Commit af94ba45d62e50c25e5beb1fe859cb56e67f22bd

Authored by yvan.ni
1 parent 2fe25ed6

小程序提交起订量的优化

packageC/pages/luckyGo/luckyGo_goodsInfo/buy_pt.wxml
... ... @@ -25,15 +25,14 @@
25 25 <block wx:if="{{is_normal==1}}">
26 26 <view class="flex">
27 27 <view class="spec-goods-stock">已售:{{sele_g.sales_sum}}</view>
28   -
29   - <block wx:if="{{!filters.is_virtual_gd(sele_g.is_virtual)}}">
30 28 <block wx:if="{{sales_rules>=2}}">
31   - <view class="spec-goods-stock" wx:if="{{def_pick_store && def_pick_store.CanOutQty}}">可售:{{def_pick_store.CanOutQty}}</view>
32   - <view class="spec-goods-stock" wx:else>可售:0</view>
  29 + <block wx:if="{{!filters.is_virtual_gd(sele_g.is_virtual)}}">
  30 + <view class="spec-goods-stock" wx:if="{{def_pick_store && def_pick_store.CanOutQty}}">可售:{{def_pick_store.CanOutQty}}</view>
  31 + <view class="spec-goods-stock" wx:else>可售:0</view>
  32 + </block>
33 33 </block>
34 34 <block wx:else><view class="spec-goods-stock">可售:{{sele_g.store_count}}</view></block>
35   - </block>
36   - </view>
  35 + </view>
