Commit 5f45ccd71d1b7a0454e7556ce976d34da920e609
Merge branch 'qa' of http://git.vipzhuang.cn/wxd/MShopWeApp
Showing
37 changed files
with
2505 additions
and
462 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 | \ No newline at end of file | 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,7 +67,7 @@ | ||
| 67 | <text>{{item.integral}}积分 + ¥{{item.addmoney}}</text> | 67 | <text>{{item.integral}}积分 + ¥{{item.addmoney}}</text> |
| 68 | </view> | 68 | </view> |
| 69 | <view class="pdt14 fs22 gray flex jc_sb"> | 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 | <view>销量:{{item.buy_num+item.virtual}}</view> | 71 | <view>销量:{{item.buy_num+item.virtual}}</view> |
| 72 | </view> | 72 | </view> |
| 73 | </view> | 73 | </view> |
packageC/pages/luckyGo/luckyGo_goodsInfo/buy_pt.wxml
| @@ -200,7 +200,7 @@ | @@ -200,7 +200,7 @@ | ||
| 200 | <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">请先选择门店</view> | 200 | <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">请先选择门店</view> |
| 201 | </block> | 201 | </block> |
| 202 | <block wx:else> | 202 | <block wx:else> |
| 203 | - <block wx:if="{{data.store_count<=0}}"> | 203 | + <block wx:if="{{sele_g.store_count<=0}}"> |
| 204 | <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view> | 204 | <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view> |
| 205 | </block> | 205 | </block> |
| 206 | <block wx:else> | 206 | <block wx:else> |
packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js
| @@ -297,7 +297,11 @@ Page({ | @@ -297,7 +297,11 @@ Page({ | ||
| 297 | nav_backgroundColor: "#ffffff", | 297 | nav_backgroundColor: "#ffffff", |
| 298 | nav_type: 2, //导航类型 | 298 | nav_type: 2, //导航类型 |
| 299 | istop: 0, //是否置顶风格为1 | 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,7 +1044,11 @@ Page({ | ||
| 1040 | 1044 | ||
| 1041 | this.wait_for_store_config(); | 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 | failRollback: !0, | 1052 | failRollback: !0, |
| 1045 | success: function (t) { | 1053 | success: function (t) { |
| 1046 | console.log(t); | 1054 | console.log(t); |
| @@ -1145,7 +1153,8 @@ Page({ | @@ -1145,7 +1153,8 @@ Page({ | ||
| 1145 | ee.setData({ | 1153 | ee.setData({ |
| 1146 | data: t.data.data, | 1154 | data: t.data.data, |
| 1147 | sele_g: t.data.data, | 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,12 +2341,11 @@ Page({ | ||
| 2332 | if (this.data.openSpecModal_pt && this.data.is_normal) { | 2341 | if (this.data.openSpecModal_pt && this.data.is_normal) { |
| 2333 | this.get_sto(); | 2342 | this.get_sto(); |
| 2334 | this.setData({ | 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 | this.sele_spec_chech_activity(); | 2348 | this.sele_spec_chech_activity(); |
| 2340 | - | ||
| 2341 | } | 2349 | } |
| 2342 | 2350 | ||
| 2343 | this.setData({ | 2351 | this.setData({ |
| @@ -3369,6 +3377,27 @@ Page({ | @@ -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 | deal_pickup(e) { | 3402 | deal_pickup(e) { |
| 3374 | var th = this; | 3403 | var th = this; |
| @@ -3502,15 +3531,21 @@ Page({ | @@ -3502,15 +3531,21 @@ Page({ | ||
| 3502 | th.setData({ def_pick_store: e.data.data.pageData[0] }) | 3531 | th.setData({ def_pick_store: e.data.data.pageData[0] }) |
| 3503 | } | 3532 | } |
| 3504 | } | 3533 | } |
| 3534 | + | ||
| 3535 | + //-- 设置商品详情页面的门店显示情况 --- | ||
| 3536 | + th.deal_front_pk(); | ||
| 3537 | + | ||
| 3505 | } else { | 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,6 +3564,9 @@ Page({ | ||
| 3529 | sto_sele_distr: e.data.data.pageData[0].distr_type | 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,6 +4036,7 @@ Page({ | ||
| 3998 | } | 4036 | } |
| 3999 | 4037 | ||
| 4000 | if(prom_type==9){ | 4038 | if(prom_type==9){ |
| 4039 | + ee.get_sto(); | ||
| 4001 | this.setData({ isshow: 1, }); | 4040 | this.setData({ isshow: 1, }); |
| 4002 | } | 4041 | } |
| 4003 | 4042 | ||
| @@ -4500,6 +4539,7 @@ Page({ | @@ -4500,6 +4539,7 @@ Page({ | ||
| 4500 | var th = this; | 4539 | var th = this; |
| 4501 | var ind = parseInt(e.currentTarget.dataset.ind); | 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 | //ind == 1是普通购买 | 4544 | //ind == 1是普通购买 |
| 4505 | if (ind == 1) { | 4545 | if (ind == 1) { |
| @@ -5940,7 +5980,10 @@ Page({ | @@ -5940,7 +5980,10 @@ Page({ | ||
| 5940 | 5980 | ||
| 5941 | var th = this; | 5981 | var th = this; |
| 5942 | var ind = ee.currentTarget.dataset.ind; | 5982 | var ind = ee.currentTarget.dataset.ind; |
| 5983 | + var isfront = ee.currentTarget.dataset.isfront; | ||
| 5943 | var bconfig = th.data.bconfig; | 5984 | var bconfig = th.data.bconfig; |
| 5985 | + th.data.isfront=0; | ||
| 5986 | + if(isfront) th.data.isfront=1; | ||
| 5944 | 5987 | ||
| 5945 | //如果开启了,则不在选择门店 | 5988 | //如果开启了,则不在选择门店 |
| 5946 | if(this.data.sys_switch.is_pricing_open_store && getApp().globalData.pk_store){ | 5989 | if(this.data.sys_switch.is_pricing_open_store && getApp().globalData.pk_store){ |
| @@ -6187,6 +6230,10 @@ Page({ | @@ -6187,6 +6230,10 @@ Page({ | ||
| 6187 | if (!th.data.sele_g) return false; | 6230 | if (!th.data.sele_g) return false; |
| 6188 | //判断门店的配送方式是不是匹配 | 6231 | //判断门店的配送方式是不是匹配 |
| 6189 | var g_distr_type = th.data.sele_g.distr_type; | 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 | if (item.distr_type != 0 && g_distr_type != 0 && item.distr_type != g_distr_type) { | 6237 | if (item.distr_type != 0 && g_distr_type != 0 && item.distr_type != g_distr_type) { |
| 6191 | wx.showToast({ | 6238 | wx.showToast({ |
| 6192 | title: "门店配送方式不匹配", | 6239 | title: "门店配送方式不匹配", |
| @@ -6208,6 +6255,12 @@ Page({ | @@ -6208,6 +6255,12 @@ Page({ | ||
| 6208 | fir_pick_index: 0 | 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 | if (openindstore == 1) { | 6264 | if (openindstore == 1) { |
| 6212 | th.setData({ | 6265 | th.setData({ |
| 6213 | openSpecModal: !0, | 6266 | openSpecModal: !0, |
| @@ -6314,6 +6367,12 @@ Page({ | @@ -6314,6 +6367,12 @@ Page({ | ||
| 6314 | choice_sort_store: 0 | 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 | var openindstore = th.data.open_ind_store; | 6376 | var openindstore = th.data.open_ind_store; |
| 6318 | if (openindstore == 1) { | 6377 | if (openindstore == 1) { |
| 6319 | th.setData({ | 6378 | th.setData({ |
packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.wxml
| @@ -418,8 +418,8 @@ | @@ -418,8 +418,8 @@ | ||
| 418 | 418 | ||
| 419 | </block> | 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 | <view class="flex-vertical-between "> | 423 | <view class="flex-vertical-between "> |
| 424 | <view class="flex-vertical select_store_height"> | 424 | <view class="flex-vertical select_store_height"> |
| 425 | <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image> | 425 | <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image> |
| @@ -427,30 +427,30 @@ | @@ -427,30 +427,30 @@ | ||
| 427 | </view> | 427 | </view> |
| 428 | <view hidden="{{has_def && sys_switch.is_pricing_open_store}}" class="red_bb fs26">更多门店<text class="bg_jj"></text></view> | 428 | <view hidden="{{has_def && sys_switch.is_pricing_open_store}}" class="red_bb fs26">更多门店<text class="bg_jj"></text></view> |
| 429 | </view> | 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 | <view class="flex-space-between address ai_end pdv10"> | 431 | <view class="flex-space-between address ai_end pdv10"> |
| 432 | <view> | 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 | </view> | 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 | </view> | 437 | </view> |
| 438 | </view> | 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 | <block wx:else> | 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 | </view> | 443 | </view> |
| 444 | <block wx:else> | 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 | </view> | 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 | </view> | 450 | </view> |
| 451 | </block> | 451 | </block> |
| 452 | </block> | 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 | </view> | 454 | </view> |
| 455 | </view> | 455 | </view> |
| 456 | </view> | 456 | </view> |
packageE/pages/cart/cart2/cart2.js
| @@ -1510,6 +1510,11 @@ Page({ | @@ -1510,6 +1510,11 @@ Page({ | ||
| 1510 | item1.is_post_temp=1; | 1510 | item1.is_post_temp=1; |
| 1511 | //如果是秒杀,团购的时候,优惠促销和搭配购的时候 | 1511 | //如果是秒杀,团购的时候,优惠促销和搭配购的时候 |
| 1512 | if([1,2,3,5,6,7,10].indexOf(item1.prom_type)>-1){ | 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 | var url= "/api/weshop/activitylist/getSJGoodsPriceNew/" + os.stoid | 1518 | var url= "/api/weshop/activitylist/getSJGoodsPriceNew/" + os.stoid |
| 1514 | + "/" + item1.goods_id + "/"+item1.prom_type+"/" + item1.prom_id + "/" + app.globalData.user_id; | 1519 | + "/" + item1.goods_id + "/"+item1.prom_type+"/" + item1.prom_id + "/" + app.globalData.user_id; |
| 1515 | await app.request.promiseGet(url,{}).then(res=>{ | 1520 | await app.request.promiseGet(url,{}).then(res=>{ |
| @@ -1522,6 +1527,11 @@ Page({ | @@ -1522,6 +1527,11 @@ Page({ | ||
| 1522 | }else item1.is_order_yh=0; | 1527 | }else item1.is_order_yh=0; |
| 1523 | 1528 | ||
| 1524 | item1.is_post_temp=res.data.data.is_post_temp; | 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,7 +2018,6 @@ Page({ | ||
| 2008 | //t.data.data.shop_price = tt.data.data.prom_price; | 2018 | //t.data.data.shop_price = tt.data.data.prom_price; |
| 2009 | gd.shop_price=t.data.data.shop_price = tt.data.data.prom_user_price; | 2019 | gd.shop_price=t.data.data.shop_price = tt.data.data.prom_user_price; |
| 2010 | th.data.ckeck_quan_price = 0; | 2020 | th.data.ckeck_quan_price = 0; |
| 2011 | - gd.is_xz_yh = 1; | ||
| 2012 | 2021 | ||
| 2013 | t.data.data.fir_rate = tt.data.data.fir_rate; | 2022 | t.data.data.fir_rate = tt.data.data.fir_rate; |
| 2014 | t.data.data.sec_rate = tt.data.data.sec_rate; | 2023 | t.data.data.sec_rate = tt.data.data.sec_rate; |
| @@ -2046,6 +2055,14 @@ Page({ | @@ -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 | th.setData({ | 2067 | th.setData({ |
| 2051 | bn_goods: gd, | 2068 | bn_goods: gd, |
| @@ -3911,6 +3928,7 @@ Page({ | @@ -3911,6 +3928,7 @@ Page({ | ||
| 3911 | is_by_quan = 1; | 3928 | is_by_quan = 1; |
| 3912 | } | 3929 | } |
| 3913 | } | 3930 | } |
| 3931 | + | ||
| 3914 | if (!is_by_quan) { | 3932 | if (!is_by_quan) { |
| 3915 | var user_addr = th.data.user_addr; | 3933 | var user_addr = th.data.user_addr; |
| 3916 | var req_d = { | 3934 | var req_d = { |
| @@ -6410,7 +6428,7 @@ Page({ | @@ -6410,7 +6428,7 @@ Page({ | ||
| 6410 | for (var i in goodlist) { | 6428 | for (var i in goodlist) { |
| 6411 | var gd = goodlist[i]; | 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 | continue; | 6432 | continue; |
| 6415 | } | 6433 | } |
| 6416 | 6434 | ||
| @@ -6421,6 +6439,10 @@ Page({ | @@ -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 | if (gd.prom_type == 2) { | 6448 | if (gd.prom_type == 2) { |
packageE/pages/cart/cart2/cart2.wxss
| @@ -278,7 +278,8 @@ page { | @@ -278,7 +278,8 @@ page { | ||
| 278 | padding: 0 42rpx; | 278 | padding: 0 42rpx; |
| 279 | border-radius: 36rpx; | 279 | border-radius: 36rpx; |
| 280 | margin-left: 0; | 280 | margin-left: 0; |
| 281 | - margin-right: 0; | 281 | + margin-right: 0; |
| 282 | + border: none; | ||
| 282 | } | 283 | } |
| 283 | 284 | ||
| 284 | .pay-amount { } | 285 | .pay-amount { } |
packageE/pages/cart/cart2_pt/cart2_pt.js
| @@ -77,6 +77,19 @@ Page({ | @@ -77,6 +77,19 @@ Page({ | ||
| 77 | bconfig:null, | 77 | bconfig:null, |
| 78 | showFold:true, | 78 | showFold:true, |
| 79 | template_id:[], | 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,6 +496,10 @@ Page({ | ||
| 483 | } else { | 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 | gd.prom_id=gg.prom_id; | 503 | gd.prom_id=gg.prom_id; |
| 487 | //--阶梯团很特殊,不能用总表来拿价格-- | 504 | //--阶梯团很特殊,不能用总表来拿价格-- |
| 488 | getApp().request.get("/api/weshop/teamlist/get/" + oo.stoid + "/" + gd.prom_id, { | 505 | getApp().request.get("/api/weshop/teamlist/get/" + oo.stoid + "/" + gd.prom_id, { |
| @@ -510,6 +527,15 @@ Page({ | @@ -510,6 +527,15 @@ Page({ | ||
| 510 | t.data.data.commission = tt.data.data.commission; | 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 | if (pt_data.kttype == 3) { | 540 | if (pt_data.kttype == 3) { |
| 515 | t.data.data.shop_price = tt.data.data.yf_price; //用定金来购买 | 541 | t.data.data.shop_price = tt.data.data.yf_price; //用定金来购买 |
| @@ -566,14 +592,15 @@ Page({ | @@ -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,11 +658,13 @@ Page({ | ||
| 631 | this.getuser_addr(function (ie) { | 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 | th.setData({ add_back: 1,same_ok:1 }); | 662 | th.setData({ add_back: 1,same_ok:1 }); |
| 636 | //if (th.data.bn_goods) th.calculatePrice2(); | 663 | //if (th.data.bn_goods) th.calculatePrice2(); |
| 637 | } | 664 | } |
| 638 | th.setData({ user_addr: ie,show_btn:0 }); | 665 | th.setData({ user_addr: ie,show_btn:0 }); |
| 666 | + | ||
| 667 | + th.data.isget_by_quan = {}; | ||
| 639 | }) | 668 | }) |
| 640 | //--更新默认地址--,看一下是不是跳到地址页面 | 669 | //--更新默认地址--,看一下是不是跳到地址页面 |
| 641 | if (!getApp().globalData.is_cart_old) { | 670 | if (!getApp().globalData.is_cart_old) { |
| @@ -764,9 +793,45 @@ Page({ | @@ -764,9 +793,45 @@ Page({ | ||
| 764 | var o_shipping_price = 0, goods_weight = -1, goods_piece = -1; | 793 | var o_shipping_price = 0, goods_weight = -1, goods_piece = -1; |
| 765 | var out_of_weight = null; //超出多少重量 | 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 | var ord_prom=null; | 829 | var ord_prom=null; |
| 769 | var o_condition=allpice; | 830 | var o_condition=allpice; |
| 831 | + var pickid = th.data.bn_pick; | ||
| 832 | + | ||
| 833 | + | ||
| 834 | + | ||
| 770 | if(th.data.bn_is_order_yh && th.data.kt_type != 3 ){ | 835 | if(th.data.bn_is_order_yh && th.data.kt_type != 3 ){ |
| 771 | 836 | ||
| 772 | await getApp().request.promiseGet("/api/weshop/promorder/getOrderPromotion", { | 837 | await getApp().request.promiseGet("/api/weshop/promorder/getOrderPromotion", { |
| @@ -781,6 +846,40 @@ Page({ | @@ -781,6 +846,40 @@ Page({ | ||
| 781 | //-----------当地址不为空,且是物流时,计算物流费用,同时阶梯团不计算拼团价格---------- | 846 | //-----------当地址不为空,且是物流时,计算物流费用,同时阶梯团不计算拼团价格---------- |
| 782 | if (th.data.user_addr != null && th.data.bn_exp_type == 0 && (th.data.kt_type != 3 || th.data.bn_goods.is_normal == 1)) { | 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 | if(good.is_free_shipping){ | 883 | if(good.is_free_shipping){ |
| 785 | var wl_txt = "formData.shipping_price"; | 884 | var wl_txt = "formData.shipping_price"; |
| 786 | th.setData({ [wl_txt]: 0 }) | 885 | th.setData({ [wl_txt]: 0 }) |
| @@ -791,6 +890,7 @@ Page({ | @@ -791,6 +890,7 @@ Page({ | ||
| 791 | wuliu: parseFloat(allpice).toFixed(2), store_id: os.stoid | 890 | wuliu: parseFloat(allpice).toFixed(2), store_id: os.stoid |
| 792 | } | 891 | } |
| 793 | var back_data = null; | 892 | var back_data = null; |
| 893 | + var quan_no_goods_arr=null; | ||
| 794 | 894 | ||
| 795 | if(!ord_prom || ord_prom.is_post_temp) { | 895 | if(!ord_prom || ord_prom.is_post_temp) { |
| 796 | if (th.data.bn_is_post_temp || th.data.bn_goods.is_normal == 1) { | 896 | if (th.data.bn_is_post_temp || th.data.bn_goods.is_normal == 1) { |
| @@ -802,108 +902,146 @@ Page({ | @@ -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 | cut_good_weight += item['weight'] * item['buynum']; | 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 | var wl_txt = "formData.shipping_price"; | 1042 | var wl_txt = "formData.shipping_price"; |
| 906 | - th.setData({ [wl_txt]: shipping_price, }) | 1043 | + th.setData({ [wl_txt]: 0, }) |
| 1044 | + } | ||
| 907 | } | 1045 | } |
| 908 | } else if (th.data.bn_exp_type == 1) { | 1046 | } else if (th.data.bn_exp_type == 1) { |
| 909 | var wl_txt = "formData.shipping_price"; | 1047 | var wl_txt = "formData.shipping_price"; |
| @@ -1140,6 +1278,9 @@ Page({ | @@ -1140,6 +1278,9 @@ Page({ | ||
| 1140 | } | 1278 | } |
| 1141 | 1279 | ||
| 1142 | 1280 | ||
| 1281 | + | ||
| 1282 | + var txt3 = "formData.coupon_price"; | ||
| 1283 | + | ||
| 1143 | if (th.data.bn_use_commission) { | 1284 | if (th.data.bn_use_commission) { |
| 1144 | order_m = (parseFloat(order_m) - parseFloat(th.data.bn_goods.use_commission)).toFixed(2); | 1285 | order_m = (parseFloat(order_m) - parseFloat(th.data.bn_goods.use_commission)).toFixed(2); |
| 1145 | th.setData({ [txt4]: th.data.bn_goods.use_commission }) | 1286 | th.setData({ [txt4]: th.data.bn_goods.use_commission }) |
| @@ -1148,14 +1289,14 @@ Page({ | @@ -1148,14 +1289,14 @@ Page({ | ||
| 1148 | //--------------如果使用余额--------------------- | 1289 | //--------------如果使用余额--------------------- |
| 1149 | if (th.data.bn_use_money == 1 && th.data.yuer > 0) { | 1290 | if (th.data.bn_use_money == 1 && th.data.yuer > 0) { |
| 1150 | if (parseFloat(th.data.yuer) > parseFloat(order_m)) { | 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 | } else { | 1293 | } else { |
| 1153 | order_m = parseFloat(order_m) - parseFloat(th.data.yuer); | 1294 | order_m = parseFloat(order_m) - parseFloat(th.data.yuer); |
| 1154 | order_m = order_m.toFixed(2); | 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 | } else { | 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 | wx.hideLoading(); | 1302 | wx.hideLoading(); |
| @@ -1268,6 +1409,17 @@ Page({ | @@ -1268,6 +1409,17 @@ Page({ | ||
| 1268 | item['shipping_name'] = th.data.bn_exp_type == 1 ? '' : th.data.wu_arr[th.data.index].name; | 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 | if (!th.data.bn_goods.is_normal) { | 1423 | if (!th.data.bn_goods.is_normal) { |
| 1272 | item.is_zsorder = th.data.kt_type + 1; //开团类型 | 1424 | item.is_zsorder = th.data.kt_type + 1; //开团类型 |
| 1273 | } | 1425 | } |
| @@ -1681,5 +1833,428 @@ Page({ | @@ -1681,5 +1833,428 @@ Page({ | ||
| 1681 | buycard: function () { | 1833 | buycard: function () { |
| 1682 | getApp().goto("/pages/user/plus/plus"); | 1834 | getApp().goto("/pages/user/plus/plus"); |
| 1683 | getApp().globalData.plus_buy_back = 1; | 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 | <wxs module="filters" src="../../../../utils/filter.wxs"></wxs> | 1 | <wxs module="filters" src="../../../../utils/filter.wxs"></wxs> |
| 2 | +<wxs module="filter" src="../cart2/c_filter.wxs"></wxs> | ||
| 2 | <form bindsubmit="sendsm"> | 3 | <form bindsubmit="sendsm"> |
| 3 | <view class="container"> | 4 | <view class="container"> |
| 4 | 5 | ||
| @@ -101,6 +102,24 @@ | @@ -101,6 +102,24 @@ | ||
| 101 | <icon color="#f23030" size="16" type="info"></icon>{{order.store_prom}} | 102 | <icon color="#f23030" size="16" type="info"></icon>{{order.store_prom}} |
| 102 | </view> | 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 | <block wx:if="{{bn_exp_type==0 && !is_default_logistics}}"> | 124 | <block wx:if="{{bn_exp_type==0 && !is_default_logistics}}"> |
| 106 | <view class="use-item flex-space-between" wx:if="{{kt_type!=3 || is_normal==1}}"> | 125 | <view class="use-item flex-space-between" wx:if="{{kt_type!=3 || is_normal==1}}"> |
| @@ -186,6 +205,12 @@ | @@ -186,6 +205,12 @@ | ||
| 186 | <view>配送费用</view> | 205 | <view>配送费用</view> |
| 187 | <view class="co-red">¥ {{formData.shipping_price}}元</view> | 206 | <view class="co-red">¥ {{formData.shipping_price}}元</view> |
| 188 | </view> | 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 | <view class="item" wx:if="{{formData.prestore>0}}"> | 215 | <view class="item" wx:if="{{formData.prestore>0}}"> |
| 191 | <view>使用预存</view> | 216 | <view>使用预存</view> |
| @@ -256,4 +281,128 @@ | @@ -256,4 +281,128 @@ | ||
| 256 | </view> | 281 | </view> |
| 257 | </view> | 282 | </view> |
| 258 | 283 | ||
| 259 | -<warn id="warn"></warn> | ||
| 260 | \ No newline at end of file | 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 | \ No newline at end of file | 410 | \ No newline at end of file |
packageE/pages/cart/cart2_pt/cart2_pt.wxss
packageE/pages/cart/cart_wk/cart_wk.js
| 1 | // pages/cart/cart_wk/cart_wk.js | 1 | // pages/cart/cart_wk/cart_wk.js |
| 2 | var t = getApp(), | 2 | var t = getApp(), |
| 3 | - oo = t.globalData.setting, | 3 | + oo = t.globalData.setting,app=t, |
| 4 | os=oo; | 4 | os=oo; |
| 5 | var ut=require("../../../../utils/util.js"); | 5 | var ut=require("../../../../utils/util.js"); |
| 6 | var util_pay=require("../../../../utils/pay.js"); | 6 | var util_pay=require("../../../../utils/pay.js"); |
| @@ -53,8 +53,21 @@ Page({ | @@ -53,8 +53,21 @@ Page({ | ||
| 53 | paying:0, //支付中 | 53 | paying:0, //支付中 |
| 54 | same_ok:1, //同城配送的控制 | 54 | same_ok:1, //同城配送的控制 |
| 55 | formData:{ | 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,13 +167,8 @@ Page({ | ||
| 154 | user_addr: addr, enterAddressPage: 0,same_ok:1 | 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 | }) |
| @@ -330,6 +338,10 @@ Page({ | @@ -330,6 +338,10 @@ Page({ | ||
| 330 | } | 338 | } |
| 331 | }) | 339 | }) |
| 332 | 340 | ||
| 341 | + //-- 之前用的券要清理掉,从头选 -- | ||
| 342 | + if(order.coupon_no){ | ||
| 343 | + await getApp().request.promisePost('/api/weshop/users/frozenQuan/del/'+order.user_id+'/'+order.coupon_no,{}) | ||
| 344 | + } | ||
| 333 | 345 | ||
| 334 | if(act_set.is_order_yh){ | 346 | if(act_set.is_order_yh){ |
| 335 | th.data.bn_is_order_yh=1; | 347 | th.data.bn_is_order_yh=1; |
| @@ -361,7 +373,7 @@ Page({ | @@ -361,7 +373,7 @@ Page({ | ||
| 361 | 373 | ||
| 362 | if (!goods) return false; | 374 | if (!goods) return false; |
| 363 | 375 | ||
| 364 | - if(goods.is_minishop==1 && getApp().is_sp_hao()){ | 376 | + if(goods.is_minishop==1 && getApp().is_sp_hao()){ |
| 365 | 377 | ||
| 366 | if(goods.distr_type==1 || pickup.distr_type==1) { | 378 | if(goods.distr_type==1 || pickup.distr_type==1) { |
| 367 | wx.showToast({ | 379 | wx.showToast({ |
| @@ -423,7 +435,6 @@ Page({ | @@ -423,7 +435,6 @@ Page({ | ||
| 423 | } | 435 | } |
| 424 | 436 | ||
| 425 | 437 | ||
| 426 | - | ||
| 427 | order.order_goods = order_goods; | 438 | order.order_goods = order_goods; |
| 428 | 439 | ||
| 429 | //-- 计算获得佣金的金额 -- | 440 | //-- 计算获得佣金的金额 -- |
| @@ -446,12 +457,23 @@ Page({ | @@ -446,12 +457,23 @@ Page({ | ||
| 446 | 457 | ||
| 447 | } | 458 | } |
| 448 | 459 | ||
| 460 | + if(teamlist.is_quan){ | ||
| 461 | + let q_ch_money= parseFloat(price * order_goods.goods_num).toFixed(2); | ||
| 462 | + th.data.ckeck_quan_price = q_ch_money; | ||
| 463 | + th.data.check_quan_price_list = q_ch_money + ""; | ||
| 464 | + th.data.check_quan_ware_list = goods.erpwareid + ""; | ||
| 465 | + }else{ | ||
| 466 | + goods.is_xz_yh = 1; | ||
| 467 | + } | ||
| 468 | + | ||
| 469 | + | ||
| 449 | 470 | ||
| 450 | 471 | ||
| 451 | this.setData({ | 472 | this.setData({ |
| 452 | order: order, | 473 | order: order, |
| 453 | distr_type: distr_type, | 474 | distr_type: distr_type, |
| 454 | pickup: pickup, | 475 | pickup: pickup, |
| 476 | + bn_pick: pickup.pickup_id, | ||
| 455 | exp_type: exp_type, | 477 | exp_type: exp_type, |
| 456 | goods: goods, | 478 | goods: goods, |
| 457 | teamgroup: teamgroup, | 479 | teamgroup: teamgroup, |
| @@ -460,6 +482,7 @@ Page({ | @@ -460,6 +482,7 @@ Page({ | ||
| 460 | 482 | ||
| 461 | //--计算价格-- | 483 | //--计算价格-- |
| 462 | th.calculatePrice2(); | 484 | th.calculatePrice2(); |
| 485 | + th.get_buy_now_quan(); | ||
| 463 | }, | 486 | }, |
| 464 | 487 | ||
| 465 | 488 | ||
| @@ -469,6 +492,37 @@ Page({ | @@ -469,6 +492,37 @@ Page({ | ||
| 469 | th.setData({submit: 1}) | 492 | th.setData({submit: 1}) |
| 470 | 493 | ||
| 471 | var allpice = th.data.order.order_amount + th.data.order.user_money + th.data.order.tail_money; | 494 | var allpice = th.data.order.order_amount + th.data.order.user_money + th.data.order.tail_money; |
| 495 | + | ||
| 496 | + //---如果有选择优惠券的情况下--- | ||
| 497 | + var quan_price = 0, bn_pick = th.data.bn_pick; | ||
| 498 | + var quan_no = null; | ||
| 499 | + if (th.data.using_quan[bn_pick] != null && th.data.using_quan[bn_pick] != undefined) | ||
| 500 | + quan_no = th.data.using_quan[bn_pick].coupon_no; | ||
| 501 | + | ||
| 502 | + if (quan_no) { | ||
| 503 | + //如果是一件代发就不要找商品 | ||
| 504 | + if (th.data.using_quan[bn_pick].isby != 1) { | ||
| 505 | + //---获取优惠券优惠--- | ||
| 506 | + await getApp().request.promiseGet("/api/weshop/couponList/getUseCouponPrice", { | ||
| 507 | + data: { | ||
| 508 | + storeId: oo.stoid, | ||
| 509 | + CashRepNo: quan_no, | ||
| 510 | + WaresSum: th.data.ckeck_quan_price, | ||
| 511 | + WareIds: th.data.check_quan_ware_list | ||
| 512 | + } | ||
| 513 | + }).then(res => { | ||
| 514 | + | ||
| 515 | + if (res.data.code == 0 && res.data.data && res.data.data.length > 0) { | ||
| 516 | + quan_price = res.data.data[0].WareCashSum; | ||
| 517 | + allpice=allpice-quan_price; | ||
| 518 | + } | ||
| 519 | + }) | ||
| 520 | + } | ||
| 521 | + } | ||
| 522 | + | ||
| 523 | + var order_prom_txt3 = "formData.coupon_price"; | ||
| 524 | + th.setData({[order_prom_txt3]: quan_price}) | ||
| 525 | + | ||
| 472 | var o_condition = allpice; | 526 | var o_condition = allpice; |
| 473 | var ord_prom=null; | 527 | var ord_prom=null; |
| 474 | var order_prom_amount=0; | 528 | var order_prom_amount=0; |
| @@ -487,10 +541,10 @@ Page({ | @@ -487,10 +541,10 @@ Page({ | ||
| 487 | 541 | ||
| 488 | //--计算物流-- | 542 | //--计算物流-- |
| 489 | if (th.data.exp_type == 0) { | 543 | if (th.data.exp_type == 0) { |
| 490 | - th.calculate_wuliu(); | 544 | + th.calculate_wuliu(allpice); |
| 491 | return false; | 545 | return false; |
| 492 | }else if(th.data.exp_type == 2){ | 546 | }else if(th.data.exp_type == 2){ |
| 493 | - th.calculate_same_city(); | 547 | + th.calculate_same_city(allpice); |
| 494 | return false; | 548 | return false; |
| 495 | } else { | 549 | } else { |
| 496 | 550 | ||
| @@ -500,7 +554,7 @@ Page({ | @@ -500,7 +554,7 @@ Page({ | ||
| 500 | switch (ord_prom['type']) { | 554 | switch (ord_prom['type']) { |
| 501 | case 0: | 555 | case 0: |
| 502 | allpice = Math.round(o_condition * ord_prom['expression']) / 100;//满额打折 | 556 | allpice = Math.round(o_condition * ord_prom['expression']) / 100;//满额打折 |
| 503 | - order_prom_amount = (o_condition - order_m).toFixed(2); | 557 | + order_prom_amount = (o_condition - allpice).toFixed(2); |
| 504 | break; | 558 | break; |
| 505 | case 1: | 559 | case 1: |
| 506 | //-- 如果有优惠促销倍减的时候 -- | 560 | //-- 如果有优惠促销倍减的时候 -- |
| @@ -521,6 +575,7 @@ Page({ | @@ -521,6 +575,7 @@ Page({ | ||
| 521 | //--订单优惠的显示-- | 575 | //--订单优惠的显示-- |
| 522 | var order_prom_txt1 = "formData.order_prom_id"; | 576 | var order_prom_txt1 = "formData.order_prom_id"; |
| 523 | var order_prom_txt2 = "formData.order_prom_amount"; | 577 | var order_prom_txt2 = "formData.order_prom_amount"; |
| 578 | + | ||
| 524 | if (order_prom_id > 0) { | 579 | if (order_prom_id > 0) { |
| 525 | th.setData({[order_prom_txt1]: order_prom_id, [order_prom_txt2]: order_prom_amount}) | 580 | th.setData({[order_prom_txt1]: order_prom_id, [order_prom_txt2]: order_prom_amount}) |
| 526 | } else { | 581 | } else { |
| @@ -565,19 +620,10 @@ Page({ | @@ -565,19 +620,10 @@ Page({ | ||
| 565 | exp_type: type,same_ok:1 | 620 | exp_type: type,same_ok:1 |
| 566 | }); | 621 | }); |
| 567 | //--计算物流的值-- | 622 | //--计算物流的值-- |
| 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(); | 623 | + if (th.data.goods) { |
| 624 | + th.calculatePrice2(); | ||
| 580 | } | 625 | } |
| 626 | + | ||
| 581 | }, | 627 | }, |
| 582 | 628 | ||
| 583 | //关闭支付 | 629 | //关闭支付 |
| @@ -632,6 +678,18 @@ Page({ | @@ -632,6 +678,18 @@ Page({ | ||
| 632 | tail_pay_type: ind,//0微信支付 1余额支付 | 678 | tail_pay_type: ind,//0微信支付 1余额支付 |
| 633 | }; | 679 | }; |
| 634 | 680 | ||
| 681 | + //组装优惠券的钱 | ||
| 682 | + if (parseFloat(th.data.formData.coupon_price) > 0) { | ||
| 683 | + dd.coupon_price = th.data.formData.coupon_price; | ||
| 684 | + dd.coupon_no = th.data.using_quan[th.data.bn_pick].coupon_no; | ||
| 685 | + } | ||
| 686 | + | ||
| 687 | + 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) { | ||
| 688 | + dd.coupon_no = th.data.using_quan[th.data.bn_pick].coupon_no; | ||
| 689 | + dd.coupon_price = 0; | ||
| 690 | + } | ||
| 691 | + | ||
| 692 | + | ||
| 635 | if (th.data.exp_type == 0 || th.data.exp_type == 2) { | 693 | if (th.data.exp_type == 0 || th.data.exp_type == 2) { |
| 636 | var index = th.data.index; | 694 | var index = th.data.index; |
| 637 | dd.shipping_code = th.data.wu_arr[index].code; | 695 | dd.shipping_code = th.data.wu_arr[index].code; |
| @@ -774,7 +832,7 @@ Page({ | @@ -774,7 +832,7 @@ Page({ | ||
| 774 | }, | 832 | }, |
| 775 | 833 | ||
| 776 | //----计算物流的钱---- | 834 | //----计算物流的钱---- |
| 777 | - async calculate_wuliu() { | 835 | + async calculate_wuliu(p_allpice) { |
| 778 | //让按钮变灰色 | 836 | //让按钮变灰色 |
| 779 | this.setData({submit: 1}); | 837 | this.setData({submit: 1}); |
| 780 | var to = getApp(), th = this; | 838 | var to = getApp(), th = this; |
| @@ -791,14 +849,54 @@ Page({ | @@ -791,14 +849,54 @@ Page({ | ||
| 791 | var order_prom_amount=0; | 849 | var order_prom_amount=0; |
| 792 | //--全部金额-- | 850 | //--全部金额-- |
| 793 | var allpice = th.data.order.order_amount + th.data.order.user_money + th.data.order.pt_tail_money; | 851 | var allpice = th.data.order.order_amount + th.data.order.user_money + th.data.order.pt_tail_money; |
| 852 | + if(p_allpice) allpice=p_allpice; | ||
| 794 | // if(th.data.bn_use_commission){ | 853 | // if(th.data.bn_use_commission){ |
| 795 | // allpice-=th.data.goods.use_commission; | 854 | // allpice-=th.data.goods.use_commission; |
| 796 | // } | 855 | // } |
| 856 | + var pickid=th.data.bn_pick; | ||
| 797 | var o_condition=allpice; | 857 | var o_condition=allpice; |
| 858 | + var quan_no = null; | ||
| 859 | + | ||
| 860 | + if (th.data.using_quan[pickid] != null && th.data.using_quan[pickid] != undefined) | ||
| 861 | + quan_no = th.data.using_quan[pickid].coupon_no; | ||
| 798 | 862 | ||
| 799 | //-----------当地址不为空,且是物流时,计算物流费用---------- | 863 | //-----------当地址不为空,且是物流时,计算物流费用---------- |
| 800 | if (th.data.user_addr != null && th.data.exp_type == 0 && good.is_free_shipping == 0) { | 864 | if (th.data.user_addr != null && th.data.exp_type == 0 && good.is_free_shipping == 0) { |
| 801 | 865 | ||
| 866 | + //看是不是有调用过包邮券 | ||
| 867 | + if (!th.data.isget_by_quan[th.data.pickid] && good.is_xz_yh != 1) { | ||
| 868 | + | ||
| 869 | + //--判断要不要显示包邮券,链式调用接口,调取包邮券,已经是减了优惠的金额,见到优惠券的钱--- | ||
| 870 | + getApp().request.promiseGet("/api/weshop/userfeemail/pageAndArea", { | ||
| 871 | + data: { | ||
| 872 | + store_id: os.stoid, | ||
| 873 | + isuse: 0, | ||
| 874 | + condition: o_condition, | ||
| 875 | + user_id: getApp().globalData.user_id, | ||
| 876 | + pageSize: 2000 | ||
| 877 | + } | ||
| 878 | + }).then(res => { | ||
| 879 | + if (res.data.code == 0 && res.data.data.total > 0) { | ||
| 880 | + //此时要循环判断包邮的地区,不包邮商品是不是符合 | ||
| 881 | + var arr = [], quanlist = res.data.data.pageData; | ||
| 882 | + quanlist = th.check_is_frozenQuan(quanlist, th.data.frozenQuan, 1); | ||
| 883 | + for (var i in quanlist) { | ||
| 884 | + var item = quanlist[i]; | ||
| 885 | + if (item.region_list && th.check_by_area(item.region_list)) continue; //如果是不包邮区域 | ||
| 886 | + if (item.goods_list) { | ||
| 887 | + var no_goods_arr = item.goods_list.split(","); | ||
| 888 | + if (ut.isContained(no_goods_arr, gd_arr_list)) continue; //如果是不包邮商品 | ||
| 889 | + } | ||
| 890 | + arr.push(item); | ||
| 891 | + } | ||
| 892 | + if (arr) { | ||
| 893 | + th.setData({ get_by_quan_list: arr }); | ||
| 894 | + } | ||
| 895 | + th.data.isget_by_quan[th.data.bn_pick] = 1; | ||
| 896 | + } | ||
| 897 | + }) | ||
| 898 | + } | ||
| 899 | + | ||
| 802 | //订单促销的包邮模板 和 活动的包邮模板要一起判断 | 900 | //订单促销的包邮模板 和 活动的包邮模板要一起判断 |
| 803 | if ((!ord_prom || ord_prom.is_post_temp) && th.data.bn_is_post_temp) { | 901 | if ((!ord_prom || ord_prom.is_post_temp) && th.data.bn_is_post_temp) { |
| 804 | var user_addr = th.data.user_addr; | 902 | var user_addr = th.data.user_addr; |
| @@ -814,98 +912,137 @@ Page({ | @@ -814,98 +912,137 @@ Page({ | ||
| 814 | }); | 912 | }); |
| 815 | } | 913 | } |
| 816 | 914 | ||
| 817 | - var cut_good_weight = 0; | ||
| 818 | - for (let i in gd_arr_list) { | ||
| 819 | - let item = gd_arr_list[i]; | ||
| 820 | 915 | ||
| 821 | - if (back_data && back_data['is_by_all'] && (!back_data.no_free_goods || back_data.no_free_goods.indexOf(item.goods_id) == -1)) { | 916 | + var is_by_quan = 0; |
| 917 | + var quan_no_goods_arr=null; | ||
| 822 | 918 | ||
| 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; | 919 | + //如果是包邮券的时候,要看看券的情况,判断一下包邮有没有不包邮模板 |
| 920 | + if (quan_no && th.data.using_quan[pickid].isby == 1) { | ||
| 921 | + var quan = th.data.using_quan[pickid]; | ||
| 922 | + if (quan.goods_list) { | ||
| 923 | + quan_no_goods_arr = quan.goods_list.split(","); | ||
| 924 | + } else { | ||
| 925 | + is_by_quan = 1; | ||
| 926 | + } | ||
| 927 | + } | ||
| 928 | + | ||
| 929 | + //如果有包邮券的不包邮商品的时候 | ||
| 930 | + if (quan_no_goods_arr) { | ||
| 931 | + if (back_data && back_data.no_free_goods) { | ||
| 932 | + back_data['is_by_all'] = 1; | ||
| 933 | + var arr3 = back_data.no_free_goods.filter(item => { | ||
| 934 | + return quan_no_goods_arr.includes(item) | ||
| 935 | + }) | ||
| 936 | + back_data.no_free_goods = null; | ||
| 937 | + if (arr3.length) { | ||
| 938 | + back_data.no_free_goods = arr3; | ||
| 830 | } | 939 | } |
| 831 | - continue; | ||
| 832 | } | 940 | } |
| 941 | + if (!back_data || !back_data.no_free_goods) { | ||
| 942 | + if (!back_data) back_data = {}; | ||
| 943 | + back_data['is_by_all'] = 1; | ||
| 944 | + back_data['no_free_goods'] = quan_no_goods_arr; | ||
| 945 | + } | ||
| 946 | + } | ||
| 833 | 947 | ||
| 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']; | 948 | + if(!is_by_quan){ |
| 949 | + var cut_good_weight = 0; | ||
| 950 | + for (let i in gd_arr_list) { | ||
| 951 | + let item = gd_arr_list[i]; | ||
| 843 | 952 | ||
| 844 | - if (back_data && back_data.is_by_all && !back_data.no_free_goods) { | ||
| 845 | - cut_good_weight += item['weight'] * item['buynum']; | 953 | + if (back_data && back_data['is_by_all'] && (!back_data.no_free_goods || back_data.no_free_goods.indexOf(item.goods_id) == -1)) { |
| 954 | + | ||
| 955 | + if (item['exp_sum_type'] == 2 && back_data.weight_free > 0) { | ||
| 956 | + if (goods_weight < 0) goods_weight = 0; | ||
| 957 | + goods_weight += item['weight'] * item['buynum']; | ||
| 958 | + cut_good_weight += item['weight'] * item['buynum']; | ||
| 959 | + } | ||
| 846 | if (back_data.weight_free > 0) { | 960 | if (back_data.weight_free > 0) { |
| 847 | out_of_weight = (back_data.weight_free * 1000) - cut_good_weight; | 961 | out_of_weight = (back_data.weight_free * 1000) - cut_good_weight; |
| 848 | } | 962 | } |
| 963 | + continue; | ||
| 849 | } | 964 | } |
| 850 | - break; | ||
| 851 | - case 3: | ||
| 852 | - if (goods_piece < 0) goods_piece = 0; | ||
| 853 | - //累积商品数量 | ||
| 854 | - goods_piece += item['buynum']; | ||
| 855 | - break; | ||
| 856 | - } | ||
| 857 | - } | ||
| 858 | 965 | ||
| 859 | - //如果是正值的时候 | ||
| 860 | - if (out_of_weight >= 0) out_of_weight = -cut_good_weight; | ||
| 861 | - else out_of_weight = -back_data.weight_free * 1000; | 966 | + switch (item['exp_sum_type']) { |
| 967 | + case 1: | ||
| 968 | + //统一运费 | ||
| 969 | + o_shipping_price += item['uniform_exp_sum']; | ||
| 970 | + break; | ||
| 971 | + case 2: | ||
| 972 | + if (goods_weight < 0) goods_weight = 0; | ||
| 973 | + //累积商品重量 每种商品的重量 * 数量 | ||
| 974 | + goods_weight += item['weight'] * item['buynum']; | ||
| 975 | + | ||
| 976 | + if (back_data && back_data.is_by_all && !back_data.no_free_goods) { | ||
| 977 | + cut_good_weight += item['weight'] * item['buynum']; | ||
| 978 | + if (back_data.weight_free > 0) { | ||
| 979 | + out_of_weight = (back_data.weight_free * 1000) - cut_good_weight; | ||
| 980 | + } | ||
| 981 | + } | ||
| 982 | + break; | ||
| 983 | + case 3: | ||
| 984 | + if (goods_piece < 0) goods_piece = 0; | ||
| 985 | + //累积商品数量 | ||
| 986 | + goods_piece += item['buynum']; | ||
| 987 | + break; | ||
| 988 | + } | ||
| 989 | + } | ||
| 862 | 990 | ||
| 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 | - } | 991 | + //如果是正值的时候 |
| 992 | + if (out_of_weight >= 0) out_of_weight = -cut_good_weight; | ||
| 993 | + else out_of_weight = -back_data.weight_free * 1000; | ||
| 994 | + | ||
| 995 | + if (!th.data.wu_arr) { | ||
| 996 | + wx.hideLoading(); | ||
| 997 | + wx.showToast({ | ||
| 998 | + title: "物流配置未启用物流公司", icon: 'none', duration: 2000 | ||
| 999 | + }) | ||
| 1000 | + //th.setData({ show_submit:0, }); | ||
| 1001 | + th.setData({show_submit: 1, submit: 0, same_ok: 0}) | ||
| 1002 | + return false; | ||
| 1003 | + } | ||
| 1004 | + var code = th.data.wu_arr[th.data.index].code; | ||
| 1005 | + | ||
| 1006 | + //--------------开始计算物流------------------ | ||
| 1007 | + var shipping_price = 0; | ||
| 1008 | + // ut.calculatewuliu(code, o_shipping_price, goods_weight, out_of_weight, | ||
| 1009 | + // goods_piece, th.data.user_addr, back_data, rs); | ||
| 1010 | + | ||
| 1011 | + var w_data = { | ||
| 1012 | + store_id: os.stoid, code: code, | ||
| 1013 | + o_shipping_price: o_shipping_price, | ||
| 1014 | + goods_weight: goods_weight, | ||
| 1015 | + out_of_weight: out_of_weight, goods_piece: goods_piece, | ||
| 1016 | + user_addr_province: th.data.user_addr.province, | ||
| 1017 | + user_addr_city: th.data.user_addr.city, | ||
| 1018 | + user_addr_district: th.data.user_addr.district, | ||
| 1019 | + is_by_all: back_data && back_data.is_by_all ? 1 : 0, | ||
| 1020 | + no_free_goods: back_data && back_data.no_free_goods && back_data.no_free_goods.length > 0 ? 1 : 0, | ||
| 1021 | + } | ||
| 890 | 1022 | ||
| 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; | 1023 | + var is_ok = 0; |
| 1024 | + await getApp().request.promisePost('/api/weshop/order/getOrderWuLiPrice', { | ||
| 1025 | + data: w_data, | ||
| 1026 | + is_json: 1 | ||
| 1027 | + }).then(res => { | ||
| 1028 | + if (res.data.code == 0) { | ||
| 1029 | + shipping_price = res.data.data; | ||
| 1030 | + is_ok = 1; | ||
| 1031 | + } else { | ||
| 1032 | + getApp().confirmBox("计算物流错误:" + res.data.msg); | ||
| 1033 | + } | ||
| 1034 | + }) | ||
| 1035 | + if (!is_ok) { | ||
| 1036 | + th.setData({show_submit: 1, submit: 0, same_ok: 0}) | ||
| 1037 | + wx.hideLoading(); | ||
| 1038 | + return false; | ||
| 1039 | + } | ||
| 907 | } | 1040 | } |
| 908 | 1041 | ||
| 1042 | + | ||
| 1043 | + | ||
| 1044 | + | ||
| 1045 | + | ||
| 909 | //-- 计算一下订单促销 -- | 1046 | //-- 计算一下订单促销 -- |
| 910 | if (ord_prom) { | 1047 | if (ord_prom) { |
| 911 | order_prom_id = ord_prom['id']; | 1048 | order_prom_id = ord_prom['id']; |
| @@ -1026,7 +1163,7 @@ Page({ | @@ -1026,7 +1163,7 @@ Page({ | ||
| 1026 | }, | 1163 | }, |
| 1027 | 1164 | ||
| 1028 | //----计算物流的钱--- | 1165 | //----计算物流的钱--- |
| 1029 | - async calculate_same_city() { | 1166 | + async calculate_same_city(p_allpice) { |
| 1030 | //让按钮变灰色 | 1167 | //让按钮变灰色 |
| 1031 | this.setData({submit:1}); | 1168 | this.setData({submit:1}); |
| 1032 | var th = this; | 1169 | var th = this; |
| @@ -1039,7 +1176,9 @@ Page({ | @@ -1039,7 +1176,9 @@ Page({ | ||
| 1039 | var order_prom_amount=0; | 1176 | var order_prom_amount=0; |
| 1040 | 1177 | ||
| 1041 | //--全部金额-- | 1178 | //--全部金额-- |
| 1042 | - var allpice = th.data.order.order_amount + th.data.order.user_money + th.data.order.pt_tail_money; | 1179 | + var allpice = p_allpice; |
| 1180 | + var o_condition=p_allpice; | ||
| 1181 | + | ||
| 1043 | //-----------当地址不为空,且是物流时,计算物流费用---------- | 1182 | //-----------当地址不为空,且是物流时,计算物流费用---------- |
| 1044 | if (th.data.user_addr != null) { | 1183 | if (th.data.user_addr != null) { |
| 1045 | 1184 | ||
| @@ -1145,7 +1284,7 @@ Page({ | @@ -1145,7 +1284,7 @@ Page({ | ||
| 1145 | 1284 | ||
| 1146 | } else { | 1285 | } else { |
| 1147 | 1286 | ||
| 1148 | - var allpice = th.data.order.order_amount + th.data.order.user_money + th.data.order.tail_money; | 1287 | + |
| 1149 | 1288 | ||
| 1150 | //-- 计算一下订单促销 -- | 1289 | //-- 计算一下订单促销 -- |
| 1151 | if (ord_prom) { | 1290 | if (ord_prom) { |
| @@ -1339,6 +1478,397 @@ Page({ | @@ -1339,6 +1478,397 @@ Page({ | ||
| 1339 | var th = this; | 1478 | var th = this; |
| 1340 | th.setData({bn_use_commission: !th.data.bn_use_commission}); | 1479 | th.setData({bn_use_commission: !th.data.bn_use_commission}); |
| 1341 | th.calculatePrice2(); | 1480 | th.calculatePrice2(); |
| 1342 | - } | 1481 | + }, |
| 1482 | + | ||
| 1483 | + //------ 获取立即购买的购物车的劵 -------- | ||
| 1484 | + get_buy_now_quan: function () { | ||
| 1485 | + var quanlist = null, th = this, frozenQuan = null; | ||
| 1486 | + var good = this.data.goods; | ||
| 1487 | + | ||
| 1488 | + //一件代发商品不使用优惠券 | ||
| 1489 | + if (good.whsle_id) return false; | ||
| 1490 | + if(!th.data.check_quan_ware_list) return false; | ||
| 1491 | + | ||
| 1492 | + //--如果商家后台没有限制使用优惠券,同时商品的优惠活动没有限制使用优惠券-- | ||
| 1493 | + if (th.data.is_close_quan != 1 && good.is_xz_yh != 1 && th.data.check_quan_ware_list) { | ||
| 1494 | + var url0 = "/api/weshop/users/frozenQuan/listFrozenQuan/" + app.globalData.user_id; | ||
| 1495 | + var url = "/api/weshop/couponList/getUseCouponList"; | ||
| 1496 | + app.request.promiseGet(url0, { 1: 1 }).then(res => { | ||
| 1497 | + if (res.data.code == 0) { | ||
| 1498 | + frozenQuan = res.data.data; | ||
| 1499 | + th.data.frozenQuan = frozenQuan; | ||
| 1500 | + } | ||
| 1501 | + app.request.time_limit_get(6, url, { | ||
| 1502 | + data: { | ||
| 1503 | + storeId: oo.stoid, | ||
| 1504 | + userId: app.globalData.user_id, | ||
| 1505 | + BuySum: th.data.ckeck_quan_price, | ||
| 1506 | + WareIds: encodeURIComponent(th.data.check_quan_ware_list), | ||
| 1507 | + pageSize: 100 | ||
| 1508 | + }, | ||
| 1509 | + success: function (res) { | ||
| 1510 | + if (res.data.code == 0) { | ||
| 1511 | + quanlist = res.data.data.pageData; | ||
| 1512 | + if (quanlist) { | ||
| 1513 | + quanlist = th.check_is_frozenQuan(quanlist, frozenQuan); | ||
| 1514 | + th.setData({ selected_quan_list: quanlist }) | ||
| 1515 | + } | ||
| 1516 | + } | ||
| 1517 | + } | ||
| 1518 | + }) | ||
| 1519 | + }) | ||
| 1520 | + } | ||
| 1521 | + }, | ||
| 1522 | + | ||
| 1523 | + //--验证是否已经冻结-- | ||
| 1524 | + check_is_frozenQuan: function (quanlist, frozenQuan, isby) { | ||
| 1525 | + console.log("券列表", quanlist); | ||
| 1526 | + if (!quanlist) return null; | ||
| 1527 | + if (!frozenQuan) return quanlist; | ||
| 1528 | + var arr = []; | ||
| 1529 | + for (var i = 0; i < quanlist.length; i++) { | ||
| 1530 | + var item = quanlist[i]; | ||
| 1531 | + var is_find = 0; | ||
| 1532 | + var Q_no = quanlist[i].CashRepNo; | ||
| 1533 | + if (isby) Q_no = quanlist[i].no; | ||
| 1534 | + for (var j = 0; j < frozenQuan.length; j++) { | ||
| 1535 | + var q_no = frozenQuan[j].cashRepNo; | ||
| 1536 | + if (Q_no == q_no) { | ||
| 1537 | + is_find = 1; | ||
| 1538 | + break; | ||
| 1539 | + } | ||
| 1540 | + } | ||
| 1541 | + if (!is_find) arr.push(item); | ||
| 1542 | + } | ||
| 1543 | + return arr; | ||
| 1544 | + }, | ||
| 1545 | + | ||
| 1546 | + /*----券的所有操作----*/ | ||
| 1547 | + open_coupon_list: function (e) { | ||
| 1548 | + var th = this; | ||
| 1549 | + var pickid = e.currentTarget.dataset.pickid; | ||
| 1550 | + var bn = e.currentTarget.dataset.bn; | ||
| 1551 | + var cindx = e.currentTarget.dataset.cind; | ||
| 1552 | + | ||
| 1553 | + if (bn == 1) { | ||
| 1554 | + th.setData({ open_quan: 1, selected_quan_pick: pickid, disabled: 1 }); | ||
| 1555 | + } else { | ||
| 1556 | + //---多单打开券的时候,就要判断券在其他门店是否有使用--- | ||
| 1557 | + var quanlist = th.data.cartlist[cindx].quan_list; | ||
| 1558 | + var exp_type = th.data.cartlist[cindx].exp_type; | ||
| 1559 | + | ||
| 1560 | + | ||
| 1561 | + //对于在其他门店已经选择了的券 要判断是否显示到界面 | ||
| 1562 | + var t_user = th.data.using_quan[pickid]; | ||
| 1563 | + | ||
| 1564 | + for (var i in quanlist) { | ||
| 1565 | + quanlist[i].is_using = th.check_in_sele(quanlist[i].CashRepNo, pickid); | ||
| 1566 | + if (t_user && quanlist[i].CashRepNo == t_user.coupon_no) | ||
| 1567 | + quanlist[i].show_red = 1; | ||
| 1568 | + else | ||
| 1569 | + quanlist[i].show_red = 0; | ||
| 1570 | + } | ||
| 1571 | + | ||
| 1572 | + if (get_by_quan_list_cart) { | ||
| 1573 | + for (var i in get_by_quan_list_cart) { | ||
| 1574 | + get_by_quan_list_cart[i].is_using = th.check_in_sele(get_by_quan_list_cart[i].no, pickid); | ||
| 1575 | + if (t_user && get_by_quan_list_cart[i].no == t_user.coupon_no) | ||
| 1576 | + get_by_quan_list_cart[i].show_red = 1; | ||
| 1577 | + else | ||
| 1578 | + get_by_quan_list_cart[i].show_red = 0; | ||
| 1579 | + } | ||
| 1580 | + th.setData({ by_quan_list_cart: get_by_quan_list_cart }); | ||
| 1581 | + } else { | ||
| 1582 | + th.setData({ by_quan_list_cart: null }); | ||
| 1583 | + } | ||
| 1584 | + | ||
| 1585 | + console.log("2222222券的列表", quanlist); | ||
| 1586 | + th.setData({ | ||
| 1587 | + sele_cart_ind: cindx, | ||
| 1588 | + sele_exp_type: exp_type, | ||
| 1589 | + open_quan: 1, | ||
| 1590 | + selected_quan_pick: pickid, | ||
| 1591 | + selected_quan_list: quanlist, | ||
| 1592 | + disabled: 1 | ||
| 1593 | + }); | ||
| 1594 | + } | ||
| 1595 | + }, | ||
| 1596 | + close_coupon: function (e) { | ||
| 1597 | + var th = this; | ||
| 1598 | + th.setData({ open_quan: 0, disabled: 0 }); | ||
| 1599 | + }, | ||
| 1600 | + | ||
| 1601 | + /*--点击选择券--*/ | ||
| 1602 | + sele_quan_item: function (e) { | ||
| 1603 | + | ||
| 1604 | + var ind = e.currentTarget.dataset.ind; | ||
| 1605 | + var quan_item = this.data.selected_quan_list[ind]; | ||
| 1606 | + var pickid = this.data.selected_quan_pick; //现在选择的是哪一个门店 | ||
| 1607 | + //--如果券是单品使用的时候-- | ||
| 1608 | + if (quan_item && quan_item.UseObjectType && quan_item.UseObjectType == "20") { | ||
| 1609 | + //---只有多件购买的时候才要计算,//购物车购买和搭配勾的时候--- | ||
| 1610 | + var gg = getApp().get_b_now(); | ||
| 1611 | + if (this.data.is_b_now == 0 || gg.prom_type == 5) { | ||
| 1612 | + var arr = this.data.order_prom_list_cart; | ||
| 1613 | + var t_pk_item = null; | ||
| 1614 | + for (var ii in arr) { | ||
| 1615 | + var ep = arr[ii]; | ||
| 1616 | + if (pickid == ep.pickup_id) { | ||
| 1617 | + t_pk_item = ep; | ||
| 1618 | + break; | ||
| 1619 | + } | ||
| 1620 | + } | ||
| 1621 | + //--寻找券指定的商品-- | ||
| 1622 | + var gd = null; | ||
| 1623 | + if (t_pk_item) { | ||
| 1624 | + var goods = t_pk_item.goods; | ||
| 1625 | + for (var gid in goods) { | ||
| 1626 | + if (quan_item.UseObjectID == goods[gid].erpwareid) { | ||
| 1627 | + gd = goods[gid]; | ||
| 1628 | + } | ||
| 1629 | + } | ||
| 1630 | + } | ||
| 1631 | + if (!gd) { | ||
| 1632 | + getApp().my_warnning("未找到指定商品使用", 0, this, 600); | ||
| 1633 | + return false; | ||
| 1634 | + } | ||
| 1635 | + //计算价格,如果有平摊的实收要计算实收的金额 | ||
| 1636 | + var item_price = gd.goods_price * gd.goods_num; | ||
| 1637 | + //-- 如果有平摊下去,有实收价格的时候,就要用account_fir来计算价格 -- | ||
| 1638 | + if (gd.account_fir != null && gd.account_fir != undefined) { | ||
| 1639 | + item_price = gd.account_fir * gd.goods_num; | ||
| 1640 | + } | ||
| 1641 | + | ||
| 1642 | + if (item_price < parseFloat(quan_item.BuySum)) { | ||
| 1643 | + getApp().my_warnning("该单品金额没有大于等于" + quan_item.BuySum + "元时不能使用优惠券", 0, this, 600); | ||
| 1644 | + return false; | ||
| 1645 | + } | ||
| 1646 | + } | ||
| 1647 | + } | ||
| 1648 | + | ||
| 1649 | + var no_use = e.currentTarget.dataset.no, quanlist = this.data.selected_quan_list; | ||
| 1650 | + //---所有的券的显示红色选择都清理一遍--- | ||
| 1651 | + for (var i in quanlist) { | ||
| 1652 | + quanlist[i].show_red = 0; | ||
| 1653 | + } | ||
| 1654 | + this.setData({ selected_quan_list: quanlist }); | ||
| 1655 | + var by_quanlist = this.data.get_by_quan_list; | ||
| 1656 | + if (by_quanlist) { | ||
| 1657 | + //---所有的券的显示红色选择都清理一遍--- | ||
| 1658 | + for (var inb in by_quanlist) { | ||
| 1659 | + by_quanlist[inb].show_red = 0; | ||
| 1660 | + } | ||
| 1661 | + this.setData({ get_by_quan_list: by_quanlist }); | ||
| 1662 | + } | ||
| 1663 | + | ||
| 1664 | + var by_cart_list = this.data.by_quan_list_cart; | ||
| 1665 | + if (by_cart_list) { | ||
| 1666 | + //---所有的券的显示红色选择都清理一遍--- | ||
| 1667 | + for (var inc in by_cart_list) { | ||
| 1668 | + by_cart_list[inc].show_red = 0; | ||
| 1669 | + } | ||
| 1670 | + this.setData({ by_quan_list_cart: by_cart_list }); | ||
| 1671 | + } | ||
| 1672 | + | ||
| 1673 | + var using_quan = this.data.using_quan; | ||
| 1674 | + var th = this; | ||
| 1675 | + //---如果是不使用优惠券--- | ||
| 1676 | + if (no_use == 1) { | ||
| 1677 | + console.log("有进来吗券", no_use); | ||
| 1678 | + if (using_quan[th.data.selected_quan_pick]) { | ||
| 1679 | + using_quan[th.data.selected_quan_pick].is_nouse_red = 1; | ||
| 1680 | + } | ||
| 1681 | + else { | ||
| 1682 | + using_quan[th.data.selected_quan_pick] = { is_nouse_red: 1 }; | ||
| 1683 | + } | ||
| 1684 | + this.setData({ using_quan: using_quan, is_coupon: th.is_coupon }); | ||
| 1685 | + return; | ||
| 1686 | + } | ||
| 1687 | + | ||
| 1688 | + | ||
| 1689 | + var txt = "selected_quan_list[" + ind + "].show_red"; | ||
| 1690 | + var obj = {}; | ||
| 1691 | + obj[txt] = 1; | ||
| 1692 | + if (quan_item.show_red) { | ||
| 1693 | + obj[txt] = 0; | ||
| 1694 | + } | ||
| 1695 | + this.setData(obj); | ||
| 1696 | + console.log(this.data.selected_quan_list, "选中的券的下标", quan_item, "数据都在这里", txt); | ||
| 1697 | + if (using_quan[th.data.selected_quan_pick]) { | ||
| 1698 | + using_quan[th.data.selected_quan_pick].is_nouse_red = 0; | ||
| 1699 | + } | ||
| 1700 | + else { | ||
| 1701 | + using_quan[th.data.selected_quan_pick] = { is_nouse_red: 0 }; | ||
| 1702 | + } | ||
| 1703 | + this.setData({ using_quan: using_quan }); | ||
| 1704 | + | ||
| 1705 | + }, | ||
| 1706 | + | ||
| 1707 | + /*----- 点击选择包邮券 -----*/ | ||
| 1708 | + sele_quan_item_by: function (e) { | ||
| 1709 | + var no_use = e.currentTarget.dataset.no; | ||
| 1710 | + //立即购买的包邮券 | ||
| 1711 | + var by_quanlist = this.data.get_by_quan_list; | ||
| 1712 | + if (by_quanlist) { | ||
| 1713 | + //---所有的券的显示红色选择都清理一遍--- | ||
| 1714 | + for (var ind in by_quanlist) { | ||
| 1715 | + by_quanlist[ind].show_red = 0; | ||
| 1716 | + } | ||
| 1717 | + this.setData({ get_by_quan_list: by_quanlist }); | ||
| 1718 | + } | ||
| 1719 | + | ||
| 1720 | + //普通券 | ||
| 1721 | + var quanlist = this.data.selected_quan_list; | ||
| 1722 | + if (quanlist) { | ||
| 1723 | + //---所有的券的显示红色选择都清理一遍--- | ||
| 1724 | + for (var ind in quanlist) { | ||
| 1725 | + quanlist[ind].show_red = 0; | ||
| 1726 | + } | ||
| 1727 | + this.setData({ selected_quan_list: quanlist }); | ||
| 1728 | + } | ||
| 1729 | + | ||
| 1730 | + var th = this; | ||
| 1731 | + var using_quan = this.data.using_quan; | ||
| 1732 | + //---如果是不使用优惠券--- | ||
| 1733 | + if (no_use == 1) { | ||
| 1734 | + if (using_quan[th.data.selected_quan_pick]) { | ||
| 1735 | + using_quan[th.data.selected_quan_pick].is_nouse_red = 1; | ||
| 1736 | + } | ||
| 1737 | + else { | ||
| 1738 | + using_quan[th.data.selected_quan_pick] = { is_nouse_red: 1 }; | ||
| 1739 | + } | ||
| 1740 | + this.setData({ using_quan: using_quan, is_coupon: th.is_coupon }); | ||
| 1741 | + return; | ||
| 1742 | + } | ||
| 1743 | + | ||
| 1744 | + var pickid = th.data.selected_quan_pick; //现在选择的是哪一个门店 | ||
| 1745 | + var ind = e.currentTarget.dataset.ind; | ||
| 1746 | + //--如果是立即购买的部分-- | ||
| 1747 | + var txt = ""; | ||
| 1748 | + var txt1 = ""; | ||
| 1749 | + var quan_item = null; | ||
| 1750 | + | ||
| 1751 | + quan_item = this.data.get_by_quan_list[ind]; | ||
| 1752 | + txt = "get_by_quan_list[" + ind + "].show_red"; | ||
| 1753 | + var obj = {}; | ||
| 1754 | + obj[txt] = 1; | ||
| 1755 | + this.setData(obj); | ||
| 1756 | + | ||
| 1757 | + | ||
| 1758 | + if (using_quan[th.data.selected_quan_pick]) { | ||
| 1759 | + using_quan[th.data.selected_quan_pick].is_nouse_red = 0; | ||
| 1760 | + } | ||
| 1761 | + else { | ||
| 1762 | + using_quan[th.data.selected_quan_pick] = { is_nouse_red: 0 }; | ||
| 1763 | + } | ||
| 1764 | + this.setData({ using_quan: using_quan }); | ||
| 1765 | + }, | ||
| 1766 | + | ||
| 1767 | + //--确认使用券--- | ||
| 1768 | + confirm_quan: function () { | ||
| 1769 | + var using_quan = this.data.using_quan; //正在使用中的券列表 | ||
| 1770 | + var pickid = this.data.selected_quan_pick; //选中的门店ID | ||
| 1771 | + var th = this; | ||
| 1772 | + var selected_quan_list = this.data.selected_quan_list; //选择了那个门店的券列表 | ||
| 1773 | + var get_by_quan_list = this.data.get_by_quan_list; //立即购买的包邮券列表 | ||
| 1774 | + var by_quan_list_cart = this.data.by_quan_list_cart; //购物车购买的包邮券列表 | ||
| 1775 | + //选择了的券 | ||
| 1776 | + var sele_quan = null; | ||
| 1777 | + | ||
| 1778 | + //循环普通的券 | ||
| 1779 | + for (var i in selected_quan_list) { | ||
| 1780 | + var item = selected_quan_list[i]; | ||
| 1781 | + if (item.show_red) { | ||
| 1782 | + th.insert_into_using_quan(item, using_quan, pickid); | ||
| 1783 | + return; | ||
| 1784 | + } | ||
| 1785 | + } | ||
| 1786 | + //循环包邮的券,立即购买的 | ||
| 1787 | + for (var i in get_by_quan_list) { | ||
| 1788 | + var item = get_by_quan_list[i]; | ||
| 1789 | + if (item.show_red) { | ||
| 1790 | + if (th.data.is_no_by[pickid] == 1) { | ||
| 1791 | + getApp().my_warnning("已全场不能包邮,不能选择包邮券", 0, th); | ||
| 1792 | + return false; | ||
| 1793 | + } | ||
| 1794 | + if (th.data.is_by[pickid] == 1) { | ||
| 1795 | + getApp().my_warnning("已全场包邮,不能选择包邮券", 0, th); | ||
| 1796 | + return false; | ||
| 1797 | + } | ||
| 1798 | + | ||
| 1799 | + th.insert_into_using_quan(item, using_quan, pickid, 1); | ||
| 1800 | + return; | ||
| 1801 | + } | ||
| 1802 | + } | ||
| 1803 | + | ||
| 1804 | + //循环包邮的券 | ||
| 1805 | + for (var i in by_quan_list_cart) { | ||
| 1806 | + var item = by_quan_list_cart[i]; | ||
| 1807 | + if (item.show_red) { | ||
| 1808 | + if (th.data.is_no_by[pickid] == 1) { | ||
| 1809 | + getApp().my_warnning("已全场不能包邮,不能选择包邮券", 0, th); | ||
| 1810 | + return false; | ||
| 1811 | + } | ||
| 1812 | + if (th.data.is_by[pickid] == 1) { | ||
| 1813 | + getApp().my_warnning("已全场包邮,不能选择包邮券", 0, th); | ||
| 1814 | + return false; | ||
| 1815 | + } | ||
| 1816 | + th.insert_into_using_quan(item, using_quan, pickid, 1); | ||
| 1817 | + return; | ||
| 1818 | + } | ||
| 1819 | + } | ||
| 1820 | + | ||
| 1821 | + //选择了的券,看是不是点击了不使用券,点击了不使用优惠券 | ||
| 1822 | + if (using_quan[pickid]) { | ||
| 1823 | + if (using_quan[pickid].is_nouse_red == 1) { | ||
| 1824 | + using_quan[pickid] = { is_nouse_red: 1 }; | ||
| 1825 | + th.setData({ using_quan: using_quan }); | ||
| 1826 | + th.calculatePrice2(); | ||
| 1827 | + th.setData({ open_quan: 0 }); | ||
| 1828 | + return; | ||
| 1829 | + } | ||
| 1830 | + } | ||
| 1831 | + }, | ||
| 1832 | + | ||
| 1833 | + //----把券插入之后的操作,同时还要重新计算价格---- | ||
| 1834 | + insert_into_using_quan: async function (item, using_quan, pickid, isby) { | ||
| 1835 | + | ||
| 1836 | + | ||
| 1837 | + var th = this; | ||
| 1838 | + var old_quan = null; | ||
| 1839 | + if (isby == 1) { | ||
| 1840 | + using_quan[pickid] = { | ||
| 1841 | + coupon_no: item.no, | ||
| 1842 | + money: 0, | ||
| 1843 | + is_nouse_red: 0, | ||
| 1844 | + region_list: item.region_list, | ||
| 1845 | + goods_list: item.goods_list | ||
| 1846 | + }; | ||
| 1847 | + using_quan[pickid].isby = 1; | ||
| 1848 | + } else { | ||
| 1849 | + if (using_quan[pickid]) old_quan = using_quan[pickid]; | ||
| 1850 | + using_quan[pickid] = { coupon_no: item.CashRepNo, money: item.Sum, is_nouse_red: 0 }; | ||
| 1851 | + using_quan[pickid].isby = 0; | ||
| 1852 | + } | ||
| 1853 | + this.setData({ using_quan: using_quan }); | ||
| 1854 | + | ||
| 1855 | + th.calculatePrice2(function () { | ||
| 1856 | + | ||
| 1857 | + if (old_quan) using_quan[pickid] = old_quan; | ||
| 1858 | + else using_quan[pickid] = null; | ||
| 1859 | + th.setData({ using_quan: using_quan, submit: 0 }); | ||
| 1860 | + wx.showToast({ | ||
| 1861 | + title: "不能使用优惠券,同城起送价不足", | ||
| 1862 | + icon: 'none', | ||
| 1863 | + duration: 2000 | ||
| 1864 | + }) | ||
| 1865 | + | ||
| 1866 | + }); | ||
| 1867 | + | ||
| 1868 | + th.setData({ open_quan: 0 }); | ||
| 1869 | + }, | ||
| 1870 | + | ||
| 1871 | + | ||
| 1872 | + | ||
| 1343 | 1873 | ||
| 1344 | }) | 1874 | }) |
| 1345 | \ No newline at end of file | 1875 | \ No newline at end of file |
packageE/pages/cart/cart_wk/cart_wk.wxml
| 1 | <wxs module="filters" src="../../../../utils/filter.wxs"></wxs> | 1 | <wxs module="filters" src="../../../../utils/filter.wxs"></wxs> |
| 2 | +<wxs module="filter" src="../cart2/c_filter.wxs"></wxs> | ||
| 2 | 3 | ||
| 3 | <!-- 先选择配送方式,2021.7修改 --> | 4 | <!-- 先选择配送方式,2021.7修改 --> |
| 4 | <block wx:if="{{show_submit}}"> | 5 | <block wx:if="{{show_submit}}"> |
| @@ -67,6 +68,23 @@ | @@ -67,6 +68,23 @@ | ||
| 67 | 68 | ||
| 68 | </view> | 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 | <view class="use-item bdr_b-14 jc_sb" wx:if='{{exp_type==0 && !is_default_logistics}}'> | 88 | <view class="use-item bdr_b-14 jc_sb" wx:if='{{exp_type==0 && !is_default_logistics}}'> |
| 71 | <view>选择物流:</view> | 89 | <view>选择物流:</view> |
| 72 | <view class="flex-vertical" bindtap="show_wu_arr" data-txt='index' style="margin-right: 8rpx;"> | 90 | <view class="flex-vertical" bindtap="show_wu_arr" data-txt='index' style="margin-right: 8rpx;"> |
| @@ -103,6 +121,14 @@ | @@ -103,6 +121,14 @@ | ||
| 103 | <text class='redwz'>¥{{order.tail_money}}</text> | 121 | <text class='redwz'>¥{{order.tail_money}}</text> |
| 104 | </view> | 122 | </view> |
| 105 | </view> | 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 | <view class='ct_one jc_sb' wx:if="{{exp_price>0}}"> | 132 | <view class='ct_one jc_sb' wx:if="{{exp_price>0}}"> |
| 107 | <view class='ct_one_left'>配送费用</view> | 133 | <view class='ct_one_left'>配送费用</view> |
| 108 | <view class='ct_one_right'> | 134 | <view class='ct_one_right'> |
| @@ -134,7 +160,7 @@ | @@ -134,7 +160,7 @@ | ||
| 134 | <text class='zf_left_wz'>支付合计:</text> | 160 | <text class='zf_left_wz'>支付合计:</text> |
| 135 | <text class='zf_left_red'>¥{{filters.toFix(order.tail_money+exp_price,2)}}</text> | 161 | <text class='zf_left_red'>¥{{filters.toFix(order.tail_money+exp_price,2)}}</text> |
| 136 | </view> --> | 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 | <view class="zf_btn {{(submit || !same_ok)?'gray':''}}" bindtap="to_pay">支付尾款</view> | 164 | <view class="zf_btn {{(submit || !same_ok)?'gray':''}}" bindtap="to_pay">支付尾款</view> |
| 139 | </view> | 165 | </view> |
| 140 | 166 | ||
| @@ -201,3 +227,121 @@ | @@ -201,3 +227,121 @@ | ||
| 201 | </view> | 227 | </view> |
| 202 | <view style="height: 50rpx"></view> | 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,7 +152,34 @@ | ||
| 152 | <view class="foot_empty data-v-3a5b7e36"></view> | 152 | <view class="foot_empty data-v-3a5b7e36"></view> |
| 153 | 153 | ||
| 154 | <block wx:if="{{flag != 1}}"> | 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 | <block wx:if="{{isStart==1}}"> | 183 | <block wx:if="{{isStart==1}}"> |
| 157 | <view class="foot_button data-v-3a5b7e36"> | 184 | <view class="foot_button data-v-3a5b7e36"> |
| 158 | <!-- <block wx:if="{{giftPrice>0 && giftIntegral>0}}"> | 185 | <!-- <block wx:if="{{giftPrice>0 && giftIntegral>0}}"> |
| @@ -192,29 +219,9 @@ | @@ -192,29 +219,9 @@ | ||
| 192 | </block> --> | 219 | </block> --> |
| 193 | 220 | ||
| 194 | </block> | 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 | </block> | 225 | </block> |
| 219 | 226 | ||
| 220 | </view> | 227 | </view> |
packageE/pages/user/monthgiftbag/monthgiftbag.js
| @@ -3,9 +3,11 @@ var e = getApp(), | @@ -3,9 +3,11 @@ var e = getApp(), | ||
| 3 | a = e.globalData.setting, | 3 | a = e.globalData.setting, |
| 4 | os = a, | 4 | os = a, |
| 5 | t = e.request, | 5 | t = e.request, |
| 6 | - d = e.globalData; | 6 | + d = e.globalData,ut=i; |
| 7 | + | ||
| 7 | Page({ | 8 | Page({ |
| 8 | data: { | 9 | data: { |
| 10 | + url: a.url, //接口网址 | ||
| 9 | iurl: a.imghost, //图片前缀网址 | 11 | iurl: a.imghost, //图片前缀网址 |
| 10 | getDate: "", | 12 | getDate: "", |
| 11 | getStorageID: '', | 13 | getStorageID: '', |
| @@ -118,7 +120,8 @@ Page({ | @@ -118,7 +120,8 @@ Page({ | ||
| 118 | user_id: th.data.getUserID, //用户ID | 120 | user_id: th.data.getUserID, //用户ID |
| 119 | page: th.data.curpage, | 121 | page: th.data.curpage, |
| 120 | pageSize: th.data.pageSize, | 122 | pageSize: th.data.pageSize, |
| 121 | - pay_state:1 | 123 | + pay_state:1, |
| 124 | + isdetail:1 | ||
| 122 | }; | 125 | }; |
| 123 | 126 | ||
| 124 | if(this.data.sear_key){ | 127 | if(this.data.sear_key){ |
| @@ -157,6 +160,44 @@ Page({ | @@ -157,6 +160,44 @@ Page({ | ||
| 157 | 160 | ||
| 158 | // arr2[j].virtualsales=arr2[j].virtualSales | 161 | // arr2[j].virtualsales=arr2[j].virtualSales |
| 159 | // arr2[j].lbnum=arr2[j].lbNum | 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,7 +301,101 @@ Page({ | ||
| 260 | input_sear(e){ | 301 | input_sear(e){ |
| 261 | let value = e.detail; | 302 | let value = e.detail; |
| 262 | this.data.sear_key=value; | 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 | \ No newline at end of file | 402 | \ No newline at end of file |
packageE/pages/user/monthgiftbag/monthgiftbag.json
| @@ -4,6 +4,7 @@ | @@ -4,6 +4,7 @@ | ||
| 4 | "usingComponents": { | 4 | "usingComponents": { |
| 5 | "warn": "/components/long_warn/long_warn", | 5 | "warn": "/components/long_warn/long_warn", |
| 6 | "my_confirm": "/components/my_confirm/my_confirm", | 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 | \ No newline at end of file | 11 | \ No newline at end of file |
packageE/pages/user/monthgiftbag/monthgiftbag.wxml
| @@ -103,9 +103,40 @@ | @@ -103,9 +103,40 @@ | ||
| 103 | 103 | ||
| 104 | </view> | 104 | </view> |
| 105 | </view> | 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 | </view> | 140 | </view> |
| 110 | <view class="content_box_button" style="color:#b9b5b5;" wx:else>已退款</view> | 141 | <view class="content_box_button" style="color:#b9b5b5;" wx:else>已退款</view> |
| 111 | </view> | 142 | </view> |
| @@ -134,4 +165,6 @@ | @@ -134,4 +165,6 @@ | ||
| 134 | </view> | 165 | </view> |
| 135 | <!-- 引入提示组件 --> | 166 | <!-- 引入提示组件 --> |
| 136 | <warn id="warn"></warn> | 167 | <warn id="warn"></warn> |
| 137 | -<my_confirm id="my_confirm"></my_confirm> | ||
| 138 | \ No newline at end of file | 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 | \ No newline at end of file | 172 | \ No newline at end of file |
packageE/pages/user/monthgiftbag/monthgiftbag.wxss
| @@ -184,8 +184,20 @@ | @@ -184,8 +184,20 @@ | ||
| 184 | background: #d41c34; | 184 | background: #d41c34; |
| 185 | color: #fff; | 185 | color: #fff; |
| 186 | line-height: 50rpx; | 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 | .foot_box { | 201 | .foot_box { |
| 190 | -webkit-align-content: center; | 202 | -webkit-align-content: center; |
| 191 | align-content: center; | 203 | align-content: center; |
| @@ -251,3 +263,12 @@ page { | @@ -251,3 +263,12 @@ page { | ||
| 251 | .After_all .end { | 263 | .After_all .end { |
| 252 | margin: 0rpx 15rpx; | 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 | \ No newline at end of file | 275 | \ No newline at end of file |
pages/goods/goodsInfo/buy_com_pop.wxml
| @@ -72,7 +72,7 @@ | @@ -72,7 +72,7 @@ | ||
| 72 | <view class="xc-goods-attribute"> | 72 | <view class="xc-goods-attribute"> |
| 73 | <view hidden="{{ismend==1}}" class="spec-name">商品规格</view> | 73 | <view hidden="{{ismend==1}}" class="spec-name">商品规格</view> |
| 74 | <view hidden="{{ismend==1}}" style="max-height: 120rpx;overflow-y: auto;"> | 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 | data-gid='{{item.goods_id}}' wx:for="{{sku_g_pt}}" wx:key="sku_g"> | 76 | data-gid='{{item.goods_id}}' wx:for="{{sku_g_pt}}" wx:key="sku_g"> |
| 77 | {{item.gg}} | 77 | {{item.gg}} |
| 78 | </view> | 78 | </view> |
pages/goods/goodsInfo/buy_integral.wxml
| @@ -3,9 +3,9 @@ | @@ -3,9 +3,9 @@ | ||
| 3 | <view class="pding"> | 3 | <view class="pding"> |
| 4 | <icon bindtap="closeSpecModal_inte" class="modal-close" color="black" size="22" type="cancel"></icon> | 4 | <icon bindtap="closeSpecModal_inte" class="modal-close" color="black" size="22" type="cancel"></icon> |
| 5 | <view class="spec-goods"> | 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 | <view class="spec-goods-info"> | 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 | <view class="flex ai_end xc-val-money"> | 9 | <view class="flex ai_end xc-val-money"> |
| 10 | <view class="spec-goods-price"> | 10 | <view class="spec-goods-price"> |
| 11 | <text wx:if="{{prom_integral}}">{{prom_integral}}积分</text> | 11 | <text wx:if="{{prom_integral}}">{{prom_integral}}积分</text> |
| @@ -61,7 +61,7 @@ | @@ -61,7 +61,7 @@ | ||
| 61 | <view class="xc-goods-attribute"> | 61 | <view class="xc-goods-attribute"> |
| 62 | <view hidden="{{ismend==1}}" class="spec-name">商品规格</view> | 62 | <view hidden="{{ismend==1}}" class="spec-name">商品规格</view> |
| 63 | <view hidden="{{ismend==1}}" style="max-height: 120rpx;overflow-y: auto;"> | 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 | {{item.gg}} | 65 | {{item.gg}} |
| 66 | </view> | 66 | </view> |
| 67 | </view> | 67 | </view> |
| @@ -105,7 +105,7 @@ | @@ -105,7 +105,7 @@ | ||
| 105 | <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">请先选择门店</view> | 105 | <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">请先选择门店</view> |
| 106 | </block> | 106 | </block> |
| 107 | <block wx:else> | 107 | <block wx:else> |
| 108 | - <block wx:if="{{data.store_count<=0}}"> | 108 | + <block wx:if="{{sele_g.store_count<=0}}"> |
| 109 | <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view> | 109 | <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view> |
| 110 | </block> | 110 | </block> |
| 111 | <block wx:else> | 111 | <block wx:else> |
pages/goods/goodsInfo/buy_pt.wxml
| @@ -85,7 +85,7 @@ | @@ -85,7 +85,7 @@ | ||
| 85 | <view hidden="{{ismend==1}}" class="spec-name">商品规格</view> | 85 | <view hidden="{{ismend==1}}" class="spec-name">商品规格</view> |
| 86 | <block wx:if="{{is_normal==0}}"> | 86 | <block wx:if="{{is_normal==0}}"> |
| 87 | <view hidden="{{ismend==1}}" class="flex"> | 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 | </view> | 89 | </view> |
| 90 | </view> | 90 | </view> |
| 91 | </block> | 91 | </block> |
pages/goods/goodsInfo/goodsInfo.js
| @@ -151,10 +151,14 @@ Page({ | @@ -151,10 +151,14 @@ Page({ | ||
| 151 | prom_type: 0, | 151 | prom_type: 0, |
| 152 | prom_time_text: "", | 152 | prom_time_text: "", |
| 153 | prom_price: null, | 153 | prom_price: null, |
| 154 | + f_prom_price: null, //秒杀使用 | ||
| 154 | prom_buy_limit: 0, | 155 | prom_buy_limit: 0, |
| 155 | djs: null, | 156 | djs: null, |
| 156 | prom_st: 0, | 157 | prom_st: 0, |
| 158 | + f_prom_st: 0, | ||
| 157 | prom_r_null: 0, | 159 | prom_r_null: 0, |
| 160 | + f_prom_r_null: 0, | ||
| 161 | + | ||
| 158 | prom_end_time: null, | 162 | prom_end_time: null, |
| 159 | prom_start_time: null, | 163 | prom_start_time: null, |
| 160 | prom_act: null, | 164 | prom_act: null, |
| @@ -285,6 +289,9 @@ Page({ | @@ -285,6 +289,9 @@ Page({ | ||
| 285 | istop: 0, //是否置顶风格为1 | 289 | istop: 0, //是否置顶风格为1 |
| 286 | searchbox_transparent: 1, | 290 | searchbox_transparent: 1, |
| 287 | template_id:[],//订阅消息id | 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,6 +1027,10 @@ Page({ | ||
| 1020 | var ee = this, | 1027 | var ee = this, |
| 1021 | gid = this.data.gid, | 1028 | gid = this.data.gid, |
| 1022 | i = getApp().request; | 1029 | i = getApp().request; |
| 1030 | + if(this.data.front_g){ | ||
| 1031 | + gid = this.data.front_g.goods_id; | ||
| 1032 | + } | ||
| 1033 | + | ||
| 1023 | 1034 | ||
| 1024 | this.wait_for_store_config(); | 1035 | this.wait_for_store_config(); |
| 1025 | //先检验一下商品的活动情况 | 1036 | //先检验一下商品的活动情况 |
| @@ -1192,7 +1203,8 @@ Page({ | @@ -1192,7 +1203,8 @@ Page({ | ||
| 1192 | ee.setData({ | 1203 | ee.setData({ |
| 1193 | data: t.data.data, | 1204 | data: t.data.data, |
| 1194 | sele_g: t.data.data, | 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,8 +1236,13 @@ Page({ | ||
| 1224 | } | 1236 | } |
| 1225 | ee.data.g_buy_num = new Map(); | 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 | var th = ee; | 1247 | var th = ee; |
| 1231 | if (ee.data.cat_name == '') { | 1248 | if (ee.data.cat_name == '') { |
| @@ -1968,7 +1985,7 @@ Page({ | @@ -1968,7 +1985,7 @@ Page({ | ||
| 1968 | // }) | 1985 | // }) |
| 1969 | // } | 1986 | // } |
| 1970 | //要包含积分购的普通购买0 3,5,7,10, is_integral_normal积分普通购买字段 | 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 | newd.prom_type = 0; | 1989 | newd.prom_type = 0; |
| 1973 | newd.prom_id = 0; | 1990 | newd.prom_id = 0; |
| 1974 | 1991 | ||
| @@ -2019,6 +2036,7 @@ Page({ | @@ -2019,6 +2036,7 @@ Page({ | ||
| 2019 | return false; | 2036 | return false; |
| 2020 | //return s.my_warnning("库存不足!", 0, th); | 2037 | //return s.my_warnning("库存不足!", 0, th); |
| 2021 | } | 2038 | } |
| 2039 | + | ||
| 2022 | th.add_cart_next(e, t, a, o, newd); //加入购物车下一步 | 2040 | th.add_cart_next(e, t, a, o, newd); //加入购物车下一步 |
| 2023 | } | 2041 | } |
| 2024 | } | 2042 | } |
| @@ -2272,6 +2290,7 @@ Page({ | @@ -2272,6 +2290,7 @@ Page({ | ||
| 2272 | openSpecModal_inte: 0, | 2290 | openSpecModal_inte: 0, |
| 2273 | openSpecModal_inte_normal: 0, | 2291 | openSpecModal_inte_normal: 0, |
| 2274 | openSpecModal_pt: 0, | 2292 | openSpecModal_pt: 0, |
| 2293 | + openSpecModal_flash_normal:0 | ||
| 2275 | }) | 2294 | }) |
| 2276 | 2295 | ||
| 2277 | if (e.prom_type == 4) { | 2296 | if (e.prom_type == 4) { |
| @@ -2710,11 +2729,11 @@ Page({ | @@ -2710,11 +2729,11 @@ Page({ | ||
| 2710 | 2729 | ||
| 2711 | closeSpecModal: function () { | 2730 | closeSpecModal: function () { |
| 2712 | if (this.data.openSpecModal_pt && this.data.is_normal) { | 2731 | if (this.data.openSpecModal_pt && this.data.is_normal) { |
| 2713 | - this.get_sto(); | ||
| 2714 | this.setData({ | 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 | this.sele_spec_chech_activity(1); | 2737 | this.sele_spec_chech_activity(1); |
| 2719 | } | 2738 | } |
| 2720 | 2739 | ||
| @@ -2738,6 +2757,8 @@ Page({ | @@ -2738,6 +2757,8 @@ Page({ | ||
| 2738 | return false; | 2757 | return false; |
| 2739 | } | 2758 | } |
| 2740 | 2759 | ||
| 2760 | + th.setData({def_pick_store: ut.deep_cp(th.data.front_pick)}); | ||
| 2761 | + | ||
| 2741 | this.setData({ | 2762 | this.setData({ |
| 2742 | store: 0, | 2763 | store: 0, |
| 2743 | choice_sort_store: 0, | 2764 | choice_sort_store: 0, |
| @@ -2754,6 +2775,7 @@ Page({ | @@ -2754,6 +2775,7 @@ Page({ | ||
| 2754 | } | 2775 | } |
| 2755 | 2776 | ||
| 2756 | var check_up = 0; | 2777 | var check_up = 0; |
| 2778 | + //-- 如果是当前商品的时候 -- | ||
| 2757 | if (th.data.more_flash) { | 2779 | if (th.data.more_flash) { |
| 2758 | for (var i in th.data.more_flash) { | 2780 | for (var i in th.data.more_flash) { |
| 2759 | var item = th.data.more_flash[i]; | 2781 | var item = th.data.more_flash[i]; |
| @@ -3383,7 +3405,7 @@ Page({ | @@ -3383,7 +3405,7 @@ Page({ | ||
| 3383 | return false; | 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 | var that = this; | 3410 | var that = this; |
| 3389 | var th = this; | 3411 | var th = this; |
| @@ -3466,8 +3488,9 @@ Page({ | @@ -3466,8 +3488,9 @@ Page({ | ||
| 3466 | item['disc'] = txt; | 3488 | item['disc'] = txt; |
| 3467 | if (item) this.setData({ | 3489 | if (item) this.setData({ |
| 3468 | sele_g: item, | 3490 | sele_g: item, |
| 3469 | - gid: gid, | ||
| 3470 | data: item, | 3491 | data: item, |
| 3492 | + //gid: gid, //只去掉gid的更新 | ||
| 3493 | + | ||
| 3471 | }); | 3494 | }); |
| 3472 | 3495 | ||
| 3473 | 3496 | ||
| @@ -3914,21 +3937,23 @@ Page({ | @@ -3914,21 +3937,23 @@ Page({ | ||
| 3914 | } | 3937 | } |
| 3915 | if(func) func(); | 3938 | if(func) func(); |
| 3916 | }else{ | 3939 | }else{ |
| 3917 | - | ||
| 3918 | if(func) func(); | 3940 | if(func) func(); |
| 3919 | th.setData({sp_seleing:0}) | 3941 | th.setData({sp_seleing:0}) |
| 3920 | wx.hideLoading(); | 3942 | wx.hideLoading(); |
| 3943 | + th.data.fir_set_sto=0; | ||
| 3921 | } | 3944 | } |
| 3922 | } else { | 3945 | } else { |
| 3923 | if(func) func(); | 3946 | if(func) func(); |
| 3924 | th.setData({sp_seleing:0}) | 3947 | th.setData({sp_seleing:0}) |
| 3925 | wx.hideLoading(); | 3948 | wx.hideLoading(); |
| 3949 | + th.data.fir_set_sto=0; | ||
| 3926 | } | 3950 | } |
| 3927 | },err=>{ | 3951 | },err=>{ |
| 3928 | ut.m_toast('网络繁忙,请稍后重试'); | 3952 | ut.m_toast('网络繁忙,请稍后重试'); |
| 3929 | if(func) func(); | 3953 | if(func) func(); |
| 3930 | th.setData({sp_seleing:0}) | 3954 | th.setData({sp_seleing:0}) |
| 3931 | wx.hideLoading(); | 3955 | wx.hideLoading(); |
| 3956 | + th.data.fir_set_sto=0; | ||
| 3932 | }) | 3957 | }) |
| 3933 | }, 200) | 3958 | }, 200) |
| 3934 | 3959 | ||
| @@ -4035,6 +4060,28 @@ Page({ | @@ -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 | deal_pickup(e) { | 4086 | deal_pickup(e) { |
| 4040 | var th = this; | 4087 | var th = this; |
| @@ -4227,6 +4274,11 @@ Page({ | @@ -4227,6 +4274,11 @@ Page({ | ||
| 4227 | }) | 4274 | }) |
| 4228 | } | 4275 | } |
| 4229 | } | 4276 | } |
| 4277 | + | ||
| 4278 | + | ||
| 4279 | + //-- 设置商品详情页面的门店显示情况 --- | ||
| 4280 | + th.deal_front_pk(); | ||
| 4281 | + | ||
| 4230 | } else { | 4282 | } else { |
| 4231 | th.setData({ | 4283 | th.setData({ |
| 4232 | is_show_sto_cat: -1, | 4284 | is_show_sto_cat: -1, |
| @@ -4242,6 +4294,9 @@ Page({ | @@ -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,7 +4314,11 @@ Page({ | ||
| 4259 | sto_sele_distr: e.data.data.pageData[0].distr_type | 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,6 +4425,7 @@ Page({ | ||
| 4366 | 4425 | ||
| 4367 | 4426 | ||
| 4368 | } else { | 4427 | } else { |
| 4428 | + th.data.fir_set_sto=0; | ||
| 4369 | th.setData({ | 4429 | th.setData({ |
| 4370 | all_sto: null, | 4430 | all_sto: null, |
| 4371 | only_pk: null, | 4431 | only_pk: null, |
| @@ -4463,7 +4523,8 @@ Page({ | @@ -4463,7 +4523,8 @@ Page({ | ||
| 4463 | th.deal_pickup(em); | 4523 | th.deal_pickup(em); |
| 4464 | 4524 | ||
| 4465 | } else { | 4525 | } else { |
| 4466 | - | 4526 | + |
| 4527 | + th.data.fir_set_sto=0; | ||
| 4467 | th.setData({ | 4528 | th.setData({ |
| 4468 | all_sto: null, | 4529 | all_sto: null, |
| 4469 | only_pk: null, | 4530 | only_pk: null, |
| @@ -4473,6 +4534,7 @@ Page({ | @@ -4473,6 +4534,7 @@ Page({ | ||
| 4473 | 4534 | ||
| 4474 | } else { | 4535 | } else { |
| 4475 | 4536 | ||
| 4537 | + th.data.fir_set_sto=0; | ||
| 4476 | th.setData({ | 4538 | th.setData({ |
| 4477 | all_sto: null, | 4539 | all_sto: null, |
| 4478 | only_pk: null, | 4540 | only_pk: null, |
| @@ -4749,7 +4811,9 @@ Page({ | @@ -4749,7 +4811,9 @@ Page({ | ||
| 4749 | if (em.data.code == 0) { | 4811 | if (em.data.code == 0) { |
| 4750 | 4812 | ||
| 4751 | if (em.data.data <= 0) ee.setData({ | 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 | getApp().request.get("/api/ms/flash_sale/getNew/" + os.stoid + "/" + user_id + "/" + prom_id, { | 4819 | getApp().request.get("/api/ms/flash_sale/getNew/" + os.stoid + "/" + user_id + "/" + prom_id, { |
| @@ -4784,10 +4848,12 @@ Page({ | @@ -4784,10 +4848,12 @@ Page({ | ||
| 4784 | 4848 | ||
| 4785 | ee.setData({ | 4849 | ee.setData({ |
| 4786 | prom_price: t.data.data.user_price, | 4850 | prom_price: t.data.data.user_price, |
| 4851 | + f_prom_price: t.data.data.user_price, | ||
| 4787 | prom_type: 1, | 4852 | prom_type: 1, |
| 4788 | prom_id: prom_id, | 4853 | prom_id: prom_id, |
| 4789 | prom_buy_limit: t.data.data.buy_limit, | 4854 | prom_buy_limit: t.data.data.buy_limit, |
| 4790 | prom_act: t.data.data, | 4855 | prom_act: t.data.data, |
| 4856 | + f_prom_act: t.data.data, | ||
| 4791 | prom_end_time: prom_end_time, | 4857 | prom_end_time: prom_end_time, |
| 4792 | prom_start_time: prom_start_time, | 4858 | prom_start_time: prom_start_time, |
| 4793 | isshow: 1, | 4859 | isshow: 1, |
| @@ -4806,7 +4872,8 @@ Page({ | @@ -4806,7 +4872,8 @@ Page({ | ||
| 4806 | if (endTime2 > newTime) { | 4872 | if (endTime2 > newTime) { |
| 4807 | ee.setData({ | 4873 | ee.setData({ |
| 4808 | prom_time_text: '距秒杀结束还有', | 4874 | prom_time_text: '距秒杀结束还有', |
| 4809 | - prom_st: 1 | 4875 | + prom_st: 1, |
| 4876 | + f_prom_st: 1 | ||
| 4810 | }) | 4877 | }) |
| 4811 | ee.countDown(endTime2); | 4878 | ee.countDown(endTime2); |
| 4812 | } | 4879 | } |
| @@ -5248,7 +5315,8 @@ Page({ | @@ -5248,7 +5315,8 @@ Page({ | ||
| 5248 | var endTime2 = th.data.prom_act.end_time; | 5315 | var endTime2 = th.data.prom_act.end_time; |
| 5249 | th.setData({ | 5316 | th.setData({ |
| 5250 | prom_time_text: '距结束还剩:', | 5317 | prom_time_text: '距结束还剩:', |
| 5251 | - prom_st: 1 | 5318 | + prom_st: 1, |
| 5319 | + f_prom_st: 1, | ||
| 5252 | }) | 5320 | }) |
| 5253 | setTimeout(function () { | 5321 | setTimeout(function () { |
| 5254 | th.countDown(endTime2) | 5322 | th.countDown(endTime2) |
| @@ -5265,7 +5333,8 @@ Page({ | @@ -5265,7 +5333,8 @@ Page({ | ||
| 5265 | } | 5333 | } |
| 5266 | th.setData({ | 5334 | th.setData({ |
| 5267 | prom_time_text: '活动已经结束:', | 5335 | prom_time_text: '活动已经结束:', |
| 5268 | - prom_st: 3 | 5336 | + prom_st: 3, |
| 5337 | + f_prom_st: 3 | ||
| 5269 | }) | 5338 | }) |
| 5270 | th.setData({ | 5339 | th.setData({ |
| 5271 | djs: obj | 5340 | djs: obj |
| @@ -5416,9 +5485,9 @@ Page({ | @@ -5416,9 +5485,9 @@ Page({ | ||
| 5416 | //如果是拼单活动的普通购买 | 5485 | //如果是拼单活动的普通购买 |
| 5417 | if (ind == 1) { | 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 | th.data.def_pick_store.is_no_dis_nor=0; | 5491 | th.data.def_pick_store.is_no_dis_nor=0; |
| 5423 | th.setData({def_pick_store:th.data.def_pick_store}) | 5492 | th.setData({def_pick_store:th.data.def_pick_store}) |
| 5424 | } | 5493 | } |
| @@ -5870,6 +5939,14 @@ Page({ | @@ -5870,6 +5939,14 @@ Page({ | ||
| 5870 | //----------立即购买_pt----------- | 5939 | //----------立即购买_pt----------- |
| 5871 | buyNow_pt: function (e) { | 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 | wxlog.info(getApp().globalData.user_id+'-拼团立即购买:'+JSON.stringify(e)); | 5950 | wxlog.info(getApp().globalData.user_id+'-拼团立即购买:'+JSON.stringify(e)); |
| 5874 | 5951 | ||
| 5875 | s.set_b_now(e); | 5952 | s.set_b_now(e); |
| @@ -5994,7 +6071,7 @@ Page({ | @@ -5994,7 +6071,7 @@ Page({ | ||
| 5994 | } else { | 6071 | } else { |
| 5995 | console.log(222, goods_id) | 6072 | console.log(222, goods_id) |
| 5996 | wx.navigateTo({ | 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,7 +6079,7 @@ Page({ | ||
| 6002 | else { | 6079 | else { |
| 6003 | console.log(1111, th.data.goods_id) | 6080 | console.log(1111, th.data.goods_id) |
| 6004 | wx.navigateTo({ | 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,6 +7376,11 @@ Page({ | ||
| 7299 | choice_store: function (ee) { | 7376 | choice_store: function (ee) { |
| 7300 | var th = this; | 7377 | var th = this; |
| 7301 | var ind = ee.currentTarget.dataset.ind; | 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 | var bconfig = th.data.bconfig; | 7384 | var bconfig = th.data.bconfig; |
| 7303 | this.setData({ | 7385 | this.setData({ |
| 7304 | keyword:'' | 7386 | keyword:'' |
| @@ -7318,40 +7400,92 @@ Page({ | @@ -7318,40 +7400,92 @@ Page({ | ||
| 7318 | return false; | 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 | return false; | 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 | if (bconfig && bconfig.is_sort_storage) { | 7489 | if (bconfig && bconfig.is_sort_storage) { |
| 7356 | wx.getLocation({ | 7490 | wx.getLocation({ |
| 7357 | type: 'gcj02', | 7491 | type: 'gcj02', |
| @@ -7496,12 +7630,18 @@ Page({ | @@ -7496,12 +7630,18 @@ Page({ | ||
| 7496 | check_the_pick(item, func) { | 7630 | check_the_pick(item, func) { |
| 7497 | var th = this; | 7631 | var th = this; |
| 7498 | var goodsinfo = th.data.sele_g; | 7632 | var goodsinfo = th.data.sele_g; |
| 7633 | + | ||
| 7634 | + if(th.data.isfront){ | ||
| 7635 | + goodsinfo=this.data.front_g; | ||
| 7636 | + } | ||
| 7637 | + | ||
| 7638 | + | ||
| 7499 | var erpwareid = goodsinfo.erpwareid; | 7639 | var erpwareid = goodsinfo.erpwareid; |
| 7500 | var plist = null; | 7640 | var plist = null; |
| 7501 | var lock = 0; | 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 | func(); | 7645 | func(); |
| 7506 | return false; | 7646 | return false; |
| 7507 | } | 7647 | } |
| @@ -7630,6 +7770,10 @@ Page({ | @@ -7630,6 +7770,10 @@ Page({ | ||
| 7630 | if (!th.data.sele_g) return false; | 7770 | if (!th.data.sele_g) return false; |
| 7631 | //判断门店的配送方式是不是匹配 | 7771 | //判断门店的配送方式是不是匹配 |
| 7632 | var g_distr_type = th.data.sele_g.distr_type; | 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 | if (item.distr_type != 0 && g_distr_type != 0 && item.distr_type != g_distr_type) { | 7777 | if (item.distr_type != 0 && g_distr_type != 0 && item.distr_type != g_distr_type) { |
| 7634 | wx.showToast({ | 7778 | wx.showToast({ |
| 7635 | title: "门店配送方式不匹配,请选择其他门店", | 7779 | title: "门店配送方式不匹配,请选择其他门店", |
| @@ -7651,6 +7795,14 @@ Page({ | @@ -7651,6 +7795,14 @@ Page({ | ||
| 7651 | fir_pick_index: 0 | 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 | switch (openindstore) { | 7806 | switch (openindstore) { |
| 7655 | case 1: | 7807 | case 1: |
| 7656 | th.setData({ | 7808 | th.setData({ |
| @@ -7776,6 +7928,14 @@ Page({ | @@ -7776,6 +7928,14 @@ Page({ | ||
| 7776 | choice_sort_store: 0 | 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 | var openindstore = th.data.open_ind_store; | 7939 | var openindstore = th.data.open_ind_store; |
| 7780 | if (openindstore == 1) { | 7940 | if (openindstore == 1) { |
| 7781 | th.setData({ | 7941 | th.setData({ |
| @@ -8138,11 +8298,23 @@ Page({ | @@ -8138,11 +8298,23 @@ Page({ | ||
| 8138 | th.data.collocationGoods = r_data.collocationPromList; | 8298 | th.data.collocationGoods = r_data.collocationPromList; |
| 8139 | th.data.prom_goods = r_data.promGoodsLists; | 8299 | th.data.prom_goods = r_data.promGoodsLists; |
| 8140 | } else { | 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,9 +8420,21 @@ Page({ | ||
| 8248 | //使用sort排序 | 8420 | //使用sort排序 |
| 8249 | ppdata.sort(comp); | 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,8 +8529,12 @@ Page({ | ||
| 8345 | 8529 | ||
| 8346 | }, | 8530 | }, |
| 8347 | 8531 | ||
| 8348 | - //-- 积分购 -- | 8532 | + //-- 积分购购买弹出框 -- |
| 8349 | go_pay_integral: function () { | 8533 | go_pay_integral: function () { |
| 8534 | + | ||
| 8535 | + //-- 在打开弹出框的时候,front_pk门店要赋值 -- | ||
| 8536 | + this.setData({def_pick_store: ut.deep_cp(this.data.front_pick)}); | ||
| 8537 | + | ||
| 8350 | this.data.g_buy_num = new Map(); | 8538 | this.data.g_buy_num = new Map(); |
| 8351 | this.get_sto(0) | 8539 | this.get_sto(0) |
| 8352 | this.setData({ | 8540 | this.setData({ |
| @@ -8355,14 +8543,15 @@ Page({ | @@ -8355,14 +8543,15 @@ Page({ | ||
| 8355 | }); | 8543 | }); |
| 8356 | }, | 8544 | }, |
| 8357 | 8545 | ||
| 8358 | - //-- 积分购普通购买 -- | 8546 | + //-- 积分购普通购买弹出框 -- |
| 8359 | go_pay_integral_normal:async function () { | 8547 | go_pay_integral_normal:async function () { |
| 8360 | 8548 | ||
| 8361 | this.data.g_buy_num = new Map(); | 8549 | this.data.g_buy_num = new Map(); |
| 8362 | var th = this; | 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 | th.data.def_pick_store.is_no_dis_nor=0; | 8555 | th.data.def_pick_store.is_no_dis_nor=0; |
| 8367 | th.setData({def_pick_store:th.data.def_pick_store}) | 8556 | th.setData({def_pick_store:th.data.def_pick_store}) |
| 8368 | } | 8557 | } |
| @@ -8400,13 +8589,12 @@ Page({ | @@ -8400,13 +8589,12 @@ Page({ | ||
| 8400 | this.setData({ | 8589 | this.setData({ |
| 8401 | openSpecModal_inte_normal: 0 | 8590 | openSpecModal_inte_normal: 0 |
| 8402 | }); | 8591 | }); |
| 8403 | - //要进行还原 | ||
| 8404 | - this.get_sto(); | 8592 | + //要进行还原 |
| 8405 | this.setData({ | 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 | this.sele_spec_chech_activity(); | 8598 | this.sele_spec_chech_activity(); |
| 8411 | }, | 8599 | }, |
| 8412 | 8600 | ||
| @@ -8701,9 +8889,20 @@ Page({ | @@ -8701,9 +8889,20 @@ Page({ | ||
| 8701 | // th.data.prom_type = new_arr[0].prom_type; | 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,7 +8911,12 @@ Page({ | ||
| 8712 | go_more_flash: function (e) { | 8911 | go_more_flash: function (e) { |
| 8713 | var prom_id = e.currentTarget.dataset.id; | 8912 | var prom_id = e.currentTarget.dataset.id; |
| 8714 | var prom_type = e.currentTarget.dataset.prom_type; | 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 | var url = ""; | 8920 | var url = ""; |
| 8717 | 8921 | ||
| 8718 | switch (parseInt(prom_type)) { | 8922 | switch (parseInt(prom_type)) { |
pages/goods/goodsInfo/goodsInfo.wxml
| @@ -83,40 +83,41 @@ | @@ -83,40 +83,41 @@ | ||
| 83 | </view> | 83 | </view> |
| 84 | </view> | 84 | </view> |
| 85 | 85 | ||
| 86 | - <!-- --显示秒杀价 --> | 86 | + <!-- --显示秒杀的定时器 --> |
| 87 | <view class="prom_show rel" wx:if="{{prom_type==1}}"> | 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 | <image class="abs spike-img" src="{{iurl}}/miniapp/images/xsmiaosha.png"></image> | 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 | <view class="secview flex abs fs24 xc-miaosha-time"> | 92 | <view class="secview flex abs fs24 xc-miaosha-time"> |
| 93 | <block wx:if="djs.day"> | 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 | {{djs.day}} | 95 | {{djs.day}} |
| 96 | </view> | 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 | </block> | 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 | {{djs.hou}} | 100 | {{djs.hou}} |
| 101 | </view> | 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 | {{djs.min}} | 104 | {{djs.min}} |
| 105 | </view> | 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 | {{djs.sec}} | 108 | {{djs.sec}} |
| 109 | </view> | 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 | </view> | 111 | </view> |
| 112 | </view> | 112 | </view> |
| 113 | - <!-- --显示团购价 --> | 113 | + |
| 114 | + <!-- --显示团购价和剩余时间 --> | ||
| 114 | <view class="prom_show rel" wx:if="{{prom_type==2}}"> | 115 | <view class="prom_show rel" wx:if="{{prom_type==2}}"> |
| 115 | 116 | ||
| 116 | <view class="abs flex fs36" style="align-items:flex-end;color: #fff; margin-top: 34rpx; margin-left: 10rpx; height: 60rpx">¥{{prom_price}} | 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 | </view> | 121 | </view> |
| 121 | 122 | ||
| 122 | <image class="abs" style="width: 120rpx;top: 32rpx; right: 220rpx;" mode="widthFix" src='{{iurl+"/miniapp/images/activity-time.png"}}'></image> | 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,8 +144,8 @@ | ||
| 143 | <view class="flex fs35 xc-qtsign">¥</view> | 144 | <view class="flex fs35 xc-qtsign">¥</view> |
| 144 | <view class="fs50 val">{{prom_price}}</view> | 145 | <view class="fs50 val">{{prom_price}}</view> |
| 145 | </view> | 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 | </view> | 149 | </view> |
| 149 | 150 | ||
| 150 | <view class="abs white xc-nanber"> | 151 | <view class="abs white xc-nanber"> |
| @@ -199,7 +200,7 @@ | @@ -199,7 +200,7 @@ | ||
| 199 | <!-- 许程 商家团主页 --> | 200 | <!-- 许程 商家团主页 --> |
| 200 | <view class="xc-goods-explain flex-vertical-between"> | 201 | <view class="xc-goods-explain flex-vertical-between"> |
| 201 | <view class="xc-explain fs32 ellipsis-2" wx:if="{{prom_type!=0 }}"> | 202 | <view class="xc-explain fs32 ellipsis-2" wx:if="{{prom_type!=0 }}"> |
| 202 | - {{data.goods_name}} | 203 | + {{front_g.goods_name}} |
| 203 | </view> | 204 | </view> |
| 204 | <!-- 这个是分享按钮 --> | 205 | <!-- 这个是分享按钮 --> |
| 205 | <view wx:if="{{isLogin}}" class="xc-share-frame t-c shrink0" bindtap="clickShare"> | 206 | <view wx:if="{{isLogin}}" class="xc-share-frame t-c shrink0" bindtap="clickShare"> |
| @@ -236,7 +237,7 @@ | @@ -236,7 +237,7 @@ | ||
| 236 | 237 | ||
| 237 | <block wx:for="{{teamgroup}}" wx:for-index="t_ind"> | 238 | <block wx:for="{{teamgroup}}" wx:for-index="t_ind"> |
| 238 | <view class='group' wx:if="{{item.open_num>0}}" > | 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 | <!-- <view class="flex ai_c"> --> | 241 | <!-- <view class="flex ai_c"> --> |
| 241 | <!-- //选项框头像 --> | 242 | <!-- //选项框头像 --> |
| 242 | <view class='gtou'> | 243 | <view class='gtou'> |
| @@ -283,11 +284,11 @@ | @@ -283,11 +284,11 @@ | ||
| 283 | <text class="rel_txt" wx:if="{{!prom_integral && !prom_price}}">0积分</text> | 284 | <text class="rel_txt" wx:if="{{!prom_integral && !prom_price}}">0积分</text> |
| 284 | 285 | ||
| 285 | <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 | <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 | </text> | 288 | </text> |
| 288 | 289 | ||
| 289 | <text wx:else class="rel_txt fs22" decode="{{true}}" space="{{true}}" style="color: #999; text-decoration: line-through;"> | 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 | </text> | 292 | </text> |
| 292 | 293 | ||
| 293 | </view> | 294 | </view> |
| @@ -304,13 +305,13 @@ | @@ -304,13 +305,13 @@ | ||
| 304 | {{prom_act.show_time_off}}开始兑换 | 305 | {{prom_act.show_time_off}}开始兑换 |
| 305 | </view> | 306 | </view> |
| 306 | <view class="goods-title"> | 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 | </view> | 310 | </view> |
| 310 | <view class="goods-num"> | 311 | <view class="goods-num"> |
| 311 | <view class="sales">销量:{{prom_act.buy_num+prom_act.virtual}}件</view> | 312 | <view class="sales">销量:{{prom_act.buy_num+prom_act.virtual}}件</view> |
| 312 | <view class="stock"> | 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 | </view> | 315 | </view> |
| 315 | <view class="stock">{{categories3[0].num}}人评价</view> | 316 | <view class="stock">{{categories3[0].num}}人评价</view> |
| 316 | </view> | 317 | </view> |
| @@ -327,21 +328,21 @@ | @@ -327,21 +328,21 @@ | ||
| 327 | <view class="co-red" wx:if="{{prom_type==0 || prom_type==3}}"> | 328 | <view class="co-red" wx:if="{{prom_type==0 || prom_type==3}}"> |
| 328 | 329 | ||
| 329 | <view class="market-price flex" style="align-items: baseline;"> | 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 | <view class="flex ai-center grade-card-frame"> | 332 | <view class="flex ai-center grade-card-frame"> |
| 332 | <image class="img" src="{{iurl}}/miniapp/images/userinfo/userinfo/privilege_t.png"></image> | 333 | <image class="img" src="{{iurl}}/miniapp/images/userinfo/userinfo/privilege_t.png"></image> |
| 333 | <view class="fs24 white view card-name ellipsis-1">{{card_name}}</view> | 334 | <view class="fs24 white view card-name ellipsis-1">{{card_name}}</view> |
| 334 | </view> | 335 | </view> |
| 335 | <text class="rel yuan">¥</text> | 336 | <text class="rel yuan">¥</text> |
| 336 | - {{filters.toFix(data[card_field],2)}} | 337 | + {{filters.toFix(front_g[card_field],2)}} |
| 337 | </block> | 338 | </block> |
| 338 | 339 | ||
| 339 | <block wx:else > | 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 | </block> | 342 | </block> |
| 342 | 343 | ||
| 343 | <view wx:if="{{is_retail_price}}" class='yj' style="margin-left:10rpx"> | 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 | </view> | 346 | </view> |
| 346 | 347 | ||
| 347 | </view> | 348 | </view> |
| @@ -355,33 +356,33 @@ | @@ -355,33 +356,33 @@ | ||
| 355 | </view> | 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 | <view class="flex ai-center grade-card-frame card-frame"> | 360 | <view class="flex ai-center grade-card-frame card-frame"> |
| 360 | <image class="img" src="{{iurl}}/miniapp/images/userinfo/userinfo/privilege_t.png"></image> | 361 | <image class="img" src="{{iurl}}/miniapp/images/userinfo/userinfo/privilege_t.png"></image> |
| 361 | <view class="fs24 white view card-name ellipsis-1"> | 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 | </view> | 364 | </view> |
| 364 | </view> | 365 | </view> |
| 365 | <view class="fs32 xc-black3 ai_and carde_frame"> | 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 | </view> | 368 | </view> |
| 368 | </view> | 369 | </view> |
| 369 | <!-- 等级卡的显示,购买, 等级卡近30天要显示续费 --> | 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 | <view class="beauty-makeup-frame flex ai-center"> | 374 | <view class="beauty-makeup-frame flex ai-center"> |
| 374 | <view class="left flex ai-center jc_sa"> | 375 | <view class="left flex ai-center jc_sa"> |
| 375 | <view class="flex ai-center grade-card-frame card-frame advert-card"> | 376 | <view class="flex ai-center grade-card-frame card-frame advert-card"> |
| 376 | <image class="img" src="{{iurl}}/miniapp/images/userinfo/userinfo/privilege_t.png"></image> | 377 | <image class="img" src="{{iurl}}/miniapp/images/userinfo/userinfo/privilege_t.png"></image> |
| 377 | <view class="fs24 white view card-name ellipsis-1"> | 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 | </view> | 380 | </view> |
| 380 | </view> | 381 | </view> |
| 381 | <view class="card-effect"> | 382 | <view class="card-effect"> |
| 382 | <view class="fs24 xc-black3"> | 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 | </view> | 386 | </view> |
| 386 | <view class="fs22 xc-ash">开通会员 尽享更多优惠</view> | 387 | <view class="fs22 xc-ash">开通会员 尽享更多优惠</view> |
| 387 | </view> | 388 | </view> |
| @@ -393,7 +394,7 @@ | @@ -393,7 +394,7 @@ | ||
| 393 | </view> | 394 | </view> |
| 394 | </view> | 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 | <view class="beauty-makeup-frame flex ai-center"> | 398 | <view class="beauty-makeup-frame flex ai-center"> |
| 398 | <view class="left flex ai-center jc_sa"> | 399 | <view class="left flex ai-center jc_sa"> |
| 399 | <view class="flex ai-center grade-card-frame card-frame advert-card"> | 400 | <view class="flex ai-center grade-card-frame card-frame advert-card"> |
| @@ -404,7 +405,7 @@ | @@ -404,7 +405,7 @@ | ||
| 404 | <view class="fs24 xc-black3"> | 405 | <view class="fs24 xc-black3"> |
| 405 | 成为{{card_name}}立 | 406 | 成为{{card_name}}立 |
| 406 | <text class="co-red"> | 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 | </text> | 409 | </text> |
| 409 | 元 | 410 | 元 |
| 410 | </view> | 411 | </view> |
| @@ -422,13 +423,13 @@ | @@ -422,13 +423,13 @@ | ||
| 422 | <!-- 许程商品名字 --> | 423 | <!-- 许程商品名字 --> |
| 423 | <view wx:if="{{prom_type!=1 && prom_type!=2 }}"> | 424 | <view wx:if="{{prom_type!=1 && prom_type!=2 }}"> |
| 424 | <view class="goods-title"> | 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 | </view> | 428 | </view> |
| 428 | </view> | 429 | </view> |
| 429 | <view class="goods-num" wx:if="{{prom_type!=1 && prom_type!=2}}"> | 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 | <view class="stock">{{categories3[0].num}}人评价</view> | 433 | <view class="stock">{{categories3[0].num}}人评价</view> |
| 433 | </view> | 434 | </view> |
| 434 | 435 | ||
| @@ -437,10 +438,10 @@ | @@ -437,10 +438,10 @@ | ||
| 437 | <view class="flex" style="align-items: baseline;"> | 438 | <view class="flex" style="align-items: baseline;"> |
| 438 | <view class="flex xc-price-frame"> | 439 | <view class="flex xc-price-frame"> |
| 439 | <text class="fs30">¥</text> | 440 | <text class="fs30">¥</text> |
| 440 | - {{prom_price}} | 441 | + {{f_prom_price}} |
| 441 | </view> | 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 | </view> | 445 | </view> |
| 445 | <!-- 这个是分享按钮 --> | 446 | <!-- 这个是分享按钮 --> |
| 446 | <view wx:if="{{isLogin}}" class="xc-share-frame t-c shrink0" bindtap="clickShare"> | 447 | <view wx:if="{{isLogin}}" class="xc-share-frame t-c shrink0" bindtap="clickShare"> |
| @@ -453,11 +454,11 @@ | @@ -453,11 +454,11 @@ | ||
| 453 | 454 | ||
| 454 | <!-- 秒杀的活动名称 --> | 455 | <!-- 秒杀的活动名称 --> |
| 455 | <view class="xc-explain fs32 ellipsis-2" wx:if="{{prom_type!=0 && prom_type!=4 && prom_type!=2}}"> | 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 | </view> | 458 | </view> |
| 458 | 459 | ||
| 459 | <view class="xc-explain flex jc_sb" wx:if="{{prom_type==2}}"> | 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 | <view wx:if="{{isLogin}}" class="xc-share-frame t-c shrink0" bindtap="clickShare" style="flex-shrink:0;position: relative;top: -22rpx;"> | 463 | <view wx:if="{{isLogin}}" class="xc-share-frame t-c shrink0" bindtap="clickShare" style="flex-shrink:0;position: relative;top: -22rpx;"> |
| 463 | <view class="iconfont icon-share"></view> | 464 | <view class="iconfont icon-share"></view> |
| @@ -465,26 +466,26 @@ | @@ -465,26 +466,26 @@ | ||
| 465 | </view> | 466 | </view> |
| 466 | </view> | 467 | </view> |
| 467 | 468 | ||
| 468 | - <!-- 许程 7.24 暂时注释 --> | 469 | + <!-- 许程 7.24 暂时注释,秒杀才有多规格--> |
| 469 | <view wx:if="{{prom_type==1}}"> | 470 | <view wx:if="{{prom_type==1}}"> |
| 470 | <view class="goods-num"> | 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 | <view class="stock" wx:else>限购:不限</view> | 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 | <view class="sales">已购:0件</view> | 478 | <view class="sales">已购:0件</view> |
| 478 | </block> | 479 | </block> |
| 479 | <block wx:else> | 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 | </block> | 482 | </block> |
| 482 | </block> | 483 | </block> |
| 483 | <block wx:else> | 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 | <view class="stock" wx:else>限购:不限</view> | 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 | </block> | 489 | </block> |
| 489 | </view> | 490 | </view> |
| 490 | </view> | 491 | </view> |
| @@ -574,18 +575,17 @@ | @@ -574,18 +575,17 @@ | ||
| 574 | <!-- </view>--> | 575 | <!-- </view>--> |
| 575 | <!-- </view>--> | 576 | <!-- </view>--> |
| 576 | <!-- </block>--> | 577 | <!-- </block>--> |
| 577 | - | ||
| 578 | - | ||
| 579 | - <block wx:if="{{order_prom}}"> | 578 | + |
| 579 | + <block wx:if="{{f_order_prom}}"> | ||
| 580 | <view class="cx-frame flex" style="position: relative; height: auto"> | 580 | <view class="cx-frame flex" style="position: relative; height: auto"> |
| 581 | <view class="cx-sizs fs30 pdr20">订单优惠</view> | 581 | <view class="cx-sizs fs30 pdr20">订单优惠</view> |
| 582 | <!-- 中间显示层 --> | 582 | <!-- 中间显示层 --> |
| 583 | <view class="flex ai-center"> | 583 | <view class="flex ai-center"> |
| 584 | <image class="hui_img" src="{{iurl}}/miniapp//images/hui.png"></image> | 584 | <image class="hui_img" src="{{iurl}}/miniapp//images/hui.png"></image> |
| 585 | <view class="order_hui"> | 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 | <view class="fs26"> | 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 | </view> | 589 | </view> |
| 590 | </view> | 590 | </view> |
| 591 | </view> | 591 | </view> |
| @@ -616,9 +616,9 @@ | @@ -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 | <!-- <view class="cx-frame flex" style="position: relative; height: auto" wx:if="{{item.prom_type==1}}">--> | 622 | <!-- <view class="cx-frame flex" style="position: relative; height: auto" wx:if="{{item.prom_type==1}}">--> |
| 623 | <view class="cx-frame flex" style="position: relative; height: auto" > | 623 | <view class="cx-frame flex" style="position: relative; height: auto" > |
| 624 | <view wx:if="{{item.prom_type==1}}" class="cx-sizs wsize" style="width: 144rpx">秒杀</view> | 624 | <view wx:if="{{item.prom_type==1}}" class="cx-sizs wsize" style="width: 144rpx">秒杀</view> |
| @@ -657,11 +657,11 @@ | @@ -657,11 +657,11 @@ | ||
| 657 | </block> | 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 | <view data-coupon="1" bindtap="switch_cx_group" class="cx-frame flex" style="position: relative"> | 661 | <view data-coupon="1" bindtap="switch_cx_group" class="cx-frame flex" style="position: relative"> |
| 662 | <view class="cx-sizs fs30">促销</view> | 662 | <view class="cx-sizs fs30">促销</view> |
| 663 | <view class="flex ai_c f1 pdh20"> | 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 | <view wx:if="{{item.prom_type==3}}" class="xc-coupon t-c four-level-word">优惠促销</view> | 665 | <view wx:if="{{item.prom_type==3}}" class="xc-coupon t-c four-level-word">优惠促销</view> |
| 666 | <view wx:if="{{item.prom_type==5}}" class="xc-coupon t-c four-level-word">搭配促销</view> | 666 | <view wx:if="{{item.prom_type==5}}" class="xc-coupon t-c four-level-word">搭配促销</view> |
| 667 | <view wx:if="{{item.prom_type==7}}" class="xc-coupon t-c four-level-word">组合购</view> | 667 | <view wx:if="{{item.prom_type==7}}" class="xc-coupon t-c four-level-word">组合购</view> |
| @@ -676,7 +676,7 @@ | @@ -676,7 +676,7 @@ | ||
| 676 | 676 | ||
| 677 | 677 | ||
| 678 | <!-- 许程 7.24暂时注释 --> | 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 | <view data-coupon="1" bindtap="switchCoupon" class="cx-frame flex" style="position: relative"> | 680 | <view data-coupon="1" bindtap="switchCoupon" class="cx-frame flex" style="position: relative"> |
| 681 | <view class="cx-sizs fs30">领券</view> | 681 | <view class="cx-sizs fs30">领券</view> |
| 682 | <view class="flex ai_c f1 pdh20"> | 682 | <view class="flex ai_c f1 pdh20"> |
| @@ -695,8 +695,8 @@ | @@ -695,8 +695,8 @@ | ||
| 695 | </view> | 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 | <view class="flex-vertical-between "> | 700 | <view class="flex-vertical-between "> |
| 701 | <view class="flex-vertical select_store_height"> | 701 | <view class="flex-vertical select_store_height"> |
| 702 | <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image> | 702 | <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image> |
| @@ -704,36 +704,36 @@ | @@ -704,36 +704,36 @@ | ||
| 704 | </view> | 704 | </view> |
| 705 | <view hidden="{{has_def && sys_switch.is_pricing_open_store}}" class="red_bb fs26">更多门店<text class="bg_jj"></text></view> | 705 | <view hidden="{{has_def && sys_switch.is_pricing_open_store}}" class="red_bb fs26">更多门店<text class="bg_jj"></text></view> |
| 706 | </view> | 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 | <view class="flex-space-between address ai_end pdv10"> | 708 | <view class="flex-space-between address ai_end pdv10"> |
| 709 | <view> | 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 | </view> | 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 | </view> | 714 | </view> |
| 715 | </view> | 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 | <block wx:else> | 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 | </view> | 720 | </view> |
| 721 | <block wx:else> | 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 | </view> | 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 | </view> | 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 | </view> | 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 | </view> | 733 | </view> |
| 734 | </block> | 734 | </block> |
| 735 | </block> | 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 | </view> | 737 | </view> |
| 738 | </view> | 738 | </view> |
| 739 | </view> | 739 | </view> |
| @@ -803,6 +803,7 @@ | @@ -803,6 +803,7 @@ | ||
| 803 | </view> | 803 | </view> |
| 804 | </scroll-view> | 804 | </scroll-view> |
| 805 | </view> | 805 | </view> |
| 806 | + | ||
| 806 | <!-- 图文详情 --> | 807 | <!-- 图文详情 --> |
| 807 | <view class="bdt16"> | 808 | <view class="bdt16"> |
| 808 | <view class="t_g_info"> | 809 | <view class="t_g_info"> |
| @@ -816,7 +817,7 @@ | @@ -816,7 +817,7 @@ | ||
| 816 | <text>商品名称</text> | 817 | <text>商品名称</text> |
| 817 | </view> | 818 | </view> |
| 818 | <view class="item_right"> | 819 | <view class="item_right"> |
| 819 | - <text>{{data.goods_name}}</text> | 820 | + <text>{{front_g.goods_name}}</text> |
| 820 | </view> | 821 | </view> |
| 821 | </view> | 822 | </view> |
| 822 | <view class="tb_item tb-l"> | 823 | <view class="tb_item tb-l"> |
| @@ -824,7 +825,7 @@ | @@ -824,7 +825,7 @@ | ||
| 824 | <text>商品编号</text> | 825 | <text>商品编号</text> |
| 825 | </view> | 826 | </view> |
| 826 | <view class="item_right"> | 827 | <view class="item_right"> |
| 827 | - <text>{{data.goods_sn}}</text> | 828 | + <text>{{front_g.goods_sn}}</text> |
| 828 | </view> | 829 | </view> |
| 829 | </view> | 830 | </view> |
| 830 | <view class="tb_item tb-l"> | 831 | <view class="tb_item tb-l"> |
| @@ -832,7 +833,7 @@ | @@ -832,7 +833,7 @@ | ||
| 832 | <text>商品条码</text> | 833 | <text>商品条码</text> |
| 833 | </view> | 834 | </view> |
| 834 | <view class="item_right"> | 835 | <view class="item_right"> |
| 835 | - <text>{{data.sku}}</text> | 836 | + <text>{{front_g.sku}}</text> |
| 836 | </view> | 837 | </view> |
| 837 | </view> | 838 | </view> |
| 838 | <view class="tb_item tb-l" wx:if="{{cat_name && is_show_pl}}"> | 839 | <view class="tb_item tb-l" wx:if="{{cat_name && is_show_pl}}"> |
| @@ -864,7 +865,7 @@ | @@ -864,7 +865,7 @@ | ||
| 864 | <text>规格</text> | 865 | <text>规格</text> |
| 865 | </view> | 866 | </view> |
| 866 | <view class="item_right"> | 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 | </view> | 869 | </view> |
| 869 | </view> | 870 | </view> |
| 870 | <view class="tb_item tb-l"> | 871 | <view class="tb_item tb-l"> |
| @@ -872,7 +873,7 @@ | @@ -872,7 +873,7 @@ | ||
| 872 | <text>上架时间</text> | 873 | <text>上架时间</text> |
| 873 | </view> | 874 | </view> |
| 874 | <view class="item_right"> | 875 | <view class="item_right"> |
| 875 | - <text>{{data.on_time}}</text> | 876 | + <text>{{front_g.on_time}}</text> |
| 876 | </view> | 877 | </view> |
| 877 | </view> | 878 | </view> |
| 878 | </view> | 879 | </view> |
| @@ -904,7 +905,7 @@ | @@ -904,7 +905,7 @@ | ||
| 904 | <text>商品名称</text> | 905 | <text>商品名称</text> |
| 905 | </view> | 906 | </view> |
| 906 | <view class="item_right"> | 907 | <view class="item_right"> |
| 907 | - <text>{{data.goods_name}}</text> | 908 | + <text>{{front_g.goods_name}}</text> |
| 908 | </view> | 909 | </view> |
| 909 | </view> | 910 | </view> |
| 910 | <view class="tb_item tb-l"> | 911 | <view class="tb_item tb-l"> |
| @@ -912,7 +913,7 @@ | @@ -912,7 +913,7 @@ | ||
| 912 | <text>商品编号</text> | 913 | <text>商品编号</text> |
| 913 | </view> | 914 | </view> |
| 914 | <view class="item_right"> | 915 | <view class="item_right"> |
| 915 | - <text>{{data.goods_sn}}</text> | 916 | + <text>{{front_g.goods_sn}}</text> |
| 916 | </view> | 917 | </view> |
| 917 | </view> | 918 | </view> |
| 918 | <view class="tb_item tb-l"> | 919 | <view class="tb_item tb-l"> |
| @@ -920,7 +921,7 @@ | @@ -920,7 +921,7 @@ | ||
| 920 | <text>商品条码</text> | 921 | <text>商品条码</text> |
| 921 | </view> | 922 | </view> |
| 922 | <view class="item_right"> | 923 | <view class="item_right"> |
| 923 | - <text>{{data.sku}}</text> | 924 | + <text>{{front_g.sku}}</text> |
| 924 | </view> | 925 | </view> |
| 925 | </view> | 926 | </view> |
| 926 | <view class="tb_item tb-l" wx:if="{{cat_name && is_show_pl}}"> | 927 | <view class="tb_item tb-l" wx:if="{{cat_name && is_show_pl}}"> |
| @@ -952,7 +953,7 @@ | @@ -952,7 +953,7 @@ | ||
| 952 | <text>规格</text> | 953 | <text>规格</text> |
| 953 | </view> | 954 | </view> |
| 954 | <view class="item_right"> | 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 | </view> | 957 | </view> |
| 957 | </view> | 958 | </view> |
| 958 | <view class="tb_item tb-l"> | 959 | <view class="tb_item tb-l"> |
| @@ -960,7 +961,7 @@ | @@ -960,7 +961,7 @@ | ||
| 960 | <text>上架时间</text> | 961 | <text>上架时间</text> |
| 961 | </view> | 962 | </view> |
| 962 | <view class="item_right"> | 963 | <view class="item_right"> |
| 963 | - <text>{{data.on_time}}</text> | 964 | + <text>{{front_g.on_time}}</text> |
| 964 | </view> | 965 | </view> |
| 965 | </view> | 966 | </view> |
| 966 | </view> | 967 | </view> |
| @@ -1102,13 +1103,13 @@ | @@ -1102,13 +1103,13 @@ | ||
| 1102 | <view>购物车</view> | 1103 | <view>购物车</view> |
| 1103 | </navigator> | 1104 | </navigator> |
| 1104 | </view> | 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 | </view> | 1108 | </view> |
| 1108 | <!-- 普通商品购买 --> | 1109 | <!-- 普通商品购买 --> |
| 1109 | <block wx:if="{{prom_type==0 || prom_type==3}}"> | 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 | <view bindtap="openSpecModel" data-ind="1" class="join-btn cart-btn">加入购物车</view> | 1113 | <view bindtap="openSpecModel" data-ind="1" class="join-btn cart-btn">加入购物车</view> |
| 1113 | <view bindtap="openSpecModel" data-ind="2" class="buy-btn cart-btn">立即购买</view> | 1114 | <view bindtap="openSpecModel" data-ind="2" class="buy-btn cart-btn">立即购买</view> |
| 1114 | </block> | 1115 | </block> |
| @@ -1117,15 +1118,15 @@ | @@ -1117,15 +1118,15 @@ | ||
| 1117 | </block> | 1118 | </block> |
| 1118 | </block> | 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 | <view bindtap="openSpecModel" data-ind="1" class="join-btn cart-btn">加入购物车</view> | 1123 | <view bindtap="openSpecModel" data-ind="1" class="join-btn cart-btn">加入购物车</view> |
| 1123 | <view bindtap="openSpecModel" data-ind="2" class="buy-btn cart-btn">立即抢购</view> | 1124 | <view bindtap="openSpecModel" data-ind="2" class="buy-btn cart-btn">立即抢购</view> |
| 1124 | </block> | 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 | <view bindtap="openSpecModel_Nor" data-nor="1" class="join-btn cart-btn">单独购买</view> | 1130 | <view bindtap="openSpecModel_Nor" data-nor="1" class="join-btn cart-btn">单独购买</view> |
| 1130 | <view class="buy-btn cart-btn lanse">即将开始</view> | 1131 | <view class="buy-btn cart-btn lanse">即将开始</view> |
| 1131 | </block> | 1132 | </block> |
| @@ -1135,12 +1136,12 @@ | @@ -1135,12 +1136,12 @@ | ||
| 1135 | </block> | 1136 | </block> |
| 1136 | 1137 | ||
| 1137 | 1138 | ||
| 1138 | - <block wx:if="{{prom_r_null}}"> | 1139 | + <block wx:if="{{f_prom_r_null}}"> |
| 1139 | <block wx:if="{{prom_type==1}}"> | 1140 | <block wx:if="{{prom_type==1}}"> |
| 1140 | 1141 | ||
| 1141 | <!-- 多个秒杀的时候 --> | 1142 | <!-- 多个秒杀的时候 --> |
| 1142 | <block wx:if="{{is_more_flash}}"> | 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 | <view bindtap="openSpecModel_Nor" data-nor="1" class="join-btn cart-btn">单独购买</view> | 1145 | <view bindtap="openSpecModel_Nor" data-nor="1" class="join-btn cart-btn">单独购买</view> |
| 1145 | <view bindtap="openSpecModel" data-ind="2" class="buy-btn cart-btn">立即抢购</view> | 1146 | <view bindtap="openSpecModel" data-ind="2" class="buy-btn cart-btn">立即抢购</view> |
| 1146 | </block> | 1147 | </block> |
| @@ -1150,7 +1151,7 @@ | @@ -1150,7 +1151,7 @@ | ||
| 1150 | </block> | 1151 | </block> |
| 1151 | </block> | 1152 | </block> |
| 1152 | <block wx:else> | 1153 | <block wx:else> |
| 1153 | - <block wx:if="{{prom_act.is_shop_buy}}"> | 1154 | + <block wx:if="{{f_prom_act.is_shop_buy}}"> |
| 1154 | <view bindtap="openSpecModel_Nor" data-nor="1" class="join-btn cart-btn">单独购买</view> | 1155 | <view bindtap="openSpecModel_Nor" data-nor="1" class="join-btn cart-btn">单独购买</view> |
| 1155 | <view class="buy-btn cart-btn huise">已抢光</view> | 1156 | <view class="buy-btn cart-btn huise">已抢光</view> |
| 1156 | </block> | 1157 | </block> |
| @@ -1165,6 +1166,65 @@ | @@ -1165,6 +1166,65 @@ | ||
| 1165 | <view wx:else class="buy-btn cart-btn cart-btn-lg huise set_width">已抢光</view> | 1166 | <view wx:else class="buy-btn cart-btn cart-btn-lg huise set_width">已抢光</view> |
| 1166 | 1167 | ||
| 1167 | </block> | 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 | <block wx:if="{{prom_st==3 && !prom_r_null}}"> | 1228 | <block wx:if="{{prom_st==3 && !prom_r_null}}"> |
| 1169 | <block wx:if="{{prom_type==1 && prom_act.is_shop_buy}}"> | 1229 | <block wx:if="{{prom_type==1 && prom_act.is_shop_buy}}"> |
| 1170 | <view bindtap="openSpecModel_Nor" data-nor="1" class="join-btn cart-btn">单独购买</view> | 1230 | <view bindtap="openSpecModel_Nor" data-nor="1" class="join-btn cart-btn">单独购买</view> |
| @@ -1173,15 +1233,16 @@ | @@ -1173,15 +1233,16 @@ | ||
| 1173 | <view wx:else class="buy-btn cart-btn cart-btn-lg lanse set_width">活动已经结束</view> | 1233 | <view wx:else class="buy-btn cart-btn cart-btn-lg lanse set_width">活动已经结束</view> |
| 1174 | </block> | 1234 | </block> |
| 1175 | </block> | 1235 | </block> |
| 1236 | + | ||
| 1176 | <!-- -----拼单------ --> | 1237 | <!-- -----拼单------ --> |
| 1177 | <block wx:if="{{prom_type==6}}"> | 1238 | <block wx:if="{{prom_type==6}}"> |
| 1178 | <view bindtap="openSpecModel_pt" data-it="1" data-ind="1" class="join-btn cart-btn line-h"> | 1239 | <view bindtap="openSpecModel_pt" data-it="1" data-ind="1" class="join-btn cart-btn line-h"> |
| 1179 | <view class="fir-v"> | 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 | </block> | 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 | </view> | 1246 | </view> |
| 1186 | <view>单独购买</view> | 1247 | <view>单独购买</view> |
| 1187 | </view> | 1248 | </view> |
| @@ -1236,10 +1297,10 @@ | @@ -1236,10 +1297,10 @@ | ||
| 1236 | <block wx:if="{{is_shopbuy}}"> | 1297 | <block wx:if="{{is_shopbuy}}"> |
| 1237 | <view bindtap="go_pay_integral_normal" class="join-btn cart-btn line-h"> | 1298 | <view bindtap="go_pay_integral_normal" class="join-btn cart-btn line-h"> |
| 1238 | <view class="fir-v"> | 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 | </block> | 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 | </view> | 1304 | </view> |
| 1244 | <view>单独购买</view> | 1305 | <view>单独购买</view> |
| 1245 | </view> | 1306 | </view> |
| @@ -1390,12 +1451,12 @@ | @@ -1390,12 +1451,12 @@ | ||
| 1390 | <view hidden="{{ismend==1}}" style="max-height: 120rpx;overflow-y: auto;"> | 1451 | <view hidden="{{ismend==1}}" style="max-height: 120rpx;overflow-y: auto;"> |
| 1391 | 1452 | ||
| 1392 | <block wx:if="{{sku_g_pt}}"> | 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 | {{item.gg}} | 1455 | {{item.gg}} |
| 1395 | </view> | 1456 | </view> |
| 1396 | </block> | 1457 | </block> |
| 1397 | <block wx:else> | 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 | {{item.gg}} | 1460 | {{item.gg}} |
| 1400 | </view> | 1461 | </view> |
| 1401 | </block> | 1462 | </block> |
| @@ -1682,7 +1743,7 @@ | @@ -1682,7 +1743,7 @@ | ||
| 1682 | <view class="store-list"> | 1743 | <view class="store-list"> |
| 1683 | <!-- 如果还没有点击更多门店的时候 --> | 1744 | <!-- 如果还没有点击更多门店的时候 --> |
| 1684 | <block wx:if="{{choice_sort_store==0}}"> | 1745 | <block wx:if="{{choice_sort_store==0}}"> |
| 1685 | - <!-- 需要for循环 --> | 1746 | + <!-- 需要for循环is_show_sto_cat表示门店的数量已经超10个 --> |
| 1686 | <block wx:if="{{is_show_sto_cat==1}}"> | 1747 | <block wx:if="{{is_show_sto_cat==1}}"> |
| 1687 | <view class="store_choose flex" wx:for="{{def_pickpu_list}}" bindtap="choose_for_store_fir" data-ind="{{index}}"> | 1748 | <view class="store_choose flex" wx:for="{{def_pickpu_list}}" bindtap="choose_for_store_fir" data-ind="{{index}}"> |
| 1688 | <view class="store flex-vertical"> | 1749 | <view class="store flex-vertical"> |
| @@ -1716,6 +1777,7 @@ | @@ -1716,6 +1777,7 @@ | ||
| 1716 | </view> | 1777 | </view> |
| 1717 | </block> | 1778 | </block> |
| 1718 | <block wx:else> | 1779 | <block wx:else> |
| 1780 | + <!-- 此时的情况就是门店的数量少于10个 --> | ||
| 1719 | <view class="store_choose flex" wx:for="{{only_pk}}" bindtap="choose_for_store_fir" data-ind="{{index}}"> | 1781 | <view class="store_choose flex" wx:for="{{only_pk}}" bindtap="choose_for_store_fir" data-ind="{{index}}"> |
| 1720 | <view class="store flex-vertical"> | 1782 | <view class="store flex-vertical"> |
| 1721 | <!-- 需要点击事件 --> | 1783 | <!-- 需要点击事件 --> |
| @@ -1815,6 +1877,7 @@ | @@ -1815,6 +1877,7 @@ | ||
| 1815 | </block> | 1877 | </block> |
| 1816 | </view> | 1878 | </view> |
| 1817 | </block> | 1879 | </block> |
| 1880 | + | ||
| 1818 | <!-- ---------------分享弹窗--------------- --> | 1881 | <!-- ---------------分享弹窗--------------- --> |
| 1819 | <!-- 二维码显示页面 --> | 1882 | <!-- 二维码显示页面 --> |
| 1820 | <canvas canvas-id='share' style='width:750rpx;height:1217rpx;background-color:white;' wx:if="{{!canvasHidden}}"></canvas> | 1883 | <canvas canvas-id='share' style='width:750rpx;height:1217rpx;background-color:white;' wx:if="{{!canvasHidden}}"></canvas> |
| @@ -1849,7 +1912,7 @@ | @@ -1849,7 +1912,7 @@ | ||
| 1849 | <view class="t-c fs36" style="color: #c3172d">提示</view> | 1912 | <view class="t-c fs36" style="color: #c3172d">提示</view> |
| 1850 | 1913 | ||
| 1851 | <block wx:for="{{more_flash}}"> | 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 | <view class="ellipsis-2" style="max-width: 80%">该商品有参与{{item.act_name}} {{tool.act_type(item.prom_type)}} 活动</view> | 1916 | <view class="ellipsis-2" style="max-width: 80%">该商品有参与{{item.act_name}} {{tool.act_type(item.prom_type)}} 活动</view> |
| 1854 | <view class="fs26 c-7b">去参与 | 1917 | <view class="fs26 c-7b">去参与 |
| 1855 | <text class="bg_jj is_more_cx"></text> | 1918 | <text class="bg_jj is_more_cx"></text> |
pages/index/index/index.json
| @@ -10,6 +10,7 @@ | @@ -10,6 +10,7 @@ | ||
| 10 | "shopname": "/components/diy_shopname/diy_shopname", | 10 | "shopname": "/components/diy_shopname/diy_shopname", |
| 11 | "pingd_buy": "/components/diy_pingd_buy/diy_pingd_buy", | 11 | "pingd_buy": "/components/diy_pingd_buy/diy_pingd_buy", |
| 12 | "diy_public": "/components/diy_public/diy_public", | 12 | "diy_public": "/components/diy_public/diy_public", |
| 13 | + "heat_img": "/components/diy_heatImg/diy_heatImg", | ||
| 13 | "title": "/components/diy_title/diy_title", | 14 | "title": "/components/diy_title/diy_title", |
| 14 | "notice": "/components/diy_notice/diy_notice", | 15 | "notice": "/components/diy_notice/diy_notice", |
| 15 | "voice": "/components/diy_voice/diy_voice", | 16 | "voice": "/components/diy_voice/diy_voice", |
pages/index/index/index.wxml
| @@ -488,9 +488,10 @@ | @@ -488,9 +488,10 @@ | ||
| 488 | <block wx:if="{{item.ename=='seckill' || item.ename=='seckillNew'}}"> | 488 | <block wx:if="{{item.ename=='seckill' || item.ename=='seckillNew'}}"> |
| 489 | <seckill object="{{item.content}}"></seckill> | 489 | <seckill object="{{item.content}}"></seckill> |
| 490 | </block> | 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 | <block wx:if="{{item.ename=='title'}}"> | 496 | <block wx:if="{{item.ename=='title'}}"> |
| 496 | <title object="{{item.content}}"></title> | 497 | <title object="{{item.content}}"></title> |
pages/template/index.json
| @@ -13,6 +13,7 @@ | @@ -13,6 +13,7 @@ | ||
| 13 | "pingd_buy": "/components/diy_pingd_buy/diy_pingd_buy", | 13 | "pingd_buy": "/components/diy_pingd_buy/diy_pingd_buy", |
| 14 | "luckyGo": "/components/diy_luckyGo/diy_luckyGo", | 14 | "luckyGo": "/components/diy_luckyGo/diy_luckyGo", |
| 15 | "diy_public": "/components/diy_public/diy_public", | 15 | "diy_public": "/components/diy_public/diy_public", |
| 16 | + "heat_img": "/components/diy_heatImg/diy_heatImg", | ||
| 16 | "title": "/components/diy_title/diy_title", | 17 | "title": "/components/diy_title/diy_title", |
| 17 | "notice": "/components/diy_notice/diy_notice", | 18 | "notice": "/components/diy_notice/diy_notice", |
| 18 | "voice": "/components/diy_voice/diy_voice", | 19 | "voice": "/components/diy_voice/diy_voice", |
pages/template/index.wxml
| @@ -47,6 +47,10 @@ | @@ -47,6 +47,10 @@ | ||
| 47 | <block wx:if="{{item.ename=='seckill' || item.ename=='seckillNew'}}"> | 47 | <block wx:if="{{item.ename=='seckill' || item.ename=='seckillNew'}}"> |
| 48 | <seckill object="{{item.content}}"></seckill> | 48 | <seckill object="{{item.content}}"></seckill> |
| 49 | </block> | 49 | </block> |
| 50 | + <!-- 热区切图 --> | ||
| 51 | + <block wx:if="{{item.ename=='heatCutDiagram'}}"> | ||
| 52 | + <heat_img object="{{item.content}}" ></heat_img> | ||
| 53 | + </block> | ||
| 50 | <!-- <block wx:if="{{item.ename=='seckillNew'}}"> | 54 | <!-- <block wx:if="{{item.ename=='seckillNew'}}"> |
| 51 | <diy_public object="{{item.content}}" prom_type="1"></diy_public> | 55 | <diy_public object="{{item.content}}" prom_type="1"></diy_public> |
| 52 | </block> --> | 56 | </block> --> |
pages/user/order_detail/order_detail.js
pages/user/order_list/order_list.wxml
| @@ -215,6 +215,7 @@ | @@ -215,6 +215,7 @@ | ||
| 215 | <view>合计<text wx:if="{{item.discount!=underdefine && item.discount!=null && item.discount!=0}}" style="color:#d60021;">(改)</text>:</view> | 215 | <view>合计<text wx:if="{{item.discount!=underdefine && item.discount!=null && item.discount!=0}}" style="color:#d60021;">(改)</text>:</view> |
| 216 | <view class="fs24 c-r">¥</view> | 216 | <view class="fs24 c-r">¥</view> |
| 217 | <view class="c-r">{{filters.toFix(item.order_amount+item.user_money+item.pt_tail_money+item.use_commission+item.pre_cut,2)}} | 217 | <view class="c-r">{{filters.toFix(item.order_amount+item.user_money+item.pt_tail_money+item.use_commission+item.pre_cut,2)}} |
| 218 | + <text wx:if="{{item.coupon_price}}">+{{item.coupon_price}}元优惠券</text> | ||
| 218 | </view> | 219 | </view> |
| 219 | 220 | ||
| 220 | </view> | 221 | </view> |
utils/more_cx.js
| @@ -402,7 +402,8 @@ module.exports = { | @@ -402,7 +402,8 @@ module.exports = { | ||
| 402 | //-- 促销活动对象表,最初的map表,包含活动类型,活动id,goods商品 --- | 402 | //-- 促销活动对象表,最初的map表,包含活动类型,活动id,goods商品 --- |
| 403 | var cx_act_map=[]; | 403 | var cx_act_map=[]; |
| 404 | for(var i=0; i<goods.length;i++){ | 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 | if(!c_item.selected) continue; | 408 | if(!c_item.selected) continue; |
| 408 | //如果是秒杀之类是商品 | 409 | //如果是秒杀之类是商品 |
utils/request.js
| @@ -270,16 +270,17 @@ module.exports = { | @@ -270,16 +270,17 @@ module.exports = { | ||
| 270 | //---promise的使用delete---- | 270 | //---promise的使用delete---- |
| 271 | promiseDelete: function (url, data) { | 271 | promiseDelete: function (url, data) { |
| 272 | var th = this; | 272 | var th = this; |
| 273 | + if(!data) data={}; | ||
| 273 | if (url.indexOf("http") == -1) url = getApp().globalData.setting.url + url; | 274 | if (url.indexOf("http") == -1) url = getApp().globalData.setting.url + url; |
| 274 | return new Promise((resolve, reject) => { | 275 | return new Promise((resolve, reject) => { |
| 275 | - data.isShowLoading && th.showLoading(); | 276 | + data && data.isShowLoading && th.showLoading(); |
| 276 | wx.request({ | 277 | wx.request({ |
| 277 | url, | 278 | url, |
| 278 | method: 'DELETE', | 279 | method: 'DELETE', |
| 279 | header: { "content-type": "application/x-www-form-urlencoded" }, | 280 | header: { "content-type": "application/x-www-form-urlencoded" }, |
| 280 | data: data.data, | 281 | data: data.data, |
| 281 | success(res) { | 282 | success(res) { |
| 282 | - data.isShowLoading && th.hideLoading(); | 283 | + data && data.isShowLoading && th.hideLoading(); |
| 283 | resolve(res); | 284 | resolve(res); |
| 284 | }, | 285 | }, |
| 285 | fail(err) { data.isShowLoading && th.hideLoading(); reject(err); } | 286 | fail(err) { data.isShowLoading && th.hideLoading(); reject(err); } |
utils/util.js
| @@ -1012,5 +1012,11 @@ module.exports = { | @@ -1012,5 +1012,11 @@ module.exports = { | ||
| 1012 | wx_back:wx_back, | 1012 | wx_back:wx_back, |
| 1013 | _debounce, | 1013 | _debounce, |
| 1014 | calculatewuliu:calculatewuliu, //计算物流的函数进行抽象 | 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 | }; |