Commit 51b150cb54cfb848ae31e048504dfcfe6cffc3aa
1 parent
ba3d4e4e
判断门店不可售的优化,在切换到参与非实收订单促销的时候,判断门店是不是可售
Showing
1 changed file
with
51 additions
and
4 deletions
packageE/pages/cart/cart2/cart2.js
@@ -4825,6 +4825,9 @@ Page({ | @@ -4825,6 +4825,9 @@ Page({ | ||
4825 | if (th.data.wu_arr == null || th.data.wu_arr.length <= 0) { | 4825 | if (th.data.wu_arr == null || th.data.wu_arr.length <= 0) { |
4826 | getApp().my_warnning("读取物流失败", 0, th); | 4826 | getApp().my_warnning("读取物流失败", 0, th); |
4827 | th.data.is_summit_ing = 0; | 4827 | th.data.is_summit_ing = 0; |
4828 | + th.setData({ | ||
4829 | + submit: 0 | ||
4830 | + }) | ||
4828 | return false; | 4831 | return false; |
4829 | } | 4832 | } |
4830 | 4833 | ||
@@ -4962,9 +4965,26 @@ Page({ | @@ -4962,9 +4965,26 @@ Page({ | ||
4962 | }; | 4965 | }; |
4963 | 4966 | ||
4964 | //如果有参与非实收的订单促销,那么就相当于是普通购买 | 4967 | //如果有参与非实收的订单促销,那么就相当于是普通购买 |
4965 | - if(th.data.can_use_ord_prom[th.data.bn_pick]){ | ||
4966 | - goods.is_pd_normal=1; | ||
4967 | - goods.discount_field= th.data.show_ord_prom[th.data.bn_pick]; | 4968 | + if (th.data.can_use_ord_prom[th.data.bn_pick]) { |
4969 | + goods.is_pd_normal = 1; | ||
4970 | + goods.discount_field = th.data.show_ord_prom[th.data.bn_pick]; | ||
4971 | + | ||
4972 | + //如果是指定门店,就要判断 | ||
4973 | + if (th.data.bn_goods.pick_group_ids) { | ||
4974 | + var idx0 = th.data.bn_goods.pick_up_lists.findIndex(function (e) { | ||
4975 | + return e.pickup_id == th.data.bn_pick; | ||
4976 | + }) | ||
4977 | + if (idx0 < 0) { | ||
4978 | + getApp().my_warnning(th.data.bn_goods.goods_name + "的门店不可售", 0, th); | ||
4979 | + th.data.is_summit_ing = 0; | ||
4980 | + th.setData({ | ||
4981 | + submit: 0 | ||
4982 | + }) | ||
4983 | + return false; | ||
4984 | + } | ||
4985 | + } | ||
4986 | + | ||
4987 | + | ||
4968 | } | 4988 | } |
4969 | 4989 | ||
4970 | if (th.data.bn_goods.whsle_id) { | 4990 | if (th.data.bn_goods.whsle_id) { |
@@ -5017,11 +5037,17 @@ Page({ | @@ -5017,11 +5037,17 @@ Page({ | ||
5017 | if(mo_num>goods.goods_num){ | 5037 | if(mo_num>goods.goods_num){ |
5018 | getApp().confirmBox(goods.goods_name + "的未达到起订数量"); | 5038 | getApp().confirmBox(goods.goods_name + "的未达到起订数量"); |
5019 | th.data.is_summit_ing = 0; | 5039 | th.data.is_summit_ing = 0; |
5040 | + th.setData({ | ||
5041 | + submit: 0 | ||
5042 | + }) | ||
5020 | return false; | 5043 | return false; |
5021 | } | 5044 | } |
5022 | if(steep>1 && (goods.goods_num-mo_num)%steep!=0 ){ | 5045 | if(steep>1 && (goods.goods_num-mo_num)%steep!=0 ){ |
5023 | getApp().confirmBox(goods.goods_name + "的购买的数量不是起订量的倍数"); | 5046 | getApp().confirmBox(goods.goods_name + "的购买的数量不是起订量的倍数"); |
5024 | th.data.is_summit_ing = 0; | 5047 | th.data.is_summit_ing = 0; |
5048 | + th.setData({ | ||
5049 | + submit: 0 | ||
5050 | + }) | ||
5025 | return false; | 5051 | return false; |
5026 | } | 5052 | } |
5027 | } | 5053 | } |
@@ -5036,6 +5062,9 @@ Page({ | @@ -5036,6 +5062,9 @@ Page({ | ||
5036 | if (!isok) { | 5062 | if (!isok) { |
5037 | getApp().confirmBox("商品的门店库存不足"); | 5063 | getApp().confirmBox("商品的门店库存不足"); |
5038 | th.data.is_summit_ing = 0; | 5064 | th.data.is_summit_ing = 0; |
5065 | + th.setData({ | ||
5066 | + submit: 0 | ||
5067 | + }) | ||
5039 | return false; | 5068 | return false; |
5040 | } | 5069 | } |
5041 | } | 5070 | } |
@@ -5154,6 +5183,9 @@ Page({ | @@ -5154,6 +5183,9 @@ Page({ | ||
5154 | if (th.data.wu_arr == null || th.data.wu_arr.length <= 0) { | 5183 | if (th.data.wu_arr == null || th.data.wu_arr.length <= 0) { |
5155 | th.data.is_summit_ing = 0; | 5184 | th.data.is_summit_ing = 0; |
5156 | getApp().confirmBox("读取物流失败"); | 5185 | getApp().confirmBox("读取物流失败"); |
5186 | + th.setData({ | ||
5187 | + submit: 0 | ||
5188 | + }) | ||
5157 | return false; | 5189 | return false; |
5158 | } | 5190 | } |
5159 | } | 5191 | } |
@@ -5362,7 +5394,22 @@ Page({ | @@ -5362,7 +5394,22 @@ Page({ | ||
5362 | 5394 | ||
5363 | //订单促销取价规则使用 | 5395 | //订单促销取价规则使用 |
5364 | if (g_item.discount_field) { | 5396 | if (g_item.discount_field) { |
5365 | - goods.discount_field =g_item.discount_field; | 5397 | + goods.discount_field =g_item.discount_field; |
5398 | + //此时要判断商品的门店是不是匹配 | ||
5399 | + if(g_item.prom_type==0 && g_item.pick_group_ids){ | ||
5400 | + var idx0 = g_item.pick_up_lists.findIndex(function (e) { | ||
5401 | + return e.pickup_id == item.pickup_id; | ||
5402 | + }) | ||
5403 | + if (idx0 < 0) { | ||
5404 | + getApp().my_warnning(g_item.goods_name + "的门店不可售", 0, th); | ||
5405 | + th.data.is_summit_ing = 0; | ||
5406 | + th.setData({ | ||
5407 | + submit: 0 | ||
5408 | + }) | ||
5409 | + return false; | ||
5410 | + } | ||
5411 | + } | ||
5412 | + | ||
5366 | } | 5413 | } |
5367 | 5414 | ||
5368 | if (g_item.is_pd_normal) { | 5415 | if (g_item.is_pd_normal) { |