Commit a029991fecd8c52d1d0a4b22d68407bfc3aa5316
Merge branch 'qa' of http://git.vipzhuang.cn/wxd/MShopWeApp
Showing
5 changed files
with
21 additions
and
11 deletions
packageE/pages/cart/cart2/zh_calculate.js
@@ -156,9 +156,9 @@ module.exports = { | @@ -156,9 +156,9 @@ module.exports = { | ||
156 | 156 | ||
157 | //看一下是几倍 | 157 | //看一下是几倍 |
158 | let be = parseInt(no_in_arr.length / act.zhbuyqty); | 158 | let be = parseInt(no_in_arr.length / act.zhbuyqty); |
159 | - //如果有总数控制的时候 | 159 | + //如果有总数控制的时候,看还能买几组 |
160 | if(act.zh_num){ | 160 | if(act.zh_num){ |
161 | - var be1=act.zh_num-act.zh_buy_num-1; | 161 | + var be1= parseInt((act.zh_num-act.zh_buy_num)/ act.zhbuyqty)-1; |
162 | if(be1<be) be=be1; | 162 | if(be1<be) be=be1; |
163 | } | 163 | } |
164 | 164 | ||
@@ -207,8 +207,8 @@ module.exports = { | @@ -207,8 +207,8 @@ module.exports = { | ||
207 | 207 | ||
208 | } | 208 | } |
209 | if (!zhqty_len) { | 209 | if (!zhqty_len) { |
210 | - aprice += be1 * act.zhprice; | ||
211 | - let pop_num = be1 * act.zhbuyqty - delete_num; | 210 | + aprice += be * act.zhprice; |
211 | + let pop_num = be * act.zhbuyqty - delete_num; | ||
212 | for (var m = 0; m < pop_num; m++) { | 212 | for (var m = 0; m < pop_num; m++) { |
213 | no_in_arr.pop(); | 213 | no_in_arr.pop(); |
214 | } | 214 | } |
packageF/pages/free_delivery/free_delivery.js
@@ -74,10 +74,15 @@ Page({ | @@ -74,10 +74,15 @@ Page({ | ||
74 | userInfo | 74 | userInfo |
75 | }) | 75 | }) |
76 | if (userInfo) { | 76 | if (userInfo) { |
77 | - this.setData({ | ||
78 | - login_title:userInfo.mobile, | ||
79 | - login_name:'领取会员' | ||
80 | - }) | 77 | + if (userInfo.mobile) { |
78 | + this.setData({ | ||
79 | + login_title:userInfo.mobile, | ||
80 | + login_name:'领取会员' | ||
81 | + }) | ||
82 | + }else{ | ||
83 | + getApp().globalData.userInfo=null | ||
84 | + wx.setStorageSync("userinfo", null); | ||
85 | + } | ||
81 | } | 86 | } |
82 | 87 | ||
83 | }, | 88 | }, |
pages/cart/cart/zh_calculate.js
@@ -240,9 +240,9 @@ module.exports = { | @@ -240,9 +240,9 @@ module.exports = { | ||
240 | var zhqty_len = 0; //几个超量倍增 | 240 | var zhqty_len = 0; //几个超量倍增 |
241 | var be = parseInt(no_in_arr.length / act.zhbuyqty); //看一下是几倍 | 241 | var be = parseInt(no_in_arr.length / act.zhbuyqty); //看一下是几倍 |
242 | 242 | ||
243 | - //如果有总数控制的时候 | 243 | + //如果有总数控制的时候,看还能买几组 |
244 | if(act.zh_num){ | 244 | if(act.zh_num){ |
245 | - var be1=act.zh_num-act.zh_buy_num-1; | 245 | + var be1= parseInt((act.zh_num-act.zh_buy_num)/ act.zhbuyqty)-1; |
246 | if(be1<be) be=be1; | 246 | if(be1<be) be=be1; |
247 | } | 247 | } |
248 | 248 |
pages/goods/goodsInfo/goodsInfo.js
@@ -8492,11 +8492,12 @@ Page({ | @@ -8492,11 +8492,12 @@ Page({ | ||
8492 | openSpecModal_flash_normal: 1 | 8492 | openSpecModal_flash_normal: 1 |
8493 | }); | 8493 | }); |
8494 | } else { | 8494 | } else { |
8495 | - th.get_sto(1); | 8495 | + |
8496 | th.get_sku(o.stoid, th.data.data, th.data.gid, 1, function () { | 8496 | th.get_sku(o.stoid, th.data.data, th.data.gid, 1, function () { |
8497 | th.setData({ | 8497 | th.setData({ |
8498 | openSpecModal_flash_normal: 1 | 8498 | openSpecModal_flash_normal: 1 |
8499 | }); | 8499 | }); |
8500 | + th.get_sto(1); | ||
8500 | }); | 8501 | }); |
8501 | } | 8502 | } |
8502 | if (!this.data.data.whsle_id) this.check_is_youhui(th.data.gid, 1); | 8503 | if (!this.data.data.whsle_id) this.check_is_youhui(th.data.gid, 1); |
utils/more_cx.js
@@ -46,6 +46,7 @@ module.exports = { | @@ -46,6 +46,7 @@ module.exports = { | ||
46 | 46 | ||
47 | let no_in_arr = []; //剩余的未加入组合购 | 47 | let no_in_arr = []; //剩余的未加入组合购 |
48 | let out_arr = []; //超出活动限购的商品放入 | 48 | let out_arr = []; //超出活动限购的商品放入 |
49 | + let zhqty_bz = []; //超量 | ||
49 | 50 | ||
50 | //-- 判断组合购的总数量是不是到了 -- | 51 | //-- 判断组合购的总数量是不是到了 -- |
51 | if(act.zh_num>0){ | 52 | if(act.zh_num>0){ |
@@ -135,6 +136,9 @@ module.exports = { | @@ -135,6 +136,9 @@ module.exports = { | ||
135 | all_num += item.num; | 136 | all_num += item.num; |
136 | //当有起购数的控制的时候 | 137 | //当有起购数的控制的时候 |
137 | if (item.zhqty) { | 138 | if (item.zhqty) { |
139 | + | ||
140 | + zhqty_bz.push(item); | ||
141 | + | ||
138 | all_zhqty += item.zhqty; | 142 | all_zhqty += item.zhqty; |
139 | if (item.num < item.zhqty) { | 143 | if (item.num < item.zhqty) { |
140 | need_to_buy += item.zhqty - item.num; | 144 | need_to_buy += item.zhqty - item.num; |