37 36 </block>
38 37 <!-- <block wx:if="{{is_normal==0}}">
39 38 <view class="flex">
... ...
packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js
... ... @@ -4469,9 +4469,7 @@ Page({
4469 4469  
4470 4470 //-----------------拼单生成方法---------------------
4471 4471 addCart_pt: function () {
4472   - this.setData({
4473   - openSpecModal_pt: 0,
4474   - });
  4472 +
4475 4473 if (this.data.is_normal == 0) {
4476 4474 //看一下有没有起购数,如果有起购数,要计算起购数
4477 4475 // var qnum = parseFloat(th.data.prom_act.minbuynum);
... ...
packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.wxml
... ... @@ -1186,7 +1186,7 @@
1186 1186 <block wx:else>
1187 1187 <!-- 如果是线下库存购买的时候,且是普通商品购买的时候 -->
1188 1188 <block wx:if="{{sales_rules>=2 && prom_type==0}}">
1189   - <block wx:if="{{!def_pick_store.CanOutQty || def_pick_store.CanOutQty<mo_num}}">
  1189 + <block wx:if="{{!def_pick_store.CanOutQty || def_pick_store.CanOutQty<1}}">
1190 1190 <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">
1191 1191 库存不足
1192 1192 </view>
... ... @@ -1202,7 +1202,7 @@
1202 1202 </block>
1203 1203 <!-- 线上销售 -->
1204 1204 <block wx:else>
1205   - <block wx:if="{{sele_g.store_count<(mo_num?mo_num:1)}}">
  1205 + <block wx:if="{{sele_g.store_count<1}}">
1206 1206 <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">
1207 1207 库存不足
1208 1208 </view>
... ...
packageE/pages/cart/cart2/cart2.js
... ... @@ -4069,7 +4069,7 @@ Page({
4069 4069  
4070 4070 if ([0,3,5,7,10].indexOf(goods.prom_type)>-1){
4071 4071 if(mo_num>goods.goods_num){
4072   - getApp().confirmBox(goods.goods_name + "的未到达起订数量");
  4072 + getApp().confirmBox(goods.goods_name + "的未达到起订数量");
4073 4073 th.data.is_summit_ing = 0;
4074 4074 return false;
4075 4075 }
... ... @@ -4452,7 +4452,7 @@ Page({
4452 4452  
4453 4453 if ([0,3,5,7,10].indexOf(goods.prom_type)>-1){
4454 4454 if(mo_num>goods.goods_num){
4455   - getApp().confirmBox(goods.goods_name + "的未到达起订数量");
  4455 + getApp().confirmBox(goods.goods_name + "的未达到起订数量");
4456 4456 th.data.is_summit_ing = 0;
4457 4457 return false;
4458 4458 }
... ...
pages/cart/cart/cart.js
... ... @@ -3511,7 +3511,7 @@ Page({
3511 3511 if([0,3,5,7,10].indexOf(py_type)>-1){
3512 3512  
3513 3513 if(mo_num>i_arr[j].goods_num){
3514   - getApp().confirmBox(i_arr[j].goods_name + "的未到达起订数量");
  3514 + getApp().confirmBox(i_arr[j].goods_name + "的未达到起订数量");
3515 3515 wx.hideLoading();
3516 3516 return false;
3517 3517 }
... ...
pages/goods/goodsInfo/buy_com_pop.wxml
... ... @@ -141,7 +141,7 @@
141 141 </block>
142 142 <block wx:else>
143 143 <block wx:if="{{sales_rules>=2 && !sele_g.whsle_id }}">
144   - <view wx:if="{{!def_pick_store.CanOutQty || def_pick_store.CanOutQty<mo_num }}" class="spec-cart-btn fs32" data-action="add"
  144 + <view wx:if="{{!def_pick_store.CanOutQty || def_pick_store.CanOutQty<1 }}" class="spec-cart-btn fs32" data-action="add"
145 145 style="background-color: #dcdcdc;color: #999">库存不足
146 146 </view>
147 147 <block wx:else>
... ... @@ -156,7 +156,7 @@
156 156 </block>
157 157 </block>
158 158  
159   - <block wx:elif="{{data.store_count<(mo_num?mo_num:1)}}">
  159 + <block wx:elif="{{data.store_count<1}}">
160 160 <view class="spec-cart-btn fs32" data-action="add"
161 161 style="background-color: #dcdcdc;color: #999">库存不足
162 162 </view>
... ...
pages/goods/goodsInfo/buy_integral.wxml
... ... @@ -48,7 +48,7 @@
48 48 <block wx:else>
49 49 <view class="no_store" wx:if="{{def_pick_store.is_no_dis}}">(配送不匹配)</view>
50 50 <view wx:elif="{{def_pick_store && sales_rules>=2 && prom_type==0}}">
51   - <block wx:if="{{!def_pick_store.CanOutQty || def_pick_store.CanOutQty<mo_num}}">(库存不足)</block>
  51 + <block wx:if="{{!def_pick_store.CanOutQty || def_pick_store.CanOutQty<1}}">(库存不足)</block>
52 52 </view>
53 53 </block>
54 54 </block>
... ...
pages/goods/goodsInfo/buy_pt.wxml
... ... @@ -183,7 +183,7 @@
183 183 <block wx:else>
184 184 <!-- 如果是线下库存购买的时候,且是普通商品购买的时候 -->
185 185 <block wx:if="{{sales_rules>=2 && !sele_g.whsle_id}}">
186   - <block wx:if="{{!def_pick_store.CanOutQty || def_pick_store.CanOutQty<mo_num}}">
  186 + <block wx:if="{{!def_pick_store.CanOutQty || def_pick_store.CanOutQty<1}}">
187 187 <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">
188 188 库存不足
189 189 </view>
... ... @@ -194,7 +194,7 @@
194 194 </block>
195 195 <!-- 线上销售 -->
196 196 <block wx:else>
197   - <block wx:if="{{sele_g.store_count<(mo_num?mo_num:1) && is_no_new}}">
  197 + <block wx:if="{{sele_g.store_count<1 && is_no_new}}">
198 198 <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">
199 199 库存不足
200 200 </view>
... ...
pages/goods/goodsInfo/goodsInfo.js
... ... @@ -2407,12 +2407,18 @@ Page({
2407 2407 },
2408 2408 //----------减少购买数量-----------
2409 2409 subCartNum: function (t) {
2410   -
2411 2410 var add_num=1;
2412 2411 var p_type=parseInt(this.data.prom_type)
2413 2412 if([1,2,4,6,8,9].indexOf(p_type)==-1 || this.data.openSpecModal_inte_normal == 1 || this.data.is_normal == 1){
2414 2413 add_num = getApp().get_limit_qty(this.data.sele_g, this.data.is_act, 1);
2415   -
  2414 + var mo_num = getApp().get_limit_qty(this.data.sele_g, this.data.is_act);
  2415 + if(this.data.goodsInputNum - add_num<mo_num){
  2416 + wx.showToast({
  2417 + title: '购买数量不能小于起订量',
  2418 + icon: 'none',
  2419 + });
  2420 + return false;
  2421 + }
2416 2422 }
2417 2423 this.checkCartNum(this.data.goodsInputNum - add_num);
2418 2424 },
... ...
pages/goods/goodsInfo/goodsInfo.wxml
... ... @@ -1410,7 +1410,7 @@
1410 1410 <!-- 如果是线下库存购买的时候,且是普通商品购买的时候 -->
1411 1411 <block wx:if="{{sales_rules>=2 && prom_type==0 && !sele_g.whsle_id}}">
1412 1412  
1413   - <block wx:if="{{!def_pick_store.CanOutQty || def_pick_store.CanOutQty<mo_num }}">
  1413 + <block wx:if="{{!def_pick_store.CanOutQty || def_pick_store.CanOutQty<1 }}">
1414 1414 <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">
1415 1415 库存不足
1416 1416 </view>
... ... @@ -1426,7 +1426,7 @@
1426 1426 </block>
1427 1427 <!-- 线上销售 -->
1428 1428 <block wx:else>
1429   - <block wx:if="{{ sele_g.store_count<(mo_num?mo_num:1) && is_no_new}}">
  1429 + <block wx:if="{{ sele_g.store_count<1 && is_no_new}}">
1430 1430 <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">
1431 1431 库存不足
1432 1432 </view>
... ...