diff --git a/components/goods_list/goods_list.js b/components/goods_list/goods_list.js index e69de29..1bbfb29 100644 --- a/components/goods_list/goods_list.js +++ b/components/goods_list/goods_list.js @@ -0,0 +1,84 @@ +// pages/user/yhq/qr_code/qr_code.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属性,属性值可以在组件使用时指定 + }, + ready: function () { + }, + + + methods: { + + get_list:function(){ + + var that = this; + if(that.data.is_no_more==0) return false; + + + 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:6, + }, + success: function (res){ + var data=res.data; + var total=data.data.total; + if (total <= curPage*6){ + that.setData({ is_no_more: 0 }); + }else{ + that.data.curPage++; + } + + + //加载完成 + if (data.data.pageData) { + that.setData({load_complete:1}); + } + if(that.data.recommend!=null){ + var ra=that.data.recommend.concat(data.data.pageData); + that.setData({ recommend: ra }); + }else{ + 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; + }, + + + }, + + + + + +}) \ No newline at end of file diff --git a/pages/user/add_comment/add_comment.wxml b/pages/user/add_comment/add_comment.wxml index 083ac03..50641e7 100644 --- a/pages/user/add_comment/add_comment.wxml +++ b/pages/user/add_comment/add_comment.wxml @@ -86,7 +86,7 @@ - + @@ -95,7 +95,7 @@ - + 添加图片 {{imgs.length>0?imgs.length:0}}/3 diff --git a/pages/user/collect_list/collect_list.js b/pages/user/collect_list/collect_list.js index 4e5ec32..61b7b0f 100644 --- a/pages/user/collect_list/collect_list.js +++ b/pages/user/collect_list/collect_list.js @@ -17,15 +17,15 @@ Page({ collects: null, currentPage: 1, curpage: 1, - collects_Recommend: [], + ismore: 0, iscollects: 0, - loadName: null, + editEd: 0, //商品编辑按钮是否点击 isall: false, //是否全选 sum: 0, total_collects:0, - total_goods:0, + is_goods:0, pageSize:8,//分页数量 }, onLoad: function() { @@ -34,31 +34,34 @@ Page({ // this.requestList(); }, requestCollectList: function() { - isShowLoading: 0; var th = this; e = "/api/weshop/goodscollect/list?" + "pageSize=" + th.data.pageSize +"&user_id=" + app_d.user_id + "&store_id=" + oo.stoid + "&page=" + th.data.currentPage; o.request(e, function(e) { th.data.currentPage++; - - if(th.data.total_collects) + if(th.data.total_collects==0){ th.setData({ iscollects: 1, total_collects:e.data.data.total}) - - if (th.data.total_collects - 共{{collects.length}}件商品 + 共{{total_collects}}件商品 {{editEd?'完成':'编辑'}} @@ -49,7 +49,7 @@ - + @@ -75,10 +75,10 @@ - + 找相似 - + @@ -89,95 +89,23 @@ - - - - - - - - - + + + + + 好物推荐 - - - - - - - - - - - - - {{item.goods_name}} - - - - - - {{item.shop_price}} - - - - - {{item.market_price}} - - - - - - - - - {{loadName}} - - - - - - 没有更多内容了 - - - - - - - + + + + - - + @@ -195,8 +123,6 @@ 删除 - - - \ No newline at end of file +