Commit 9bfc9ec91a0194d060472ebcc06ee0da8dfb7bda
Merge branch 'test' of http://git.vipzhuang.cn/wxd/MShopWeApp into qa
Showing
35 changed files
with
2496 additions
and
459 deletions
components/diy_heatImg/diy_heatImg.js
0 → 100644
1 | +// components/diy_heatImg/diy_heatImg.js | |
2 | +Component({ | |
3 | + /** | |
4 | + * 组件的属性列表 | |
5 | + */ | |
6 | + properties: { | |
7 | + object: { | |
8 | + type: Object, | |
9 | + value: null, | |
10 | + }, | |
11 | + }, | |
12 | + | |
13 | + /** | |
14 | + * 组件的初始数据 | |
15 | + */ | |
16 | + data: { | |
17 | + | |
18 | + }, | |
19 | + | |
20 | + /** | |
21 | + * 组件的方法列表 | |
22 | + */ | |
23 | + methods: { | |
24 | + //---智能跳转--- | |
25 | + go_url: function (e) { | |
26 | + var url = e.currentTarget.dataset.url; | |
27 | + getApp().goto(url); | |
28 | + }, | |
29 | + nv_void(e) { | |
30 | + var feedId = e.currentTarget.dataset.feedid; | |
31 | + var finderUserName = e.currentTarget.dataset.finderUserName; | |
32 | + var video_type = e.currentTarget.dataset.video_type; | |
33 | + getApp().openChannelsActivity({ | |
34 | + feedId, | |
35 | + finderUserName, | |
36 | + video_type | |
37 | + }) | |
38 | + }, | |
39 | + } | |
40 | +}) | ... | ... |
components/diy_heatImg/diy_heatImg.json
0 → 100644
components/diy_heatImg/diy_heatImg.wxml
0 → 100644
1 | +<!--components/diy_heatImg/diy_heatImg.wxml--> | |
2 | +<wxs module="g_filter" src="../diy_notice/g_filter.wxs"></wxs> | |
3 | +<view class="imgbox"> | |
4 | + <image src="{{object.img}}" mode="widthFix" class="img"></image> | |
5 | + <block wx:for="{{object.data}}"> | |
6 | + <block wx:if="{{g_filter.has_char(item.wxapp_url,'plugin')>=0}}"> | |
7 | + <navigator url="{{item.wxapp_url}}" class="item" style="width: {{item.width*2}}rpx;height: {{item.height*2}}rpx;left: {{item.left*2}}rpx;top: {{item.top*2}}rpx;"></navigator> | |
8 | + </block> | |
9 | + <block wx:elif="{{item.AppId}}"> | |
10 | + <navigator url="{{item.wxapp_url}}" target="miniProgram" app-id="{{item.AppId}}" path="{{item.wxapp_url}}" class="item" style="width: {{item.width*2}}rpx;height: {{item.height*2}}rpx;left: {{item.left*2}}rpx;top: {{item.top*2}}rpx;"></navigator> | |
11 | + </block> | |
12 | + <block wx:elif="{{item.finderUserName && item.video_type}}"> | |
13 | + <view catchtap="nv_void" data-feedid="{{item.feedId}}" data-video_type="{{item.video_type}}" data-finderUserName="{{item.finderUserName}}" class="item" style="width: {{item.width*2}}rpx;height: {{item.height*2}}rpx;left: {{item.left*2}}rpx;top: {{item.top*2}}rpx;"></view> | |
14 | + </block> | |
15 | + <block wx:else> | |
16 | + <view class="item" data-url="{{item.wxapp_url}}" catchtap="go_url" style="width: {{item.width*2}}rpx;height: {{item.height*2}}rpx;left: {{item.left*2}}rpx;top: {{item.top*2}}rpx;"></view> | |
17 | + </block> | |
18 | + </block> | |
19 | +</view> | |
20 | + | |
0 | 21 | \ No newline at end of file | ... | ... |
components/diy_heatImg/diy_heatImg.wxss
0 → 100644
packageA/pages/jfbuy/jfbuy.wxml
... | ... | @@ -67,7 +67,7 @@ |
67 | 67 | <text>{{item.integral}}积分 + ¥{{item.addmoney}}</text> |
68 | 68 | </view> |
69 | 69 | <view class="pdt14 fs22 gray flex jc_sb"> |
70 | - <view>¥{{item.shop_price}}</view> | |
70 | + <view><text wx:if="{{item.price_show==1}}">¥{{item.shop_price}}</text></view> | |
71 | 71 | <view>销量:{{item.buy_num+item.virtual}}</view> |
72 | 72 | </view> |
73 | 73 | </view> | ... | ... |
packageC/pages/luckyGo/luckyGo_goodsInfo/buy_pt.wxml
... | ... | @@ -200,7 +200,7 @@ |
200 | 200 | <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">请先选择门店</view> |
201 | 201 | </block> |
202 | 202 | <block wx:else> |
203 | - <block wx:if="{{data.store_count<=0}}"> | |
203 | + <block wx:if="{{sele_g.store_count<=0}}"> | |
204 | 204 | <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view> |
205 | 205 | </block> |
206 | 206 | <block wx:else> | ... | ... |
packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js
... | ... | @@ -297,7 +297,11 @@ Page({ |
297 | 297 | nav_backgroundColor: "#ffffff", |
298 | 298 | nav_type: 2, //导航类型 |
299 | 299 | istop: 0, //是否置顶风格为1 |
300 | - searchbox_transparent: 1 | |
300 | + searchbox_transparent: 1, | |
301 | + | |
302 | + front_g:null, | |
303 | + fir_set_sto:1, //最初始的一下,获取门店 | |
304 | + front_pick:null, //在详情页面上显示的门店 | |
301 | 305 | |
302 | 306 | }, |
303 | 307 | |
... | ... | @@ -1040,7 +1044,11 @@ Page({ |
1040 | 1044 | |
1041 | 1045 | this.wait_for_store_config(); |
1042 | 1046 | |
1043 | - i.get("/api/weshop/goods/get/" + o.stoid + "/" + ee.data.gid, { | |
1047 | + if(ee.data.front_g){ | |
1048 | + gid=ee.data.front_g.goods_id; | |
1049 | + } | |
1050 | + | |
1051 | + i.get("/api/weshop/goods/get/" + o.stoid + "/" + gid, { | |
1044 | 1052 | failRollback: !0, |
1045 | 1053 | success: function (t) { |
1046 | 1054 | console.log(t); |
... | ... | @@ -1145,7 +1153,8 @@ Page({ |
1145 | 1153 | ee.setData({ |
1146 | 1154 | data: t.data.data, |
1147 | 1155 | sele_g: t.data.data, |
1148 | - userInfo: getApp().globalData.userInfo | |
1156 | + userInfo: getApp().globalData.userInfo, | |
1157 | + front_g:ut.deep_cp(t.data.data) | |
1149 | 1158 | }); |
1150 | 1159 | |
1151 | 1160 | |
... | ... | @@ -2332,12 +2341,11 @@ Page({ |
2332 | 2341 | if (this.data.openSpecModal_pt && this.data.is_normal) { |
2333 | 2342 | this.get_sto(); |
2334 | 2343 | this.setData({ |
2335 | - sele_g: this.data.data, | |
2336 | - gid: this.data.data.goods_id | |
2344 | + sele_g: this.data.front_g, | |
2345 | + gid: this.data.front_g.goods_id | |
2337 | 2346 | }) |
2338 | 2347 | |
2339 | 2348 | this.sele_spec_chech_activity(); |
2340 | - | |
2341 | 2349 | } |
2342 | 2350 | |
2343 | 2351 | this.setData({ |
... | ... | @@ -3369,6 +3377,27 @@ Page({ |
3369 | 3377 | } |
3370 | 3378 | }, |
3371 | 3379 | |
3380 | + | |
3381 | + //-- 处理首页的显示门店 --- | |
3382 | + deal_front_pk(){ | |
3383 | + var th=this; | |
3384 | + if(this.data.fir_set_sto==1){ | |
3385 | + this.data.fir_set_sto=0; | |
3386 | + var cp_data=null | |
3387 | + if(th.data.def_pick_store && th.data.def_pick_store.pickup_id){ | |
3388 | + cp_data=JSON.parse(JSON.stringify(th.data.def_pick_store)); | |
3389 | + } | |
3390 | + th.setData({ | |
3391 | + front_pick:cp_data, | |
3392 | + front_only_pk:th.data.only_pk, | |
3393 | + front_def_pickpu_list:th.data.def_pickpu_list, | |
3394 | + front_pickpu_listt:th.data.pickpu_list, | |
3395 | + front_all_sto:th.data.all_sto, | |
3396 | + front_is_show_sto_cat:th.data.is_show_sto_cat, | |
3397 | + }) | |
3398 | + } | |
3399 | + }, | |
3400 | + | |
3372 | 3401 | //------------处理门店--------------- |
3373 | 3402 | deal_pickup(e) { |
3374 | 3403 | var th = this; |
... | ... | @@ -3502,15 +3531,21 @@ Page({ |
3502 | 3531 | th.setData({ def_pick_store: e.data.data.pageData[0] }) |
3503 | 3532 | } |
3504 | 3533 | } |
3534 | + | |
3535 | + //-- 设置商品详情页面的门店显示情况 --- | |
3536 | + th.deal_front_pk(); | |
3537 | + | |
3505 | 3538 | } else { |
3506 | - th.setData({ | |
3507 | - is_show_sto_cat: -1, | |
3508 | - only_pk: e.data.data.pageData | |
3509 | - }); | |
3510 | - //-----如果没有默认门店,要取第一个门店作为默认店.此时没有门店分类的情况------ | |
3511 | - if (!th.data.def_pick_store) { | |
3512 | - th.setData({ def_pick_store: e.data.data.pageData[0] }) | |
3513 | - } | |
3539 | + th.setData({ | |
3540 | + is_show_sto_cat: -1, | |
3541 | + only_pk: e.data.data.pageData | |
3542 | + }); | |
3543 | + //-----如果没有默认门店,要取第一个门店作为默认店.此时没有门店分类的情况------ | |
3544 | + if (!th.data.def_pick_store) { | |
3545 | + th.setData({ def_pick_store: e.data.data.pageData[0] }) | |
3546 | + } | |
3547 | + //-- 设置商品详情页面的门店显示情况 --- | |
3548 | + th.deal_front_pk(); | |
3514 | 3549 | |
3515 | 3550 | } |
3516 | 3551 | } |
... | ... | @@ -3529,6 +3564,9 @@ Page({ |
3529 | 3564 | sto_sele_distr: e.data.data.pageData[0].distr_type |
3530 | 3565 | }) |
3531 | 3566 | } |
3567 | + | |
3568 | + //-- 设置商品详情页面的门店显示情况 --- | |
3569 | + th.deal_front_pk(); | |
3532 | 3570 | } |
3533 | 3571 | }, |
3534 | 3572 | |
... | ... | @@ -3998,6 +4036,7 @@ Page({ |
3998 | 4036 | } |
3999 | 4037 | |
4000 | 4038 | if(prom_type==9){ |
4039 | + ee.get_sto(); | |
4001 | 4040 | this.setData({ isshow: 1, }); |
4002 | 4041 | } |
4003 | 4042 | |
... | ... | @@ -4500,6 +4539,7 @@ Page({ |
4500 | 4539 | var th = this; |
4501 | 4540 | var ind = parseInt(e.currentTarget.dataset.ind); |
4502 | 4541 | |
4542 | + th.setData({def_pick_store: ut.deep_cp(th.data.front_pick)}); | |
4503 | 4543 | |
4504 | 4544 | //ind == 1是普通购买 |
4505 | 4545 | if (ind == 1) { |
... | ... | @@ -5940,7 +5980,10 @@ Page({ |
5940 | 5980 | |
5941 | 5981 | var th = this; |
5942 | 5982 | var ind = ee.currentTarget.dataset.ind; |
5983 | + var isfront = ee.currentTarget.dataset.isfront; | |
5943 | 5984 | var bconfig = th.data.bconfig; |
5985 | + th.data.isfront=0; | |
5986 | + if(isfront) th.data.isfront=1; | |
5944 | 5987 | |
5945 | 5988 | //如果开启了,则不在选择门店 |
5946 | 5989 | if(this.data.sys_switch.is_pricing_open_store && getApp().globalData.pk_store){ |
... | ... | @@ -6187,6 +6230,10 @@ Page({ |
6187 | 6230 | if (!th.data.sele_g) return false; |
6188 | 6231 | //判断门店的配送方式是不是匹配 |
6189 | 6232 | var g_distr_type = th.data.sele_g.distr_type; |
6233 | + if(th.data.isfront==1){ | |
6234 | + g_distr_type = th.data.data.distr_type; | |
6235 | + } | |
6236 | + | |
6190 | 6237 | if (item.distr_type != 0 && g_distr_type != 0 && item.distr_type != g_distr_type) { |
6191 | 6238 | wx.showToast({ |
6192 | 6239 | title: "门店配送方式不匹配", |
... | ... | @@ -6208,6 +6255,12 @@ Page({ |
6208 | 6255 | fir_pick_index: 0 |
6209 | 6256 | }); |
6210 | 6257 | |
6258 | + if(th.data.isfront){ | |
6259 | + th.setData({ | |
6260 | + front_pick: ut.deep_cp(item) | |
6261 | + }) | |
6262 | + } | |
6263 | + | |
6211 | 6264 | if (openindstore == 1) { |
6212 | 6265 | th.setData({ |
6213 | 6266 | openSpecModal: !0, |
... | ... | @@ -6314,6 +6367,12 @@ Page({ |
6314 | 6367 | choice_sort_store: 0 |
6315 | 6368 | }); |
6316 | 6369 | |
6370 | + if(th.data.isfront){ | |
6371 | + th.setData({ | |
6372 | + front_pick: ut.deep_cp(item) | |
6373 | + }) | |
6374 | + } | |
6375 | + | |
6317 | 6376 | var openindstore = th.data.open_ind_store; |
6318 | 6377 | if (openindstore == 1) { |
6319 | 6378 | th.setData({ | ... | ... |
packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.wxml
... | ... | @@ -418,8 +418,8 @@ |
418 | 418 | |
419 | 419 | </block> |
420 | 420 | <!-- 门店收货地址 --> |
421 | - <view class="xc-address_frame bdt16 flex-vertical xc-ash {{def_pick_store!=null?'sn_height':'on_height'}}"> | |
422 | - <view class="address_frame" bindtap="choice_store" data-ind="0"> | |
421 | + <view class="xc-address_frame bdt16 flex-vertical xc-ash {{front_pick!=null?'sn_height':'on_height'}}"> | |
422 | + <view class="address_frame" bindtap="choice_store" data-ind="0" data-isfront="1" > | |
423 | 423 | <view class="flex-vertical-between "> |
424 | 424 | <view class="flex-vertical select_store_height"> |
425 | 425 | <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image> |
... | ... | @@ -427,30 +427,30 @@ |
427 | 427 | </view> |
428 | 428 | <view hidden="{{has_def && sys_switch.is_pricing_open_store}}" class="red_bb fs26">更多门店<text class="bg_jj"></text></view> |
429 | 429 | </view> |
430 | - <view wx:if="{{def_pick_store && def_pick_store.pickup_name}}"> | |
430 | + <view wx:if="{{front_pick && front_pick.pickup_name}}"> | |
431 | 431 | <view class="flex-space-between address ai_end pdv10"> |
432 | 432 | <view> |
433 | - <text class="fs30 xc-black3 shop_name bold">{{def_pick_store.pickup_name}}</text> | |
433 | + <text class="fs30 xc-black3 shop_name bold">{{front_pick.pickup_name}}</text> | |
434 | 434 | </view> |
435 | - <view class="distance fs24" wx:if="{{def_pick_store.distance!=null}}"> | |
436 | - 距离:{{def_pick_store.distance>1000?filters.toFix(def_pick_store.distance/1000,2)+"km":filters.toFix(def_pick_store.distance,0)+"m"}} | |
435 | + <view class="distance fs24" wx:if="{{front_pick.distance!=null}}"> | |
436 | + 距离:{{front_pick.distance>1000?filters.toFix(front_pick.distance/1000,2)+"km":filters.toFix(front_pick.distance,0)+"m"}} | |
437 | 437 | </view> |
438 | 438 | </view> |
439 | - <view class="no_store" wx:if="{{only_pk && !only_pk.length}}">(库存不足)</view> | |
439 | + <view class="no_store" wx:if="{{front_only_pk && !front_only_pk.length}}">(库存不足)</view> | |
440 | 440 | <block wx:else> |
441 | - <view class="no_store" wx:if="{{def_pickpu_list && !def_pickpu_list.length}}"> | |
441 | + <view class="no_store" wx:if="{{front_def_pickpu_list && !front_def_pickpu_list.length}}"> | |
442 | 442 | (库存不足) |
443 | 443 | </view> |
444 | 444 | <block wx:else> |
445 | - <view class="no_store" wx:if="{{def_pick_store && def_pick_store.is_no_dis}}"> | |
445 | + <view class="no_store" wx:if="{{front_pick && front_pick.is_no_dis}}"> | |
446 | 446 | (配送不匹配) |
447 | 447 | </view> |
448 | - <view class="no_store" wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && !filters.is_virtual_gd(sele_g.is_virtual) && sales_rules>=2 && prom_type==0}}"> | |
448 | + <view class="no_store" wx:elif="{{front_pick && !front_pick.CanOutQty && !filters.is_virtual_gd(front_g.is_virtual) && sales_rules>=2 && prom_type==0}}"> | |
449 | 449 | (库存不足) |
450 | 450 | </view> |
451 | 451 | </block> |
452 | 452 | </block> |
453 | - <view class="fs24 xc-ash-9f">地址:{{def_pick_store.fulladdress}}</view> | |
453 | + <view class="fs24 xc-ash-9f">地址:{{front_pick.fulladdress}}</view> | |
454 | 454 | </view> |
455 | 455 | </view> |
456 | 456 | </view> | ... | ... |
packageE/pages/cart/cart2/cart2.js
... | ... | @@ -1510,6 +1510,11 @@ Page({ |
1510 | 1510 | item1.is_post_temp=1; |
1511 | 1511 | //如果是秒杀,团购的时候,优惠促销和搭配购的时候 |
1512 | 1512 | if([1,2,3,5,6,7,10].indexOf(item1.prom_type)>-1){ |
1513 | + | |
1514 | + if(item1.prom_type==1 || item1.prom_type==6) { | |
1515 | + item1.is_quan=0; | |
1516 | + } | |
1517 | + | |
1513 | 1518 | var url= "/api/weshop/activitylist/getSJGoodsPriceNew/" + os.stoid |
1514 | 1519 | + "/" + item1.goods_id + "/"+item1.prom_type+"/" + item1.prom_id + "/" + app.globalData.user_id; |
1515 | 1520 | await app.request.promiseGet(url,{}).then(res=>{ |
... | ... | @@ -1522,6 +1527,11 @@ Page({ |
1522 | 1527 | }else item1.is_order_yh=0; |
1523 | 1528 | |
1524 | 1529 | item1.is_post_temp=res.data.data.is_post_temp; |
1530 | + | |
1531 | + if(item1.prom_type==1 || item1.prom_type==6) { | |
1532 | + item1.is_quan=res.data.data.is_quan; | |
1533 | + } | |
1534 | + | |
1525 | 1535 | } |
1526 | 1536 | }) |
1527 | 1537 | } |
... | ... | @@ -2008,7 +2018,6 @@ Page({ |
2008 | 2018 | //t.data.data.shop_price = tt.data.data.prom_price; |
2009 | 2019 | gd.shop_price=t.data.data.shop_price = tt.data.data.prom_user_price; |
2010 | 2020 | th.data.ckeck_quan_price = 0; |
2011 | - gd.is_xz_yh = 1; | |
2012 | 2021 | |
2013 | 2022 | t.data.data.fir_rate = tt.data.data.fir_rate; |
2014 | 2023 | t.data.data.sec_rate = tt.data.data.sec_rate; |
... | ... | @@ -2046,6 +2055,14 @@ Page({ |
2046 | 2055 | |
2047 | 2056 | } |
2048 | 2057 | |
2058 | + if (tt.data.data.is_quan) { | |
2059 | + th.data.ckeck_quan_price = t.data.data.shop_price * gg.goods_num; | |
2060 | + th.data.check_quan_price_list = t.data.data.shop_price * gg.goods_num + ""; | |
2061 | + th.data.check_quan_ware_list = t.data.data.erpwareid + ""; | |
2062 | + } else { | |
2063 | + gd.is_xz_yh = 1; | |
2064 | + } | |
2065 | + | |
2049 | 2066 | |
2050 | 2067 | th.setData({ |
2051 | 2068 | bn_goods: gd, |
... | ... | @@ -3911,6 +3928,7 @@ Page({ |
3911 | 3928 | is_by_quan = 1; |
3912 | 3929 | } |
3913 | 3930 | } |
3931 | + | |
3914 | 3932 | if (!is_by_quan) { |
3915 | 3933 | var user_addr = th.data.user_addr; |
3916 | 3934 | var req_d = { |
... | ... | @@ -6410,7 +6428,7 @@ Page({ |
6410 | 6428 | for (var i in goodlist) { |
6411 | 6429 | var gd = goodlist[i]; |
6412 | 6430 | //--如果是秒杀就跳出,如果是赠品,如果是组合购限制使用优惠券-- |
6413 | - if (gd.whsle_id == 1 || gd.prom_type == 1 || gd.is_gift || (gd.prom_type == 7 && gd.act && gd.act.is_xz_yh) || gd.is_xz_yh == 1) { | |
6431 | + if (gd.whsle_id == 1 || gd.is_gift || (gd.prom_type == 7 && gd.act && gd.act.is_xz_yh) || gd.is_xz_yh == 1) { | |
6414 | 6432 | continue; |
6415 | 6433 | } |
6416 | 6434 | |
... | ... | @@ -6421,6 +6439,10 @@ Page({ |
6421 | 6439 | } |
6422 | 6440 | } |
6423 | 6441 | |
6442 | + //--如果是秒杀,要判断有没有限制使用优惠券 | |
6443 | + if (gd.prom_type == 1 && !gd.is_quan) { | |
6444 | + continue; | |
6445 | + } | |
6424 | 6446 | |
6425 | 6447 | //--如果是团购,要判断有没有限制使用优惠券 |
6426 | 6448 | if (gd.prom_type == 2) { | ... | ... |
packageE/pages/cart/cart2/cart2.wxss
packageE/pages/cart/cart2_pt/cart2_pt.js
... | ... | @@ -77,6 +77,19 @@ Page({ |
77 | 77 | bconfig:null, |
78 | 78 | showFold:true, |
79 | 79 | template_id:[], |
80 | + | |
81 | + //--更优惠券抵用有关,立即购买的,如果是购物车,就要把相应的值,写入cartlist数组中-- | |
82 | + ckeck_quan_price: 0, | |
83 | + check_quan_price_list: '', | |
84 | + check_quan_ware_list: '', | |
85 | + | |
86 | + // 设计一个数组来存放已经选择了的券编号,coupon_no是券号,money是面值,coupon_price是真正优惠的价格,数组的下标是pickid | |
87 | + //using_quan[11]={coupon_no:"1212121",money:"20",coupon_price:"45"} | |
88 | + using_quan: {}, | |
89 | + //如果是全场包邮了,或者是全场不包邮了,就不要选包邮券 | |
90 | + is_no_by: {}, | |
91 | + is_by: {}, | |
92 | + is_quan_by: {}, | |
80 | 93 | }, |
81 | 94 | |
82 | 95 | |
... | ... | @@ -483,6 +496,10 @@ Page({ |
483 | 496 | } else { |
484 | 497 | |
485 | 498 | |
499 | + th.data.ckeck_quan_price = t.data.data.shop_price * gg.goods_num; | |
500 | + th.data.check_quan_price_list = t.data.data.shop_price * gg.goods_num + ""; | |
501 | + th.data.check_quan_ware_list = t.data.data.erpwareid + ""; | |
502 | + | |
486 | 503 | gd.prom_id=gg.prom_id; |
487 | 504 | //--阶梯团很特殊,不能用总表来拿价格-- |
488 | 505 | getApp().request.get("/api/weshop/teamlist/get/" + oo.stoid + "/" + gd.prom_id, { |
... | ... | @@ -510,6 +527,15 @@ Page({ |
510 | 527 | t.data.data.commission = tt.data.data.commission; |
511 | 528 | |
512 | 529 | |
530 | + if (!tt.data.data.is_quan || pt_data.kttype == 3) { | |
531 | + | |
532 | + th.data.ckeck_quan_price = 0; | |
533 | + th.data.check_quan_price_list = ""; | |
534 | + th.data.check_quan_ware_list = ""; | |
535 | + gd.is_xz_yh = 1; | |
536 | + } | |
537 | + | |
538 | + | |
513 | 539 | |
514 | 540 | if (pt_data.kttype == 3) { |
515 | 541 | t.data.data.shop_price = tt.data.data.yf_price; //用定金来购买 |
... | ... | @@ -566,14 +592,15 @@ Page({ |
566 | 592 | } |
567 | 593 | |
568 | 594 | |
569 | - th.setData({ | |
570 | - bn_goods: t.data.data, bn_pickname: gg.pick_name, | |
571 | - bn_pick: gg.pick_id, bn_t_exp_t: distr_t, bn_exp_type: et | |
572 | - }); | |
595 | + th.setData({ | |
596 | + bn_goods: t.data.data, bn_pickname: gg.pick_name, | |
597 | + bn_pick: gg.pick_id, bn_t_exp_t: distr_t, bn_exp_type: et | |
598 | + }); | |
573 | 599 | |
574 | 600 | |
575 | - //计算价格 | |
576 | - th.calculatePrice2(); | |
601 | + //计算价格 | |
602 | + th.calculatePrice2(); | |
603 | + th.get_buy_now_quan(); | |
577 | 604 | } |
578 | 605 | }); |
579 | 606 | } |
... | ... | @@ -631,11 +658,13 @@ Page({ |
631 | 658 | this.getuser_addr(function (ie) { |
632 | 659 | //更换地址回来要重新调用计算价钱的接口 |
633 | 660 | |
634 | - if (!th.data.user_addr || th.data.user_addr.address_id != ie.address_id) { | |
661 | + if (!th.data.user_addr || !ie || th.data.user_addr.address_id != ie.address_id) { | |
635 | 662 | th.setData({ add_back: 1,same_ok:1 }); |
636 | 663 | //if (th.data.bn_goods) th.calculatePrice2(); |
637 | 664 | } |
638 | 665 | th.setData({ user_addr: ie,show_btn:0 }); |
666 | + | |
667 | + th.data.isget_by_quan = {}; | |
639 | 668 | }) |
640 | 669 | //--更新默认地址--,看一下是不是跳到地址页面 |
641 | 670 | if (!getApp().globalData.is_cart_old) { |
... | ... | @@ -764,9 +793,45 @@ Page({ |
764 | 793 | var o_shipping_price = 0, goods_weight = -1, goods_piece = -1; |
765 | 794 | var out_of_weight = null; //超出多少重量 |
766 | 795 | |
796 | + | |
797 | + | |
798 | + | |
799 | + //---如果有选择优惠券的情况下--- | |
800 | + var quan_price = 0, bn_pick = th.data.bn_pick; | |
801 | + var quan_no = null; | |
802 | + if (th.data.using_quan[bn_pick] != null && th.data.using_quan[bn_pick] != undefined) | |
803 | + quan_no = th.data.using_quan[bn_pick].coupon_no; | |
804 | + | |
805 | + if (quan_no) { | |
806 | + //如果是一件代发就不要找商品 | |
807 | + if (th.data.using_quan[bn_pick].isby != 1) { | |
808 | + //---获取优惠券优惠--- | |
809 | + await getApp().request.promiseGet("/api/weshop/couponList/getUseCouponPrice", { | |
810 | + data: { | |
811 | + storeId: oo.stoid, | |
812 | + CashRepNo: quan_no, | |
813 | + WaresSum: th.data.ckeck_quan_price, | |
814 | + WareIds: th.data.check_quan_ware_list | |
815 | + } | |
816 | + }).then(res => { | |
817 | + | |
818 | + if (res.data.code == 0 && res.data.data && res.data.data.length > 0) { | |
819 | + quan_price = res.data.data[0].WareCashSum; | |
820 | + | |
821 | + allpice=allpice-quan_price; | |
822 | + | |
823 | + } | |
824 | + }) | |
825 | + } | |
826 | + } | |
827 | + | |
767 | 828 | //-- 判断订单优惠的叠加 -- |
768 | 829 | var ord_prom=null; |
769 | 830 | var o_condition=allpice; |
831 | + var pickid = th.data.bn_pick; | |
832 | + | |
833 | + | |
834 | + | |
770 | 835 | if(th.data.bn_is_order_yh && th.data.kt_type != 3 ){ |
771 | 836 | |
772 | 837 | await getApp().request.promiseGet("/api/weshop/promorder/getOrderPromotion", { |
... | ... | @@ -781,6 +846,40 @@ Page({ |
781 | 846 | //-----------当地址不为空,且是物流时,计算物流费用,同时阶梯团不计算拼团价格---------- |
782 | 847 | if (th.data.user_addr != null && th.data.bn_exp_type == 0 && (th.data.kt_type != 3 || th.data.bn_goods.is_normal == 1)) { |
783 | 848 | |
849 | + //看是不是有调用过包邮券 | |
850 | + if (!th.data.isget_by_quan[th.data.bn_pick] && good.is_xz_yh != 1) { | |
851 | + | |
852 | + //--判断要不要显示包邮券,链式调用接口,调取包邮券,已经是减了优惠的金额,见到优惠券的钱--- | |
853 | + getApp().request.promiseGet("/api/weshop/userfeemail/pageAndArea", { | |
854 | + data: { | |
855 | + store_id: os.stoid, | |
856 | + isuse: 0, | |
857 | + condition: o_condition, | |
858 | + user_id: getApp().globalData.user_id, | |
859 | + pageSize: 2000 | |
860 | + } | |
861 | + }).then(res => { | |
862 | + if (res.data.code == 0 && res.data.data.total > 0) { | |
863 | + //此时要循环判断包邮的地区,不包邮商品是不是符合 | |
864 | + var arr = [], quanlist = res.data.data.pageData; | |
865 | + quanlist = th.check_is_frozenQuan(quanlist, th.data.frozenQuan, 1); | |
866 | + for (var i in quanlist) { | |
867 | + var item = quanlist[i]; | |
868 | + if (item.region_list && th.check_by_area(item.region_list)) continue; //如果是不包邮区域 | |
869 | + if (item.goods_list) { | |
870 | + var no_goods_arr = item.goods_list.split(","); | |
871 | + if (ut.isContained(no_goods_arr, gd_arr_list)) continue; //如果是不包邮商品 | |
872 | + } | |
873 | + arr.push(item); | |
874 | + } | |
875 | + if (arr) { | |
876 | + th.setData({ get_by_quan_list: arr }); | |
877 | + } | |
878 | + th.data.isget_by_quan[th.data.bn_pick] = 1; | |
879 | + } | |
880 | + }) | |
881 | + } | |
882 | + | |
784 | 883 | if(good.is_free_shipping){ |
785 | 884 | var wl_txt = "formData.shipping_price"; |
786 | 885 | th.setData({ [wl_txt]: 0 }) |
... | ... | @@ -791,6 +890,7 @@ Page({ |
791 | 890 | wuliu: parseFloat(allpice).toFixed(2), store_id: os.stoid |
792 | 891 | } |
793 | 892 | var back_data = null; |
893 | + var quan_no_goods_arr=null; | |
794 | 894 | |
795 | 895 | if(!ord_prom || ord_prom.is_post_temp) { |
796 | 896 | if (th.data.bn_is_post_temp || th.data.bn_goods.is_normal == 1) { |
... | ... | @@ -802,108 +902,146 @@ Page({ |
802 | 902 | } |
803 | 903 | } |
804 | 904 | |
805 | - var gd_arr_list = []; | |
806 | - gd_arr_list.push(good); | |
807 | - var cut_good_weight = 0; | |
808 | - for (let i in gd_arr_list) { | |
809 | - let item = gd_arr_list[i]; | |
810 | - | |
811 | - if (back_data && back_data['is_by_all'] && (!back_data.no_free_goods || back_data.no_free_goods.indexOf(item.goods_id) == -1)) { | |
905 | + var is_by_quan = 0; | |
906 | + //如果是包邮券的时候,要看看券的情况,判断一下包邮有没有不包邮模板 | |
907 | + if (quan_no && th.data.using_quan[pickid].isby == 1) { | |
908 | + var quan = th.data.using_quan[pickid]; | |
909 | + if (quan.goods_list) { | |
910 | + quan_no_goods_arr = quan.goods_list.split(","); | |
911 | + } else { | |
912 | + is_by_quan = 1; | |
913 | + } | |
914 | + } | |
812 | 915 | |
813 | - if (item['exp_sum_type'] == 2 && back_data.weight_free > 0) { | |
814 | - if (goods_weight < 0) goods_weight = 0; | |
815 | - cut_good_weight += item['weight'] * item['buynum']; | |
816 | - goods_weight += item['weight'] * item['buynum']; | |
817 | - } | |
818 | - if (back_data.weight_free > 0) { | |
819 | - out_of_weight = (back_data.weight_free * 1000) - cut_good_weight; | |
820 | - } | |
821 | - continue; | |
916 | + //如果有包邮券的不包邮商品的时候 | |
917 | + if (quan_no_goods_arr) { | |
918 | + if (back_data && back_data.no_free_goods) { | |
919 | + back_data['is_by_all'] = 1; | |
920 | + var arr3 = back_data.no_free_goods.filter(item => { | |
921 | + return quan_no_goods_arr.includes(item) | |
922 | + }) | |
923 | + back_data.no_free_goods = null; | |
924 | + if (arr3.length) { | |
925 | + back_data.no_free_goods = arr3; | |
822 | 926 | } |
927 | + } | |
928 | + if (!back_data || !back_data.no_free_goods) { | |
929 | + if (!back_data) back_data = {}; | |
930 | + back_data['is_by_all'] = 1; | |
931 | + back_data['no_free_goods'] = quan_no_goods_arr; | |
932 | + } | |
933 | + } | |
934 | + | |
935 | + | |
936 | + if(!is_by_quan){ | |
937 | + var gd_arr_list = []; | |
938 | + gd_arr_list.push(good); | |
939 | + var cut_good_weight = 0; | |
940 | + for (let i in gd_arr_list) { | |
941 | + let item = gd_arr_list[i]; | |
823 | 942 | |
824 | - switch (item['exp_sum_type']) { | |
825 | - case 1: | |
826 | - //统一运费 | |
827 | - o_shipping_price += item['uniform_exp_sum']; | |
828 | - break; | |
829 | - case 2: | |
830 | - if (goods_weight < 0) goods_weight = 0; | |
831 | - //累积商品重量 每种商品的重量 * 数量 | |
832 | - goods_weight += item['weight'] * item['buynum']; | |
833 | - | |
834 | - if (back_data && back_data.is_by_all && !back_data.no_free_goods) { | |
943 | + if (back_data && back_data['is_by_all'] && (!back_data.no_free_goods || back_data.no_free_goods.indexOf(item.goods_id) == -1)) { | |
944 | + | |
945 | + if (item['exp_sum_type'] == 2 && back_data.weight_free > 0) { | |
946 | + if (goods_weight < 0) goods_weight = 0; | |
835 | 947 | cut_good_weight += item['weight'] * item['buynum']; |
836 | - if (back_data.weight_free > 0) { | |
837 | - out_of_weight = (back_data.weight_free * 1000) - cut_good_weight; | |
838 | - } | |
948 | + goods_weight += item['weight'] * item['buynum']; | |
839 | 949 | } |
840 | - break; | |
841 | - case 3: | |
842 | - if (goods_piece < 0) goods_piece = 0; | |
843 | - //累积商品数量 | |
844 | - goods_piece += item['buynum']; | |
845 | - break; | |
846 | - } | |
847 | - } | |
950 | + if (back_data.weight_free > 0) { | |
951 | + out_of_weight = (back_data.weight_free * 1000) - cut_good_weight; | |
952 | + } | |
953 | + continue; | |
954 | + } | |
848 | 955 | |
849 | - //如果是正值的时候 | |
850 | - if (out_of_weight >= 0) out_of_weight = -cut_good_weight; | |
851 | - else out_of_weight = -back_data.weight_free * 1000; | |
956 | + switch (item['exp_sum_type']) { | |
957 | + case 1: | |
958 | + //统一运费 | |
959 | + o_shipping_price += item['uniform_exp_sum']; | |
960 | + break; | |
961 | + case 2: | |
962 | + if (goods_weight < 0) goods_weight = 0; | |
963 | + //累积商品重量 每种商品的重量 * 数量 | |
964 | + goods_weight += item['weight'] * item['buynum']; | |
965 | + | |
966 | + if (back_data && back_data.is_by_all && !back_data.no_free_goods) { | |
967 | + cut_good_weight += item['weight'] * item['buynum']; | |
968 | + if (back_data.weight_free > 0) { | |
969 | + out_of_weight = (back_data.weight_free * 1000) - cut_good_weight; | |
970 | + } | |
971 | + } | |
972 | + break; | |
973 | + case 3: | |
974 | + if (goods_piece < 0) goods_piece = 0; | |
975 | + //累积商品数量 | |
976 | + goods_piece += item['buynum']; | |
977 | + break; | |
978 | + } | |
979 | + } | |
852 | 980 | |
981 | + //如果是正值的时候 | |
982 | + if (out_of_weight >= 0) out_of_weight = -cut_good_weight; | |
983 | + else out_of_weight = -back_data.weight_free * 1000; | |
853 | 984 | |
854 | - if(!th.data.wu_arr){ | |
855 | - wx.hideLoading(); | |
856 | - wx.showToast({ | |
857 | - title: "物流配置未启用物流公司", icon: 'none', duration: 2000 | |
858 | - }) | |
859 | - //th.setData({ show_submit:0, }); | |
860 | - th.setData({show_submit:1, submit: 0,same_ok:0 }) | |
861 | - return false; | |
862 | - } | |
863 | 985 | |
864 | - var code = th.data.wu_arr[th.data.index].code; | |
865 | - | |
866 | - //--------------开始计算物流------------------ | |
867 | - var shipping_price = 0; | |
868 | - // var shipping_price = ut.calculatewuliu(code, o_shipping_price, goods_weight, out_of_weight, | |
869 | - // goods_piece, th.data.user_addr, back_data, rs); | |
870 | - | |
871 | - var w_data = { | |
872 | - store_id: os.stoid, code: code, | |
873 | - o_shipping_price: o_shipping_price, | |
874 | - goods_weight: goods_weight, | |
875 | - out_of_weight: out_of_weight, goods_piece: goods_piece, | |
876 | - user_addr_province: th.data.user_addr.province, | |
877 | - user_addr_city: th.data.user_addr.city, | |
878 | - user_addr_district: th.data.user_addr.district, | |
879 | - is_by_all: back_data && back_data.is_by_all ? 1 : 0, | |
880 | - no_free_goods: back_data && back_data.no_free_goods && back_data.no_free_goods.length > 0 ? 1 : 0, | |
881 | - } | |
986 | + if(!th.data.wu_arr){ | |
987 | + wx.hideLoading(); | |
988 | + wx.showToast({ | |
989 | + title: "物流配置未启用物流公司", icon: 'none', duration: 2000 | |
990 | + }) | |
991 | + //th.setData({ show_submit:0, }); | |
992 | + th.setData({show_submit:1, submit: 0,same_ok:0 }) | |
993 | + return false; | |
994 | + } | |
882 | 995 | |
883 | - var is_ok = 0; | |
884 | - await getApp().request.promisePost('/api/weshop/order/getOrderWuLiPrice', { | |
885 | - data: w_data, | |
886 | - is_json: 1 | |
887 | - }).then(res => { | |
888 | - if (res.data.code == 0) { | |
889 | - shipping_price = res.data.data; | |
890 | - is_ok = 1; | |
996 | + var code = th.data.wu_arr[th.data.index].code; | |
997 | + | |
998 | + //--------------开始计算物流------------------ | |
999 | + var shipping_price = 0; | |
1000 | + // var shipping_price = ut.calculatewuliu(code, o_shipping_price, goods_weight, out_of_weight, | |
1001 | + // goods_piece, th.data.user_addr, back_data, rs); | |
1002 | + | |
1003 | + var w_data = { | |
1004 | + store_id: os.stoid, code: code, | |
1005 | + o_shipping_price: o_shipping_price, | |
1006 | + goods_weight: goods_weight, | |
1007 | + out_of_weight: out_of_weight, goods_piece: goods_piece, | |
1008 | + user_addr_province: th.data.user_addr.province, | |
1009 | + user_addr_city: th.data.user_addr.city, | |
1010 | + user_addr_district: th.data.user_addr.district, | |
1011 | + is_by_all: back_data && back_data.is_by_all ? 1 : 0, | |
1012 | + no_free_goods: back_data && back_data.no_free_goods && back_data.no_free_goods.length > 0 ? 1 : 0, | |
891 | 1013 | } |
892 | - }) | |
893 | - if (!is_ok) { | |
894 | - wx.hideLoading(); | |
895 | - wx.showToast({ | |
896 | - title: "计算物流错误", icon: 'none', duration: 2000 | |
1014 | + | |
1015 | + var is_ok = 0; | |
1016 | + await getApp().request.promisePost('/api/weshop/order/getOrderWuLiPrice', { | |
1017 | + data: w_data, | |
1018 | + is_json: 1 | |
1019 | + }).then(res => { | |
1020 | + if (res.data.code == 0) { | |
1021 | + shipping_price = res.data.data; | |
1022 | + is_ok = 1; | |
1023 | + } | |
897 | 1024 | }) |
898 | - //th.setData({ show_submit:0 }); | |
899 | - th.setData({show_submit:1, submit: 0,same_ok:0 }) | |
1025 | + if (!is_ok) { | |
1026 | + wx.hideLoading(); | |
1027 | + wx.showToast({ | |
1028 | + title: "计算物流错误", icon: 'none', duration: 2000 | |
1029 | + }) | |
1030 | + //th.setData({ show_submit:0 }); | |
1031 | + th.setData({show_submit:1, submit: 0,same_ok:0 }) | |
1032 | + | |
1033 | + return false; | |
1034 | + } | |
900 | 1035 | |
901 | - return false; | |
902 | - } | |
1036 | + shipping_price = parseFloat(shipping_price).toFixed(2); | |
1037 | + var wl_txt = "formData.shipping_price"; | |
1038 | + th.setData({ [wl_txt]: shipping_price, }) | |
903 | 1039 | |
904 | - shipping_price = parseFloat(shipping_price).toFixed(2); | |
1040 | + } | |
1041 | + else{ | |
905 | 1042 | var wl_txt = "formData.shipping_price"; |
906 | - th.setData({ [wl_txt]: shipping_price, }) | |
1043 | + th.setData({ [wl_txt]: 0, }) | |
1044 | + } | |
907 | 1045 | } |
908 | 1046 | } else if (th.data.bn_exp_type == 1) { |
909 | 1047 | var wl_txt = "formData.shipping_price"; |
... | ... | @@ -1140,6 +1278,9 @@ Page({ |
1140 | 1278 | } |
1141 | 1279 | |
1142 | 1280 | |
1281 | + | |
1282 | + var txt3 = "formData.coupon_price"; | |
1283 | + | |
1143 | 1284 | if (th.data.bn_use_commission) { |
1144 | 1285 | order_m = (parseFloat(order_m) - parseFloat(th.data.bn_goods.use_commission)).toFixed(2); |
1145 | 1286 | th.setData({ [txt4]: th.data.bn_goods.use_commission }) |
... | ... | @@ -1148,14 +1289,14 @@ Page({ |
1148 | 1289 | //--------------如果使用余额--------------------- |
1149 | 1290 | if (th.data.bn_use_money == 1 && th.data.yuer > 0) { |
1150 | 1291 | if (parseFloat(th.data.yuer) > parseFloat(order_m)) { |
1151 | - th.setData({ [txt]: order_m, [txt2]: 0, submit: 0, show_btn: 1 }) | |
1292 | + th.setData({ [txt]: order_m, [txt2]: 0, [txt3]:quan_price,submit: 0, show_btn: 1 }) | |
1152 | 1293 | } else { |
1153 | 1294 | order_m = parseFloat(order_m) - parseFloat(th.data.yuer); |
1154 | 1295 | order_m = order_m.toFixed(2); |
1155 | - th.setData({ [txt]: th.data.yuer, [txt2]: order_m, submit: 0, show_btn: 1 }) | |
1296 | + th.setData({ [txt]: th.data.yuer, [txt2]: order_m,[txt3]:quan_price, submit: 0, show_btn: 1 }) | |
1156 | 1297 | } |
1157 | 1298 | } else { |
1158 | - th.setData({ [txt]: 0, [txt2]: order_m, submit: 0, show_btn: 1 }) | |
1299 | + th.setData({ [txt]: 0, [txt2]: order_m,[txt3]:quan_price, submit: 0, show_btn: 1 }) | |
1159 | 1300 | } |
1160 | 1301 | |
1161 | 1302 | wx.hideLoading(); |
... | ... | @@ -1268,6 +1409,17 @@ Page({ |
1268 | 1409 | item['shipping_name'] = th.data.bn_exp_type == 1 ? '' : th.data.wu_arr[th.data.index].name; |
1269 | 1410 | } |
1270 | 1411 | |
1412 | + | |
1413 | + //组装优惠券的钱 | |
1414 | + if (parseFloat(th.data.formData.coupon_price) > 0) { | |
1415 | + item.coupon_price = th.data.formData.coupon_price; | |
1416 | + item.coupon_no = th.data.using_quan[th.data.bn_pick].coupon_no; | |
1417 | + } | |
1418 | + if (th.data.using_quan[th.data.bn_pick] && th.data.using_quan[th.data.bn_pick].coupon_no && th.data.using_quan[th.data.bn_pick].isby) { | |
1419 | + item.coupon_no = th.data.using_quan[th.data.bn_pick].coupon_no; | |
1420 | + item.coupon_price = 0; | |
1421 | + } | |
1422 | + | |
1271 | 1423 | if (!th.data.bn_goods.is_normal) { |
1272 | 1424 | item.is_zsorder = th.data.kt_type + 1; //开团类型 |
1273 | 1425 | } |
... | ... | @@ -1681,5 +1833,428 @@ Page({ |
1681 | 1833 | buycard: function () { |
1682 | 1834 | getApp().goto("/pages/user/plus/plus"); |
1683 | 1835 | getApp().globalData.plus_buy_back = 1; |
1684 | - } | |
1836 | + }, | |
1837 | + | |
1838 | + //------ 获取立即购买的购物车的劵 -------- | |
1839 | + get_buy_now_quan: function () { | |
1840 | + var quanlist = null, th = this, frozenQuan = null; | |
1841 | + var good = this.data.bn_goods; | |
1842 | + | |
1843 | + //一件代发商品不使用优惠券 | |
1844 | + if (good.whsle_id) return false; | |
1845 | + if(!th.data.check_quan_ware_list) return false; | |
1846 | + | |
1847 | + //--如果商家后台没有限制使用优惠券,同时商品的优惠活动没有限制使用优惠券-- | |
1848 | + if (th.data.is_close_quan != 1 && th.data.bn_goods.is_xz_yh != 1 && th.data.check_quan_ware_list) { | |
1849 | + var url0 = "/api/weshop/users/frozenQuan/listFrozenQuan/" + app.globalData.user_id; | |
1850 | + var url = "/api/weshop/couponList/getUseCouponList"; | |
1851 | + app.request.promiseGet(url0, { 1: 1 }).then(res => { | |
1852 | + if (res.data.code == 0) { | |
1853 | + frozenQuan = res.data.data; | |
1854 | + th.data.frozenQuan = frozenQuan; | |
1855 | + } | |
1856 | + app.request.time_limit_get(6, url, { | |
1857 | + data: { | |
1858 | + storeId: oo.stoid, | |
1859 | + userId: app.globalData.user_id, | |
1860 | + BuySum: th.data.ckeck_quan_price, | |
1861 | + WareIds: encodeURIComponent(th.data.check_quan_ware_list), | |
1862 | + pageSize: 100 | |
1863 | + }, | |
1864 | + success: function (res) { | |
1865 | + if (res.data.code == 0) { | |
1866 | + quanlist = res.data.data.pageData; | |
1867 | + if (quanlist) { | |
1868 | + quanlist = th.check_is_frozenQuan(quanlist, frozenQuan); | |
1869 | + th.setData({ selected_quan_list: quanlist }) | |
1870 | + } | |
1871 | + } | |
1872 | + } | |
1873 | + }) | |
1874 | + }) | |
1875 | + } | |
1876 | + }, | |
1877 | + | |
1878 | + //--验证是否已经冻结-- | |
1879 | + check_is_frozenQuan: function (quanlist, frozenQuan, isby) { | |
1880 | + console.log("券列表", quanlist); | |
1881 | + if (!quanlist) return null; | |
1882 | + if (!frozenQuan) return quanlist; | |
1883 | + var arr = []; | |
1884 | + for (var i = 0; i < quanlist.length; i++) { | |
1885 | + var item = quanlist[i]; | |
1886 | + var is_find = 0; | |
1887 | + var Q_no = quanlist[i].CashRepNo; | |
1888 | + if (isby) Q_no = quanlist[i].no; | |
1889 | + for (var j = 0; j < frozenQuan.length; j++) { | |
1890 | + var q_no = frozenQuan[j].cashRepNo; | |
1891 | + if (Q_no == q_no) { | |
1892 | + is_find = 1; | |
1893 | + break; | |
1894 | + } | |
1895 | + } | |
1896 | + if (!is_find) arr.push(item); | |
1897 | + } | |
1898 | + return arr; | |
1899 | + }, | |
1900 | + | |
1901 | + /*----券的所有操作----*/ | |
1902 | + open_coupon_list: function (e) { | |
1903 | + var th = this; | |
1904 | + var pickid = e.currentTarget.dataset.pickid; | |
1905 | + var bn = e.currentTarget.dataset.bn; | |
1906 | + var cindx = e.currentTarget.dataset.cind; | |
1907 | + | |
1908 | + if (bn == 1) { | |
1909 | + th.setData({ open_quan: 1, selected_quan_pick: pickid, disabled: 1 }); | |
1910 | + } else { | |
1911 | + //---多单打开券的时候,就要判断券在其他门店是否有使用--- | |
1912 | + var quanlist = th.data.cartlist[cindx].quan_list; | |
1913 | + var exp_type = th.data.cartlist[cindx].exp_type; | |
1914 | + | |
1915 | + | |
1916 | + //对于在其他门店已经选择了的券 要判断是否显示到界面 | |
1917 | + var t_user = th.data.using_quan[pickid]; | |
1918 | + | |
1919 | + for (var i in quanlist) { | |
1920 | + quanlist[i].is_using = th.check_in_sele(quanlist[i].CashRepNo, pickid); | |
1921 | + if (t_user && quanlist[i].CashRepNo == t_user.coupon_no) | |
1922 | + quanlist[i].show_red = 1; | |
1923 | + else | |
1924 | + quanlist[i].show_red = 0; | |
1925 | + } | |
1926 | + | |
1927 | + if (get_by_quan_list_cart) { | |
1928 | + for (var i in get_by_quan_list_cart) { | |
1929 | + get_by_quan_list_cart[i].is_using = th.check_in_sele(get_by_quan_list_cart[i].no, pickid); | |
1930 | + if (t_user && get_by_quan_list_cart[i].no == t_user.coupon_no) | |
1931 | + get_by_quan_list_cart[i].show_red = 1; | |
1932 | + else | |
1933 | + get_by_quan_list_cart[i].show_red = 0; | |
1934 | + } | |
1935 | + th.setData({ by_quan_list_cart: get_by_quan_list_cart }); | |
1936 | + } else { | |
1937 | + th.setData({ by_quan_list_cart: null }); | |
1938 | + } | |
1939 | + | |
1940 | + console.log("2222222券的列表", quanlist); | |
1941 | + th.setData({ | |
1942 | + sele_cart_ind: cindx, | |
1943 | + sele_exp_type: exp_type, | |
1944 | + open_quan: 1, | |
1945 | + selected_quan_pick: pickid, | |
1946 | + selected_quan_list: quanlist, | |
1947 | + disabled: 1 | |
1948 | + }); | |
1949 | + } | |
1950 | + }, | |
1951 | + close_coupon: function (e) { | |
1952 | + var th = this; | |
1953 | + th.setData({ open_quan: 0, disabled: 0 }); | |
1954 | + }, | |
1955 | + | |
1956 | + /*--点击选择券--*/ | |
1957 | + sele_quan_item: function (e) { | |
1958 | + | |
1959 | + var ind = e.currentTarget.dataset.ind; | |
1960 | + var quan_item = this.data.selected_quan_list[ind]; | |
1961 | + var pickid = this.data.selected_quan_pick; //现在选择的是哪一个门店 | |
1962 | + //--如果券是单品使用的时候-- | |
1963 | + if (quan_item && quan_item.UseObjectType && quan_item.UseObjectType == "20") { | |
1964 | + //---只有多件购买的时候才要计算,//购物车购买和搭配勾的时候--- | |
1965 | + var gg = getApp().get_b_now(); | |
1966 | + if (this.data.is_b_now == 0 || gg.prom_type == 5) { | |
1967 | + var arr = this.data.order_prom_list_cart; | |
1968 | + var t_pk_item = null; | |
1969 | + for (var ii in arr) { | |
1970 | + var ep = arr[ii]; | |
1971 | + if (pickid == ep.pickup_id) { | |
1972 | + t_pk_item = ep; | |
1973 | + break; | |
1974 | + } | |
1975 | + } | |
1976 | + //--寻找券指定的商品-- | |
1977 | + var gd = null; | |
1978 | + if (t_pk_item) { | |
1979 | + var goods = t_pk_item.goods; | |
1980 | + for (var gid in goods) { | |
1981 | + if (quan_item.UseObjectID == goods[gid].erpwareid) { | |
1982 | + gd = goods[gid]; | |
1983 | + } | |
1984 | + } | |
1985 | + } | |
1986 | + if (!gd) { | |
1987 | + getApp().my_warnning("未找到指定商品使用", 0, this, 600); | |
1988 | + return false; | |
1989 | + } | |
1990 | + //计算价格,如果有平摊的实收要计算实收的金额 | |
1991 | + var item_price = gd.goods_price * gd.goods_num; | |
1992 | + //-- 如果有平摊下去,有实收价格的时候,就要用account_fir来计算价格 -- | |
1993 | + if (gd.account_fir != null && gd.account_fir != undefined) { | |
1994 | + item_price = gd.account_fir * gd.goods_num; | |
1995 | + } | |
1996 | + | |
1997 | + if (item_price < parseFloat(quan_item.BuySum)) { | |
1998 | + getApp().my_warnning("该单品金额没有大于等于" + quan_item.BuySum + "元时不能使用优惠券", 0, this, 600); | |
1999 | + return false; | |
2000 | + } | |
2001 | + } | |
2002 | + } | |
2003 | + | |
2004 | + var no_use = e.currentTarget.dataset.no, quanlist = this.data.selected_quan_list; | |
2005 | + //---所有的券的显示红色选择都清理一遍--- | |
2006 | + for (var i in quanlist) { | |
2007 | + quanlist[i].show_red = 0; | |
2008 | + } | |
2009 | + this.setData({ selected_quan_list: quanlist }); | |
2010 | + var by_quanlist = this.data.get_by_quan_list; | |
2011 | + if (by_quanlist) { | |
2012 | + //---所有的券的显示红色选择都清理一遍--- | |
2013 | + for (var inb in by_quanlist) { | |
2014 | + by_quanlist[inb].show_red = 0; | |
2015 | + } | |
2016 | + this.setData({ get_by_quan_list: by_quanlist }); | |
2017 | + } | |
2018 | + | |
2019 | + var by_cart_list = this.data.by_quan_list_cart; | |
2020 | + if (by_cart_list) { | |
2021 | + //---所有的券的显示红色选择都清理一遍--- | |
2022 | + for (var inc in by_cart_list) { | |
2023 | + by_cart_list[inc].show_red = 0; | |
2024 | + } | |
2025 | + this.setData({ by_quan_list_cart: by_cart_list }); | |
2026 | + } | |
2027 | + | |
2028 | + var using_quan = this.data.using_quan; | |
2029 | + var th = this; | |
2030 | + //---如果是不使用优惠券--- | |
2031 | + if (no_use == 1) { | |
2032 | + console.log("有进来吗券", no_use); | |
2033 | + if (using_quan[th.data.selected_quan_pick]) { | |
2034 | + using_quan[th.data.selected_quan_pick].is_nouse_red = 1; | |
2035 | + } | |
2036 | + else { | |
2037 | + using_quan[th.data.selected_quan_pick] = { is_nouse_red: 1 }; | |
2038 | + } | |
2039 | + this.setData({ using_quan: using_quan, is_coupon: th.is_coupon }); | |
2040 | + return; | |
2041 | + } | |
2042 | + | |
2043 | + | |
2044 | + var txt = "selected_quan_list[" + ind + "].show_red"; | |
2045 | + var obj = {}; | |
2046 | + obj[txt] = 1; | |
2047 | + if (quan_item.show_red) { | |
2048 | + obj[txt] = 0; | |
2049 | + } | |
2050 | + this.setData(obj); | |
2051 | + console.log(this.data.selected_quan_list, "选中的券的下标", quan_item, "数据都在这里", txt); | |
2052 | + if (using_quan[th.data.selected_quan_pick]) { | |
2053 | + using_quan[th.data.selected_quan_pick].is_nouse_red = 0; | |
2054 | + } | |
2055 | + else { | |
2056 | + using_quan[th.data.selected_quan_pick] = { is_nouse_red: 0 }; | |
2057 | + } | |
2058 | + this.setData({ using_quan: using_quan }); | |
2059 | + | |
2060 | + }, | |
2061 | + | |
2062 | + /*----- 点击选择包邮券 -----*/ | |
2063 | + sele_quan_item_by: function (e) { | |
2064 | + var no_use = e.currentTarget.dataset.no; | |
2065 | + //立即购买的包邮券 | |
2066 | + var by_quanlist = this.data.get_by_quan_list; | |
2067 | + if (by_quanlist) { | |
2068 | + //---所有的券的显示红色选择都清理一遍--- | |
2069 | + for (var ind in by_quanlist) { | |
2070 | + by_quanlist[ind].show_red = 0; | |
2071 | + } | |
2072 | + this.setData({ get_by_quan_list: by_quanlist }); | |
2073 | + } | |
2074 | + | |
2075 | + //--购物车过来的包邮券-- | |
2076 | + var by_cart_list = this.data.by_quan_list_cart; | |
2077 | + if (by_cart_list) { | |
2078 | + //---所有的券的显示红色选择都清理一遍--- | |
2079 | + for (var ind in by_cart_list) { | |
2080 | + by_cart_list[ind].show_red = 0; | |
2081 | + } | |
2082 | + this.setData({ by_quan_list_cart: by_cart_list }); | |
2083 | + } | |
2084 | + //普通券 | |
2085 | + var quanlist = this.data.selected_quan_list; | |
2086 | + if (quanlist) { | |
2087 | + //---所有的券的显示红色选择都清理一遍--- | |
2088 | + for (var ind in quanlist) { | |
2089 | + quanlist[ind].show_red = 0; | |
2090 | + } | |
2091 | + this.setData({ selected_quan_list: quanlist }); | |
2092 | + } | |
2093 | + | |
2094 | + var th = this; | |
2095 | + var using_quan = this.data.using_quan; | |
2096 | + //---如果是不使用优惠券--- | |
2097 | + if (no_use == 1) { | |
2098 | + if (using_quan[th.data.selected_quan_pick]) { | |
2099 | + using_quan[th.data.selected_quan_pick].is_nouse_red = 1; | |
2100 | + } | |
2101 | + else { | |
2102 | + using_quan[th.data.selected_quan_pick] = { is_nouse_red: 1 }; | |
2103 | + } | |
2104 | + this.setData({ using_quan: using_quan, is_coupon: th.is_coupon }); | |
2105 | + return; | |
2106 | + } | |
2107 | + | |
2108 | + var pickid = th.data.selected_quan_pick; //现在选择的是哪一个门店 | |
2109 | + var ind = e.currentTarget.dataset.ind; | |
2110 | + //--如果是立即购买的部分-- | |
2111 | + var txt = ""; | |
2112 | + var txt1 = ""; | |
2113 | + var quan_item = null; | |
2114 | + if (th.data.is_b_now) { | |
2115 | + quan_item = this.data.get_by_quan_list[ind]; | |
2116 | + txt = "get_by_quan_list[" + ind + "].show_red"; | |
2117 | + var obj = {}; | |
2118 | + obj[txt] = 1; | |
2119 | + this.setData(obj); | |
2120 | + } else { | |
2121 | + txt = "by_quan_list_cart[" + ind + "].show_red"; | |
2122 | + quan_item = th.data.by_quan_list_cart[ind]; | |
2123 | + var obj = {}; | |
2124 | + obj[txt] = 1; | |
2125 | + this.setData(obj); | |
2126 | + th.data.get_by_quan_list_cart[pickid] = JSON.parse(JSON.stringify(th.data.by_quan_list_cart)); //要把选中的弄回数组 | |
2127 | + } | |
2128 | + | |
2129 | + if (using_quan[th.data.selected_quan_pick]) { | |
2130 | + using_quan[th.data.selected_quan_pick].is_nouse_red = 0; | |
2131 | + } | |
2132 | + else { | |
2133 | + using_quan[th.data.selected_quan_pick] = { is_nouse_red: 0 }; | |
2134 | + } | |
2135 | + this.setData({ using_quan: using_quan }); | |
2136 | + }, | |
2137 | + | |
2138 | + //--确认使用券--- | |
2139 | + confirm_quan: function () { | |
2140 | + var using_quan = this.data.using_quan; //正在使用中的券列表 | |
2141 | + var pickid = this.data.selected_quan_pick; //选中的门店ID | |
2142 | + var th = this; | |
2143 | + var selected_quan_list = this.data.selected_quan_list; //选择了那个门店的券列表 | |
2144 | + var get_by_quan_list = this.data.get_by_quan_list; //立即购买的包邮券列表 | |
2145 | + var by_quan_list_cart = this.data.by_quan_list_cart; //购物车购买的包邮券列表 | |
2146 | + //选择了的券 | |
2147 | + var sele_quan = null; | |
2148 | + | |
2149 | + //循环普通的券 | |
2150 | + for (var i in selected_quan_list) { | |
2151 | + var item = selected_quan_list[i]; | |
2152 | + if (item.show_red) { | |
2153 | + th.insert_into_using_quan(item, using_quan, pickid); | |
2154 | + return; | |
2155 | + } | |
2156 | + } | |
2157 | + //循环包邮的券,立即购买的 | |
2158 | + for (var i in get_by_quan_list) { | |
2159 | + var item = get_by_quan_list[i]; | |
2160 | + if (item.show_red) { | |
2161 | + if (th.data.is_no_by[pickid] == 1) { | |
2162 | + getApp().my_warnning("已全场不能包邮,不能选择包邮券", 0, th); | |
2163 | + return false; | |
2164 | + } | |
2165 | + if (th.data.is_by[pickid] == 1) { | |
2166 | + getApp().my_warnning("已全场包邮,不能选择包邮券", 0, th); | |
2167 | + return false; | |
2168 | + } | |
2169 | + | |
2170 | + th.insert_into_using_quan(item, using_quan, pickid, 1); | |
2171 | + return; | |
2172 | + } | |
2173 | + } | |
2174 | + | |
2175 | + //循环包邮的券 | |
2176 | + for (var i in by_quan_list_cart) { | |
2177 | + var item = by_quan_list_cart[i]; | |
2178 | + if (item.show_red) { | |
2179 | + if (th.data.is_no_by[pickid] == 1) { | |
2180 | + getApp().my_warnning("已全场不能包邮,不能选择包邮券", 0, th); | |
2181 | + return false; | |
2182 | + } | |
2183 | + if (th.data.is_by[pickid] == 1) { | |
2184 | + getApp().my_warnning("已全场包邮,不能选择包邮券", 0, th); | |
2185 | + return false; | |
2186 | + } | |
2187 | + th.insert_into_using_quan(item, using_quan, pickid, 1); | |
2188 | + return; | |
2189 | + } | |
2190 | + } | |
2191 | + | |
2192 | + //选择了的券,看是不是点击了不使用券,点击了不使用优惠券 | |
2193 | + if (using_quan[pickid]) { | |
2194 | + if (using_quan[pickid].is_nouse_red == 1) { | |
2195 | + using_quan[pickid] = { is_nouse_red: 1 }; | |
2196 | + th.setData({ using_quan: using_quan }); | |
2197 | + if (th.data.is_b_now == 1) { | |
2198 | + th.calculatePrice2(); | |
2199 | + } else { | |
2200 | + th.calculatePrice(); | |
2201 | + } | |
2202 | + th.setData({ open_quan: 0 }); | |
2203 | + return; | |
2204 | + } | |
2205 | + } | |
2206 | + }, | |
2207 | + | |
2208 | + //----把券插入之后的操作,同时还要重新计算价格---- | |
2209 | + insert_into_using_quan: async function (item, using_quan, pickid, isby) { | |
2210 | + | |
2211 | + | |
2212 | + var th = this; | |
2213 | + var old_quan = null; | |
2214 | + if (isby == 1) { | |
2215 | + using_quan[pickid] = { | |
2216 | + coupon_no: item.no, | |
2217 | + money: 0, | |
2218 | + is_nouse_red: 0, | |
2219 | + region_list: item.region_list, | |
2220 | + goods_list: item.goods_list | |
2221 | + }; | |
2222 | + using_quan[pickid].isby = 1; | |
2223 | + } else { | |
2224 | + if (using_quan[pickid]) old_quan = using_quan[pickid]; | |
2225 | + using_quan[pickid] = { coupon_no: item.CashRepNo, money: item.Sum, is_nouse_red: 0 }; | |
2226 | + using_quan[pickid].isby = 0; | |
2227 | + } | |
2228 | + this.setData({ using_quan: using_quan }); | |
2229 | + if (th.data.is_b_now == 1) { | |
2230 | + th.calculatePrice2(function () { | |
2231 | + | |
2232 | + if (old_quan) using_quan[pickid] = old_quan; | |
2233 | + else using_quan[pickid] = null; | |
2234 | + th.setData({ using_quan: using_quan, submit: 0 }); | |
2235 | + wx.showToast({ | |
2236 | + title: "不能使用优惠券,同城起送价不足", | |
2237 | + icon: 'none', | |
2238 | + duration: 2000 | |
2239 | + }) | |
2240 | + | |
2241 | + }); | |
2242 | + } else { | |
2243 | + th.calculatePrice(function () { | |
2244 | + if (old_quan) using_quan[pickid] = old_quan; | |
2245 | + else using_quan[pickid] = null; | |
2246 | + th.setData({ using_quan: using_quan, submit: 0 }); | |
2247 | + wx.showToast({ | |
2248 | + title: "不能使用优惠券,同城起送价不足", | |
2249 | + icon: 'none', | |
2250 | + duration: 2000 | |
2251 | + }) | |
2252 | + }); | |
2253 | + } | |
2254 | + th.setData({ open_quan: 0 }); | |
2255 | + }, | |
2256 | + | |
2257 | + | |
2258 | + | |
2259 | + | |
1685 | 2260 | }); | ... | ... |
packageE/pages/cart/cart2_pt/cart2_pt.wxml
1 | 1 | <wxs module="filters" src="../../../../utils/filter.wxs"></wxs> |
2 | +<wxs module="filter" src="../cart2/c_filter.wxs"></wxs> | |
2 | 3 | <form bindsubmit="sendsm"> |
3 | 4 | <view class="container"> |
4 | 5 | |
... | ... | @@ -101,6 +102,24 @@ |
101 | 102 | <icon color="#f23030" size="16" type="info"></icon>{{order.store_prom}} |
102 | 103 | </view> |
103 | 104 | |
105 | + | |
106 | + <view class="xc-coupon-frame flex-center" data-bn="1" bindtap="open_coupon_list" data-pickid="{{bn_pick}}" hidden="{{(selected_quan_list?selected_quan_list.length:0)+ (get_by_quan_list && bn_exp_type==0?get_by_quan_list.length:0)<=0}}" wx:if="{{(selected_quan_list && selected_quan_list.length>0) || get_by_quan_list!=null}}"> | |
107 | + <view class="work-frame flex-space-between"> | |
108 | + <view class="work"> | |
109 | + 优惠券 <text class="quan_num_show">{{(selected_quan_list?selected_quan_list.length:0)+ (get_by_quan_list && bn_exp_type==0?get_by_quan_list.length:0)}}张可用</text> | |
110 | + </view> | |
111 | + <view class="xc-right-frame"> | |
112 | + <text wx:if="{{using_quan[bn_pick].is_nouse}}">不使用</text> | |
113 | + <block wx:else> | |
114 | + <text wx:if="{{using_quan[bn_pick].money}}">¥{{using_quan[bn_pick].money}}元优惠券</text> | |
115 | + <text wx:if="{{using_quan[bn_pick].isby}}">包邮券</text> | |
116 | + </block> | |
117 | + <view class="xc-right"></view> | |
118 | + </view> | |
119 | + </view> | |
120 | + </view> | |
121 | + | |
122 | + | |
104 | 123 | <!--阶梯团是不显示的--> |
105 | 124 | <block wx:if="{{bn_exp_type==0 && !is_default_logistics}}"> |
106 | 125 | <view class="use-item flex-space-between" wx:if="{{kt_type!=3 || is_normal==1}}"> |
... | ... | @@ -186,6 +205,12 @@ |
186 | 205 | <view>配送费用</view> |
187 | 206 | <view class="co-red">¥ {{formData.shipping_price}}元</view> |
188 | 207 | </view> |
208 | + | |
209 | + <view class="item" wx:if="{{formData.coupon_price>0}}"> | |
210 | + <view>使用优惠券</view> | |
211 | + <view class="co-red">- ¥ {{formData.coupon_price}}元</view> | |
212 | + </view> | |
213 | + | |
189 | 214 | <!-- 使用预存优惠金额 --> |
190 | 215 | <view class="item" wx:if="{{formData.prestore>0}}"> |
191 | 216 | <view>使用预存</view> |
... | ... | @@ -256,4 +281,128 @@ |
256 | 281 | </view> |
257 | 282 | </view> |
258 | 283 | |
259 | -<warn id="warn"></warn> | |
260 | 284 | \ No newline at end of file |
285 | +<warn id="warn"></warn> | |
286 | + | |
287 | + | |
288 | + | |
289 | + <!-- 使用券列表的弹窗 --> | |
290 | +<view wx:if='{{open_quan==1}}'> | |
291 | + <view class="cover-layer flex-center " bindtap='close_coupon'> </view> | |
292 | + <view class="cx-popup {{open_quan==true?'up' : 'down'}}"> | |
293 | + <!-- 最上面 --> | |
294 | + <view class="top flex"> | |
295 | + <view class="xc-top-content t-c"> | |
296 | + <view class="xc-title">优惠券使用</view> | |
297 | + </view> | |
298 | + <view class="xc-close-frame" bindtap='close_coupon'> | |
299 | + <view class="xc-close">×</view> | |
300 | + </view> | |
301 | + </view> | |
302 | + <!-- 使用优惠券和不使用优惠券层--> | |
303 | + <view class="may_use_coupon fs28 flex"> 可使用的优惠券 | |
304 | + <view class=" is_use_coupon flex-vertical" bindtap="sele_quan_item" data-no="1">不使用优惠券 | |
305 | + <block wx:if="{{using_quan[selected_quan_pick].is_nouse_red}}"> | |
306 | + <view class="circle white xc-hooka fs20 red-b sn"><text>Γ</text></view> | |
307 | + </block> | |
308 | + <block wx:else> | |
309 | + <view class="circle xc-hookst ons"></view> | |
310 | + </block> | |
311 | + </view> | |
312 | + </view> | |
313 | + | |
314 | + <!-- 中间券内容显示 --> | |
315 | + <view class="xc-frame flex-level"> | |
316 | + <view class="list-frame"> | |
317 | + <view wx:for="{{selected_quan_list}}" bindtap="sele_quan_item" wx:if="{{!item.is_using}}" data-ind="{{q_index}}" wx:for-item="item" wx:for-index="q_index"> | |
318 | + <view class="xc-coupon-frame flex-center" data-ind="{{q_index}}"> | |
319 | + <view class="coupon-frame flex rel"> | |
320 | + <!-- 锯齿 --> | |
321 | + <include src="../cart2/juchi_part.wxml" /> | |
322 | + <!-- 左边 --> | |
323 | + <view class="coupon-left rel {{filter.setcolor(item.UseObjectType)}} flex-center"> | |
324 | + <view class="white xc-money-frames"> | |
325 | + <view class="f_text"><text class="xc-rmb-symbol">¥</text><text class="xc-rmb-val">{{item.Sum}}</text></view> | |
326 | + <view class="coupon-explain t-c" wx:if="{{item.BuySum>0}}">满{{item.BuySum}}元可用</view> | |
327 | + <view class="coupon-explain t-c" wx:else>满0元可用</view> | |
328 | + </view> | |
329 | + </view> | |
330 | + <!-- 右边 --> | |
331 | + <view class="coupon-right flex-center rel"> | |
332 | + <view class="coupon-annotation flex"> | |
333 | + <view class="flex top-frame"> | |
334 | + <view class="frame"> | |
335 | + <view class="coupon-wode ib flex ellipsis-2 "> | |
336 | + <text class="xc-brand t-c ib white {{filter.setcolor(item.UseObjectType)}}">{{filter.get_type_card(item.UseObjectType)}}</text> | |
337 | + <block>{{item.Sum}}元优惠券</block> | |
338 | + </view> | |
339 | + <view class="coupon-time">{{filters.replace_time2(item.BeginDate)}}至{{item.ValidDate?filters.replace_time2(item.ValidDate):'不限'}}</view> | |
340 | + </view> | |
341 | + </view> | |
342 | + <block wx:if="{{item.show_red}}"> | |
343 | + <view class="circle white xc-hook fs20 red-b sn"><text>Γ</text></view> | |
344 | + </block> | |
345 | + <block wx:else> | |
346 | + <view class="circle xc-hooks on"></view> | |
347 | + </block> | |
348 | + </view> | |
349 | + <include src="../cart2/remark_click_part.wxml" /> | |
350 | + </view> | |
351 | + </view> | |
352 | + </view> | |
353 | + <!-- 打开是说明 --> | |
354 | + <include src="../cart2/remark_part.wxml" /> | |
355 | + </view> | |
356 | + <!-- 包邮券的显示,立即购买 --> | |
357 | + <block wx:if="{{ is_b_now && bn_exp_type==0}}"> | |
358 | + <view wx:for="{{get_by_quan_list}}" bindtap="sele_quan_item_by" wx:if="{{!item.is_using}}" data-ind="{{byq_index}}" wx:for-item="item" wx:for-index="byq_index"> | |
359 | + <view class="xc-coupon-frame flex-center" data-ind="{{byq_index}}"> | |
360 | + <view class="coupon-frame flex rel"> | |
361 | + <!-- 锯齿 --> | |
362 | + <include src="../cart2/juchi_part.wxml" /> | |
363 | + <!-- 左边 --> | |
364 | + <view class="coupon-left rel {{filter.setcolor(item.UseObjectType)}} flex-center"> | |
365 | + <view class="white xc-money-frames"> | |
366 | + <view class="f_text"><text class="xc-rmb-val">包邮券</text></view> | |
367 | + <view class="coupon-explain t-c" wx:if="{{item.condition>0}}">满{{item.condition}}元可用</view> | |
368 | + <view class="coupon-explain t-c" wx:else>满0元可用</view> | |
369 | + </view> | |
370 | + </view> | |
371 | + <!-- 右边 --> | |
372 | + <view class="coupon-right flex-center rel"> | |
373 | + <view class="coupon-annotation flex"> | |
374 | + <view class="flex top-frame"> | |
375 | + <view class="frame"> | |
376 | + <view class="coupon-wode ib flex ellipsis-2 "> | |
377 | + <text class="xc-brand t-c ib white {{filter.setcolor(item.UseObjectType)}}">{{filter.get_type_card(0)}}</text> | |
378 | + <block>包邮券</block> | |
379 | + </view> | |
380 | + <view class="coupon-time">{{filters.format_time(item.use_start_time)}}至{{item.use_end_time?filters.format_time(item.use_end_time):'不限'}}</view> | |
381 | + </view> | |
382 | + </view> | |
383 | + <block wx:if="{{item.show_red}}"> | |
384 | + <view class="circle white xc-hook fs20 red-b sn"><text>Γ</text></view> | |
385 | + </block> | |
386 | + <block wx:else> | |
387 | + <view class="circle xc-hooks on"></view> | |
388 | + </block> | |
389 | + </view> | |
390 | + <include src="../cart2/remark_click_part2.wxml" /> | |
391 | + </view> | |
392 | + </view> | |
393 | + </view> | |
394 | + <!-- 打开是说明 --> | |
395 | + <include src="../cart2/remark_part.wxml" /> | |
396 | + </view> | |
397 | + </block> | |
398 | + | |
399 | + | |
400 | + | |
401 | + | |
402 | + </view> | |
403 | + </view> | |
404 | + <!-- 最底下确定层--> | |
405 | + <view class="determine-frame"> | |
406 | + <view class="xc-confirm flex-center" bindtap="confirm_quan"> 确定 </view> | |
407 | + </view> | |
408 | + </view> | |
409 | +</view> | |
261 | 410 | \ No newline at end of file | ... | ... |
packageE/pages/cart/cart2_pt/cart2_pt.wxss
packageE/pages/cart/cart_wk/cart_wk.js
1 | 1 | // pages/cart/cart_wk/cart_wk.js |
2 | 2 | var t = getApp(), |
3 | - oo = t.globalData.setting, | |
3 | + oo = t.globalData.setting,app=t, | |
4 | 4 | os=oo; |
5 | 5 | var ut=require("../../../../utils/util.js"); |
6 | 6 | var util_pay=require("../../../../utils/pay.js"); |
... | ... | @@ -53,8 +53,21 @@ Page({ |
53 | 53 | paying:0, //支付中 |
54 | 54 | same_ok:1, //同城配送的控制 |
55 | 55 | formData:{ |
56 | - order_prom_amount:0 | |
57 | - } | |
56 | + order_prom_amount:0, | |
57 | + coupon_price:0 | |
58 | + }, | |
59 | + | |
60 | + //--更优惠券抵用有关,立即购买的,如果是购物车,就要把相应的值,写入cartlist数组中-- | |
61 | + ckeck_quan_price: 0, | |
62 | + check_quan_price_list: '', | |
63 | + check_quan_ware_list: '', | |
64 | + | |
65 | + // 设计一个数组来存放已经选择了的券编号,coupon_no是券号,money是面值,coupon_price是真正优惠的价格,数组的下标是pickid | |
66 | + //using_quan[11]={coupon_no:"1212121",money:"20",coupon_price:"45"} | |
67 | + using_quan: {}, | |
68 | + isget_by_quan: {}, //是否调用了接口获取包邮券 | |
69 | + is_by:{}, | |
70 | + get_by_quan_list: null, //立即购买的 | |
58 | 71 | |
59 | 72 | }, |
60 | 73 | |
... | ... | @@ -154,13 +167,8 @@ Page({ |
154 | 167 | user_addr: addr, enterAddressPage: 0,same_ok:1 |
155 | 168 | }); |
156 | 169 | } |
157 | - | |
158 | - if (th.data.exp_type == 0 && th.data.goods) { | |
159 | - th.calculate_wuliu(); | |
160 | - } | |
161 | - | |
162 | - if (th.data.exp_type == 2 && th.data.goods) { | |
163 | - th.calculate_same_city(); | |
170 | + if (th.data.goods) { | |
171 | + th.calculatePrice2(); | |
164 | 172 | } |
165 | 173 | |
166 | 174 | }) |
... | ... | @@ -361,7 +369,7 @@ Page({ |
361 | 369 | |
362 | 370 | if (!goods) return false; |
363 | 371 | |
364 | - if(goods.is_minishop==1 && getApp().is_sp_hao()){ | |
372 | + if(goods.is_minishop==1 && getApp().is_sp_hao()){ | |
365 | 373 | |
366 | 374 | if(goods.distr_type==1 || pickup.distr_type==1) { |
367 | 375 | wx.showToast({ |
... | ... | @@ -423,7 +431,6 @@ Page({ |
423 | 431 | } |
424 | 432 | |
425 | 433 | |
426 | - | |
427 | 434 | order.order_goods = order_goods; |
428 | 435 | |
429 | 436 | //-- 计算获得佣金的金额 -- |
... | ... | @@ -446,12 +453,23 @@ Page({ |
446 | 453 | |
447 | 454 | } |
448 | 455 | |
456 | + if(teamlist.is_quan){ | |
457 | + let q_ch_money= parseFloat(price * order_goods.goods_num).toFixed(2); | |
458 | + th.data.ckeck_quan_price = q_ch_money; | |
459 | + th.data.check_quan_price_list = q_ch_money + ""; | |
460 | + th.data.check_quan_ware_list = goods.erpwareid + ""; | |
461 | + }else{ | |
462 | + goods.is_xz_yh = 1; | |
463 | + } | |
464 | + | |
465 | + | |
449 | 466 | |
450 | 467 | |
451 | 468 | this.setData({ |
452 | 469 | order: order, |
453 | 470 | distr_type: distr_type, |
454 | 471 | pickup: pickup, |
472 | + bn_pick: pickup.pickup_id, | |
455 | 473 | exp_type: exp_type, |
456 | 474 | goods: goods, |
457 | 475 | teamgroup: teamgroup, |
... | ... | @@ -460,6 +478,7 @@ Page({ |
460 | 478 | |
461 | 479 | //--计算价格-- |
462 | 480 | th.calculatePrice2(); |
481 | + th.get_buy_now_quan(); | |
463 | 482 | }, |
464 | 483 | |
465 | 484 | |
... | ... | @@ -469,6 +488,37 @@ Page({ |
469 | 488 | th.setData({submit: 1}) |
470 | 489 | |
471 | 490 | var allpice = th.data.order.order_amount + th.data.order.user_money + th.data.order.tail_money; |
491 | + | |
492 | + //---如果有选择优惠券的情况下--- | |
493 | + var quan_price = 0, bn_pick = th.data.bn_pick; | |
494 | + var quan_no = null; | |
495 | + if (th.data.using_quan[bn_pick] != null && th.data.using_quan[bn_pick] != undefined) | |
496 | + quan_no = th.data.using_quan[bn_pick].coupon_no; | |
497 | + | |
498 | + if (quan_no) { | |
499 | + //如果是一件代发就不要找商品 | |
500 | + if (th.data.using_quan[bn_pick].isby != 1) { | |
501 | + //---获取优惠券优惠--- | |
502 | + await getApp().request.promiseGet("/api/weshop/couponList/getUseCouponPrice", { | |
503 | + data: { | |
504 | + storeId: oo.stoid, | |
505 | + CashRepNo: quan_no, | |
506 | + WaresSum: th.data.ckeck_quan_price, | |
507 | + WareIds: th.data.check_quan_ware_list | |
508 | + } | |
509 | + }).then(res => { | |
510 | + | |
511 | + if (res.data.code == 0 && res.data.data && res.data.data.length > 0) { | |
512 | + quan_price = res.data.data[0].WareCashSum; | |
513 | + allpice=allpice-quan_price; | |
514 | + } | |
515 | + }) | |
516 | + } | |
517 | + } | |
518 | + | |
519 | + var order_prom_txt3 = "formData.coupon_price"; | |
520 | + th.setData({[order_prom_txt3]: quan_price}) | |
521 | + | |
472 | 522 | var o_condition = allpice; |
473 | 523 | var ord_prom=null; |
474 | 524 | var order_prom_amount=0; |
... | ... | @@ -487,10 +537,10 @@ Page({ |
487 | 537 | |
488 | 538 | //--计算物流-- |
489 | 539 | if (th.data.exp_type == 0) { |
490 | - th.calculate_wuliu(); | |
540 | + th.calculate_wuliu(allpice); | |
491 | 541 | return false; |
492 | 542 | }else if(th.data.exp_type == 2){ |
493 | - th.calculate_same_city(); | |
543 | + th.calculate_same_city(allpice); | |
494 | 544 | return false; |
495 | 545 | } else { |
496 | 546 | |
... | ... | @@ -521,6 +571,7 @@ Page({ |
521 | 571 | //--订单优惠的显示-- |
522 | 572 | var order_prom_txt1 = "formData.order_prom_id"; |
523 | 573 | var order_prom_txt2 = "formData.order_prom_amount"; |
574 | + | |
524 | 575 | if (order_prom_id > 0) { |
525 | 576 | th.setData({[order_prom_txt1]: order_prom_id, [order_prom_txt2]: order_prom_amount}) |
526 | 577 | } else { |
... | ... | @@ -565,19 +616,10 @@ Page({ |
565 | 616 | exp_type: type,same_ok:1 |
566 | 617 | }); |
567 | 618 | //--计算物流的值-- |
568 | - if (type == 0) { | |
569 | - th.calculate_wuliu(); | |
570 | - } else if(type==1){ | |
571 | - var allpice = parseFloat(th.data.order.order_amount) | |
572 | - + parseFloat(th.data.order.user_money) | |
573 | - + parseFloat(th.data.order.tail_money); | |
574 | - allpice = allpice.toFixed(2); | |
575 | - this.setData({ | |
576 | - allpice: allpice, exp_price: 0,show_submit:1,submit:0 | |
577 | - }); | |
578 | - }else{ | |
579 | - th.calculate_same_city(); | |
619 | + if (th.data.goods) { | |
620 | + th.calculatePrice2(); | |
580 | 621 | } |
622 | + | |
581 | 623 | }, |
582 | 624 | |
583 | 625 | //关闭支付 |
... | ... | @@ -632,6 +674,18 @@ Page({ |
632 | 674 | tail_pay_type: ind,//0微信支付 1余额支付 |
633 | 675 | }; |
634 | 676 | |
677 | + //组装优惠券的钱 | |
678 | + if (parseFloat(th.data.formData.coupon_price) > 0) { | |
679 | + dd.coupon_price = th.data.formData.coupon_price; | |
680 | + dd.coupon_no = th.data.using_quan[th.data.bn_pick].coupon_no; | |
681 | + } | |
682 | + | |
683 | + if (th.data.using_quan[th.data.bn_pick] && th.data.using_quan[th.data.bn_pick].coupon_no && th.data.using_quan[th.data.bn_pick].isby) { | |
684 | + dd.coupon_no = th.data.using_quan[th.data.bn_pick].coupon_no; | |
685 | + dd.coupon_price = 0; | |
686 | + } | |
687 | + | |
688 | + | |
635 | 689 | if (th.data.exp_type == 0 || th.data.exp_type == 2) { |
636 | 690 | var index = th.data.index; |
637 | 691 | dd.shipping_code = th.data.wu_arr[index].code; |
... | ... | @@ -774,7 +828,7 @@ Page({ |
774 | 828 | }, |
775 | 829 | |
776 | 830 | //----计算物流的钱---- |
777 | - async calculate_wuliu() { | |
831 | + async calculate_wuliu(p_allpice) { | |
778 | 832 | //让按钮变灰色 |
779 | 833 | this.setData({submit: 1}); |
780 | 834 | var to = getApp(), th = this; |
... | ... | @@ -791,14 +845,54 @@ Page({ |
791 | 845 | var order_prom_amount=0; |
792 | 846 | //--全部金额-- |
793 | 847 | var allpice = th.data.order.order_amount + th.data.order.user_money + th.data.order.pt_tail_money; |
848 | + if(p_allpice) allpice=p_allpice; | |
794 | 849 | // if(th.data.bn_use_commission){ |
795 | 850 | // allpice-=th.data.goods.use_commission; |
796 | 851 | // } |
852 | + var pickid=th.data.bn_pick; | |
797 | 853 | var o_condition=allpice; |
854 | + var quan_no = null; | |
855 | + | |
856 | + if (th.data.using_quan[pickid] != null && th.data.using_quan[pickid] != undefined) | |
857 | + quan_no = th.data.using_quan[pickid].coupon_no; | |
798 | 858 | |
799 | 859 | //-----------当地址不为空,且是物流时,计算物流费用---------- |
800 | 860 | if (th.data.user_addr != null && th.data.exp_type == 0 && good.is_free_shipping == 0) { |
801 | 861 | |
862 | + //看是不是有调用过包邮券 | |
863 | + if (!th.data.isget_by_quan[th.data.pickid] && good.is_xz_yh != 1) { | |
864 | + | |
865 | + //--判断要不要显示包邮券,链式调用接口,调取包邮券,已经是减了优惠的金额,见到优惠券的钱--- | |
866 | + getApp().request.promiseGet("/api/weshop/userfeemail/pageAndArea", { | |
867 | + data: { | |
868 | + store_id: os.stoid, | |
869 | + isuse: 0, | |
870 | + condition: o_condition, | |
871 | + user_id: getApp().globalData.user_id, | |
872 | + pageSize: 2000 | |
873 | + } | |
874 | + }).then(res => { | |
875 | + if (res.data.code == 0 && res.data.data.total > 0) { | |
876 | + //此时要循环判断包邮的地区,不包邮商品是不是符合 | |
877 | + var arr = [], quanlist = res.data.data.pageData; | |
878 | + quanlist = th.check_is_frozenQuan(quanlist, th.data.frozenQuan, 1); | |
879 | + for (var i in quanlist) { | |
880 | + var item = quanlist[i]; | |
881 | + if (item.region_list && th.check_by_area(item.region_list)) continue; //如果是不包邮区域 | |
882 | + if (item.goods_list) { | |
883 | + var no_goods_arr = item.goods_list.split(","); | |
884 | + if (ut.isContained(no_goods_arr, gd_arr_list)) continue; //如果是不包邮商品 | |
885 | + } | |
886 | + arr.push(item); | |
887 | + } | |
888 | + if (arr) { | |
889 | + th.setData({ get_by_quan_list: arr }); | |
890 | + } | |
891 | + th.data.isget_by_quan[th.data.bn_pick] = 1; | |
892 | + } | |
893 | + }) | |
894 | + } | |
895 | + | |
802 | 896 | //订单促销的包邮模板 和 活动的包邮模板要一起判断 |
803 | 897 | if ((!ord_prom || ord_prom.is_post_temp) && th.data.bn_is_post_temp) { |
804 | 898 | var user_addr = th.data.user_addr; |
... | ... | @@ -814,98 +908,137 @@ Page({ |
814 | 908 | }); |
815 | 909 | } |
816 | 910 | |
817 | - var cut_good_weight = 0; | |
818 | - for (let i in gd_arr_list) { | |
819 | - let item = gd_arr_list[i]; | |
820 | 911 | |
821 | - if (back_data && back_data['is_by_all'] && (!back_data.no_free_goods || back_data.no_free_goods.indexOf(item.goods_id) == -1)) { | |
912 | + var is_by_quan = 0; | |
913 | + var quan_no_goods_arr=null; | |
822 | 914 | |
823 | - if (item['exp_sum_type'] == 2 && back_data.weight_free > 0) { | |
824 | - if (goods_weight < 0) goods_weight = 0; | |
825 | - goods_weight += item['weight'] * item['buynum']; | |
826 | - cut_good_weight += item['weight'] * item['buynum']; | |
827 | - } | |
828 | - if (back_data.weight_free > 0) { | |
829 | - out_of_weight = (back_data.weight_free * 1000) - cut_good_weight; | |
915 | + //如果是包邮券的时候,要看看券的情况,判断一下包邮有没有不包邮模板 | |
916 | + if (quan_no && th.data.using_quan[pickid].isby == 1) { | |
917 | + var quan = th.data.using_quan[pickid]; | |
918 | + if (quan.goods_list) { | |
919 | + quan_no_goods_arr = quan.goods_list.split(","); | |
920 | + } else { | |
921 | + is_by_quan = 1; | |
922 | + } | |
923 | + } | |
924 | + | |
925 | + //如果有包邮券的不包邮商品的时候 | |
926 | + if (quan_no_goods_arr) { | |
927 | + if (back_data && back_data.no_free_goods) { | |
928 | + back_data['is_by_all'] = 1; | |
929 | + var arr3 = back_data.no_free_goods.filter(item => { | |
930 | + return quan_no_goods_arr.includes(item) | |
931 | + }) | |
932 | + back_data.no_free_goods = null; | |
933 | + if (arr3.length) { | |
934 | + back_data.no_free_goods = arr3; | |
830 | 935 | } |
831 | - continue; | |
832 | 936 | } |
937 | + if (!back_data || !back_data.no_free_goods) { | |
938 | + if (!back_data) back_data = {}; | |
939 | + back_data['is_by_all'] = 1; | |
940 | + back_data['no_free_goods'] = quan_no_goods_arr; | |
941 | + } | |
942 | + } | |
833 | 943 | |
834 | - switch (item['exp_sum_type']) { | |
835 | - case 1: | |
836 | - //统一运费 | |
837 | - o_shipping_price += item['uniform_exp_sum']; | |
838 | - break; | |
839 | - case 2: | |
840 | - if (goods_weight < 0) goods_weight = 0; | |
841 | - //累积商品重量 每种商品的重量 * 数量 | |
842 | - goods_weight += item['weight'] * item['buynum']; | |
944 | + if(!is_by_quan){ | |
945 | + var cut_good_weight = 0; | |
946 | + for (let i in gd_arr_list) { | |
947 | + let item = gd_arr_list[i]; | |
843 | 948 | |
844 | - if (back_data && back_data.is_by_all && !back_data.no_free_goods) { | |
845 | - cut_good_weight += item['weight'] * item['buynum']; | |
949 | + if (back_data && back_data['is_by_all'] && (!back_data.no_free_goods || back_data.no_free_goods.indexOf(item.goods_id) == -1)) { | |
950 | + | |
951 | + if (item['exp_sum_type'] == 2 && back_data.weight_free > 0) { | |
952 | + if (goods_weight < 0) goods_weight = 0; | |
953 | + goods_weight += item['weight'] * item['buynum']; | |
954 | + cut_good_weight += item['weight'] * item['buynum']; | |
955 | + } | |
846 | 956 | if (back_data.weight_free > 0) { |
847 | 957 | out_of_weight = (back_data.weight_free * 1000) - cut_good_weight; |
848 | 958 | } |
959 | + continue; | |
849 | 960 | } |
850 | - break; | |
851 | - case 3: | |
852 | - if (goods_piece < 0) goods_piece = 0; | |
853 | - //累积商品数量 | |
854 | - goods_piece += item['buynum']; | |
855 | - break; | |
856 | - } | |
857 | - } | |
858 | 961 | |
859 | - //如果是正值的时候 | |
860 | - if (out_of_weight >= 0) out_of_weight = -cut_good_weight; | |
861 | - else out_of_weight = -back_data.weight_free * 1000; | |
962 | + switch (item['exp_sum_type']) { | |
963 | + case 1: | |
964 | + //统一运费 | |
965 | + o_shipping_price += item['uniform_exp_sum']; | |
966 | + break; | |
967 | + case 2: | |
968 | + if (goods_weight < 0) goods_weight = 0; | |
969 | + //累积商品重量 每种商品的重量 * 数量 | |
970 | + goods_weight += item['weight'] * item['buynum']; | |
971 | + | |
972 | + if (back_data && back_data.is_by_all && !back_data.no_free_goods) { | |
973 | + cut_good_weight += item['weight'] * item['buynum']; | |
974 | + if (back_data.weight_free > 0) { | |
975 | + out_of_weight = (back_data.weight_free * 1000) - cut_good_weight; | |
976 | + } | |
977 | + } | |
978 | + break; | |
979 | + case 3: | |
980 | + if (goods_piece < 0) goods_piece = 0; | |
981 | + //累积商品数量 | |
982 | + goods_piece += item['buynum']; | |
983 | + break; | |
984 | + } | |
985 | + } | |
862 | 986 | |
863 | - if(!th.data.wu_arr){ | |
864 | - wx.hideLoading(); | |
865 | - wx.showToast({ | |
866 | - title: "物流配置未启用物流公司", icon: 'none', duration: 2000 | |
867 | - }) | |
868 | - //th.setData({ show_submit:0, }); | |
869 | - th.setData({show_submit:1, submit: 0,same_ok:0 }) | |
870 | - return false; | |
871 | - } | |
872 | - var code = th.data.wu_arr[th.data.index].code; | |
873 | - | |
874 | - //--------------开始计算物流------------------ | |
875 | - var shipping_price = 0; | |
876 | - // ut.calculatewuliu(code, o_shipping_price, goods_weight, out_of_weight, | |
877 | - // goods_piece, th.data.user_addr, back_data, rs); | |
878 | - | |
879 | - var w_data = { | |
880 | - store_id: os.stoid, code: code, | |
881 | - o_shipping_price: o_shipping_price, | |
882 | - goods_weight: goods_weight, | |
883 | - out_of_weight: out_of_weight, goods_piece: goods_piece, | |
884 | - user_addr_province: th.data.user_addr.province, | |
885 | - user_addr_city: th.data.user_addr.city, | |
886 | - user_addr_district: th.data.user_addr.district, | |
887 | - is_by_all: back_data && back_data.is_by_all ? 1 : 0, | |
888 | - no_free_goods: back_data && back_data.no_free_goods && back_data.no_free_goods.length > 0 ? 1 : 0, | |
889 | - } | |
987 | + //如果是正值的时候 | |
988 | + if (out_of_weight >= 0) out_of_weight = -cut_good_weight; | |
989 | + else out_of_weight = -back_data.weight_free * 1000; | |
990 | + | |
991 | + if (!th.data.wu_arr) { | |
992 | + wx.hideLoading(); | |
993 | + wx.showToast({ | |
994 | + title: "物流配置未启用物流公司", icon: 'none', duration: 2000 | |
995 | + }) | |
996 | + //th.setData({ show_submit:0, }); | |
997 | + th.setData({show_submit: 1, submit: 0, same_ok: 0}) | |
998 | + return false; | |
999 | + } | |
1000 | + var code = th.data.wu_arr[th.data.index].code; | |
1001 | + | |
1002 | + //--------------开始计算物流------------------ | |
1003 | + var shipping_price = 0; | |
1004 | + // ut.calculatewuliu(code, o_shipping_price, goods_weight, out_of_weight, | |
1005 | + // goods_piece, th.data.user_addr, back_data, rs); | |
1006 | + | |
1007 | + var w_data = { | |
1008 | + store_id: os.stoid, code: code, | |
1009 | + o_shipping_price: o_shipping_price, | |
1010 | + goods_weight: goods_weight, | |
1011 | + out_of_weight: out_of_weight, goods_piece: goods_piece, | |
1012 | + user_addr_province: th.data.user_addr.province, | |
1013 | + user_addr_city: th.data.user_addr.city, | |
1014 | + user_addr_district: th.data.user_addr.district, | |
1015 | + is_by_all: back_data && back_data.is_by_all ? 1 : 0, | |
1016 | + no_free_goods: back_data && back_data.no_free_goods && back_data.no_free_goods.length > 0 ? 1 : 0, | |
1017 | + } | |
890 | 1018 | |
891 | - var is_ok = 0; | |
892 | - await getApp().request.promisePost('/api/weshop/order/getOrderWuLiPrice', { | |
893 | - data: w_data, | |
894 | - is_json: 1 | |
895 | - }).then(res => { | |
896 | - if (res.data.code == 0) { | |
897 | - shipping_price = res.data.data; | |
898 | - is_ok = 1; | |
899 | - } else { | |
900 | - getApp().confirmBox("计算物流错误:" + res.data.msg); | |
901 | - } | |
902 | - }) | |
903 | - if (!is_ok) { | |
904 | - th.setData({show_submit:1, submit: 0,same_ok:0 }) | |
905 | - wx.hideLoading(); | |
906 | - return false; | |
1019 | + var is_ok = 0; | |
1020 | + await getApp().request.promisePost('/api/weshop/order/getOrderWuLiPrice', { | |
1021 | + data: w_data, | |
1022 | + is_json: 1 | |
1023 | + }).then(res => { | |
1024 | + if (res.data.code == 0) { | |
1025 | + shipping_price = res.data.data; | |
1026 | + is_ok = 1; | |
1027 | + } else { | |
1028 | + getApp().confirmBox("计算物流错误:" + res.data.msg); | |
1029 | + } | |
1030 | + }) | |
1031 | + if (!is_ok) { | |
1032 | + th.setData({show_submit: 1, submit: 0, same_ok: 0}) | |
1033 | + wx.hideLoading(); | |
1034 | + return false; | |
1035 | + } | |
907 | 1036 | } |
908 | 1037 | |
1038 | + | |
1039 | + | |
1040 | + | |
1041 | + | |
909 | 1042 | //-- 计算一下订单促销 -- |
910 | 1043 | if (ord_prom) { |
911 | 1044 | order_prom_id = ord_prom['id']; |
... | ... | @@ -1026,7 +1159,7 @@ Page({ |
1026 | 1159 | }, |
1027 | 1160 | |
1028 | 1161 | //----计算物流的钱--- |
1029 | - async calculate_same_city() { | |
1162 | + async calculate_same_city(p_allpice) { | |
1030 | 1163 | //让按钮变灰色 |
1031 | 1164 | this.setData({submit:1}); |
1032 | 1165 | var th = this; |
... | ... | @@ -1039,7 +1172,9 @@ Page({ |
1039 | 1172 | var order_prom_amount=0; |
1040 | 1173 | |
1041 | 1174 | //--全部金额-- |
1042 | - var allpice = th.data.order.order_amount + th.data.order.user_money + th.data.order.pt_tail_money; | |
1175 | + var allpice = p_allpice; | |
1176 | + var o_condition=p_allpice; | |
1177 | + | |
1043 | 1178 | //-----------当地址不为空,且是物流时,计算物流费用---------- |
1044 | 1179 | if (th.data.user_addr != null) { |
1045 | 1180 | |
... | ... | @@ -1145,7 +1280,7 @@ Page({ |
1145 | 1280 | |
1146 | 1281 | } else { |
1147 | 1282 | |
1148 | - var allpice = th.data.order.order_amount + th.data.order.user_money + th.data.order.tail_money; | |
1283 | + | |
1149 | 1284 | |
1150 | 1285 | //-- 计算一下订单促销 -- |
1151 | 1286 | if (ord_prom) { |
... | ... | @@ -1339,6 +1474,397 @@ Page({ |
1339 | 1474 | var th = this; |
1340 | 1475 | th.setData({bn_use_commission: !th.data.bn_use_commission}); |
1341 | 1476 | th.calculatePrice2(); |
1342 | - } | |
1477 | + }, | |
1478 | + | |
1479 | + //------ 获取立即购买的购物车的劵 -------- | |
1480 | + get_buy_now_quan: function () { | |
1481 | + var quanlist = null, th = this, frozenQuan = null; | |
1482 | + var good = this.data.goods; | |
1483 | + | |
1484 | + //一件代发商品不使用优惠券 | |
1485 | + if (good.whsle_id) return false; | |
1486 | + if(!th.data.check_quan_ware_list) return false; | |
1487 | + | |
1488 | + //--如果商家后台没有限制使用优惠券,同时商品的优惠活动没有限制使用优惠券-- | |
1489 | + if (th.data.is_close_quan != 1 && good.is_xz_yh != 1 && th.data.check_quan_ware_list) { | |
1490 | + var url0 = "/api/weshop/users/frozenQuan/listFrozenQuan/" + app.globalData.user_id; | |
1491 | + var url = "/api/weshop/couponList/getUseCouponList"; | |
1492 | + app.request.promiseGet(url0, { 1: 1 }).then(res => { | |
1493 | + if (res.data.code == 0) { | |
1494 | + frozenQuan = res.data.data; | |
1495 | + th.data.frozenQuan = frozenQuan; | |
1496 | + } | |
1497 | + app.request.time_limit_get(6, url, { | |
1498 | + data: { | |
1499 | + storeId: oo.stoid, | |
1500 | + userId: app.globalData.user_id, | |
1501 | + BuySum: th.data.ckeck_quan_price, | |
1502 | + WareIds: encodeURIComponent(th.data.check_quan_ware_list), | |
1503 | + pageSize: 100 | |
1504 | + }, | |
1505 | + success: function (res) { | |
1506 | + if (res.data.code == 0) { | |
1507 | + quanlist = res.data.data.pageData; | |
1508 | + if (quanlist) { | |
1509 | + quanlist = th.check_is_frozenQuan(quanlist, frozenQuan); | |
1510 | + th.setData({ selected_quan_list: quanlist }) | |
1511 | + } | |
1512 | + } | |
1513 | + } | |
1514 | + }) | |
1515 | + }) | |
1516 | + } | |
1517 | + }, | |
1518 | + | |
1519 | + //--验证是否已经冻结-- | |
1520 | + check_is_frozenQuan: function (quanlist, frozenQuan, isby) { | |
1521 | + console.log("券列表", quanlist); | |
1522 | + if (!quanlist) return null; | |
1523 | + if (!frozenQuan) return quanlist; | |
1524 | + var arr = []; | |
1525 | + for (var i = 0; i < quanlist.length; i++) { | |
1526 | + var item = quanlist[i]; | |
1527 | + var is_find = 0; | |
1528 | + var Q_no = quanlist[i].CashRepNo; | |
1529 | + if (isby) Q_no = quanlist[i].no; | |
1530 | + for (var j = 0; j < frozenQuan.length; j++) { | |
1531 | + var q_no = frozenQuan[j].cashRepNo; | |
1532 | + if (Q_no == q_no) { | |
1533 | + is_find = 1; | |
1534 | + break; | |
1535 | + } | |
1536 | + } | |
1537 | + if (!is_find) arr.push(item); | |
1538 | + } | |
1539 | + return arr; | |
1540 | + }, | |
1541 | + | |
1542 | + /*----券的所有操作----*/ | |
1543 | + open_coupon_list: function (e) { | |
1544 | + var th = this; | |
1545 | + var pickid = e.currentTarget.dataset.pickid; | |
1546 | + var bn = e.currentTarget.dataset.bn; | |
1547 | + var cindx = e.currentTarget.dataset.cind; | |
1548 | + | |
1549 | + if (bn == 1) { | |
1550 | + th.setData({ open_quan: 1, selected_quan_pick: pickid, disabled: 1 }); | |
1551 | + } else { | |
1552 | + //---多单打开券的时候,就要判断券在其他门店是否有使用--- | |
1553 | + var quanlist = th.data.cartlist[cindx].quan_list; | |
1554 | + var exp_type = th.data.cartlist[cindx].exp_type; | |
1555 | + | |
1556 | + | |
1557 | + //对于在其他门店已经选择了的券 要判断是否显示到界面 | |
1558 | + var t_user = th.data.using_quan[pickid]; | |
1559 | + | |
1560 | + for (var i in quanlist) { | |
1561 | + quanlist[i].is_using = th.check_in_sele(quanlist[i].CashRepNo, pickid); | |
1562 | + if (t_user && quanlist[i].CashRepNo == t_user.coupon_no) | |
1563 | + quanlist[i].show_red = 1; | |
1564 | + else | |
1565 | + quanlist[i].show_red = 0; | |
1566 | + } | |
1567 | + | |
1568 | + if (get_by_quan_list_cart) { | |
1569 | + for (var i in get_by_quan_list_cart) { | |
1570 | + get_by_quan_list_cart[i].is_using = th.check_in_sele(get_by_quan_list_cart[i].no, pickid); | |
1571 | + if (t_user && get_by_quan_list_cart[i].no == t_user.coupon_no) | |
1572 | + get_by_quan_list_cart[i].show_red = 1; | |
1573 | + else | |
1574 | + get_by_quan_list_cart[i].show_red = 0; | |
1575 | + } | |
1576 | + th.setData({ by_quan_list_cart: get_by_quan_list_cart }); | |
1577 | + } else { | |
1578 | + th.setData({ by_quan_list_cart: null }); | |
1579 | + } | |
1580 | + | |
1581 | + console.log("2222222券的列表", quanlist); | |
1582 | + th.setData({ | |
1583 | + sele_cart_ind: cindx, | |
1584 | + sele_exp_type: exp_type, | |
1585 | + open_quan: 1, | |
1586 | + selected_quan_pick: pickid, | |
1587 | + selected_quan_list: quanlist, | |
1588 | + disabled: 1 | |
1589 | + }); | |
1590 | + } | |
1591 | + }, | |
1592 | + close_coupon: function (e) { | |
1593 | + var th = this; | |
1594 | + th.setData({ open_quan: 0, disabled: 0 }); | |
1595 | + }, | |
1596 | + | |
1597 | + /*--点击选择券--*/ | |
1598 | + sele_quan_item: function (e) { | |
1599 | + | |
1600 | + var ind = e.currentTarget.dataset.ind; | |
1601 | + var quan_item = this.data.selected_quan_list[ind]; | |
1602 | + var pickid = this.data.selected_quan_pick; //现在选择的是哪一个门店 | |
1603 | + //--如果券是单品使用的时候-- | |
1604 | + if (quan_item && quan_item.UseObjectType && quan_item.UseObjectType == "20") { | |
1605 | + //---只有多件购买的时候才要计算,//购物车购买和搭配勾的时候--- | |
1606 | + var gg = getApp().get_b_now(); | |
1607 | + if (this.data.is_b_now == 0 || gg.prom_type == 5) { | |
1608 | + var arr = this.data.order_prom_list_cart; | |
1609 | + var t_pk_item = null; | |
1610 | + for (var ii in arr) { | |
1611 | + var ep = arr[ii]; | |
1612 | + if (pickid == ep.pickup_id) { | |
1613 | + t_pk_item = ep; | |
1614 | + break; | |
1615 | + } | |
1616 | + } | |
1617 | + //--寻找券指定的商品-- | |
1618 | + var gd = null; | |
1619 | + if (t_pk_item) { | |
1620 | + var goods = t_pk_item.goods; | |
1621 | + for (var gid in goods) { | |
1622 | + if (quan_item.UseObjectID == goods[gid].erpwareid) { | |
1623 | + gd = goods[gid]; | |
1624 | + } | |
1625 | + } | |
1626 | + } | |
1627 | + if (!gd) { | |
1628 | + getApp().my_warnning("未找到指定商品使用", 0, this, 600); | |
1629 | + return false; | |
1630 | + } | |
1631 | + //计算价格,如果有平摊的实收要计算实收的金额 | |
1632 | + var item_price = gd.goods_price * gd.goods_num; | |
1633 | + //-- 如果有平摊下去,有实收价格的时候,就要用account_fir来计算价格 -- | |
1634 | + if (gd.account_fir != null && gd.account_fir != undefined) { | |
1635 | + item_price = gd.account_fir * gd.goods_num; | |
1636 | + } | |
1637 | + | |
1638 | + if (item_price < parseFloat(quan_item.BuySum)) { | |
1639 | + getApp().my_warnning("该单品金额没有大于等于" + quan_item.BuySum + "元时不能使用优惠券", 0, this, 600); | |
1640 | + return false; | |
1641 | + } | |
1642 | + } | |
1643 | + } | |
1644 | + | |
1645 | + var no_use = e.currentTarget.dataset.no, quanlist = this.data.selected_quan_list; | |
1646 | + //---所有的券的显示红色选择都清理一遍--- | |
1647 | + for (var i in quanlist) { | |
1648 | + quanlist[i].show_red = 0; | |
1649 | + } | |
1650 | + this.setData({ selected_quan_list: quanlist }); | |
1651 | + var by_quanlist = this.data.get_by_quan_list; | |
1652 | + if (by_quanlist) { | |
1653 | + //---所有的券的显示红色选择都清理一遍--- | |
1654 | + for (var inb in by_quanlist) { | |
1655 | + by_quanlist[inb].show_red = 0; | |
1656 | + } | |
1657 | + this.setData({ get_by_quan_list: by_quanlist }); | |
1658 | + } | |
1659 | + | |
1660 | + var by_cart_list = this.data.by_quan_list_cart; | |
1661 | + if (by_cart_list) { | |
1662 | + //---所有的券的显示红色选择都清理一遍--- | |
1663 | + for (var inc in by_cart_list) { | |
1664 | + by_cart_list[inc].show_red = 0; | |
1665 | + } | |
1666 | + this.setData({ by_quan_list_cart: by_cart_list }); | |
1667 | + } | |
1668 | + | |
1669 | + var using_quan = this.data.using_quan; | |
1670 | + var th = this; | |
1671 | + //---如果是不使用优惠券--- | |
1672 | + if (no_use == 1) { | |
1673 | + console.log("有进来吗券", no_use); | |
1674 | + if (using_quan[th.data.selected_quan_pick]) { | |
1675 | + using_quan[th.data.selected_quan_pick].is_nouse_red = 1; | |
1676 | + } | |
1677 | + else { | |
1678 | + using_quan[th.data.selected_quan_pick] = { is_nouse_red: 1 }; | |
1679 | + } | |
1680 | + this.setData({ using_quan: using_quan, is_coupon: th.is_coupon }); | |
1681 | + return; | |
1682 | + } | |
1683 | + | |
1684 | + | |
1685 | + var txt = "selected_quan_list[" + ind + "].show_red"; | |
1686 | + var obj = {}; | |
1687 | + obj[txt] = 1; | |
1688 | + if (quan_item.show_red) { | |
1689 | + obj[txt] = 0; | |
1690 | + } | |
1691 | + this.setData(obj); | |
1692 | + console.log(this.data.selected_quan_list, "选中的券的下标", quan_item, "数据都在这里", txt); | |
1693 | + if (using_quan[th.data.selected_quan_pick]) { | |
1694 | + using_quan[th.data.selected_quan_pick].is_nouse_red = 0; | |
1695 | + } | |
1696 | + else { | |
1697 | + using_quan[th.data.selected_quan_pick] = { is_nouse_red: 0 }; | |
1698 | + } | |
1699 | + this.setData({ using_quan: using_quan }); | |
1700 | + | |
1701 | + }, | |
1702 | + | |
1703 | + /*----- 点击选择包邮券 -----*/ | |
1704 | + sele_quan_item_by: function (e) { | |
1705 | + var no_use = e.currentTarget.dataset.no; | |
1706 | + //立即购买的包邮券 | |
1707 | + var by_quanlist = this.data.get_by_quan_list; | |
1708 | + if (by_quanlist) { | |
1709 | + //---所有的券的显示红色选择都清理一遍--- | |
1710 | + for (var ind in by_quanlist) { | |
1711 | + by_quanlist[ind].show_red = 0; | |
1712 | + } | |
1713 | + this.setData({ get_by_quan_list: by_quanlist }); | |
1714 | + } | |
1715 | + | |
1716 | + //普通券 | |
1717 | + var quanlist = this.data.selected_quan_list; | |
1718 | + if (quanlist) { | |
1719 | + //---所有的券的显示红色选择都清理一遍--- | |
1720 | + for (var ind in quanlist) { | |
1721 | + quanlist[ind].show_red = 0; | |
1722 | + } | |
1723 | + this.setData({ selected_quan_list: quanlist }); | |
1724 | + } | |
1725 | + | |
1726 | + var th = this; | |
1727 | + var using_quan = this.data.using_quan; | |
1728 | + //---如果是不使用优惠券--- | |
1729 | + if (no_use == 1) { | |
1730 | + if (using_quan[th.data.selected_quan_pick]) { | |
1731 | + using_quan[th.data.selected_quan_pick].is_nouse_red = 1; | |
1732 | + } | |
1733 | + else { | |
1734 | + using_quan[th.data.selected_quan_pick] = { is_nouse_red: 1 }; | |
1735 | + } | |
1736 | + this.setData({ using_quan: using_quan, is_coupon: th.is_coupon }); | |
1737 | + return; | |
1738 | + } | |
1739 | + | |
1740 | + var pickid = th.data.selected_quan_pick; //现在选择的是哪一个门店 | |
1741 | + var ind = e.currentTarget.dataset.ind; | |
1742 | + //--如果是立即购买的部分-- | |
1743 | + var txt = ""; | |
1744 | + var txt1 = ""; | |
1745 | + var quan_item = null; | |
1746 | + | |
1747 | + quan_item = this.data.get_by_quan_list[ind]; | |
1748 | + txt = "get_by_quan_list[" + ind + "].show_red"; | |
1749 | + var obj = {}; | |
1750 | + obj[txt] = 1; | |
1751 | + this.setData(obj); | |
1752 | + | |
1753 | + | |
1754 | + if (using_quan[th.data.selected_quan_pick]) { | |
1755 | + using_quan[th.data.selected_quan_pick].is_nouse_red = 0; | |
1756 | + } | |
1757 | + else { | |
1758 | + using_quan[th.data.selected_quan_pick] = { is_nouse_red: 0 }; | |
1759 | + } | |
1760 | + this.setData({ using_quan: using_quan }); | |
1761 | + }, | |
1762 | + | |
1763 | + //--确认使用券--- | |
1764 | + confirm_quan: function () { | |
1765 | + var using_quan = this.data.using_quan; //正在使用中的券列表 | |
1766 | + var pickid = this.data.selected_quan_pick; //选中的门店ID | |
1767 | + var th = this; | |
1768 | + var selected_quan_list = this.data.selected_quan_list; //选择了那个门店的券列表 | |
1769 | + var get_by_quan_list = this.data.get_by_quan_list; //立即购买的包邮券列表 | |
1770 | + var by_quan_list_cart = this.data.by_quan_list_cart; //购物车购买的包邮券列表 | |
1771 | + //选择了的券 | |
1772 | + var sele_quan = null; | |
1773 | + | |
1774 | + //循环普通的券 | |
1775 | + for (var i in selected_quan_list) { | |
1776 | + var item = selected_quan_list[i]; | |
1777 | + if (item.show_red) { | |
1778 | + th.insert_into_using_quan(item, using_quan, pickid); | |
1779 | + return; | |
1780 | + } | |
1781 | + } | |
1782 | + //循环包邮的券,立即购买的 | |
1783 | + for (var i in get_by_quan_list) { | |
1784 | + var item = get_by_quan_list[i]; | |
1785 | + if (item.show_red) { | |
1786 | + if (th.data.is_no_by[pickid] == 1) { | |
1787 | + getApp().my_warnning("已全场不能包邮,不能选择包邮券", 0, th); | |
1788 | + return false; | |
1789 | + } | |
1790 | + if (th.data.is_by[pickid] == 1) { | |
1791 | + getApp().my_warnning("已全场包邮,不能选择包邮券", 0, th); | |
1792 | + return false; | |
1793 | + } | |
1794 | + | |
1795 | + th.insert_into_using_quan(item, using_quan, pickid, 1); | |
1796 | + return; | |
1797 | + } | |
1798 | + } | |
1799 | + | |
1800 | + //循环包邮的券 | |
1801 | + for (var i in by_quan_list_cart) { | |
1802 | + var item = by_quan_list_cart[i]; | |
1803 | + if (item.show_red) { | |
1804 | + if (th.data.is_no_by[pickid] == 1) { | |
1805 | + getApp().my_warnning("已全场不能包邮,不能选择包邮券", 0, th); | |
1806 | + return false; | |
1807 | + } | |
1808 | + if (th.data.is_by[pickid] == 1) { | |
1809 | + getApp().my_warnning("已全场包邮,不能选择包邮券", 0, th); | |
1810 | + return false; | |
1811 | + } | |
1812 | + th.insert_into_using_quan(item, using_quan, pickid, 1); | |
1813 | + return; | |
1814 | + } | |
1815 | + } | |
1816 | + | |
1817 | + //选择了的券,看是不是点击了不使用券,点击了不使用优惠券 | |
1818 | + if (using_quan[pickid]) { | |
1819 | + if (using_quan[pickid].is_nouse_red == 1) { | |
1820 | + using_quan[pickid] = { is_nouse_red: 1 }; | |
1821 | + th.setData({ using_quan: using_quan }); | |
1822 | + th.calculatePrice2(); | |
1823 | + th.setData({ open_quan: 0 }); | |
1824 | + return; | |
1825 | + } | |
1826 | + } | |
1827 | + }, | |
1828 | + | |
1829 | + //----把券插入之后的操作,同时还要重新计算价格---- | |
1830 | + insert_into_using_quan: async function (item, using_quan, pickid, isby) { | |
1831 | + | |
1832 | + | |
1833 | + var th = this; | |
1834 | + var old_quan = null; | |
1835 | + if (isby == 1) { | |
1836 | + using_quan[pickid] = { | |
1837 | + coupon_no: item.no, | |
1838 | + money: 0, | |
1839 | + is_nouse_red: 0, | |
1840 | + region_list: item.region_list, | |
1841 | + goods_list: item.goods_list | |
1842 | + }; | |
1843 | + using_quan[pickid].isby = 1; | |
1844 | + } else { | |
1845 | + if (using_quan[pickid]) old_quan = using_quan[pickid]; | |
1846 | + using_quan[pickid] = { coupon_no: item.CashRepNo, money: item.Sum, is_nouse_red: 0 }; | |
1847 | + using_quan[pickid].isby = 0; | |
1848 | + } | |
1849 | + this.setData({ using_quan: using_quan }); | |
1850 | + | |
1851 | + th.calculatePrice2(function () { | |
1852 | + | |
1853 | + if (old_quan) using_quan[pickid] = old_quan; | |
1854 | + else using_quan[pickid] = null; | |
1855 | + th.setData({ using_quan: using_quan, submit: 0 }); | |
1856 | + wx.showToast({ | |
1857 | + title: "不能使用优惠券,同城起送价不足", | |
1858 | + icon: 'none', | |
1859 | + duration: 2000 | |
1860 | + }) | |
1861 | + | |
1862 | + }); | |
1863 | + | |
1864 | + th.setData({ open_quan: 0 }); | |
1865 | + }, | |
1866 | + | |
1867 | + | |
1868 | + | |
1343 | 1869 | |
1344 | 1870 | }) |
1345 | 1871 | \ No newline at end of file | ... | ... |
packageE/pages/cart/cart_wk/cart_wk.wxml
1 | 1 | <wxs module="filters" src="../../../../utils/filter.wxs"></wxs> |
2 | +<wxs module="filter" src="../cart2/c_filter.wxs"></wxs> | |
2 | 3 | |
3 | 4 | <!-- 先选择配送方式,2021.7修改 --> |
4 | 5 | <block wx:if="{{show_submit}}"> |
... | ... | @@ -67,6 +68,23 @@ |
67 | 68 | |
68 | 69 | </view> |
69 | 70 | |
71 | + | |
72 | +<view class="xc-coupon-frame flex-center" data-bn="1" bindtap="open_coupon_list" data-pickid="{{bn_pick}}" hidden="{{(selected_quan_list?selected_quan_list.length:0)+ (get_by_quan_list && exp_type==0?get_by_quan_list.length:0)<=0}}" wx:if="{{(selected_quan_list && selected_quan_list.length>0) || (get_by_quan_list!=null && exp_type==0 )}}"> | |
73 | + <view class="work-frame flex-space-between"> | |
74 | + <view class="work"> | |
75 | + 优惠券 <text class="quan_num_show">{{(selected_quan_list?selected_quan_list.length:0)+ (get_by_quan_list && exp_type==0?get_by_quan_list.length:0)}}张可用</text> | |
76 | + </view> | |
77 | + <view class="xc-right-frame"> | |
78 | + <text wx:if="{{using_quan[bn_pick].is_nouse}}">不使用</text> | |
79 | + <block wx:else> | |
80 | + <text wx:if="{{using_quan[bn_pick].money}}">¥{{using_quan[bn_pick].money}}元优惠券</text> | |
81 | + <text wx:if="{{using_quan[bn_pick].isby}}">包邮券</text> | |
82 | + </block> | |
83 | + <view class="xc-right"></view> | |
84 | + </view> | |
85 | + </view> | |
86 | +</view> | |
87 | + | |
70 | 88 | <view class="use-item bdr_b-14 jc_sb" wx:if='{{exp_type==0 && !is_default_logistics}}'> |
71 | 89 | <view>选择物流:</view> |
72 | 90 | <view class="flex-vertical" bindtap="show_wu_arr" data-txt='index' style="margin-right: 8rpx;"> |
... | ... | @@ -103,6 +121,14 @@ |
103 | 121 | <text class='redwz'>¥{{order.tail_money}}</text> |
104 | 122 | </view> |
105 | 123 | </view> |
124 | + | |
125 | + <view class='ct_one jc_sb' wx:if="{{formData.coupon_price>0}}"> | |
126 | + <view class='ct_one_left'>使用优惠券</view> | |
127 | + <view class='ct_one_right'> | |
128 | + <text class='redwz'>- ¥ {{formData.coupon_price}}元</text> | |
129 | + </view> | |
130 | + </view> | |
131 | + | |
106 | 132 | <view class='ct_one jc_sb' wx:if="{{exp_price>0}}"> |
107 | 133 | <view class='ct_one_left'>配送费用</view> |
108 | 134 | <view class='ct_one_right'> |
... | ... | @@ -134,7 +160,7 @@ |
134 | 160 | <text class='zf_left_wz'>支付合计:</text> |
135 | 161 | <text class='zf_left_red'>¥{{filters.toFix(order.tail_money+exp_price,2)}}</text> |
136 | 162 | </view> --> |
137 | - <view class='zf_left'>支付合计:<text class='zf_left_red'>¥{{filters.toFix(order.tail_money+exp_price-(bn_use_commission?goods.use_commission:0)-(formData.order_prom_amount?formData.order_prom_amount:0) ,2)}}</text></view> | |
163 | + <view class='zf_left'>支付合计:<text class='zf_left_red'>¥{{filters.toFix(order.tail_money+exp_price-formData.coupon_price-(bn_use_commission?goods.use_commission:0)-(formData.order_prom_amount?formData.order_prom_amount:0) ,2)}}</text></view> | |
138 | 164 | <view class="zf_btn {{(submit || !same_ok)?'gray':''}}" bindtap="to_pay">支付尾款</view> |
139 | 165 | </view> |
140 | 166 | |
... | ... | @@ -201,3 +227,121 @@ |
201 | 227 | </view> |
202 | 228 | <view style="height: 50rpx"></view> |
203 | 229 | |
230 | +<!-- 使用券列表的弹窗 --> | |
231 | +<view wx:if='{{open_quan==1}}'> | |
232 | + <view class="cover-layer flex-center " bindtap='close_coupon'> </view> | |
233 | + <view class="cx-popup {{open_quan==true?'up' : 'down'}}"> | |
234 | + <!-- 最上面 --> | |
235 | + <view class="top flex"> | |
236 | + <view class="xc-top-content t-c"> | |
237 | + <view class="xc-title">优惠券使用</view> | |
238 | + </view> | |
239 | + <view class="xc-close-frame" bindtap='close_coupon'> | |
240 | + <view class="xc-close">×</view> | |
241 | + </view> | |
242 | + </view> | |
243 | + <!-- 使用优惠券和不使用优惠券层--> | |
244 | + <view class="may_use_coupon fs28 flex"> 可使用的优惠券 | |
245 | + <view class=" is_use_coupon flex-vertical" bindtap="sele_quan_item" data-no="1">不使用优惠券 | |
246 | + <block wx:if="{{using_quan[selected_quan_pick].is_nouse_red}}"> | |
247 | + <view class="circle white xc-hooka fs20 red-b sn"><text>Γ</text></view> | |
248 | + </block> | |
249 | + <block wx:else> | |
250 | + <view class="circle xc-hookst ons"></view> | |
251 | + </block> | |
252 | + </view> | |
253 | + </view> | |
254 | + | |
255 | + <!-- 中间券内容显示 --> | |
256 | + <view class="xc-frame flex-level"> | |
257 | + <view class="list-frame"> | |
258 | + <view wx:for="{{selected_quan_list}}" bindtap="sele_quan_item" wx:if="{{!item.is_using}}" data-ind="{{q_index}}" wx:for-item="item" wx:for-index="q_index"> | |
259 | + <view class="xc-coupon-frame flex-center" data-ind="{{q_index}}"> | |
260 | + <view class="coupon-frame flex rel"> | |
261 | + <!-- 锯齿 --> | |
262 | + <include src="../cart2/juchi_part.wxml" /> | |
263 | + <!-- 左边 --> | |
264 | + <view class="coupon-left rel {{filter.setcolor(item.UseObjectType)}} flex-center"> | |
265 | + <view class="white xc-money-frames"> | |
266 | + <view class="f_text"><text class="xc-rmb-symbol">¥</text><text class="xc-rmb-val">{{item.Sum}}</text></view> | |
267 | + <view class="coupon-explain t-c" wx:if="{{item.BuySum>0}}">满{{item.BuySum}}元可用</view> | |
268 | + <view class="coupon-explain t-c" wx:else>满0元可用</view> | |
269 | + </view> | |
270 | + </view> | |
271 | + <!-- 右边 --> | |
272 | + <view class="coupon-right flex-center rel"> | |
273 | + <view class="coupon-annotation flex"> | |
274 | + <view class="flex top-frame"> | |
275 | + <view class="frame"> | |
276 | + <view class="coupon-wode ib flex ellipsis-2 "> | |
277 | + <text class="xc-brand t-c ib white {{filter.setcolor(item.UseObjectType)}}">{{filter.get_type_card(item.UseObjectType)}}</text> | |
278 | + <block>{{item.Sum}}元优惠券</block> | |
279 | + </view> | |
280 | + <view class="coupon-time">{{filters.replace_time2(item.BeginDate)}}至{{item.ValidDate?filters.replace_time2(item.ValidDate):'不限'}}</view> | |
281 | + </view> | |
282 | + </view> | |
283 | + <block wx:if="{{item.show_red}}"> | |
284 | + <view class="circle white xc-hook fs20 red-b sn"><text>Γ</text></view> | |
285 | + </block> | |
286 | + <block wx:else> | |
287 | + <view class="circle xc-hooks on"></view> | |
288 | + </block> | |
289 | + </view> | |
290 | + <include src="../cart2/remark_click_part.wxml" /> | |
291 | + </view> | |
292 | + </view> | |
293 | + </view> | |
294 | + <!-- 打开是说明 --> | |
295 | + <include src="../cart2/remark_part.wxml" /> | |
296 | + </view> | |
297 | + <!-- 包邮券的显示,立即购买 --> | |
298 | + <block wx:if="{{get_by_quan_list && get_by_quan_list.length}}"> | |
299 | + <view wx:for="{{get_by_quan_list}}" bindtap="sele_quan_item_by" wx:if="{{!item.is_using}}" data-ind="{{byq_index}}" wx:for-item="item" wx:for-index="byq_index"> | |
300 | + <view class="xc-coupon-frame flex-center" data-ind="{{byq_index}}"> | |
301 | + <view class="coupon-frame flex rel"> | |
302 | + <!-- 锯齿 --> | |
303 | + <include src="../cart2/juchi_part.wxml" /> | |
304 | + <!-- 左边 --> | |
305 | + <view class="coupon-left rel {{filter.setcolor(item.UseObjectType)}} flex-center"> | |
306 | + <view class="white xc-money-frames"> | |
307 | + <view class="f_text"><text class="xc-rmb-val">包邮券</text></view> | |
308 | + <view class="coupon-explain t-c" wx:if="{{item.condition>0}}">满{{item.condition}}元可用</view> | |
309 | + <view class="coupon-explain t-c" wx:else>满0元可用</view> | |
310 | + </view> | |
311 | + </view> | |
312 | + <!-- 右边 --> | |
313 | + <view class="coupon-right flex-center rel"> | |
314 | + <view class="coupon-annotation flex"> | |
315 | + <view class="flex top-frame"> | |
316 | + <view class="frame"> | |
317 | + <view class="coupon-wode ib flex ellipsis-2 "> | |
318 | + <text class="xc-brand t-c ib white {{filter.setcolor(item.UseObjectType)}}">{{filter.get_type_card(0)}}</text> | |
319 | + <block>包邮券</block> | |
320 | + </view> | |
321 | + <view class="coupon-time">{{filters.format_time(item.use_start_time)}}至{{item.use_end_time?filters.format_time(item.use_end_time):'不限'}}</view> | |
322 | + </view> | |
323 | + </view> | |
324 | + <block wx:if="{{item.show_red}}"> | |
325 | + <view class="circle white xc-hook fs20 red-b sn"><text>Γ</text></view> | |
326 | + </block> | |
327 | + <block wx:else> | |
328 | + <view class="circle xc-hooks on"></view> | |
329 | + </block> | |
330 | + </view> | |
331 | + <include src="../cart2/remark_click_part2.wxml" /> | |
332 | + </view> | |
333 | + </view> | |
334 | + </view> | |
335 | + <!-- 打开是说明 --> | |
336 | + <include src="../cart2/remark_part.wxml" /> | |
337 | + </view> | |
338 | + </block> | |
339 | + | |
340 | + </view> | |
341 | + </view> | |
342 | + <!-- 最底下确定层--> | |
343 | + <view class="determine-frame"> | |
344 | + <view class="xc-confirm flex-center" bindtap="confirm_quan"> 确定 </view> | |
345 | + </view> | |
346 | + </view> | |
347 | +</view> | ... | ... |
packageE/pages/cart/cart_wk/cart_wk.wxss
packageE/pages/user/monthgiftbag/giftpackbuy/giftpackbuy.wxss
packageE/pages/user/monthgiftbag/giftpacklist/giftpacklist.js
packageE/pages/user/monthgiftbag/giftpacklist/giftpacklist.wxml
... | ... | @@ -152,7 +152,34 @@ |
152 | 152 | <view class="foot_empty data-v-3a5b7e36"></view> |
153 | 153 | |
154 | 154 | <block wx:if="{{flag != 1}}"> |
155 | - <block wx:if="{{isBuy==0 && giftTitle}}"> | |
155 | + | |
156 | + <!-- 已经领取过的orderSn是有值的 --> | |
157 | + <block wx:if="{{isBuy==0 && orderSn}}"> | |
158 | + <view class="foot_button data-v-3a5b7e36"> | |
159 | + <block wx:if="{{is_lb!=1}}"> | |
160 | + <view class="foot_button_buy data-v-3a5b7e36 overdue"> | |
161 | + <text class="data-v-3a5b7e36">无核销商品</text> | |
162 | + </view> | |
163 | + </block> | |
164 | + <block wx:else> | |
165 | + <view wx:if="{{c_state==-1}}" class="foot_button_buy data-v-3a5b7e36 overdue" > | |
166 | + <text class="data-v-3a5b7e36">兑换未开始</text> | |
167 | + </view> | |
168 | + <view wx:if="{{c_state==0}}" class="foot_button_buy data-v-3a5b7e36" bindtap="getcode"> | |
169 | + <text class="data-v-3a5b7e36">立即使用</text> | |
170 | + </view> | |
171 | + <view wx:if="{{c_state==1}}" class="foot_button_buy data-v-3a5b7e36 overdue" bindtap="getcode"> | |
172 | + <text class="data-v-3a5b7e36">商品已核销</text> | |
173 | + </view> | |
174 | + <view wx:if="{{c_state==2}}" class="foot_button_buy data-v-3a5b7e36 overdue"> | |
175 | + <text class="data-v-3a5b7e36">商品兑换时间已过</text> | |
176 | + </view> | |
177 | + </block> | |
178 | + </view> | |
179 | + </block> | |
180 | + | |
181 | + <!-- 没有订单号,说明要进来领取 --> | |
182 | + <block wx:elif="{{isBuy==0 && giftTitle}}"> | |
156 | 183 | <block wx:if="{{isStart==1}}"> |
157 | 184 | <view class="foot_button data-v-3a5b7e36"> |
158 | 185 | <!-- <block wx:if="{{giftPrice>0 && giftIntegral>0}}"> |
... | ... | @@ -192,29 +219,9 @@ |
192 | 219 | </block> --> |
193 | 220 | |
194 | 221 | </block> |
195 | - <block wx:if="{{isBuy==0 && orderSn}}"> | |
196 | - <view class="foot_button data-v-3a5b7e36"> | |
197 | - <block wx:if="{{is_lb!=1}}"> | |
198 | - <view class="foot_button_buy data-v-3a5b7e36 overdue"> | |
199 | - <text class="data-v-3a5b7e36">无核销商品</text> | |
200 | - </view> | |
201 | - </block> | |
202 | - <block wx:else> | |
203 | - <view wx:if="{{c_state==-1}}" class="foot_button_buy data-v-3a5b7e36 overdue" > | |
204 | - <text class="data-v-3a5b7e36">兑换未开始</text> | |
205 | - </view> | |
206 | - <view wx:if="{{c_state==0}}" class="foot_button_buy data-v-3a5b7e36" bindtap="getcode"> | |
207 | - <text class="data-v-3a5b7e36">立即使用</text> | |
208 | - </view> | |
209 | - <view wx:if="{{c_state==1}}" class="foot_button_buy data-v-3a5b7e36 overdue" bindtap="getcode"> | |
210 | - <text class="data-v-3a5b7e36">商品已核销</text> | |
211 | - </view> | |
212 | - <view wx:if="{{c_state==2}}" class="foot_button_buy data-v-3a5b7e36 overdue"> | |
213 | - <text class="data-v-3a5b7e36">商品兑换时间已过</text> | |
214 | - </view> | |
215 | - </block> | |
216 | - </view> | |
217 | - </block> | |
222 | + | |
223 | + | |
224 | + | |
218 | 225 | </block> |
219 | 226 | |
220 | 227 | </view> | ... | ... |
packageE/pages/user/monthgiftbag/monthgiftbag.js
... | ... | @@ -3,9 +3,11 @@ var e = getApp(), |
3 | 3 | a = e.globalData.setting, |
4 | 4 | os = a, |
5 | 5 | t = e.request, |
6 | - d = e.globalData; | |
6 | + d = e.globalData,ut=i; | |
7 | + | |
7 | 8 | Page({ |
8 | 9 | data: { |
10 | + url: a.url, //接口网址 | |
9 | 11 | iurl: a.imghost, //图片前缀网址 |
10 | 12 | getDate: "", |
11 | 13 | getStorageID: '', |
... | ... | @@ -118,7 +120,8 @@ Page({ |
118 | 120 | user_id: th.data.getUserID, //用户ID |
119 | 121 | page: th.data.curpage, |
120 | 122 | pageSize: th.data.pageSize, |
121 | - pay_state:1 | |
123 | + pay_state:1, | |
124 | + isdetail:1 | |
122 | 125 | }; |
123 | 126 | |
124 | 127 | if(this.data.sear_key){ |
... | ... | @@ -157,6 +160,44 @@ Page({ |
157 | 160 | |
158 | 161 | // arr2[j].virtualsales=arr2[j].virtualSales |
159 | 162 | // arr2[j].lbnum=arr2[j].lbNum |
163 | + | |
164 | + | |
165 | + | |
166 | + if(!arr2[j].receive_ordersn){ | |
167 | + arr2[j].is_no_rev=1; | |
168 | + } | |
169 | + | |
170 | + arr2[j].is_detail=0; | |
171 | + if(arr2[j].detaillist){ | |
172 | + arr2[j].is_detail=1; | |
173 | + }else{ | |
174 | + continue; | |
175 | + } | |
176 | + | |
177 | + | |
178 | + | |
179 | + arr2[j].lbType=0; | |
180 | + if(arr2[j].detaillist.iswarelbtype){ | |
181 | + arr2[j].lbType=1; | |
182 | + } | |
183 | + //---获取日期的时间戳--- | |
184 | + var t_endtime = arr2[j].detaillist.endTime; | |
185 | + t_endtime = t_endtime.replace(/-/g, '/'); | |
186 | + var t_date = new Date(t_endtime) / 1000; | |
187 | + var t_now = ut.gettimestamp(); | |
188 | + | |
189 | + var t_starttime = arr2[j].detaillist.starTime; | |
190 | + t_starttime = t_starttime.replace(/-/g, '/'); | |
191 | + var t_sdate = new Date(t_starttime) / 1000; | |
192 | + | |
193 | + arr2[j].c_state=0 | |
194 | + if (arr2[j].detaillist.goodsUseState) | |
195 | + arr2[j].c_state=1 | |
196 | + else if (t_date <= t_now) | |
197 | + arr2[j].c_state=2 | |
198 | + else if (t_sdate > t_now) | |
199 | + arr2[j].c_state=-1 | |
200 | + | |
160 | 201 | } |
161 | 202 | |
162 | 203 | |
... | ... | @@ -260,7 +301,101 @@ Page({ |
260 | 301 | input_sear(e){ |
261 | 302 | let value = e.detail; |
262 | 303 | this.data.sear_key=value; |
263 | - } | |
304 | + }, | |
305 | + | |
306 | + //-- 获取核销码 --- | |
307 | + getcode: function (e) { | |
308 | + var th = this; | |
309 | + let codeId = e.currentTarget.dataset.codeid; | |
310 | + let orderSn = e.currentTarget.dataset.ordersn; | |
311 | + var json = { | |
312 | + "storeId": a.stoid, | |
313 | + "orderSn": orderSn, | |
314 | + } | |
315 | + if (codeId && codeId !== "") { | |
316 | + json.id = codeId | |
317 | + } | |
318 | + var data = JSON.stringify(json); | |
319 | + var url = th.data.url + "/api/weshop/marketing/gift/goods/verify/code/get"; //预约接口地址 | |
320 | + getApp().request.json_post(url, json, | |
321 | + function (res) { | |
322 | + if (res.data.code == 0) { | |
323 | + th.setData({ | |
324 | + code: res.data.data | |
325 | + }) | |
326 | + th.code_show(); | |
327 | + } else { | |
328 | + getApp().my_warnning(res.data.msg, 0, th); | |
329 | + } | |
330 | + }, | |
331 | + function (res) { | |
332 | + | |
333 | + }, | |
334 | + "put" | |
335 | + ) | |
336 | + }, | |
337 | + | |
338 | + //显示核销码 | |
339 | + code_show: function (e) { | |
340 | + var th = this; | |
341 | + //--获取成功的时候-- | |
342 | + var no = th.data.code; | |
343 | + var qc_com = th.selectComponent("#qc_com"); //组件的id | |
344 | + var obj = { | |
345 | + val: no, | |
346 | + content: "请将二维码展示给核销员,收货更快捷" | |
347 | + }; | |
348 | + qc_com.open(obj) | |
349 | + }, | |
350 | + | |
351 | + getGift(e){ | |
352 | + var that=this; | |
353 | + if (that.data.islogin) { | |
354 | + return | |
355 | + } | |
356 | + that.setData({ | |
357 | + islogin:true | |
358 | + }) | |
359 | + | |
360 | + var record_list_id=e.currentTarget.dataset.record_list_id; | |
361 | + var index=e.currentTarget.dataset.index; | |
362 | + | |
363 | + var json = { | |
364 | + "id":record_list_id,// "记录Id", | |
365 | + "storeId": that.data.getStorageID, //商家Id | |
366 | + "userId": that.data.getUserID, //用户ID | |
367 | + }; | |
368 | + // var url ="/api/weshop/marketing/buy/receive/gift/record/insert"; | |
369 | + // var url ="/api/weshop/marketing/marketingMonthgiftbagRecord/createOrder"; | |
370 | + var url ="/api/weshop/marketing/marketingMonthgiftbagRecord/recordReceive"; | |
371 | + getApp().request.json_post(url, json, | |
372 | + function (res) { | |
373 | + console.log('领取礼包'); | |
374 | + console.log(res); | |
375 | + if (res.data.code == 0 && res.data.data) { | |
376 | + | |
377 | + var txt="wareCard["+index+"]is_receive"; | |
378 | + that.setData({ | |
379 | + [txt]:1 | |
380 | + }) | |
381 | + getApp().my_warnning("领取成功!", 1, that); | |
382 | + | |
383 | + } else { | |
384 | + that.setData({submit:0}) | |
385 | + getApp().my_warnning(res.data.msg, 0, that); | |
386 | + } | |
387 | + that.setData({ | |
388 | + islogin:false | |
389 | + }) | |
390 | + }, | |
391 | + function (res) { | |
392 | + that.setData({submit:0}) | |
393 | + } | |
394 | + ) | |
395 | + }, | |
396 | + | |
397 | + | |
398 | + | |
264 | 399 | |
265 | 400 | |
266 | 401 | }); |
267 | 402 | \ No newline at end of file | ... | ... |
packageE/pages/user/monthgiftbag/monthgiftbag.json
... | ... | @@ -4,6 +4,7 @@ |
4 | 4 | "usingComponents": { |
5 | 5 | "warn": "/components/long_warn/long_warn", |
6 | 6 | "my_confirm": "/components/my_confirm/my_confirm", |
7 | - "lb_sear": "/components/lb_sear/lb_sear" | |
7 | + "lb_sear": "/components/lb_sear/lb_sear", | |
8 | + "qr_code": "/components/qr_code/qr_code" | |
8 | 9 | } |
9 | 10 | } |
10 | 11 | \ No newline at end of file | ... | ... |
packageE/pages/user/monthgiftbag/monthgiftbag.wxml
... | ... | @@ -103,9 +103,40 @@ |
103 | 103 | |
104 | 104 | </view> |
105 | 105 | </view> |
106 | - <view wx:if="{{item.is_back !=1}}" class="content_box_button" bindtap="navigateTo" data-url="/packageE/pages/user/monthgiftbag/giftpacklist/giftpacklist?isBuy=0&lbId={{item.lbId}}&cover_img={{item.cover_img}}&orderSn={{item.receive_ordersn}}&record_list_id={{item.record_list_id}}&is_receive={{item.is_receive}}"> | |
107 | - <button wx:if="{{item.receive_ordersn}}">立即使用</button> | |
108 | - <button wx:else>立即领取</button> | |
106 | + <view wx:if="{{item.is_back !=1}}" class="content_box_button" bindtap="navigateTo" | |
107 | + data-url="/packageE/pages/user/monthgiftbag/giftpacklist/giftpacklist?isBuy=0&lbId={{item.lbId}}&cover_img={{item.cover_img}}&orderSn={{item.receive_ordersn}}&record_list_id={{item.record_list_id}}&is_receive={{item.is_receive}}"> | |
108 | + | |
109 | + <button wx:if="{{item.is_detail || item.is_no_rev}}" class="white" style="margin-right:10rpx">查看详情</button> | |
110 | + <button wx:else class="white">查看详情</button> | |
111 | + | |
112 | + | |
113 | + <!-- 已经领取过的,有单号 --> | |
114 | + <block wx:if="{{item.receive_ordersn}}"> | |
115 | + | |
116 | + <block wx:if="{{item.is_detail}}"> | |
117 | + <block wx:if="{{item.lbType==1}}" > | |
118 | + <button wx:if="{{item.c_state==-1}}" class="overdue">兑换未开始</button> | |
119 | + <button wx:if="{{item.c_state==0}}" data-ordersn="{{item.receive_ordersn}}" catchtap="getcode">立即使用</button> | |
120 | + <button wx:if="{{item.c_state==1}}" data-ordersn="{{item.receive_ordersn}}" catchtap="getcode" class="overdue">商品已核销</button> | |
121 | + <button wx:if="{{item.c_state==2}}" class="overdue">商品兑换时间已过</button> | |
122 | + </block> | |
123 | + | |
124 | + <block wx:else> | |
125 | + <button class="overdue">无核销商品</button> | |
126 | + </block> | |
127 | + </block> | |
128 | + </block> | |
129 | + <!-- 点击领取后的动画效果--> | |
130 | + <block wx:elif="{{item.is_receive}}"> | |
131 | + <button class="overdue">已领取</button> | |
132 | + </block> | |
133 | + <!-- 未领取的 --> | |
134 | + <block wx:else> | |
135 | + <button catchtap="getGift" data-index="{{index}}" data-record_list_id="{{item.record_list_id}}" data-id="{{item.lbId}}" >立即领取</button> | |
136 | + </block> | |
137 | + | |
138 | + | |
139 | + | |
109 | 140 | </view> |
110 | 141 | <view class="content_box_button" style="color:#b9b5b5;" wx:else>已退款</view> |
111 | 142 | </view> |
... | ... | @@ -134,4 +165,6 @@ |
134 | 165 | </view> |
135 | 166 | <!-- 引入提示组件 --> |
136 | 167 | <warn id="warn"></warn> |
137 | -<my_confirm id="my_confirm"></my_confirm> | |
138 | 168 | \ No newline at end of file |
169 | +<my_confirm id="my_confirm"></my_confirm> | |
170 | +<!-- 弹出框扫描 --> | |
171 | +<qr_code id="qc_com"></qr_code> | |
139 | 172 | \ No newline at end of file | ... | ... |
packageE/pages/user/monthgiftbag/monthgiftbag.wxss
... | ... | @@ -184,8 +184,20 @@ |
184 | 184 | background: #d41c34; |
185 | 185 | color: #fff; |
186 | 186 | line-height: 50rpx; |
187 | + border-radius:10rpx; | |
188 | + border: none; | |
187 | 189 | } |
188 | 190 | |
191 | + | |
192 | + | |
193 | +.content_box_button button.white { | |
194 | + | |
195 | + background: #fff; | |
196 | + color: #666; | |
197 | + | |
198 | +} | |
199 | + | |
200 | + | |
189 | 201 | .foot_box { |
190 | 202 | -webkit-align-content: center; |
191 | 203 | align-content: center; |
... | ... | @@ -251,3 +263,12 @@ page { |
251 | 263 | .After_all .end { |
252 | 264 | margin: 0rpx 15rpx; |
253 | 265 | } |
266 | + | |
267 | + | |
268 | +.content_box_button button.overdue{ | |
269 | + background: rgb(153,153,153); | |
270 | +} | |
271 | + | |
272 | +.content_box_button button.overdue::after{ | |
273 | + border: none; | |
274 | +} | |
254 | 275 | \ No newline at end of file | ... | ... |
pages/goods/goodsInfo/buy_com_pop.wxml
... | ... | @@ -72,7 +72,7 @@ |
72 | 72 | <view class="xc-goods-attribute"> |
73 | 73 | <view hidden="{{ismend==1}}" class="spec-name">商品规格</view> |
74 | 74 | <view hidden="{{ismend==1}}" style="max-height: 120rpx;overflow-y: auto;"> |
75 | - <view class="spec_bt {{gid==item.goods_id?'act':''}}" bindtap="sele_spec" data-nor="1" | |
75 | + <view class="spec_bt {{sele_g.goods_id==item.goods_id?'act':''}}" bindtap="sele_spec" data-nor="1" | |
76 | 76 | data-gid='{{item.goods_id}}' wx:for="{{sku_g_pt}}" wx:key="sku_g"> |
77 | 77 | {{item.gg}} |
78 | 78 | </view> | ... | ... |
pages/goods/goodsInfo/buy_integral.wxml
... | ... | @@ -3,9 +3,9 @@ |
3 | 3 | <view class="pding"> |
4 | 4 | <icon bindtap="closeSpecModal_inte" class="modal-close" color="black" size="22" type="cancel"></icon> |
5 | 5 | <view class="spec-goods"> |
6 | - <image class="wh100 spec-img xc-distance-bottom" bindtap="previewImage" src="{{data.original_img}}" binderror="pop_err_img" data-errorimg="data.original_img"></image> | |
6 | + <image class="wh100 spec-img xc-distance-bottom" bindtap="previewImage" src="{{front_g.original_img}}" binderror="pop_err_img" data-errorimg="data.original_img"></image> | |
7 | 7 | <view class="spec-goods-info"> |
8 | - <view class="spec-goods-name ellipsis-2">{{data.goods_name}}</view> | |
8 | + <view class="spec-goods-name ellipsis-2">{{front_g.goods_name}}</view> | |
9 | 9 | <view class="flex ai_end xc-val-money"> |
10 | 10 | <view class="spec-goods-price"> |
11 | 11 | <text wx:if="{{prom_integral}}">{{prom_integral}}积分</text> |
... | ... | @@ -61,7 +61,7 @@ |
61 | 61 | <view class="xc-goods-attribute"> |
62 | 62 | <view hidden="{{ismend==1}}" class="spec-name">商品规格</view> |
63 | 63 | <view hidden="{{ismend==1}}" style="max-height: 120rpx;overflow-y: auto;"> |
64 | - <view class="spec_bt {{gid==item.goods_id?'act':''}}" bindtap="sele_spec" data-gid='{{item.goods_id}}' wx:for="{{sku_g}}" wx:key="sku_g"> | |
64 | + <view class="spec_bt {{sele_g.goods_id==item.goods_id?'act':''}}" bindtap="sele_spec" data-gid='{{item.goods_id}}' wx:for="{{sku_g}}" wx:key="sku_g"> | |
65 | 65 | {{item.gg}} |
66 | 66 | </view> |
67 | 67 | </view> |
... | ... | @@ -105,7 +105,7 @@ |
105 | 105 | <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">请先选择门店</view> |
106 | 106 | </block> |
107 | 107 | <block wx:else> |
108 | - <block wx:if="{{data.store_count<=0}}"> | |
108 | + <block wx:if="{{sele_g.store_count<=0}}"> | |
109 | 109 | <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view> |
110 | 110 | </block> |
111 | 111 | <block wx:else> | ... | ... |
pages/goods/goodsInfo/buy_pt.wxml
... | ... | @@ -85,7 +85,7 @@ |
85 | 85 | <view hidden="{{ismend==1}}" class="spec-name">商品规格</view> |
86 | 86 | <block wx:if="{{is_normal==0}}"> |
87 | 87 | <view hidden="{{ismend==1}}" class="flex"> |
88 | - <view class="spec_bt {{gid==item.goods_id?'act':''}}" bindtap="sele_spec" data-gid='{{item.goods_id}}' wx:for="{{sku_g}}" wx:key="sku_g">{{item.gg}} | |
88 | + <view class="spec_bt {{sele_g.goods_id==item.goods_id?'act':''}}" bindtap="sele_spec" data-gid='{{item.goods_id}}' wx:for="{{sku_g}}" wx:key="sku_g">{{item.gg}} | |
89 | 89 | </view> |
90 | 90 | </view> |
91 | 91 | </block> | ... | ... |
pages/goods/goodsInfo/goodsInfo.js
... | ... | @@ -151,10 +151,14 @@ Page({ |
151 | 151 | prom_type: 0, |
152 | 152 | prom_time_text: "", |
153 | 153 | prom_price: null, |
154 | + f_prom_price: null, //秒杀使用 | |
154 | 155 | prom_buy_limit: 0, |
155 | 156 | djs: null, |
156 | 157 | prom_st: 0, |
158 | + f_prom_st: 0, | |
157 | 159 | prom_r_null: 0, |
160 | + f_prom_r_null: 0, | |
161 | + | |
158 | 162 | prom_end_time: null, |
159 | 163 | prom_start_time: null, |
160 | 164 | prom_act: null, |
... | ... | @@ -285,6 +289,9 @@ Page({ |
285 | 289 | istop: 0, //是否置顶风格为1 |
286 | 290 | searchbox_transparent: 1, |
287 | 291 | template_id:[],//订阅消息id |
292 | + | |
293 | + fir_set_sto:1, //最初始的一下,获取门店 | |
294 | + front_pick:null, //在详情页面上显示的门店 | |
288 | 295 | }, |
289 | 296 | |
290 | 297 | //------初始化加载---------- |
... | ... | @@ -1020,6 +1027,10 @@ Page({ |
1020 | 1027 | var ee = this, |
1021 | 1028 | gid = this.data.gid, |
1022 | 1029 | i = getApp().request; |
1030 | + if(this.data.front_g){ | |
1031 | + gid = this.data.front_g.goods_id; | |
1032 | + } | |
1033 | + | |
1023 | 1034 | |
1024 | 1035 | this.wait_for_store_config(); |
1025 | 1036 | //先检验一下商品的活动情况 |
... | ... | @@ -1192,7 +1203,8 @@ Page({ |
1192 | 1203 | ee.setData({ |
1193 | 1204 | data: t.data.data, |
1194 | 1205 | sele_g: t.data.data, |
1195 | - userInfo: getApp().globalData.userInfo | |
1206 | + userInfo: getApp().globalData.userInfo, | |
1207 | + front_g: ut.deep_cp(t.data.data), | |
1196 | 1208 | }); |
1197 | 1209 | |
1198 | 1210 | //获取统一条形码,普通商品和优惠促销的商品 |
... | ... | @@ -1224,8 +1236,13 @@ Page({ |
1224 | 1236 | } |
1225 | 1237 | ee.data.g_buy_num = new Map(); |
1226 | 1238 | |
1239 | + | |
1240 | + //再返回的时候,prom_id要以f_prom_act为准 | |
1241 | + var c_prom_id=ee.data.data.prom_id; | |
1242 | + if(ee.data.f_prom_act) c_prom_id=ee.data.f_prom_act.id; | |
1243 | + | |
1227 | 1244 | //-- 增加相同的活动 -- |
1228 | - ee.check_prom(gid, ee.data.data.prom_type, ee.data.data.prom_id); | |
1245 | + ee.check_prom(gid, ee.data.data.prom_type, c_prom_id); | |
1229 | 1246 | |
1230 | 1247 | var th = ee; |
1231 | 1248 | if (ee.data.cat_name == '') { |
... | ... | @@ -1968,7 +1985,7 @@ Page({ |
1968 | 1985 | // }) |
1969 | 1986 | // } |
1970 | 1987 | //要包含积分购的普通购买0 3,5,7,10, is_integral_normal积分普通购买字段 |
1971 | - else if ([0, 3, 5, 7, 10].indexOf(th.data.prom_type) > -1 || newd.is_integral_normal) { | |
1988 | + else if ([0, 3, 5, 7, 10].indexOf(th.data.prom_type) > -1 || newd.is_integral_normal || newd.is_pd_normal) { | |
1972 | 1989 | newd.prom_type = 0; |
1973 | 1990 | newd.prom_id = 0; |
1974 | 1991 | |
... | ... | @@ -2019,6 +2036,7 @@ Page({ |
2019 | 2036 | return false; |
2020 | 2037 | //return s.my_warnning("库存不足!", 0, th); |
2021 | 2038 | } |
2039 | + | |
2022 | 2040 | th.add_cart_next(e, t, a, o, newd); //加入购物车下一步 |
2023 | 2041 | } |
2024 | 2042 | } |
... | ... | @@ -2272,6 +2290,7 @@ Page({ |
2272 | 2290 | openSpecModal_inte: 0, |
2273 | 2291 | openSpecModal_inte_normal: 0, |
2274 | 2292 | openSpecModal_pt: 0, |
2293 | + openSpecModal_flash_normal:0 | |
2275 | 2294 | }) |
2276 | 2295 | |
2277 | 2296 | if (e.prom_type == 4) { |
... | ... | @@ -2710,11 +2729,11 @@ Page({ |
2710 | 2729 | |
2711 | 2730 | closeSpecModal: function () { |
2712 | 2731 | if (this.data.openSpecModal_pt && this.data.is_normal) { |
2713 | - this.get_sto(); | |
2714 | 2732 | this.setData({ |
2715 | - sele_g: this.data.data, | |
2716 | - gid: this.data.data.goods_id | |
2733 | + sele_g: this.data.front_g, | |
2734 | + gid: this.data.front_g.goods_id | |
2717 | 2735 | }) |
2736 | + this.get_sto(); | |
2718 | 2737 | this.sele_spec_chech_activity(1); |
2719 | 2738 | } |
2720 | 2739 | |
... | ... | @@ -2738,6 +2757,8 @@ Page({ |
2738 | 2757 | return false; |
2739 | 2758 | } |
2740 | 2759 | |
2760 | + th.setData({def_pick_store: ut.deep_cp(th.data.front_pick)}); | |
2761 | + | |
2741 | 2762 | this.setData({ |
2742 | 2763 | store: 0, |
2743 | 2764 | choice_sort_store: 0, |
... | ... | @@ -2754,6 +2775,7 @@ Page({ |
2754 | 2775 | } |
2755 | 2776 | |
2756 | 2777 | var check_up = 0; |
2778 | + //-- 如果是当前商品的时候 -- | |
2757 | 2779 | if (th.data.more_flash) { |
2758 | 2780 | for (var i in th.data.more_flash) { |
2759 | 2781 | var item = th.data.more_flash[i]; |
... | ... | @@ -3383,7 +3405,7 @@ Page({ |
3383 | 3405 | return false; |
3384 | 3406 | } |
3385 | 3407 | |
3386 | - this.setData({sp_seleing:1}) | |
3408 | + this.setData({sp_seleing:1,more_flash:null}) | |
3387 | 3409 | |
3388 | 3410 | var that = this; |
3389 | 3411 | var th = this; |
... | ... | @@ -3466,8 +3488,9 @@ Page({ |
3466 | 3488 | item['disc'] = txt; |
3467 | 3489 | if (item) this.setData({ |
3468 | 3490 | sele_g: item, |
3469 | - gid: gid, | |
3470 | 3491 | data: item, |
3492 | + //gid: gid, //只去掉gid的更新 | |
3493 | + | |
3471 | 3494 | }); |
3472 | 3495 | |
3473 | 3496 | |
... | ... | @@ -3914,21 +3937,23 @@ Page({ |
3914 | 3937 | } |
3915 | 3938 | if(func) func(); |
3916 | 3939 | }else{ |
3917 | - | |
3918 | 3940 | if(func) func(); |
3919 | 3941 | th.setData({sp_seleing:0}) |
3920 | 3942 | wx.hideLoading(); |
3943 | + th.data.fir_set_sto=0; | |
3921 | 3944 | } |
3922 | 3945 | } else { |
3923 | 3946 | if(func) func(); |
3924 | 3947 | th.setData({sp_seleing:0}) |
3925 | 3948 | wx.hideLoading(); |
3949 | + th.data.fir_set_sto=0; | |
3926 | 3950 | } |
3927 | 3951 | },err=>{ |
3928 | 3952 | ut.m_toast('网络繁忙,请稍后重试'); |
3929 | 3953 | if(func) func(); |
3930 | 3954 | th.setData({sp_seleing:0}) |
3931 | 3955 | wx.hideLoading(); |
3956 | + th.data.fir_set_sto=0; | |
3932 | 3957 | }) |
3933 | 3958 | }, 200) |
3934 | 3959 | |
... | ... | @@ -4035,6 +4060,28 @@ Page({ |
4035 | 4060 | } |
4036 | 4061 | }, |
4037 | 4062 | |
4063 | + | |
4064 | + | |
4065 | + //处理首页的显示门店 | |
4066 | + deal_front_pk(){ | |
4067 | + var th=this; | |
4068 | + if(this.data.fir_set_sto==1){ | |
4069 | + this.data.fir_set_sto=0; | |
4070 | + var cp_data=null | |
4071 | + if(th.data.def_pick_store && th.data.def_pick_store.pickup_id){ | |
4072 | + cp_data=JSON.parse(JSON.stringify(th.data.def_pick_store)); | |
4073 | + } | |
4074 | + th.setData({ | |
4075 | + front_pick:cp_data, | |
4076 | + front_only_pk:th.data.only_pk, | |
4077 | + front_def_pickpu_list:th.data.def_pickpu_list, | |
4078 | + front_pickpu_listt:th.data.pickpu_list, | |
4079 | + front_all_sto:th.data.all_sto, | |
4080 | + front_is_show_sto_cat:th.data.is_show_sto_cat, | |
4081 | + }) | |
4082 | + } | |
4083 | + }, | |
4084 | + | |
4038 | 4085 | //------------处理门店--------------- |
4039 | 4086 | deal_pickup(e) { |
4040 | 4087 | var th = this; |
... | ... | @@ -4227,6 +4274,11 @@ Page({ |
4227 | 4274 | }) |
4228 | 4275 | } |
4229 | 4276 | } |
4277 | + | |
4278 | + | |
4279 | + //-- 设置商品详情页面的门店显示情况 --- | |
4280 | + th.deal_front_pk(); | |
4281 | + | |
4230 | 4282 | } else { |
4231 | 4283 | th.setData({ |
4232 | 4284 | is_show_sto_cat: -1, |
... | ... | @@ -4242,6 +4294,9 @@ Page({ |
4242 | 4294 | }) |
4243 | 4295 | } |
4244 | 4296 | |
4297 | + //-- 设置商品详情页面的门店显示情况 --- | |
4298 | + th.deal_front_pk(); | |
4299 | + | |
4245 | 4300 | } |
4246 | 4301 | } |
4247 | 4302 | }); |
... | ... | @@ -4259,7 +4314,11 @@ Page({ |
4259 | 4314 | sto_sele_distr: e.data.data.pageData[0].distr_type |
4260 | 4315 | }) |
4261 | 4316 | } |
4317 | + | |
4318 | + //-- 设置商品详情页面的门店显示情况 --- | |
4319 | + th.deal_front_pk(); | |
4262 | 4320 | } |
4321 | + | |
4263 | 4322 | }, |
4264 | 4323 | |
4265 | 4324 | //------------处理线下门店库存-------- |
... | ... | @@ -4366,6 +4425,7 @@ Page({ |
4366 | 4425 | |
4367 | 4426 | |
4368 | 4427 | } else { |
4428 | + th.data.fir_set_sto=0; | |
4369 | 4429 | th.setData({ |
4370 | 4430 | all_sto: null, |
4371 | 4431 | only_pk: null, |
... | ... | @@ -4463,7 +4523,8 @@ Page({ |
4463 | 4523 | th.deal_pickup(em); |
4464 | 4524 | |
4465 | 4525 | } else { |
4466 | - | |
4526 | + | |
4527 | + th.data.fir_set_sto=0; | |
4467 | 4528 | th.setData({ |
4468 | 4529 | all_sto: null, |
4469 | 4530 | only_pk: null, |
... | ... | @@ -4473,6 +4534,7 @@ Page({ |
4473 | 4534 | |
4474 | 4535 | } else { |
4475 | 4536 | |
4537 | + th.data.fir_set_sto=0; | |
4476 | 4538 | th.setData({ |
4477 | 4539 | all_sto: null, |
4478 | 4540 | only_pk: null, |
... | ... | @@ -4749,7 +4811,9 @@ Page({ |
4749 | 4811 | if (em.data.code == 0) { |
4750 | 4812 | |
4751 | 4813 | if (em.data.data <= 0) ee.setData({ |
4752 | - prom_r_null: 1,pro_null:1 | |
4814 | + prom_r_null: 1, | |
4815 | + f_prom_r_null: 1, | |
4816 | + pro_null:1, | |
4753 | 4817 | }); |
4754 | 4818 | //拿取价格并且判断时间-- |
4755 | 4819 | getApp().request.get("/api/ms/flash_sale/getNew/" + os.stoid + "/" + user_id + "/" + prom_id, { |
... | ... | @@ -4784,10 +4848,12 @@ Page({ |
4784 | 4848 | |
4785 | 4849 | ee.setData({ |
4786 | 4850 | prom_price: t.data.data.user_price, |
4851 | + f_prom_price: t.data.data.user_price, | |
4787 | 4852 | prom_type: 1, |
4788 | 4853 | prom_id: prom_id, |
4789 | 4854 | prom_buy_limit: t.data.data.buy_limit, |
4790 | 4855 | prom_act: t.data.data, |
4856 | + f_prom_act: t.data.data, | |
4791 | 4857 | prom_end_time: prom_end_time, |
4792 | 4858 | prom_start_time: prom_start_time, |
4793 | 4859 | isshow: 1, |
... | ... | @@ -4806,7 +4872,8 @@ Page({ |
4806 | 4872 | if (endTime2 > newTime) { |
4807 | 4873 | ee.setData({ |
4808 | 4874 | prom_time_text: '距秒杀结束还有', |
4809 | - prom_st: 1 | |
4875 | + prom_st: 1, | |
4876 | + f_prom_st: 1 | |
4810 | 4877 | }) |
4811 | 4878 | ee.countDown(endTime2); |
4812 | 4879 | } |
... | ... | @@ -5248,7 +5315,8 @@ Page({ |
5248 | 5315 | var endTime2 = th.data.prom_act.end_time; |
5249 | 5316 | th.setData({ |
5250 | 5317 | prom_time_text: '距结束还剩:', |
5251 | - prom_st: 1 | |
5318 | + prom_st: 1, | |
5319 | + f_prom_st: 1, | |
5252 | 5320 | }) |
5253 | 5321 | setTimeout(function () { |
5254 | 5322 | th.countDown(endTime2) |
... | ... | @@ -5265,7 +5333,8 @@ Page({ |
5265 | 5333 | } |
5266 | 5334 | th.setData({ |
5267 | 5335 | prom_time_text: '活动已经结束:', |
5268 | - prom_st: 3 | |
5336 | + prom_st: 3, | |
5337 | + f_prom_st: 3 | |
5269 | 5338 | }) |
5270 | 5339 | th.setData({ |
5271 | 5340 | djs: obj |
... | ... | @@ -5416,9 +5485,9 @@ Page({ |
5416 | 5485 | //如果是拼单活动的普通购买 |
5417 | 5486 | if (ind == 1) { |
5418 | 5487 | |
5419 | - | |
5420 | - //要把不匹配还原 | |
5421 | - if (th.data.def_pick_store && JSON.stringify(th.data.def_pick_store) != '{}'){ | |
5488 | + if(th.data.front_pick){ | |
5489 | + th.setData({def_pick_store: ut.deep_cp(th.data.front_pick)}); | |
5490 | + }else if (th.data.def_pick_store && JSON.stringify(th.data.def_pick_store) != '{}'){ //要把不匹配还原 | |
5422 | 5491 | th.data.def_pick_store.is_no_dis_nor=0; |
5423 | 5492 | th.setData({def_pick_store:th.data.def_pick_store}) |
5424 | 5493 | } |
... | ... | @@ -5870,6 +5939,14 @@ Page({ |
5870 | 5939 | //----------立即购买_pt----------- |
5871 | 5940 | buyNow_pt: function (e) { |
5872 | 5941 | |
5942 | + this.setData({ | |
5943 | + openSpecModal: 0, | |
5944 | + openSpecModal_inte: 0, | |
5945 | + openSpecModal_inte_normal: 0, | |
5946 | + openSpecModal_pt: 0, | |
5947 | + openSpecModal_flash_normal:0 | |
5948 | + }) | |
5949 | + | |
5873 | 5950 | wxlog.info(getApp().globalData.user_id+'-拼团立即购买:'+JSON.stringify(e)); |
5874 | 5951 | |
5875 | 5952 | s.set_b_now(e); |
... | ... | @@ -5994,7 +6071,7 @@ Page({ |
5994 | 6071 | } else { |
5995 | 6072 | console.log(222, goods_id) |
5996 | 6073 | wx.navigateTo({ |
5997 | - url: "/pages/team/team_show/team_show?tg_id=" + id + "&goods_id=" + goods_id, | |
6074 | + url: "/packageG/pages/team/team_show/team_show?tg_id=" + id + "&goods_id=" + goods_id, | |
5998 | 6075 | }); |
5999 | 6076 | } |
6000 | 6077 | } |
... | ... | @@ -6002,7 +6079,7 @@ Page({ |
6002 | 6079 | else { |
6003 | 6080 | console.log(1111, th.data.goods_id) |
6004 | 6081 | wx.navigateTo({ |
6005 | - url: "/pages/team/team_show/team_show?tg_id=" + id + "&goods_id=" + goods_id, | |
6082 | + url: "/packageG/pages/team/team_show/team_show?tg_id=" + id + "&goods_id=" + goods_id, | |
6006 | 6083 | }); |
6007 | 6084 | } |
6008 | 6085 | } |
... | ... | @@ -7299,6 +7376,11 @@ Page({ |
7299 | 7376 | choice_store: function (ee) { |
7300 | 7377 | var th = this; |
7301 | 7378 | var ind = ee.currentTarget.dataset.ind; |
7379 | + var isfront = ee.currentTarget.dataset.isfront; | |
7380 | + | |
7381 | + th.data.isfront=0; | |
7382 | + if(isfront) th.data.isfront=1; | |
7383 | + | |
7302 | 7384 | var bconfig = th.data.bconfig; |
7303 | 7385 | this.setData({ |
7304 | 7386 | keyword:'' |
... | ... | @@ -7318,40 +7400,92 @@ Page({ |
7318 | 7400 | return false; |
7319 | 7401 | } |
7320 | 7402 | |
7321 | - if (!th.data.only_pk && !th.data.def_pickpu_list && !th.data.change) { | |
7322 | - // getApp().confirmBox("门店库存不足", null, 25000, !1); | |
7323 | - wx.showToast({ | |
7324 | - title: '门店库存不足', | |
7325 | - icon: 'none', | |
7326 | - }); | |
7327 | - return false; | |
7328 | - } | |
7329 | - th.data.change = 0; | |
7403 | + if(th.data.isfront==1){ | |
7330 | 7404 | |
7331 | - if (th.data.only_pk && !th.data.only_pk.length) { | |
7332 | - // getApp().confirmBox("门店库存不足", null, 25000, !1); | |
7333 | - wx.showToast({ | |
7334 | - title: '门店库存不足', | |
7335 | - icon: 'none', | |
7336 | - }); | |
7337 | - return false; | |
7338 | - } | |
7339 | - if (th.data.def_pickpu_list && !th.data.def_pickpu_list.length) { | |
7340 | - // getApp().confirmBox("门店库存不足", null, 25000, !1); | |
7341 | - wx.showToast({ | |
7342 | - title: '门店库存不足', | |
7343 | - icon: 'none', | |
7344 | - }); | |
7345 | - return false; | |
7346 | - } | |
7405 | + if (!th.data.front_only_pk && !th.data.front_def_pickpu_list && !th.data.change) { | |
7406 | + // getApp().confirmBox("门店库存不足", null, 25000, !1); | |
7407 | + wx.showToast({ | |
7408 | + title: '门店库存不足', | |
7409 | + icon: 'none', | |
7410 | + }); | |
7411 | + return false; | |
7412 | + } | |
7413 | + th.data.change = 0; | |
7414 | + | |
7415 | + if (th.data.front_only_pk && !th.data.front_only_pk.length) { | |
7416 | + // getApp().confirmBox("门店库存不足", null, 25000, !1); | |
7417 | + wx.showToast({ | |
7418 | + title: '门店库存不足', | |
7419 | + icon: 'none', | |
7420 | + }); | |
7421 | + return false; | |
7422 | + } | |
7423 | + if (th.data.front_def_pickpu_list && !th.data.front_def_pickpu_list.length) { | |
7424 | + // getApp().confirmBox("门店库存不足", null, 25000, !1); | |
7425 | + wx.showToast({ | |
7426 | + title: '门店库存不足', | |
7427 | + icon: 'none', | |
7428 | + }); | |
7429 | + return false; | |
7430 | + } | |
7431 | + | |
7432 | + //-- 把默认的数据拿过来,数据传递要用深拷贝 -- | |
7433 | + th.setData({ | |
7434 | + def_pick_store: ut.deep_cp(th.data.front_pick), | |
7435 | + only_pk:ut.deep_cp(th.data.front_only_pk), | |
7436 | + def_pickpu_list:ut.deep_cp(th.data.front_def_pickpu_list), | |
7437 | + pickpu_list:ut.deep_cp(th.data.front_pickpu_listt), | |
7438 | + all_sto:ut.deep_cp(th.data.front_all_sto), | |
7439 | + is_show_sto_cat:th.data.front_is_show_sto_cat | |
7440 | + }) | |
7441 | + | |
7442 | + | |
7443 | + this.setData({ | |
7444 | + open_ind_store: ind, | |
7445 | + store: 1, | |
7446 | + openSpecModal: !1, | |
7447 | + openSpecModal_pt: !1, | |
7448 | + openSpecModal_flash_normal: !1, | |
7449 | + }) | |
7347 | 7450 | |
7348 | - //如果开启了,则不在选择门店 | |
7349 | - if (th.data.sys_switch.is_pricing_open_store && getApp().globalData.pk_store) { | |
7350 | 7451 | return false; |
7452 | + | |
7453 | + | |
7454 | + }else{ | |
7455 | + if (!th.data.only_pk && !th.data.def_pickpu_list && !th.data.change) { | |
7456 | + // getApp().confirmBox("门店库存不足", null, 25000, !1); | |
7457 | + wx.showToast({ | |
7458 | + title: '门店库存不足', | |
7459 | + icon: 'none', | |
7460 | + }); | |
7461 | + return false; | |
7462 | + } | |
7463 | + th.data.change = 0; | |
7464 | + | |
7465 | + if (th.data.only_pk && !th.data.only_pk.length) { | |
7466 | + // getApp().confirmBox("门店库存不足", null, 25000, !1); | |
7467 | + wx.showToast({ | |
7468 | + title: '门店库存不足', | |
7469 | + icon: 'none', | |
7470 | + }); | |
7471 | + return false; | |
7472 | + } | |
7473 | + if (th.data.def_pickpu_list && !th.data.def_pickpu_list.length) { | |
7474 | + // getApp().confirmBox("门店库存不足", null, 25000, !1); | |
7475 | + wx.showToast({ | |
7476 | + title: '门店库存不足', | |
7477 | + icon: 'none', | |
7478 | + }); | |
7479 | + return false; | |
7480 | + } | |
7481 | + | |
7351 | 7482 | } |
7352 | 7483 | |
7353 | 7484 | |
7354 | 7485 | |
7486 | + | |
7487 | + | |
7488 | + | |
7355 | 7489 | if (bconfig && bconfig.is_sort_storage) { |
7356 | 7490 | wx.getLocation({ |
7357 | 7491 | type: 'gcj02', |
... | ... | @@ -7496,12 +7630,18 @@ Page({ |
7496 | 7630 | check_the_pick(item, func) { |
7497 | 7631 | var th = this; |
7498 | 7632 | var goodsinfo = th.data.sele_g; |
7633 | + | |
7634 | + if(th.data.isfront){ | |
7635 | + goodsinfo=this.data.front_g; | |
7636 | + } | |
7637 | + | |
7638 | + | |
7499 | 7639 | var erpwareid = goodsinfo.erpwareid; |
7500 | 7640 | var plist = null; |
7501 | 7641 | var lock = 0; |
7502 | 7642 | |
7503 | 7643 | //---如果是活动的时候,同时不是普通购买--- |
7504 | - if (getApp().is_virtual(th.data.sele_g) || th.data.sele_g.whsle_id || ([1, 2, 4, 6, 8, 9].indexOf(th.data.prom_type) > -1 && !th.data.is_normal)) { | |
7644 | + if (getApp().is_virtual(goodsinfo) || goodsinfo.whsle_id || ([1, 2, 4, 6, 8, 9].indexOf(th.data.prom_type) > -1 && !th.data.is_normal)) { | |
7505 | 7645 | func(); |
7506 | 7646 | return false; |
7507 | 7647 | } |
... | ... | @@ -7630,6 +7770,10 @@ Page({ |
7630 | 7770 | if (!th.data.sele_g) return false; |
7631 | 7771 | //判断门店的配送方式是不是匹配 |
7632 | 7772 | var g_distr_type = th.data.sele_g.distr_type; |
7773 | + if(th.data.isfront==1){ | |
7774 | + g_distr_type = th.data.data.distr_type; | |
7775 | + } | |
7776 | + | |
7633 | 7777 | if (item.distr_type != 0 && g_distr_type != 0 && item.distr_type != g_distr_type) { |
7634 | 7778 | wx.showToast({ |
7635 | 7779 | title: "门店配送方式不匹配,请选择其他门店", |
... | ... | @@ -7651,6 +7795,14 @@ Page({ |
7651 | 7795 | fir_pick_index: 0 |
7652 | 7796 | }); |
7653 | 7797 | |
7798 | + | |
7799 | + if(th.data.isfront){ | |
7800 | + th.setData({ | |
7801 | + front_pick: ut.deep_cp(item) | |
7802 | + }) | |
7803 | + } | |
7804 | + | |
7805 | + | |
7654 | 7806 | switch (openindstore) { |
7655 | 7807 | case 1: |
7656 | 7808 | th.setData({ |
... | ... | @@ -7776,6 +7928,14 @@ Page({ |
7776 | 7928 | choice_sort_store: 0 |
7777 | 7929 | }); |
7778 | 7930 | |
7931 | + if(th.data.isfront){ | |
7932 | + th.setData({ | |
7933 | + front_pick: ut.deep_cp(item) | |
7934 | + }) | |
7935 | + } | |
7936 | + | |
7937 | + | |
7938 | + | |
7779 | 7939 | var openindstore = th.data.open_ind_store; |
7780 | 7940 | if (openindstore == 1) { |
7781 | 7941 | th.setData({ |
... | ... | @@ -8138,11 +8298,23 @@ Page({ |
8138 | 8298 | th.data.collocationGoods = r_data.collocationPromList; |
8139 | 8299 | th.data.prom_goods = r_data.promGoodsLists; |
8140 | 8300 | } else { |
8141 | - th.setData({ | |
8142 | - order_prom: r_data.promOrder, | |
8143 | - collocationGoods: r_data.collocationPromList, | |
8144 | - prom_goods: r_data.promGoodsLists, | |
8145 | - }) | |
8301 | + | |
8302 | + if(gid==th.data.front_g){ | |
8303 | + th.setData({ | |
8304 | + order_prom: r_data.promOrder, | |
8305 | + f_order_prom: r_data.promOrder, | |
8306 | + collocationGoods: r_data.collocationPromList, | |
8307 | + prom_goods: r_data.promGoodsLists, | |
8308 | + }) | |
8309 | + }else{ | |
8310 | + th.setData({ | |
8311 | + order_prom: r_data.promOrder, | |
8312 | + collocationGoods: r_data.collocationPromList, | |
8313 | + prom_goods: r_data.promGoodsLists, | |
8314 | + }) | |
8315 | + } | |
8316 | + | |
8317 | + | |
8146 | 8318 | } |
8147 | 8319 | |
8148 | 8320 | |
... | ... | @@ -8248,9 +8420,21 @@ Page({ |
8248 | 8420 | //使用sort排序 |
8249 | 8421 | ppdata.sort(comp); |
8250 | 8422 | |
8251 | - th.setData({ | |
8252 | - cx_prom_group: ppdata | |
8253 | - }) | |
8423 | + | |
8424 | + //-- 如果是前端商品的时候 -- | |
8425 | + if(th.data.sele_g.goods_id==th.data.front_g.goods_id){ | |
8426 | + th.setData({ | |
8427 | + cx_prom_group: ppdata, | |
8428 | + f_cx_prom_group: ppdata, | |
8429 | + }) | |
8430 | + | |
8431 | + }else{ | |
8432 | + th.setData({ | |
8433 | + cx_prom_group: ppdata | |
8434 | + }) | |
8435 | + } | |
8436 | + | |
8437 | + | |
8254 | 8438 | |
8255 | 8439 | }) |
8256 | 8440 | }, |
... | ... | @@ -8345,8 +8529,12 @@ Page({ |
8345 | 8529 | |
8346 | 8530 | }, |
8347 | 8531 | |
8348 | - //-- 积分购 -- | |
8532 | + //-- 积分购购买弹出框 -- | |
8349 | 8533 | go_pay_integral: function () { |
8534 | + | |
8535 | + //-- 在打开弹出框的时候,front_pk门店要赋值 -- | |
8536 | + this.setData({def_pick_store: ut.deep_cp(this.data.front_pick)}); | |
8537 | + | |
8350 | 8538 | this.data.g_buy_num = new Map(); |
8351 | 8539 | this.get_sto(0) |
8352 | 8540 | this.setData({ |
... | ... | @@ -8355,14 +8543,15 @@ Page({ |
8355 | 8543 | }); |
8356 | 8544 | }, |
8357 | 8545 | |
8358 | - //-- 积分购普通购买 -- | |
8546 | + //-- 积分购普通购买弹出框 -- | |
8359 | 8547 | go_pay_integral_normal:async function () { |
8360 | 8548 | |
8361 | 8549 | this.data.g_buy_num = new Map(); |
8362 | 8550 | var th = this; |
8363 | 8551 | |
8364 | - //要把不匹配还原 | |
8365 | - if (th.data.def_pick_store && JSON.stringify(th.data.def_pick_store) != '{}'){ | |
8552 | + if(th.data.front_pick){ | |
8553 | + th.setData({def_pick_store: ut.deep_cp(th.data.front_pick)}); | |
8554 | + }else if (th.data.def_pick_store && JSON.stringify(th.data.def_pick_store) != '{}'){ //要把不匹配还原 | |
8366 | 8555 | th.data.def_pick_store.is_no_dis_nor=0; |
8367 | 8556 | th.setData({def_pick_store:th.data.def_pick_store}) |
8368 | 8557 | } |
... | ... | @@ -8400,13 +8589,12 @@ Page({ |
8400 | 8589 | this.setData({ |
8401 | 8590 | openSpecModal_inte_normal: 0 |
8402 | 8591 | }); |
8403 | - //要进行还原 | |
8404 | - this.get_sto(); | |
8592 | + //要进行还原 | |
8405 | 8593 | this.setData({ |
8406 | - sele_g: this.data.data, | |
8407 | - gid: this.data.data.goods_id | |
8594 | + sele_g: ut.deep_cp(this.data.front_g), | |
8595 | + gid: this.data.front_g.goods_id | |
8408 | 8596 | }) |
8409 | - | |
8597 | + this.get_sto(); | |
8410 | 8598 | this.sele_spec_chech_activity(); |
8411 | 8599 | }, |
8412 | 8600 | |
... | ... | @@ -8701,9 +8889,20 @@ Page({ |
8701 | 8889 | // th.data.prom_type = new_arr[0].prom_type; |
8702 | 8890 | // } |
8703 | 8891 | |
8704 | - th.setData({ | |
8705 | - more_flash: new_arr | |
8706 | - }); | |
8892 | + //-- 如果是前端商品的时候 -- | |
8893 | + if(gid==th.data.front_g.goods_id){ | |
8894 | + th.setData({ | |
8895 | + more_flash: new_arr, | |
8896 | + f_more_flash: new_arr, | |
8897 | + }); | |
8898 | + | |
8899 | + }else{ | |
8900 | + th.setData({ | |
8901 | + more_flash: new_arr | |
8902 | + }); | |
8903 | + } | |
8904 | + | |
8905 | + | |
8707 | 8906 | } |
8708 | 8907 | }) |
8709 | 8908 | }, |
... | ... | @@ -8712,7 +8911,12 @@ Page({ |
8712 | 8911 | go_more_flash: function (e) { |
8713 | 8912 | var prom_id = e.currentTarget.dataset.id; |
8714 | 8913 | var prom_type = e.currentTarget.dataset.prom_type; |
8715 | - var goods_id = this.data.data.goods_id; | |
8914 | + var is_sele = e.currentTarget.dataset.is_sele; | |
8915 | + var goods_id=this.data.front_g.goods_id; | |
8916 | + if(is_sele){ | |
8917 | + goods_id=this.data.sele_g.goods_id; | |
8918 | + } | |
8919 | + | |
8716 | 8920 | var url = ""; |
8717 | 8921 | |
8718 | 8922 | switch (parseInt(prom_type)) { | ... | ... |
pages/goods/goodsInfo/goodsInfo.wxml
... | ... | @@ -83,40 +83,41 @@ |
83 | 83 | </view> |
84 | 84 | </view> |
85 | 85 | |
86 | - <!-- --显示秒杀价 --> | |
86 | + <!-- --显示秒杀的定时器 --> | |
87 | 87 | <view class="prom_show rel" wx:if="{{prom_type==1}}"> |
88 | - <image class="secondkill-img" src='{{prom_st==1? iurl+"/miniapp/images/red_jx.png":iurl+"/miniapp/images/blue_ks.png"}}'></image> | |
88 | + <image class="secondkill-img" src='{{f_prom_st==1? iurl+"/miniapp/images/red_jx.png":iurl+"/miniapp/images/blue_ks.png"}}'></image> | |
89 | 89 | <image class="abs spike-img" src="{{iurl}}/miniapp/images/xsmiaosha.png"></image> |
90 | - <view class="stop fs26 abs" wx:if="{{prom_st==1}}">距活动结束还有</view> | |
91 | - <view class="start fs26 abs" wx:if="{{prom_st==2}}">距活动开始还有</view> | |
90 | + <view class="stop fs26 abs" wx:if="{{f_prom_st==1}}">距活动结束还有</view> | |
91 | + <view class="start fs26 abs" wx:if="{{f_prom_st==2}}">距活动开始还有</view> | |
92 | 92 | <view class="secview flex abs fs24 xc-miaosha-time"> |
93 | 93 | <block wx:if="djs.day"> |
94 | - <view class='day-val' style="color:{{prom_st==1?'#d40022':'#0097e0'}}"> | |
94 | + <view class='day-val' style="color:{{f_prom_st==1?'#d40022':'#0097e0'}}"> | |
95 | 95 | {{djs.day}} |
96 | 96 | </view> |
97 | - <view class="day white" style="color: {{prom_st==1?'#d40022':'#0097e0'}}">天</view> | |
97 | + <view class="day white" style="color: {{f_prom_st==1?'#d40022':'#0097e0'}}">天</view> | |
98 | 98 | </block> |
99 | - <view class='time-val white t-c' style=" background:{{prom_st==1?'#d40022':'#0097e0'}}"> | |
99 | + <view class='time-val white t-c' style=" background:{{f_prom_st==1?'#d40022':'#0097e0'}}"> | |
100 | 100 | {{djs.hou}} |
101 | 101 | </view> |
102 | - <view class="time" style="color: {{prom_st==1?'#d40022':'#0097e0'}}">时</view> | |
103 | - <view class='time-val white t-c' style=" background:{{prom_st==1?'#d40022':'#0097e0'}}"> | |
102 | + <view class="time" style="color: {{f_prom_st==1?'#d40022':'#0097e0'}}">时</view> | |
103 | + <view class='time-val white t-c' style=" background:{{f_prom_st==1?'#d40022':'#0097e0'}}"> | |
104 | 104 | {{djs.min}} |
105 | 105 | </view> |
106 | - <view class="time" style="color: {{prom_st==1?'#d40022':'#0097e0'}}">分</view> | |
107 | - <view class='time-val white t-c' style="background:{{prom_st==1?'#d40022':'#0097e0'}}"> | |
106 | + <view class="time" style="color: {{f_prom_st==1?'#d40022':'#0097e0'}}">分</view> | |
107 | + <view class='time-val white t-c' style="background:{{f_prom_st==1?'#d40022':'#0097e0'}}"> | |
108 | 108 | {{djs.sec}} |
109 | 109 | </view> |
110 | - <view class="time" style="color: {{prom_st==1?'#d40022':'#0097e0'}}">秒</view> | |
110 | + <view class="time" style="color: {{f_prom_st==1?'#d40022':'#0097e0'}}">秒</view> | |
111 | 111 | </view> |
112 | 112 | </view> |
113 | - <!-- --显示团购价 --> | |
113 | + | |
114 | + <!-- --显示团购价和剩余时间 --> | |
114 | 115 | <view class="prom_show rel" wx:if="{{prom_type==2}}"> |
115 | 116 | |
116 | 117 | <view class="abs flex fs36" style="align-items:flex-end;color: #fff; margin-top: 34rpx; margin-left: 10rpx; height: 60rpx">¥{{prom_price}} |
117 | 118 | |
118 | - <view wx:if="{{is_retail_price}}" class="word-line fs24 no_line_c" style="margin-left: 10rpx;position: relative;top: -6rpx; color:#fff !important">零售价:¥{{filters.toFix(data.market_price,2)}}</view> | |
119 | - <view wx:else class="word-line no_line_x fs24" style="margin-left: 10rpx;position: relative;top: -6rpx;color:#fff !important">¥{{filters.toFix(data.shop_price,2)}}</view> | |
119 | + <view wx:if="{{is_retail_price}}" class="word-line fs24 no_line_c" style="margin-left: 10rpx;position: relative;top: -6rpx; color:#fff !important">零售价:¥{{filters.toFix(front_g.market_price,2)}}</view> | |
120 | + <view wx:else class="word-line no_line_x fs24" style="margin-left: 10rpx;position: relative;top: -6rpx;color:#fff !important">¥{{filters.toFix(front_g.shop_price,2)}}</view> | |
120 | 121 | </view> |
121 | 122 | |
122 | 123 | <image class="abs" style="width: 120rpx;top: 32rpx; right: 220rpx;" mode="widthFix" src='{{iurl+"/miniapp/images/activity-time.png"}}'></image> |
... | ... | @@ -143,8 +144,8 @@ |
143 | 144 | <view class="flex fs35 xc-qtsign">¥</view> |
144 | 145 | <view class="fs50 val">{{prom_price}}</view> |
145 | 146 | </view> |
146 | - <view wx:if="{{is_retail_price}}" class="word-line fs20 xc-qtunit-price no_line_c" style="color:#fff !important ">零售价:¥{{filters.toFix(data.market_price,2)}}</view> | |
147 | - <view wx:else class="word-line no_line_x fs20 xc-qtunit-price" style="color:#fff !important ">¥{{filters.toFix(data.shop_price,2)}}</view> | |
147 | + <view wx:if="{{is_retail_price}}" class="word-line fs20 xc-qtunit-price no_line_c" style="color:#fff !important ">零售价:¥{{filters.toFix(front_g.market_price,2)}}</view> | |
148 | + <view wx:else class="word-line no_line_x fs20 xc-qtunit-price" style="color:#fff !important ">¥{{filters.toFix(front_g.shop_price,2)}}</view> | |
148 | 149 | </view> |
149 | 150 | |
150 | 151 | <view class="abs white xc-nanber"> |
... | ... | @@ -199,7 +200,7 @@ |
199 | 200 | <!-- 许程 商家团主页 --> |
200 | 201 | <view class="xc-goods-explain flex-vertical-between"> |
201 | 202 | <view class="xc-explain fs32 ellipsis-2" wx:if="{{prom_type!=0 }}"> |
202 | - {{data.goods_name}} | |
203 | + {{front_g.goods_name}} | |
203 | 204 | </view> |
204 | 205 | <!-- 这个是分享按钮 --> |
205 | 206 | <view wx:if="{{isLogin}}" class="xc-share-frame t-c shrink0" bindtap="clickShare"> |
... | ... | @@ -236,7 +237,7 @@ |
236 | 237 | |
237 | 238 | <block wx:for="{{teamgroup}}" wx:for-index="t_ind"> |
238 | 239 | <view class='group' wx:if="{{item.open_num>0}}" > |
239 | - <view class='group-list' bindtap="go_cj_team" data-ind="{{t_ind}}" data-goodsid="{{data.goods_id}}"> | |
240 | + <view class='group-list' bindtap="go_cj_team" data-ind="{{t_ind}}" data-goodsid="{{front_g.goods_id}}"> | |
240 | 241 | <!-- <view class="flex ai_c"> --> |
241 | 242 | <!-- //选项框头像 --> |
242 | 243 | <view class='gtou'> |
... | ... | @@ -283,11 +284,11 @@ |
283 | 284 | <text class="rel_txt" wx:if="{{!prom_integral && !prom_price}}">0积分</text> |
284 | 285 | |
285 | 286 | <text wx:if="{{is_retail_price}}" class="rel_txt fs22 no_line_x" decode="{{true}}" space="{{true}}" style="color: #999; text-decoration: line-through;"> |
286 | - 零售价:¥{{filters.toFix(data.market_price,2)}} | |
287 | + 零售价:¥{{filters.toFix(front_g.market_price,2)}} | |
287 | 288 | </text> |
288 | 289 | |
289 | 290 | <text wx:else class="rel_txt fs22" decode="{{true}}" space="{{true}}" style="color: #999; text-decoration: line-through;"> |
290 | - ¥{{filters.toFix(data.shop_price,2)}} | |
291 | + ¥{{filters.toFix(front_g.shop_price,2)}} | |
291 | 292 | </text> |
292 | 293 | |
293 | 294 | </view> |
... | ... | @@ -304,13 +305,13 @@ |
304 | 305 | {{prom_act.show_time_off}}开始兑换 |
305 | 306 | </view> |
306 | 307 | <view class="goods-title"> |
307 | - <image wx:if="{{data.commission > 0}}" style="width: 25rpx;height: 25rpx;margin-right: 6rpx;" src="https://mshop-lib.yolipai.net/template/mobile/new/static/images/addmoney.png"></image> | |
308 | - <view class="goods-name elli">{{data.goods_name}}</view> | |
308 | + <image wx:if="{{front_g.commission > 0}}" style="width: 25rpx;height: 25rpx;margin-right: 6rpx;" src="https://mshop-lib.yolipai.net/template/mobile/new/static/images/addmoney.png"></image> | |
309 | + <view class="goods-name elli">{{front_g.goods_name}}</view> | |
309 | 310 | </view> |
310 | 311 | <view class="goods-num"> |
311 | 312 | <view class="sales">销量:{{prom_act.buy_num+prom_act.virtual}}件</view> |
312 | 313 | <view class="stock"> |
313 | - 折扣:{{g_filters.num((prom_price?prom_price:0)*10/data.shop_price)}}折 | |
314 | + 折扣:{{g_filters.num((prom_price?prom_price:0)*10/front_g.shop_price)}}折 | |
314 | 315 | </view> |
315 | 316 | <view class="stock">{{categories3[0].num}}人评价</view> |
316 | 317 | </view> |
... | ... | @@ -327,21 +328,21 @@ |
327 | 328 | <view class="co-red" wx:if="{{prom_type==0 || prom_type==3}}"> |
328 | 329 | |
329 | 330 | <view class="market-price flex" style="align-items: baseline;"> |
330 | - <block wx:if="{{card_field && data[card_field]>0}}"> | |
331 | + <block wx:if="{{card_field && front_g[card_field]>0}}"> | |
331 | 332 | <view class="flex ai-center grade-card-frame"> |
332 | 333 | <image class="img" src="{{iurl}}/miniapp/images/userinfo/userinfo/privilege_t.png"></image> |
333 | 334 | <view class="fs24 white view card-name ellipsis-1">{{card_name}}</view> |
334 | 335 | </view> |
335 | 336 | <text class="rel yuan">¥</text> |
336 | - {{filters.toFix(data[card_field],2)}} | |
337 | + {{filters.toFix(front_g[card_field],2)}} | |
337 | 338 | </block> |
338 | 339 | |
339 | 340 | <block wx:else > |
340 | - <text class="rel yuan">¥</text>{{filters.toFix(data.shop_price,2)}} | |
341 | + <text class="rel yuan">¥</text>{{filters.toFix(front_g.shop_price,2)}} | |
341 | 342 | </block> |
342 | 343 | |
343 | 344 | <view wx:if="{{is_retail_price}}" class='yj' style="margin-left:10rpx"> |
344 | - <text class="no_line_x">零售价:¥{{filters.toFix(data.market_price,2)}}</text> | |
345 | + <text class="no_line_x">零售价:¥{{filters.toFix(front_g.market_price,2)}}</text> | |
345 | 346 | </view> |
346 | 347 | |
347 | 348 | </view> |
... | ... | @@ -355,33 +356,33 @@ |
355 | 356 | </view> |
356 | 357 | <!-- 不是秒杀 --> |
357 | 358 | <!-- 等级卡的价格,不是等级卡会员,且商品又有设置等级级价,商家后台有开通升级卡同能 --> |
358 | - <view class="flex ai_and" wx:if="{{!card_field && is_no_plus && g_filters.is_has_rank(rank_switch,data) && prom_type!=1 && prom_type!=2 && prom_type!=4 && card_list && card_list.length>0 && g_filters.get_card_price(data,card_list,1)!=''}}"> | |
359 | + <view class="flex ai_and" wx:if="{{!card_field && is_no_plus && g_filters.is_has_rank(rank_switch,front_g) && prom_type!=1 && prom_type!=2 && prom_type!=4 && card_list && card_list.length>0 && g_filters.get_card_price(front_g,card_list,1)!=''}}"> | |
359 | 360 | <view class="flex ai-center grade-card-frame card-frame"> |
360 | 361 | <image class="img" src="{{iurl}}/miniapp/images/userinfo/userinfo/privilege_t.png"></image> |
361 | 362 | <view class="fs24 white view card-name ellipsis-1"> |
362 | - {{g_filters.get_card_price(data,card_list,1)}} | |
363 | + {{g_filters.get_card_price(front_g,card_list,1)}} | |
363 | 364 | </view> |
364 | 365 | </view> |
365 | 366 | <view class="fs32 xc-black3 ai_and carde_frame"> |
366 | - <text class="fs26">¥</text>{{g_filters.get_card_price(data,card_list,0)}} | |
367 | + <text class="fs26">¥</text>{{g_filters.get_card_price(front_g,card_list,0)}} | |
367 | 368 | </view> |
368 | 369 | </view> |
369 | 370 | <!-- 等级卡的显示,购买, 等级卡近30天要显示续费 --> |
370 | - <block wx:if="{{g_filters.is_has_rank(rank_switch,data) && is_no_plus}}"> | |
371 | + <block wx:if="{{g_filters.is_has_rank(rank_switch,front_g) && is_no_plus}}"> | |
371 | 372 | <!-- 不是秒杀,且会员不是等级会员 --> |
372 | - <view wx:if="{{!card_field && prom_type!=1 && prom_type!=2 && card_list && card_list.length>0 && g_filters.get_card_price(data,card_list,1)!=''}}"> | |
373 | + <view wx:if="{{!card_field && prom_type!=1 && prom_type!=2 && card_list && card_list.length>0 && g_filters.get_card_price(front_g,card_list,1)!=''}}"> | |
373 | 374 | <view class="beauty-makeup-frame flex ai-center"> |
374 | 375 | <view class="left flex ai-center jc_sa"> |
375 | 376 | <view class="flex ai-center grade-card-frame card-frame advert-card"> |
376 | 377 | <image class="img" src="{{iurl}}/miniapp/images/userinfo/userinfo/privilege_t.png"></image> |
377 | 378 | <view class="fs24 white view card-name ellipsis-1"> |
378 | - {{g_filters.get_card_price(data,card_list,1)}} | |
379 | + {{g_filters.get_card_price(front_g,card_list,1)}} | |
379 | 380 | </view> |
380 | 381 | </view> |
381 | 382 | <view class="card-effect"> |
382 | 383 | <view class="fs24 xc-black3"> |
383 | - 成为{{g_filters.get_card_price(data,card_list,1)}}立 | |
384 | - <text class="co-red">省{{filters.toFix(data.shop_price-g_filters.get_card_price(data,card_list,0),2)}}</text>元 | |
384 | + 成为{{g_filters.get_card_price(front_g,card_list,1)}}立 | |
385 | + <text class="co-red">省{{filters.toFix(front_g.shop_price-g_filters.get_card_price(front_g,card_list,0),2)}}</text>元 | |
385 | 386 | </view> |
386 | 387 | <view class="fs22 xc-ash">开通会员 尽享更多优惠</view> |
387 | 388 | </view> |
... | ... | @@ -393,7 +394,7 @@ |
393 | 394 | </view> |
394 | 395 | </view> |
395 | 396 | <!-- 立即续费的显示 --> |
396 | - <view wx:elif="{{is_near_date && data[card_field]>0 && prom_type!=1 && prom_type!=2 && card_name!=''}}"> | |
397 | + <view wx:elif="{{is_near_date && front_g[card_field]>0 && prom_type!=1 && prom_type!=2 && card_name!=''}}"> | |
397 | 398 | <view class="beauty-makeup-frame flex ai-center"> |
398 | 399 | <view class="left flex ai-center jc_sa"> |
399 | 400 | <view class="flex ai-center grade-card-frame card-frame advert-card"> |
... | ... | @@ -404,7 +405,7 @@ |
404 | 405 | <view class="fs24 xc-black3"> |
405 | 406 | 成为{{card_name}}立 |
406 | 407 | <text class="co-red"> |
407 | - 省{{filters.toFix(data.shop_price[card_field],2)}} | |
408 | + 省{{filters.toFix(front_g.shop_price[card_field],2)}} | |
408 | 409 | </text> |
409 | 410 | 元 |
410 | 411 | </view> |
... | ... | @@ -422,13 +423,13 @@ |
422 | 423 | <!-- 许程商品名字 --> |
423 | 424 | <view wx:if="{{prom_type!=1 && prom_type!=2 }}"> |
424 | 425 | <view class="goods-title"> |
425 | - <image wx:if="{{data.commission > 0}}" style="width: 25rpx;height: 25rpx;margin-right: 6rpx;" src="https://mshop-lib.yolipai.net/template/mobile/new/static/images/addmoney.png"></image> | |
426 | - <view class="goods-name elli">{{data.goods_name}}</view> | |
426 | + <image wx:if="{{front_g.commission > 0}}" style="width: 25rpx;height: 25rpx;margin-right: 6rpx;" src="https://mshop-lib.yolipai.net/template/mobile/new/static/images/addmoney.png"></image> | |
427 | + <view class="goods-name elli">{{front_g.goods_name}}</view> | |
427 | 428 | </view> |
428 | 429 | </view> |
429 | 430 | <view class="goods-num" wx:if="{{prom_type!=1 && prom_type!=2}}"> |
430 | - <view class="sales">销量:{{data.sales_sum}}件</view> | |
431 | - <view class="stock">折扣:{{g_filters.num(data.disc)}}折</view> | |
431 | + <view class="sales">销量:{{front_g.sales_sum}}件</view> | |
432 | + <view class="stock">折扣:{{g_filters.num(front_g.disc)}}折</view> | |
432 | 433 | <view class="stock">{{categories3[0].num}}人评价</view> |
433 | 434 | </view> |
434 | 435 | |
... | ... | @@ -437,10 +438,10 @@ |
437 | 438 | <view class="flex" style="align-items: baseline;"> |
438 | 439 | <view class="flex xc-price-frame"> |
439 | 440 | <text class="fs30">¥</text> |
440 | - {{prom_price}} | |
441 | + {{f_prom_price}} | |
441 | 442 | </view> |
442 | - <view wx:if="{{is_retail_price}}" class="word-line fs24 no_line_x">零售价:¥{{filters.toFix(data.market_price,2)}}</view> | |
443 | - <view wx:else class="word-line no_line_x fs24">¥{{filters.toFix(data.shop_price,2)}}</view> | |
443 | + <view wx:if="{{is_retail_price}}" class="word-line fs24 no_line_x">零售价:¥{{filters.toFix(front_g.market_price,2)}}</view> | |
444 | + <view wx:else class="word-line no_line_x fs24">¥{{filters.toFix(front_g.shop_price,2)}}</view> | |
444 | 445 | </view> |
445 | 446 | <!-- 这个是分享按钮 --> |
446 | 447 | <view wx:if="{{isLogin}}" class="xc-share-frame t-c shrink0" bindtap="clickShare"> |
... | ... | @@ -453,11 +454,11 @@ |
453 | 454 | |
454 | 455 | <!-- 秒杀的活动名称 --> |
455 | 456 | <view class="xc-explain fs32 ellipsis-2" wx:if="{{prom_type!=0 && prom_type!=4 && prom_type!=2}}"> |
456 | - {{sele_g.goods_name}} | |
457 | + {{front_g.goods_name}} | |
457 | 458 | </view> |
458 | 459 | |
459 | 460 | <view class="xc-explain flex jc_sb" wx:if="{{prom_type==2}}"> |
460 | - <view class="fs32 ellipsis-2" style="max-width:80%; max-height: 90rpx;">{{sele_g.goods_name}}</view> | |
461 | + <view class="fs32 ellipsis-2" style="max-width:80%; max-height: 90rpx;">{{front_g.goods_name}}</view> | |
461 | 462 | <!-- 这个是分享按钮 --> |
462 | 463 | <view wx:if="{{isLogin}}" class="xc-share-frame t-c shrink0" bindtap="clickShare" style="flex-shrink:0;position: relative;top: -22rpx;"> |
463 | 464 | <view class="iconfont icon-share"></view> |
... | ... | @@ -465,26 +466,26 @@ |
465 | 466 | </view> |
466 | 467 | </view> |
467 | 468 | |
468 | - <!-- 许程 7.24 暂时注释 --> | |
469 | + <!-- 许程 7.24 暂时注释,秒杀才有多规格--> | |
469 | 470 | <view wx:if="{{prom_type==1}}"> |
470 | 471 | <view class="goods-num"> |
471 | - <block wx:if="prom_st>0"> | |
472 | - <view class="stock">总数量:{{prom_act.is_virtual_count ? prom_act.goods_num : (prom_act.goods_num+prom_act.virtual)}}件</view> | |
473 | - <view class="stock" wx:if="{{prom_act.buy_limit>0}}">限购:{{prom_act.buy_limit}}件</view> | |
472 | + <block wx:if="f_prom_st>0"> | |
473 | + <view class="stock">总数量:{{f_prom_act.is_virtual_count ? f_prom_act.goods_num : (f_prom_act.goods_num+f_prom_act.virtual)}}件</view> | |
474 | + <view class="stock" wx:if="{{f_prom_act.buy_limit>0}}">限购:{{f_prom_act.buy_limit}}件</view> | |
474 | 475 | <view class="stock" wx:else>限购:不限</view> |
475 | 476 | |
476 | - <block wx:if="{{prom_st==0}}"> | |
477 | + <block wx:if="{{f_prom_st==0}}"> | |
477 | 478 | <view class="sales">已购:0件</view> |
478 | 479 | </block> |
479 | 480 | <block wx:else> |
480 | - <view class="sales">已购:{{prom_act.buy_num+prom_act.virtual}}件</view> | |
481 | + <view class="sales">已购:{{f_prom_act.buy_num+f_prom_act.virtual}}件</view> | |
481 | 482 | </block> |
482 | 483 | </block> |
483 | 484 | <block wx:else> |
484 | - <view class="stock">总数量:{{prom_act.goods_num}}件</view> | |
485 | - <view class="stock" wx:if="{{prom_act.buy_limit>0}}">限购:{{prom_act.buy_limit}}件</view> | |
485 | + <view class="stock">总数量:{{f_prom_act.goods_num}}件</view> | |
486 | + <view class="stock" wx:if="{{f_prom_act.buy_limit>0}}">限购:{{f_prom_act.buy_limit}}件</view> | |
486 | 487 | <view class="stock" wx:else>限购:不限</view> |
487 | - <view class="sales">已购:{{prom_act.buy_num}}件</view> | |
488 | + <view class="sales">已购:{{f_prom_act.buy_num}}件</view> | |
488 | 489 | </block> |
489 | 490 | </view> |
490 | 491 | </view> |
... | ... | @@ -574,18 +575,17 @@ |
574 | 575 | <!-- </view>--> |
575 | 576 | <!-- </view>--> |
576 | 577 | <!-- </block>--> |
577 | - | |
578 | - | |
579 | - <block wx:if="{{order_prom}}"> | |
578 | + | |
579 | + <block wx:if="{{f_order_prom}}"> | |
580 | 580 | <view class="cx-frame flex" style="position: relative; height: auto"> |
581 | 581 | <view class="cx-sizs fs30 pdr20">订单优惠</view> |
582 | 582 | <!-- 中间显示层 --> |
583 | 583 | <view class="flex ai-center"> |
584 | 584 | <image class="hui_img" src="{{iurl}}/miniapp//images/hui.png"></image> |
585 | 585 | <view class="order_hui"> |
586 | - <view class="fs28 ellipsis-1">{{order_prom.name}}</view> | |
586 | + <view class="fs28 ellipsis-1">{{f_order_prom.name}}</view> | |
587 | 587 | <view class="fs26"> |
588 | - (活动时间:{{tool.format_tt(order_prom.start_time)}} - {{tool.format_tt(order_prom.end_time)}}) | |
588 | + (活动时间:{{tool.format_tt(f_order_prom.start_time)}} - {{tool.format_tt(f_order_prom.end_time)}}) | |
589 | 589 | </view> |
590 | 590 | </view> |
591 | 591 | </view> |
... | ... | @@ -616,9 +616,9 @@ |
616 | 616 | |
617 | 617 | <!-- 判断是不是有秒杀 --> |
618 | 618 | <!-- 判断是不是有秒杀 --> |
619 | - <block wx:if="{{more_flash}}"> | |
619 | + <block wx:if="{{f_more_flash}}"> | |
620 | 620 | |
621 | - <block wx:for="{{more_flash}}"> | |
621 | + <block wx:for="{{f_more_flash}}"> | |
622 | 622 | <!-- <view class="cx-frame flex" style="position: relative; height: auto" wx:if="{{item.prom_type==1}}">--> |
623 | 623 | <view class="cx-frame flex" style="position: relative; height: auto" > |
624 | 624 | <view wx:if="{{item.prom_type==1}}" class="cx-sizs wsize" style="width: 144rpx">秒杀</view> |
... | ... | @@ -657,11 +657,11 @@ |
657 | 657 | </block> |
658 | 658 | |
659 | 659 | <!-- 新增促销多活动的排版 --> |
660 | - <view class="bdt16" wx:if="{{ prom_type!=1 && prom_type!=2 && prom_type!=4 && prom_type!=6 && cx_prom_group.length>0}}"> | |
660 | + <view class="bdt16" wx:if="{{ prom_type!=1 && prom_type!=2 && prom_type!=4 && prom_type!=6 && f_cx_prom_group.length>0}}"> | |
661 | 661 | <view data-coupon="1" bindtap="switch_cx_group" class="cx-frame flex" style="position: relative"> |
662 | 662 | <view class="cx-sizs fs30">促销</view> |
663 | 663 | <view class="flex ai_c f1 pdh20"> |
664 | - <view class="xc-coupon-fram" wx:for="{{cx_prom_group}}" > | |
664 | + <view class="xc-coupon-fram" wx:for="{{f_cx_prom_group}}" > | |
665 | 665 | <view wx:if="{{item.prom_type==3}}" class="xc-coupon t-c four-level-word">优惠促销</view> |
666 | 666 | <view wx:if="{{item.prom_type==5}}" class="xc-coupon t-c four-level-word">搭配促销</view> |
667 | 667 | <view wx:if="{{item.prom_type==7}}" class="xc-coupon t-c four-level-word">组合购</view> |
... | ... | @@ -676,7 +676,7 @@ |
676 | 676 | |
677 | 677 | |
678 | 678 | <!-- 许程 7.24暂时注释 --> |
679 | - <view class="bdt16" wx:if="{{ prom_type!=1 && prom_act.kttype!=3&&prom_act.kttype!=2&&prom_act.kttype!=1 && is_closecoupon!=1 && sele_g.is_xz_yh !=1 && fir_quan.length>0 }}"> | |
679 | + <view class="bdt16" wx:if="{{ prom_type!=1 && prom_act.kttype!=3&&prom_act.kttype!=2&&prom_act.kttype!=1 && is_closecoupon!=1 && front_g.is_xz_yh !=1 && fir_quan.length>0 }}"> | |
680 | 680 | <view data-coupon="1" bindtap="switchCoupon" class="cx-frame flex" style="position: relative"> |
681 | 681 | <view class="cx-sizs fs30">领券</view> |
682 | 682 | <view class="flex ai_c f1 pdh20"> |
... | ... | @@ -695,8 +695,8 @@ |
695 | 695 | </view> |
696 | 696 | |
697 | 697 | <!-- 门店收货地址 --> |
698 | - <view class="xc-address_frame bdt16 flex-vertical xc-ash {{def_pick_store!=null?'sn_height':'on_height'}}"> | |
699 | - <view class="address_frame" bindtap="choice_store" data-ind="0"> | |
698 | + <view class="xc-address_frame bdt16 flex-vertical xc-ash {{front_pick!=null?'sn_height':'on_height'}}"> | |
699 | + <view class="address_frame" bindtap="choice_store" data-ind="0" data-isfront="1" > | |
700 | 700 | <view class="flex-vertical-between "> |
701 | 701 | <view class="flex-vertical select_store_height"> |
702 | 702 | <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image> |
... | ... | @@ -704,36 +704,36 @@ |
704 | 704 | </view> |
705 | 705 | <view hidden="{{has_def && sys_switch.is_pricing_open_store}}" class="red_bb fs26">更多门店<text class="bg_jj"></text></view> |
706 | 706 | </view> |
707 | - <view wx:if="{{def_pick_store && def_pick_store.pickup_name}}"> | |
707 | + <view wx:if="{{front_pick && front_pick.pickup_name}}"> | |
708 | 708 | <view class="flex-space-between address ai_end pdv10"> |
709 | 709 | <view> |
710 | - <text class="fs30 xc-black3 shop_name bold">{{def_pick_store.pickup_name}}</text> | |
710 | + <text class="fs30 xc-black3 shop_name bold">{{front_pick.pickup_name}}</text> | |
711 | 711 | </view> |
712 | - <view class="distance fs24" wx:if="{{def_pick_store.distance!=null}}"> | |
713 | - 距离:{{def_pick_store.distance>1000?filters.toFix(def_pick_store.distance/1000,2)+"km":filters.toFix(def_pick_store.distance,0)+"m"}} | |
712 | + <view class="distance fs24" wx:if="{{front_pick.distance!=null}}"> | |
713 | + 距离:{{front_pick.distance>1000?filters.toFix(front_pick.distance/1000,2)+"km":filters.toFix(front_pick.distance,0)+"m"}} | |
714 | 714 | </view> |
715 | 715 | </view> |
716 | - <view class="no_store" wx:if="{{only_pk && !only_pk.length}}">(库存不足)</view> | |
716 | + <view class="no_store" wx:if="{{front_only_pk && !front_only_pk.length}}">(库存不足)</view> | |
717 | 717 | <block wx:else> |
718 | - <view class="no_store" wx:if="{{def_pickpu_list && !def_pickpu_list.length}}"> | |
718 | + <view class="no_store" wx:if="{{front_def_pickpu_list && !front_def_pickpu_list.length}}"> | |
719 | 719 | (库存不足) |
720 | 720 | </view> |
721 | 721 | <block wx:else> |
722 | - <view class="no_store" wx:if="{{def_pick_store && def_pick_store.is_no_dis}}"> | |
722 | + <view class="no_store" wx:if="{{front_pick && front_pick.is_no_dis}}"> | |
723 | 723 | (配送不匹配) |
724 | 724 | </view> |
725 | - <view class="no_store" wx:elif="{{def_pick_store && def_pick_store.is_no_dis_nor && prom_type==0}}"> | |
725 | + <view class="no_store" wx:elif="{{front_pick && front_pick.is_no_dis_nor && prom_type==0}}"> | |
726 | 726 | (该店不可售) |
727 | 727 | </view> |
728 | - <view class="no_store" wx:elif="{{def_pick_store && def_pick_store.is_no_dis_act}}"> | |
728 | + <view class="no_store" wx:elif="{{front_pick && front_pick.is_no_dis_act}}"> | |
729 | 729 | (该店不可售) |
730 | 730 | </view> |
731 | - <view class="no_store" wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules>=2 && prom_type==0 && !sele_g.whsle_id}}"> | |
731 | + <view class="no_store" wx:elif="{{front_pick && !front_pick.CanOutQty && !filters.is_virtual_gd(front_g.is_virtual) && sales_rules>=2 && prom_type==0 && !front_g.whsle_id}}"> | |
732 | 732 | (库存不足) |
733 | 733 | </view> |
734 | 734 | </block> |
735 | 735 | </block> |
736 | - <view class="fs24 xc-ash-9f">地址:{{def_pick_store.fulladdress}}</view> | |
736 | + <view class="fs24 xc-ash-9f">地址:{{front_pick.fulladdress}}</view> | |
737 | 737 | </view> |
738 | 738 | </view> |
739 | 739 | </view> |
... | ... | @@ -803,6 +803,7 @@ |
803 | 803 | </view> |
804 | 804 | </scroll-view> |
805 | 805 | </view> |
806 | + | |
806 | 807 | <!-- 图文详情 --> |
807 | 808 | <view class="bdt16"> |
808 | 809 | <view class="t_g_info"> |
... | ... | @@ -816,7 +817,7 @@ |
816 | 817 | <text>商品名称</text> |
817 | 818 | </view> |
818 | 819 | <view class="item_right"> |
819 | - <text>{{data.goods_name}}</text> | |
820 | + <text>{{front_g.goods_name}}</text> | |
820 | 821 | </view> |
821 | 822 | </view> |
822 | 823 | <view class="tb_item tb-l"> |
... | ... | @@ -824,7 +825,7 @@ |
824 | 825 | <text>商品编号</text> |
825 | 826 | </view> |
826 | 827 | <view class="item_right"> |
827 | - <text>{{data.goods_sn}}</text> | |
828 | + <text>{{front_g.goods_sn}}</text> | |
828 | 829 | </view> |
829 | 830 | </view> |
830 | 831 | <view class="tb_item tb-l"> |
... | ... | @@ -832,7 +833,7 @@ |
832 | 833 | <text>商品条码</text> |
833 | 834 | </view> |
834 | 835 | <view class="item_right"> |
835 | - <text>{{data.sku}}</text> | |
836 | + <text>{{front_g.sku}}</text> | |
836 | 837 | </view> |
837 | 838 | </view> |
838 | 839 | <view class="tb_item tb-l" wx:if="{{cat_name && is_show_pl}}"> |
... | ... | @@ -864,7 +865,7 @@ |
864 | 865 | <text>规格</text> |
865 | 866 | </view> |
866 | 867 | <view class="item_right"> |
867 | - <text>{{filters.show_gui_ge(data.goods_spec,data.goods_color)}}</text> | |
868 | + <text>{{filters.show_gui_ge(front_g.goods_spec,front_g.goods_color)}}</text> | |
868 | 869 | </view> |
869 | 870 | </view> |
870 | 871 | <view class="tb_item tb-l"> |
... | ... | @@ -872,7 +873,7 @@ |
872 | 873 | <text>上架时间</text> |
873 | 874 | </view> |
874 | 875 | <view class="item_right"> |
875 | - <text>{{data.on_time}}</text> | |
876 | + <text>{{front_g.on_time}}</text> | |
876 | 877 | </view> |
877 | 878 | </view> |
878 | 879 | </view> |
... | ... | @@ -904,7 +905,7 @@ |
904 | 905 | <text>商品名称</text> |
905 | 906 | </view> |
906 | 907 | <view class="item_right"> |
907 | - <text>{{data.goods_name}}</text> | |
908 | + <text>{{front_g.goods_name}}</text> | |
908 | 909 | </view> |
909 | 910 | </view> |
910 | 911 | <view class="tb_item tb-l"> |
... | ... | @@ -912,7 +913,7 @@ |
912 | 913 | <text>商品编号</text> |
913 | 914 | </view> |
914 | 915 | <view class="item_right"> |
915 | - <text>{{data.goods_sn}}</text> | |
916 | + <text>{{front_g.goods_sn}}</text> | |
916 | 917 | </view> |
917 | 918 | </view> |
918 | 919 | <view class="tb_item tb-l"> |
... | ... | @@ -920,7 +921,7 @@ |
920 | 921 | <text>商品条码</text> |
921 | 922 | </view> |
922 | 923 | <view class="item_right"> |
923 | - <text>{{data.sku}}</text> | |
924 | + <text>{{front_g.sku}}</text> | |
924 | 925 | </view> |
925 | 926 | </view> |
926 | 927 | <view class="tb_item tb-l" wx:if="{{cat_name && is_show_pl}}"> |
... | ... | @@ -952,7 +953,7 @@ |
952 | 953 | <text>规格</text> |
953 | 954 | </view> |
954 | 955 | <view class="item_right"> |
955 | - <text>{{data.goods_spec==""?"规格1":data.goods_spec}}</text> | |
956 | + <text>{{front_g.goods_spec==""?"规格1":front_g.goods_spec}}</text> | |
956 | 957 | </view> |
957 | 958 | </view> |
958 | 959 | <view class="tb_item tb-l"> |
... | ... | @@ -960,7 +961,7 @@ |
960 | 961 | <text>上架时间</text> |
961 | 962 | </view> |
962 | 963 | <view class="item_right"> |
963 | - <text>{{data.on_time}}</text> | |
964 | + <text>{{front_g.on_time}}</text> | |
964 | 965 | </view> |
965 | 966 | </view> |
966 | 967 | </view> |
... | ... | @@ -1102,13 +1103,13 @@ |
1102 | 1103 | <view>购物车</view> |
1103 | 1104 | </navigator> |
1104 | 1105 | </view> |
1105 | - <view bindtap="openSpecModel" class="buy-btn cart-btn cart-btn-lg" wx:if="{{data.goods.is_virtual}}"> | |
1106 | + <view bindtap="openSpecModel" class="buy-btn cart-btn cart-btn-lg" wx:if="{{front_g.goods.is_virtual}}"> | |
1106 | 1107 | 立即购买 |
1107 | 1108 | </view> |
1108 | 1109 | <!-- 普通商品购买 --> |
1109 | 1110 | <block wx:if="{{prom_type==0 || prom_type==3}}"> |
1110 | 1111 | <!-- 线上销售的时候,要判断库存量, 线下库存的时候不用判断 --> |
1111 | - <block wx:if="{{(sele_g.store_count>0 && sales_rules==1) || sales_rules>=2 }}"> | |
1112 | + <block wx:if="{{(front_g.store_count>0 && sales_rules==1) || sales_rules>=2 }}"> | |
1112 | 1113 | <view bindtap="openSpecModel" data-ind="1" class="join-btn cart-btn">加入购物车</view> |
1113 | 1114 | <view bindtap="openSpecModel" data-ind="2" class="buy-btn cart-btn">立即购买</view> |
1114 | 1115 | </block> |
... | ... | @@ -1117,15 +1118,15 @@ |
1117 | 1118 | </block> |
1118 | 1119 | </block> |
1119 | 1120 | <!-- -----秒杀------ --> |
1120 | - <block wx:if="{{prom_type==1 || prom_type==2}}"> | |
1121 | - <block wx:if="{{prom_st==1 && !prom_r_null}}"> | |
1121 | + <block wx:if="{{prom_type==1}}"> | |
1122 | + <block wx:if="{{f_prom_st==1 && !f_prom_r_null}}"> | |
1122 | 1123 | <view bindtap="openSpecModel" data-ind="1" class="join-btn cart-btn">加入购物车</view> |
1123 | 1124 | <view bindtap="openSpecModel" data-ind="2" class="buy-btn cart-btn">立即抢购</view> |
1124 | 1125 | </block> |
1125 | 1126 | |
1126 | - <block wx:if="{{prom_st==0 && !prom_r_null}}"> | |
1127 | + <block wx:if="{{f_prom_st==0 && !f_prom_r_null}}"> | |
1127 | 1128 | <!-- 秒杀预热要单独购买 --> |
1128 | - <block wx:if="{{prom_type==1 && prom_act.is_shop_buy}}"> | |
1129 | + <block wx:if="{{prom_type==1 && f_prom_act.is_shop_buy}}"> | |
1129 | 1130 | <view bindtap="openSpecModel_Nor" data-nor="1" class="join-btn cart-btn">单独购买</view> |
1130 | 1131 | <view class="buy-btn cart-btn lanse">即将开始</view> |
1131 | 1132 | </block> |
... | ... | @@ -1135,12 +1136,12 @@ |
1135 | 1136 | </block> |
1136 | 1137 | |
1137 | 1138 | |
1138 | - <block wx:if="{{prom_r_null}}"> | |
1139 | + <block wx:if="{{f_prom_r_null}}"> | |
1139 | 1140 | <block wx:if="{{prom_type==1}}"> |
1140 | 1141 | |
1141 | 1142 | <!-- 多个秒杀的时候 --> |
1142 | 1143 | <block wx:if="{{is_more_flash}}"> |
1143 | - <block wx:if="{{prom_act.is_shop_buy}}"> | |
1144 | + <block wx:if="{{f_prom_act.is_shop_buy}}"> | |
1144 | 1145 | <view bindtap="openSpecModel_Nor" data-nor="1" class="join-btn cart-btn">单独购买</view> |
1145 | 1146 | <view bindtap="openSpecModel" data-ind="2" class="buy-btn cart-btn">立即抢购</view> |
1146 | 1147 | </block> |
... | ... | @@ -1150,7 +1151,7 @@ |
1150 | 1151 | </block> |
1151 | 1152 | </block> |
1152 | 1153 | <block wx:else> |
1153 | - <block wx:if="{{prom_act.is_shop_buy}}"> | |
1154 | + <block wx:if="{{f_prom_act.is_shop_buy}}"> | |
1154 | 1155 | <view bindtap="openSpecModel_Nor" data-nor="1" class="join-btn cart-btn">单独购买</view> |
1155 | 1156 | <view class="buy-btn cart-btn huise">已抢光</view> |
1156 | 1157 | </block> |
... | ... | @@ -1165,6 +1166,65 @@ |
1165 | 1166 | <view wx:else class="buy-btn cart-btn cart-btn-lg huise set_width">已抢光</view> |
1166 | 1167 | |
1167 | 1168 | </block> |
1169 | + <block wx:if="{{f_prom_st==3 && !f_prom_r_null}}"> | |
1170 | + <block wx:if="{{prom_type==1 && f_prom_act.is_shop_buy}}"> | |
1171 | + <view bindtap="openSpecModel_Nor" data-nor="1" class="join-btn cart-btn">单独购买</view> | |
1172 | + <view class="buy-btn cart-btn huise">活动已经结束</view> | |
1173 | + </block> | |
1174 | + <view wx:else class="buy-btn cart-btn cart-btn-lg lanse set_width">活动已经结束</view> | |
1175 | + </block> | |
1176 | + </block> | |
1177 | + | |
1178 | + | |
1179 | + <!-- -----团购------ --> | |
1180 | + <block wx:if="{{prom_type==2}}"> | |
1181 | + <block wx:if="{{prom_st==1 && !prom_r_null}}"> | |
1182 | + <view bindtap="openSpecModel" data-ind="1" class="join-btn cart-btn">加入购物车</view> | |
1183 | + <view bindtap="openSpecModel" data-ind="2" class="buy-btn cart-btn">立即抢购</view> | |
1184 | + </block> | |
1185 | + | |
1186 | + <block wx:if="{{prom_st==0 && !prom_r_null}}"> | |
1187 | + <!-- 秒杀预热要单独购买 --> | |
1188 | + <block wx:if="{{prom_type==1 && prom_act.is_shop_buy}}"> | |
1189 | + <view bindtap="openSpecModel_Nor" data-nor="1" class="join-btn cart-btn">单独购买</view> | |
1190 | + <view class="buy-btn cart-btn lanse">即将开始</view> | |
1191 | + </block> | |
1192 | + <block wx:else> | |
1193 | + <view class="buy-btn cart-btn cart-btn-lg lanse set_width">即将开始</view> | |
1194 | + </block> | |
1195 | + </block> | |
1196 | + | |
1197 | + | |
1198 | + <block wx:if="{{prom_r_null}}"> | |
1199 | + <block wx:if="{{prom_type==1}}"> | |
1200 | + | |
1201 | + <!-- 多个秒杀的时候 --> | |
1202 | + <block wx:if="{{is_more_flash}}"> | |
1203 | + <block wx:if="{{prom_act.is_shop_buy}}"> | |
1204 | + <view bindtap="openSpecModel_Nor" data-nor="1" class="join-btn cart-btn">单独购买</view> | |
1205 | + <view bindtap="openSpecModel" data-ind="2" class="buy-btn cart-btn">立即抢购</view> | |
1206 | + </block> | |
1207 | + <block wx:else> | |
1208 | + <view bindtap="openSpecModel" data-ind="1" class="join-btn cart-btn">加入购物车</view> | |
1209 | + <view bindtap="openSpecModel" data-ind="2" class="buy-btn cart-btn">立即抢购</view> | |
1210 | + </block> | |
1211 | + </block> | |
1212 | + <block wx:else> | |
1213 | + <block wx:if="{{prom_act.is_shop_buy}}"> | |
1214 | + <view bindtap="openSpecModel_Nor" data-nor="1" class="join-btn cart-btn">单独购买</view> | |
1215 | + <view class="buy-btn cart-btn huise">已抢光</view> | |
1216 | + </block> | |
1217 | + <block wx:else> | |
1218 | + <view class="buy-btn cart-btn huise">已抢光</view> | |
1219 | + </block> | |
1220 | + </block> | |
1221 | + | |
1222 | + | |
1223 | + </block> | |
1224 | + | |
1225 | + <view wx:else class="buy-btn cart-btn cart-btn-lg huise set_width">已抢光</view> | |
1226 | + | |
1227 | + </block> | |
1168 | 1228 | <block wx:if="{{prom_st==3 && !prom_r_null}}"> |
1169 | 1229 | <block wx:if="{{prom_type==1 && prom_act.is_shop_buy}}"> |
1170 | 1230 | <view bindtap="openSpecModel_Nor" data-nor="1" class="join-btn cart-btn">单独购买</view> |
... | ... | @@ -1173,15 +1233,16 @@ |
1173 | 1233 | <view wx:else class="buy-btn cart-btn cart-btn-lg lanse set_width">活动已经结束</view> |
1174 | 1234 | </block> |
1175 | 1235 | </block> |
1236 | + | |
1176 | 1237 | <!-- -----拼单------ --> |
1177 | 1238 | <block wx:if="{{prom_type==6}}"> |
1178 | 1239 | <view bindtap="openSpecModel_pt" data-it="1" data-ind="1" class="join-btn cart-btn line-h"> |
1179 | 1240 | <view class="fir-v"> |
1180 | - <!-- ¥{{data.shop_price,2)}} --> | |
1181 | - <block wx:if="{{card_field && sele_g[card_field]>0}}"> | |
1182 | - {{filters.toFix(sele_g[card_field],2)}} | |
1241 | + | |
1242 | + <block wx:if="{{card_field && front_g[card_field]>0}}"> | |
1243 | + {{filters.toFix(front_g[card_field],2)}} | |
1183 | 1244 | </block> |
1184 | - <block wx:else>{{filters.toFix(sele_g.shop_price,2)}}</block> | |
1245 | + <block wx:else>{{filters.toFix(front_g.shop_price,2)}}</block> | |
1185 | 1246 | </view> |
1186 | 1247 | <view>单独购买</view> |
1187 | 1248 | </view> |
... | ... | @@ -1236,10 +1297,10 @@ |
1236 | 1297 | <block wx:if="{{is_shopbuy}}"> |
1237 | 1298 | <view bindtap="go_pay_integral_normal" class="join-btn cart-btn line-h"> |
1238 | 1299 | <view class="fir-v"> |
1239 | - <block wx:if="{{card_field && sele_g[card_field]>0}}"> | |
1240 | - {{filters.toFix(sele_g[card_field],2)}} | |
1300 | + <block wx:if="{{card_field && front_g[card_field]>0}}"> | |
1301 | + {{filters.toFix(front_g[card_field],2)}} | |
1241 | 1302 | </block> |
1242 | - <block wx:else>{{filters.toFix(sele_g.shop_price,2)}}</block> | |
1303 | + <block wx:else>{{filters.toFix(front_g.shop_price,2)}}</block> | |
1243 | 1304 | </view> |
1244 | 1305 | <view>单独购买</view> |
1245 | 1306 | </view> |
... | ... | @@ -1390,12 +1451,12 @@ |
1390 | 1451 | <view hidden="{{ismend==1}}" style="max-height: 120rpx;overflow-y: auto;"> |
1391 | 1452 | |
1392 | 1453 | <block wx:if="{{sku_g_pt}}"> |
1393 | - <view class="spec_bt {{gid==item.goods_id?'act':''}}" bindtap="sele_spec" data-gid='{{item.goods_id}}' wx:for="{{sku_g_pt}}" wx:key="sku_g"> | |
1454 | + <view class="spec_bt {{sele_g.goods_id==item.goods_id?'act':''}}" bindtap="sele_spec" data-gid='{{item.goods_id}}' wx:for="{{sku_g_pt}}" wx:key="sku_g"> | |
1394 | 1455 | {{item.gg}} |
1395 | 1456 | </view> |
1396 | 1457 | </block> |
1397 | 1458 | <block wx:else> |
1398 | - <view class="spec_bt {{gid==item.goods_id?'act':''}}" bindtap="sele_spec" data-gid='{{item.goods_id}}' wx:for="{{sku_g}}" wx:key="sku_g"> | |
1459 | + <view class="spec_bt {{sele_g.goods_id==item.goods_id?'act':''}}" bindtap="sele_spec" data-gid='{{item.goods_id}}' wx:for="{{sku_g}}" wx:key="sku_g"> | |
1399 | 1460 | {{item.gg}} |
1400 | 1461 | </view> |
1401 | 1462 | </block> |
... | ... | @@ -1682,7 +1743,7 @@ |
1682 | 1743 | <view class="store-list"> |
1683 | 1744 | <!-- 如果还没有点击更多门店的时候 --> |
1684 | 1745 | <block wx:if="{{choice_sort_store==0}}"> |
1685 | - <!-- 需要for循环 --> | |
1746 | + <!-- 需要for循环is_show_sto_cat表示门店的数量已经超10个 --> | |
1686 | 1747 | <block wx:if="{{is_show_sto_cat==1}}"> |
1687 | 1748 | <view class="store_choose flex" wx:for="{{def_pickpu_list}}" bindtap="choose_for_store_fir" data-ind="{{index}}"> |
1688 | 1749 | <view class="store flex-vertical"> |
... | ... | @@ -1716,6 +1777,7 @@ |
1716 | 1777 | </view> |
1717 | 1778 | </block> |
1718 | 1779 | <block wx:else> |
1780 | + <!-- 此时的情况就是门店的数量少于10个 --> | |
1719 | 1781 | <view class="store_choose flex" wx:for="{{only_pk}}" bindtap="choose_for_store_fir" data-ind="{{index}}"> |
1720 | 1782 | <view class="store flex-vertical"> |
1721 | 1783 | <!-- 需要点击事件 --> |
... | ... | @@ -1815,6 +1877,7 @@ |
1815 | 1877 | </block> |
1816 | 1878 | </view> |
1817 | 1879 | </block> |
1880 | + | |
1818 | 1881 | <!-- ---------------分享弹窗--------------- --> |
1819 | 1882 | <!-- 二维码显示页面 --> |
1820 | 1883 | <canvas canvas-id='share' style='width:750rpx;height:1217rpx;background-color:white;' wx:if="{{!canvasHidden}}"></canvas> |
... | ... | @@ -1849,7 +1912,7 @@ |
1849 | 1912 | <view class="t-c fs36" style="color: #c3172d">提示</view> |
1850 | 1913 | |
1851 | 1914 | <block wx:for="{{more_flash}}"> |
1852 | - <view bindtap="go_more_flash" data-prom_type="{{item.prom_type}}" data-id="{{item.act_id}}" class="flex jc_sb fs28 mt20" > | |
1915 | + <view bindtap="go_more_flash" data-is_sele="1" data-prom_type="{{item.prom_type}}" data-id="{{item.act_id}}" class="flex jc_sb fs28 mt20" > | |
1853 | 1916 | <view class="ellipsis-2" style="max-width: 80%">该商品有参与{{item.act_name}} {{tool.act_type(item.prom_type)}} 活动</view> |
1854 | 1917 | <view class="fs26 c-7b">去参与 |
1855 | 1918 | <text class="bg_jj is_more_cx"></text> | ... | ... |
pages/index/index/index.json
... | ... | @@ -10,6 +10,7 @@ |
10 | 10 | "shopname": "/components/diy_shopname/diy_shopname", |
11 | 11 | "pingd_buy": "/components/diy_pingd_buy/diy_pingd_buy", |
12 | 12 | "diy_public": "/components/diy_public/diy_public", |
13 | + "heat_img": "/components/diy_heatImg/diy_heatImg", | |
13 | 14 | "title": "/components/diy_title/diy_title", |
14 | 15 | "notice": "/components/diy_notice/diy_notice", |
15 | 16 | "voice": "/components/diy_voice/diy_voice", | ... | ... |
pages/index/index/index.wxml
... | ... | @@ -488,9 +488,10 @@ |
488 | 488 | <block wx:if="{{item.ename=='seckill' || item.ename=='seckillNew'}}"> |
489 | 489 | <seckill object="{{item.content}}"></seckill> |
490 | 490 | </block> |
491 | - <!-- <block wx:if="{{item.ename=='seckillNew'}}"> | |
492 | - <diy_public object="{{item.content}}" prom_type="1"></diy_public> | |
493 | - </block> --> | |
491 | + <!-- 热区切图 --> | |
492 | + <block wx:if="{{item.ename=='heatCutDiagram'}}"> | |
493 | + <heat_img object="{{item.content}}" ></heat_img> | |
494 | + </block> | |
494 | 495 | <!--标题--> |
495 | 496 | <block wx:if="{{item.ename=='title'}}"> |
496 | 497 | <title object="{{item.content}}"></title> | ... | ... |
pages/template/index.json
... | ... | @@ -13,6 +13,7 @@ |
13 | 13 | "pingd_buy": "/components/diy_pingd_buy/diy_pingd_buy", |
14 | 14 | "luckyGo": "/components/diy_luckyGo/diy_luckyGo", |
15 | 15 | "diy_public": "/components/diy_public/diy_public", |
16 | + "heat_img": "/components/diy_heatImg/diy_heatImg", | |
16 | 17 | "title": "/components/diy_title/diy_title", |
17 | 18 | "notice": "/components/diy_notice/diy_notice", |
18 | 19 | "voice": "/components/diy_voice/diy_voice", | ... | ... |
pages/template/index.wxml
... | ... | @@ -47,6 +47,10 @@ |
47 | 47 | <block wx:if="{{item.ename=='seckill' || item.ename=='seckillNew'}}"> |
48 | 48 | <seckill object="{{item.content}}"></seckill> |
49 | 49 | </block> |
50 | + <!-- 热区切图 --> | |
51 | + <block wx:if="{{item.ename=='heatCutDiagram'}}"> | |
52 | + <heat_img object="{{item.content}}" ></heat_img> | |
53 | + </block> | |
50 | 54 | <!-- <block wx:if="{{item.ename=='seckillNew'}}"> |
51 | 55 | <diy_public object="{{item.content}}" prom_type="1"></diy_public> |
52 | 56 | </block> --> | ... | ... |
pages/user/order_detail/order_detail.js
utils/more_cx.js
... | ... | @@ -402,7 +402,8 @@ module.exports = { |
402 | 402 | //-- 促销活动对象表,最初的map表,包含活动类型,活动id,goods商品 --- |
403 | 403 | var cx_act_map=[]; |
404 | 404 | for(var i=0; i<goods.length;i++){ |
405 | - var c_item=goods[i]; | |
405 | + //-- 运用深拷贝,避免价格的bug --s | |
406 | + var c_item= JSON.parse(JSON.stringify(goods[i])); | |
406 | 407 | //没有选中 |
407 | 408 | if(!c_item.selected) continue; |
408 | 409 | //如果是秒杀之类是商品 | ... | ... |
utils/util.js
... | ... | @@ -1012,5 +1012,11 @@ module.exports = { |
1012 | 1012 | wx_back:wx_back, |
1013 | 1013 | _debounce, |
1014 | 1014 | calculatewuliu:calculatewuliu, //计算物流的函数进行抽象 |
1015 | - format_content | |
1015 | + format_content, | |
1016 | + deep_cp:function(e){ | |
1017 | + if(!e) return null; | |
1018 | + //判断e是不是对象类型 | |
1019 | + var new_e = JSON.parse(JSON.stringify(e)); | |
1020 | + return new_e; | |
1021 | + } | |
1016 | 1022 | }; | ... | ... |