Commit 614887830dc21e097d513219583e68d919dbbe25

Authored by abson
1 parent ba998f66

oa单优化

pages/cart/cart/cart.wxml
@@ -39,11 +39,9 @@ @@ -39,11 +39,9 @@
39 <!-- 购物车商品框架 --> 39 <!-- 购物车商品框架 -->
40 <view class="login-in"> 40 <view class="login-in">
41 <!-- 编辑 --> 41 <!-- 编辑 -->
42 - <view class="padding flex-vertical-between fs30 Storenum store">  
43 - <view class="flex">  
44 - <view>总数量:</view>  
45 - <view class="goods_num">{{all_num}}</view>  
46 - <view wx:if="{{total_fee > 0 && freight_free - total_fee > 0}}" class="co-red weight_free">再买{{freight_free - total_fee}}元可享包邮({{weight_free}}kg内);</view> 42 + <view class="padding flex-vertical-between fs30 Storenum store" style="{{total_fee > 0 && freight_free - total_fee > 0 ? 'justify-content:space-between':'justify-content: flex-end;'}}">
  43 + <view wx:if="{{total_fee > 0 && freight_free - total_fee > 0}}" class="fs28 pdr20 pdl20 c-red2 flex jc_sb weight_free">
  44 + <text>再买{{freight_free - total_fee}}元可享全场包邮({{weight_free}}kg内)</text>
47 </view> 45 </view>
48 <view wx:if="{{is_edit==0}}" bindtap="edit_cart" data-type="1">编辑</view> 46 <view wx:if="{{is_edit==0}}" bindtap="edit_cart" data-type="1">编辑</view>
49 <view wx:else bindtap="edit_cart" data-type="0">完成</view> 47 <view wx:else bindtap="edit_cart" data-type="0">完成</view>
@@ -140,7 +138,8 @@ @@ -140,7 +138,8 @@
140 </view> 138 </view>
141 <!--- 去凑单 --> 139 <!--- 去凑单 -->
142 <view style="margin-top: 20rpx; padding: 0 30rpx"> 140 <view style="margin-top: 20rpx; padding: 0 30rpx">
143 - <view class="flex jc_sb fs28" wx:for="{{item.make_up_arr}}" style="margin-bottom: 20rpx" > 141 + <block wx:if="{{item.make_up_arr}}">
  142 + <view class="flex jc_sb fs28" wx:for="{{item.make_up_arr}}" style="margin-bottom: 20rpx" >
144 <view class="ellipsis-1" style="width: 80%">再买<text class="co-red">{{item.diff}}<text wx:if="{{item.diff_type==0}}">元</text> 143 <view class="ellipsis-1" style="width: 80%">再买<text class="co-red">{{item.diff}}<text wx:if="{{item.diff_type==0}}">元</text>
145 <text wx:if="{{item.diff_type==1}}">件</text> 144 <text wx:if="{{item.diff_type==1}}">件</text>
146 </text>, 145 </text>,
@@ -153,26 +152,36 @@ @@ -153,26 +152,36 @@
153 <text wx:if="{{item.content.is_libao==1}}">送礼包|</text> 152 <text wx:if="{{item.content.is_libao==1}}">送礼包|</text>
154 <text></text> 153 <text></text>
155 </view> 154 </view>
156 - <view class="co-red" data-prom_id="{{item.prom_id}}" bindtap="go_cou_dang">去凑单></view> 155 + <view class="co-red" data-prom_id="{{item.prom_id}}" bindtap="go_cou_dang">去凑单></view>
157 </view> 156 </view>
158 - </view>  
159 - 157 + </block>
  158 + </view>
160 <!-- 还差多少件立即享受组合购 --> 159 <!-- 还差多少件立即享受组合购 -->
161 <block wx:if="{{item.need_list && item.need_list.length>0 && !is_edit}}"> 160 <block wx:if="{{item.need_list && item.need_list.length>0 && !is_edit}}">
162 - <view class="fs28 pdr20 pdl20 pdb20 c-red2 flex jc_sb" wx:for="{{item.need_list}}"> 161 + <view class="fs28 pdr20 pdl20 pdb20 c-red2 flex jc_sb" wx:for="{{item.need_list}}">
163 <text>{{item.title}}</text> 162 <text>{{item.title}}</text>
164 - <text data-url="/packageB/pages/zuhegou/index/index?id={{item.id}}" bindtap="go_url">去凑单</text>  
165 - </view> 163 + <text data-url="/packageB/pages/zuhegou/index/index?id={{item.id}}" bindtap="go_url">去凑单></text>
  164 + </view>
