diff --git a/components/goods_list/goods_list.js b/components/goods_list/goods_list.js
index 43ffdd3..549d54c 100644
--- a/components/goods_list/goods_list.js
+++ b/components/goods_list/goods_list.js
@@ -1,12 +1,18 @@
// pages/user/yhq/qr_code/qr_code.js
-const {
- barcode,
- qrcode
-} = require('../../utils/index.js')
+
+
+var
+ t = getApp(), a = t.request, o = t.globalData.setting, os = o,
+ i = require("../../utils/util.js"), ut = i, s = require("../../utils/common.js");
+
Component({
data: {
+ url: o.imghost,
object: null,
+ curPage:1,
+ is_no_more:1,//加载完所有数据的控制器
+ load_complete:0//加载完成
},
properties: {
// 这里定义了innerText属性,属性值可以在组件使用时指定
@@ -14,14 +20,55 @@ Component({
ready: function () {
},
+
methods: {
+
+ get_list:function(){
+
+ var that = this;
+ var curPage = that.data.curPage;
+ getApp().request.get('/api/weshop/goods/page?page',{
+ data: { is_mainshow: 1, isonsale: 1,
+ is_recommend: 1, is_on_sale: 1,
+ store_id: o.stoid,
+ page: curPage,
+ pageSize:10,
+ },
+ success: function (res){
+
+ that.data.curPage++;
+ var data=res.data;
+ if (res.data.data.pageData.length==0){
+ that.setData({is_no_more:0});
+ t.showWarning("加载完啦", null, 500, !1)
+ return false;
+ }
+ //加载完成
+ if (data.data.pageData) {
+ that.setData({load_complete:1});
+ }
+ that.setData({recommend:data.data.pageData});
+ }
+ })
+ },
+ bind_bnerr_xc: function (e) {
+ var _errImg = e.target.dataset.errorimg;
+ var _errurl = e.target.dataset.url;
+
+ var _errObj = {};
+ _errObj[_errImg] = "/miniapp/images/default_g_img.gif";
+ this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
+
+ },
+ reset:function(){
+ curPage=1;
+ },
+
+
},
- //打开
- onshow: function (e) {
-
- }
+
diff --git a/components/goods_list/goods_list.json b/components/goods_list/goods_list.json
index a74b8d1..7e37c03 100644
--- a/components/goods_list/goods_list.json
+++ b/components/goods_list/goods_list.json
@@ -1,4 +1,4 @@
{
"component": true,
- "usingComponents": {}
+ "usingComponents": {}
}
\ No newline at end of file
diff --git a/components/goods_list/goods_list.wxml b/components/goods_list/goods_list.wxml
index 8eb9a4c..3a548a1 100644
--- a/components/goods_list/goods_list.wxml
+++ b/components/goods_list/goods_list.wxml
@@ -5,7 +5,7 @@
-
+
{{item.goods_name}}
@@ -21,17 +21,11 @@
¥
{{item.market_price}}
-
-
-
-
-
-
-
+
没有更多内容了
diff --git a/components/goods_list/goods_list.wxss b/components/goods_list/goods_list.wxss
index 4434e22..70b2a4e 100644
--- a/components/goods_list/goods_list.wxss
+++ b/components/goods_list/goods_list.wxss
@@ -1,7 +1,45 @@
.collects {
margin-top: 40rpx;
}
+.ib{
+ display: inline-block;
+}
+.fs24{
+ font-size: 24rpx;
+}
+.flex-center{
+display:flex;
+justify-content:center;
+align-items:center;
+}
+.xc-wc{
+ color: #d60021;
+}
+.fs22{
+ font-size: 22rpx;
+}
+.xc-ash{
+color: #b9b9b9;
+}
+.choice_box .choice_list .choice_footer .price {
+ color: #f23030; height: 10px
+}
+.fs35{
+ font-size:35rpx;
+}
+.flex{display: flex}
+.ellipsis-2 {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ -webkit-line-clamp: 2;
+}
+.goods_name{
+ height: 70rpx;
+ margin-top: 6rpx;
+}
.hang {
width: 100%;
margin: auto;
diff --git a/pages/index/index/index.js b/pages/index/index/index.js
index deef4cc..47ebab3 100644
--- a/pages/index/index/index.js
+++ b/pages/index/index/index.js
@@ -59,7 +59,7 @@ Page({
onLoad: function () {
var th = this;
- n.init(th, "", "recommend");
+ // n.init(th, "", "recommend");
//看一下商家是否开通了权益
//--初始化是否有打勾--
@@ -72,8 +72,14 @@ Page({
}
})
+
+
},
async onShow() {
+
+
+
+
var th=this;
await this.init_load();
//显示的时候要开启计时器
@@ -288,13 +294,14 @@ Page({
}
})
//---调用信息---
- this.requestRecommend();
+ // this.requestRecommend();
this.setData({ishow:1});
//---先获取会员---
t.getUserFir(function () {
});
-
+ var goods_list = this.selectComponent("#goods_list"); //组件的id
+ goods_list.get_list();
},
//--判断小程序是否过期--
@@ -312,23 +319,13 @@ Page({
},
//---加载更多是靠这个函数----
onReachBottom: function () {
- //if (!n.canloadMore()) this.setData({ is_no_more:1});
- var n1 = n.data.goodsLoadFinishFlag
- if (n1) {
- this.setData({ is_no_more: 1 }); return false;
- }
- n.canloadMore() && this.requestRecommend();
-
+
+ var goods_list = this.selectComponent("#goods_list"); //组件的id
+ goods_list.get_list();
+
},
- //--更多商品--
- requestRecommend: function () {
- var e = this, t = '/api/weshop/goods/page?page=' + e.data.currentPage;
- n.request(t, function () {
- e.data.currentPage++;
- }
- , null, { is_mainshow: 1, isonsale: 1, is_recommend:1, is_on_sale: 1, store_id: o.stoid, pageSize: 10 });
- },
+
onPullDownRefresh: function (e) {
this.data.recommend = null, this.data.currentPage = 1, n.resetConfig(), this.requestHomePage(),
@@ -393,12 +390,12 @@ Page({
bind_bnerr2: function (e) {
var _errImg = e.target.dataset.errorimg;
var _errurl = e.target.dataset.url;
- var ii = _errurl.indexOf(o.imghost);
- if (ii != -1) {
- var _errObj = {};
- _errObj[_errImg] = this.data.url + "/miniapp/images/default_g_img.gif";
- this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
- }
+ //var ii = _errurl.indexOf(o.imghost);
+ // if (ii != -1) {
+ // var _errObj = {};
+ // _errObj[_errImg] = this.data.url + "/miniapp/images/default_g_img.gif";
+ // this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
+ // }
},
//图片失败,默认图片
bind_bnerr3: function (e) {
diff --git a/pages/index/index/index.json b/pages/index/index/index.json
index 292c095..4fc1363 100644
--- a/pages/index/index/index.json
+++ b/pages/index/index/index.json
@@ -2,9 +2,9 @@
"navigationBarBackgroundColor": "#ff7295",
"navigationBarTextStyle": "white",
"usingComponents": {
- "goods_list":"/components/goods_list/goods_list",
+ "goods_recommend":"/components/goods_list/goods_list",
"nav": "/components/diy_nav/diy_nav",
- "advertising":"/components/diy_advertising/diy_advertising",
+ "advertising":"/components/diy_advertising/diy_advertising",
"groupbuy": "/components/diy_groupbuy/diy_groupbuy",
"goodsGroup": "/components/diy_goodsGroup/diy_goodsGroup",
"seckill": "/components/diy_seckill/diy_seckill",
diff --git a/pages/index/index/index.wxml b/pages/index/index/index.wxml
index ce01948..363a493 100644
--- a/pages/index/index/index.wxml
+++ b/pages/index/index/index.wxml
@@ -140,12 +140,7 @@
-
-
-
-
-
-
+
@@ -237,15 +232,7 @@
-
+
@@ -256,93 +243,7 @@
-
-
-
-
-
-
-
-
-
-
-
+
@@ -376,44 +277,10 @@
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
diff --git a/utils/LoadMore.js b/utils/LoadMore.js
index 2094bc8..3653473 100644
--- a/utils/LoadMore.js
+++ b/utils/LoadMore.js
@@ -110,13 +110,13 @@ var e = function() {
//没有活动,就不用调用接口
if (glist==""){
- c.setData(a({}, l, g));
+ //c.setData(a({}, l, g));
if ("function" == typeof e && (n = e(t)), !1 === n) return !1;
i && 0 != i.length || (s.data.goodsLoadFinishFlag = !0, u && o.showWarning("加载完啦", null, 500, !1));
return false;
}
- c.setData(a({}, l, g));
+ // c.setData(a({}, l, g));
if ("function" == typeof e && (n = e(t)), !1 === n) return !1;
i && 0 != i.length || (s.data.goodsLoadFinishFlag = !0, u && o.showWarning("加载完啦", null, 500, !1));
diff --git a/utils/filter.wxs b/utils/filter.wxs
index 76c6b60..b652f86 100644
--- a/utils/filter.wxs
+++ b/utils/filter.wxs
@@ -1,6 +1,5 @@
var filters = {
toFix:function(val,count){
- console.log("你是说明书上 没什么 ");
return val.toFixed(count)
},
replace_time:function(val){