Commit b2fcca429a8259ba764c195516237969ce3b811c
Merge branch 'dev' of http://git.vipzhuang.cn/wxd/MShopWeApp into dev
Showing
6 changed files
with
28 additions
and
18 deletions
packageB/pages/zuhegou/index/index.js
... | ... | @@ -1599,12 +1599,12 @@ Page({ |
1599 | 1599 | } |
1600 | 1600 | if (item.num > item.zhqty) { |
1601 | 1601 | for (var i = 0; i < item.num - item.zhqty; i++) { |
1602 | - no_in_arr.push({price: item.current_price}) | |
1602 | + no_in_arr.push({price: item.current_price,goods_id:item.goods_id}); | |
1603 | 1603 | } |
1604 | 1604 | } |
1605 | 1605 | } else { |
1606 | 1606 | for (var j = 0; j < item.num; j++) { |
1607 | - no_in_arr.push({price: item.current_price}) | |
1607 | + no_in_arr.push({price: item.current_price,goods_id:item.goods_id}); | |
1608 | 1608 | } |
1609 | 1609 | } |
1610 | 1610 | } else { |
... | ... | @@ -1615,7 +1615,7 @@ Page({ |
1615 | 1615 | //当满足组合的要求:总数要满足,起购数要满足 |
1616 | 1616 | if (all_num >= this.data.act.zhbuyqty && !need_to_buy) { |
1617 | 1617 | function sortData(a, b) { |
1618 | - return a.price - b.price | |
1618 | + return b.price - a.price | |
1619 | 1619 | } |
1620 | 1620 | |
1621 | 1621 | no_in_arr.sort(sortData); | ... | ... |
pages/cart/cart/zh_calculate.js
... | ... | @@ -87,8 +87,8 @@ module.exports = { |
87 | 87 | var goods = zh_prom_goods[act.id]; |
88 | 88 | //寻找一下 |
89 | 89 | function get_num(ite) { |
90 | - for (let v1 in car_item.goods) { | |
91 | - var vh = car_item.goods[v1]; | |
90 | + for (let v1 in bitem.goods) { | |
91 | + var vh = bitem.goods[v1]; | |
92 | 92 | if (vh.goods_id == ite.goods_id) { |
93 | 93 | return vh; |
94 | 94 | } |
... | ... | @@ -96,6 +96,17 @@ module.exports = { |
96 | 96 | return 0; |
97 | 97 | } |
98 | 98 | |
99 | + //寻找一下 | |
100 | + function get_num2(ite) { | |
101 | + for (let v2 in car_item.goods) { | |
102 | + var vh = car_item.goods[v2]; | |
103 | + if (vh.goods_id == ite.goods_id) { | |
104 | + return vh; | |
105 | + } | |
106 | + } | |
107 | + return 0; | |
108 | + } | |
109 | + | |
99 | 110 | for (var i in goods) { |
100 | 111 | var item = goods[i]; |
101 | 112 | item.num = get_num(item).goods_num; |
... | ... | @@ -114,14 +125,14 @@ module.exports = { |
114 | 125 | if (item.num > item.zhqty) { |
115 | 126 | for (var i = 0; i < item.num - item.zhqty; i++) { |
116 | 127 | no_in_arr.push({ |
117 | - price: item.goods_price,offline_price:item.offline_price | |
128 | + price: item.goods_price,offline_price:item.offline_price,goods_id:item.goods_id | |
118 | 129 | }) |
119 | 130 | } |
120 | 131 | } |
121 | 132 | } else { |
122 | 133 | for (var j = 0; j < item.num; j++) { |
123 | 134 | no_in_arr.push({ |
124 | - price: item.goods_price,offline_price:item.offline_price | |
135 | + price: item.goods_price,offline_price:item.offline_price,goods_id:item.goods_id | |
125 | 136 | }) |
126 | 137 | } |
127 | 138 | } |
... | ... | @@ -136,7 +147,7 @@ module.exports = { |
136 | 147 | //当满足组合的要求:总数要满足,起购数要满足 |
137 | 148 | if (all_num >= act.zhbuyqty && !need_to_buy) { |
138 | 149 | function sortData(a, b) { |
139 | - return a.price - b.price | |
150 | + return b.price - a.price | |
140 | 151 | } |
141 | 152 | |
142 | 153 | no_in_arr.sort(sortData); |
... | ... | @@ -159,7 +170,7 @@ module.exports = { |
159 | 170 | if (no_in_arr.length) { |
160 | 171 | for (var ii in no_in_arr) { |
161 | 172 | var item = no_in_arr[ii]; |
162 | - var gitem=get_num(item); | |
173 | + var gitem=get_num2(item); | |
163 | 174 | if(gitem) { |
164 | 175 | if (!gitem.need_downlow_num) { |
165 | 176 | gitem.need_downlow_num = 1; |
... | ... | @@ -190,9 +201,7 @@ module.exports = { |
190 | 201 | } else { |
191 | 202 | for (var ii in goods) { |
192 | 203 | var item = goods[ii]; |
193 | - | |
194 | - | |
195 | - var gitem=get_num(item); | |
204 | + var gitem=get_num2(item); | |
196 | 205 | if(gitem) { |
197 | 206 | gitem.need_downlow_num = item.num; |
198 | 207 | ... | ... |
pages/cart/cart2/zh_calculate.js
pages/cart/cart2_pt/cart2_pt.js
... | ... | @@ -153,6 +153,7 @@ Page({ |
153 | 153 | if (su.data.code == 0) { |
154 | 154 | var yuer = parseFloat(th.data.userinfo.user_money - |
155 | 155 | (th.data.userinfo.frozen_money>0?th.data.userinfo.frozen_money:0) - su.data.data.summoney).toFixed(2); |
156 | + if(yuer<0) yuer=0; | |
156 | 157 | th.setData({ txmon: su.data.data.summoney, yuer: yuer }); |
157 | 158 | } |
158 | 159 | } |
... | ... | @@ -451,13 +452,13 @@ Page({ |
451 | 452 | var txt = "formData.user_money"; |
452 | 453 | var txt2 = "formData.order_amount"; |
453 | 454 | //--------------如果使用余额--------------------- |
454 | - if (th.data.bn_use_money == 1) { | |
455 | + if (th.data.bn_use_money == 1 && th.data.yuer>0) { | |
455 | 456 | if ( parseFloat(th.data.yuer) > total_m) { |
456 | 457 | th.setData({ [txt]: total_m, [txt2]:0 }) |
457 | 458 | }else{ |
458 | 459 | order_m = parseFloat(order_m) - parseFloat(th.data.yuer); |
459 | 460 | order_m = order_m.toFixed(2); |
460 | - th.setData({ [txt]: th.data.userinfo.yuer, [txt2]: order_m }) | |
461 | + th.setData({ [txt]: th.data.yuer, [txt2]: order_m }) | |
461 | 462 | } |
462 | 463 | }else{ |
463 | 464 | th.setData({ [txt]: 0, [txt2]: order_m }) | ... | ... |
pages/cart/cart2_pt/cart2_pt.wxml
... | ... | @@ -125,7 +125,7 @@ |
125 | 125 | |
126 | 126 | <view class="information bdr14"> |
127 | 127 | <!-----使用余额------> |
128 | - <view class="set-mes" wx:if="{{userinfo.user_money>0}}"> | |
128 | + <view class="set-mes" wx:if="{{userinfo.user_money>0 && yuer>0}}"> | |
129 | 129 | <view class="use-item" bindtap='set_bn_useyuer' style="padding-left:0;padding-right:0;"> |
130 | 130 | <icon color="{{bn_use_money?'red':'gray'}}" size="16" type="success"></icon> |
131 | 131 | <view class="yu_er">使用余额 :¥{{yuer}} </view> | ... | ... |
pages/goods/categoryList/categoryList.wxml
... | ... | @@ -196,7 +196,7 @@ |
196 | 196 | <block wx:for="{{groups}}" wx:for-item="brand_list" wx:for-index="pidx"> |
197 | 197 | <view class="brand_img_frame" wx:for="{{brand_list.array}}" wx:for-item="user" wx:for-index="idx" bindtap="go_brand" data-bid="{{user.id}}" > |
198 | 198 | |
199 | - <view class="brand_img t-c"> | |
199 | + <view class="t-c"> | |
200 | 200 | <image class="brand_img" src="{{user.logo}}" data-errorimg="groups[{{pidx}}].array[{{idx}}].logo" binderror="bind_bnerr_pp"></image> |
201 | 201 | <view class="brand_img_name ellipsis-1 fs24">{{user.name}}</view> |
202 | 202 | </view> |
... | ... | @@ -381,7 +381,7 @@ |
381 | 381 | <block wx:for="{{groups}}" wx:for-item="brand_list" wx:for-index="pidx"> |
382 | 382 | <view class="brand_img_frame "wx:for="{{brand_list.array}}" wx:for-item="user" wx:for-index="idx" bindtap="go_brand" data-bid="{{user.id}}" > |
383 | 383 | |
384 | - <view class="brand_img t-c"> | |
384 | + <view class="t-c"> | |
385 | 385 | <image class=" brand_img" src="{{user.logo}}" data-pix="{{pidx}}" data-idx="{{idx}}" data-errorimg="groups[{{pidx}}].array[{{idx}}].logo" binderror="bind_bnerr_pp"></image> |
386 | 386 | <view class="brand_img_name ellipsis-1 fs24">{{user.name}}</view> |
387 | 387 | </view> | ... | ... |