From 29cd3ff87a53822a4fdafe3517e5a78e059eb154 Mon Sep 17 00:00:00 2001 From: iceling Date: Sat, 18 Jan 2020 14:27:30 +0800 Subject: [PATCH] 我的礼包优化 --- pages/giftpack/buygiftpack/giftpackbuy.js | 3 ++- pages/giftpack/mygiftpack/mygiftpack.js | 27 ++++++++++++++------------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/pages/giftpack/buygiftpack/giftpackbuy.js b/pages/giftpack/buygiftpack/giftpackbuy.js index c4c77da..045eff7 100644 --- a/pages/giftpack/buygiftpack/giftpackbuy.js +++ b/pages/giftpack/buygiftpack/giftpackbuy.js @@ -170,7 +170,8 @@ Page({ }), wx.stopPullDownRefresh(); //停止下拉刷新 } else { th.setData({ - is_read: 1 + is_read: 1, + ismore:1 }) } } diff --git a/pages/giftpack/mygiftpack/mygiftpack.js b/pages/giftpack/mygiftpack/mygiftpack.js index 6708adf..4944146 100644 --- a/pages/giftpack/mygiftpack/mygiftpack.js +++ b/pages/giftpack/mygiftpack/mygiftpack.js @@ -20,8 +20,8 @@ Page({ contentrefresh: '加载中...', contentnomore: '已加载全部' }, - ismore:0,//数据是否全部加载完成 - is_read:0,//是否查询过我的礼包接口 + ismore: 0, //数据是否全部加载完成 + is_read: 0, //是否查询过我的礼包接口 curpage: 1, //当前分页数 pageSize: 10, //页大小 total: 0, //总数量 @@ -42,16 +42,16 @@ Page({ }, getList: function() { var th = this; - + getApp().request.get('/api/weshop/marketing/my/giftbag/page', { - isShowLoading:true, + isShowLoading: true, data: { storeId: th.data.getStorageID, //商家ID userId: th.data.getUserID, //用户ID page: th.data.curpage, pageSize: th.data.pageSize }, - success: function success(res) { + success: function(res) { if (res.data.code == 0) { th.data.curpage++; var arr1 = th.data.wareCard; @@ -63,21 +63,22 @@ Page({ wareCard: arr3, total: res.data.data.total, ismore: ismore, - is_read:1 + is_read: 1 }), wx.stopPullDownRefresh(); //停止下拉刷新 } else { th.setData({ - is_read: 1 + is_read: 1, + ismore:1 }) } - + } - + }); }, //销毁界面跳转 - redirectTo: function (e) { + redirectTo: function(e) { var th = this; var url = e.currentTarget.dataset.url; //销毁跳转 @@ -86,20 +87,20 @@ Page({ }); }, //不销毁界面跳转 - navigateTo: function (e) { + navigateTo: function(e) { var th = this; var url = e.currentTarget.dataset.url; getApp().goto(url); }, //下拉事件 - onReachBottom: function () { + onReachBottom: function() { var th = this; if (th.data.total <= th.data.pageSize) return; if (th.data.ismore) return; th.getList(); }, //图片失败,默认图片 - bind_bnerr2: function (e) { + bind_bnerr2: function(e) { var _errImg = e.target.dataset.errorimg; var _errObj = {}; _errObj[_errImg] = "/public/images/empty.jpg"; -- libgit2 0.21.4