Commit 7c3b287fb8d7c8106a9ea3f92af23bf6cbf0400e

Authored by 后端开发-许程
2 parents bd77643e bfe84779

Merge branch 'work-1.1_20191010' of http://git.vipzhuang.cn/wxd/MShopWeApp into work-1.1_20191010

pages/cart/cart2/cart2.js
... ... @@ -72,17 +72,17 @@ Page({
72 72 //选择的券列表
73 73 selected_quan_list:null,
74 74 //选择的券的门店
75   - selected_quan_pick:null,
  75 + selected_quan_pick:null,
76 76 is_close_quan:0,
77 77 disabled:0,
78 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 84 is_shipping_code:"",//插入用户默认地址
  85 + wu_arr_txt:"", //要更新的物流的字段
86 86 },
87 87 onLoad: function(t) {
88 88  
... ... @@ -97,7 +97,6 @@ Page({
97 97 }
98 98 });
99 99  
100   -
101 100 },
102 101 onUnload: function () { this.setData({ isclose: 1 })},
103 102  
... ... @@ -291,7 +290,7 @@ Page({
291 290 var m_wind=0,def_exp_code=getApp().globalData.userInfo.def_exp_code;
292 291 if(e_t==0 && def_exp_code){
293 292 for(var k=0;k<th.data.wu_arr.length;k++){
294   - var item=th.data.wu_arr[k]; if(def_exp_code=item.code){ m_wind=k; }
  293 + var item=th.data.wu_arr[k]; if(def_exp_code==item.code){ m_wind=k; }
295 294 }
296 295 }
297 296  
... ... @@ -400,7 +399,7 @@ Page({
400 399 var m_wind=0,def_exp_code=getApp().globalData.userInfo.def_exp_code;
401 400 if(et==0 && def_exp_code){
402 401 for(var k=0;k<th.data.wu_arr.length;k++){
403   - var item=th.data.wu_arr[k]; if(def_exp_code=item.code){ m_wind=k; }
  402 + var item=th.data.wu_arr[k]; if(def_exp_code==item.code){ m_wind=k; }
404 403 }
405 404 }
406 405  
... ... @@ -668,11 +667,12 @@ Page({
668 667 all_shipping_m += th.data.cartlist[i].shipping_price;
669 668 all_order_m += th.data.cartlist[i].order_amount;
670 669 all_user_m += th.data.cartlist[i].user_money;
671   - all_coupon_price_m+=th.data.cartlist[i].coupon_price;
  670 + all_coupon_price_m=parseFloat(all_coupon_price_m)+parseFloat(th.data.cartlist[i].coupon_price);
672 671  
673 672  
674 673 }
675 674  
  675 + all_shipping_m=parseFloat(all_shipping_m).toFixed(2);
676 676 all_total_m = parseFloat(all_total_m).toFixed(2);
677 677 all_order_m = parseFloat(all_order_m).toFixed(2);
678 678 all_price = parseFloat(all_price).toFixed(2);
... ... @@ -1400,26 +1400,32 @@ Page({
1400 1400 }
1401 1401 return arr;
1402 1402 },
1403   - // // 开启物流的弹窗
1404   - express_name:function(){
1405   - this.setData({ open_express: 1});
1406 1403  
  1404 + //// 开启物流的弹窗
  1405 + show_wu_arr:function(e){
  1406 + var wu_arr_txt=e.currentTarget.dataset.txt;
  1407 + this.setData({ open_express: 1,wu_arr_txt:wu_arr_txt});
1407 1408 },
1408 1409 // 关闭物流的弹窗
1409 1410 close_express:function(){
1410 1411 this.setData({ open_express:0 });
1411 1412 },
1412   - // 选择物流
  1413 + // 选择物流
1413 1414 click_express_name:function(e){
1414 1415 var express_name = e.currentTarget.dataset.name, shippingcode = e.currentTarget.dataset.shippingcode;
1415   - console.log("判断是不是11111111111111111111111111111", shippingcode);
1416 1416 var index=e.currentTarget.dataset.idxe;
1417   - this.setData({ is_express: index, index: index, is_shipping_code: shippingcode});
  1417 + var ob={ is_express: index, is_shipping_code: shippingcode};
  1418 + ob[this.data.wu_arr_txt]=index;
  1419 + this.setData(ob);
1418 1420 },
  1421 +
1419 1422 //点击确定物流
1420 1423 determine_expres:function(e){
1421 1424 this.setData({ open_express: 0});
1422   - this.calculatePrice();
  1425 + if(this.data.is_b_now==1)
  1426 + this.calculatePrice2();
  1427 + else
  1428 + this.calculatePrice();
1423 1429 },
1424 1430  
1425 1431 //点击打开优惠券使用说明
... ... @@ -1452,7 +1458,8 @@ Page({
1452 1458 if (rse.data.code==0){
1453 1459 th.setData({ open_express: 0 });
1454 1460 //----计算此时购物车的价格----
1455   - th.calculatePrice();
  1461 + if(th.data.is_b_now==1) th.calculatePrice2();
  1462 + else th.calculatePrice();
1456 1463 }
1457 1464 }
1458 1465 })
... ...
pages/cart/cart2/cart2.wxml
... ... @@ -118,10 +118,10 @@
118 118 </view>
119 119 </view>
120 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 125 </block>
126 126 </view>
127 127  
... ... @@ -157,9 +157,7 @@
157 157 <!------立即购买-------->
158 158 <view class="xc-border xc-border"></view>
159 159 <block wx:if="{{is_b_now==1}}">
160   -
161 160 <view class="use-item bfff">
162   -
163 161 <image class="dp" src='{{imgUrl}}/miniapp/images/dianpu.png'> </image> <view>门店:{{bn_pickname}}</view></view>
164 162 <view class="order-detail">
165 163 <view class="goods-img">
... ... @@ -209,12 +207,9 @@
209 207 <view class="yu_er">物流</view>
210 208 </view>
211 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 213 </view>
219 214  
220 215 </view>
... ... @@ -308,8 +303,8 @@
308 303 <view class="xc-frame flex-level">
309 304 <view class="list-frame">
310 305  
311   - <view wx:for="{{selected_quan_list}}" bindtap="sele_quan_item" wx:if="{{!item.is_using}}" data-ind="{{index}}" wx:for-item="item"wx:for-index="index">
312   - <view class="xc-coupon-frame flex-center" bindtap="sele_coupon" data-ind="{{index}}">
  306 + <view wx:for="{{selected_quan_list}}" bindtap="sele_quan_item" wx:if="{{!item.is_using}}" data-ind="{{q_index}}" wx:for-item="item"wx:for-index="q_index">
  307 + <view class="xc-coupon-frame flex-center" bindtap="sele_coupon" data-ind="{{q_index}}">
313 308 <view class="coupon-frame flex rel">
314 309 <!-- 锯齿 -->
315 310 <view class="circle-frame abs">
... ... @@ -377,12 +372,12 @@
377 372 <image class="coupon-code" src='{{iurl}}/miniapp/images/hui-ewm.png'></image>
378 373 </view> -->
379 374  
380   - <block wx:if="{{is_coupon==index}}">
381   - <view class="circle white xc-hook fs20 red-b sn"><text>Γ</text></view>
382   - </block>
383   - <block wx:else>
384   - <view class="circle xc-hooks on"></view>
385   - </block>
  375 + <block wx:if="{{item.show_red}}">
  376 + <view class="circle white xc-hook fs20 red-b sn"><text>Γ</text></view>
  377 + </block>
  378 + <block wx:else>
  379 + <view class="circle xc-hooks on"></view>
  380 + </block>
386 381 </view>
387 382  
388 383  
... ... @@ -419,9 +414,7 @@
419 414 </view >
420 415 </view>
421 416  
422   -
423 417 <!----弹起选择物流名的列表---->
424   -
425 418 <view wx:if='{{open_express==1}}' >
426 419 <view class="cover-layer flex-center " bindtap='close_express'>
427 420 </view>
... ... @@ -439,7 +432,10 @@
439 432 </view>
440 433 <view class="express_list">
441 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 439 <block wx:if="{{is_express==idx}}">
444 440 <view class="circle white xc-hook fs20 red-b"><text>Γ</text></view>
445 441 </block>
... ... @@ -465,5 +461,4 @@
465 461  
466 462  
467 463  
468   -
469 464 <warn id="warn"></warn>
470 465 \ No newline at end of file
... ...