Commit f9e20cc2db353b3e1f4519847c4612e2f738d1a6

Authored by 前端研发-钱巧玲
1 parent 774042f5

我的礼包添加提示

pages/giftpack/buygiftpack/giftpackbuy.js
... ... @@ -37,7 +37,7 @@ Page({
37 37 th.getList();
38 38 },
39 39 onShow: function() {
40   -
  40 +
41 41 },
42 42  
43 43 GetBuyPrice: function(e) {
... ... @@ -57,6 +57,9 @@ Page({
57 57 },
58 58 function() {
59 59 my_confirm.open_cancel(0);
  60 + wx.showLoading({
  61 + title: '加载中',
  62 + })
60 63 var json = {
61 64 "actId": '', //活动Id
62 65 "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销
... ... @@ -76,6 +79,7 @@ Page({
76 79 'content-type': 'application/json'
77 80 }, // 设置请求的 header
78 81 success: function(res) {
  82 + wx.hideLoading();
79 83 if (res.data.code == 0) {
80 84 var order_sn = res.data.data.orderSn;
81 85 res = res.data.data.result;
... ... @@ -89,7 +93,9 @@ Page({
89 93 success: function(res) {
90 94 getApp().goto(url);
91 95 },
92   - fail: function(res) {}
  96 + fail: function(res) {
  97 + getApp().my_confirm("取消支付", 0, th);
  98 + }
93 99 });
94 100 } else {
95 101 getApp().my_warnning(res.data.msg, 0, th);
... ... @@ -99,7 +105,6 @@ Page({
99 105  
100 106 }
101 107  
102   -
103 108 )
104 109  
105 110  
... ... @@ -118,6 +123,9 @@ Page({
118 123 },
119 124 function() {
120 125 my_confirm.open_cancel(0);
  126 + wx.showLoading({
  127 + title: '加载中',
  128 + })
121 129 var json = {
122 130 "actId": '', //活动Id
123 131 "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销
... ... @@ -136,6 +144,7 @@ Page({
136 144 'content-type': 'application/json'
137 145 }, // 设置请求的 header
138 146 success: function(res) {
  147 + wx.hideLoading();
139 148 if (res.data.code == 0) {
140 149 getApp().my_warnning("兑换成功!", 1, th);
141 150 } else {
... ... @@ -197,7 +206,7 @@ Page({
197 206 var th = this;
198 207 var url = e.currentTarget.dataset.url;
199 208 getApp().goto(url);
200   -
  209 +
201 210 },
202 211 //下拉事件
203 212 onReachBottom: function() {
... ...
pages/giftpack/giftpacklist/giftpacklist.js
... ... @@ -61,6 +61,9 @@ Page({
61 61 },
62 62 function() {
63 63 my_confirm.open_cancel(0);
  64 + wx.showLoading({
  65 + title: '加载中',
  66 + })
64 67 var json = {
65 68 "actId": '', //活动Id
66 69 "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销
... ... @@ -80,6 +83,7 @@ Page({
80 83 'content-type': 'application/json'
81 84 }, // 设置请求的 header
82 85 success: function(res) {
  86 + wx.hideLoading();
83 87 if (res.data.code == 0) {
84 88 var res = res.data.data;
85 89 var order_sn = res.orderSn;
... ... @@ -124,6 +128,9 @@ Page({
124 128 },
125 129 function() {
126 130 my_confirm.open_cancel(0);
  131 + wx.showLoading({
  132 + title: '加载中',
  133 + })
127 134 var json = {
128 135 "actId": '', //活动Id
129 136 "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销
... ... @@ -142,6 +149,7 @@ Page({
142 149 'content-type': 'application/json'
143 150 }, // 设置请求的 header
144 151 success: function(res) {
  152 + wx.hideLoading();
145 153 if (res.data.code == 0) {
146 154 getApp().my_warnning("兑换成功!", 1, th);
147 155 } else {
... ... @@ -157,6 +165,9 @@ Page({
157 165 GetMyGiftList: function() {
158 166 var _this = this;
159 167 var th = this;
  168 + wx.showLoading({
  169 + title: '加载中',
  170 + })
160 171 getApp().request.get('/api/weshop/marketing/my/giftbag/detail/get', {
161 172 data: {
162 173 "storeId": a.stoid, //商家ID
... ... @@ -164,6 +175,7 @@ Page({
164 175 "orderSn": th.data.orderSn
165 176 },
166 177 success: function success(res) {
  178 + wx.hideLoading();
167 179 if (res.data.code == 0) {
168 180 th.setData({
169 181 giftImage: th.data.iurl + res.data.data.lbUrl,
... ... @@ -279,6 +291,9 @@ Page({
279 291 //获取核销码
280 292 getcode: function() {
281 293 var th = this;
  294 + wx.showLoading({
  295 + title: '加载中',
  296 + })
282 297 var orderSn = th.data.orderSn; //订单号
283 298 var json = {
284 299 "storeId": a.stoid,
... ... @@ -294,6 +309,7 @@ Page({
294 309 'content-type': 'application/json'
295 310 }, // 设置请求的 header
296 311 success: function(res) {
  312 + wx.hideLoading();
297 313 if (res.data.code == 0) {
298 314 th.setData({
299 315 code: res.data.data
... ...
pages/giftpack/mygiftpack/mygiftpack.js
... ... @@ -28,8 +28,6 @@ Page({
28 28 },
29 29  
30 30 onLoad: function(options) {
31   - // this.getStorageID = options.stoid;
32   - // this.getUserID = options.userid;
33 31 var th = this;
34 32 th.setData({
35 33 getStorageID: a.stoid,
... ... @@ -40,49 +38,15 @@ Page({
40 38 th.getList();
41 39 },
42 40 onShow: function() {
43   - // this.pages = 1;
44   - // this.pageSize = 10;
45   - // this.loadingType = 0;
46   - // this.getList();
47   - // var th = this;
48   - // th.setData({
49   - // pages: 1,
50   - // pageSize: 10,
51   - // loadingType: 0
52   - // })
53   - // th.getList();
54   - },
55   - // methods: {
56   - // BuyGift: function BuyGift() {
57   - // /*销毁跳转*/
58   - // uni.reLaunch({
59   - // url: 'pages/giftpack/buygiftpack/giftpackbuy?stoid=' + this.getStorageID + '&userid=' + this.getUserID
60   - // });
61   -
62   - // },
63   - // GetGiftPackList: function(getId, ojb) {
64   - // //不销毁调整
65   - // uni.navigateTo({
66   - // url: 'pages/giftpack/giftpacklist/giftpacklist?isBuy=0&stoid=' + this.getStorageID + '&userid=' + this.getUserID + '&id=' +
67   - // getId
68   - // });
69 41  
70   - // },
  42 + },
71 43 getList: function() {
72 44 var th = this;
73   - // if (th.data.loadingType) {
74   - // return false;
75   - // }
76   - // // that.loadingType = 1;
77   - // th.setData({
78   - // loadingType: 1
79   - // })
  45 + wx.showLoading({
  46 + title: '加载中',
  47 + })
80 48 getApp().request.get('/api/weshop/marketing/my/giftbag/page', {
81 49 data: {
82   - // "storeId": this.getStorageID, //商家ID
83   - // "userId": this.getUserID, //用户ID
84   - // "page": this.pages,
85   - // "pageSize": this.pageSize
86 50 storeId: th.data.getStorageID, //商家ID
87 51 userId: th.data.getUserID, //用户ID
88 52 page: th.data.curpage,
... ... @@ -108,47 +72,7 @@ Page({
108 72 is_read: 1
109 73 })
110 74 }
111   - // if (res.data.code == 0) {
112   - // if (res.data.data.total > 0) {
113   - // // _this.isEmpty = false;
114   - // _this.setData({
115   - // isEmpty: false
116   - // })
117   - // } else {
118   - // // _this.isEmpty = true;
119   - // _this.setData({
120   - // isEmpty: true
121   - // })
122   - // }
123   - // if (res.data.data.pageData.length == 0) {
124   - // // _this.loadingType = 2;
125   - // _this.setData({
126   - // loadingType: 2
127   - // })
128   - // } else {
129   - // var wareCard = that.wareCard;
130   - // var is_resad = 0;
131   - // // if (_this.wareCard.length < res.data.data.pageData.length) {
132   - // if (wareCard.length < res.data.data.total) {
133   - // for (var i = 0; i < res.data.data.pageData.length; i++) {
134   - // wareCard.push(res.data.data.pageData[i]);
135   - // }
136   - // }else{
137   - // is_resad=1
138   - // }
139   - // _this.setData({
140   - // wareCard: wareCard,
141   - // is_resad: is_resad
142   - // })
143   -
144   - // // _this.loadingType = 0;
145   - // _this.setData({
146   - // loadingType: 0
147   - // })
148   - // }
149   - // } else {
150   -
151   - // }
  75 +
152 76 }
153 77  
154 78 });
... ...