Commit 452948f35936f110b83b1f1a8048fc41015f1cd9
Merge branch 'test' of http://git.vipzhuang.cn/wxd/MShopWeApp into qa
Showing
12 changed files
with
243 additions
and
44 deletions
components/promate_pop/promate_pop.wxss
@@ -261,6 +261,7 @@ | @@ -261,6 +261,7 @@ | ||
261 | .xc-hook.on { | 261 | .xc-hook.on { |
262 | transform: rotate(-135deg); | 262 | transform: rotate(-135deg); |
263 | background-color: #d60021; | 263 | background-color: #d60021; |
264 | + font-size: 24rpx | ||
264 | } | 265 | } |
265 | 266 | ||
266 | @import '../../app.wxss'; | 267 | @import '../../app.wxss'; |
packageB/pages/evaluate/evaluate.js
@@ -26,7 +26,8 @@ Page({ | @@ -26,7 +26,8 @@ Page({ | ||
26 | is_act:0, //是否能购获取图片 | 26 | is_act:0, //是否能购获取图片 |
27 | actId:0, //活动ID | 27 | actId:0, //活动ID |
28 | giftBagId:0, //礼包ID | 28 | giftBagId:0, //礼包ID |
29 | - ftype:0 | 29 | + ftype:0, |
30 | + isdg:0, //是否是导购 | ||
30 | 31 | ||
31 | }, | 32 | }, |
32 | //点击星级 | 33 | //点击星级 |
@@ -242,6 +243,11 @@ Page({ | @@ -242,6 +243,11 @@ Page({ | ||
242 | this.setData({ftype:parseInt(options.fromtype)}) ; | 243 | this.setData({ftype:parseInt(options.fromtype)}) ; |
243 | if(options.fromtype==4 || options.fromtype==1 ) th.judge_act(); | 244 | if(options.fromtype==4 || options.fromtype==1 ) th.judge_act(); |
244 | } | 245 | } |
246 | + if (options.isdg) { | ||
247 | + this.setData({ | ||
248 | + isdg:options.isdg | ||
249 | + }) | ||
250 | + } | ||
245 | //th.query_bea(); | 251 | //th.query_bea(); |
246 | 252 | ||
247 | var userinfo=getApp().globalData.userInfo; | 253 | var userinfo=getApp().globalData.userInfo; |
@@ -288,8 +294,9 @@ Page({ | @@ -288,8 +294,9 @@ Page({ | ||
288 | console.log(id,"订单", this.data.number); | 294 | console.log(id,"订单", this.data.number); |
289 | 295 | ||
290 | var ty=this.data.ftype?this.data.ftype:2; | 296 | var ty=this.data.ftype?this.data.ftype:2; |
297 | + var isdg = this.data.isdg | ||
291 | wx.redirectTo({ | 298 | wx.redirectTo({ |
292 | - url: "/pages/giftpack/evaluategift/evaluategift?actId="+id+ "&orderType="+ty+"&orderNumber="+this.data.number+"&isdg=1" | 299 | + url: "/pages/giftpack/evaluategift/evaluategift?actId="+id+ "&orderType="+ty+"&orderNumber="+this.data.number+"&isdg="+isdg |
293 | }); | 300 | }); |
294 | 301 | ||
295 | }, | 302 | }, |
packageD/pages/user/coupons/coupons.wxml
@@ -64,8 +64,8 @@ | @@ -64,8 +64,8 @@ | ||
64 | </view> | 64 | </view> |
65 | </view> | 65 | </view> |
66 | <view class="c-info arrow-down {{detail.isShowDetails ? 'active':''}}" bindtap="clickDetails" data-index="{{idx}}"> | 66 | <view class="c-info arrow-down {{detail.isShowDetails ? 'active':''}}" bindtap="clickDetails" data-index="{{idx}}"> |
67 | - <view class="{{detail.isShowDetails ? '':'ellipsis-1x'}}" wx:if="{{detail.Remark1!=''}}"><text style="margin-right: 15rpx">使用说明:</text>{{filter.getNum(detail.Sum)}}元优惠券,{{(detail.UseObjectID==null || detail.UseObjectID=='')?"全场通用":"仅限"+(detail.UseObjectName)+"使用"}},满 {{detail.BuySum==null || detail.BuySum==''?filter.getNum(0):filter.getNum(detail.BuySum)}}元使用 {{detail.region_list_name==null || detail.region_list_name==''?"":",不包邮地区:"+region_list_name}};{{detail.Remark1}};活动名称:{{detail.ActName}}、活动编号:{{detail.ActNo}}</view> | ||
68 | - <view class="{{detail.isShowDetails ? '':'ellipsis-1x'}}" wx:else><text style="margin-right: 15rpx">使用说明:</text> {{filter.getNum(detail.Sum)}}元优惠券,{{(detail.UseObjectID==null || detail.UseObjectID=='')?"全场通用":"仅限"+(detail.UseObjectName)+"使用"}},满 {{detail.BuySum==null || detail.BuySum==''?filter.getNum(0):filter.getNum(detail.BuySum)}}元使用 {{detail.region_list_name==null || detail.region_list_name==''?"":",不包邮地区:"+region_list_name}};活动名称:{{detail.ActName}}、活动编号:{{detail.ActNo}}</view> | 67 | + <view class="{{detail.isShowDetails ? '':'ellipsis-1x'}}" wx:if="{{detail.Remark1!=''}}"><text style="margin-right: 15rpx">使用说明:</text>{{filter.getNum(detail.Sum)}}元优惠券,{{(detail.UseObjectID==null || detail.UseObjectID=='')?"全场通用":"仅限"+(detail.UseObjectName)+"使用"}},满 {{detail.BuySum==null || detail.BuySum==''?filter.getNum(0):filter.getNum(detail.BuySum)}}元使用 {{detail.region_list_name==null || detail.region_list_name==''?"":",不包邮地区:"+region_list_name}};{{detail.Remark1}};活动名称:{{detail.ActName}}、活动编号:{{detail.ActNo}}、使用场景:{{ (detail.UseRange && detail.UseRange !=0) ? (detail.UseRange==1 ? '仅线下可用' : '仅线上可用') :'通用'}}</view> |
68 | + <view class="{{detail.isShowDetails ? '':'ellipsis-1x'}}" wx:else><text style="margin-right: 15rpx">使用说明:</text> {{filter.getNum(detail.Sum)}}元优惠券,{{(detail.UseObjectID==null || detail.UseObjectID=='')?"全场通用":"仅限"+(detail.UseObjectName)+"使用"}},满 {{detail.BuySum==null || detail.BuySum==''?filter.getNum(0):filter.getNum(detail.BuySum)}}元使用 {{detail.region_list_name==null || detail.region_list_name==''?"":",不包邮地区:"+region_list_name}};活动名称:{{detail.ActName}}、活动编号:{{detail.ActNo}}、使用场景:{{(detail.UseRange && detail.UseRange !=0) ? (detail.UseRange==1 ? '仅线下可用' : '仅线上可用') :'通用'}}</view> | ||
69 | </view> | 69 | </view> |
70 | </block> | 70 | </block> |
71 | </view> | 71 | </view> |
packageE/pages/cart/cart2/cart2.js
@@ -1294,7 +1294,7 @@ Page({ | @@ -1294,7 +1294,7 @@ Page({ | ||
1294 | await m_cx.cart_cx_group(th, arr[k].goods, c_item, 0, 0, (show_can_cx) => { | 1294 | await m_cx.cart_cx_group(th, arr[k].goods, c_item, 0, 0, (show_can_cx) => { |
1295 | 1295 | ||
1296 | arr[k].show_can_cx = show_can_cx; | 1296 | arr[k].show_can_cx = show_can_cx; |
1297 | - }) | 1297 | + },2) |
1298 | } else { | 1298 | } else { |
1299 | var show_can_cx = this.data.cartlist[k].show_can_cx; | 1299 | var show_can_cx = this.data.cartlist[k].show_can_cx; |
1300 | //-- 多促销活动的优化 -- | 1300 | //-- 多促销活动的优化 -- |
pages/cart/cart/cart.js
@@ -855,6 +855,7 @@ Page({ | @@ -855,6 +855,7 @@ Page({ | ||
855 | item.selected = 0; | 855 | item.selected = 0; |
856 | item.erpwareid = good.erpwareid; //要同步下线商品的id | 856 | item.erpwareid = good.erpwareid; //要同步下线商品的id |
857 | item.shop_price = good.shop_price; //要同步下线商品的id | 857 | item.shop_price = good.shop_price; //要同步下线商品的id |
858 | + item.init_goods_price=good.goods_price; | ||
858 | 859 | ||
859 | //-- 读出每一种商品的所有的活动,方便后面的活动切换使用 -- | 860 | //-- 读出每一种商品的所有的活动,方便后面的活动切换使用 -- |
860 | if (item.prom_type == 0) | 861 | if (item.prom_type == 0) |
@@ -1559,6 +1560,10 @@ Page({ | @@ -1559,6 +1560,10 @@ Page({ | ||
1559 | var fir = 0; | 1560 | var fir = 0; |
1560 | for (var j = 0; j < item.length; j++) { | 1561 | for (var j = 0; j < item.length; j++) { |
1561 | if (item[j].is_gift) continue; | 1562 | if (item[j].is_gift) continue; |
1563 | + | ||
1564 | + //把价格还原 | ||
1565 | + item[j].goods_price=item[j].init_goods_price; | ||
1566 | + | ||
1562 | var obj = JSON.parse(JSON.stringify(item[j])); | 1567 | var obj = JSON.parse(JSON.stringify(item[j])); |
1563 | var gd_info=obj; | 1568 | var gd_info=obj; |
1564 | 1569 | ||
@@ -2078,6 +2083,7 @@ Page({ | @@ -2078,6 +2083,7 @@ Page({ | ||
2078 | this.data.btn_click = 1; | 2083 | this.data.btn_click = 1; |
2079 | var garr = e.data.service_data; | 2084 | var garr = e.data.service_data; |
2080 | 2085 | ||
2086 | + //之前没有选中,代表现在要选中 | ||
2081 | if (!a.selected) { | 2087 | if (!a.selected) { |
2082 | 2088 | ||
2083 | //如果是标记的时候 | 2089 | //如果是标记的时候 |
@@ -2385,7 +2391,7 @@ Page({ | @@ -2385,7 +2391,7 @@ Page({ | ||
2385 | //不需要修改价格 | 2391 | //不需要修改价格 |
2386 | await m_cx.cart_cx_group(th, ite1, car[a], 0, n_ok, (show_can_cx) => { | 2392 | await m_cx.cart_cx_group(th, ite1, car[a], 0, n_ok, (show_can_cx) => { |
2387 | rd_arr.push(show_can_cx) | 2393 | rd_arr.push(show_can_cx) |
2388 | - },1) | 2394 | + }) |
2389 | } | 2395 | } |
2390 | 2396 | ||
2391 | if(car.length>1 && c_ind>-1){ | 2397 | if(car.length>1 && c_ind>-1){ |
@@ -2393,7 +2399,7 @@ Page({ | @@ -2393,7 +2399,7 @@ Page({ | ||
2393 | //检验和设置商品的最终是以 取用什么活动,因为多促销 | 2399 | //检验和设置商品的最终是以 取用什么活动,因为多促销 |
2394 | await m_cx.cart_cx_group(th, ite2, car[c_ind], 0, n_ok, (show_can_cx) => { | 2400 | await m_cx.cart_cx_group(th, ite2, car[c_ind], 0, n_ok, (show_can_cx) => { |
2395 | rd_arr[c_ind]=show_can_cx; | 2401 | rd_arr[c_ind]=show_can_cx; |
2396 | - },1) | 2402 | + }) |
2397 | } | 2403 | } |
2398 | 2404 | ||
2399 | for (var a = 0; a < car.length; a++) { | 2405 | for (var a = 0; a < car.length; a++) { |
@@ -4012,7 +4018,7 @@ Page({ | @@ -4012,7 +4018,7 @@ Page({ | ||
4012 | 4018 | ||
4013 | //如果会员是等级会员,商品有等级价,且不是活动商品 | 4019 | //如果会员是等级会员,商品有等级价,且不是活动商品 |
4014 | if (card_field && val[card_field] > 0 && | 4020 | if (card_field && val[card_field] > 0 && |
4015 | - ((val.prom_type == 0 && g_arr[i].prom_type == 0) || g_arr[i].prom_type == 3 || g_arr[i].prom_type == 5 || g_arr[i].prom_type == 7 || g_arr[i].prom_type == 10)) { | 4021 | + ((val.prom_type == 0 && g_arr[i].prom_type == 0) || g_arr[i].prom_type == 5 || g_arr[i].prom_type == 7 || g_arr[i].prom_type == 10)) { |
4016 | if (g_arr[i].goods_price != val[card_field]) { | 4022 | if (g_arr[i].goods_price != val[card_field]) { |
4017 | isok = 0; | 4023 | isok = 0; |
4018 | gname = val.goods_name; | 4024 | gname = val.goods_name; |
@@ -5104,8 +5110,11 @@ Page({ | @@ -5104,8 +5110,11 @@ Page({ | ||
5104 | 5110 | ||
5105 | var th = this; | 5111 | var th = this; |
5106 | var car = JSON.parse(JSON.stringify(this.data.requestData)); | 5112 | var car = JSON.parse(JSON.stringify(this.data.requestData)); |
5107 | - var item = car[c_idx].goods, | ||
5108 | - is_s_sele = 1; | 5113 | + var item = car[c_idx].goods, is_s_sele = 1; |
5114 | + | ||
5115 | + for (var i = 0; i < item.length; i++) { | ||
5116 | + item[i].goods_price = item[i].init_goods_price; | ||
5117 | + } | ||
5109 | 5118 | ||
5110 | var is_has_other = 0; | 5119 | var is_has_other = 0; |
5111 | for (var ii = 0; ii < car.length; ii++) { | 5120 | for (var ii = 0; ii < car.length; ii++) { |
@@ -5126,15 +5135,16 @@ Page({ | @@ -5126,15 +5135,16 @@ Page({ | ||
5126 | } | 5135 | } |
5127 | //-- 让选择进入对应 -- | 5136 | //-- 让选择进入对应 -- |
5128 | for (var i = 0; i < item.length; i++) { | 5137 | for (var i = 0; i < item.length; i++) { |
5129 | - if (sele_arr.hasOwnProperty(i)) { | ||
5130 | - item[i].selected = sele_arr[i]; | ||
5131 | - } | 5138 | + if (sele_arr.hasOwnProperty(i)) { |
5139 | + item[i].selected = sele_arr[i]; | ||
5140 | + } | ||
5132 | } | 5141 | } |
5142 | + | ||
5133 | //-- 先批量判断一下活动的类型,同时要同步跟新 -- | 5143 | //-- 先批量判断一下活动的类型,同时要同步跟新 -- |
5134 | m_cx.cart_cx_group(this, item, car[c_idx], 0, 0, (show_can_cx) => { | 5144 | m_cx.cart_cx_group(this, item, car[c_idx], 0, 0, (show_can_cx) => { |
5135 | car[c_idx].show_can_cx = show_can_cx; | 5145 | car[c_idx].show_can_cx = show_can_cx; |
5136 | th.cx_check_ok2(func, car); | 5146 | th.cx_check_ok2(func, car); |
5137 | - },1); | 5147 | + }); |
5138 | 5148 | ||
5139 | }, | 5149 | }, |
5140 | 5150 | ||
@@ -5257,6 +5267,7 @@ Page({ | @@ -5257,6 +5267,7 @@ Page({ | ||
5257 | } | 5267 | } |
5258 | } | 5268 | } |
5259 | } | 5269 | } |
5270 | + | ||
5260 | func({ | 5271 | func({ |
5261 | 'code': 0, | 5272 | 'code': 0, |
5262 | 'msg': '成功' | 5273 | 'msg': '成功' |
pages/cart/cart/cart.wxml
@@ -193,16 +193,7 @@ | @@ -193,16 +193,7 @@ | ||
193 | <view class="flex jc_sb fs28" wx:for="{{item.make_up_arr}}" style="margin-bottom: 20rpx" > | 193 | <view class="flex jc_sb fs28" wx:for="{{item.make_up_arr}}" style="margin-bottom: 20rpx" > |
194 | <view class="ellipsis-1" style="width: 80%">再买<text class="co-red">{{item.diff}}<text wx:if="{{item.diff_type==0}}">元</text> | 194 | <view class="ellipsis-1" style="width: 80%">再买<text class="co-red">{{item.diff}}<text wx:if="{{item.diff_type==0}}">元</text> |
195 | <text wx:if="{{item.diff_type==1}}">件</text> | 195 | <text wx:if="{{item.diff_type==1}}">件</text> |
196 | - </text>, | ||
197 | - <text wx:if="{{item.content.is_money==1}}">免{{item.content.money}}元|</text> | ||
198 | - <text wx:if="{{item.content.is_sale==1}}">打{{item.content.sale}}折|</text> | ||
199 | - <text wx:if="{{item.content.is_past==1}}">包邮|</text> | ||
200 | - <text wx:if="{{item.content.is_coupon==1}}">送优惠券|</text> | ||
201 | - <text wx:if="{{item.content.is_int==1}}">送积分|</text> | ||
202 | - <text wx:if="{{item.content.is_gift==1}}">送赠品|</text> | ||
203 | - <text wx:if="{{item.content.is_libao==1}}">送礼包|</text> | ||
204 | - <text wx:if="{{item.content.is_zxlibao==1}}">送专享礼包|</text> | ||
205 | - <text wx:if="{{item.content.is_monthgiftbag==1}}">送每月礼包|</text> | 196 | + </text>,{{g_filter.map_str(item.content)}} |
206 | <text></text> | 197 | <text></text> |
207 | </view> | 198 | </view> |
208 | <view class="co-red" data-prom_id="{{item.prom_id}}" bindtap="go_cou_dang">去凑单></view> | 199 | <view class="co-red" data-prom_id="{{item.prom_id}}" bindtap="go_cou_dang">去凑单></view> |
pages/cart/cart/g_filter.wxs
@@ -35,6 +35,22 @@ var g_filters = { | @@ -35,6 +35,22 @@ var g_filters = { | ||
35 | if([1,2,4,6,8,9].indexOf(items.prom_type)>-1) return false; | 35 | if([1,2,4,6,8,9].indexOf(items.prom_type)>-1) return false; |
36 | if(!show_can_cx) return false; | 36 | if(!show_can_cx) return false; |
37 | return true; | 37 | return true; |
38 | + }, | ||
39 | + | ||
40 | + //判断一下文件末尾的|号,促销显示送的内容 | ||
41 | + map_str:function (content){ | ||
42 | + var string=''; | ||
43 | + if(content.is_money==1) string+='免'+content.money+'元|'; | ||
44 | + if(content.is_sale==1) string+="打"+content.sale+"折|"; | ||
45 | + if(content.is_past==1) string+= "包邮|"; | ||
46 | + if(content.is_coupon==1) string+="送优惠券|"; | ||
47 | + if(content.is_int==1) string+="送积分|"; | ||
48 | + if(content.is_gift==1) string+="送赠品|"; | ||
49 | + if(content.is_libao==1) string+="送礼包|"; | ||
50 | + if(content.is_zxlibao==1) string+="送专享礼包|"; | ||
51 | + if(content.is_monthgiftbag==1) string+="送每月礼包|"; | ||
52 | + string=string.substring(0,string.length-1); | ||
53 | + return string | ||
38 | } | 54 | } |
39 | 55 | ||
40 | } | 56 | } |
@@ -44,5 +60,6 @@ module.exports = { | @@ -44,5 +60,6 @@ module.exports = { | ||
44 | end_time: g_filters.end_time, | 60 | end_time: g_filters.end_time, |
45 | toFix: g_filters.toFix, | 61 | toFix: g_filters.toFix, |
46 | is_more_act: g_filters.is_more_act, | 62 | is_more_act: g_filters.is_more_act, |
47 | - check_show:g_filters.check_show | 63 | + check_show:g_filters.check_show, |
64 | + map_str:g_filters.map_str | ||
48 | } | 65 | } |
49 | \ No newline at end of file | 66 | \ No newline at end of file |
pages/giftpack/evaluategift/evaluategift.js
@@ -189,6 +189,9 @@ Page({ | @@ -189,6 +189,9 @@ Page({ | ||
189 | "giftBagId": th.data.giftBagId, | 189 | "giftBagId": th.data.giftBagId, |
190 | "buyFrom": 2 | 190 | "buyFrom": 2 |
191 | }; | 191 | }; |
192 | + if (th.data.isdg) { | ||
193 | + json.isdg=th.data.isdg | ||
194 | + } | ||
192 | var data = JSON.stringify(json); | 195 | var data = JSON.stringify(json); |
193 | var url = th.data.url + "/api/weshop/marketing/free/receive/gift/record/insert"; | 196 | var url = th.data.url + "/api/weshop/marketing/free/receive/gift/record/insert"; |
194 | getApp().request.json_post(url, json, | 197 | getApp().request.json_post(url, json, |
pages/user/index/index.js
@@ -174,8 +174,11 @@ Page({ | @@ -174,8 +174,11 @@ Page({ | ||
174 | if (item.is_sy == 0) { | 174 | if (item.is_sy == 0) { |
175 | var now = Date.parse(new Date()); now = now / 1000; | 175 | var now = Date.parse(new Date()); now = now / 1000; |
176 | if (item.end_time < now) { | 176 | if (item.end_time < now) { |
177 | - th.setData({ is_no_plus: 0 }) | 177 | + th.setData({ is_no_plus: 0 }) |
178 | + }else{ | ||
179 | + th.setData({ is_no_plus: 1 }) | ||
178 | } | 180 | } |
181 | + | ||
179 | }else if(item.is_sy == 1){ | 182 | }else if(item.is_sy == 1){ |
180 | th.setData({ is_no_plus: 1 }) | 183 | th.setData({ is_no_plus: 1 }) |
181 | } | 184 | } |
pages/user/order_detail/order_detail.js
@@ -822,6 +822,17 @@ Page({ | @@ -822,6 +822,17 @@ Page({ | ||
822 | }) | 822 | }) |
823 | 823 | ||
824 | 824 | ||
825 | + if(gg.prom_type==3){ | ||
826 | + var prom_pc=null; | ||
827 | + await getApp().request.promiseGet("/api/weshop/promgoods/get/" + os.stoid + "/" + gg.prom_id, {}).then(res => { | ||
828 | + if (res.data.code == 0) { prom_pc = res.data.data; } | ||
829 | + }) | ||
830 | + | ||
831 | + if(prom_pc){ | ||
832 | + gg.discount_field=prom_pc.discount_field; | ||
833 | + } | ||
834 | + } | ||
835 | + | ||
825 | if ((gg.prom_type == 1 || gg.prom_type == 2 || gg.prom_type == 4 || gg.prom_type == 6 || gg.prom_type == 8 || gg.prom_type == 9) | 836 | if ((gg.prom_type == 1 || gg.prom_type == 2 || gg.prom_type == 4 || gg.prom_type == 6 || gg.prom_type == 8 || gg.prom_type == 9) |
826 | && !good.is_collocation && !good.is_gift && !good.is_integral_normal && !good.is_pd_normal) { | 837 | && !good.is_collocation && !good.is_gift && !good.is_integral_normal && !good.is_pd_normal) { |
827 | var prom = null; | 838 | var prom = null; |
@@ -922,6 +933,36 @@ Page({ | @@ -922,6 +933,36 @@ Page({ | ||
922 | yh_check=0; | 933 | yh_check=0; |
923 | } | 934 | } |
924 | } | 935 | } |
936 | + | ||
937 | + //--- 要判断一下优惠促销的商品的限购 --- | ||
938 | + if(yh_check){ | ||
939 | + var pro_gd_limit_num=0; | ||
940 | + var p_limit_rs= await getApp().request.promisePost('/api/weshop/promgoods/getPromGoodsLimitNum',{ | ||
941 | + data:{ | ||
942 | + store_id:os.stoid,goods_id:gg.goods_id,prom_id:gg.prom_id,prom_type:3 | ||
943 | + } | ||
944 | + }) | ||
945 | + if(p_limit_rs && p_limit_rs.data.code==0){ | ||
946 | + pro_gd_limit_num=p_limit_rs.data.data | ||
947 | + } | ||
948 | + //-- 如果有商品限购的时候 -- | ||
949 | + if(pro_gd_limit_num>0){ | ||
950 | + var pro_by_num=0; | ||
951 | + var lrs= { | ||
952 | + store_id: os.stoid,user_id: getApp().globalData.user_id, | ||
953 | + goods_id: gg.goods_id, prom_type: 3, | ||
954 | + prom_id: gg.prom_id, isnew:1 | ||
955 | + }; | ||
956 | + var gd_limit_rs=await getApp().promiseGet('/api/weshop/ordergoods/getUserBuyGoodsNum',{data:lrs}); | ||
957 | + if(gd_limit_rs && gd_limit_rs.data.code==0){ | ||
958 | + pro_by_num=gd_limit_rs.data.data.promgoodsbuynum | ||
959 | + } | ||
960 | + if(pro_gd_limit_num<=pro_by_num){ | ||
961 | + yh_check=0; | ||
962 | + } | ||
963 | + } | ||
964 | + } | ||
965 | + | ||
925 | //-- 优惠促销活动没有超出限购的话 -- | 966 | //-- 优惠促销活动没有超出限购的话 -- |
926 | if(yh_check){ | 967 | if(yh_check){ |
927 | if(!the_yh_map[gg.prom_id]) the_yh_map[gg.prom_id]=[]; | 968 | if(!the_yh_map[gg.prom_id]) the_yh_map[gg.prom_id]=[]; |
@@ -1043,17 +1084,32 @@ Page({ | @@ -1043,17 +1084,32 @@ Page({ | ||
1043 | 1084 | ||
1044 | //-- 如果会员是等级会员,商品有等级价,且不是活动商品,同时线下取价的要放在最后来判断 -- | 1085 | //-- 如果会员是等级会员,商品有等级价,且不是活动商品,同时线下取价的要放在最后来判断 -- |
1045 | if (!good.is_gift && !good.is_collocation && gg.prom_type != 9) { | 1086 | if (!good.is_gift && !good.is_collocation && gg.prom_type != 9) { |
1046 | - if (card_field && gg[card_field] > 0) { | ||
1047 | - if (good.goods_price != gg[card_field] && good.offline_cut <= 0) isok = 0; | ||
1048 | - if (good.goods_price > gg[card_field] && good.offline_cut > 0) isok = 0; //如果线下价格比较贵,则不通过 | ||
1049 | 1087 | ||
1050 | - } else { | ||
1051 | - if (good.goods_price != gg.shop_price && good.offline_cut <= 0) isok = 0; | ||
1052 | - if (good.goods_price > gg.shop_price && good.offline_cut > 0) isok = 0; //如果线下价格比较贵,则不通过 | 1088 | + //-- 优惠促销的时候控制取价规则 -- |
1089 | + if(gg.prom_type!=3 || gg.discount_field==undefined || gg.discount_field==0 ) { | ||
1090 | + if (card_field && gg[card_field] > 0) { | ||
1091 | + if (good.goods_price != gg[card_field] && good.offline_cut <= 0) isok = 0; | ||
1092 | + if (good.goods_price > gg[card_field] && good.offline_cut > 0) isok = 0; //如果线下价格比较贵,则不通过 | ||
1093 | + | ||
1094 | + } else { | ||
1095 | + if (good.goods_price != gg.shop_price && good.offline_cut <= 0) isok = 0; | ||
1096 | + if (good.goods_price > gg.shop_price && good.offline_cut > 0) isok = 0; //如果线下价格比较贵,则不通过 | ||
1097 | + } | ||
1098 | + }else{ | ||
1099 | + if(good.prom_type==3){ | ||
1100 | + switch (gg.discount_field){ | ||
1101 | + case 1: | ||
1102 | + if (good.goods_price != gg.shop_price) isok = 0; | ||
1103 | + break; | ||
1104 | + case 2: | ||
1105 | + if (good.goods_price != gg.market_price) isok = 0; | ||
1106 | + break; | ||
1107 | + } | ||
1108 | + } | ||
1053 | } | 1109 | } |
1110 | + | ||
1054 | var is_h = 0; | 1111 | var is_h = 0; |
1055 | if (!isok) { | 1112 | if (!isok) { |
1056 | - | ||
1057 | var content = gg.goods_name + '商品的价格发生了变化,请取消订单重新购买1' | 1113 | var content = gg.goods_name + '商品的价格发生了变化,请取消订单重新购买1' |
1058 | th.toast(content); | 1114 | th.toast(content); |
1059 | th.setData({ paying: 0 }); | 1115 | th.setData({ paying: 0 }); |
pages/user/order_list/order_list.js
@@ -17,6 +17,8 @@ var ut = require('../../../utils/util.js'); | @@ -17,6 +17,8 @@ var ut = require('../../../utils/util.js'); | ||
17 | var t = require("../../../utils/pay.js"); | 17 | var t = require("../../../utils/pay.js"); |
18 | var t_pay = require("../../../utils/pay2.js"); | 18 | var t_pay = require("../../../utils/pay2.js"); |
19 | 19 | ||
20 | + | ||
21 | + | ||
20 | Page({ | 22 | Page({ |
21 | data: { | 23 | data: { |
22 | url: e.globalData.setting.url, | 24 | url: e.globalData.setting.url, |
@@ -1105,13 +1107,25 @@ Page({ | @@ -1105,13 +1107,25 @@ Page({ | ||
1105 | return e.s_time < ut.gettimestamp() || (e.warm_uptime && e.warm_uptime < ut.gettimestamp()) | 1107 | return e.s_time < ut.gettimestamp() || (e.warm_uptime && e.warm_uptime < ut.gettimestamp()) |
1106 | }) | 1108 | }) |
1107 | if (arr2.length == 1) { | 1109 | if (arr2.length == 1) { |
1108 | - gg.prom_type=arr2[0].prom_type; | ||
1109 | - gg.prom_id=arr2[0].act_id; | 1110 | + gg.prom_type=arr2[0].prom_type; |
1111 | + gg.prom_id=arr2[0].act_id; | ||
1110 | } | 1112 | } |
1111 | } | 1113 | } |
1112 | }) | 1114 | }) |
1113 | 1115 | ||
1114 | 1116 | ||
1117 | + if(gg.prom_type==3){ | ||
1118 | + var prom_pc=null; | ||
1119 | + await getApp().request.promiseGet("/api/weshop/promgoods/get/" + os.stoid + "/" + gg.prom_id, {}).then(res => { | ||
1120 | + if (res.data.code == 0) { prom_pc = res.data.data; } | ||
1121 | + }) | ||
1122 | + | ||
1123 | + if(prom_pc){ | ||
1124 | + gg.discount_field=prom_pc.discount_field; | ||
1125 | + } | ||
1126 | + } | ||
1127 | + | ||
1128 | + | ||
1115 | if ((gg.prom_type == 1 || gg.prom_type == 2 || gg.prom_type == 4 || gg.prom_type == 6 || gg.prom_type == 8 || gg.prom_type == 9) | 1129 | if ((gg.prom_type == 1 || gg.prom_type == 2 || gg.prom_type == 4 || gg.prom_type == 6 || gg.prom_type == 8 || gg.prom_type == 9) |
1116 | && !good.is_collocation && !good.is_gift && !good.is_integral_normal && !good.is_pd_normal) { | 1130 | && !good.is_collocation && !good.is_gift && !good.is_integral_normal && !good.is_pd_normal) { |
1117 | var prom = null; | 1131 | var prom = null; |
@@ -1211,11 +1225,44 @@ Page({ | @@ -1211,11 +1225,44 @@ Page({ | ||
1211 | yh_check=0; | 1225 | yh_check=0; |
1212 | } | 1226 | } |
1213 | } | 1227 | } |
1228 | + | ||
1229 | + //--- 要判断一下优惠促销的商品的限购 --- | ||
1230 | + if(yh_check){ | ||
1231 | + var pro_gd_limit_num=0; | ||
1232 | + var p_limit_rs= await getApp().request.promisePost('/api/weshop/promgoods/getPromGoodsLimitNum',{ | ||
1233 | + data:{ | ||
1234 | + store_id:os.stoid,goods_id:gg.goods_id,prom_id:gg.prom_id,prom_type:3 | ||
1235 | + } | ||
1236 | + }) | ||
1237 | + if(p_limit_rs && p_limit_rs.data.code==0){ | ||
1238 | + pro_gd_limit_num=p_limit_rs.data.data | ||
1239 | + } | ||
1240 | + //-- 如果有商品限购的时候 -- | ||
1241 | + if(pro_gd_limit_num>0){ | ||
1242 | + var pro_by_num=0; | ||
1243 | + var lrs= { | ||
1244 | + store_id: os.stoid,user_id: getApp().globalData.user_id, | ||
1245 | + goods_id: gg.goods_id, prom_type: 3, | ||
1246 | + prom_id: gg.prom_id, isnew:1 | ||
1247 | + }; | ||
1248 | + var gd_limit_rs=await getApp().promiseGet('/api/weshop/ordergoods/getUserBuyGoodsNum',{data:lrs}); | ||
1249 | + if(gd_limit_rs && gd_limit_rs.data.code==0){ | ||
1250 | + pro_by_num=gd_limit_rs.data.data.promgoodsbuynum | ||
1251 | + } | ||
1252 | + if(pro_gd_limit_num<=pro_by_num){ | ||
1253 | + yh_check=0; | ||
1254 | + } | ||
1255 | + } | ||
1256 | + } | ||
1257 | + | ||
1214 | //-- 优惠促销活动没有超出限购的话 -- | 1258 | //-- 优惠促销活动没有超出限购的话 -- |
1215 | if(yh_check){ | 1259 | if(yh_check){ |
1216 | if(!the_yh_map[gg.prom_id]) the_yh_map[gg.prom_id]=[]; | 1260 | if(!the_yh_map[gg.prom_id]) the_yh_map[gg.prom_id]=[]; |
1217 | the_yh_map[gg.prom_id].push(good); | 1261 | the_yh_map[gg.prom_id].push(good); |
1218 | } | 1262 | } |
1263 | + | ||
1264 | + good.discount_field=prom.discount_field; | ||
1265 | + | ||
1219 | break | 1266 | break |
1220 | case 7: | 1267 | case 7: |
1221 | //获取组合购活动 | 1268 | //获取组合购活动 |
@@ -1329,14 +1376,33 @@ Page({ | @@ -1329,14 +1376,33 @@ Page({ | ||
1329 | 1376 | ||
1330 | //-- 如果会员是等级会员,商品有等级价,且不是活动商品,同时线下取价的要放在最后来判断 -- | 1377 | //-- 如果会员是等级会员,商品有等级价,且不是活动商品,同时线下取价的要放在最后来判断 -- |
1331 | if (!good.is_gift && !good.is_collocation && gg.prom_type != 9) { | 1378 | if (!good.is_gift && !good.is_collocation && gg.prom_type != 9) { |
1332 | - if (card_field && gg[card_field] > 0) { | ||
1333 | - if (good.goods_price != gg[card_field] && good.offline_cut <= 0) isok = 0; | ||
1334 | - if (good.goods_price > gg[card_field] && good.offline_cut > 0) isok = 0; //如果线下价格比较贵,则不通过 | ||
1335 | 1379 | ||
1336 | - } else { | ||
1337 | - if (good.goods_price != gg.shop_price && good.offline_cut <= 0) isok = 0; | ||
1338 | - if (good.goods_price > gg.shop_price && good.offline_cut > 0) isok = 0; //如果线下价格比较贵,则不通过 | 1380 | + |
1381 | + //-- 优惠促销的时候控制取价规则 -- | ||
1382 | + if(gg.prom_type!=3 || gg.discount_field==undefined || gg.discount_field==0 ){ | ||
1383 | + if (card_field && gg[card_field] > 0) { | ||
1384 | + if (good.goods_price != gg[card_field] && good.offline_cut <= 0) isok = 0; | ||
1385 | + if (good.goods_price > gg[card_field] && good.offline_cut > 0) isok = 0; //如果线下价格比较贵,则不通过 | ||
1386 | + | ||
1387 | + } else { | ||
1388 | + if (good.goods_price != gg.shop_price && good.offline_cut <= 0) isok = 0; | ||
1389 | + if (good.goods_price > gg.shop_price && good.offline_cut > 0) isok = 0; //如果线下价格比较贵,则不通过 | ||
1390 | + } | ||
1391 | + }else{ | ||
1392 | + | ||
1393 | + if(good.prom_type==3){ | ||
1394 | + switch (gg.discount_field){ | ||
1395 | + case 1: | ||
1396 | + if (good.goods_price != gg.shop_price) isok = 0; | ||
1397 | + break; | ||
1398 | + case 2: | ||
1399 | + if (good.goods_price != gg.market_price) isok = 0; | ||
1400 | + break; | ||
1401 | + } | ||
1402 | + } | ||
1339 | } | 1403 | } |
1404 | + | ||
1405 | + | ||
1340 | var is_h = 0; | 1406 | var is_h = 0; |
1341 | if (!isok) { | 1407 | if (!isok) { |
1342 | 1408 |
utils/more_cx.js
@@ -364,8 +364,29 @@ module.exports = { | @@ -364,8 +364,29 @@ module.exports = { | ||
364 | return g_item.goods_id==ck_prom_type.goods[b].goods_id && [0,3,5,7,10].indexOf(g_item.prom_type)>-1; | 364 | return g_item.goods_id==ck_prom_type.goods[b].goods_id && [0,3,5,7,10].indexOf(g_item.prom_type)>-1; |
365 | }) | 365 | }) |
366 | if(fg>-1){ | 366 | if(fg>-1){ |
367 | + | ||
368 | + goods[fg].goods_price = goods[fg].init_goods_price; | ||
367 | goods[fg].prom_type=ck_prom_type.prom_type; | 369 | goods[fg].prom_type=ck_prom_type.prom_type; |
368 | goods[fg].prom_id=ck_prom_type.prom_id; | 370 | goods[fg].prom_id=ck_prom_type.prom_id; |
371 | + | ||
372 | + if(ck_prom_type.prom_type==3){ | ||
373 | + let ffd=th.data.in_yhact[ck_prom_type.prom_id]; | ||
374 | + let f_price = goods[fg].goods_price; | ||
375 | + if (ffd.discount_field != undefined) { | ||
376 | + switch (ffd.discount_field) { | ||
377 | + case 0: | ||
378 | + f_price = goods[fg].goods_price; | ||
379 | + break; | ||
380 | + case 1: | ||
381 | + f_price = goods[fg].shop_price; | ||
382 | + break; | ||
383 | + case 2: | ||
384 | + f_price = goods[fg].goods_market_price; | ||
385 | + break; | ||
386 | + } | ||
387 | + } | ||
388 | + goods[fg].goods_price = f_price; | ||
389 | + } | ||
369 | } | 390 | } |
370 | } | 391 | } |
371 | 392 | ||
@@ -402,8 +423,12 @@ module.exports = { | @@ -402,8 +423,12 @@ module.exports = { | ||
402 | //-- 促销活动对象表,最初的map表,包含活动类型,活动id,goods商品 --- | 423 | //-- 促销活动对象表,最初的map表,包含活动类型,活动id,goods商品 --- |
403 | var cx_act_map=[]; | 424 | var cx_act_map=[]; |
404 | for(var i=0; i<goods.length;i++){ | 425 | for(var i=0; i<goods.length;i++){ |
405 | - //-- 运用深拷贝,避免价格的bug --s | ||
406 | - var c_item= JSON.parse(JSON.stringify(goods[i])); | 426 | + |
427 | + //商品的价格要还原,只有在购物车时候有init_goods_price,因为购物车要还原 | ||
428 | + if(goods[i].init_goods_price!=undefined) | ||
429 | + goods[i].goods_price=goods[i].init_goods_price; | ||
430 | + //进行深拷贝 | ||
431 | + var c_item=JSON.parse(JSON.stringify(goods[i])); | ||
407 | //没有选中 | 432 | //没有选中 |
408 | if(!c_item.selected) continue; | 433 | if(!c_item.selected) continue; |
409 | //如果是秒杀之类是商品 | 434 | //如果是秒杀之类是商品 |
@@ -526,7 +551,7 @@ module.exports = { | @@ -526,7 +551,7 @@ module.exports = { | ||
526 | for(var f=0;f<t_goods.length;f++){ | 551 | for(var f=0;f<t_goods.length;f++){ |
527 | all_num+=t_goods[f].goods_num; | 552 | all_num+=t_goods[f].goods_num; |
528 | 553 | ||
529 | - if(!is_no_change) { | 554 | + if(is_no_change!=1) { |
530 | //-- 优惠促销取价的优化 -- | 555 | //-- 优惠促销取价的优化 -- |
531 | let f_price = t_goods[f].goods_price; | 556 | let f_price = t_goods[f].goods_price; |
532 | if (fd.discount_field != undefined) { | 557 | if (fd.discount_field != undefined) { |
@@ -752,6 +777,25 @@ module.exports = { | @@ -752,6 +777,25 @@ module.exports = { | ||
752 | if(fg>-1){ | 777 | if(fg>-1){ |
753 | goods[fg].prom_type=ck_prom_type.prom_type; | 778 | goods[fg].prom_type=ck_prom_type.prom_type; |
754 | goods[fg].prom_id=ck_prom_type.prom_id; | 779 | goods[fg].prom_id=ck_prom_type.prom_id; |
780 | + | ||
781 | + if(ck_prom_type.prom_type==3 && (is_no_change!=2 || ck_prom_type.is_no_ok!=1) ){ | ||
782 | + let ffd=th.data.in_yhact[ck_prom_type.prom_id]; | ||
783 | + let f_price = goods[fg].goods_price; | ||
784 | + if (ffd.discount_field != undefined) { | ||
785 | + switch (ffd.discount_field) { | ||
786 | + case 0: | ||
787 | + f_price = goods[fg].goods_price; | ||
788 | + break; | ||
789 | + case 1: | ||
790 | + f_price = goods[fg].shop_price; | ||
791 | + break; | ||
792 | + case 2: | ||
793 | + f_price = goods[fg].goods_market_price; | ||
794 | + break; | ||
795 | + } | ||
796 | + } | ||
797 | + goods[fg].goods_price = f_price; | ||
798 | + } | ||
755 | } | 799 | } |
756 | } | 800 | } |
757 | } | 801 | } |