Commit ae684249825932020d4ea7ce02fc072be003f113

Authored by 前端研发-钱巧玲
1 parent 3d4ebe6d

新人有礼所有提示框修改

pages/giftpack/buygiftpack/giftpackbuy.js
... ... @@ -47,7 +47,6 @@ Page({
47 47 var my_confirm = th.selectComponent("#my_confirm"); //组件的id
48 48 var order_sn = e.currentTarget.dataset.order_sn; //订单号
49 49 var money = e.currentTarget.dataset.money; //支付金额
50   -
51 50 my_confirm.open(
52 51 "是否确定购买该礼包",
53 52 "取消",
... ... @@ -57,9 +56,6 @@ Page({
57 56 },
58 57 function() {
59 58 my_confirm.open_cancel(0);
60   - wx.showLoading({
61   - title: '加载中',
62   - })
63 59 var json = {
64 60 "actId": '', //活动Id
65 61 "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销
... ... @@ -99,37 +95,7 @@ Page({
99 95 }
100 96  
101 97 )
102   - wx.request({
103   - url: url,
104   - data: data,
105   - method: 'post',
106   - header: {
107   - 'content-type': 'application/json'
108   - }, // 设置请求的 header
109   - success: function(res) {
110   - wx.hideLoading();
111   - if (res.data.code == 0) {
112   - var order_sn = res.data.data.orderSn;
113   - res = res.data.data.result;
114   - var url = "/pages/giftpack/payment/payment?money=" + money + "&order_sn=" + order_sn;
115   - wx.requestPayment({
116   - timeStamp: String(res.timeStamp),
117   - nonceStr: res.nonceStr,
118   - package: res.packageValue,
119   - signType: res.signType,
120   - paySign: res.paySign,
121   - success: function(res) {
122   - getApp().goto(url);
123   - },
124   - fail: function(res) {
125   - getApp().my_confirm("取消支付", 0, th);
126   - }
127   - });
128   - } else {
129   - getApp().my_warnning(res.data.msg, 0, th);
130   - }
131   - }
132   - })
  98 +
133 99  
134 100 }
135 101  
... ... @@ -151,9 +117,6 @@ Page({
151 117 },
152 118 function() {
153 119 my_confirm.open_cancel(0);
154   - wx.showLoading({
155   - title: '加载中',
156   - })
157 120 var json = {
158 121 "actId": '', //活动Id
159 122 "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销
... ... @@ -191,8 +154,7 @@ Page({
191 154 page: th.data.pages,
192 155 pageSize: th.data.pageSize
193 156 },
194   - success: function success(res) {
195   - wx.hideLoading();
  157 + success: function(res) {
196 158 if (res.data.code == 0) {
197 159 th.data.curpage++;
198 160 var arr1 = th.data.wareCard;
... ... @@ -236,9 +198,7 @@ Page({
236 198 var th = this;
237 199 if (th.data.total <= th.data.pageSize) return;
238 200 if (th.data.ismore) return;
239   - wx.showLoading({
240   - title: '加载中...',
241   - })
  201 +
242 202 th.getList();
243 203 },
244 204 //图片失败,默认图片
... ...
pages/giftpack/giftpacklist/giftpacklist.js
... ... @@ -61,7 +61,7 @@ Page({
61 61 },
62 62 function() {
63 63 my_confirm.open_cancel(0);
64   -
  64 +
65 65 var json = {
66 66 "actId": '', //活动Id
67 67 "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销
... ... @@ -74,36 +74,36 @@ Page({
74 74 var data = JSON.stringify(json);
75 75 var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert";
76 76  
77   - getApp().request.json_post(url,json,
78   - function(res){
79   - if (res.data.code == 0) {
80   - var res = res.data.data;
81   - var order_sn = res.orderSn;
82   - var url = "/pages/giftpack/payment/payment?money=" + money + "&order_sn=" + order_sn;
83   - wx.requestPayment({
84   - timeStamp: String(res.result.timeStamp),
85   - nonceStr: res.result.nonceStr,
86   - package: res.result.packageValue,
87   - signType: res.result.signType,
88   - paySign: res.result.paySign,
89   - success: function (n) {
90   - getApp().goto(url);
91   - },
92   - fail: function (n) {
93   - getApp().my_confirm("取消支付", 0, th);
94   - }
95   - });
96   - } else {
97   - getApp().my_warnning(res.data.msg, 0, th);
  77 + getApp().request.json_post(url, json,
  78 + function(res) {
  79 + if (res.data.code == 0) {
  80 + var res = res.data.data;
  81 + var order_sn = res.orderSn;
  82 + var url = "/pages/giftpack/payment/payment?money=" + money + "&order_sn=" + order_sn;
  83 + wx.requestPayment({
  84 + timeStamp: String(res.result.timeStamp),
  85 + nonceStr: res.result.nonceStr,
  86 + package: res.result.packageValue,
  87 + signType: res.result.signType,
  88 + paySign: res.result.paySign,
  89 + success: function(n) {
  90 + getApp().goto(url);
  91 + },
  92 + fail: function(n) {
  93 + getApp().my_confirm("取消支付", 0, th);
  94 + }
  95 + });
  96 + } else {
  97 + getApp().my_warnning(res.data.msg, 0, th);
  98 + }
  99 + },
  100 + function(res) {
  101 +
98 102 }
99   - },
100   - function(res){
101 103  
102   - }
  104 + )
103 105  
104   - )
105 106  
106   -
107 107 }
108 108  
109 109  
... ... @@ -136,18 +136,18 @@ Page({
136 136 var data = JSON.stringify(json);
137 137 var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert";
138 138 getApp().request.json_post(url, json,
139   - function (res) {
140   - if (res.data.code == 0) {
141   - getApp().my_warnning("兑换成功!", 1, th);
142   - } else {
143   - getApp().my_warnning(res.data.msg, 0, th);
144   - }
  139 + function(res) {
  140 + if (res.data.code == 0) {
  141 + getApp().my_warnning("兑换成功!", 1, th);
  142 + } else {
  143 + getApp().my_warnning(res.data.msg, 0, th);
  144 + }
145 145 },
146   - function (res) {
  146 + function(res) {
147 147  
148 148 }
149 149  
150   - )
  150 + )
151 151 })
152 152  
153 153  
... ... @@ -156,13 +156,13 @@ Page({
156 156 var _this = this;
157 157 var th = this;
158 158 getApp().request.get('/api/weshop/marketing/my/giftbag/detail/get', {
  159 + isShowLoading: true,
159 160 data: {
160 161 "storeId": a.stoid, //商家ID
161 162 "userId": d.user_id, //用户ID
162 163 "orderSn": th.data.orderSn
163 164 },
164   - success: function success(res) {
165   - wx.hideLoading();
  165 + success: function(res) {
166 166 if (res.data.code == 0) {
167 167 th.setData({
168 168 giftImage: th.data.iurl + res.data.data.lbUrl,
... ... @@ -224,6 +224,7 @@ Page({
224 224 var _this2 = this;
225 225 var th = this.data;
226 226 getApp().request.get('/api/weshop/marketing/giftbag/detail/get', {
  227 + isShowLoading: true,
227 228 data: {
228 229 "storeId": a.stoid, //商家ID
229 230 "userId": d.user_id, //用户ID
... ... @@ -278,9 +279,6 @@ Page({
278 279 //获取核销码
279 280 getcode: function() {
280 281 var th = this;
281   - wx.showLoading({
282   - title: '加载中',
283   - })
284 282 var orderSn = th.data.orderSn; //订单号
285 283 var json = {
286 284 "storeId": a.stoid,
... ... @@ -288,15 +286,8 @@ Page({
288 286 };
289 287 var data = JSON.stringify(json);
290 288 var url = th.data.url + "/api/weshop/marketing/gift/goods/verify/code/get"; //预约接口地址
291   - wx.request({
292   - url: url,
293   - data: data,
294   - method: 'put',
295   - header: {
296   - 'content-type': 'application/json'
297   - }, // 设置请求的 header
298   - success: function(res) {
299   - wx.hideLoading();
  289 + getApp().request.json_post(url, json,
  290 + function(res) {
300 291 if (res.data.code == 0) {
301 292 th.setData({
302 293 code: res.data.data
... ... @@ -305,8 +296,14 @@ Page({
305 296 } else {
306 297 getApp().my_warnning(res.data.msg, 0, th);
307 298 }
308   - }
309   - })
  299 + },
  300 + function(res) {
  301 +
  302 + },
  303 + "put"
  304 +
  305 + )
  306 +
310 307 },
311 308 //界面跳转
312 309 goto: function(e) {
... ...
pages/giftpack/giftpacklist/giftpacklist.wxml
... ... @@ -37,7 +37,7 @@
37 37 <text class="data-v-3a5b7e36">礼包内容</text>
38 38 </view>
39 39 <block wx:for="{{wareCard}}" wx:for-item="item" wx:for-index="index" wx:key="index">
40   - <view class="box_ware_box data-v-3a5b7e36">
  40 + <view wx:if="{{item.couponName!=undefined}}" class="box_ware_box data-v-3a5b7e36">
41 41 <view class="box_ware_img data-v-3a5b7e36">
42 42 <block wx:if="{{item.lbType==1}}">
43 43 <image src="{{item.wareImage==''?iurl+'/miniapp/images/giftbag/gift01.png':iurl+item.wareImage}}" class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].wareImage"></image>
... ...
pages/giftpack/mygiftpack/mygiftpack.js
... ... @@ -52,7 +52,6 @@ Page({
52 52 pageSize: th.data.pageSize
53 53 },
54 54 success: function success(res) {
55   - wx.hideLoading();
56 55 if (res.data.code == 0) {
57 56 th.data.curpage++;
58 57 var arr1 = th.data.wareCard;
... ... @@ -97,9 +96,6 @@ Page({
97 96 var th = this;
98 97 if (th.data.total <= th.data.pageSize) return;
99 98 if (th.data.ismore) return;
100   - wx.showLoading({
101   - title: '加载中...',
102   - })
103 99 th.getList();
104 100 },
105 101 //图片失败,默认图片
... ...
pages/giftpack/newvipgift/newvipgift.js
... ... @@ -33,10 +33,8 @@ Page({
33 33 GetList: function() {
34 34 var th = this;
35 35 var url = "/api/weshop/marketing/giftbag/bound/get";
36   - wx.showLoading({
37   - title: '加载中',
38   - })
39 36 getApp().request.promiseGet(url, {
  37 + isShowLoading: true,
40 38 data: {
41 39 "actId": th.data.getActId, //活动id
42 40 "actType": 1, //活动类型 1新人礼 2评价有礼 3节日营销 4生日营销
... ... @@ -45,7 +43,6 @@ Page({
45 43 "userId": d.user_id //用户ID
46 44 }
47 45 }).then(res => {
48   - wx.hideLoading();
49 46 if (res.data.code == 0) {
50 47 if (res.data.data.lbCoupons != null && res.data.data.lbCoupons.length > 0) {
51 48 //礼包内容--礼券
... ... @@ -137,9 +134,6 @@ Page({
137 134 th.setData({
138 135 is_sub: 1
139 136 })
140   - wx.showLoading({
141   - title: '加载中',
142   - })
143 137 var json = {
144 138 "actId": th.data.getActId, //活动Id
145 139 "actType": 1, //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销
... ... @@ -149,15 +143,8 @@ Page({
149 143 };
150 144 var data = JSON.stringify(json);
151 145 var url = th.data.url + "/api/weshop/marketing/free/receive/gift/record/insert";
152   - wx.request({
153   - url: url,
154   - data: data,
155   - method: 'post',
156   - header: {
157   - 'content-type': 'application/json'
158   - }, // 设置请求的 header
159   - success: function(res) {
160   - wx.hideLoading();
  146 + getApp().request.json_post(url, json,
  147 + function(res) {
161 148 th.setData({
162 149 is_sub: 0
163 150 })
... ... @@ -169,8 +156,13 @@ Page({
169 156 } else {
170 157 getApp().my_warnning(res.data.msg, 0, th);
171 158 }
172   - }
173   - })
  159 + },
  160 + function(res) {
  161 +
  162 + }, "post"
  163 +
  164 + )
  165 +
174 166 }
175 167 },
176 168 //界面跳转
... ...