166 </block> 165 </block>
167 166
168 <!-- 阶梯促销提示多少件的优惠 --> 167 <!-- 阶梯促销提示多少件的优惠 -->
169 <block wx:if="{{item.l_need_list && item.l_need_list.length>0 && !is_edit}}"> 168 <block wx:if="{{item.l_need_list && item.l_need_list.length>0 && !is_edit}}">
170 -  
171 <view class="fs28 pdr20 pdl20 pdb20 c-red2 flex jc_sb" wx:for="{{item.l_need_list}}"> 169 <view class="fs28 pdr20 pdl20 pdb20 c-red2 flex jc_sb" wx:for="{{item.l_need_list}}">
172 <text>{{item.title}}</text> 170 <text>{{item.title}}</text>
173 - <text data-url="/pages/goods/goodsList/goodsList?ladder_id={{item.id}}" bindtap="go_url">去凑单</text> 171 + <text data-url="/pages/goods/goodsList/goodsList?ladder_id={{item.id}}" bindtap="go_url">去凑单></text>
174 </view> 172 </view>
175 </block> 173 </block>
  174 +
  175 + <!-- <block wx:if="{{item.make_up_arr}}">
  176 + <view wx:if="{{total_fee > 0 && freight_free - total_fee > 0}}" class="fs28 pdr20 pdl20 c-red2 flex jc_sb weight_free">
  177 + <text>再买{{freight_free - total_fee}}元可享全场包邮({{weight_free}}kg内)</text>
  178 + </view>
  179 + </block>
  180 + <block wx:else="">
  181 + <view wx:if="{{total_fee > 0 && freight_free - total_fee > 0}}" class="fs28 pdr20 pdl20 c-red2 flex jc_sb weight_free">
  182 + <text>再买{{freight_free - total_fee}}元可享全场包邮({{weight_free}}kg内)</text>
  183 + </view>
  184 + </block> -->
