Commit c0102fd8cb43c2635eb6ba67ecb4af74b2786a19
Merge branch 'dev' of http://git.vipzhuang.cn/wxd/MShopWeApp into dev
Showing
30 changed files
with
1050 additions
and
427 deletions
images/dpr.png
0 → 100644
21.7 KB
images/nothingaddress.png
0 → 100644
17.8 KB
images/share/miao_share.png
0 → 100644
14 KB
pages/cart/cart2/cart2.js
... | ... | @@ -72,6 +72,8 @@ Page({ |
72 | 72 | selected_quan_list:null, |
73 | 73 | //选择的券的门店 |
74 | 74 | selected_quan_pick:null, |
75 | + is_close_quan:0, | |
76 | + disabled:0, | |
75 | 77 | |
76 | 78 | }, |
77 | 79 | onLoad: function(t) { |
... | ... | @@ -79,11 +81,65 @@ Page({ |
79 | 81 | wx.setNavigationBarTitle({ title: "填写订单",}) |
80 | 82 | var th = this; this.setData({ is_b_now: t.is_bnow == undefined ? 0 : t.is_bnow,}); |
81 | 83 | th.data.param=t; |
82 | - //-----先获取物流,再获取用户信息,再展示页面----- | |
83 | - th.get_wuliu(th.get_info(th.show_page)); | |
84 | - | |
84 | + | |
85 | + //清空is_pick_up | |
86 | + getApp().request.put("/api/weshop/useraddress/updatePickUp", { | |
87 | + data: {user_id: getApp().globalData.user_id, is_pickup: 0}, | |
88 | + success: function (s) { | |
89 | + } | |
90 | + }); | |
91 | + | |
92 | + //先获取是否有关闭使用优惠券 | |
93 | + getApp().getConfig2(function (ee) { | |
94 | + var json_d = JSON.parse(ee.switch_list); | |
95 | + th.setData({ is_close_quan: json_d.is_close_quan }); | |
96 | + //-----先获取物流,再获取用户信息,再展示页面----- | |
97 | + th.get_wuliu(th.get_info(th.show_page)); | |
98 | + }) | |
85 | 99 | }, |
86 | 100 | onUnload: function () { this.setData({ isclose: 1 })}, |
101 | + | |
102 | + //----------子页返回父页触发---------- | |
103 | + onShow: function() { | |
104 | + console.log('onshow'); | |
105 | + var th=this; | |
106 | + console.log(th.data.isclose); | |
107 | + if (th.data.isclose==0){ | |
108 | + /*--- | |
109 | + wx.navigateTo({ | |
110 | + url: "/pages/user/index/index" | |
111 | + //url: "/pages/index/index/index" | |
112 | + })---*/ | |
113 | + wx.switchTab({ | |
114 | + url: "/pages/index/index/index" | |
115 | + }) | |
116 | + | |
117 | + }else{ | |
118 | + this.getuser_addr(function(ie){ | |
119 | + | |
120 | + console.log("getuser_addr") | |
121 | + console.log(ie) | |
122 | + | |
123 | + th.setData({user_addr: ie }); | |
124 | + var going=0; | |
125 | + | |
126 | + //使用计算器,避免空现象 | |
127 | + var jishi= setInterval(function () { | |
128 | + if (th.data.is_b_now == 1 && going==0) { | |
129 | + if(th.data.bn_goods) { | |
130 | + th.calculatePrice2();going=1;clearInterval(jishi); | |
131 | + } | |
132 | + }else if(going==0) { | |
133 | + if (th.data.cartlist){ | |
134 | + th.calculatePrice();going = 1; clearInterval(jishi); | |
135 | + } | |
136 | + } | |
137 | + },500) | |
138 | + | |
139 | + }); | |
140 | + } | |
141 | + }, | |
142 | + | |
87 | 143 | //-------------------获取物流--------------- |
88 | 144 | get_wuliu(func) { |
89 | 145 | var th = this; |
... | ... | @@ -112,10 +168,15 @@ Page({ |
112 | 168 | ];---*/ |
113 | 169 | var user_addr = su.data.data.pageData; |
114 | 170 | var item = null; |
171 | + var def_item=null; | |
115 | 172 | for (var i = 0; i < user_addr.length; i++) { |
116 | - if (user_addr[i]['is_default'] == 1) { item = user_addr[i]; break; } | |
173 | + if (user_addr[i]['is_default'] == 1) { def_item = user_addr[i];} | |
174 | + if (user_addr[i]['is_pickup'] == 1) { item = user_addr[i]; } | |
117 | 175 | } |
176 | + | |
177 | + if (item == null) item = def_item; | |
118 | 178 | if (item == null) item = user_addr[0]; |
179 | + | |
119 | 180 | if(item==undefined) item=null; |
120 | 181 | func(item); |
121 | 182 | } |
... | ... | @@ -260,14 +321,30 @@ Page({ |
260 | 321 | arr[ind].check_quan_ware_list=check_quan_ware_list; |
261 | 322 | arr[ind].check_quan_price_list=check_quan_price_list; |
262 | 323 | |
263 | - //调用接口,获取优惠券的列表 | |
264 | - var url="/api/weshop/couponList/getUseCouponList"; | |
265 | - await app.request.promiseGet(url,{ | |
266 | - data:{storeId:oo.stoid,userId:app.globalData.user_id,BuySum:ckeck_quan_price,WareIds:check_quan_ware_list,pageSize:100} | |
267 | - }).then(res=>{ | |
268 | - if(res.data.code==0) | |
269 | - arr[ind].quan_list=res.data.data.pageData; | |
270 | - }) | |
324 | + //是否关闭使用优惠券 | |
325 | + if (th.data.is_close_quan != 1) { | |
326 | + //调用接口,获取优惠券的列表 | |
327 | + var url="/api/weshop/couponList/getUseCouponList"; | |
328 | + await app.request.promiseGet(url,{ | |
329 | + data:{storeId:oo.stoid,userId:app.globalData.user_id,BuySum:ckeck_quan_price,WareIds:check_quan_ware_list,pageSize:100} | |
330 | + }).then(res=>{ | |
331 | + if(res.data.code==0) | |
332 | + arr[ind].quan_list=res.data.data.pageData; | |
333 | + }) | |
334 | + | |
335 | + var frozenQuan=null; | |
336 | + var url0="/api/weshop/users/frozenQuan/listFrozenQuan/"+app.globalData.user_id; | |
337 | + await app.request.promiseGet(url0,{1:1}).then(res=>{ | |
338 | + if(res.data.code==0){ | |
339 | + frozenQuan=res.data.data; | |
340 | + } | |
341 | + }) | |
342 | + | |
343 | + if(frozenQuan){ | |
344 | + arr[ind].quan_list=th.check_is_frozenQuan(arr[ind].quan_list,frozenQuan); | |
345 | + } | |
346 | + | |
347 | + } | |
271 | 348 | } |
272 | 349 | |
273 | 350 | th.setData({ |
... | ... | @@ -314,14 +391,29 @@ Page({ |
314 | 391 | th.data.check_quan_ware_list=t.data.data.erpwareid+""; |
315 | 392 | |
316 | 393 | var quanlist=null; |
317 | - var url="/api/weshop/couponList/getUseCouponList"; | |
318 | - await app.request.promiseGet(url,{ | |
319 | - data:{storeId:oo.stoid,userId:app.globalData.user_id,BuySum:th.data.ckeck_quan_price,WareIds:th.data.check_quan_ware_list,pageSize:100} | |
320 | - }).then(res=>{ | |
321 | - if(res.data.code==0) | |
322 | - quanlist=res.data.data.pageData; | |
394 | + | |
395 | + if (th.data.is_close_quan != 1) { | |
396 | + var url="/api/weshop/couponList/getUseCouponList"; | |
397 | + await app.request.promiseGet(url,{ | |
398 | + data:{storeId:oo.stoid,userId:app.globalData.user_id,BuySum:th.data.ckeck_quan_price,WareIds:th.data.check_quan_ware_list,pageSize:100} | |
399 | + }).then(res=>{ | |
400 | + if(res.data.code==0) | |
401 | + quanlist=res.data.data.pageData; | |
402 | + }) | |
403 | + } | |
404 | + | |
405 | + var frozenQuan=null; | |
406 | + var url0="/api/weshop/users/frozenQuan/listFrozenQuan/"+app.globalData.user_id; | |
407 | + await app.request.promiseGet(url0,{1:1}).then(res=>{ | |
408 | + if(res.data.code==0){ | |
409 | + frozenQuan=res.data.data; | |
410 | + } | |
323 | 411 | }) |
324 | 412 | |
413 | + if(frozenQuan){ | |
414 | + quanlist=th.check_is_frozenQuan(quanlist,frozenQuan); | |
415 | + } | |
416 | + | |
325 | 417 | t.data.data.prom_id = 0; |
326 | 418 | t.data.data.prom_type = 0; |
327 | 419 | |
... | ... | @@ -347,13 +439,28 @@ Page({ |
347 | 439 | th.data.check_quan_price_list=t.data.data.shop_price*gg.goods_num+""; |
348 | 440 | th.data.check_quan_ware_list=t.data.data.erpwareid+""; |
349 | 441 | |
350 | - var url="/api/weshop/couponList/getUseCouponList"; | |
351 | - await app.request.promiseGet(url,{ | |
352 | - data:{storeId:oo.stoid,userId:app.globalData.user_id,BuySum:th.data.ckeck_quan_price,WareIds:th.data.check_quan_ware_list,pageSize:100} | |
353 | - }).then(res=>{ | |
354 | - if(res.data.code==0) | |
355 | - quanlist=res.data.data.pageData; | |
356 | - }) | |
442 | + if (th.data.is_close_quan != 1) { | |
443 | + | |
444 | + var url="/api/weshop/couponList/getUseCouponList"; | |
445 | + await app.request.promiseGet(url,{ | |
446 | + data:{storeId:oo.stoid,userId:app.globalData.user_id,BuySum:th.data.ckeck_quan_price,WareIds:th.data.check_quan_ware_list,pageSize:100} | |
447 | + }).then(res=>{ | |
448 | + if(res.data.code==0) | |
449 | + quanlist=res.data.data.pageData; | |
450 | + }) | |
451 | + | |
452 | + var frozenQuan=null; | |
453 | + var url0="/api/weshop/users/frozenQuan/listFrozenQuan/"+app.globalData.user_id; | |
454 | + await app.request.promiseGet(url0,{1:1}).then(res=>{ | |
455 | + if(res.data.code==0){ | |
456 | + frozenQuan=res.data.data; | |
457 | + } | |
458 | + }) | |
459 | + | |
460 | + if(frozenQuan){ | |
461 | + quanlist=th.check_is_frozenQuan(quanlist,frozenQuan); | |
462 | + } | |
463 | + } | |
357 | 464 | } |
358 | 465 | th.setData({ |
359 | 466 | bn_goods: t.data.data, bn_pickname: gg.pick_name, bn_exp_type: et, |
... | ... | @@ -371,36 +478,6 @@ Page({ |
371 | 478 | } |
372 | 479 | }, |
373 | 480 | |
374 | - //----------子页返回父页触发---------- | |
375 | - onShow: function() { | |
376 | - console.log('onshow'); | |
377 | - var th=this; | |
378 | - console.log(th.data.isclose); | |
379 | - if (th.data.isclose==0){ | |
380 | - /*--- | |
381 | - wx.navigateTo({ | |
382 | - url: "/pages/user/index/index" | |
383 | - //url: "/pages/index/index/index" | |
384 | - })---*/ | |
385 | - wx.switchTab({ | |
386 | - url: "/pages/index/index/index" | |
387 | - }) | |
388 | - | |
389 | - }else{ | |
390 | - this.getuser_addr(function(ie){ | |
391 | - | |
392 | - console.log("getuser_addr") | |
393 | - console.log(ie) | |
394 | - | |
395 | - th.setData({user_addr: ie }); | |
396 | - if (th.data.is_b_now == 1) { | |
397 | - th.calculatePrice2(); | |
398 | - } else { | |
399 | - th.calculatePrice(); | |
400 | - } | |
401 | - }); | |
402 | - } | |
403 | - }, | |
404 | 481 | //---------------检查是否有收货地址------------------- |
405 | 482 | checkAddressList: function() { |
406 | 483 | var t = this; |
... | ... | @@ -725,7 +802,8 @@ Page({ |
725 | 802 | 'twon': addr == null ? 0 : addr.twon, |
726 | 803 | 'address': addr == null ? "": addr.address, |
727 | 804 | 'more_address': addr == null ? "" : addr.more_address, |
728 | - 'mobile': th.data.userinfo.mobile, | |
805 | + //'mobile': th.data.userinfo.mobile, | |
806 | + 'mobile': addr == null ? th.data.userinfo.mobile : addr.mobile, | |
729 | 807 | 'email':'', |
730 | 808 | 'shipping_code': th.data.bn_exp_type == 1 ? 0 : th.data.wu_arr[th.data.index].code, |
731 | 809 | 'shipping_name': th.data.bn_exp_type == 1 ? '' : th.data.wu_arr[th.data.index].name, |
... | ... | @@ -909,15 +987,19 @@ Page({ |
909 | 987 | a.post("/api/weshop/order/pay/createOrder", { |
910 | 988 | data: dd, |
911 | 989 | success: function (t) { |
912 | - console.log(t); | |
913 | - //app.showWarning("支付成功"); | |
914 | - app.my_warnning("支付成功",1,th); | |
915 | - setTimeout(function () { | |
916 | - th.setData({ isclose: 0 }); | |
917 | - wx.navigateTo({ | |
918 | - url: "/pages/user/order_list/order_list" | |
919 | - }) | |
920 | - }, 1000) | |
990 | + //console.log(t); | |
991 | + if(t.data.code==0){ | |
992 | + app.my_warnning("支付成功",1,th); | |
993 | + setTimeout(function () { | |
994 | + th.setData({ isclose: 0 }); | |
995 | + wx.navigateTo({ | |
996 | + url: "/pages/user/order_list/order_list" | |
997 | + }) | |
998 | + }, 1000) | |
999 | + } | |
1000 | + }, | |
1001 | + fail:function () { | |
1002 | + | |
921 | 1003 | } |
922 | 1004 | }); |
923 | 1005 | } |
... | ... | @@ -960,7 +1042,7 @@ Page({ |
960 | 1042 | }, |
961 | 1043 | enterAddressPage: function() { |
962 | 1044 | this.data.enterAddressPage = !0, wx.navigateTo({ |
963 | - url: "/pages/user/address_list/address_list?operate=select" | |
1045 | + url: "/pages/user/address_list/address_list?is_back=1" | |
964 | 1046 | }); |
965 | 1047 | }, |
966 | 1048 | |
... | ... | @@ -1083,13 +1165,9 @@ Page({ |
1083 | 1165 | var bn=e.currentTarget.dataset.bn; |
1084 | 1166 | var cindx=e.currentTarget.dataset.cind; |
1085 | 1167 | |
1086 | - console.log("open_coupon_list--quan"); | |
1087 | - console.log("门店:"+pickid); | |
1088 | - console.log(bn); | |
1089 | - | |
1090 | 1168 | |
1091 | 1169 | if(bn==1){ |
1092 | - th.setData({open_quan:1,selected_quan_pick:pickid}); | |
1170 | + th.setData({open_quan:1,selected_quan_pick:pickid, disabled:1}); | |
1093 | 1171 | }else{ |
1094 | 1172 | //---多单打开券的时候,就要判断券在其他门店是否有使用--- |
1095 | 1173 | var quanlist=th.data.cartlist[cindx].quan_list; |
... | ... | @@ -1098,12 +1176,12 @@ Page({ |
1098 | 1176 | var is_using= th.check_in_sele(quanlist[i].CashRepNo,pickid); |
1099 | 1177 | if(is_using) quanlist[i].is_using=1; |
1100 | 1178 | } |
1101 | - th.setData({open_quan:1,selected_quan_pick:pickid,selected_quan_list:quanlist}); | |
1179 | + th.setData({open_quan:1,selected_quan_pick:pickid,selected_quan_list:quanlist,disabled:1}); | |
1102 | 1180 | } |
1103 | 1181 | }, |
1104 | 1182 | close_coupon:function (e) { |
1105 | 1183 | var th=this; |
1106 | - th.setData({open_quan:0}); | |
1184 | + th.setData({open_quan:0,disabled:0}); | |
1107 | 1185 | }, |
1108 | 1186 | |
1109 | 1187 | //---判断券时候在已经选择的列表中--- |
... | ... | @@ -1216,6 +1294,26 @@ Page({ |
1216 | 1294 | var ob={}; |
1217 | 1295 | ob[txt] = this.data.imgUrl + "/miniapp/images/default_g_img.gif"; |
1218 | 1296 | this.setData(ob); |
1297 | + }, | |
1298 | + | |
1299 | + //--验证是否已经冻结-- | |
1300 | + check_is_frozenQuan:function(quanlist,frozenQuan){ | |
1301 | + var arr=[]; | |
1302 | + for(var i=0;i<quanlist.length;i++){ | |
1303 | + var item=quanlist[i]; | |
1304 | + var is_find=0; | |
1305 | + var Q_no=quanlist[i].CashRepNo; | |
1306 | + for(var j=0;j<frozenQuan.length;j++){ | |
1307 | + var q_no=frozenQuan[j].cashRepNo; | |
1308 | + if(Q_no==q_no){ | |
1309 | + is_find=1; break; | |
1310 | + } | |
1311 | + } | |
1312 | + if(!is_find) arr.push(item); | |
1313 | + | |
1314 | + } | |
1315 | + return arr; | |
1219 | 1316 | } |
1220 | 1317 | |
1318 | + | |
1221 | 1319 | }); | ... | ... |
pages/cart/cart2/cart2.wxml
... | ... | @@ -89,7 +89,7 @@ |
89 | 89 | <view class="coupon-mes"> |
90 | 90 | <view>用户备注(50字)</view> |
91 | 91 | <view class="leave-word"> |
92 | - <textarea bindinput="keyUpChangeNum" class="word-box" maxlength="50" name="user_note_{{item.pickup_id}}"></textarea> | |
92 | + <textarea bindinput="keyUpChangeNum" disabled="{{disabled}}" class="word-box" maxlength="50" name="user_note_{{item.pickup_id}}"></textarea> | |
93 | 93 | <view class="max-word">{{maxWord}}/50</view> |
94 | 94 | </view> |
95 | 95 | </view> |
... | ... | @@ -183,19 +183,9 @@ |
183 | 183 | </view> |
184 | 184 | </view> |
185 | 185 | <view class="coupon-mes"> |
186 | - <!-- <view bindtap="useCoupon" class="coupon-title"> | |
187 | - <view class="classname"> | |
188 | - <view class="">优惠券</view> | |
189 | - <view class="coupon-num">{{order.couponNum}}张可用</view> | |
190 | - </view> | |
191 | - <view class="set-btn"> | |
192 | - <view>{{coupon?coupon.coupon.name:'未使用'}}</view> | |
193 | - <image class="arrow-rigth" src="{{imgUrl}}/miniapp/images/icon-arrowdown.png"></image> | |
194 | - </view> | |
195 | - </view> --> | |
196 | 186 | <view>用户备注(50字)</view> |
197 | 187 | <view class="leave-word"> |
198 | - <textarea bindinput="keyUpChangeNum" class="word-box" maxlength="50" name="user_note"></textarea> | |
188 | + <textarea bindinput="keyUpChangeNum" disabled="{{disabled}}" class="word-box" maxlength="50" name="user_note"></textarea> | |
199 | 189 | <view class="max-word">{{maxWord}}/50</view> |
200 | 190 | </view> |
201 | 191 | </view> | ... | ... |
pages/cart/cart2/cart2.wxss
... | ... | @@ -279,7 +279,7 @@ |
279 | 279 | border-bottom:1px solid #ddd; |
280 | 280 | } |
281 | 281 | .xc-coupon-frame .work-frame{ |
282 | - width: 92%; | |
282 | + width: 94%; | |
283 | 283 | height: 100%; |
284 | 284 | |
285 | 285 | } |
... | ... | @@ -294,7 +294,7 @@ |
294 | 294 | } |
295 | 295 | |
296 | 296 | .xc-coupon-frame .work-frame .work{ font-size: 30rpx; line-height: 92rpx; color: #d81e06;} |
297 | -.xc-right-frame{font-size: 30rpx;line-height: 92rpx; } | |
297 | +.xc-right-frame{font-size: 30rpx;line-height: 92rpx; margin-right: 10rpx } | |
298 | 298 | |
299 | 299 | /* 自定义弹出窗口 */ |
300 | 300 | .cx-popup{ |
... | ... | @@ -345,7 +345,6 @@ |
345 | 345 | .xc-close-frame{ |
346 | 346 | margin-top:10rpx; |
347 | 347 | width:1%; |
348 | - display:flex; | |
349 | 348 | } |
350 | 349 | |
351 | 350 | .xc-close{ |
... | ... | @@ -354,8 +353,9 @@ height: 46rpx; |
354 | 353 | border-radius: 50%; |
355 | 354 | border: 5rpx solid #a5a5a7; |
356 | 355 | text-align: center; |
357 | -line-height: 33rpx; | |
358 | -font-size: 64rpx; | |
356 | +line-height: 46rpx; | |
357 | +font-size: 34rpx; | |
358 | +font-weight: bolder; | |
359 | 359 | color: #a5a5a7; |
360 | 360 | margin-top: 5rpx; |
361 | 361 | ... | ... |
pages/cart/cart2_pt/cart2_pt.js
... | ... | @@ -107,9 +107,12 @@ Page({ |
107 | 107 | |
108 | 108 | var user_addr = su.data.data.pageData; |
109 | 109 | var item = null; |
110 | + var def_item=null; | |
110 | 111 | for (var i = 0; i < user_addr.length; i++) { |
111 | - if (user_addr[i]['is_default'] == 1) { item = user_addr[i]; break; } | |
112 | + if (user_addr[i]['is_default'] == 1) { def_item = user_addr[i]; } | |
113 | + if (user_addr[i]['is_pickup'] == 1) { item = user_addr[i]; } | |
112 | 114 | } |
115 | + if (item == null) item = def_item; | |
113 | 116 | if (item == null) item = user_addr[0]; |
114 | 117 | if (item == undefined) item = null; |
115 | 118 | func(item); | ... | ... |
pages/cart/cart_wk/cart_wk.js
... | ... | @@ -43,6 +43,14 @@ Page({ |
43 | 43 | * 生命周期函数--监听页面加载 |
44 | 44 | */ |
45 | 45 | onLoad: function(options) { |
46 | + | |
47 | + //清空is_pick_up | |
48 | + getApp().request.put("/api/weshop/useraddress/updatePickUp", { | |
49 | + data: {user_id: getApp().globalData.user_id, is_pickup: 0}, | |
50 | + success: function (s) { | |
51 | + } | |
52 | + }); | |
53 | + | |
46 | 54 | var th = this; |
47 | 55 | this.data.order_id = options.order_id; |
48 | 56 | //--初始化-- |
... | ... | @@ -110,12 +118,13 @@ Page({ |
110 | 118 | success: function(su) { |
111 | 119 | var user_addr = su.data.data.pageData; |
112 | 120 | var item = null; |
121 | + var def_item = null; | |
113 | 122 | for (var i = 0; i < user_addr.length; i++) { |
114 | - if (user_addr[i]['is_default'] == 1) { | |
115 | - item = user_addr[i]; | |
116 | - break; | |
117 | - } | |
123 | + if (user_addr[i]['is_default'] == 1) { def_item = user_addr[i]; } | |
124 | + if (user_addr[i]['is_pickup'] == 1) { item = user_addr[i]; } | |
118 | 125 | } |
126 | + | |
127 | + if (item == null) item = def_item; | |
119 | 128 | if (item == null) item = user_addr[0]; |
120 | 129 | if (item == undefined) item = null; |
121 | 130 | func(item); |
... | ... | @@ -218,7 +227,9 @@ Page({ |
218 | 227 | jsarr.forEach(function(value,index){ |
219 | 228 | if(count>=value['rynum']) price=value['price']; |
220 | 229 | }) |
221 | - var tail_money=price*order_goods.goods_num-order['order_amount']-order['user_money']; | |
230 | + var tail_money =(price*order_goods.goods_num-order['order_amount']-order['user_money']).toFixed(2); | |
231 | + | |
232 | + tail_money = parseFloat(tail_money); | |
222 | 233 | order.tail_money=tail_money; |
223 | 234 | |
224 | 235 | //--判断物流-- |
... | ... | @@ -253,7 +264,7 @@ Page({ |
253 | 264 | if(exp_type==0){ |
254 | 265 | th.calculate_wuliu(); |
255 | 266 | }else{ |
256 | - var allpice = th.data.order.order_amount + th.data.order.user_money + th.data.order.pt_tail_money; | |
267 | + var allpice = th.data.order.order_amount + th.data.order.user_money + th.data.order.tail_money; | |
257 | 268 | allpice = allpice.toFixed(2); |
258 | 269 | th.setData({ exp_price: 0, allpice: allpice }) |
259 | 270 | } |
... | ... | @@ -284,6 +295,9 @@ Page({ |
284 | 295 | this.setData({ |
285 | 296 | exp_type: type |
286 | 297 | }); |
298 | + | |
299 | + | |
300 | + | |
287 | 301 | //--计算物流的值-- |
288 | 302 | if (type == 0) { |
289 | 303 | th.calculate_wuliu(); |
... | ... | @@ -364,7 +378,7 @@ Page({ |
364 | 378 | var n=t.data.data; |
365 | 379 | th.weixinPay(n, |
366 | 380 | function () { |
367 | - var allmoney=th.data.order.user_money+th.data.order.order_amount+th.data.order.pt_tail_money; | |
381 | + var allmoney=th.data.allpice; | |
368 | 382 | th.jumpPaymentPage(th.data.order.order_sn,allmoney); |
369 | 383 | },function () { |
370 | 384 | getApp().my_warnning("支付失败",0,th); |
... | ... | @@ -402,7 +416,7 @@ Page({ |
402 | 416 | case 2: |
403 | 417 | if (goods_weight < 0) goods_weight = 0; |
404 | 418 | //累积商品重量 每种商品的重量 * 数量 |
405 | - goods_weight += good['weight'] * good['buynum']; | |
419 | + goods_weight += good['weight'] * th.data.order.order_goods['goods_num']; | |
406 | 420 | break; |
407 | 421 | case 3: |
408 | 422 | if (goods_piece < 0) goods_piece = 0; |
... | ... | @@ -497,7 +511,7 @@ Page({ |
497 | 511 | //--进入收货地址的编辑页面-- |
498 | 512 | enterAddressPage: function() { |
499 | 513 | this.data.enterAddressPage =1, wx.navigateTo({ |
500 | - url: "/pages/user/address_list/address_list?operate=select" | |
514 | + url: "/pages/user/address_list/address_list?is_back=1" | |
501 | 515 | }); |
502 | 516 | }, |
503 | 517 | ... | ... |
pages/cart/cart_wk/cart_wk.wxml
... | ... | @@ -78,7 +78,7 @@ |
78 | 78 | <view class='ct_one_right'><text class='redwz'>{{teamgroup.jt_ct_num}}</text>人</view> |
79 | 79 | </view> |
80 | 80 | <view class='ct_one jc_sb'> |
81 | - <view class='ct_one_left'>成团单价</view> | |
81 | + <view class='ct_one_left'>成团金额</view> | |
82 | 82 | <view class='ct_one_right'>¥<text class='redwz'>{{filters.toFix(order.order_amount+order.user_money+order.tail_money,2)}}</text></view> |
83 | 83 | </view> |
84 | 84 | <view class='ct_one jc_sb'> | ... | ... |
pages/goods/goodsInfo/goodsInfo.js
... | ... | @@ -50,8 +50,7 @@ Page({ |
50 | 50 | activeCategoryId: 0, |
51 | 51 | supportPageScroll: !1, |
52 | 52 | address: { |
53 | - address: "", | |
54 | - district: 0 | |
53 | + address: "", district: 0 | |
55 | 54 | }, |
56 | 55 | shipping: "", |
57 | 56 | shippingCost: 0, |
... | ... | @@ -145,7 +144,7 @@ Page({ |
145 | 144 | pd_xx: 0, |
146 | 145 | is_normal: 0, //是否普通购买 |
147 | 146 | teamgroup:null, //有多少人开团 |
148 | - grounp_tatal:0, //有几个人开团 | |
147 | + grounp_tatal:0, //有几个人开团 | |
149 | 148 | timer:[], |
150 | 149 | |
151 | 150 | //商品的购买次数 |
... | ... | @@ -201,12 +200,16 @@ Page({ |
201 | 200 | is_show_pl:0, //是否品类 |
202 | 201 | is_show_pp:0, //是否品牌 |
203 | 202 | is_show_gb:0, //是否国别 |
203 | + is_closecoupon:0, | |
204 | + | |
205 | + //是否点赞中 | |
206 | + iszaning: 0, | |
204 | 207 | }, |
205 | 208 | |
206 | 209 | //------初始化加载---------- |
207 | 210 | onLoad: function(t) { |
208 | 211 | wx.setNavigationBarTitle({ title: "商品详情",}) |
209 | - var ee = this, that=ee, | |
212 | + var ee = this, that=ee,th=ee, | |
210 | 213 | gid = t.goods_id; |
211 | 214 | |
212 | 215 | //如果tg_id是空的话,分享回来 |
... | ... | @@ -218,33 +221,35 @@ Page({ |
218 | 221 | gid: gid |
219 | 222 | }); |
220 | 223 | |
224 | + | |
225 | + getApp().getConfig2(function (e) { | |
226 | + if (e.categoryset.indexOf("," + 1 + ",") != -1) { ee.setData({ is_show_pl: 1 }); } | |
227 | + if (e.categoryset.indexOf("," + 3 + ",") != -1) { ee.setData({ is_show_pp: 1 }); } | |
228 | + if (e.categoryset.indexOf("," + 2 + ",") != -1) { ee.setData({ is_show_gb: 1 }); } | |
229 | + | |
230 | + var json_d = JSON.parse(e.switch_list); | |
231 | + ee.setData({ store_config: e, is_closecoupon: json_d.is_closecoupon }); | |
232 | + ee.init(gid); | |
233 | + //------几人评价------- | |
234 | + n.init(th, "", "comments"); | |
235 | + th.requestCardNum(), wx.pageScrollTo && th.setData({ | |
236 | + supportPageScroll: !0 | |
237 | + }); | |
238 | + | |
239 | + }) | |
240 | + | |
241 | + | |
221 | 242 | //获取用户设备信息,屏幕宽度 |
222 | 243 | wx.getSystemInfo({ |
223 | 244 | success: res => { |
224 | 245 | that.setData({ screenWidth: res.screenWidth }) |
225 | 246 | } |
226 | 247 | }) |
227 | - | |
228 | - ee.init(gid); | |
229 | - //------几人评价------- | |
230 | - n.init(this, "", "comments"); | |
231 | - this.requestCardNum(), wx.pageScrollTo && this.setData({ | |
232 | - supportPageScroll: !0 | |
233 | - }); | |
234 | - | |
235 | - getApp().getConfig2(function (e) { | |
236 | - | |
237 | - if(e.categoryset.indexOf(","+1+",")!=-1){ ee.setData({is_show_pl:1}); } | |
238 | - if(e.categoryset.indexOf(","+3+",")!=-1){ ee.setData({is_show_pp:1}); } | |
239 | - if(e.categoryset.indexOf(","+2+",")!=-1){ ee.setData({is_show_gb:1}); } | |
240 | - ee.setData({store_config:e}); | |
241 | - }) | |
242 | - | |
243 | 248 | }, |
244 | 249 | |
245 | 250 | //------------程序初始化入口------------- |
246 | 251 | async init(gid) { |
247 | - var ee = this, | |
252 | + var ee = this,th=ee, | |
248 | 253 | gallery = null, |
249 | 254 | is_collect = 0, |
250 | 255 | collect_id = 0, |
... | ... | @@ -344,17 +349,19 @@ Page({ |
344 | 349 | } |
345 | 350 | } |
346 | 351 | |
347 | - //----获取详情页的券的数量---- | |
348 | - await getApp().request.promiseGet("/api/weshop/prom/coupon/page", { | |
349 | - data: { | |
350 | - store_id: os.stoid, | |
351 | - type:1, | |
352 | - pageSize: 3, | |
353 | - page:1, | |
354 | - }, | |
355 | - }).then(res1 => { | |
356 | - fir_quan=res1.data.data.pageData; | |
357 | - }) | |
352 | + if (th.data.is_closecoupon!=1){ | |
353 | + //----获取详情页的券的数量---- | |
354 | + await getApp().request.promiseGet("/api/weshop/prom/coupon/page", { | |
355 | + data: { | |
356 | + store_id: os.stoid, | |
357 | + type:1, | |
358 | + pageSize: 3, | |
359 | + page:1, | |
360 | + }, | |
361 | + }).then(res1 => { | |
362 | + fir_quan=res1.data.data.pageData; | |
363 | + }) | |
364 | + } | |
358 | 365 | |
359 | 366 | |
360 | 367 | //--------获取视频图片--------- |
... | ... | @@ -1426,7 +1433,7 @@ Page({ |
1426 | 1433 | //----已经结束----- |
1427 | 1434 | if (t.data.data.is_end == 1) { |
1428 | 1435 | ee.setData({ |
1429 | - prom_type: 0,isshow:1, | |
1436 | + prom_type: 0,isshow:1, | |
1430 | 1437 | }); |
1431 | 1438 | ee.get_sku(os.stoid, ee.data.data.sku, gid); |
1432 | 1439 | return false; |
... | ... | @@ -1465,13 +1472,31 @@ Page({ |
1465 | 1472 | th.data.buy_order = odr; |
1466 | 1473 | if (odr.pt_status == 0 && odr.order_status == 1) { |
1467 | 1474 | th.setData({ |
1468 | - user_order_pt_state: 1 | |
1475 | + user_order_pt_state: 1 | |
1469 | 1476 | }); |
1470 | 1477 | } |
1471 | 1478 | if (odr.pt_status == 1 && odr.order_status == 1) { |
1472 | - th.setData({ | |
1473 | - user_order_pt_state: 2 | |
1474 | - }); | |
1479 | + if (odr.is_zsorder == 4){ | |
1480 | + getApp().request.promiseGet("/api/weshop/teamgroup/page/", { | |
1481 | + data: { store_id: os.stoid, team_id: odr.pt_prom_id, listno: odr.pt_listno } | |
1482 | + }).then(res => { | |
1483 | + var now=ut.gettimestamp(); | |
1484 | + var tgr = res.data.data.pageData[0]; | |
1485 | + //如果团的时间已经到了 | |
1486 | + if (now >= tgr.kt_end_time){ | |
1487 | + th.update_jiti(tgr.id); | |
1488 | + }else{ | |
1489 | + th.setData({ | |
1490 | + user_order_pt_state: 2 | |
1491 | + }); | |
1492 | + } | |
1493 | + }) | |
1494 | + | |
1495 | + }else{ | |
1496 | + th.setData({ | |
1497 | + user_order_pt_state: 2 | |
1498 | + }); | |
1499 | + } | |
1475 | 1500 | } |
1476 | 1501 | |
1477 | 1502 | if (odr.pt_status == 2 && odr.is_zsorder == 4) { |
... | ... | @@ -1895,7 +1920,7 @@ Page({ |
1895 | 1920 | if (newd.kt_type > 1) { |
1896 | 1921 | newd.is_pt_tz = 1; //开团类型 |
1897 | 1922 | } |
1898 | - if (newd.kt_type == 3){ | |
1923 | + if (newd.kt_type == 3 && th.data.is_normal!=1){ | |
1899 | 1924 | th.data.sto_sele_distr=1; |
1900 | 1925 | } |
1901 | 1926 | |
... | ... | @@ -2048,6 +2073,9 @@ Page({ |
2048 | 2073 | } |
2049 | 2074 | |
2050 | 2075 | var iszan=th.data.comments[item_id].userZanNum; |
2076 | + if(this.data.iszaning) return false; | |
2077 | + this.data.iszaning=1; | |
2078 | + | |
2051 | 2079 | |
2052 | 2080 | app.request.post("/api/weshop/commentZan/save",{ |
2053 | 2081 | data:{store_id:o.stoid,user_id:app.globalData.user_id,goods_id:th.data.gid,comment_id:com_id}, |
... | ... | @@ -2055,11 +2083,11 @@ Page({ |
2055 | 2083 | |
2056 | 2084 | if (ee.data.code == "-1") { |
2057 | 2085 | app.my_warnning("不能给自己点赞", 0, th); |
2086 | + th.data.iszaning=0; | |
2058 | 2087 | return; |
2059 | 2088 | } |
2060 | 2089 | |
2061 | 2090 | if(ee.data.code==0 && iszan!=1){ |
2062 | - | |
2063 | 2091 | var num=th.data.comments[item_id].zan_num; num++; |
2064 | 2092 | var text="comments["+item_id+"].zan_num"; |
2065 | 2093 | var text1="comments["+item_id+"].userZanNum"; |
... | ... | @@ -2067,6 +2095,7 @@ Page({ |
2067 | 2095 | _errObj[text]=num; |
2068 | 2096 | _errObj[text1]=1; |
2069 | 2097 | th.setData(_errObj); |
2098 | + | |
2070 | 2099 | }else{ |
2071 | 2100 | var num=th.data.comments[item_id].zan_num; num--; |
2072 | 2101 | var text="comments["+item_id+"].zan_num"; |
... | ... | @@ -2076,6 +2105,11 @@ Page({ |
2076 | 2105 | _errObj[text1]=0; |
2077 | 2106 | th.setData(_errObj); |
2078 | 2107 | } |
2108 | + | |
2109 | + setTimeout(function(){ | |
2110 | + th.data.iszaning = 0; | |
2111 | + },500) | |
2112 | + | |
2079 | 2113 | } |
2080 | 2114 | }) |
2081 | 2115 | }, |
... | ... | @@ -2248,7 +2282,6 @@ Page({ |
2248 | 2282 | //-------大图后面就不一样了----------- |
2249 | 2283 | switch (type) { |
2250 | 2284 | case 0: //普通商品的展示 |
2251 | - case 1: //秒杀商品的展示 | |
2252 | 2285 | //中间的几个字 |
2253 | 2286 | var g_path = "../../../images/share/s_gou.png"; |
2254 | 2287 | context.drawImage(g_path, 56 * unit, 670 * unit, 22 * unit, 22 * unit); |
... | ... | @@ -2278,6 +2311,26 @@ Page({ |
2278 | 2311 | //---二维吗图--- |
2279 | 2312 | context.drawImage(vpath, 380 * unit, 736 * unit, 120 * unit, 120 * unit); |
2280 | 2313 | break; |
2314 | + case 1: //秒杀商品的展示 | |
2315 | + //---画线--- | |
2316 | + context.setLineWidth(1 * unit) | |
2317 | + context.moveTo(32 * unit, 670 * unit) | |
2318 | + context.lineTo(520 * unit, 670 * unit) | |
2319 | + context.stroke(); | |
2320 | + | |
2321 | + //画秒杀的图片 | |
2322 | + var miaos_path='../../../images/share/miao_share.png'; | |
2323 | + context.drawImage(miaos_path, 43 * unit, 700 * unit, 222 * unit, 40 * unit); | |
2324 | + | |
2325 | + //---文字--- | |
2326 | + context.setFontSize(22 * unit) | |
2327 | + context.setFillStyle("black") | |
2328 | + context.fillText("特惠好物,限时秒杀", 40 * unit, 806 * unit); | |
2329 | + context.fillText("长按识别二维码,立即开始抢购", 40 * unit, 846 * unit); | |
2330 | + //---二维吗图--- | |
2331 | + context.drawImage(vpath, 380 * unit, 736 * unit, 120 * unit, 120 * unit); | |
2332 | + break; | |
2333 | + | |
2281 | 2334 | case 2://会员团和商家团的展示 |
2282 | 2335 | //---画线--- |
2283 | 2336 | context.setLineWidth(1 * unit) |
... | ... | @@ -2569,6 +2622,26 @@ Page({ |
2569 | 2622 | var ob={}; |
2570 | 2623 | ob[txt] = this.data.iurl + "/miniapp/images/default_g_img.gif"; |
2571 | 2624 | this.setData(ob); |
2625 | + }, | |
2626 | + | |
2627 | + //--调用更新阶梯团的接口-- | |
2628 | + update_jiti:function(id){ | |
2629 | + var th=this; | |
2630 | + //--更新阶梯团-- | |
2631 | + getApp().request.put("/api/weshop/teamgroup/updateTeamOrder/"+os.stoid+"/"+id, { | |
2632 | + success: function (ee) { | |
2633 | + //--等于0是要去支付尾款,接口调用失败,就要去查看参团详情-- | |
2634 | + if (ee.data.code==0) { | |
2635 | + th.setData({ | |
2636 | + user_order_pt_state: 3, | |
2637 | + }); | |
2638 | + }else if(ee.data.code==-1){ | |
2639 | + th.setData({ | |
2640 | + user_order_pt_state: 2, | |
2641 | + }); | |
2642 | + } | |
2643 | + } | |
2644 | + }) | |
2572 | 2645 | } |
2573 | 2646 | |
2574 | 2647 | }); |
2575 | 2648 | \ No newline at end of file | ... | ... |
pages/goods/goodsInfo/goodsInfo.wxml
... | ... | @@ -300,7 +300,7 @@ |
300 | 300 | </view> |
301 | 301 | </block> |
302 | 302 | <!--许程 7.24暂时注释 --> |
303 | - <view wx:if="{{prom_type!=1&&prom_act.kttype!=3&&prom_act.kttype!=2&&prom_act.kttype!=1}}"> | |
303 | + <view wx:if="{{prom_type!=1&&prom_act.kttype!=3&&prom_act.kttype!=2&&prom_act.kttype!=1 && is_closecoupon!=1}}"> | |
304 | 304 | <view class="cx-frame flex" style="position: relative" wx:if="{{fir_quan.length>0}}"> |
305 | 305 | <view class="cx-sizs wsize">领券</view> |
306 | 306 | <view class="xc-coupon-fram" wx:for="{{fir_quan}}" wx:key="{{index}}"> |
... | ... | @@ -821,7 +821,7 @@ |
821 | 821 | </block> |
822 | 822 | <block wx:else> |
823 | 823 | <view class="spec-goods-stock">已售:{{sele_g.sales_sum}}</view> |
824 | - <view class="spec-goods-stock">可售:{{sele_g.store_count-sele_g.sales_sum}}</view> | |
824 | + <view class="spec-goods-stock">可售:{{sele_g.store_count}}</view> | |
825 | 825 | <view class="spec-goods-stock">已选:{{sku_g_pt[0].gg}}</view> |
826 | 826 | </block> |
827 | 827 | </view> | ... | ... |
pages/team/team_ping/team_ping.wxml
... | ... | @@ -64,7 +64,7 @@ |
64 | 64 | <view class='foot-left'> |
65 | 65 | 共{{item.order_goods[0].goods_num}}件, |
66 | 66 | <block wx:if="{{item.is_zsorder==4}}"> |
67 | - <block wx:if="{{item.pt_status==4 || item.pt_status==5}}"> | |
67 | + <block wx:if="{{item.pt_status==3 || item.pt_status==4 || item.pt_status==5 || item.pt_status==6}}"> | |
68 | 68 | 金额:<text class="xc-wc">¥</text> |
69 | 69 | <view class='foot-l-wz fs35'>{{filters.toFix(item.user_money+item.order_amount+item.pt_tail_money,2)}}</view> |
70 | 70 | </block> | ... | ... |
pages/team/team_ping/team_ping.wxss
pages/user/add_address/add_address.js
... | ... | @@ -12,6 +12,8 @@ Page({ |
12 | 12 | iurl: a.imghost, |
13 | 13 | address: null, |
14 | 14 | isnew:0, |
15 | + is_op_co:false,//switch开关 | |
16 | + disabled:0 | |
15 | 17 | }, |
16 | 18 | onLoad: function(s) { |
17 | 19 | var a = this,th=a; |
... | ... | @@ -25,6 +27,32 @@ Page({ |
25 | 27 | th.initRegions(); |
26 | 28 | }) |
27 | 29 | }, |
30 | + | |
31 | + onReachBottom: function () { | |
32 | + if (this.data.total <= 6) return; | |
33 | + if (this.data.ismore) return; | |
34 | + this.requestAddressList(); | |
35 | + }, | |
36 | + | |
37 | + requestAddressList: function () { | |
38 | + var e = this; | |
39 | + t.get(e.data.url + "/api/weshop/useraddress/page", { | |
40 | + data: { store_id: os.stoid, user_id: oo.user_id, page: e.data.curpage, pageSize: 6 }, | |
41 | + success: function (t) { | |
42 | + e.data.curpage++; | |
43 | + var arr1 = e.data.addresses; | |
44 | + var arr2 = t.data.data.pageData; | |
45 | + var arr3 = [...arr1, ...arr2]; | |
46 | + | |
47 | + var ismore = 0; | |
48 | + if (arr3.length == t.data.data.total) ismore = 1 | |
49 | + | |
50 | + e.setData({ | |
51 | + addresses: arr3, total: t.data.data.total, ismore: ismore | |
52 | + }), wx.stopPullDownRefresh(); | |
53 | + } | |
54 | + }); | |
55 | + }, | |
28 | 56 | initRegions: function() { |
29 | 57 | var e = this; |
30 | 58 | new s.default(this, "regions", { |
... | ... | @@ -32,6 +60,7 @@ Page({ |
32 | 60 | console.log("initRegions"); |
33 | 61 | console.log(t); |
34 | 62 | Object.assign(e.data.address, t), e.setData({ |
63 | + "disabled": 0, | |
35 | 64 | "address.province_name": e.data.address.province_name, |
36 | 65 | "address.city_name": e.data.address.city_name, |
37 | 66 | "address.district_name": e.data.address.district_name, |
... | ... | @@ -44,92 +73,101 @@ Page({ |
44 | 73 | } |
45 | 74 | }); |
46 | 75 | }, |
76 | + //-----------添加或者编辑----------- | |
77 | + submitAddress: function (s) { | |
78 | + var a = this.data.address, b = a, th = this; | |
79 | + Object.assign(a, s.detail.value), a.is_default = Number(a.is_default); | |
80 | + a.store_id = os.stoid; | |
47 | 81 | |
48 | - //-----------添加或者编辑----------- | |
49 | - submitAddress: function(s) { | |
50 | - var a= this.data.address, b=a,th=this; | |
51 | - Object.assign(a, s.detail.value), a.is_default = Number(a.is_default); | |
52 | - a.store_id = os.stoid; | |
53 | - | |
54 | - var ob = ut.check_mobile(a.mobile); | |
55 | - if(ob.code!=1){ | |
56 | - return getApp().my_warnning(ob.title,0,th); | |
57 | - } | |
58 | - | |
59 | - if (a.more_address == null || a.more_address == undefined || a.more_address=="" ){ | |
60 | - getApp().my_warnning("请选择地区",0,th); | |
61 | - return false; | |
62 | - } | |
63 | - | |
64 | - | |
65 | - //判断是不是空对象 | |
66 | - //--------如果是修改地址---------- | |
67 | - if (!th.data.isnew){ | |
68 | - if (a.is_default==1){ | |
69 | - t.put("/api/weshop/useraddress/update", { | |
70 | - data: { user_id: oo.user_id, is_default:0}, | |
71 | - success: function (s) { | |
72 | - t.put("/api/weshop/useraddress/updateById", { | |
73 | - data: a, | |
74 | - success: function (s) { | |
75 | - e.showSuccess(s.data.msg, function () { | |
76 | - wx.navigateBack(); | |
77 | - }); | |
78 | - } | |
79 | - }); | |
80 | - } | |
81 | - }); | |
82 | - | |
83 | - }else{ | |
84 | - t.put("/api/weshop/useraddress/updateById", { | |
85 | - data: a, | |
86 | - success: function (s) { | |
87 | - e.showSuccess(s.data.msg, function () { | |
88 | - wx.navigateBack(); | |
89 | - }); | |
90 | - } | |
82 | + //判断用户名是否为空 | |
83 | + var cs = th.check(a.consignee); | |
84 | + if (cs != 1) { | |
85 | + return getApp().my_warnning("收货姓名不能为空", 0, th); | |
86 | + } | |
87 | + | |
88 | + var ob = ut.check_mobile(a.mobile); | |
89 | + if (ob.code != 1) { | |
90 | + return getApp().my_warnning(ob.title, 0, th); | |
91 | + } | |
92 | + | |
93 | + if (a.more_address == null || a.more_address == undefined || a.more_address == "") { | |
94 | + getApp().my_warnning("请选择地区", 0, th); | |
95 | + return false; | |
96 | + } | |
97 | + //判断地址是否为空 | |
98 | + var add = th.check(a.address); | |
99 | + if (add != 1) { | |
100 | + return getApp().my_warnning("详细地址不能为空", 0, th); | |
101 | + } | |
102 | + | |
103 | + //判断是不是空对象 | |
104 | + //--------如果是修改地址---------- | |
105 | + if (!th.data.isnew) { | |
106 | + if (a.is_default == 1) { | |
107 | + t.put("/api/weshop/useraddress/update", { | |
108 | + data: { user_id: oo.user_id, is_default: 0 }, | |
109 | + success: function (s) { | |
110 | + t.put("/api/weshop/useraddress/updateById", { | |
111 | + data: a, | |
112 | + success: function (s) { | |
113 | + e.showSuccess(s.data.msg, function () { | |
114 | + wx.navigateBack(); | |
91 | 115 | }); |
92 | - } | |
93 | - | |
94 | - }else{ | |
95 | - a['user_id'] = oo.user_id; | |
96 | - a['store_id'] = os.stoid; | |
97 | - | |
98 | - | |
99 | - if (a.is_default == 1) { | |
100 | - t.put("/api/weshop/useraddress/update", { | |
101 | - data: { user_id: oo.user_id, is_default: 0 }, | |
102 | - success: function (s) { | |
103 | - | |
104 | - //-----新增地址------- | |
105 | - t.post("/api/weshop/useraddress/save", { | |
106 | - data: a, | |
107 | - success: function (s) { | |
108 | - e.showSuccess(s.data.msg, function () { | |
109 | - wx.navigateBack(); | |
110 | - }); | |
111 | - } | |
112 | - }); | |
113 | - | |
114 | - } | |
115 | - }) | |
116 | - }else{ | |
117 | - | |
118 | - //-----新增地址------- | |
119 | - t.post("/api/weshop/useraddress/save", { | |
120 | - data: a, | |
121 | - success: function (s) { | |
122 | - e.showSuccess(s.data.msg, function () { | |
123 | - wx.navigateBack(); | |
124 | - }); | |
125 | - } | |
126 | - }); | |
127 | - } | |
128 | - | |
129 | - | |
130 | - | |
131 | - } | |
132 | - }, | |
116 | + } | |
117 | + }); | |
118 | + } | |
119 | + }); | |
120 | + | |
121 | + } else { | |
122 | + t.put("/api/weshop/useraddress/updateById", { | |
123 | + data: a, | |
124 | + success: function (s) { | |
125 | + e.showSuccess(s.data.msg, function () { | |
126 | + wx.navigateBack(); | |
127 | + }); | |
128 | + } | |
129 | + }); | |
130 | + } | |
131 | + | |
132 | + } else { | |
133 | + a['user_id'] = oo.user_id; | |
134 | + a['store_id'] = os.stoid; | |
135 | + | |
136 | + | |
137 | + if (a.is_default == 1) { | |
138 | + t.put("/api/weshop/useraddress/update", { | |
139 | + data: { user_id: oo.user_id, is_default: 0 }, | |
140 | + success: function (s) { | |
141 | + | |
142 | + //-----新增地址------- | |
143 | + t.post("/api/weshop/useraddress/save", { | |
144 | + data: a, | |
145 | + success: function (s) { | |
146 | + e.showSuccess(s.data.msg, function () { | |
147 | + wx.navigateBack(); | |
148 | + }); | |
149 | + } | |
150 | + }); | |
151 | + | |
152 | + } | |
153 | + }) | |
154 | + } else { | |
155 | + | |
156 | + //-----新增地址------- | |
157 | + t.post("/api/weshop/useraddress/save", { | |
158 | + data: a, | |
159 | + success: function (s) { | |
160 | + e.showSuccess(s.data.msg, function () { | |
161 | + wx.navigateBack(); | |
162 | + }); | |
163 | + } | |
164 | + }); | |
165 | + } | |
166 | + | |
167 | + | |
168 | + | |
169 | + } | |
170 | + }, | |
133 | 171 | |
134 | 172 | //---------删除收货地址------------ |
135 | 173 | deleteAddress: function() { |
... | ... | @@ -146,5 +184,20 @@ Page({ |
146 | 184 | }); |
147 | 185 | } |
148 | 186 | }); |
149 | - } | |
187 | + }, | |
188 | + //是否是默认地址 | |
189 | + bind_is_op_co:function(e){ | |
190 | + var i = e.detail; | |
191 | + this.setData({ | |
192 | + is_op_co:i | |
193 | + }) | |
194 | + console.log(i) | |
195 | + }, | |
196 | + check:function(as){ | |
197 | + var code = 1; | |
198 | + if(as===''){ | |
199 | + code = -1; | |
200 | + } | |
201 | + return code; | |
202 | +} | |
150 | 203 | }); |
151 | 204 | \ No newline at end of file | ... | ... |
pages/user/add_address/add_address.wxml
1 | 1 | <import src="../../../utils/regions/regions.wxml"></import> |
2 | + | |
3 | + | |
2 | 4 | <view class="container"> |
5 | +<view class="topbcolor"></view> | |
3 | 6 | <form bindsubmit="submitAddress"> |
7 | + | |
4 | 8 | <view class="item"> |
5 | - <view class="item-name">收货人:</view> | |
6 | - <input class="item-input" name="consignee" value="{{address.consignee}}"></input> | |
9 | + <view class="item-name">收货人</view> | |
10 | + <input class="item-input" name="consignee" value="{{address.consignee}}" placeholder="请填写收货人姓名" placeholder-style="color: rgb(199, 199, 199)"></input> | |
7 | 11 | </view> |
8 | 12 | <view class="item"> |
9 | - <view class="item-name">手机号码:</view> | |
10 | - <input type="number" class="item-input" name="mobile" value="{{address.mobile}}"></input> | |
13 | + <view class="item-name">手机号码</view> | |
14 | + <input type="number" class="item-input" name="mobile" value="{{address.mobile}}" placeholder="请填写收货人手机号" placeholder-style="color: rgb(199, 199, 199)"></input> | |
11 | 15 | </view> |
12 | 16 | <view bindtap="openRegionsModal" class="item" data-id="0"> |
13 | - <view class="item-name">所在地区:</view> | |
14 | - <view class="item-input">{{address.more_address}}</view> | |
17 | + <view class="item-name">所在地区</view> | |
18 | + <view class="item-input{{address.more_address==null?'address':''}}">{{address.more_address==null?'省市区县,乡镇等':address.more_address}}</view> | |
15 | 19 | <view class="item-img"> |
16 | 20 | <image class="arrow" src="{{iurl}}/miniapp/images/icon-arrowdown.png"></image> |
17 | 21 | </view> |
22 | + </view> | |
23 | + <view class="detailed"> | |
24 | + <view class="detailed_item-name">详细地址</view> | |
25 | + <textarea wx:if="{{!disabled}}" class="detailed_item-input" name="address" disabled="{{disabled}}" data-dis="{{disabled}}" | |
26 | + value="{{address.address}}" placeholder="街道 楼牌号等" placeholder-style="color: rgb(199, 199, 199)"></textarea> | |
18 | 27 | </view> |
19 | - <view class="item"> | |
20 | - <view class="item-name">详细地址:</view> | |
21 | - <input class="item-input" name="address" value="{{address.address}}"></input> | |
22 | - </view> | |
23 | - <view class="item"> | |
28 | + <view class="item item_default"> | |
24 | 29 | <view class="item-name">设为默认地址</view> |
25 | - <switch checked="{{address.is_default==1?true:false}}" class="item-switch" color="#e30000" name="is_default" type="switch"></switch> | |
30 | + <switch checked="{{address.is_default==1?true:false}}" class="item-switch" | |
31 | + color="{{address.is_default==1?'rgb(239,22,51)':is_op_co==false?'white':'rgb(239,22,51)'}}" name="is_default" type="switch" bindchange="bind_is_op_co"/> | |
26 | 32 | </view> |
27 | 33 | <view class="address-btns"> |
28 | - <button bindtap="deleteAddress" class="delete-btn">删除地址</button> | |
34 | + <button bindtap="deleteAddress" wx:if="{{address.mobile!=null}}" class="delete-btn">删除地址</button> | |
29 | 35 | <button class="submit-btn" formType="submit">提交地址</button> |
30 | 36 | </view> |
31 | 37 | </form> |
32 | 38 | </view> |
33 | -<template is="regions" data="{{regions:regions}}"></template> | |
34 | 39 | |
40 | +<template is="regions" data="{{regions:regions}}"></template> | |
35 | 41 | <warn id="warn"></warn> | ... | ... |
pages/user/add_address/add_address.wxss
1 | 1 | page { |
2 | - background: white; | |
2 | + background: rgb(255, 255, 255); | |
3 | +} | |
4 | + | |
5 | +.topbcolor { | |
6 | + width: 100%; | |
7 | + height: 7rpx; | |
8 | + background-color: rgb(245, 245, 245); | |
3 | 9 | } |
4 | 10 | |
5 | 11 | .item { |
6 | - float: left; | |
7 | - padding: 0 30rpx; | |
8 | - width: 100%; | |
9 | - box-sizing: border-box; | |
10 | - font-size: 30rpx; | |
11 | - border-bottom: 1rpx #f5f5f5 solid; | |
12 | - line-height: 100rpx; | |
13 | - height: 100rpx; | |
14 | - position: relative; | |
12 | + display: flex; | |
13 | + align-items: center; | |
14 | + padding: 0 31rpx; | |
15 | + width: 100%; | |
16 | + box-sizing: border-box; | |
17 | + border-bottom: 1rpx #f5f5f5 solid; | |
18 | + height: 98rpx; | |
19 | + position: relative; | |
20 | + font-size: 26rpx; | |
21 | + padding-top: 16rpx; | |
15 | 22 | } |
16 | 23 | |
17 | 24 | .item-name { |
18 | - float: left; | |
25 | + display: flex; | |
26 | + align-items: center; | |
27 | + height: 100%; | |
28 | + width: 104rpx; | |
29 | +} | |
30 | + | |
31 | +.item-img { | |
32 | + height: 100%; | |
33 | + align-items: center; | |
34 | +} | |
35 | + | |
36 | +.item_default { | |
37 | + display: flex; | |
38 | + justify-content: space-between; | |
39 | +} | |
40 | + | |
41 | +.item_default .item-name { | |
42 | + width: 200rpx; | |
19 | 43 | } |
20 | 44 | |
21 | 45 | .item-input { |
22 | - float: left; | |
23 | - height: 100rpx; | |
24 | - width: 450rpx; | |
25 | - margin-left: 20rpx; | |
26 | - word-break: keep-all; | |
27 | - white-space: nowrap; | |
28 | - overflow: hidden; | |
29 | - text-overflow: ellipsis; | |
46 | + display: flex; | |
47 | + height: 100%; | |
48 | + margin-left: 40rpx; | |
49 | + /* word-break: keep-all; | |
50 | + white-space: nowrap; | |
51 | + overflow: hidden; */ | |
52 | + text-overflow: ellipsis; | |
53 | + color: rgb(0, 0, 0); | |
54 | + align-items: center; | |
55 | + width: 74%; | |
56 | +} | |
57 | + | |
58 | +.item-inputaddress { | |
59 | + color: rgb(199, 199, 199); | |
60 | + margin-left: 40rpx; | |
61 | +} | |
62 | + | |
63 | +.detailed { | |
64 | + height: 193rpx; | |
65 | + padding-bottom: 95rpx; | |
66 | + display: flex; | |
67 | + padding: 0 31rpx; | |
68 | + padding-top: 41rpx; | |
69 | + font-size: 26rpx; | |
70 | + border-bottom: 1rpx #f5f5f5 solid; | |
71 | +} | |
72 | + | |
73 | +.detailed .detailed_item-name { | |
74 | + width: 137rpx; | |
75 | +} | |
76 | + | |
77 | +.detailed_item-input { | |
78 | + margin-left: 40rpx; | |
79 | + height: auto; | |
80 | + width: 100%; | |
81 | + min-height: 40rpx; | |
82 | + padding-bottom: 28rpx; | |
30 | 83 | } |
31 | 84 | |
32 | 85 | .item-switch { |
33 | - float: right; | |
86 | + zoom: 0.7; | |
87 | +} | |
88 | + | |
89 | +.item-switch::before { | |
90 | + width: 80rpx !important; | |
91 | + height: 35rpx !important; | |
92 | + zoom: 1; | |
34 | 93 | } |
35 | 94 | |
36 | 95 | .arrow { |
37 | - position: absolute; | |
38 | - right: 30rpx; | |
39 | - width: 32rpx; | |
40 | - height: 32rpx; | |
41 | - padding-top: 30rpx; | |
96 | + position: absolute; | |
97 | + right: 26rpx; | |
98 | + width: 26rpx; | |
99 | + height: 26rpx; | |
100 | + padding-top: 28rpx; | |
42 | 101 | } |
43 | 102 | |
44 | 103 | .address-btns { |
45 | - position: absolute; | |
46 | - bottom: 80rpx; | |
47 | - float: left; | |
48 | - width: 100%; | |
49 | - padding: 10rpx 0; | |
104 | + position: absolute; | |
105 | + display: flex; | |
106 | + justify-content: center; | |
107 | + align-items: center; | |
108 | + bottom: 80rpx; | |
109 | + width: 100%; | |
50 | 110 | } |
51 | 111 | |
52 | 112 | .delete-btn { |
53 | - float: left; | |
54 | - width: 40%; | |
55 | - margin: 0 10% 0 5%; | |
56 | - border-radius: 10rpx; | |
57 | - color: #999; | |
58 | - border: 1px solid #f2f2f2; | |
113 | + display: flex; | |
114 | + justify-content: center; | |
115 | + align-items: center; | |
116 | + width: 285rpx; | |
117 | + height: 60rpx; | |
118 | + border-radius: 40rpx; | |
119 | + font-size: 27rpx; | |
120 | + color: rgb(0, 0, 0); | |
121 | + border: 1rpx solid rgb(210, 210, 210); | |
59 | 122 | } |
60 | 123 | |
61 | 124 | .submit-btn { |
62 | - float: left; | |
63 | - width: 40%; | |
64 | - background-color: #e30000; | |
65 | - color: white; | |
66 | - border-radius: 10rpx; | |
125 | + display: flex; | |
126 | + justify-content: center; | |
127 | + align-items: center; | |
128 | + width: 285rpx; | |
129 | + height: 59rpx; | |
130 | + background-color: #e30000; | |
131 | + font-size: 27rpx; | |
132 | + color: rgb(255, 255, 255); | |
133 | + border-radius: 40rpx; | |
67 | 134 | } |
68 | - | |
69 | -@import "../../../utils/regions/regions.wxss"; | |
70 | 135 | \ No newline at end of file |
136 | +@import "../../../utils/regions/regions.wxss"; | ... | ... |
pages/user/address_list/address_list.js
1 | -var e = getApp(), t = require("../../../utils/request.js"),os=e.globalData.setting,oo=e.globalData; | |
2 | - | |
1 | +var e = getApp(), t = require("../../../utils/request.js"), os = e.globalData.setting, oo = e.globalData, t = e.request; | |
3 | 2 | |
4 | 3 | Page({ |
5 | - data: { | |
6 | - url: e.globalData.setting.url, | |
7 | - resourceUrl: e.globalData.setting.resourceUrl, | |
8 | - iurl: e.globalData.setting.imghost, | |
9 | - addresses: [], | |
10 | - operate: null, | |
11 | - curpage:1, | |
12 | - total:0, | |
13 | - ismore:0, | |
14 | - | |
15 | - }, | |
16 | - onLoad: function(e) { | |
17 | - this.data.operate = e.operate; | |
18 | - }, | |
19 | - onShow: function() { | |
20 | - this.data.curpage=1; | |
21 | - this.data.addresses=[]; | |
22 | - this.requestAddressList(); | |
23 | - }, | |
24 | - | |
4 | + data: { | |
5 | + url: e.globalData.setting.url, | |
6 | + resourceUrl: e.globalData.setting.resourceUrl, | |
7 | + iurl: e.globalData.setting.imghost, | |
8 | + addresses: [], | |
9 | + operate: null, | |
10 | + curpage: 1, | |
11 | + total: 0, | |
12 | + ismore: 0, | |
13 | + is_back:0, //有没有跳转 | |
14 | + isloading:0, | |
15 | + is_address_read:0 | |
16 | + }, | |
17 | + onLoad: function (e) { | |
18 | + | |
19 | + //清空is_pick_up | |
20 | + getApp().request.put("/api/weshop/useraddress/updatePickUp", { | |
21 | + data: {user_id: getApp().globalData.user_id, is_pickup: 0}, | |
22 | + success: function (s) { | |
23 | + } | |
24 | + }); | |
25 | + | |
26 | + this.data.operate = e.operate; | |
27 | + var is_back=e.is_back; | |
28 | + if (is_back) this.setData({ is_back: is_back}) | |
29 | + }, | |
30 | + onShow: function () { | |
31 | + this.data.curpage = 1; | |
32 | + this.data.addresses = []; | |
33 | + this.requestAddressList(); | |
34 | + console.log(this.data.addresses) | |
35 | + }, | |
25 | 36 | |
26 | 37 | onReachBottom: function () { |
27 | - if(this.data.total<=6) return; | |
28 | - if(this.data.ismore) return; | |
29 | - this.requestAddressList(); | |
38 | + if (this.data.total <= 6) return; | |
39 | + if (this.data.ismore) return; | |
40 | + this.requestAddressList(); | |
30 | 41 | }, |
31 | 42 | |
32 | - requestAddressList: function() { | |
33 | - var tt= Math.random() * 100 | |
34 | - var e = this; | |
35 | - t.get(e.data.url + "/api/weshop/useraddress/page", { | |
36 | - data: { store_id: os.stoid, user_id: oo.user_id, page: e.data.curpage,pageSize:6,t:tt}, | |
37 | - success: function(t) { | |
38 | - e.data.curpage++; | |
39 | - var arr1 = e.data.addresses; | |
40 | - var arr2 = t.data.data.pageData; | |
41 | - var arr3 = [...arr1, ...arr2]; | |
42 | - | |
43 | - var ismore=0; | |
44 | - if (arr3.length == t.data.data.total) ismore=1 | |
45 | - | |
46 | - e.setData({ | |
47 | - addresses: arr3, total: t.data.data.total, ismore: ismore | |
48 | - }), wx.stopPullDownRefresh(); | |
49 | - } | |
50 | - }); | |
51 | - }, | |
52 | - | |
53 | - /*----------编辑地址----------*/ | |
54 | - editAddress: function(e) { | |
55 | - var t = this.getAddressData(e.currentTarget.dataset.id), s = ""; | |
56 | - for (var a in t) s += (0 != s.length ? "&" : "?") + a + "=" + t[a]; | |
57 | - s && wx.navigateTo({ | |
58 | - url: "/pages/user/add_address/add_address" + s | |
59 | - }); | |
60 | - }, | |
61 | - | |
62 | - /*-----选择地址返回确认------*/ | |
63 | - selectAddress: function(e) { | |
64 | - if (null != this.data.operate) { | |
65 | - /*---- | |
66 | - if ("select" == this.data.operate) wx.setStorageSync("cart:cart2:address_id", e.currentTarget.dataset.item.address_id); else if ("teamSelect" == this.data.operate) wx.setStorageSync("team:confirm:address_id", e.currentTarget.dataset.item.address_id); else if ("selectAddress" == this.data.operate) { | |
67 | - var t = { | |
68 | - address: e.currentTarget.dataset.item.province_name + e.currentTarget.dataset.item.city_name + e.currentTarget.dataset.item.district_name, | |
69 | - district: e.currentTarget.dataset.item.district | |
70 | - }; | |
71 | - wx.setStorageSync("goodsInfo:goodsInfo:address", t); | |
72 | - }---*/ | |
73 | - oo.baddr = e.currentTarget.dataset.item; | |
74 | - wx.navigateBack(); | |
75 | - } | |
76 | - }, | |
77 | - getAddressData: function(e) { | |
78 | - var t = this.data.addresses; | |
79 | - for (var s in t) if (t[s].address_id == e) break; | |
80 | - return s ? t[s] : {}; | |
81 | - }, | |
82 | - | |
83 | - go_url:function(e){ | |
84 | - var url=e.currentTarget.dataset.url; | |
85 | - getApp().goto(url); | |
43 | + requestAddressList: function () { | |
44 | + var tt = Math.random() * 100 | |
45 | + var e = this; | |
46 | + t.get(e.data.url + "/api/weshop/useraddress/page", { | |
47 | + data: { store_id: os.stoid, user_id: oo.user_id, page: e.data.curpage, pageSize: 6, t: tt }, | |
48 | + success: function (t) { | |
49 | + e.data.curpage++; | |
50 | + var arr1 = e.data.addresses; | |
51 | + var arr2 = t.data.data.pageData; | |
52 | + var arr3 = [...arr1, ...arr2]; | |
53 | + | |
54 | + var ismore = 0; | |
55 | + if (arr3.length == t.data.data.total) ismore = 1 | |
56 | + | |
57 | + e.setData({ | |
58 | + addresses: arr3, total: t.data.data.total, ismore: ismore, | |
59 | + is_address_read:1 | |
60 | + }), wx.stopPullDownRefresh(); | |
61 | + } | |
62 | + }); | |
63 | + }, | |
64 | + | |
65 | + /*----------编辑地址----------*/ | |
66 | + editAddress: function (e) { | |
67 | + var t = this.getAddressData(e.currentTarget.dataset.id), s = ""; | |
68 | + for (var a in t) s += (0 != s.length ? "&" : "?") + a + "=" + t[a]; | |
69 | + s && wx.navigateTo({ | |
70 | + url: "/pages/user/add_address/add_address" + s | |
71 | + }); | |
72 | + }, | |
73 | + | |
74 | + /*-----选择地址返回确认------*/ | |
75 | + selectAddress: function (e) { | |
76 | + if (null != this.data.operate) { | |
77 | + /*---- | |
78 | + if ("select" == this.data.operate) wx.setStorageSync("cart:cart2:address_id", e.currentTarget.dataset.item.address_id); else if ("teamSelect" == this.data.operate) wx.setStorageSync("team:confirm:address_id", e.currentTarget.dataset.item.address_id); else if ("selectAddress" == this.data.operate) { | |
79 | + var t = { | |
80 | + address: e.currentTarget.dataset.item.province_name + e.currentTarget.dataset.item.city_name + e.currentTarget.dataset.item.district_name, | |
81 | + district: e.currentTarget.dataset.item.district | |
82 | + }; | |
83 | + wx.setStorageSync("goodsInfo:goodsInfo:address", t); | |
84 | + }---*/ | |
85 | + | |
86 | + oo.baddr = e.currentTarget.dataset.item; | |
87 | + wx.navigateBack(); | |
86 | 88 | } |
89 | + }, | |
90 | + | |
91 | + getAddressData: function (e) { | |
92 | + var t = this.data.addresses; | |
93 | + for (var s in t) if (t[s].address_id == e) break; | |
94 | + return s ? t[s] : {}; | |
95 | + }, | |
96 | + | |
97 | + go_url: function (e) { | |
98 | + var url = e.currentTarget.dataset.url; | |
99 | + getApp().goto(url); | |
100 | + | |
101 | + }, | |
102 | + //判断是否选择 | |
103 | + add_is_pickup:function(e){ | |
104 | + | |
105 | + if(this.data.is_back==0) return false; | |
87 | 106 | |
107 | + var th = this; | |
108 | + var index = e.currentTarget.dataset.ind; | |
109 | + var a = this.data.addresses[index]; | |
88 | 110 | |
111 | + if (th.data.isloading) return; | |
112 | + th.data.isloading=1; | |
113 | + | |
114 | + t.put("/api/weshop/useraddress/updatePickUp", { | |
115 | + data: { user_id: oo.user_id, is_pickup: 0 }, | |
116 | + isShowLoading:0, | |
117 | + success: function (s) { | |
118 | + // var add_arr = th.data.addresses; | |
119 | + // for (var i in add_arr){ | |
120 | + // add_arr[i].is_pickup=0; | |
121 | + // } | |
122 | + // th.setData({addresses:add_arr}); | |
123 | + | |
124 | + a.is_pickup = 1; | |
125 | + t.put("/api/weshop/useraddress/updateById", { | |
126 | + data: a, | |
127 | + isShowLoading: 0, | |
128 | + success: function (s) { | |
129 | + // var obj={}; | |
130 | + // var txt = "addresses[" + index +"].is_pickup"; | |
131 | + // obj[txt]=1; | |
132 | + // th.setData(obj); | |
133 | + | |
134 | + th.data.isloading=0 | |
135 | + if (th.data.is_back) { | |
136 | + wx.navigateBack({}); | |
137 | + } | |
138 | + | |
139 | + },fail: function (t) { | |
140 | + th.data.isloading = 0; | |
141 | + } | |
142 | + }); | |
143 | + }, | |
144 | + fail: function (t) { | |
145 | + th.data.isloading = 0; | |
146 | + } | |
147 | + }); | |
148 | + | |
149 | + | |
150 | + | |
151 | + } | |
89 | 152 | }); |
90 | 153 | \ No newline at end of file | ... | ... |
pages/user/address_list/address_list.wxml
1 | -<view class="container"> | |
1 | +<!-- <view class="container"> | |
2 | 2 | <view class="address-box" wx:for="{{addresses}}" wx:key="{{index}}"> |
3 | 3 | <view class="address-user"> |
4 | 4 | <view class="user-name">{{item.consignee}}</view> |
... | ... | @@ -12,7 +12,69 @@ |
12 | 12 | <image src="{{iurl}}/miniapp/images/address_edit.png"></image> |
13 | 13 | </view> |
14 | 14 | </view> |
15 | - <view bindtap="go_url" class="address-create" data-url="/pages/user/add_address/add_address"> | |
15 | + <navigator class="address-create" url="/pages/user/add_address/add_address"> | |
16 | 16 | <view class="create-btn">+新建地址</view> |
17 | - </view> | |
17 | + </navigator> | |
18 | +</view> --> | |
19 | + | |
20 | +<!-- 无收货地址提醒页面 --> | |
21 | +<view class="topbcolor"></view> | |
22 | +<view class="nothing" wx:if="{{is_address_read && addresses.length<=0}}"> | |
23 | + <view class="image flex-level"> | |
24 | + <image src="../../../images/nothingaddress.png"></image> | |
25 | + </view> | |
26 | + | |
27 | + <view class="nothingaddress flex-level"> | |
28 | + <view>暂无收货地址</view> | |
29 | + </view> | |
30 | + | |
31 | + <view class="address flex-level"> | |
32 | + <navigator bindtap="go_url" data-url="/pages/user/add_address/add_address">添加收货地址</navigator> | |
33 | + </view> | |
18 | 34 | </view> |
35 | + | |
36 | +<!-- 收货地址页面集合框架 --> | |
37 | +<view class="container" wx:if="{{addresses.length>0}}"> | |
38 | + <!-- 所有的收货地址框架 --> | |
39 | + <view class="address-box"> | |
40 | + | |
41 | + <!-- 单个收货地址框架 --> | |
42 | + <view class="address-user" wx:for="{{addresses}}" wx:key="{{index}}"> | |
43 | + <!-- 选择icon | |
44 | + <view class="icon"> | |
45 | + <icon type="success" color="red" size="33rpx" wx:if="{{item.is_pickup==1}}" bindtap="add_is_pickup" data-icon="{{index}}"></icon> | |
46 | + <icon class="no_xuanze" color="white" wx:if="{{item.is_pickup==0}}" bindtap="add_is_pickup" data-icon="{{index}}"></icon> | |
47 | + </view>--> | |
48 | + | |
49 | + <!-- 收货地址全部信息 --> | |
50 | + <view class="address" bindtap="add_is_pickup" data-ind="{{index}}" > | |
51 | + <!-- 个人直接信息 --> | |
52 | + <view class="user"> | |
53 | + <!-- 名字 --> | |
54 | + <view class="userName">{{item.consignee}}</view> | |
55 | + <!-- 电话 --> | |
56 | + <view class="userPhone">{{item.mobile}}</view> | |
57 | + <view class="default" wx:if="{{item.is_default}}">默认地址</view> | |
58 | + </view> | |
59 | + | |
60 | + <!-- 收货地址 --> | |
61 | + <view class="ShippingAddress ellipsis-2 ">{{item.more_address}} {{item.address}}</view> | |
62 | + </view> | |
63 | + | |
64 | + <!-- 编辑地址图片 --> | |
65 | + <view class="edit" bindtap="editAddress" data-id="{{item.address_id}}"> | |
66 | + <image src="../../../images/dpr.png"></image> | |
67 | + </view> | |
68 | + </view> | |
69 | + | |
70 | + </view> | |
71 | + | |
72 | + <!-- 新建收货地址 --> | |
73 | + <view class="new"> | |
74 | + <navigator bindtap="go_url" data-url="/pages/user/add_address/add_address"> | |
75 | + <view class="add">+</view> | |
76 | + <view class="addAddress">新建收货地址</view> | |
77 | + </navigator> | |
78 | + </view> | |
79 | + | |
80 | +</view> | |
19 | 81 | \ No newline at end of file | ... | ... |
pages/user/address_list/address_list.wxss
1 | -page { | |
1 | +/* 没有收货地址时的样式 */ | |
2 | + | |
3 | +.nothing { | |
4 | + width: 100%; | |
5 | + font-size: 31rpx; | |
6 | +} | |
7 | + | |
8 | +.nothing image { | |
9 | + width: 299rpx; | |
10 | + height: 283rpx; | |
11 | + margin-top: 161rpx; | |
12 | +} | |
13 | + | |
14 | +.nothing .nothingaddress { | |
15 | + color: rgb(251, 65, 66); | |
16 | + margin-top: 35rpx; | |
17 | +} | |
18 | + | |
19 | +.nothing .address { | |
20 | + margin-top: 61rpx; | |
21 | +} | |
22 | + | |
23 | +.nothing .address navigator { | |
24 | + color: rgb(255, 255, 255); | |
25 | + background-color: rgb(251, 65, 66); | |
26 | + width: 256rpx; | |
27 | + height: 55rpx; | |
28 | + border-radius: 30rpx; | |
29 | + display: flex; | |
30 | + align-items: center; | |
31 | + justify-content: center; | |
32 | +} | |
33 | + | |
34 | +/* page { | |
2 | 35 | margin-bottom: 200rpx; |
3 | 36 | } |
4 | 37 | |
... | ... | @@ -15,7 +48,7 @@ page { |
15 | 48 | width: 150rpx; |
16 | 49 | } |
17 | 50 | |
18 | -.user-name { | |
51 | +.N-name { | |
19 | 52 | font-size: 30rpx; |
20 | 53 | padding-bottom: 20rpx; |
21 | 54 | word-break: keep-all; |
... | ... | @@ -62,20 +95,14 @@ page { |
62 | 95 | } |
63 | 96 | |
64 | 97 | .address-create { |
65 | - background-color: #fff; | |
66 | - width: 100%; | |
98 | + width: 50%; | |
67 | 99 | text-align: center; |
68 | 100 | position: fixed; |
69 | - bottom: 0rpx; | |
70 | - height: 200rpx; | |
71 | - border-top:1rpx solid #eee | |
72 | - | |
101 | + bottom: 80rpx; | |
102 | + left: 25%; | |
73 | 103 | } |
74 | 104 | |
75 | 105 | .create-btn { |
76 | - width: 50%; | |
77 | - margin: 0 auto; | |
78 | - margin-top: 60rpx; | |
79 | 106 | font-size: 28rpx; |
80 | 107 | color: white; |
81 | 108 | background-color: #f23030; |
... | ... | @@ -83,4 +110,131 @@ page { |
83 | 110 | text-align: center; |
84 | 111 | line-height: 80rpx; |
85 | 112 | display: block; |
86 | -} | |
87 | 113 | \ No newline at end of file |
114 | +} */ | |
115 | + | |
116 | +page { | |
117 | + margin-bottom: 200rpx; | |
118 | +} | |
119 | + | |
120 | +.topbcolor { | |
121 | + width: 100%; | |
122 | + height: 7rpx; | |
123 | + background-color: rgb(245, 245, 245); | |
124 | +} | |
125 | + | |
126 | +.container { | |
127 | + margin-top: 7rpx; | |
128 | +} | |
129 | + | |
130 | +.container .address-box { | |
131 | + width: 100%; | |
132 | +} | |
133 | + | |
134 | +.container .address-box .address-user { | |
135 | + display: flex; | |
136 | + justify-content: center; | |
137 | + width: 100%; | |
138 | + border-bottom: 2rpx solid rgb(245, 245, 245); | |
139 | + height: 180rpx; | |
140 | + align-items: center; | |
141 | +} | |
142 | + | |
143 | +.container .address-box .address-user .icon { | |
144 | + padding-right: 20rpx; | |
145 | + display: flex; | |
146 | + align-items: center; | |
147 | + height: 100%; | |
148 | +} | |
149 | + | |
150 | +.container .address-box .address-user .no_xuanze { | |
151 | + width: 31rpx; | |
152 | + height: 31rpx; | |
153 | + border-radius: 50%; | |
154 | + border: 1rpx solid; | |
155 | +} | |
156 | + | |
157 | +.container .address-box .address-user .address { | |
158 | + width: 530rpx; | |
159 | +} | |
160 | + | |
161 | +.container .address-box .address-user .address .user { | |
162 | + display: flex; | |
163 | + align-items: center; | |
164 | + width: 500rpx; | |
165 | + font-weight: bold; | |
166 | + font-size: 31rpx; | |
167 | + color: rgb(40, 36, 33); | |
168 | +} | |
169 | + | |
170 | +.container .address-box .address-user .address .user .userName { | |
171 | + overflow: hidden; | |
172 | + text-overflow: ellipsis; | |
173 | + display: -webkit-box; | |
174 | + -webkit-box-orient: vertical; | |
175 | + -webkit-line-clamp: 1; | |
176 | + max-width: 149rpx; | |
177 | +} | |
178 | + | |
179 | +.container .address-box .address-user .address .user .userPhone { | |
180 | + margin-left: 41rpx; | |
181 | +} | |
182 | + | |
183 | +.container .address-box .address-user .address .user .default { | |
184 | + display: flex; | |
185 | + width: 105rpx; | |
186 | + height: 31rpx; | |
187 | + background-color: rgb(239, 22, 51); | |
188 | + justify-content: center; | |
189 | + font-size: 20rpx; | |
190 | + color: rgb(255, 255, 253); | |
191 | + border-radius: 8rpx; | |
192 | + margin-left: 21rpx; | |
193 | + line-height: 31rpx; | |
194 | +} | |
195 | + | |
196 | +.container .address-box .address-user .address .ShippingAddress { | |
197 | + font-size: 24rpx; | |
198 | + color: rgb(41, 38, 33); | |
199 | + height: 66rpx; | |
200 | +} | |
201 | + | |
202 | +.container .address-box .address-user .edit { | |
203 | + display: flex; | |
204 | + justify-content: center; | |
205 | + margin-left: 60rpx; | |
206 | + height: 100%; | |
207 | + align-items: center; | |
208 | +} | |
209 | + | |
210 | +.container .address-box .address-user .edit image { | |
211 | + width: 41rpx; | |
212 | + height: 38rpx; | |
213 | + align-items: center; | |
214 | +} | |
215 | + | |
216 | +.container .new { | |
217 | + width: 100%; | |
218 | + display: flex; | |
219 | + justify-content: center; | |
220 | + position: fixed; | |
221 | + bottom: 0rpx; | |
222 | + height: 204rpx; | |
223 | + align-items: center; | |
224 | + background-color: rgb(255, 255, 255); | |
225 | +} | |
226 | + | |
227 | +.container .new .add { | |
228 | + margin-right: 10rpx; | |
229 | +} | |
230 | + | |
231 | +.container navigator { | |
232 | + display: flex; | |
233 | + width: 430rpx; | |
234 | + height: 62rpx; | |
235 | + background-color: rgb(239, 22, 51); | |
236 | + border-radius: 40rpx; | |
237 | + justify-content: center; | |
238 | + align-items: center; | |
239 | + color: rgb(255, 255, 255); | |
240 | + font-size: 27rpx; | |
241 | +} | ... | ... |
pages/user/coupons/coupons.js
... | ... | @@ -48,6 +48,7 @@ Page({ |
48 | 48 | show: true, |
49 | 49 | udata: null, |
50 | 50 | iurl:os.imghost, |
51 | + is_show_dhwz:0, | |
51 | 52 | }, |
52 | 53 | // 点击选中二维码 |
53 | 54 | click: function(e) { |
... | ... | @@ -130,7 +131,11 @@ Page({ |
130 | 131 | * 生命周期函数--监听页面加载 |
131 | 132 | */ |
132 | 133 | onLoad: function(options) { |
133 | - | |
134 | + var th = this; | |
135 | + getApp().getConfig2(function (ee) { | |
136 | + var json_d = JSON.parse(ee.switch_list); | |
137 | + th.setData({ is_show_dhwz: json_d.dhwz_switch }); | |
138 | + }) | |
134 | 139 | }, |
135 | 140 | |
136 | 141 | |
... | ... | @@ -165,6 +170,7 @@ Page({ |
165 | 170 | |
166 | 171 | console.log("参数", user_id, store_id); |
167 | 172 | rq.get("/api/weshop/users/getinfo/" + os.stoid + "/" + user_id, { |
173 | + isShowLoading: 0, | |
168 | 174 | success: function (su) { |
169 | 175 | |
170 | 176 | var data = su.data.data; |
... | ... | @@ -186,9 +192,9 @@ Page({ |
186 | 192 | page: e.data.current_page |
187 | 193 | }; |
188 | 194 | var big_arr = this.data.details; |
195 | + wx.showLoading(); | |
189 | 196 | await getApp().request.promiseGet("/api/weshop/users/listQuan", { |
190 | - data: get_data, | |
191 | - isShowLoading: 1, | |
197 | + data: get_data, | |
192 | 198 | }).then(res => { |
193 | 199 | var a = res.data; |
194 | 200 | val = a.data.total; |
... | ... | @@ -211,12 +217,13 @@ Page({ |
211 | 217 | details: big_arr, |
212 | 218 | }); |
213 | 219 | setTimeout(function () { |
214 | - for (var i = 0; i < details.length; i++) { | |
215 | - var no = i + len; | |
216 | - qrcode('qrcode' + no, details[i].CashRepNo, 460, 460); | |
217 | - | |
218 | - } | |
219 | - }, 100) | |
220 | + | |
221 | + for (var i = 0; i < details.length; i++) { | |
222 | + var no = i + len; | |
223 | + qrcode('qrcode' + no, details[i].CashRepNo, 460, 460); | |
224 | + } | |
225 | + wx.hideLoading(); | |
226 | + }, 1000) | |
220 | 227 | |
221 | 228 | }) |
222 | 229 | this.setData({ |
... | ... | @@ -235,7 +242,6 @@ Page({ |
235 | 242 | await getApp().request.promiseGet("/api/weshop/users/listQuan" |
236 | 243 | , { |
237 | 244 | data: get_data, |
238 | - isShowLoading: 1 | |
239 | 245 | }).then(res => { |
240 | 246 | var a = res.data; |
241 | 247 | number= a.data.total; |
... | ... | @@ -267,10 +273,10 @@ Page({ |
267 | 273 | page: e.data.current_page |
268 | 274 | }; |
269 | 275 | var big_arr= this.data.details; |
276 | + wx.showLoading(); | |
270 | 277 | await getApp().request.promiseGet("/api/weshop/users/listQuan" |
271 | 278 | , { |
272 | 279 | data: get_data, |
273 | - isShowLoading: 1 | |
274 | 280 | }).then(res => { |
275 | 281 | var a = res.data; |
276 | 282 | number = a.data.total; |
... | ... | @@ -299,7 +305,9 @@ Page({ |
299 | 305 | qrcode('qrcode' + no, details[i].CashRepNo, 460, 460); |
300 | 306 | |
301 | 307 | } |
302 | - }, 100) | |
308 | + wx.hideLoading(); | |
309 | + | |
310 | + }, 800) | |
303 | 311 | }) |
304 | 312 | }, |
305 | 313 | //---加载更多是靠这个函数---- | ... | ... |
pages/user/coupons/coupons.wxml
... | ... | @@ -9,7 +9,7 @@ |
9 | 9 | </view> |
10 | 10 | <view class='center'> |
11 | 11 | <view class='cen-left' bindtap='query'>微券查询</view> |
12 | - <view class='cen-right' bindtap='exchange'>微券兑换</view> | |
12 | + <view wx:if="{{is_show_dhwz}}" class='cen-right' bindtap='exchange'>微券兑换</view> | |
13 | 13 | </view> |
14 | 14 | <!--选择款--> |
15 | 15 | <view class='top'> | ... | ... |
pages/user/deposit/deposit.js
... | ... | @@ -11,6 +11,7 @@ Page({ |
11 | 11 | yucun_money:0, |
12 | 12 | parameter:true, |
13 | 13 | iurl: o.imghost, |
14 | + is_show_yckcz:0, | |
14 | 15 | }, |
15 | 16 | /** |
16 | 17 | * 生命周期函数--监听页面显示 |
... | ... | @@ -25,6 +26,12 @@ Page({ |
25 | 26 | wx.setNavigationBarTitle({ |
26 | 27 | title: "预存款", |
27 | 28 | }) |
29 | + | |
30 | + var th = this; | |
31 | + getApp().getConfig2(function (ee) { | |
32 | + var json_d = JSON.parse(ee.switch_list); | |
33 | + th.setData({ is_show_yckcz: json_d.yckcz_switch }); | |
34 | + }) | |
28 | 35 | }, |
29 | 36 | |
30 | 37 | /** | ... | ... |
pages/user/deposit/deposit.wxml
... | ... | @@ -7,7 +7,7 @@ |
7 | 7 | </view> |
8 | 8 | </image> |
9 | 9 | <view class="big-rim"> |
10 | - <view class="min-rim-one" type='primary' bindtap='jumPage'> | |
10 | + <view wx:if="{{is_show_yckcz}}" class="min-rim-one" type='primary' bindtap='jumPage'> | |
11 | 11 | <image class="picture-two" src="{{iurl}}/miniapp/images/usermoney/recharge.png"></image> |
12 | 12 | <view class="ldzj-font">预存款充值</view> |
13 | 13 | <image class="picture-five" src="{{iurl}}/miniapp/images/usermoney/left.png"></image> | ... | ... |
pages/user/index/index.wxml
... | ... | @@ -8,7 +8,7 @@ |
8 | 8 | bindtap="go_info" |
9 | 9 | src="{{userInfo.head_pic?userInfo.head_pic:defaultAvatar}}"></image> |
10 | 10 | <view class="xc-uesr-name"> |
11 | - {{userInfo.nickname}} <view class="hvip" wx:if='{{GradeName}}'><image class="vip-mem" src="{{iurl}}/miniapp/images/vip_hg0.png"></image>{{GradeName}}</view> | |
11 | + {{userInfo.nickname}} <view class="hvip" wx:if='{{GradeName && is_init}}'><image class="vip-mem" src="{{iurl}}/miniapp/images/vip_hg0.png"></image>{{GradeName}}</view> | |
12 | 12 | <view class="flex" style="font-size: 24rpx; margin-left:8rpx;margin-top:6rpx" wx:if="{{is_init && gradeId}}" bindtap='jump'> |
13 | 13 | <block wx:if="{{cz_val<full_cz_val}}"> |
14 | 14 | {{" "}}<text class="grow-up-val">成长值</text> <view style='margin-left:5rpx; margin-top:-4rpx;'>{{cz_val}} / {{need_money}}</view> | ... | ... |
pages/user/integral/integral.js
... | ... | @@ -30,6 +30,8 @@ Page({ |
30 | 30 | money:1.00, |
31 | 31 | integral:50, |
32 | 32 | iurl: o.imghost, |
33 | + | |
34 | + is_show_jfcz:0, | |
33 | 35 | }, |
34 | 36 | /** |
35 | 37 | * 刷出积分劵 |
... | ... | @@ -47,9 +49,7 @@ Page({ |
47 | 49 | data:get_data |
48 | 50 | }).then(res => { |
49 | 51 | var msg = res.data; |
50 | - console.log("是什么",msg); | |
51 | - result = msg.data.pageData; | |
52 | - console.log("是什sssssss么", result); | |
52 | + result = msg.data.pageData; | |
53 | 53 | }) |
54 | 54 | e.setData({ |
55 | 55 | result: result |
... | ... | @@ -192,7 +192,11 @@ Page({ |
192 | 192 | * 生命周期函数--监听页面加载 |
193 | 193 | */ |
194 | 194 | onLoad: function (options) { |
195 | - | |
195 | + var th=this; | |
196 | + getApp().getConfig2(function(ee){ | |
197 | + var json_d = JSON.parse(ee.switch_list); | |
198 | + th.setData({ is_show_jfcz: json_d.jfcz_switch }); | |
199 | + }) | |
196 | 200 | }, |
197 | 201 | |
198 | 202 | /** | ... | ... |
pages/user/integral/integral.wxml
... | ... | @@ -16,7 +16,7 @@ |
16 | 16 | <view class="swiper-tab-list {{currentTab==0 ? 'on' : ''}}" data-current="0" >积分明细</view></view> |
17 | 17 | <view class="jfmx-rim"bindtap="swichNav"> |
18 | 18 | <!-- class='ter' --> |
19 | - <view class="swiper-tab-list {{currentTab==1 ? 'on' : ''}}" data-current="1" >积分充值</view></view> | |
19 | + <view wx:if="{{is_show_jfcz}}" class="swiper-tab-list {{currentTab==1 ? 'on' : ''}}" data-current="1" >积分充值</view></view> | |
20 | 20 | </view> |
21 | 21 | <view wx:if="{{jfmx}}"> |
22 | 22 | <view class='body' bindtap="detailed"> |
... | ... | @@ -41,7 +41,8 @@ |
41 | 41 | </view> |
42 | 42 | <view class="val" style='color:{{(details.InIntegral!="0")?"green":""}}'> |
43 | 43 | {{(details.OutIntegral==0)?"+":""}}{{(details.InIntegral==0)?filter.getNum(details.OutIntegral):filter.getNum(details.InIntegral)}}积分 </view> |
44 | - </view> | |
44 | + </view> | |
45 | + <view style="clear:both"></view> | |
45 | 46 | </block> |
46 | 47 | |
47 | 48 | </view> | ... | ... |
pages/user/integral/integral.wxss
... | ... | @@ -431,7 +431,7 @@ line-height:85rpx; |
431 | 431 | } |
432 | 432 | /*左边的数据 */ |
433 | 433 | .left{ |
434 | - width:80%; | |
434 | + width:70%; | |
435 | 435 | height: 120rpx; |
436 | 436 | |
437 | 437 | } |
... | ... | @@ -459,7 +459,7 @@ line-height:85rpx; |
459 | 459 | font-size: 27rpx; |
460 | 460 | font-family: 'SimHei',Arial; |
461 | 461 | text-align:right; |
462 | - | |
462 | + float: right | |
463 | 463 | |
464 | 464 | } |
465 | 465 | /* .更多 */ | ... | ... |
pages/user/order_detail/order_detail.js
... | ... | @@ -112,14 +112,17 @@ Page({ |
112 | 112 | success: function(e) { |
113 | 113 | if(!e.confirm) return false; |
114 | 114 | //如果是秒杀和拼单的商品,取消订单要返回redis,并取消订单 |
115 | - if(is_skill==1 || is_zsorder>=2){ | |
116 | - getApp().request.delete("/api/weshop/order/cancelTeamOrder/"+os.stoid+"/"+o,{ | |
117 | - data:{}, | |
118 | - success: function(t) { | |
119 | - if(t.data.code==0) | |
120 | - th.requestOrderDetail(o), wx.setStorageSync("order:order_list:update", !0); | |
121 | - }, | |
122 | - }) | |
115 | + //if(is_skill==1 || is_zsorder>=2){ | |
116 | + | |
117 | + getApp().request.delete("/api/weshop/order/cancelTeamOrder/"+os.stoid+"/"+o,{ | |
118 | + data:{}, | |
119 | + success: function(t) { | |
120 | + if(t.data.code==0) | |
121 | + th.requestOrderDetail(o), wx.setStorageSync("order:order_list:update", !0); | |
122 | + }, | |
123 | + }) | |
124 | + | |
125 | + /*---- | |
123 | 126 | }else{ |
124 | 127 | getApp().request.put("/api/weshop/order/updatebyId", { |
125 | 128 | data: {order_id: o, order_status: 3}, |
... | ... | @@ -127,7 +130,7 @@ Page({ |
127 | 130 | th.requestOrderDetail(o), wx.setStorageSync("order:order_list:update", !0); |
128 | 131 | } |
129 | 132 | }); |
130 | - } | |
133 | + }--*/ | |
131 | 134 | } |
132 | 135 | }); |
133 | 136 | }, | ... | ... |
pages/user/order_list/order_list.js
... | ... | @@ -194,7 +194,7 @@ Page({ |
194 | 194 | success: function(t) { |
195 | 195 | //如果是秒杀和拼单的商品,取消订单要返回redis,并取消订单 |
196 | 196 | if(t.confirm){ |
197 | - if(is_skill==1 || is_zsorder>=2){ | |
197 | + //if(is_skill==1 || is_zsorder>=2){ | |
198 | 198 | getApp().request.delete("/api/weshop/order/cancelTeamOrder/"+os.stoid+"/"+a,{ |
199 | 199 | data:{}, |
200 | 200 | success: function(t) { |
... | ... | @@ -208,18 +208,7 @@ Page({ |
208 | 208 | getApp().confirmBox(e.data.msg); |
209 | 209 | } |
210 | 210 | }, |
211 | - }) | |
212 | - }else{ | |
213 | - rq.put("/api/weshop/order/updatebyId", { | |
214 | - data: { | |
215 | - order_id: a, order_status: 3 | |
216 | - }, | |
217 | - success: function (t) { | |
218 | - 0 == e.data.activeCategoryId ? | |
219 | - (e.resetData(), e.requestOrderList(e.data.activeCategoryId)) : e.deleteOrderData(a); | |
220 | - } | |
221 | - }); | |
222 | - } | |
211 | + }) | |
223 | 212 | } |
224 | 213 | } |
225 | 214 | }); |
... | ... | @@ -289,7 +278,32 @@ Page({ |
289 | 278 | |
290 | 279 | /*----------跳转支付-----------*/ |
291 | 280 | jumpToCart4: function(t) { |
281 | + var o_index=t.currentTarget.dataset.idx; | |
292 | 282 | var e = this.data.orderList[t.currentTarget.dataset.idx]; |
283 | + var th=this; | |
284 | + | |
285 | + console.log("jumpToCart4"); | |
286 | + console.log(e); | |
287 | + | |
288 | + if(e.order_amount==0){ | |
289 | + var dd = { | |
290 | + parent_sn: e.order_sn, | |
291 | + store_id: e.store_id, | |
292 | + type: 1, | |
293 | + }; | |
294 | + getApp().request.post("/api/weshop/order/pay/createOrder", { | |
295 | + data: dd, | |
296 | + success: function (t) { | |
297 | + if(t.data.code==0){ | |
298 | + th.onload(); | |
299 | + }else{ | |
300 | + getApp().confirmBox(t.data.msg+"请您取消该订单"); | |
301 | + } | |
302 | + } | |
303 | + }) | |
304 | + return false; | |
305 | + } | |
306 | + | |
293 | 307 | a.jumpToCart4({ |
294 | 308 | order_sn: e.order_sn, |
295 | 309 | order_amount: e.order_amount, | ... | ... |
utils/regions/Regions.js
... | ... | @@ -38,6 +38,9 @@ var s = function() { |
38 | 38 | return s(a, [ { |
39 | 39 | key: "openRegionsModal", |
40 | 40 | value: function(t) { |
41 | + this.page.setData({ | |
42 | + disabled:1 | |
43 | + }); | |
41 | 44 | var s = this, a = t.currentTarget.dataset.id, i = t.currentTarget.dataset.name; |
42 | 45 | isNaN(parseInt(a)) || !parseInt(a) ? (a = 0, this.currentArea = 0) : (0 == this.currentArea ? (this.address.province_name = i, |
43 | 46 | this.address.province = a, this.address.city_name = "", this.address.city = 0, this.address.district_name = "", |
... | ... | @@ -55,13 +58,14 @@ var s = function() { |
55 | 58 | t.data.data.pageData && t.data.data.pageData.length > 0 ? s.page.setData(e({}, s.dataName, { |
56 | 59 | regions: t.data.data.pageData, |
57 | 60 | showRegionsModal: !0 |
58 | - })) : s.endCall(a, i); | |
61 | + })) : s.endCall(a, i); | |
59 | 62 | } |
60 | 63 | }) : this.endCall(a, i); |
61 | 64 | } |
62 | 65 | }, { |
63 | 66 | key: "closeRegionsModal", |
64 | 67 | value: function() { |
68 | + this.page.setData({disabled:0}); | |
65 | 69 | this.page.setData(e({}, this.dataName, { |
66 | 70 | showCategoryModal: !1 |
67 | 71 | })); | ... | ... |