Commit bb969fc24f9e97798fb3265039a1249cbc87dc50

Authored by yvan.ni
1 parent cd0d4335

提交订单页面,修改

pages/cart/cart2/cart2.js
@@ -72,17 +72,17 @@ Page({ @@ -72,17 +72,17 @@ Page({
72 //选择的券列表 72 //选择的券列表
73 selected_quan_list:null, 73 selected_quan_list:null,
74 //选择的券的门店 74 //选择的券的门店
75 - selected_quan_pick:null, 75 + selected_quan_pick:null,
76 is_close_quan:0, 76 is_close_quan:0,
77 disabled:0, 77 disabled:0,
78 open_express:0,//控制选择物流名列表 的属性 78 open_express:0,//控制选择物流名列表 的属性
79 -  
80 79
81 - is_express:0,//选中物流的属性  
82 - expres_name:"",//点击选定  
83 - isopen:0,//券的说明  
84 - is_coupon:55555,//选择券的控制属性 80 + is_express:0, //选中物流的属性
  81 + expres_name:"", //点击选定
  82 + isopen:0, //券的说明
  83 + is_coupon:null, //选择券的控制属性
85 is_shipping_code:"",//插入用户默认地址 84 is_shipping_code:"",//插入用户默认地址
  85 + wu_arr_txt:"", //要更新的物流的字段
86 }, 86 },
87 onLoad: function(t) { 87 onLoad: function(t) {
88 88
@@ -97,7 +97,6 @@ Page({ @@ -97,7 +97,6 @@ Page({
97 } 97 }
98 }); 98 });
99 99
100 -  
101 }, 100 },
102 onUnload: function () { this.setData({ isclose: 1 })}, 101 onUnload: function () { this.setData({ isclose: 1 })},
103 102
@@ -1400,26 +1399,32 @@ Page({ @@ -1400,26 +1399,32 @@ Page({
1400 } 1399 }
1401 return arr; 1400 return arr;
1402 }, 1401 },
1403 - // // 开启物流的弹窗  
1404 - express_name:function(){  
1405 - this.setData({ open_express: 1});  
1406 1402
  1403 + //// 开启物流的弹窗
  1404 + show_wu_arr:function(e){
  1405 + var wu_arr_txt=e.currentTarget.dataset.txt;
  1406 + this.setData({ open_express: 1,wu_arr_txt:wu_arr_txt});
1407 }, 1407 },
1408 // 关闭物流的弹窗 1408 // 关闭物流的弹窗
1409 close_express:function(){ 1409 close_express:function(){
1410 this.setData({ open_express:0 }); 1410 this.setData({ open_express:0 });
1411 }, 1411 },
1412 - // 选择物流 1412 + // 选择物流
1413 click_express_name:function(e){ 1413 click_express_name:function(e){
1414 var express_name = e.currentTarget.dataset.name, shippingcode = e.currentTarget.dataset.shippingcode; 1414 var express_name = e.currentTarget.dataset.name, shippingcode = e.currentTarget.dataset.shippingcode;
1415 - console.log("判断是不是11111111111111111111111111111", shippingcode);  
1416 var index=e.currentTarget.dataset.idxe; 1415 var index=e.currentTarget.dataset.idxe;
1417 - this.setData({ is_express: index, index: index, is_shipping_code: shippingcode}); 1416 + var ob={ is_express: index, is_shipping_code: shippingcode};
  1417 + ob[this.data.wu_arr_txt]=index;
  1418 + this.setData(ob);
1418 }, 1419 },
  1420 +
1419 //点击确定物流 1421 //点击确定物流
1420 determine_expres:function(e){ 1422 determine_expres:function(e){
1421 this.setData({ open_express: 0}); 1423 this.setData({ open_express: 0});
1422 - this.calculatePrice(); 1424 + if(this.data.is_b_now==1)
  1425 + this.calculatePrice2();
  1426 + else
  1427 + this.calculatePrice();
1423 }, 1428 },
1424 1429
1425 //点击打开优惠券使用说明 1430 //点击打开优惠券使用说明
@@ -1452,7 +1457,8 @@ Page({ @@ -1452,7 +1457,8 @@ Page({
1452 if (rse.data.code==0){ 1457 if (rse.data.code==0){
1453 th.setData({ open_express: 0 }); 1458 th.setData({ open_express: 0 });
1454 //----计算此时购物车的价格---- 1459 //----计算此时购物车的价格----
1455 - th.calculatePrice(); 1460 + if(th.data.is_b_now==1) th.calculatePrice2();
  1461 + else th.calculatePrice();
1456 } 1462 }
1457 } 1463 }
1458 }) 1464 })
pages/cart/cart2/cart2.wxml
@@ -118,10 +118,10 @@ @@ -118,10 +118,10 @@
118 </view> 118 </view>
119 </view> 119 </view>
120 <block wx:if="{{item.exp_type==0}}"> 120 <block wx:if="{{item.exp_type==0}}">
121 - <view class="flex-vertical" bindtap="show" data-txt='cartlist[{{pidx}}].wind'>  
122 - <view >{{wu_arr[item.wind].name}}</view>  
123 - <view class="xc-right"></view>  
124 - </view> 121 + <!-- 点击显示物流选择 -->
  122 + <view class="flex-vertical" bindtap="show_wu_arr" data-txt='cartlist[{{pidx}}].wind'>
  123 + <view >{{wu_arr[item.wind].name}}</view><view class="xc-right"></view>
  124 + </view>
