Commit 684a7cd8d00ae234c42d0b136d94a298d99d28db
1 parent
bff605ba
订单提交的结果~
Showing
4 changed files
with
387 additions
and
20 deletions
pages/cart/cart2/cart2.js
... | ... | @@ -97,12 +97,6 @@ Page({ |
97 | 97 | } |
98 | 98 | }); |
99 | 99 | |
100 | - }, | |
101 | - onUnload: function () { this.setData({ isclose: 1 })}, | |
102 | - | |
103 | - //----------子页返回父页触发---------- | |
104 | - onShow: function() { | |
105 | - var th=this; | |
106 | 100 | //先获取是否有关闭使用优惠券 |
107 | 101 | getApp().getConfig2(function (ee) { |
108 | 102 | var json_d = JSON.parse(ee.switch_list); |
... | ... | @@ -111,8 +105,12 @@ Page({ |
111 | 105 | th.get_wuliu(th.get_info(th.show_page)); |
112 | 106 | }) |
113 | 107 | |
108 | + }, | |
109 | + onUnload: function () { this.setData({ isclose: 1 })}, | |
114 | 110 | |
115 | - console.log(th.data.isclose); | |
111 | + //----------子页返回父页触发---------- | |
112 | + onShow: function() { | |
113 | + var th=this; | |
116 | 114 | if (th.data.isclose==0){ |
117 | 115 | /*--- |
118 | 116 | wx.navigateTo({ |
... | ... | @@ -124,7 +122,7 @@ Page({ |
124 | 122 | }) |
125 | 123 | |
126 | 124 | }else{ |
127 | - this.getuser_addr(function(ie){ | |
125 | + this.getuser_addr(function(ie){ | |
128 | 126 | |
129 | 127 | console.log("getuser_addr") |
130 | 128 | console.log(ie) |
... | ... | @@ -146,6 +144,12 @@ Page({ |
146 | 144 | },500) |
147 | 145 | |
148 | 146 | }); |
147 | + //--更新默认地址--,看一下是不是跳到地址页面 | |
148 | + if(!getApp().globalData.is_cart2_old){ | |
149 | + this.update_code(); | |
150 | + }else{ | |
151 | + getApp().globalData.is_cart2_old=0; | |
152 | + } | |
149 | 153 | } |
150 | 154 | }, |
151 | 155 | |
... | ... | @@ -1090,6 +1094,7 @@ Page({ |
1090 | 1094 | }); |
1091 | 1095 | }, |
1092 | 1096 | enterAddressPage: function() { |
1097 | + getApp().globalData.is_cart_old=1; | |
1093 | 1098 | this.data.enterAddressPage = !0, wx.navigateTo({ |
1094 | 1099 | url: "/pages/user/address_list/address_list?is_back=1" |
1095 | 1100 | }); |
... | ... | @@ -1463,6 +1468,38 @@ Page({ |
1463 | 1468 | } |
1464 | 1469 | } |
1465 | 1470 | }) |
1466 | - | |
1467 | 1471 | }, |
1472 | + | |
1473 | + //更新下默认,在onshow里面 | |
1474 | + update_code(){ | |
1475 | + var th=this,m_wind=0,def_exp_code=getApp().globalData.userInfo.def_exp_code; | |
1476 | + //--定时器,判断wu_arr不未空-- | |
1477 | + var uii=setInterval(function () { | |
1478 | + if(th.data.wu_arr) clearInterval(uii); | |
1479 | + else { | |
1480 | + for (var k = 0; k < th.data.wu_arr.length; k++) { | |
1481 | + var item = th.data.wu_arr[k]; | |
1482 | + if (def_exp_code == item.code) { m_wind = k; } | |
1483 | + } | |
1484 | + //--如果是立即购买-- | |
1485 | + if (this.data.is_b_now == 1) { | |
1486 | + th.setData({index: m_wind}); | |
1487 | + } else { | |
1488 | + var ui = setInterval(function () { | |
1489 | + if (th.data.cartlist) { | |
1490 | + var c_arr = th.data.cartlist; | |
1491 | + for (var i in c_arr) { | |
1492 | + c_arr[i].wind = m_wind; | |
1493 | + } | |
1494 | + th.setData({cartlist: c_arr}) | |
1495 | + | |
1496 | + clearInterval(ui); | |
1497 | + } | |
1498 | + }, 500) | |
1499 | + } | |
1500 | + } | |
1501 | + },500); | |
1502 | + } | |
1503 | + | |
1504 | + | |
1468 | 1505 | }); | ... | ... |
pages/cart/cart2_pt/cart2_pt.js
... | ... | @@ -213,18 +213,21 @@ Page({ |
213 | 213 | |
214 | 214 | //----------子页返回父页触发---------- |
215 | 215 | onShow: function() { |
216 | - console.log('onshow'); | |
217 | 216 | var th=this; |
218 | - console.log(th.data.isclose); | |
219 | 217 | if (th.data.isclose==0){ |
220 | 218 | wx.switchTab({ |
221 | 219 | url: "/pages/index/index/index" |
222 | 220 | }) |
223 | - | |
224 | 221 | }else{ |
225 | - this.getuser_addr(function(ie){ | |
226 | - th.setData({user_addr: ie }); | |
227 | - }) | |
222 | + this.getuser_addr(function(ie){ | |
223 | + th.setData({user_addr: ie }); | |
224 | + }) | |
225 | + //--更新默认地址--,看一下是不是跳到地址页面 | |
226 | + if(!getApp().globalData.is_cart2_old){ | |
227 | + this.update_code(); | |
228 | + }else{ | |
229 | + getApp().globalData.is_cart2_old=0; | |
230 | + } | |
228 | 231 | } |
229 | 232 | }, |
230 | 233 | //---------------检查是否有收货地址------------------- |
... | ... | @@ -536,6 +539,7 @@ Page({ |
536 | 539 | }); |
537 | 540 | }, |
538 | 541 | enterAddressPage: function() { |
542 | + getApp().globalData.is_cart2_old=1; | |
539 | 543 | this.data.enterAddressPage = !0, wx.navigateTo({ |
540 | 544 | url: "/pages/user/address_list/address_list?operate=select" |
541 | 545 | }); |
... | ... | @@ -661,6 +665,48 @@ Page({ |
661 | 665 | var ob = {}; |
662 | 666 | ob[txt] = this.data.imgUrl + "/miniapp/images/default_g_img.gif"; |
663 | 667 | this.setData(ob); |
664 | - } | |
668 | + }, | |
669 | + | |
670 | + //// 开启物流的弹窗 | |
671 | + show_wu_arr:function(e){ | |
672 | + this.setData({ open_express: 1}); | |
673 | + }, | |
674 | + | |
675 | + //更新下默认,在onshow里面 | |
676 | + update_code(){ | |
677 | + var th=this,m_wind=0,def_exp_code=getApp().globalData.userInfo.def_exp_code; | |
678 | + | |
679 | + var uii=setInterval(function () { | |
680 | + if(th.data.wu_arr) clearInterval(uii); | |
681 | + else { | |
682 | + for (var k = 0; k < th.data.wu_arr.length; k++) { | |
683 | + var item = th.data.wu_arr[k]; | |
684 | + if (def_exp_code == item.code) { | |
685 | + m_wind = k; | |
686 | + } | |
687 | + } | |
688 | + //--如果是立即购买-- | |
689 | + th.setData({index: m_wind}); | |
690 | + } | |
691 | + },500) | |
692 | + }, | |
693 | + | |
694 | + // 关闭物流的弹窗 | |
695 | + close_express:function(){ | |
696 | + this.setData({ open_express:0 }); | |
697 | + }, | |
698 | + // 选择物流 | |
699 | + click_express_name:function(e){ | |
700 | + var express_name = e.currentTarget.dataset.name, shippingcode = e.currentTarget.dataset.shippingcode; | |
701 | + var index=e.currentTarget.dataset.idxe; | |
702 | + var ob={ is_express: index, is_shipping_code: shippingcode,index:index}; | |
703 | + this.setData(ob); | |
704 | + }, | |
705 | + | |
706 | + //点击确定物流 | |
707 | + determine_expres:function(e){ | |
708 | + this.setData({ open_express: 0}); | |
709 | + this.calculatePrice2(); | |
710 | + }, | |
665 | 711 | |
666 | 712 | }); | ... | ... |
pages/cart/cart2_pt/cart2_pt.wxml
... | ... | @@ -51,17 +51,22 @@ |
51 | 51 | |
52 | 52 | <!--阶梯团是不显示的--> |
53 | 53 | <view class="use-item" wx:if="{{kt_type!=3 || is_normal==1}}"> |
54 | + <view class="flex-vertical"> | |
54 | 55 | <view bindtap='setexptype' data-t='1' style="display:{{bn_t_exp_t==2?'none':'flex'}};"> |
55 | 56 | <icon color="{{bn_exp_type==1?'red':'gray'}}" size="16" type="success"></icon> |
56 | 57 | <view class="yu_er">自提</view> |
57 | 58 | </view> |
58 | - <view bindtap='setexptype' data-t='0' style="display:{{bn_t_exp_t==1?'none':'flex'}};"> | |
59 | + <view bindtap='setexptype' data-t='0' style="margin-left: 45rpx;display:{{bn_t_exp_t==1?'none':'flex;align-items:center;'}};"> | |
59 | 60 | <icon color="{{bn_exp_type==0?'red':'gray'}}" size="16" type="success"></icon> |
60 | 61 | <view class="yu_er">物流</view> |
61 | 62 | </view> |
62 | 63 | </view> |
64 | + <block wx:if="{{bn_exp_type==0}}"> | |
65 | + <view class="flex-vertical" bindtap="show_wu_arr" data-txt='index'><view class="logistics-name">{{wu_arr[index].name}}</view><view class="xc-right"></view></view> | |
66 | + </block> | |
67 | + </view> | |
63 | 68 | |
64 | - <!--阶梯团是不显示的--> | |
69 | + <!--阶梯团是不显示的 | |
65 | 70 | <block wx:if="{{kt_type!=3 || is_normal==1 }}"> |
66 | 71 | <view class="use-item" hidden='{{bn_exp_type==1}}'> |
67 | 72 | <view>使用物流:</view> |
... | ... | @@ -69,7 +74,7 @@ |
69 | 74 | <view >{{wu_arr[index].name}}</view> |
70 | 75 | </picker> |
71 | 76 | </view> |
72 | - </block> | |
77 | + </block>--> | |
73 | 78 | |
74 | 79 | </view> |
75 | 80 | |
... | ... | @@ -122,5 +127,49 @@ |
122 | 127 | </view> |
123 | 128 | </form> |
124 | 129 | |
130 | +<!----弹起选择物流名的列表----> | |
131 | +<view wx:if='{{open_express==1}}' > | |
132 | + <view class="cover-layer flex-center " bindtap='close_express'> | |
133 | + </view> | |
134 | + | |
135 | + <view class="cx-popup radius {{open_express==1?'up' : 'down'}}" > | |
136 | + <view class="tops flex"> | |
137 | + <view class="top-content fs32"> | |
138 | + <view> | |
139 | + 选择物流名字 | |
140 | + </view> | |
141 | + </view> | |
142 | + <view class="close-frame" bindtap='close_express' > | |
143 | + <view class="xc-close-express">×</view> | |
144 | + </view> | |
145 | + </view> | |
146 | + <view class="express_list"> | |
147 | + <view wx:for="{{wu_arr}}" wx:for-item="express_list" wx:for-index="idx"> | |
148 | + <view class="express_list_frame" bindtap="click_express_name" | |
149 | + data-shippingcode="{{express_list.shipping_code}}" | |
150 | + data-name="{{express_list.name}}" data-idxe="{{idx}}"> | |
151 | + | |
152 | + <block wx:if="{{is_express==idx}}"> | |
153 | + <view class="circle white xc-hook fs20 red-b"><text>Γ</text></view> | |
154 | + </block> | |
155 | + <block wx:else> | |
156 | + <view class="circle xc-hooks"></view> | |
157 | + </block> | |
158 | + <view class="fs30">{{express_list.name}}</view> | |
159 | + | |
160 | + </view> | |
161 | + </view> | |
162 | + </view> | |
163 | + <view class="flex click-buttem" > | |
164 | + <view class="xc-determine flex-center" bindtap="determine_expres"> | |
165 | + <view class="flex-vertical t-c">确定</view> | |
166 | + </view> | |
167 | + <view class="xc-confirms flex-center" bindtap="select_default_logistics"> | |
168 | + <view class="flex-vertical t-c">设为默认</view> | |
169 | + </view> | |
170 | + </view> | |
171 | + | |
172 | + </view > | |
173 | +</view> | |
125 | 174 | |
126 | 175 | <warn id="warn"></warn> | ... | ... |
pages/cart/cart2_pt/cart2_pt.wxss
... | ... | @@ -98,6 +98,8 @@ |
98 | 98 | border-bottom: 1px solid #ddd; |
99 | 99 | font-size: 30rpx; |
100 | 100 | padding-left: 20rpx; |
101 | + justify-content: space-between; | |
102 | + | |
101 | 103 | |
102 | 104 | } |
103 | 105 | .use-item>view{ |
... | ... | @@ -269,5 +271,238 @@ |
269 | 271 | .add_new{height: 60rpx; line-height: 60rpx;} |
270 | 272 | .addr_jia{width: 45rpx; height: 45rpx; border: 1rpx solid #ddd; |
271 | 273 | margin-right: 15rpx; margin-left: 20rpx; vertical-align: middle;} |
272 | -.yu_er{margin-left: 15rpx;} .wuliu{margin-left: 20rpx;} | |
274 | +.yu_er{margin-left: 15rpx;} .wuliu{margin-left: 20rpx;} | |
275 | + | |
276 | + | |
277 | +/* 自定义弹出窗口 */ | |
278 | +.cx-popup{ | |
279 | + width:100%; | |
280 | + height:920rpx; | |
281 | + background: #fff; | |
282 | + z-index: 35; | |
283 | + border-top-left-radius: 20rpx; | |
284 | + border-top-right-radius: 20rpx; | |
285 | + position:fixed; | |
286 | + bottom:0; | |
287 | + padding-bottom: 25rpx; | |
288 | + | |
289 | +} | |
290 | + | |
291 | +.cx-popup .top{ | |
292 | + width:95%; | |
293 | + height:100rpx; | |
294 | + border-bottom:3rpx solid #ddd; | |
295 | + margin: auto; | |
296 | + margin-top: 30rpx; | |
297 | + | |
298 | +} | |
299 | +.xc-top-content{ | |
300 | + width: 93%; | |
301 | + height:85rpx; | |
302 | + padding-top: 30rpx; | |
303 | + font-size: 34rpx; | |
304 | + font-weight: 600; | |
305 | + | |
306 | +} | |
307 | + | |
308 | + | |
309 | +.xc-valid-coupon{ | |
310 | + width: 90%; | |
311 | + height:40rpx; | |
312 | + padding-top: 24rpx; | |
313 | + overflow: hidden; | |
314 | +} | |
315 | +.xc-frame{ | |
316 | + width: 100%; | |
317 | + height:68.9%; | |
318 | +} | |
319 | + | |
320 | +.xc-frame .list-frame{ | |
321 | + width: 95%; | |
322 | + height: 100%; | |
323 | + overflow-y:scroll; | |
324 | + | |
325 | +} | |
326 | +.xc-close-frame{ | |
327 | + margin-top:-10rpx; | |
328 | + | |
329 | +} | |
330 | + | |
331 | +.xc-close{ | |
332 | + width: 37rpx; | |
333 | + height: 37rpx; | |
334 | + border-radius: 50%; | |
335 | + border: 3rpx solid #333; | |
336 | + text-align: center; | |
337 | + line-height: 34rpx; | |
338 | + font-size: 29rpx; | |
339 | + color: #333; | |
340 | + | |
341 | +} | |
342 | +.xc-money{ | |
343 | + color: #af2346; | |
344 | + font-size: 35rpx; | |
345 | +} | |
346 | + | |
347 | +.xc-money-frame{ | |
348 | + margin-left:35rpx; | |
349 | + | |
350 | +} | |
351 | +.xc-coupon-effect{ | |
352 | + width: 99%; | |
353 | + min-height: 100rpx; | |
354 | + border-bottom:3rpx solid #ddd; | |
355 | + | |
356 | + | |
357 | +} | |
358 | +.xc-goods-coupon{ | |
359 | + width: 85%; | |
360 | + height:100%; | |
361 | + | |
362 | +} | |
363 | +.xc-title{ | |
364 | + width:50%; | |
365 | + margin-left:222rpx; | |
366 | + | |
367 | +} | |
368 | +.xc-coupon-money0{ | |
369 | + color: #c91e31; | |
370 | + font-size: 35rpx; | |
371 | + line-height: 40rpx; | |
372 | + | |
373 | +} | |
374 | +.xc-coupon-money{ | |
375 | + color: #c91e31; | |
376 | + font-size: 35rpx; | |
377 | + line-height: 40rpx; | |
378 | + padding-top: 10px; | |
379 | + | |
380 | +} | |
381 | +.xc-coupon-money1{ | |
382 | + color: #444; | |
383 | + font-size: 28rpx; | |
384 | + line-height: 60rpx; | |
385 | + | |
386 | + | |
387 | +} | |
388 | +.xc-coupon-time{ | |
389 | + height: 50rpx; | |
390 | + font-size: 27rpx; | |
391 | + color: #a4a4a4; | |
392 | +} | |
393 | +.xc-coupon-time .time{ | |
394 | + margin-left: 15rpx; | |
395 | + font-size: 27rpx; | |
396 | +} | |
397 | +.xc-coupon-selection{ | |
398 | + height:100%; | |
399 | +} | |
400 | + | |
401 | +.xc-confirm { | |
402 | + width: 48%; | |
403 | + border-radius: 50rpx; | |
404 | + height: 50rpx; | |
405 | + margin:0 auto; | |
406 | + background:#d60021; | |
407 | + color:#fff; | |
408 | + font-size:28rpx; | |
409 | + margin-top: 28rpx; | |
410 | +} | |
411 | + | |
412 | +.up{ animation: up .7s; } | |
413 | +.down{ animation: down 1s; } | |
414 | +@keyframes up { 0% { transform: translateY(550rpx); } 100% { transform: translateY(0); } } | |
415 | +@keyframes down { 0% { transform: translateY(0); } 100% { transform: translateY(550rpx); } } | |
416 | + | |
417 | +.xc-not-Selection{ | |
418 | + width: 40rpx; | |
419 | + height: 40rpx; | |
420 | + background: #eeeeee; | |
421 | +} | |
422 | + | |
423 | + | |
424 | +.xc-close-express{ | |
425 | + width: 40rpx; | |
426 | + height: 40rpx; | |
427 | + border-radius: 50%; | |
428 | + border: 3rpx solid #333; | |
429 | + text-align: center; | |
430 | + font-size:32rpx; | |
431 | + line-height: 38rpx; | |
432 | + color: #333; | |
433 | + margin-top: 5rpx; | |
434 | +} | |
435 | +.cx-popup .tops{ | |
436 | + width: 100%; | |
437 | + height: 145rpx; | |
438 | + border-bottom: 3rpx solid #eee; | |
439 | + | |
440 | +} | |
441 | +.top-content { | |
442 | + width: 82%; | |
443 | + padding-top: 33px; | |
444 | + height: 100%; | |
445 | + padding-left: 40rpx; | |
446 | +} | |
447 | +.close-frame{ | |
448 | + margin-top: 30rpx; | |
449 | + | |
450 | +} | |
451 | +.cx-popup.radius{ | |
452 | + | |
453 | + height: 650rpx; | |
454 | + | |
455 | +} | |
456 | +.xc-hook { | |
457 | + width: 33rpx; | |
458 | + height: 33rpx; | |
459 | + transform: rotate(-135deg); | |
460 | + line-height: 35rpx; | |
461 | + text-align: center; | |
462 | + margin-right: 20rpx | |
463 | + | |
464 | + | |
465 | +} | |
466 | +.xc-hooks { | |
467 | + width: 30rpx; | |
468 | + height: 30rpx; | |
469 | + border: 1rpx solid #999; | |
470 | + margin-right: 20rpx; | |
471 | +} | |
472 | +.express_list_frame{ | |
473 | + display: flex; | |
474 | + height: 80rpx; | |
475 | + align-items: center; | |
476 | + padding-left: 40rpx; | |
477 | + border-bottom: 1rpx solid #eee; | |
478 | + | |
479 | +} | |
480 | +.express_list{ | |
481 | + width: 100%; | |
482 | + height: 65%; | |
483 | + overflow-y: scroll; | |
484 | + overflow: hidden; | |
485 | +} | |
486 | +.xc-confirms { | |
487 | + width: 40%; | |
488 | + border-radius: 50rpx; | |
489 | + height: 55rpx; | |
490 | + margin:0 auto; | |
491 | + font-size:28rpx; | |
492 | + background: #fff; | |
493 | + color: #333; | |
494 | + border: 2rpx solid #333; | |
495 | + | |
496 | +} | |
497 | + | |
498 | +.xc-right{ | |
499 | + width:20rpx; | |
500 | + height:20rpx; | |
501 | + border-top:2rpx solid #000; | |
502 | + border-right:2rpx solid #000; | |
503 | + transform:rotate(45deg); | |
504 | + display:inline-block; | |
505 | + | |
506 | +} | |
507 | + | |
273 | 508 | ... | ... |