Commit 29cd3ff87a53822a4fdafe3517e5a78e059eb154

Authored by iceling
1 parent e6ce6666

我的礼包优化

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