125 </block> 125 </block>
126 </view> 126 </view>
127 127
@@ -157,9 +157,7 @@ @@ -157,9 +157,7 @@
157 <!------立即购买--------> 157 <!------立即购买-------->
158 <view class="xc-border xc-border"></view> 158 <view class="xc-border xc-border"></view>
159 <block wx:if="{{is_b_now==1}}"> 159 <block wx:if="{{is_b_now==1}}">
160 -  
161 <view class="use-item bfff"> 160 <view class="use-item bfff">
162 -  
163 <image class="dp" src='{{imgUrl}}/miniapp/images/dianpu.png'> </image> <view>门店:{{bn_pickname}}</view></view> 161 <image class="dp" src='{{imgUrl}}/miniapp/images/dianpu.png'> </image> <view>门店:{{bn_pickname}}</view></view>
164 <view class="order-detail"> 162 <view class="order-detail">
165 <view class="goods-img"> 163 <view class="goods-img">
@@ -209,12 +207,9 @@ @@ -209,12 +207,9 @@
209 <view class="yu_er">物流</view> 207 <view class="yu_er">物流</view>
210 </view> 208 </view>
211 </view> 209 </view>
212 - <block wx:if="{{item.exp_type==0}}">  
213 - <view class="flex-vertical">  
214 - <view class="logistics-name">{{wu_arr[index].name}}</view>  
215 - <view class="xc-right"></view>  
216 - </view>  
217 - </block> 210 + <block wx:if="{{bn_exp_type==0}}">
  211 + <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>
  212 + </block>
218 </view> 213 </view>
219 214
220 </view> 215 </view>
@@ -419,9 +414,7 @@ @@ -419,9 +414,7 @@
419 </view > 414 </view >
420 </view> 415 </view>
421 416
422 -  
423 <!----弹起选择物流名的列表----> 417 <!----弹起选择物流名的列表---->
424 -  
425 <view wx:if='{{open_express==1}}' > 418 <view wx:if='{{open_express==1}}' >
426 <view class="cover-layer flex-center " bindtap='close_express'> 419 <view class="cover-layer flex-center " bindtap='close_express'>
427 </view> 420 </view>
@@ -439,7 +432,10 @@ @@ -439,7 +432,10 @@
439 </view> 432 </view>
440 <view class="express_list"> 433 <view class="express_list">
441 <view wx:for="{{wu_arr}}" wx:for-item="express_list" wx:for-index="idx"> 434 <view wx:for="{{wu_arr}}" wx:for-item="express_list" wx:for-index="idx">
442 - <view class="express_list_frame" bindtap="click_express_name" data-shippingcode="{{express_list.shipping_code}}" data-name="{{express_list.name}}" data-idxe="{{idx}}"> 435 + <view class="express_list_frame" bindtap="click_express_name"
  436 + data-shippingcode="{{express_list.shipping_code}}"
  437 + data-name="{{express_list.name}}" data-idxe="{{idx}}">
  438 +
443 <block wx:if="{{is_express==idx}}"> 439 <block wx:if="{{is_express==idx}}">
444 <view class="circle white xc-hook fs20 red-b"><text>Γ</text></view> 440 <view class="circle white xc-hook fs20 red-b"><text>Γ</text></view>
445 </block> 441 </block>
@@ -465,5 +461,4 @@ @@ -465,5 +461,4 @@
465 461
466 462
467 463
468 -  
469 <warn id="warn"></warn> 464 <warn id="warn"></warn>
470 \ No newline at end of file 465 \ No newline at end of file