176 185
177 186
178 <!-- 线下取价 --> 187 <!-- 线下取价 -->
pages/cart/cart/cart.wxss
@@ -224,6 +224,9 @@ radio { @@ -224,6 +224,9 @@ radio {
224 .store { 224 .store {
225 border-bottom: 7rpx solid rgb(245, 245, 245); 225 border-bottom: 7rpx solid rgb(245, 245, 245);
226 } 226 }
  227 +.login-in {
  228 + position: relative;
  229 +}
227 230
228 .login-in .Storenum { 231 .login-in .Storenum {
229 height: 80rpx; 232 height: 80rpx;
@@ -235,9 +238,11 @@ radio { @@ -235,9 +238,11 @@ radio {
235 } 238 }
236 239
237 .login-in .weight_free { 240 .login-in .weight_free {
  241 + /* position: absolute;
  242 + top: 20rpx; */
238 font-size: 26rpx; 243 font-size: 26rpx;
  244 + /* margin-left: 20rpx; */
239 line-height: 48rpx; 245 line-height: 48rpx;
240 - margin-left: 30rpx;  
241 } 246 }
242 247
243 .allradio { 248 .allradio {
pages/cart/cart2/cart2.js
@@ -24,7 +24,7 @@ Page({ @@ -24,7 +24,7 @@ Page({
24 firstEnter: !0, 24 firstEnter: !0,
25 //页面获取的参数 25 //页面获取的参数
26 param: null, 26 param: null,
27 - //提交订单的格式 27 + //提交订单的格式
28 formData: { 28 formData: {
29 order_amount: 0,//支付金额 29 order_amount: 0,//支付金额
30 total_amount: 0,//总价 30 total_amount: 0,//总价
@@ -125,7 +125,7 @@ Page({ @@ -125,7 +125,7 @@ Page({
125 125
126 in_zhact_gdmap:{}, //不同门店参与同一活动的限购 126 in_zhact_gdmap:{}, //不同门店参与同一活动的限购
127 hid_inp:1, 127 hid_inp:1,
128 - user_note:{}, 128 + user_note:"",
129 zhhe_act_map:{}, //组合活动的map表 129 zhhe_act_map:{}, //组合活动的map表
130 zuhe_map_good:{}, //组合购的map表 130 zuhe_map_good:{}, //组合购的map表
131 ladder_map:{}, //阶梯促销的map表 131 ladder_map:{}, //阶梯促销的map表
@@ -175,10 +175,7 @@ Page({ @@ -175,10 +175,7 @@ Page({
175 //----------子页返回父页触发---------- 175 //----------子页返回父页触发----------
176 onShow: function () { 176 onShow: function () {
177 var th = this; 177 var th = this;
178 - th.setData({  
179 - show_submit: 0,  
180 -  
181 - }); //让提交先掩藏 178 + th.setData({show_submit: 0}); //让提交先掩藏
182 th.data.g_cart_q_time = null; 179 th.data.g_cart_q_time = null;
183 180
184 if (th.data.isclose == 0) { 181 if (th.data.isclose == 0) {
@@ -331,7 +328,6 @@ Page({ @@ -331,7 +328,6 @@ Page({
331 typeof func == "function" && func(); 328 typeof func == "function" && func();
332 }) 329 })
333 }, 330 },
334 -  
335 //------获取会员信息-----先获取用户信息,在进行下一步--- 331 //------获取会员信息-----先获取用户信息,在进行下一步---
336 get_info: function (func) { 332 get_info: function (func) {
337 var user_id = t.globalData.user_id; 333 var user_id = t.globalData.user_id;
@@ -529,7 +525,7 @@ Page({ @@ -529,7 +525,7 @@ Page({
529 } 525 }
530 else 526 else
531 { 527 {
532 - item1.act = th.data.zhhe_act_map[item1.prom_id]; 528 + item1.act = th.data.zhhe_act_map[item1.prom_id];
533 } 529 }
534 } 530 }
535 if(item1.prom_type==10){ 531 if(item1.prom_type==10){
@@ -565,7 +561,7 @@ Page({ @@ -565,7 +561,7 @@ Page({
565 } 561 }
566 }) 562 })
567 if (!isok){ 563 if (!isok){
568 - var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item1.id; 564 + var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id;
569 getApp().request.delete(url, {}); 565 getApp().request.delete(url, {});
570 th.data.ladder_map[item1.prom_id]=-1; 566 th.data.ladder_map[item1.prom_id]=-1;
571 continue; 567 continue;
@@ -629,9 +625,7 @@ Page({ @@ -629,9 +625,7 @@ Page({
629 if (arr.length > 0) { 625 if (arr.length > 0) {
630 for (var j = 0; j < arr.length; j++) { 626 for (var j = 0; j < arr.length; j++) {
631 if (arr[j].pickup_id == pcid) { 627 if (arr[j].pickup_id == pcid) {
632 -  
633 - //赠品的配送方式要和优惠的主商品一样  
634 - if(item.is_gift!=1){ 628 + //if(item.is_gift!=1){
635 //确定配送方式 629 //确定配送方式
636 if (arr[j].distr_t == 0) { 630 if (arr[j].distr_t == 0) {
637 arr[j].distr_t = car_item.distr_type; 631 arr[j].distr_t = car_item.distr_type;
@@ -652,8 +646,7 @@ Page({ @@ -652,8 +646,7 @@ Page({
652 arr[j].exp_type = e_t; 646 arr[j].exp_type = e_t;
653 if (e_t == 0) th.setData({is_all_zt: 0}); 647 if (e_t == 0) th.setData({is_all_zt: 0});
654 else if(e_t==1) th.setData({is_all_zt: 1}); 648 else if(e_t==1) th.setData({is_all_zt: 1});
655 - }  
656 - 649 + //}
657 650
658 //-- 把等级卡会优惠多少钱装进去 -- 651 //-- 把等级卡会优惠多少钱装进去 --
659 if (car_item.cut_price1) arr[j].card_cut_price += car_item.cut_price1; 652 if (car_item.cut_price1) arr[j].card_cut_price += car_item.cut_price1;
@@ -696,7 +689,6 @@ Page({ @@ -696,7 +689,6 @@ Page({
696 } 689 }
697 //如果是物流的话,全部自提的控制要弄成0 690 //如果是物流的话,全部自提的控制要弄成0
698 if (e_t == 0) th.setData({is_all_zt: 0}); 691 if (e_t == 0) th.setData({is_all_zt: 0});
699 - else if (e_t == 1) th.setData({is_all_zt: 1});  
700 692
701 var narr = new Array(); 693 var narr = new Array();
702 narr.push(car_item); 694 narr.push(car_item);
@@ -835,8 +827,6 @@ Page({ @@ -835,8 +827,6 @@ Page({
835 get_buy_goods: function (e) { 827 get_buy_goods: function (e) {
836 var th = this; 828 var th = this;
837 var gg = to.get_b_now(); 829 var gg = to.get_b_now();
838 -  
839 -  
840 //--------如果goods_id一样,就是要立即购买----- 830 //--------如果goods_id一样,就是要立即购买-----
841 if (e == gg.goods_id) { 831 if (e == gg.goods_id) {
842 a.get("/api/weshop/goods/get/" + oo.stoid + "/" + e, { 832 a.get("/api/weshop/goods/get/" + oo.stoid + "/" + e, {
@@ -984,11 +974,6 @@ Page({ @@ -984,11 +974,6 @@ Page({
984 } else { 974 } else {
985 //--看是不是搭配促销-- 975 //--看是不是搭配促销--
986 if (gg.prom_type == 5) { 976 if (gg.prom_type == 5) {
987 -  
988 - th.setData({  
989 - 'is_coupon': gg.is_coupon  
990 - });  
991 -  
992 t.data.data.prom_id = gg.prom_id; 977 t.data.data.prom_id = gg.prom_id;
993 t.data.data.prom_type = 5; 978 t.data.data.prom_type = 5;
994 if (gg.room_id) { 979 if (gg.room_id) {
@@ -1389,8 +1374,7 @@ Page({ @@ -1389,8 +1374,7 @@ Page({
1389 by_qc = res.data.data[0]; 1374 by_qc = res.data.data[0];
1390 } 1375 }
1391 }) 1376 })
1392 - }  
1393 - ; 1377 + };
1394 var c_arr = JSON.parse(JSON.stringify(th.data.old_cartlist)); 1378 var c_arr = JSON.parse(JSON.stringify(th.data.old_cartlist));
1395 1379
1396 if (th.data.cartlist && th.data.cartlist.length > 0) { 1380 if (th.data.cartlist && th.data.cartlist.length > 0) {
@@ -1478,7 +1462,7 @@ Page({ @@ -1478,7 +1462,7 @@ Page({
1478 { 1462 {
1479 is_no_zh=1; 1463 is_no_zh=1;
1480 } 1464 }
1481 - //组合购的商品,且有订单优惠的叠加,is_orderyh就是优惠叠加 1465 + //阶梯购的商品,且有订单优惠的叠加,is_orderyh就是优惠叠加
1482 if(item[j].prom_type==10 && ladder_prom_goods && ladder_prom_goods[item[j].prom_id] 1466 if(item[j].prom_type==10 && ladder_prom_goods && ladder_prom_goods[item[j].prom_id]
1483 && th.data.ladder_map[item[j].prom_id].is_useorderyh ) 1467 && th.data.ladder_map[item[j].prom_id].is_useorderyh )
1484 { 1468 {
@@ -1490,8 +1474,8 @@ Page({ @@ -1490,8 +1474,8 @@ Page({
1490 } 1474 }
1491 o_price += item[j].goods_price * item[j].goods_num; 1475 o_price += item[j].goods_price * item[j].goods_num;
1492 1476
1493 - //判断是否有设置限制重量包邮  
1494 - if(weight_free){ 1477 + //判断是否有设置限制重量包邮,先看商品有没有包邮
  1478 + if(item[j]['is_past']!==1 && weight_free){
1495 if( item[j]['exp_sum_type']==2 ){ 1479 if( item[j]['exp_sum_type']==2 ){
1496 if (goods_weight < 0) goods_weight = 0; 1480 if (goods_weight < 0) goods_weight = 0;
1497 //累积商品重量 每种商品的重量 * 数量 1481 //累积商品重量 每种商品的重量 * 数量
@@ -1740,19 +1724,16 @@ Page({ @@ -1740,19 +1724,16 @@ Page({
1740 }).then(res => { 1724 }).then(res => {
1741 if (res.data.code == 0) { 1725 if (res.data.code == 0) {
1742 var ord_prom = res.data.data; 1726 var ord_prom = res.data.data;
1743 - //如果订单没有勾选使用优惠券不参与此活动,或者没有用优惠券  
1744 - if(!ord_prom.is_xz_yh || quan_price<=0) {  
1745 - order_prom_id = ord_prom['id'];  
1746 - switch (ord_prom['type']) {  
1747 - case 0:  
1748 - order_m = Math.round(o_condition * ord_prom['expression']) / 100;//满额打折  
1749 - order_prom_amount = (o_condition - order_m).toFixed(2);  
1750 - break;  
1751 - case 1:  
1752 - //order_m = o_condition - ord_prom['expression'];//满额优惠金额  
1753 - order_prom_amount = ord_prom['expression'];  
1754 - break;  
1755 - } 1727 + order_prom_id = ord_prom['id'];
  1728 + switch (ord_prom['type']) {
  1729 + case 0:
  1730 + order_m = Math.round(o_condition * ord_prom['expression']) / 100;//满额打折
  1731 + order_prom_amount = (o_condition - order_m).toFixed(2);
  1732 + break;
  1733 + case 1:
  1734 + //order_m = o_condition - ord_prom['expression'];//满额优惠金额
  1735 + order_prom_amount = ord_prom['expression'];
  1736 + break;
1756 } 1737 }
1757 } 1738 }
1758 }) 1739 })
@@ -2098,20 +2079,16 @@ Page({ @@ -2098,20 +2079,16 @@ Page({
2098 var order_prom_id = 0; 2079 var order_prom_id = 0;
2099 if (th.data.order_prom[th.data.bn_pick]) { 2080 if (th.data.order_prom[th.data.bn_pick]) {
2100 var ord_prom = th.data.order_prom[th.data.bn_pick]; 2081 var ord_prom = th.data.order_prom[th.data.bn_pick];
2101 - //如果订单没有勾选使用优惠券不参与此活动  
2102 - if(!ord_prom.is_xz_yh || quan_price<=0) {  
2103 -  
2104 - order_prom_id = ord_prom['id'];  
2105 - switch (ord_prom['type']) {  
2106 - case 0:  
2107 - order_m = Math.round(o_condition * ord_prom['expression']) / 100;//满额打折  
2108 - order_prom_amount = (o_condition - order_m).toFixed(2);  
2109 - break;  
2110 - case 1:  
2111 - order_m = o_condition - ord_prom['expression'];//满额优惠金额  
2112 - order_prom_amount = ord_prom['expression'];  
2113 - break;  
2114 - } 2082 + order_prom_id = ord_prom['id'];
  2083 + switch (ord_prom['type']) {
  2084 + case 0:
  2085 + order_m = Math.round(o_condition * ord_prom['expression']) / 100;//满额打折
  2086 + order_prom_amount = (o_condition - order_m).toFixed(2);
  2087 + break;
  2088 + case 1:
  2089 + order_m = o_condition - ord_prom['expression'];//满额优惠金额
  2090 + order_prom_amount = ord_prom['expression'];
  2091 + break;
2115 } 2092 }
2116 } 2093 }
2117 //--订单优惠的显示-- 2094 //--订单优惠的显示--
@@ -2263,7 +2240,6 @@ Page({ @@ -2263,7 +2240,6 @@ Page({
2263 var ff = true; 2240 var ff = true;
2264 //------------立即购买------------- 2241 //------------立即购买-------------
2265 if (th.data.is_b_now == 1 && th.data.bn_goods.prom_type != 5) { 2242 if (th.data.is_b_now == 1 && th.data.bn_goods.prom_type != 5) {
2266 -  
2267 if (th.data.bn_exp_type == 0 && th.data.user_addr == null) { 2243 if (th.data.bn_exp_type == 0 && th.data.user_addr == null) {
2268 ff = false; 2244 ff = false;
2269 getApp().my_warnning("请选择收货地址", 0, th); 2245 getApp().my_warnning("请选择收货地址", 0, th);
@@ -2300,7 +2276,7 @@ Page({ @@ -2300,7 +2276,7 @@ Page({
2300 'user_money': th.data.formData.user_money, //使用余额 2276 'user_money': th.data.formData.user_money, //使用余额
2301 'total_amount': th.data.formData.total_amount, //订单总价 2277 'total_amount': th.data.formData.total_amount, //订单总价
2302 'order_amount': th.data.formData.order_amount, //应付 2278 'order_amount': th.data.formData.order_amount, //应付
2303 - 'user_note': th.data.user_note, //用户备注 2279 + 'user_note': th.data.user_note['0']?th.data.user_note['0']:0, //用户备注
2304 'store_id': oo.stoid, //商家 2280 'store_id': oo.stoid, //商家
2305 'pickup_id': th.data.bn_pick, //门店 2281 'pickup_id': th.data.bn_pick, //门店
2306 'exp_type': th.data.bn_exp_type, //配送方式 2282 'exp_type': th.data.bn_exp_type, //配送方式
@@ -2483,11 +2459,21 @@ Page({ @@ -2483,11 +2459,21 @@ Page({
2483 'gift_id': gift_gg.gift_id, 2459 'gift_id': gift_gg.gift_id,
2484 'prom_id': gift_gg.prom_id, 2460 'prom_id': gift_gg.prom_id,
2485 }; 2461 };
  2462 + //-- 把导购的信息填入--
  2463 + if (gg.guide_id) {
  2464 + g_goods.guide_id = gg.guide_id;
  2465 + g_goods.guide_type = gg.guide_type;
  2466 + //调用接口判断是不是会员
  2467 + await getApp().request.promiseGet("/api/weshop/shoppingGuide/getId/" + oo.stoid + "/" + gg.guide_id, {}).then(res => {
  2468 + if (res.data.code == 0) {
  2469 + g_goods.guide_name = is_vip.salesman;
  2470 + g_goods.guide_sn = is_vip.salesman_no;
  2471 + }
  2472 + })
  2473 + }
2486 item.order_goods.push(g_goods); 2474 item.order_goods.push(g_goods);
2487 } 2475 }
2488 pdata.push(item); 2476 pdata.push(item);
2489 -  
2490 - console.log(pdata);  
2491 } else { 2477 } else {
2492 //---------购物车的结算--------- 2478 //---------购物车的结算---------
2493 if (th.data.is_all_zt == 0 && th.data.user_addr == null) { 2479 if (th.data.is_all_zt == 0 && th.data.user_addr == null) {
@@ -2549,7 +2535,6 @@ Page({ @@ -2549,7 +2535,6 @@ Page({
2549 if (t_item.coupon_price) { 2535 if (t_item.coupon_price) {
2550 item.coupon_price = t_item.coupon_price; 2536 item.coupon_price = t_item.coupon_price;
2551 item.coupon_no = th.data.using_quan[t_item.pickup_id].coupon_no; 2537 item.coupon_no = th.data.using_quan[t_item.pickup_id].coupon_no;
2552 - t_item.quan_no=item.coupon_no;  
2553 } else if (t_item.quan_no) { 2538 } else if (t_item.quan_no) {
2554 item.coupon_no = t_item.quan_no; 2539 item.coupon_no = t_item.quan_no;
2555 item.coupon_price = 0; 2540 item.coupon_price = 0;
@@ -2618,16 +2603,15 @@ Page({ @@ -2618,16 +2603,15 @@ Page({
2618 2603
2619 //房间号的ids 2604 //房间号的ids
2620 var room_ids = ""; 2605 var room_ids = "";
2621 - //-- 把券的钱,写入从表 ---  
2622 - if (t_item.quan_youhui_list && t_item.coupon_price) {  
2623 2606
  2607 + //-- 把券的钱,写入从表 ---
  2608 + if (t_item.quan_youhui_list && t_item.coupon_price) {
2624 for (var kk in t_item.quan_youhui_list) { 2609 for (var kk in t_item.quan_youhui_list) {
2625 var you_item = t_item.quan_youhui_list[kk]; 2610 var you_item = t_item.quan_youhui_list[kk];
2626 //-- 对券的价格进行平摊 -- 2611 //-- 对券的价格进行平摊 --
2627 await th.split_set_goods_quanprice(you_item,t_item); 2612 await th.split_set_goods_quanprice(you_item,t_item);
2628 } 2613 }
2629 } 2614 }
2630 -  
2631 //-------------让商品添加到商品列表-------------------- 2615 //-------------让商品添加到商品列表--------------------
2632 for (var k = 0; k < t_item.goods.length; k++) { 2616 for (var k = 0; k < t_item.goods.length; k++) {
2633 var g_item = t_item.goods[k]; 2617 var g_item = t_item.goods[k];
@@ -2650,7 +2634,6 @@ Page({ @@ -2650,7 +2634,6 @@ Page({
2650 goods.offline_cut = (g_item.goods_price - g_item.offline_price).toFixed(2); 2634 goods.offline_cut = (g_item.goods_price - g_item.offline_price).toFixed(2);
2651 goods.pricing_type = g_item.pricing_type; 2635 goods.pricing_type = g_item.pricing_type;
2652 } 2636 }
2653 -  
2654 if(g_item.quan_num){ 2637 if(g_item.quan_num){
2655 goods.quan_num=g_item.quan_num; 2638 goods.quan_num=g_item.quan_num;
2656 goods.quan_no=g_item.quan_no; 2639 goods.quan_no=g_item.quan_no;
@@ -2753,8 +2736,6 @@ Page({ @@ -2753,8 +2736,6 @@ Page({
2753 'content-type': 'application/json' 2736 'content-type': 'application/json'
2754 },// 设置请求的 header 2737 },// 设置请求的 header
2755 success: function (res) { 2738 success: function (res) {
2756 -  
2757 -  
2758 wx.hideLoading(); 2739 wx.hideLoading();
2759 if (res.statusCode == 200) { 2740 if (res.statusCode == 200) {
2760 var data = res.data; 2741 var data = res.data;
@@ -3603,7 +3584,6 @@ Page({ @@ -3603,7 +3584,6 @@ Page({
3603 if (th.data.is_b_now == 1) { 3584 if (th.data.is_b_now == 1) {
3604 th.setData({index: m_wind, is_express: m_wind}); 3585 th.setData({index: m_wind, is_express: m_wind});
3605 } else { 3586 } else {
3606 - clearInterval(ui);  
3607 var ui = setInterval(function () { 3587 var ui = setInterval(function () {
3608 if (th.data.cartlist) { 3588 if (th.data.cartlist) {
3609 var c_arr = th.data.cartlist; 3589 var c_arr = th.data.cartlist;
@@ -3720,17 +3700,15 @@ Page({ @@ -3720,17 +3700,15 @@ Page({
3720 check_quan_ware_list = encodeURIComponent(gd['erpwareid']); 3700 check_quan_ware_list = encodeURIComponent(gd['erpwareid']);
3721 }---*/ 3701 }---*/
3722 } 3702 }
3723 -  
3724 //优惠券优惠的金额要控制到优惠券的选择条件 3703 //优惠券优惠的金额要控制到优惠券的选择条件
3725 var cut_price = 0; 3704 var cut_price = 0;
3726 for (var i in th.data.prom_goods_map[pickup_id]) { 3705 for (var i in th.data.prom_goods_map[pickup_id]) {
3727 var obj = th.data.prom_goods_map[pickup_id][i]; 3706 var obj = th.data.prom_goods_map[pickup_id][i];
3728 - if (obj.coupon_sele && obj.prom_price) { 3707 + if (obj.coupon_sele) {
3729 cut_price += obj.price - obj.prom_price; 3708 cut_price += obj.price - obj.prom_price;
3730 } 3709 }
3731 } 3710 }
3732 3711
3733 - //阶梯优惠使用券  
3734 var prom_pt_json= ep.prom_pt_json; 3712 var prom_pt_json= ep.prom_pt_json;
3735 if(prom_pt_json){ 3713 if(prom_pt_json){
3736 for(let oj in prom_pt_json){ 3714 for(let oj in prom_pt_json){
@@ -3765,7 +3743,7 @@ Page({ @@ -3765,7 +3743,7 @@ Page({
3765 data: { 3743 data: {
3766 storeId: oo.stoid, 3744 storeId: oo.stoid,
3767 userId: app.globalData.user_id, 3745 userId: app.globalData.user_id,
3768 - BuySum: parseFloat(arr[ind].ckeck_quan_price?arr[ind].ckeck_quan_price:0).toFixed(2), 3746 + BuySum: arr[ind].ckeck_quan_price,
3769 WareIds: check_quan_ware_list, 3747 WareIds: check_quan_ware_list,
3770 pageSize: 100 3748 pageSize: 100
3771 } 3749 }
@@ -3814,7 +3792,7 @@ Page({ @@ -3814,7 +3792,7 @@ Page({
3814 data: { 3792 data: {
3815 storeId: oo.stoid, 3793 storeId: oo.stoid,
3816 userId: app.globalData.user_id, 3794 userId: app.globalData.user_id,
3817 - BuySum: parseFloat(th.data.ckeck_quan_price?th.data.ckeck_quan_price:0).toFixed(2), 3795 + BuySum: th.data.ckeck_quan_price,
3818 WareIds: encodeURIComponent(th.data.check_quan_ware_list), 3796 WareIds: encodeURIComponent(th.data.check_quan_ware_list),
3819 pageSize: 100 3797 pageSize: 100
3820 }, 3798 },
@@ -3992,6 +3970,7 @@ Page({ @@ -3992,6 +3970,7 @@ Page({
3992 var goods_weight = -1, goods_piece = -1; 3970 var goods_weight = -1, goods_piece = -1;
3993 var gift_shipping_price = 0; 3971 var gift_shipping_price = 0;
3994 var th = this; 3972 var th = this;
  3973 + var out_of_weight=null;
3995 switch (good['exp_sum_type']) { 3974 switch (good['exp_sum_type']) {
3996 case 1: 3975 case 1:
3997 //统一运费 3976 //统一运费
@@ -4003,8 +3982,9 @@ Page({ @@ -4003,8 +3982,9 @@ Page({
4003 //累积商品重量 每种商品的重量 * 数量 3982 //累积商品重量 每种商品的重量 * 数量
4004 goods_weight += good['weight'] * good['buynum']; 3983 goods_weight += good['weight'] * good['buynum'];
4005 if (goods_weight1 > 0) { 3984 if (goods_weight1 > 0) {
  3985 + out_of_weight = gift_weight_free - goods_weight;
  3986 + //不能调换位置 下面goods_weight会变大
4006 goods_weight += goods_weight1; 3987 goods_weight += goods_weight1;
4007 - out_of_weight = (gift_weight_free*1000) - goods_weight;  
4008 } 3988 }
4009 break; 3989 break;
4010 case 3: 3990 case 3:
@@ -4172,9 +4152,8 @@ Page({ @@ -4172,9 +4152,8 @@ Page({
4172 getApp().goto(url); 4152 getApp().goto(url);
4173 }, 4153 },
4174 4154
4175 - //进行对商品的平摊g_item是单个商品,you_item是这个商品分多少优惠券的钱,goods是商品列表  
4176 - split_set_goods_quanprice:async function (you_item,t_item) {  
4177 - 4155 + //进行对商品的平摊g_item是单个商品,you_item是这个商品分多少优惠券的钱,goods是商品列表
  4156 + split_set_goods_quanprice:async function (you_item,t_item) {
4178 var coupon_price=you_item.WareCashSum; 4157 var coupon_price=you_item.WareCashSum;
4179 var goods=t_item.goods; 4158 var goods=t_item.goods;
4180 var arr=[]; 4159 var arr=[];
pages/cart/cart2/cart2.wxml
@@ -375,13 +375,13 @@ @@ -375,13 +375,13 @@
375 </view> 375 </view>
376 </view> 376 </view>
377 <!-- 留言 --> 377 <!-- 留言 -->
378 -<!-- <view class="coupon-mes flex-vertical">-->  
379 -<!-- <view>留言</view>-->  
380 -<!-- <view class="leave-word">-->  
381 -<!-- <input placeholder-class="fs28" placeholder='给商家留言,最多100字' bindinput="keyUpChangeNum" disabled="{{disabled}}"-->  
382 -<!-- class="word-box" maxlength="100" name="user_note"></input>-->  
383 -<!-- </view>-->  
384 -<!-- </view>--> 378 + <view class="coupon-mes flex-vertical">
  379 + <view>留言</view>
  380 + <view class="leave-word">
  381 + <input placeholder-class="fs28" placeholder='给商家留言,最多100字' data-index="{{index}}" bindinput="keyUpChangeNum"
  382 + class="word-box" maxlength="100" name="user_note"></input>
  383 + </view>
  384 + </view>
385 385
386 <!-- 是否参与店铺优惠 --> 386 <!-- 是否参与店铺优惠 -->
387 <view class="coupon-mes flex-vertical" bindtap="bn_pop_offline" wx:if="{{bn_goods.offline_price}}"> 387 <view class="coupon-mes flex-vertical" bindtap="bn_pop_offline" wx:if="{{bn_goods.offline_price}}">