Commit 29cd3ff87a53822a4fdafe3517e5a78e059eb154
1 parent
e6ce6666
我的礼包优化
Showing
2 changed files
with
16 additions
and
14 deletions
pages/giftpack/buygiftpack/giftpackbuy.js
pages/giftpack/mygiftpack/mygiftpack.js
... | ... | @@ -20,8 +20,8 @@ Page({ |
20 | 20 | contentrefresh: '加载中...', |
21 | 21 | contentnomore: '已加载全部' |
22 | 22 | }, |
23 | - ismore:0,//数据是否全部加载完成 | |
24 | - is_read:0,//是否查询过我的礼包接口 | |
23 | + ismore: 0, //数据是否全部加载完成 | |
24 | + is_read: 0, //是否查询过我的礼包接口 | |
25 | 25 | curpage: 1, //当前分页数 |
26 | 26 | pageSize: 10, //页大小 |
27 | 27 | total: 0, //总数量 |
... | ... | @@ -42,16 +42,16 @@ Page({ |
42 | 42 | }, |
43 | 43 | getList: function() { |
44 | 44 | var th = this; |
45 | - | |
45 | + | |
46 | 46 | getApp().request.get('/api/weshop/marketing/my/giftbag/page', { |
47 | - isShowLoading:true, | |
47 | + isShowLoading: true, | |
48 | 48 | data: { |
49 | 49 | storeId: th.data.getStorageID, //商家ID |
50 | 50 | userId: th.data.getUserID, //用户ID |
51 | 51 | page: th.data.curpage, |
52 | 52 | pageSize: th.data.pageSize |
53 | 53 | }, |
54 | - success: function success(res) { | |
54 | + success: function(res) { | |
55 | 55 | if (res.data.code == 0) { |
56 | 56 | th.data.curpage++; |
57 | 57 | var arr1 = th.data.wareCard; |
... | ... | @@ -63,21 +63,22 @@ Page({ |
63 | 63 | wareCard: arr3, |
64 | 64 | total: res.data.data.total, |
65 | 65 | ismore: ismore, |
66 | - is_read:1 | |
66 | + is_read: 1 | |
67 | 67 | }), wx.stopPullDownRefresh(); //停止下拉刷新 |
68 | 68 | } else { |
69 | 69 | th.setData({ |
70 | - is_read: 1 | |
70 | + is_read: 1, | |
71 | + ismore:1 | |
71 | 72 | }) |
72 | 73 | } |
73 | - | |
74 | + | |
74 | 75 | } |
75 | - | |
76 | + | |
76 | 77 | }); |
77 | 78 | |
78 | 79 | }, |
79 | 80 | //销毁界面跳转 |
80 | - redirectTo: function (e) { | |
81 | + redirectTo: function(e) { | |
81 | 82 | var th = this; |
82 | 83 | var url = e.currentTarget.dataset.url; |
83 | 84 | //销毁跳转 |
... | ... | @@ -86,20 +87,20 @@ Page({ |
86 | 87 | }); |
87 | 88 | }, |
88 | 89 | //不销毁界面跳转 |
89 | - navigateTo: function (e) { | |
90 | + navigateTo: function(e) { | |
90 | 91 | var th = this; |
91 | 92 | var url = e.currentTarget.dataset.url; |
92 | 93 | getApp().goto(url); |
93 | 94 | }, |
94 | 95 | //下拉事件 |
95 | - onReachBottom: function () { | |
96 | + onReachBottom: function() { | |
96 | 97 | var th = this; |
97 | 98 | if (th.data.total <= th.data.pageSize) return; |
98 | 99 | if (th.data.ismore) return; |
99 | 100 | th.getList(); |
100 | 101 | }, |
101 | 102 | //图片失败,默认图片 |
102 | - bind_bnerr2: function (e) { | |
103 | + bind_bnerr2: function(e) { | |
103 | 104 | var _errImg = e.target.dataset.errorimg; |
104 | 105 | var _errObj = {}; |
105 | 106 | _errObj[_errImg] = "/public/images/empty.jpg"; | ... | ... |