Commit edba7a72e88f62e704f4971a910fbf7c90fb18d7
Merge branch 'qa' of http://git.vipzhuang.cn/wxd/MShopWeApp
Showing
26 changed files
with
930 additions
and
298 deletions
app.js
@@ -1453,10 +1453,94 @@ App({ | @@ -1453,10 +1453,94 @@ App({ | ||
1453 | }) | 1453 | }) |
1454 | } | 1454 | } |
1455 | return cx_arr; | 1455 | return cx_arr; |
1456 | - }, | 1456 | + }, |
1457 | + | ||
1458 | + //-- 获取判断注册成功后,是跳转等级卡,还是新人有礼 -- | ||
1459 | + async go_to_page(is_reg,func){ | ||
1460 | + if(!is_reg) { | ||
1461 | + func(); | ||
1462 | + return false; | ||
1463 | + } | ||
1464 | + //如果是从企业专属导购跳过来的话,就要返回专属导购处理页面 | ||
1465 | + let qyzsdg = wx.getStorageSync('qyzsdg') //如果是专属导购 | ||
1466 | + if (qyzsdg) { | ||
1467 | + wx.reLaunch({ | ||
1468 | + url: `/packageE/pages/qy/contactMe/contactMe?scene=${qyzsdg}`, | ||
1469 | + }) | ||
1470 | + return | ||
1471 | + } | ||
1457 | 1472 | ||
1473 | + //新判断新人有礼 | ||
1474 | + var res= await getApp().request.promiseGet("/api/weshop/marketing/newpeople/act/judge", { | ||
1475 | + data: { | ||
1476 | + storeId: os.stoid, | ||
1477 | + userId: this.globalData.user_id | ||
1478 | + } | ||
1479 | + }); | ||
1480 | + | ||
1481 | + if (res.data.code == 0) { | ||
1482 | + var actid = res.data.data.id; //活动id | ||
1483 | + var giftBagId = res.data.data.giftBagId; //礼包id | ||
1484 | + var new_nav = "/pages/giftpack/newvipgift/newvipgift?actId=" + actid + '&' + 'actType=' + 1 + '&' + 'giftBagId=' + giftBagId; | ||
1485 | + wx.redirectTo({ | ||
1486 | + url:new_nav | ||
1487 | + }) | ||
1488 | + return false; | ||
1489 | + } | ||
1458 | 1490 | ||
1491 | + //如果已经是等级卡了就跳过 | ||
1492 | + if(this.globalData.userInfo.card_field){ | ||
1493 | + //没有等级卡和新人有礼的时候 | ||
1494 | + if(func) func(); | ||
1495 | + return false; | ||
1496 | + } | ||
1497 | + | ||
1498 | + var dj_buy=await getApp().promiseGet("/store/storemoduleendtime/page?store_id=" + this.globalData.setting.stoid+ "&type=3", {}); | ||
1499 | + var ob = { isout: 0, isbuy: 0 }; | ||
1500 | + if (dj_buy.data.code == 0) { | ||
1501 | + var arr = dj_buy.data.data.pageData; | ||
1502 | + //----如果数组不为空---- | ||
1503 | + if (arr.length > 0) { | ||
1504 | + arr.forEach(function (val, ind) { | ||
1505 | + if (val.is_sy == 0 || val.is_sy == 1) { | ||
1506 | + ob.isbuy = 1; | ||
1507 | + var now = ut.gettimestamp(); | ||
1508 | + if (now > val.end_time) ob.isout = 1; | ||
1509 | + return false; | ||
1510 | + } | ||
1511 | + }) | ||
1512 | + } | ||
1513 | + } | ||
1514 | + | ||
1515 | + //-- 获取等级卡,直接去买等级卡 -- | ||
1516 | + if(ob.isbuy && !ob.isout){ | ||
1517 | + //-- 获取等级卡购买的数量 -- | ||
1518 | + var conf=await getApp().promiseGet("/api/weshop/storeconfig/get/" + this.globalData.setting.stoid, {}); | ||
1519 | + //-- 获取等级卡的会员已经购买的数量 --- | ||
1520 | + var dj=await getApp().promiseGet("/api/weshop/users/getUserCard/" + this.globalData.setting.stoid, {}); | ||
1521 | + var dj_num=0; | ||
1522 | + if(dj.data.code==0){ | ||
1523 | + dj_num=dj.data.data?dj.data.data:0; | ||
1524 | + } | ||
1525 | + | ||
1526 | + var sw_list= conf.data.data.switch_list; | ||
1527 | + if(sw_list){ | ||
1528 | + sw_list=JSON.parse(sw_list); | ||
1529 | + } | ||
1530 | + | ||
1531 | + | ||
1532 | + if (sw_list && sw_list.rank_switch==2 && conf.data.code == 0 && conf.data.data.dj_num>0 && conf.data.data.dj_num>dj_num) { | ||
1533 | + var nav = "/pages/user/plus/plus"; | ||
1534 | + wx.redirectTo({ | ||
1535 | + url:nav | ||
1536 | + }) | ||
1537 | + return false; | ||
1538 | + } | ||
1539 | + } | ||
1540 | + //没有等级卡和新人有礼的时候 | ||
1541 | + if(func) func(); | ||
1542 | + } | ||
1459 | 1543 | ||
1460 | - }); | 1544 | +}); |
1461 | 1545 | ||
1462 | 1546 |
packageA/pages/details_serviceCard/details_serviceCard.js
@@ -605,7 +605,7 @@ Page({ | @@ -605,7 +605,7 @@ Page({ | ||
605 | let order_sn = this.data.details.order_sn; | 605 | let order_sn = this.data.details.order_sn; |
606 | let order_id = this.data.details.order_id; | 606 | let order_id = this.data.details.order_id; |
607 | let store_id = app.globalData.setting.stoid; | 607 | let store_id = app.globalData.setting.stoid; |
608 | - let user_id = os.user_id; | 608 | + let user_id = getApp().globalData.user_id; |
609 | 609 | ||
610 | let flag = true; | 610 | let flag = true; |
611 | // 如果是普通购买或单独购买,不用判断 | 611 | // 如果是普通购买或单独购买,不用判断 |
@@ -648,7 +648,7 @@ Page({ | @@ -648,7 +648,7 @@ Page({ | ||
648 | 648 | ||
649 | 649 | ||
650 | var t_now = ut.gettimestamp(); | 650 | var t_now = ut.gettimestamp(); |
651 | - if (act_details.is_end == 0 && act_details.start_time < t_now && act_details.end_time > t_now) { | 651 | + if (act_details.is_end == 1 || act_details.start_time > t_now || act_details.end_time < t_now) { |
652 | wx.showModal({ | 652 | wx.showModal({ |
653 | title: '提示', | 653 | title: '提示', |
654 | content: '活动发生了变化,无法支付,请取消订单,重新购买!', | 654 | content: '活动发生了变化,无法支付,请取消订单,重新购买!', |
@@ -658,10 +658,23 @@ Page({ | @@ -658,10 +658,23 @@ Page({ | ||
658 | return false; | 658 | return false; |
659 | } | 659 | } |
660 | 660 | ||
661 | + //指定门店的控制 | ||
662 | + if (act_details.pick_up_lists) { | ||
663 | + var idx0=act_details.pick_up_lists.findIndex(function (e){ | ||
664 | + return e.pickup_id==it.pickup_id; | ||
665 | + }) | ||
666 | + if(idx0<0){ | ||
667 | + getApp().confirmBox(it.service_name + "秒杀活动的门店不可售"); | ||
668 | + th.setData({ paying: 0 }); | ||
669 | + flag = false; | ||
670 | + return false; | ||
671 | + } | ||
672 | + } | ||
673 | + | ||
661 | }; | 674 | }; |
662 | }); | 675 | }); |
663 | 676 | ||
664 | - if(act_details.buy_limit>0 && flag){ | 677 | + if(act_details && act_details.buy_limit>0 && flag){ |
665 | await getApp().request.promiseGet("/api/weshop/rechargeServicelist/getUserBuyGoodsNum", { | 678 | await getApp().request.promiseGet("/api/weshop/rechargeServicelist/getUserBuyGoodsNum", { |
666 | data: { | 679 | data: { |
667 | store_id: store_id, | 680 | store_id: store_id, |
packageA/pages/goodsInfo/buy_flash_normal.wxml
@@ -30,7 +30,7 @@ | @@ -30,7 +30,7 @@ | ||
30 | <!-- 选择门店模块 --> | 30 | <!-- 选择门店模块 --> |
31 | <view class="flex-space-between address ai_end xc-width "> | 31 | <view class="flex-space-between address ai_end xc-width "> |
32 | 32 | ||
33 | - <view class="flex ai_end" wx:if="{{def_pick_store && def_pick_store.pickup_name}}"> | 33 | + <view class="flex" wx:if="{{def_pick_store && def_pick_store.pickup_name}}"> |
34 | <text class="fs30 xc-black3 shop_name">{{def_pick_store.pickup_name}}</text> | 34 | <text class="fs30 xc-black3 shop_name">{{def_pick_store.pickup_name}}</text> |
35 | <view class="distance fs24 xc-ash"wx:if="{{def_pick_store.distance!=null}}"> | 35 | <view class="distance fs24 xc-ash"wx:if="{{def_pick_store.distance!=null}}"> |
36 | 距离:{{def_pick_store.distance>1000?filters.toFix(def_pick_store.distance/1000,2)+"km":filters.toFix(def_pick_store.distance,0)+"m"}} | 36 | 距离:{{def_pick_store.distance>1000?filters.toFix(def_pick_store.distance/1000,2)+"km":filters.toFix(def_pick_store.distance,0)+"m"}} |
@@ -50,7 +50,7 @@ | @@ -50,7 +50,7 @@ | ||
50 | <block wx:else> | 50 | <block wx:else> |
51 | <view wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">(库存不足)</view> | 51 | <view wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">(库存不足)</view> |
52 | <block wx:else> | 52 | <block wx:else> |
53 | - <view class="no_store" wx:if="{{def_pick_store.is_no_dis}}">(配送不匹配)</view> | 53 | + <view class="no_store" wx:if="{{def_pick_store.is_no_dis}}">(该店不可售)</view> |
54 | <view wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && !filters.is_virtual_gd(sele_g.is_virtual) && sales_rules==2 && prom_type==0}}">(库存不足)</view> | 54 | <view wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && !filters.is_virtual_gd(sele_g.is_virtual) && sales_rules==2 && prom_type==0}}">(库存不足)</view> |
55 | </block> | 55 | </block> |
56 | </block> | 56 | </block> |
@@ -97,7 +97,7 @@ | @@ -97,7 +97,7 @@ | ||
97 | 97 | ||
98 | <!-- 根本就找不到门店 --> | 98 | <!-- 根本就找不到门店 --> |
99 | <block wx:if="{{def_pick_store && def_pick_store.is_no_dis}}"> | 99 | <block wx:if="{{def_pick_store && def_pick_store.is_no_dis}}"> |
100 | - <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">配送不匹配</view> | 100 | + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">该店不可售</view> |
101 | </block> | 101 | </block> |
102 | <block wx:else> | 102 | <block wx:else> |
103 | <!-- 根本就找不到门店 --> | 103 | <!-- 根本就找不到门店 --> |
packageA/pages/goodsInfo/goodsInfo.js
@@ -431,53 +431,7 @@ Page({ | @@ -431,53 +431,7 @@ Page({ | ||
431 | // gallery = g; | 431 | // gallery = g; |
432 | // }) | 432 | // }) |
433 | 433 | ||
434 | - | ||
435 | - // ----> 秒杀 | ||
436 | - let prom_type = this.data.options.prom_type; | ||
437 | - | ||
438 | - let goods_id = this.data.options.goods_id; | ||
439 | - if(!goods_id) goods_id = this.data.data.goods_id; | ||
440 | - | ||
441 | - if(prom_type) { // 进入商品详情页地址传参有带goods_id、prom_type、prom_id参数, 即从秒杀入口进入 | ||
442 | - let prom_id = this.data.options.prom_id; | ||
443 | - // 检查活动是否开始 | ||
444 | - this.check_prom(goods_id, prom_type, prom_id); | ||
445 | - | ||
446 | - } else { // 从非秒杀入口进入,地址不带prom_type、prom_id参数 | ||
447 | - getApp().request.promiseGet('/api/weshop/activitylist/listGoodActInfo2', { | ||
448 | - data: { | ||
449 | - store_id: os.stoid, | ||
450 | - goods_id: goods_id, | ||
451 | - goods_type: 1, | ||
452 | - user_id: oo.user_id, | ||
453 | - } | ||
454 | - }).then(res => { | ||
455 | - if (res.data.code == 0) { | ||
456 | - let result = res.data.data; | ||
457 | - let resLength = result.length; | ||
458 | - if(resLength == 1) { // 如果数组长度为1,则直接显示当前活动 | ||
459 | - let goods_id = this.data.options.goods_id; | ||
460 | - let prom_type = result[0].prom_type; | ||
461 | - let prom_id = result[0].act_id; | ||
462 | - this.setData({ | ||
463 | - 'options.prom_type': prom_type, | ||
464 | - 'options.prom_id': prom_id, | ||
465 | - }); | ||
466 | - // 检查活动是否开始 | ||
467 | - this.check_prom(goods_id, prom_type, prom_id); | ||
468 | - } else if(resLength > 1) { //如果数组长度大于1,表示当前商品参加多个活动,以列表形式显示多活动 | ||
469 | - this.setData({ | ||
470 | - actList: res.data.data, | ||
471 | - }); | ||
472 | - }; | ||
473 | - | ||
474 | - }else{ | ||
475 | - this.setData({ | ||
476 | - actList: res.data.data, | ||
477 | - }); | ||
478 | - } | ||
479 | - }); | ||
480 | - }; | 434 | + |
481 | // <---- 秒杀 | 435 | // <---- 秒杀 |
482 | 436 | ||
483 | //------是否收藏---------- | 437 | //------是否收藏---------- |
@@ -625,26 +579,20 @@ Page({ | @@ -625,26 +579,20 @@ Page({ | ||
625 | //获取用户的默认门店 | 579 | //获取用户的默认门店 |
626 | th.check_guide(()=>{ | 580 | th.check_guide(()=>{ |
627 | getApp().get_user_store(function(e) { | 581 | getApp().get_user_store(function(e) { |
628 | - console.log('get_user_store'); | ||
629 | - console.log("999999999"); | ||
630 | - | ||
631 | - | ||
632 | if(!e) { | 582 | if(!e) { |
633 | th.data.fir_def_store={}; //赋值空对象 | 583 | th.data.fir_def_store={}; //赋值空对象 |
634 | return false; | 584 | return false; |
635 | } | 585 | } |
636 | 586 | ||
637 | - console.log("000000"); | ||
638 | - | ||
639 | if(getApp().globalData.is_dj_pk) th.setData({has_def:1}) | 587 | if(getApp().globalData.is_dj_pk) th.setData({has_def:1}) |
640 | 588 | ||
641 | var ee=JSON.parse(JSON.stringify(e)); | 589 | var ee=JSON.parse(JSON.stringify(e)); |
642 | - | ||
643 | - | ||
644 | console.log(e); | 590 | console.log(e); |
645 | 591 | ||
646 | //--定时器推迟一下-- | 592 | //--定时器推迟一下-- |
647 | - setTimeout(function () { | 593 | + var appd=getApp().globalData; |
594 | + var w_time = setInterval(function() { | ||
595 | + if (that.data.is_get_local_ok == 0) return false; | ||
648 | if(!th.data.data){ | 596 | if(!th.data.data){ |
649 | return false; | 597 | return false; |
650 | } | 598 | } |
@@ -654,77 +602,74 @@ Page({ | @@ -654,77 +602,74 @@ Page({ | ||
654 | ee.is_no_dis=1; | 602 | ee.is_no_dis=1; |
655 | } | 603 | } |
656 | 604 | ||
657 | - var appd=getApp().globalData; | ||
658 | - var w_time = setInterval(function() { | ||
659 | - if (that.data.is_get_local_ok == 0) return false; | ||
660 | - clearInterval(w_time); | ||
661 | - var distance = null; | ||
662 | - var e=JSON.parse(JSON.stringify(ee)); | ||
663 | - | ||
664 | - //如果有开启近距离的话,同时距离优不一样了 | ||
665 | - if (that.data.lat != null) { | ||
666 | - //如果经纬度有变化的话 | ||
667 | - if(e && appd.lat==that.data.lat && appd.lon==that.data.lon && e.distance>0 ){ | ||
668 | - that.data.fir_def_store=e; | ||
669 | - that.setData({ | ||
670 | - def_pick_store: e, | ||
671 | - sto_sele_name: e.pickup_name, | ||
672 | - sto_sele_id: e.pickup_id, | ||
673 | - sto_sele_distr: e.distr_type, | ||
674 | - sto_sele_keyid:e.keyid, | ||
675 | - }) | ||
676 | - }else{ | ||
677 | - //要用接口是获取距离,js的计算不准 | ||
678 | - getApp().request.promiseGet("/api/weshop/pickup/list",{ | ||
679 | - data:{store_id:os.stoid,pickup_id:e.pickup_id,lat:th.data.lat,lon: th.data.lon, is_pos: 1}, | ||
680 | - }).then(res=>{ | ||
681 | - if(ut.ajax_ok(res)){ | ||
682 | - e=res.data.data.pageData[0]; | ||
683 | - if (e){ | ||
684 | - e.is_no_dis=ee.is_no_dis; | ||
685 | - appd.pk_store=e; | ||
686 | - that.data.fir_def_store=e; | ||
687 | - | ||
688 | - console.log('get_user_store--2'); | ||
689 | - console.log(e); | ||
690 | - | ||
691 | - that.setData({ | ||
692 | - def_pick_store: e, | ||
693 | - sto_sele_name: e.pickup_name, | ||
694 | - sto_sele_id: e.pickup_id, | ||
695 | - sto_sele_distr: e.distr_type, | ||
696 | - sto_sele_keyid:e.keyid, | ||
697 | - }) | ||
698 | - } | ||
699 | 605 | ||
606 | + clearInterval(w_time); | ||
607 | + var distance = null; | ||
608 | + var e=JSON.parse(JSON.stringify(ee)); | ||
609 | + | ||
610 | + //如果有开启近距离的话,同时距离优不一样了 | ||
611 | + if (that.data.lat != null) { | ||
612 | + //如果经纬度有变化的话 | ||
613 | + if(e && appd.lat==that.data.lat && appd.lon==that.data.lon && e.distance>0 ){ | ||
614 | + that.data.fir_def_store=e; | ||
615 | + that.setData({ | ||
616 | + def_pick_store: e, | ||
617 | + sto_sele_name: e.pickup_name, | ||
618 | + sto_sele_id: e.pickup_id, | ||
619 | + sto_sele_distr: e.distr_type, | ||
620 | + sto_sele_keyid:e.keyid, | ||
621 | + }) | ||
622 | + }else{ | ||
623 | + //要用接口是获取距离,js的计算不准 | ||
624 | + getApp().request.promiseGet("/api/weshop/pickup/list",{ | ||
625 | + data:{store_id:os.stoid,pickup_id:e.pickup_id,lat:th.data.lat,lon: th.data.lon, is_pos: 1}, | ||
626 | + }).then(res=>{ | ||
627 | + if(ut.ajax_ok(res)){ | ||
628 | + e=res.data.data.pageData[0]; | ||
629 | + if (e){ | ||
630 | + e.is_no_dis=ee.is_no_dis; | ||
631 | + appd.pk_store=e; | ||
632 | + that.data.fir_def_store=e; | ||
633 | + | ||
634 | + console.log('get_user_store--2'); | ||
635 | + console.log(e); | ||
636 | + | ||
637 | + that.setData({ | ||
638 | + def_pick_store: e, | ||
639 | + sto_sele_name: e.pickup_name, | ||
640 | + sto_sele_id: e.pickup_id, | ||
641 | + sto_sele_distr: e.distr_type, | ||
642 | + sto_sele_keyid:e.keyid, | ||
643 | + }) | ||
700 | } | 644 | } |
701 | - }) | ||
702 | - } | ||
703 | - | ||
704 | - //e.distance = distance; | ||
705 | - appd.lat=that.data.lat; | ||
706 | - appd.lon=that.data.lon; | ||
707 | - | ||
708 | - } else { | ||
709 | - if (e) { | ||
710 | - | ||
711 | 645 | ||
712 | - console.log('get_user_store3---'); | ||
713 | - console.log(e); | 646 | + } |
647 | + }) | ||
648 | + } | ||
714 | 649 | ||
715 | - e.distance = null; | ||
716 | - that.data.fir_def_store=e; | ||
717 | - that.setData({ | ||
718 | - def_pick_store: e, | ||
719 | - sto_sele_name: e.pickup_name, | ||
720 | - sto_sele_id: e.pickup_id, | ||
721 | - sto_sele_distr: e.distr_type, | ||
722 | - sto_sele_keyid:e.keyid, | ||
723 | - }) | ||
724 | - } | 650 | + //e.distance = distance; |
651 | + appd.lat=that.data.lat; | ||
652 | + appd.lon=that.data.lon; | ||
653 | + | ||
654 | + } else { | ||
655 | + if (e) { | ||
656 | + | ||
657 | + console.log('get_user_store3---'); | ||
658 | + console.log(e); | ||
659 | + | ||
660 | + e.distance = null; | ||
661 | + that.data.fir_def_store=e; | ||
662 | + that.setData({ | ||
663 | + def_pick_store: e, | ||
664 | + sto_sele_name: e.pickup_name, | ||
665 | + sto_sele_id: e.pickup_id, | ||
666 | + sto_sele_distr: e.distr_type, | ||
667 | + sto_sele_keyid:e.keyid, | ||
668 | + }) | ||
725 | } | 669 | } |
726 | - }, 500) | ||
727 | - },1500) | 670 | + } |
671 | + }, 200) | ||
672 | + | ||
728 | 673 | ||
729 | }); | 674 | }); |
730 | }) | 675 | }) |
@@ -773,11 +718,55 @@ Page({ | @@ -773,11 +718,55 @@ Page({ | ||
773 | // mapurl: t.data.data.listServiceVideos[0].video_url, | 718 | // mapurl: t.data.data.listServiceVideos[0].video_url, |
774 | // mapurl_f_img: t.data.data.listServiceVideos[0].video_img, | 719 | // mapurl_f_img: t.data.data.listServiceVideos[0].video_img, |
775 | //listServiceItem: t.data.data.listServiceItem, | 720 | //listServiceItem: t.data.data.listServiceItem, |
776 | - 'isshow':1 | ||
777 | - | ||
778 | }); | 721 | }); |
779 | 722 | ||
780 | that.getTaohe(); | 723 | that.getTaohe(); |
724 | + // ----> 秒杀 | ||
725 | + let prom_type = th.data.options.prom_type; | ||
726 | + | ||
727 | + let goods_id = th.data.options.goods_id; | ||
728 | + if(!goods_id) goods_id = th.data.data.goods_id; | ||
729 | + | ||
730 | + if(prom_type) { // 进入商品详情页地址传参有带goods_id、prom_type、prom_id参数, 即从秒杀入口进入 | ||
731 | + let prom_id = th.data.options.prom_id; | ||
732 | + // 检查活动是否开始 | ||
733 | + th.check_prom(goods_id, prom_type, prom_id); | ||
734 | + | ||
735 | + } else { // 从非秒杀入口进入,地址不带prom_type、prom_id参数 | ||
736 | + getApp().request.promiseGet('/api/weshop/activitylist/listGoodActInfo2', { | ||
737 | + data: { | ||
738 | + store_id: os.stoid, | ||
739 | + goods_id: goods_id, | ||
740 | + goods_type: 1, | ||
741 | + user_id: oo.user_id, | ||
742 | + } | ||
743 | + }).then(res => { | ||
744 | + if (res.data.code == 0) { | ||
745 | + let result = res.data.data; | ||
746 | + let resLength = result.length; | ||
747 | + if(resLength == 1) { // 如果数组长度为1,则直接显示当前活动 | ||
748 | + let goods_id = th.data.options.goods_id; | ||
749 | + let prom_type = result[0].prom_type; | ||
750 | + let prom_id = result[0].act_id; | ||
751 | + th.setData({ | ||
752 | + 'options.prom_type': prom_type, | ||
753 | + 'options.prom_id': prom_id, | ||
754 | + }); | ||
755 | + // 检查活动是否开始 | ||
756 | + th.check_prom(goods_id, prom_type, prom_id); | ||
757 | + } else if(resLength > 1) { //如果数组长度大于1,表示当前商品参加多个活动,以列表形式显示多活动 | ||
758 | + th.setData({ | ||
759 | + actList: res.data.data, | ||
760 | + }); | ||
761 | + }; | ||
762 | + | ||
763 | + }else{ | ||
764 | + th.setData({ | ||
765 | + actList: res.data.data, | ||
766 | + }); | ||
767 | + } | ||
768 | + }); | ||
769 | + }; | ||
781 | 770 | ||
782 | // console.log('0xxxxx999999', t.data.data); | 771 | // console.log('0xxxxx999999', t.data.data); |
783 | //-----商品详情--- | 772 | //-----商品详情--- |
@@ -808,7 +797,8 @@ Page({ | @@ -808,7 +797,8 @@ Page({ | ||
808 | }); | 797 | }); |
809 | 798 | ||
810 | th.data.enterAddressPage && (this.data.enterAddressPage = !1); | 799 | th.data.enterAddressPage && (this.data.enterAddressPage = !1); |
811 | - th.get_sto(); | 800 | + //没有互动,就调用默认的门店 |
801 | + if(!th.data.prom_type) th.get_sto(); | ||
812 | }) | 802 | }) |
813 | 803 | ||
814 | 804 | ||
@@ -1612,9 +1602,9 @@ Page({ | @@ -1612,9 +1602,9 @@ Page({ | ||
1612 | if(th.data.sele_g && th.data.sele_g.share_imgurl) { | 1602 | if(th.data.sele_g && th.data.sele_g.share_imgurl) { |
1613 | img = th.data.iurl + th.data.sele_g.share_imgurl; | 1603 | img = th.data.iurl + th.data.sele_g.share_imgurl; |
1614 | ob.imageUrl = img; | 1604 | ob.imageUrl = img; |
1615 | - }; | ||
1616 | - }; | ||
1617 | - | 1605 | + } |
1606 | + } | ||
1607 | + | ||
1618 | return ob; | 1608 | return ob; |
1619 | 1609 | ||
1620 | }, | 1610 | }, |
@@ -1639,9 +1629,22 @@ Page({ | @@ -1639,9 +1629,22 @@ Page({ | ||
1639 | 1629 | ||
1640 | //---------拿出门店分类和门店------------ | 1630 | //---------拿出门店分类和门店------------ |
1641 | get_sto(e) { | 1631 | get_sto(e) { |
1632 | + var is_normal=e; | ||
1642 | var th = this,that=this; | 1633 | var th = this,that=this; |
1634 | + | ||
1635 | + if (e == 1) { | ||
1636 | + th.setData({ | ||
1637 | + is_normal: 1 | ||
1638 | + }) | ||
1639 | + } else { | ||
1640 | + th.setData({ | ||
1641 | + is_normal: 0 | ||
1642 | + }) | ||
1643 | + } | ||
1644 | + | ||
1643 | var timer_get = setInterval(function() { | 1645 | var timer_get = setInterval(function() { |
1644 | if (th.data.is_get_local_ok == 0) return false; | 1646 | if (th.data.is_get_local_ok == 0) return false; |
1647 | + if (!th.data.fir_def_store) return false; | ||
1645 | var i = getApp().request; | 1648 | var i = getApp().request; |
1646 | if (!th.data.data) return false; | 1649 | if (!th.data.data) return false; |
1647 | var dd= { | 1650 | var dd= { |
@@ -1691,34 +1694,76 @@ Page({ | @@ -1691,34 +1694,76 @@ Page({ | ||
1691 | //删除 | 1694 | //删除 |
1692 | e.data.data.pageData.splice(k--, 1); | 1695 | e.data.data.pageData.splice(k--, 1); |
1693 | } | 1696 | } |
1694 | - } | ||
1695 | - } | 1697 | + } |
1696 | 1698 | ||
1697 | - //如果有开启距离的功能,没有设置默认门店,要用最近的门店作为默认门店 | ||
1698 | - if(dd.lat && (!th.data.def_pick_store || JSON.stringify(th.data.def_pick_store)=='{}') && th.data.bconfig && th.data.bconfig.is_sort_storage){ | ||
1699 | - th.setData({ | ||
1700 | - def_pick_store:e.data.data.pageData[0], | ||
1701 | - sto_sele_name: e.data.data.pageData[0].pickup_name, | ||
1702 | - sto_sele_id: e.data.data.pageData[0].pickup_id, | ||
1703 | - sto_sele_distr: e.data.data.pageData[0].distr_type, | ||
1704 | - sto_sele_keyid: e.data.data.pageData[0].keyid, | ||
1705 | - }); | ||
1706 | - th.data.fir_def_store=e.data.data.pageData[0]; | ||
1707 | } | 1699 | } |
1708 | 1700 | ||
1709 | - //-- 如果有默认选择门店的时候,要把默认门店放在第一位,修改不要配送方式的判断 -- | ||
1710 | - if (th.data.def_pick_store && JSON.stringify(th.data.def_pick_store)!='{}'){ | ||
1711 | - for (var k = 0; k < e.data.data.pageData.length; k++) { | ||
1712 | - if (e.data.data.pageData[k].pickup_id == th.data.def_pick_store.pickup_id) { | ||
1713 | - e.data.data.pageData.splice(k, 1); //删除 | ||
1714 | - break; | ||
1715 | - } | ||
1716 | - } | ||
1717 | - e.data.data.pageData.splice(0, 0, th.data.def_pick_store); //添加 | ||
1718 | - } | ||
1719 | - | ||
1720 | - th.setData({all_pick_list:e.data.data.pageData}); | ||
1721 | - th.deal_pickup(e); | 1701 | + //如果有秒杀的指定门店 |
1702 | + if(th.data.prom_type==1 && th.data.prom_act && th.data.prom_act.pick_up_lists && e.data.data.pageData.length && !is_normal){ | ||
1703 | + var pick_up_lists=th.data.prom_act.pick_up_lists; | ||
1704 | + for (var kq = 0; kq < e.data.data.pageData.length; kq++) { | ||
1705 | + var it0=e.data.data.pageData[kq]; | ||
1706 | + var idx0=pick_up_lists.findIndex(function (e){ | ||
1707 | + return e.pickup_id==it0.pickup_id; | ||
1708 | + }) | ||
1709 | + if (idx0<0) { | ||
1710 | + //删除 | ||
1711 | + e.data.data.pageData.splice(kq--, 1); | ||
1712 | + } | ||
1713 | + } | ||
1714 | + | ||
1715 | + if (th.data.def_pick_store && JSON.stringify(th.data.def_pick_store)!='{}'){ | ||
1716 | + //-- 查找一下门店有没有在 -- | ||
1717 | + var idx1=pick_up_lists.findIndex(function (e){ | ||
1718 | + return e.pickup_id==th.data.def_pick_store.pickup_id; | ||
1719 | + }) | ||
1720 | + if(idx1<0){ | ||
1721 | + //如果是秒杀的指定门店,就要设置秒杀的 | ||
1722 | + th.data.def_pick_store.is_no_dis_act=1; | ||
1723 | + that.setData({ | ||
1724 | + def_pick_store: th.data.def_pick_store | ||
1725 | + }) | ||
1726 | + } | ||
1727 | + } | ||
1728 | + | ||
1729 | + } | ||
1730 | + | ||
1731 | + //-- 如果门店过滤后,还会是数量 -- | ||
1732 | + if(e.data.data.pageData.length){ | ||
1733 | + //如果有开启距离的功能,没有设置默认门店,要用最近的门店作为默认门店 | ||
1734 | + if(dd.lat && (!th.data.def_pick_store || JSON.stringify(th.data.def_pick_store)=='{}') && th.data.bconfig && th.data.bconfig.is_sort_storage){ | ||
1735 | + th.setData({ | ||
1736 | + def_pick_store:e.data.data.pageData[0], | ||
1737 | + sto_sele_name: e.data.data.pageData[0].pickup_name, | ||
1738 | + sto_sele_id: e.data.data.pageData[0].pickup_id, | ||
1739 | + sto_sele_distr: e.data.data.pageData[0].distr_type, | ||
1740 | + sto_sele_keyid: e.data.data.pageData[0].keyid, | ||
1741 | + }); | ||
1742 | + th.data.fir_def_store=e.data.data.pageData[0]; | ||
1743 | + } | ||
1744 | + | ||
1745 | + //-- 如果有默认选择门店的时候,要把默认门店放在第一位,修改不要配送方式的判断 -- | ||
1746 | + if (th.data.def_pick_store && JSON.stringify(th.data.def_pick_store)!='{}'){ | ||
1747 | + for (var k = 0; k < e.data.data.pageData.length; k++) { | ||
1748 | + if (e.data.data.pageData[k].pickup_id == th.data.def_pick_store.pickup_id) { | ||
1749 | + e.data.data.pageData.splice(k, 1); //删除 | ||
1750 | + break; | ||
1751 | + } | ||
1752 | + } | ||
1753 | + e.data.data.pageData.splice(0, 0, th.data.def_pick_store); //添加 | ||
1754 | + } | ||
1755 | + | ||
1756 | + th.setData({all_pick_list:e.data.data.pageData,isshow:1}); | ||
1757 | + th.deal_pickup(e); | ||
1758 | + } | ||
1759 | + else{ | ||
1760 | + th.setData({ | ||
1761 | + isshow:1 | ||
1762 | + }) | ||
1763 | + wx.hideLoading(); | ||
1764 | + } | ||
1765 | + | ||
1766 | + | ||
1722 | },800) | 1767 | },800) |
1723 | 1768 | ||
1724 | } | 1769 | } |
@@ -2666,16 +2711,16 @@ Page({ | @@ -2666,16 +2711,16 @@ Page({ | ||
2666 | return false; | 2711 | return false; |
2667 | } | 2712 | } |
2668 | if(!th.data.only_pk && !th.data.def_pickpu_list){ | 2713 | if(!th.data.only_pk && !th.data.def_pickpu_list){ |
2669 | - getApp().confirmBox("门店库存不足", null, 25000, !1); | 2714 | + getApp().confirmBox("暂无可售门店", null, 25000, !1); |
2670 | return false; | 2715 | return false; |
2671 | } | 2716 | } |
2672 | 2717 | ||
2673 | if(th.data.only_pk && !th.data.only_pk.length){ | 2718 | if(th.data.only_pk && !th.data.only_pk.length){ |
2674 | - getApp().confirmBox("门店库存不足", null, 25000, !1); | 2719 | + getApp().confirmBox("暂无可售门店", null, 25000, !1); |
2675 | return false; | 2720 | return false; |
2676 | } | 2721 | } |
2677 | if(th.data.def_pickpu_list && !th.data.def_pickpu_list.length){ | 2722 | if(th.data.def_pickpu_list && !th.data.def_pickpu_list.length){ |
2678 | - getApp().confirmBox("门店库存不足", null, 25000, !1); | 2723 | + getApp().confirmBox("暂无可售门店", null, 25000, !1); |
2679 | return false; | 2724 | return false; |
2680 | } | 2725 | } |
2681 | 2726 | ||
@@ -3158,7 +3203,8 @@ Page({ | @@ -3158,7 +3203,8 @@ Page({ | ||
3158 | 3203 | ||
3159 | } | 3204 | } |
3160 | var title= th.data.data.goods_name; | 3205 | var title= th.data.data.goods_name; |
3161 | - var img=th.data.data.original_img; | 3206 | + // var img=th.data.data.original_img; |
3207 | + var img=th.data.iurl+th.data.data.image_url; | ||
3162 | if(th.data.prom_type==6){ | 3208 | if(th.data.prom_type==6){ |
3163 | title=th.data.prom_act.share_title; | 3209 | title=th.data.prom_act.share_title; |
3164 | img=th.data.iurl+th.data.prom_act.share_imgurl; | 3210 | img=th.data.iurl+th.data.prom_act.share_imgurl; |
@@ -3177,6 +3223,13 @@ Page({ | @@ -3177,6 +3223,13 @@ Page({ | ||
3177 | url+="&room_id="+getApp().globalData.room_id+"&room_user_share=1"; | 3223 | url+="&room_id="+getApp().globalData.room_id+"&room_user_share=1"; |
3178 | } | 3224 | } |
3179 | 3225 | ||
3226 | + // 如果服务卡参加秒杀活动,且后台设置了分享标题和分享图片 | ||
3227 | + if(th.data.prom_type == 1) { | ||
3228 | + if(th.data.sele_g && th.data.sele_g.share_imgurl) { | ||
3229 | + img = th.data.iurl + th.data.sele_g.share_imgurl; | ||
3230 | + }; | ||
3231 | + }; | ||
3232 | + | ||
3180 | return { | 3233 | return { |
3181 | title:price + "元 " +title, | 3234 | title:price + "元 " +title, |
3182 | imageUrl:img, | 3235 | imageUrl:img, |
@@ -3515,7 +3568,6 @@ Page({ | @@ -3515,7 +3568,6 @@ Page({ | ||
3515 | get_normal(gid) { | 3568 | get_normal(gid) { |
3516 | this.setData({ | 3569 | this.setData({ |
3517 | prom_type: 0, | 3570 | prom_type: 0, |
3518 | - isshow: 1, | ||
3519 | }); | 3571 | }); |
3520 | // this.get_sku(os.stoid, this.data.data, gid); | 3572 | // this.get_sku(os.stoid, this.data.data, gid); |
3521 | this.get_sto(); | 3573 | this.get_sto(); |
@@ -3550,7 +3602,7 @@ Page({ | @@ -3550,7 +3602,7 @@ Page({ | ||
3550 | 3602 | ||
3551 | if (prom_type == 1 && prom_id == 0) { | 3603 | if (prom_type == 1 && prom_id == 0) { |
3552 | this.setData({ | 3604 | this.setData({ |
3553 | - prom_type: 0, isshow: 1, | 3605 | + prom_type: 0 |
3554 | }); | 3606 | }); |
3555 | 3607 | ||
3556 | //获取门店 | 3608 | //获取门店 |
@@ -3619,7 +3671,6 @@ Page({ | @@ -3619,7 +3671,6 @@ Page({ | ||
3619 | prom_act: t.data.data, | 3671 | prom_act: t.data.data, |
3620 | prom_end_time: prom_end_time, | 3672 | prom_end_time: prom_end_time, |
3621 | prom_start_time: prom_start_time, | 3673 | prom_start_time: prom_start_time, |
3622 | - isshow: 1, | ||
3623 | }); | 3674 | }); |
3624 | 3675 | ||
3625 | ee.get_sto(); | 3676 | ee.get_sto(); |
@@ -3893,18 +3944,18 @@ Page({ | @@ -3893,18 +3944,18 @@ Page({ | ||
3893 | 3944 | ||
3894 | // 是否授权登陆 | 3945 | // 是否授权登陆 |
3895 | var user_info = getApp().globalData.userInfo; | 3946 | var user_info = getApp().globalData.userInfo; |
3896 | - if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { | ||
3897 | - wx.navigateTo({ | ||
3898 | - url: '/packageE/pages/togoin/togoin', | ||
3899 | - }) | ||
3900 | - return false; | ||
3901 | - } | ||
3902 | - | 3947 | + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { |
3948 | + wx.navigateTo({ | ||
3949 | + url: '/packageE/pages/togoin/togoin', | ||
3950 | + }) | ||
3951 | + return false; | ||
3952 | + } | ||
3903 | this.data.g_buy_num = new Map(); | 3953 | this.data.g_buy_num = new Map(); |
3904 | var th = this; | 3954 | var th = this; |
3905 | this.setData({open_ind_store: 5, goodsInputNum: 1});//拼团直接给4 | 3955 | this.setData({open_ind_store: 5, goodsInputNum: 1});//拼团直接给4 |
3906 | 3956 | ||
3907 | - this.setData({openSpecModal_flash_normal: 1}); | 3957 | + this.setData({openSpecModal_flash_normal: 1}); |
3958 | + this.get_sto(1) | ||
3908 | 3959 | ||
3909 | 3960 | ||
3910 | // if (th.data.sku_g_pt) { | 3961 | // if (th.data.sku_g_pt) { |
@@ -3922,7 +3973,7 @@ Page({ | @@ -3922,7 +3973,7 @@ Page({ | ||
3922 | }, | 3973 | }, |
3923 | 3974 | ||
3924 | closeSpecModal_flash_normal: function () { | 3975 | closeSpecModal_flash_normal: function () { |
3925 | - this.setData({openSpecModal_flash_normal: 0}); | 3976 | + this.setData({openSpecModal_flash_normal: 0,is_normal:0}); |
3926 | }, | 3977 | }, |
3927 | 3978 | ||
3928 | 3979 |
packageA/pages/goodsInfo/goodsInfo.wxml
@@ -172,8 +172,9 @@ | @@ -172,8 +172,9 @@ | ||
172 | <view class="no_store" wx:if="{{only_pk && !only_pk.length}}">(未找到门店)</view> | 172 | <view class="no_store" wx:if="{{only_pk && !only_pk.length}}">(未找到门店)</view> |
173 | <block wx:else> | 173 | <block wx:else> |
174 | <view class="no_store" wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">(未找到门店)</view> | 174 | <view class="no_store" wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">(未找到门店)</view> |
175 | + <text wx:elif="{{def_pick_store.is_no_dis_act && !is_normal}}" class="no_store">(该店不可售)</text> | ||
175 | <block wx:else> | 176 | <block wx:else> |
176 | - <view class="no_store" wx:if="{{def_pick_store && def_pick_store.is_no_dis}}">(配送不匹配)</view> | 177 | + <view class="no_store" wx:if="{{def_pick_store && def_pick_store.is_no_dis}}">(该店不可售)</view> |
177 | </block> | 178 | </block> |
178 | </block> | 179 | </block> |
179 | 180 | ||
@@ -665,8 +666,8 @@ | @@ -665,8 +666,8 @@ | ||
665 | 666 | ||
666 | <!-- 选择门店模块 --> | 667 | <!-- 选择门店模块 --> |
667 | <view class="flex-space-between address ai_end xc-width" style="padding-top: 30rpx;"> | 668 | <view class="flex-space-between address ai_end xc-width" style="padding-top: 30rpx;"> |
668 | - <view class="flex ai_end" wx:if="{{def_pick_store && def_pick_store.pickup_name}}"> | ||
669 | - <text class="fs30 xc-black3 shop_name">{{def_pick_store.pickup_name}}</text> | 669 | + <view class="flex" wx:if="{{def_pick_store && def_pick_store.pickup_name}}"> |
670 | + <text class="fs30 xc-black3 shop_name" style="width:360rpx">{{def_pick_store.pickup_name}}</text> | ||
670 | <view class="distance fs24 xc-ash" wx:if="{{def_pick_store.distance!=null}}"> | 671 | <view class="distance fs24 xc-ash" wx:if="{{def_pick_store.distance!=null}}"> |
671 | 距离:{{def_pick_store.distance>1000?filters.toFix(def_pick_store.distance/1000,2)+"km":filters.toFix(def_pick_store.distance,0)+"m"}}</view> | 672 | 距离:{{def_pick_store.distance>1000?filters.toFix(def_pick_store.distance/1000,2)+"km":filters.toFix(def_pick_store.distance,0)+"m"}}</view> |
672 | </view> | 673 | </view> |
@@ -685,7 +686,8 @@ | @@ -685,7 +686,8 @@ | ||
685 | <block wx:else> | 686 | <block wx:else> |
686 | <view wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">(库存不足)</view> | 687 | <view wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">(库存不足)</view> |
687 | <block wx:else> | 688 | <block wx:else> |
688 | - <view class="no_store" wx:if="{{def_pick_store.is_no_dis}}">(配送不匹配)</view> | 689 | + <view class="no_store" wx:if="{{def_pick_store.is_no_dis}}">(该店不可售)</view> |
690 | + <view class="no_store" wx:elif="{{def_pick_store.is_no_dis_act}}">(该店不可售)</view> | ||
689 | <view wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && !filters.is_virtual_gd(sele_g.is_virtual) && sales_rules==2 && prom_type==0}}">(库存不足)</view> | 691 | <view wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && !filters.is_virtual_gd(sele_g.is_virtual) && sales_rules==2 && prom_type==0}}">(库存不足)</view> |
690 | </block> | 692 | </block> |
691 | </block> | 693 | </block> |
@@ -708,7 +710,8 @@ | @@ -708,7 +710,8 @@ | ||
708 | 710 | ||
709 | 711 | ||
710 | <view class="spec-cart-btns"> | 712 | <view class="spec-cart-btns"> |
711 | - <view wx:if="{{def_pick_store && def_pick_store.is_no_dis}}" class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">配送不匹配</view> | 713 | + <view wx:if="{{def_pick_store && def_pick_store.is_no_dis}}" class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">该店不可售</view> |
714 | + <view wx:elif="{{def_pick_store && def_pick_store.is_no_dis_act}}" class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">该店不可售</view> | ||
712 | <block wx:else> | 715 | <block wx:else> |
713 | 716 | ||
714 | <!-- 根本就找不到门店 --> | 717 | <!-- 根本就找不到门店 --> |
@@ -831,9 +834,10 @@ | @@ -831,9 +834,10 @@ | ||
831 | <view class="flex-vertical-between butttem5"> | 834 | <view class="flex-vertical-between butttem5"> |
832 | <view class="flex xc-ash"> | 835 | <view class="flex xc-ash"> |
833 | <view class="fs30 xc-black3 address_name">{{item.pickup_name}} | 836 | <view class="fs30 xc-black3 address_name">{{item.pickup_name}} |
834 | - <block wx:if="{{tool.is_no_dis(sele_g.storageId,item.keyid)}}"> | ||
835 | - <text class="no_store">(配送不匹配)</text> | 837 | + <block wx:if="{{tool.is_no_dis(data.storageId,item.keyid)}}"> |
838 | + <text class="no_store">(该店不可售)</text> | ||
836 | </block> | 839 | </block> |
840 | + <text wx:elif="{{item.is_no_dis_act && !is_normal}}" class="no_store">(该店不可售1)</text> | ||
837 | 841 | ||
838 | </view> | 842 | </view> |
839 | </view> | 843 | </view> |
@@ -862,9 +866,10 @@ | @@ -862,9 +866,10 @@ | ||
862 | <view class="flex-vertical-between "> | 866 | <view class="flex-vertical-between "> |
863 | <view class="flex xc-ash"> | 867 | <view class="flex xc-ash"> |
864 | <view class="fs30 xc-black3 address_name">{{item.pickup_name}} | 868 | <view class="fs30 xc-black3 address_name">{{item.pickup_name}} |
865 | - <block wx:if="{{tool.is_no_dis(sele_g.storageId,item.keyid)}}"> | ||
866 | - <text class="no_store">(配送不匹配)</text> | 869 | + <block wx:if="{{tool.is_no_dis(data.storageId,item.keyid)}}"> |
870 | + <text class="no_store">(该店不可售)</text> | ||
867 | </block> | 871 | </block> |
872 | + <text wx:elif="{{item.is_no_dis_act && !is_normal}}" class="no_store">(该店不可售)</text> | ||
868 | </view> | 873 | </view> |
869 | </view> | 874 | </view> |
870 | <view> | 875 | <view> |
@@ -894,9 +899,10 @@ | @@ -894,9 +899,10 @@ | ||
894 | <view class="flex-vertical-between "> | 899 | <view class="flex-vertical-between "> |
895 | <view class="flex xc-ash"> | 900 | <view class="flex xc-ash"> |
896 | <view class="fs28 xc-black3 address_name">{{item.pickup_name}} | 901 | <view class="fs28 xc-black3 address_name">{{item.pickup_name}} |
897 | - <block wx:if="{{tool.is_no_dis(sele_g.storageId,item.keyid)}}"> | ||
898 | - <text class="no_store">(配送不匹配)</text> | 902 | + <block wx:if="{{tool.is_no_dis(data.storageId,item.keyid)}}"> |
903 | + <text class="no_store">(该店不可售)</text> | ||
899 | </block> | 904 | </block> |
905 | + <text wx:elif="{{item.is_no_dis_act && !is_normal}}" class="no_store">(该店不可售)</text> | ||
900 | </view> | 906 | </view> |
901 | </view> | 907 | </view> |
902 | <view> | 908 | <view> |
packageA/pages/goodsInfo/goodsInfo.wxss
@@ -2417,9 +2417,7 @@ height: 90rpx; | @@ -2417,9 +2417,7 @@ height: 90rpx; | ||
2417 | margin: auto; */ | 2417 | margin: auto; */ |
2418 | 2418 | ||
2419 | } | 2419 | } |
2420 | -.shop_name{ | ||
2421 | 2420 | ||
2422 | -} | ||
2423 | .stores-img{ | 2421 | .stores-img{ |
2424 | width: 28rpx; | 2422 | width: 28rpx; |
2425 | height: 28rpx; | 2423 | height: 28rpx; |
@@ -2427,6 +2425,7 @@ margin: auto; */ | @@ -2427,6 +2425,7 @@ margin: auto; */ | ||
2427 | } | 2425 | } |
2428 | .shop_name{ | 2426 | .shop_name{ |
2429 | margin-right: 10rpx; | 2427 | margin-right: 10rpx; |
2428 | + max-width: 375rpx; | ||
2430 | } | 2429 | } |
2431 | .address{ | 2430 | .address{ |
2432 | /* width: 100%; | 2431 | /* width: 100%; |
@@ -2543,6 +2542,7 @@ margin-left: 17rpx; | @@ -2543,6 +2542,7 @@ margin-left: 17rpx; | ||
2543 | } | 2542 | } |
2544 | .address_name{ | 2543 | .address_name{ |
2545 | margin-right: 10rpx; | 2544 | margin-right: 10rpx; |
2545 | + max-width: 390rpx; | ||
2546 | 2546 | ||
2547 | } | 2547 | } |
2548 | .address-val{ | 2548 | .address-val{ |
packageA/pages/profile/profile.js
@@ -600,6 +600,10 @@ Page({ | @@ -600,6 +600,10 @@ Page({ | ||
600 | let url3 = '/api/weshop/users/getErpvipidPickup'; | 600 | let url3 = '/api/weshop/users/getErpvipidPickup'; |
601 | url1 += r.stoid; | 601 | url1 += r.stoid; |
602 | 602 | ||
603 | + if(t.is_reg){ | ||
604 | + this.data.is_reg=1; | ||
605 | + } | ||
606 | + | ||
603 | var uu = getApp().globalData.zc_dd; | 607 | var uu = getApp().globalData.zc_dd; |
604 | if (uu) { | 608 | if (uu) { |
605 | this.setData({head_pic: uu.head_pic, nickname: uu.nickname}) | 609 | this.setData({head_pic: uu.head_pic, nickname: uu.nickname}) |
@@ -1006,15 +1010,17 @@ Page({ | @@ -1006,15 +1010,17 @@ Page({ | ||
1006 | 1010 | ||
1007 | if (this.data.is_lable_set) { | 1011 | if (this.data.is_lable_set) { |
1008 | getApp().globalData.zc_dd = post_data; | 1012 | getApp().globalData.zc_dd = post_data; |
1013 | + var g_url="/packageE/pages/user/labels/labels?pageType=1"; | ||
1014 | + if(th.data.is_reg){ | ||
1015 | + g_url+="&is_reg=1"; | ||
1016 | + } | ||
1009 | wx.redirectTo({ | 1017 | wx.redirectTo({ |
1010 | - url: "/packageE/pages/user/labels/labels?pageType=1" | 1018 | + url:g_url |
1011 | }) | 1019 | }) |
1012 | }else{ | 1020 | }else{ |
1013 | this.zu_ce(post_data); | 1021 | this.zu_ce(post_data); |
1014 | } | 1022 | } |
1015 | 1023 | ||
1016 | - | ||
1017 | - | ||
1018 | }, | 1024 | }, |
1019 | 1025 | ||
1020 | 1026 | ||
@@ -1040,7 +1046,11 @@ Page({ | @@ -1040,7 +1046,11 @@ Page({ | ||
1040 | getApp().globalData.login_back = 1; | 1046 | getApp().globalData.login_back = 1; |
1041 | wx.setStorageSync("userinfo", e.data.data); | 1047 | wx.setStorageSync("userinfo", e.data.data); |
1042 | wx.setStorageSync("isAuth", !0), app.globalData.userInfo = e.data.data, app.globalData.userInfo.head_pic = s.getFullUrl(a.globalData.userInfo.head_pic); | 1048 | wx.setStorageSync("isAuth", !0), app.globalData.userInfo = e.data.data, app.globalData.userInfo.head_pic = s.getFullUrl(a.globalData.userInfo.head_pic); |
1043 | - wx.navigateBack({delta: 1}) | 1049 | + //wx.navigateBack({delta: 1}) |
1050 | + //-- 看情况,是跳转等级卡,还是跳转到新人有礼 -- | ||
1051 | + getApp().go_to_page(th.data.is_reg,function (){ | ||
1052 | + wx.navigateBack({ delta: 1 }) | ||
1053 | + }) | ||
1044 | 1054 | ||
1045 | }, | 1055 | }, |
1046 | failStatus: function (t) { | 1056 | failStatus: function (t) { |
@@ -1404,9 +1414,15 @@ Page({ | @@ -1404,9 +1414,15 @@ Page({ | ||
1404 | 1414 | ||
1405 | if (this.data.is_lable_set) { | 1415 | if (this.data.is_lable_set) { |
1406 | getApp().globalData.zc_dd = post_data; | 1416 | getApp().globalData.zc_dd = post_data; |
1407 | - wx.redirectTo({ | ||
1408 | - url: "/packageE/pages/user/labels/labels?pageType=1" | ||
1409 | - }) | 1417 | + |
1418 | + var g_url="/packageE/pages/user/labels/labels?pageType=1"; | ||
1419 | + if(th.data.is_reg){ | ||
1420 | + g_url+="&is_reg=1"; | ||
1421 | + } | ||
1422 | + | ||
1423 | + wx.redirectTo({ | ||
1424 | + url: g_url | ||
1425 | + }) | ||
1410 | }else{ | 1426 | }else{ |
1411 | this.zu_ce(post_data); | 1427 | this.zu_ce(post_data); |
1412 | } | 1428 | } |
packageA/pages/quan_pro/quan_pro.js
@@ -2,7 +2,7 @@ var t = require("../../../utils/util.js"), ut = t, | @@ -2,7 +2,7 @@ var t = require("../../../utils/util.js"), ut = t, | ||
2 | e = require("../../../utils/common.js"), | 2 | e = require("../../../utils/common.js"), |
3 | oo = getApp().globalData, | 3 | oo = getApp().globalData, |
4 | os = getApp().globalData.setting; | 4 | os = getApp().globalData.setting; |
5 | - var utils = require('../../../utils/util.js'),ut=utils; | 5 | + |
6 | 6 | ||
7 | Page({ | 7 | Page({ |
8 | data: { | 8 | data: { |
@@ -44,23 +44,66 @@ Page({ | @@ -44,23 +44,66 @@ Page({ | ||
44 | }, | 44 | }, |
45 | 45 | ||
46 | //---展示,显示券的信息--- | 46 | //---展示,显示券的信息--- |
47 | - onShow: function() { | 47 | + onShow:async function() { |
48 | 48 | ||
49 | //检查能不能分享 | 49 | //检查能不能分享 |
50 | getApp().check_can_share(); | 50 | getApp().check_can_share(); |
51 | - | ||
52 | var th=this; | 51 | var th=this; |
53 | - var user_id=getApp().globalData.user_id; | ||
54 | - getApp().request.promiseGet("/api/weshop/prom/coupon/pageCouponList", { | ||
55 | - data:{store_id:os.stoid,type:1,id:th.data.id,user_id:user_id} | ||
56 | - }).then(res => { | ||
57 | - th.setData({is_get:1}); | ||
58 | - if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length){ | ||
59 | - th.setData({q_data:res.data.data.pageData[0]}); | ||
60 | - } | ||
61 | - }); | ||
62 | - | ||
63 | th.setData({getcurday:ut.gettimestamp()}); | 52 | th.setData({getcurday:ut.gettimestamp()}); |
53 | + | ||
54 | + var rs=await getApp().request.promiseGet("/api/weshop/prom/coupon/get/"+th.data.id, {}) | ||
55 | + if(!rs){ | ||
56 | + th.setData({is_get:1}); | ||
57 | + return false; | ||
58 | + } | ||
59 | + if(rs.data.code!=0){ | ||
60 | + th.setData({is_get:1}); | ||
61 | + return false; | ||
62 | + } | ||
63 | + var r_data=rs.data.data; | ||
64 | + //如果只限定链接的时候,要取消分享按钮 | ||
65 | + if(r_data.is_share){ | ||
66 | + wx.hideShareMenu(); | ||
67 | + } | ||
68 | + | ||
69 | + if(r_data.store_id!=os.stoid){ | ||
70 | + th.setData({is_get:1}); | ||
71 | + return false; | ||
72 | + } | ||
73 | + if(r_data.type!=1){ | ||
74 | + th.setData({is_get:2}); | ||
75 | + return false; | ||
76 | + } | ||
77 | + | ||
78 | + var now=ut.gettimestamp(); | ||
79 | + | ||
80 | + if(r_data.send_start_time>now){ | ||
81 | + th.setData({is_get:3}); | ||
82 | + return false; | ||
83 | + } | ||
84 | + | ||
85 | + if(r_data.send_end_time<now){ | ||
86 | + th.setData({is_get:4}); | ||
87 | + return false; | ||
88 | + } | ||
89 | + | ||
90 | + th.setData({is_get:1}); | ||
91 | + th.setData({ q_data:r_data }); | ||
92 | + | ||
93 | + | ||
94 | + | ||
95 | + | ||
96 | + // var user_id=getApp().globalData.user_id; | ||
97 | + // await getApp().request.promiseGet("/api/weshop/prom/coupon/pageCouponList", { | ||
98 | + // data:{store_id:os.stoid,type:1,id:th.data.id,user_id:user_id} | ||
99 | + // }).then(res => { | ||
100 | + // th.setData({is_get:1}); | ||
101 | + // if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length){ | ||
102 | + // th.setData({q_data:res.data.data.pageData[0]}); | ||
103 | + // } | ||
104 | + // }); | ||
105 | + | ||
106 | + | ||
64 | }, | 107 | }, |
65 | 108 | ||
66 | onHide: function() { | 109 | onHide: function() { |
packageA/pages/quan_pro/quan_pro.wxml
@@ -11,7 +11,10 @@ | @@ -11,7 +11,10 @@ | ||
11 | <view> | 11 | <view> |
12 | <image style="width: 70rpx; height: 70rpx; vertical-align: middle; margin-right: 20rpx" src="{{iurl}}/miniapp/images/coupon_img/coupon_logo.png"></image> | 12 | <image style="width: 70rpx; height: 70rpx; vertical-align: middle; margin-right: 20rpx" src="{{iurl}}/miniapp/images/coupon_img/coupon_logo.png"></image> |
13 | <text wx:if="{{q_data}}">{{q_data.name}}</text> | 13 | <text wx:if="{{q_data}}">{{q_data.name}}</text> |
14 | - <text wx:elif="{{is_get}}" class="fs28">不存在此微券或数量已领取完</text> | 14 | + <text wx:elif="{{is_get==1}}" class="fs28">不存在此微券或数量已领取完</text> |
15 | + <text wx:elif="{{is_get==2}}" class="fs28">该优惠券不是免费发放类型</text> | ||
16 | + <text wx:elif="{{is_get==3}}" class="fs28">活动未开始暂时无法领取优惠券</text> | ||
17 | + <text wx:elif="{{is_get==4}}" class="fs28">优惠券已过期</text> | ||
15 | </view> | 18 | </view> |
16 | <view class="fs30 flex" wx:if="{{q_data}}" style="height: 100rpx;justify-content: space-between;"> | 19 | <view class="fs30 flex" wx:if="{{q_data}}" style="height: 100rpx;justify-content: space-between;"> |
17 | <view class="flex ai-center"> | 20 | <view class="flex ai-center"> |
@@ -45,7 +48,10 @@ | @@ -45,7 +48,10 @@ | ||
45 | </block> | 48 | </block> |
46 | 49 | ||
47 | <view wx:elif="{{is_get}}" class="fs28" style="text-align: center;color: #999;position: absolute;bottom: 20rpx;"> | 50 | <view wx:elif="{{is_get}}" class="fs28" style="text-align: center;color: #999;position: absolute;bottom: 20rpx;"> |
48 | - 不存在此微券或数量已领取完 | 51 | + <text wx:if="{{is_get==1}}">不存在此微券或数量已领取完</text> |
52 | + <text wx:if="{{is_get==2}}">该优惠券不是免费发放类型</text> | ||
53 | + <text wx:if="{{is_get==3}}">活动未开始暂时无法领取优惠券</text> | ||
54 | + <text wx:if="{{is_get==4}}">优惠券已过期</text> | ||
49 | </view> | 55 | </view> |
50 | 56 | ||
51 | </view> | 57 | </view> |
packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js
@@ -287,6 +287,8 @@ Page({ | @@ -287,6 +287,8 @@ Page({ | ||
287 | is_get_guide:0, | 287 | is_get_guide:0, |
288 | keyword:'', //门店搜索 | 288 | keyword:'', //门店搜索 |
289 | sec_i:-1,//选中分类门店 下标 | 289 | sec_i:-1,//选中分类门店 下标 |
290 | + | ||
291 | + adding:0 //避免重复点击 | ||
290 | }, | 292 | }, |
291 | 293 | ||
292 | //------初始化加载---------- | 294 | //------初始化加载---------- |
@@ -896,6 +898,9 @@ Page({ | @@ -896,6 +898,9 @@ Page({ | ||
896 | //---展示--- | 898 | //---展示--- |
897 | onShow: async function () { | 899 | onShow: async function () { |
898 | 900 | ||
901 | + //添加购物车的控制要清理0 | ||
902 | + this.data.adding=0; | ||
903 | + | ||
899 | getApp().check_can_share(this); | 904 | getApp().check_can_share(this); |
900 | // console.log('onshow'); | 905 | // console.log('onshow'); |
901 | var goods_list = null, th = this, that = this; | 906 | var goods_list = null, th = this, that = this; |
@@ -1435,7 +1440,6 @@ Page({ | @@ -1435,7 +1440,6 @@ Page({ | ||
1435 | open_ind_store: ind | 1440 | open_ind_store: ind |
1436 | }); | 1441 | }); |
1437 | 1442 | ||
1438 | - | ||
1439 | th.add_cart_func(t); | 1443 | th.add_cart_func(t); |
1440 | }, | 1444 | }, |
1441 | 1445 | ||
@@ -4687,6 +4691,14 @@ Page({ | @@ -4687,6 +4691,14 @@ Page({ | ||
4687 | s.my_warnning("还未登录!", 0, this); | 4691 | s.my_warnning("还未登录!", 0, this); |
4688 | return; | 4692 | return; |
4689 | } | 4693 | } |
4694 | + | ||
4695 | + if(this.data.adding) return false; | ||
4696 | + this.data.adding=1; | ||
4697 | + | ||
4698 | + wx.showLoading({ | ||
4699 | + mask:true | ||
4700 | + }); | ||
4701 | + | ||
4690 | var e = this, | 4702 | var e = this, |
4691 | th = e, | 4703 | th = e, |
4692 | o = this.data.sele_g; | 4704 | o = this.data.sele_g; |
@@ -4698,6 +4710,8 @@ Page({ | @@ -4698,6 +4710,8 @@ Page({ | ||
4698 | //---判断商品是否超出限购--- | 4710 | //---判断商品是否超出限购--- |
4699 | if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) { | 4711 | if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) { |
4700 | if (th.data.goodsInputNum + th.data.g_buy_num.get(th.data.sele_g.goods_id) > th.data.sele_g.viplimited) { | 4712 | if (th.data.goodsInputNum + th.data.g_buy_num.get(th.data.sele_g.goods_id) > th.data.sele_g.viplimited) { |
4713 | + wx.hideLoading(); | ||
4714 | + th.data.adding=0; | ||
4701 | wx.showModal({ | 4715 | wx.showModal({ |
4702 | title: '提示', | 4716 | title: '提示', |
4703 | content: '超出商品限购' | 4717 | content: '超出商品限购' |
@@ -4718,7 +4732,11 @@ Page({ | @@ -4718,7 +4732,11 @@ Page({ | ||
4718 | sto_sele_name: "" | 4732 | sto_sele_name: "" |
4719 | }); | 4733 | }); |
4720 | 4734 | ||
4721 | - if (th.data.sto_sele_name == "") return s.my_warnning("请选择门店", 0, th); | 4735 | + if (th.data.sto_sele_name == ""){ |
4736 | + wx.hideLoading(); | ||
4737 | + th.data.adding=0; | ||
4738 | + return s.my_warnning("请选择门店", 0, th); | ||
4739 | + } | ||
4722 | 4740 | ||
4723 | //--------------此时操作的数据------------ | 4741 | //--------------此时操作的数据------------ |
4724 | var newd = { | 4742 | var newd = { |
@@ -4789,8 +4807,9 @@ Page({ | @@ -4789,8 +4807,9 @@ Page({ | ||
4789 | 4807 | ||
4790 | th.check_CanOutQty(th.data.sele_g, pick, function (CanOutQty) { | 4808 | th.check_CanOutQty(th.data.sele_g, pick, function (CanOutQty) { |
4791 | if (CanOutQty) { | 4809 | if (CanOutQty) { |
4792 | - | ||
4793 | if (CanOutQty < e.data.goodsInputNum) { | 4810 | if (CanOutQty < e.data.goodsInputNum) { |
4811 | + wx.hideLoading(); | ||
4812 | + th.data.adding=0; | ||
4794 | wx.showToast({ | 4813 | wx.showToast({ |
4795 | title: '库存不足!', | 4814 | title: '库存不足!', |
4796 | icon: 'none', | 4815 | icon: 'none', |
@@ -4800,6 +4819,8 @@ Page({ | @@ -4800,6 +4819,8 @@ Page({ | ||
4800 | 4819 | ||
4801 | th.by_next_func(newd); | 4820 | th.by_next_func(newd); |
4802 | } else { | 4821 | } else { |
4822 | + wx.hideLoading(); | ||
4823 | + th.data.adding=0; | ||
4803 | wx.showToast({ | 4824 | wx.showToast({ |
4804 | title: '库存不足!', | 4825 | title: '库存不足!', |
4805 | icon: 'none', | 4826 | icon: 'none', |
@@ -4810,6 +4831,8 @@ Page({ | @@ -4810,6 +4831,8 @@ Page({ | ||
4810 | 4831 | ||
4811 | } else { | 4832 | } else { |
4812 | if (o.store_count <= 0) { | 4833 | if (o.store_count <= 0) { |
4834 | + wx.hideLoading(); | ||
4835 | + th.data.adding=0; | ||
4813 | wx.showToast({ | 4836 | wx.showToast({ |
4814 | title: '库存已为空!', | 4837 | title: '库存已为空!', |
4815 | icon: 'none', | 4838 | icon: 'none', |
@@ -4819,6 +4842,8 @@ Page({ | @@ -4819,6 +4842,8 @@ Page({ | ||
4819 | } | 4842 | } |
4820 | 4843 | ||
4821 | if (o.store_count < e.data.goodsInputNum) { | 4844 | if (o.store_count < e.data.goodsInputNum) { |
4845 | + wx.hideLoading(); | ||
4846 | + th.data.adding=0; | ||
4822 | wx.showToast({ | 4847 | wx.showToast({ |
4823 | title: '库存不足!', | 4848 | title: '库存不足!', |
4824 | icon: 'none', | 4849 | icon: 'none', |
@@ -6870,10 +6895,11 @@ Page({ | @@ -6870,10 +6895,11 @@ Page({ | ||
6870 | if (getApp().globalData.groupchat_id) { | 6895 | if (getApp().globalData.groupchat_id) { |
6871 | pagePath+="&groupchat_id="+getApp().globalData.groupchat_id | 6896 | pagePath+="&groupchat_id="+getApp().globalData.groupchat_id |
6872 | } | 6897 | } |
6873 | - | 6898 | + let imgPath = this.data.iurl + this.data.luckGoInfo.original_img; |
6874 | return { | 6899 | return { |
6875 | title: this.data.data.goods_name + '-' + store_name, | 6900 | title: this.data.data.goods_name + '-' + store_name, |
6876 | - imageUrl: this.data.gallery[0].image_url, | 6901 | + // imageUrl: this.data.gallery[0].image_url, |
6902 | + imageUrl: imgPath, | ||
6877 | query: pagePath | 6903 | query: pagePath |
6878 | } | 6904 | } |
6879 | }, | 6905 | }, |
packageC/pages/presell/goodsInfo/goodsInfo.js
@@ -4492,11 +4492,12 @@ Page({ | @@ -4492,11 +4492,12 @@ Page({ | ||
4492 | if (getApp().globalData.groupchat_id) { | 4492 | if (getApp().globalData.groupchat_id) { |
4493 | url+="&groupchat_id="+getApp().globalData.groupchat_id | 4493 | url+="&groupchat_id="+getApp().globalData.groupchat_id |
4494 | } | 4494 | } |
4495 | - | 4495 | + let img = this.data.data.original_img; |
4496 | return { | 4496 | return { |
4497 | title: this.data.data.goods_name + '-' + store_name, | 4497 | title: this.data.data.goods_name + '-' + store_name, |
4498 | query: 'first_leader='+user_id+url, | 4498 | query: 'first_leader='+user_id+url, |
4499 | - imageUrl: this.data.gallery[0].image_url, | 4499 | + // imageUrl: this.data.gallery[0].image_url, |
4500 | + imageUrl: img | ||
4500 | } | 4501 | } |
4501 | }, | 4502 | }, |
4502 | 4503 |
packageE/pages/cart/cart2/cart2.js
@@ -4876,6 +4876,9 @@ Page({ | @@ -4876,6 +4876,9 @@ Page({ | ||
4876 | var zh_map_count={}; | 4876 | var zh_map_count={}; |
4877 | var check_map = {}; | 4877 | var check_map = {}; |
4878 | let groupchat_ids=[] | 4878 | let groupchat_ids=[] |
4879 | + | ||
4880 | + | ||
4881 | + | ||
4879 | //-------------让商品添加到商品列表-------------------- | 4882 | //-------------让商品添加到商品列表-------------------- |
4880 | for (var k = 0; k < t_item.goods.length; k++) { | 4883 | for (var k = 0; k < t_item.goods.length; k++) { |
4881 | 4884 | ||
@@ -4893,7 +4896,12 @@ Page({ | @@ -4893,7 +4896,12 @@ Page({ | ||
4893 | 'store_id': oo.stoid, | 4896 | 'store_id': oo.stoid, |
4894 | }; | 4897 | }; |
4895 | 4898 | ||
4896 | - | 4899 | + if (g_item.is_pd_normal) { |
4900 | + goods.is_pd_normal = 1; | ||
4901 | + } | ||
4902 | + if (g_item.is_integral_normal) { | ||
4903 | + goods.is_integral_normal = 1; | ||
4904 | + } | ||
4897 | 4905 | ||
4898 | if (getApp().globalData.skinface_id) { | 4906 | if (getApp().globalData.skinface_id) { |
4899 | goods.skinface_id = getApp().globalData.skinface_id; | 4907 | goods.skinface_id = getApp().globalData.skinface_id; |
@@ -4942,11 +4950,15 @@ Page({ | @@ -4942,11 +4950,15 @@ Page({ | ||
4942 | } | 4950 | } |
4943 | break; | 4951 | break; |
4944 | case 5: | 4952 | case 5: |
4945 | - goods.prom_type = 5; | ||
4946 | - goods.prom_id = g_item.prom_id; | ||
4947 | - if (g_item.is_collocation) { | ||
4948 | - goods.is_collocation = g_item.is_collocation; | 4953 | + //看一下有没有搭配商品 |
4954 | + if(th.has_collocation(t_item.goods,g_item.prom_id)){ | ||
4955 | + goods.prom_type = 5; | ||
4956 | + goods.prom_id = g_item.prom_id; | ||
4957 | + if (g_item.is_collocation) { | ||
4958 | + goods.is_collocation = g_item.is_collocation; | ||
4959 | + } | ||
4949 | } | 4960 | } |
4961 | + | ||
4950 | break | 4962 | break |
4951 | case 7: | 4963 | case 7: |
4952 | goods.prom_type = 7; | 4964 | goods.prom_type = 7; |
@@ -5367,6 +5379,14 @@ Page({ | @@ -5367,6 +5379,14 @@ Page({ | ||
5367 | }) | 5379 | }) |
5368 | 5380 | ||
5369 | }, | 5381 | }, |
5382 | + //看一下有没有选择搭配的商品 | ||
5383 | + has_collocation(goods,prom_id){ | ||
5384 | + var idx=goods.findIndex(function (e){ | ||
5385 | + return e.prom_type==5 && e.prom_id==prom_id && e.is_collocation; | ||
5386 | + }) | ||
5387 | + return idx>0; | ||
5388 | + }, | ||
5389 | + | ||
5370 | //---确认线下门店的数量足不足--- | 5390 | //---确认线下门店的数量足不足--- |
5371 | async check_store_num(goods_id, pick, goods_num, func) { | 5391 | async check_store_num(goods_id, pick, goods_num, func) { |
5372 | var lock = 0, pick_no, plist, erpwareid; | 5392 | var lock = 0, pick_no, plist, erpwareid; |
packageE/pages/qy/contactMe/contactMe.js
@@ -92,7 +92,29 @@ Page({ | @@ -92,7 +92,29 @@ Page({ | ||
92 | this.setData({ | 92 | this.setData({ |
93 | id: f_arr[2] | 93 | id: f_arr[2] |
94 | }) | 94 | }) |
95 | - this.getopenuserid(f_arr[2]) | 95 | + //判断是否有注册,如果没有注册必须先注册 |
96 | + let userinfo = wx.getStorageSync('userinfo'); | ||
97 | + if (!userinfo) { | ||
98 | + wx.setStorageSync('qyzsdg', tt.scene) | ||
99 | + wx.navigateTo({ | ||
100 | + url: '/packageE/pages/togoin/togoin', | ||
101 | + }) | ||
102 | + }else{ | ||
103 | + if (userinfo && userinfo.mobile) { | ||
104 | + wx.removeStorageSync('qyzsdg') | ||
105 | + this.setData({ | ||
106 | + phone:userinfo.mobile | ||
107 | + }) | ||
108 | + this.getopenuserid(f_arr[2]) | ||
109 | + }else{ | ||
110 | + wx.removeStorageSync('userinfo') | ||
111 | + wx.setStorageSync('qyzsdg', tt.scene) | ||
112 | + wx.navigateTo({ | ||
113 | + url: '/packageE/pages/togoin/togoin', | ||
114 | + }) | ||
115 | + } | ||
116 | + } | ||
117 | + | ||
96 | // getApp().globalData.groupchat_id = f_arr[2]; | 118 | // getApp().globalData.groupchat_id = f_arr[2]; |
97 | } | 119 | } |
98 | 120 | ||
@@ -145,7 +167,18 @@ Page({ | @@ -145,7 +167,18 @@ Page({ | ||
145 | // } | 167 | // } |
146 | // }) | 168 | // }) |
147 | }, | 169 | }, |
148 | - | 170 | + onShow:function(){ |
171 | + let userinfo = wx.getStorageSync('userinfo'); | ||
172 | + if (userinfo && userinfo.mobile) { | ||
173 | + this.setData({ | ||
174 | + phone:userinfo.mobile | ||
175 | + }) | ||
176 | + // wx.removeStorageSync('qyzsdg') | ||
177 | + } | ||
178 | + if (this.data.id) { | ||
179 | + this.getopenuserid(this.data.id) | ||
180 | + } | ||
181 | + }, | ||
149 | getopenuserid(id) { | 182 | getopenuserid(id) { |
150 | let url = `/api/weshop/qyWeChat/qywxStaffcode/get/${id}` | 183 | let url = `/api/weshop/qyWeChat/qywxStaffcode/get/${id}` |
151 | getApp().request.promiseGet(url, { data: {} }).then(res => { | 184 | getApp().request.promiseGet(url, { data: {} }).then(res => { |
@@ -158,6 +191,10 @@ Page({ | @@ -158,6 +191,10 @@ Page({ | ||
158 | openuserid, | 191 | openuserid, |
159 | skip_verify | 192 | skip_verify |
160 | }) | 193 | }) |
194 | + if (this.data.phone) { | ||
195 | + | ||
196 | + this.befgetqy() | ||
197 | + } | ||
161 | // if (this.data.phone) { | 198 | // if (this.data.phone) { |
162 | // this.getqy() | 199 | // this.getqy() |
163 | // } | 200 | // } |
packageE/pages/togoin/togoin.js
@@ -20,6 +20,12 @@ Page({ | @@ -20,6 +20,12 @@ Page({ | ||
20 | }) | 20 | }) |
21 | } | 21 | } |
22 | getApp().globalData.isLoad_ad = 1; | 22 | getApp().globalData.isLoad_ad = 1; |
23 | + | ||
24 | + | ||
25 | + if(options.is_reg){ | ||
26 | + this.data.is_reg=1; | ||
27 | + } | ||
28 | + | ||
23 | //--判断是否有接受到邀请人的ID-- | 29 | //--判断是否有接受到邀请人的ID-- |
24 | if (options.first_leader) { | 30 | if (options.first_leader) { |
25 | this.setData({ first_leader: options.first_leader }); | 31 | this.setData({ first_leader: options.first_leader }); |
@@ -277,8 +283,13 @@ Page({ | @@ -277,8 +283,13 @@ Page({ | ||
277 | if (res.data.code == 0) { | 283 | if (res.data.code == 0) { |
278 | dd.mobile = res.data.data; | 284 | dd.mobile = res.data.data; |
279 | getApp().globalData.zc_dd = dd; | 285 | getApp().globalData.zc_dd = dd; |
286 | + | ||
287 | + var g_url="/packageA/pages/profile/profile?is_back=1"; | ||
288 | + if(th.data.is_reg){ | ||
289 | + g_url+="&is_reg=1"; | ||
290 | + } | ||
280 | wx.redirectTo({ | 291 | wx.redirectTo({ |
281 | - url: "/packageA/pages/profile/profile?is_back=1" | 292 | + url:g_url |
282 | }) | 293 | }) |
283 | } | 294 | } |
284 | }) | 295 | }) |
@@ -306,9 +317,13 @@ Page({ | @@ -306,9 +317,13 @@ Page({ | ||
306 | if (res.data.code == 0) { | 317 | if (res.data.code == 0) { |
307 | dd.mobile = res.data.data; | 318 | dd.mobile = res.data.data; |
308 | getApp().globalData.zc_dd = dd; | 319 | getApp().globalData.zc_dd = dd; |
309 | - wx.redirectTo({ | ||
310 | - url: "/packageE/pages/user/labels/labels?pageType=1" | ||
311 | - }) | 320 | + |
321 | + var g_url="/packageE/pages/user/labels/labels?pageType=1"; | ||
322 | + if(th.data.is_reg){ | ||
323 | + g_url+="&is_reg=1"; | ||
324 | + } | ||
325 | + | ||
326 | + wx.redirectTo({ url: g_url }) | ||
312 | } | 327 | } |
313 | }) | 328 | }) |
314 | } else { | 329 | } else { |
@@ -357,7 +372,12 @@ Page({ | @@ -357,7 +372,12 @@ Page({ | ||
357 | } | 372 | } |
358 | }) | 373 | }) |
359 | 374 | ||
360 | - wx.navigateBack({ delta: 1 }) | 375 | + //-- 看情况,是跳转等级卡,还是跳转到新人有礼 -- |
376 | + getApp().go_to_page(th.data.is_reg,function (){ | ||
377 | + wx.navigateBack({ delta: 1 }) | ||
378 | + }) | ||
379 | + | ||
380 | + | ||
361 | 381 | ||
362 | }, | 382 | }, |
363 | failStatus: function (t) { | 383 | failStatus: function (t) { |
packageE/pages/user/labels/labels.js
@@ -111,9 +111,18 @@ Page({ | @@ -111,9 +111,18 @@ Page({ | ||
111 | var pages = getCurrentPages(); | 111 | var pages = getCurrentPages(); |
112 | var prevPage = pages[pages.length - 2]; //上一个页面 | 112 | var prevPage = pages[pages.length - 2]; //上一个页面 |
113 | //直接调用上一个页面的setData()方法,把数据存到上一个页面中去 | 113 | //直接调用上一个页面的setData()方法,把数据存到上一个页面中去 |
114 | - prevPage.setData({ | ||
115 | - is_zy: 1 | ||
116 | - }) | 114 | + try { |
115 | + prevPage.setData({ | ||
116 | + is_zy: 1 | ||
117 | + }) | ||
118 | + } catch (error) { | ||
119 | + | ||
120 | + } | ||
121 | + | ||
122 | + if(options.is_reg){ | ||
123 | + this.data.is_reg=1; | ||
124 | + } | ||
125 | + | ||
117 | th.query_nolabels(); | 126 | th.query_nolabels(); |
118 | th.get_config(); | 127 | th.get_config(); |
119 | }, | 128 | }, |
@@ -273,9 +282,14 @@ Page({ | @@ -273,9 +282,14 @@ Page({ | ||
273 | // check_label: arr | 282 | // check_label: arr |
274 | // }) | 283 | // }) |
275 | // th.goto(); | 284 | // th.goto(); |
276 | - wx.reLaunch({ | ||
277 | - url: '/pages/user/index/index', | 285 | + // wx.reLaunch({ |
286 | + // url: '/pages/user/index/index', | ||
287 | + // }) | ||
288 | + //-- 看情况,是跳转等级卡,还是跳转到新人有礼 -- | ||
289 | + getApp().go_to_page(th.data.is_reg,function (){ | ||
290 | + wx.navigateBack({ delta: 1 }) | ||
278 | }) | 291 | }) |
292 | + | ||
279 | }, 2000); | 293 | }, 2000); |
280 | } else { | 294 | } else { |
281 | getApp().my_warnning("系统繁忙,请稍后再试", 0, th); | 295 | getApp().my_warnning("系统繁忙,请稍后再试", 0, th); |
@@ -286,9 +300,13 @@ Page({ | @@ -286,9 +300,13 @@ Page({ | ||
286 | } | 300 | } |
287 | }) | 301 | }) |
288 | }else{ | 302 | }else{ |
289 | - wx.reLaunch({ | ||
290 | - url: '/pages/user/index/index', | 303 | + getApp().go_to_page(th.data.is_reg,function (){ |
304 | + // wx.navigateBack({ delta: 1 }) | ||
305 | + wx.reLaunch({ | ||
306 | + url: '/pages/user/index/index', | ||
307 | + }) | ||
291 | }) | 308 | }) |
309 | + | ||
292 | } | 310 | } |
293 | 311 | ||
294 | }, | 312 | }, |
packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo.js
@@ -301,6 +301,7 @@ Page({ | @@ -301,6 +301,7 @@ Page({ | ||
301 | arr2[j].giftTitle=arr2[j].act_name | 301 | arr2[j].giftTitle=arr2[j].act_name |
302 | arr2[j].virtualsales=arr2[j].virtualSales | 302 | arr2[j].virtualsales=arr2[j].virtualSales |
303 | arr2[j].lbnum=arr2[j].lbNum | 303 | arr2[j].lbnum=arr2[j].lbNum |
304 | + | ||
304 | } | 305 | } |
305 | if(arr2.length>0){ | 306 | if(arr2.length>0){ |
306 | var monthgiftbag =arr2[0]; | 307 | var monthgiftbag =arr2[0]; |
@@ -320,6 +321,7 @@ Page({ | @@ -320,6 +321,7 @@ Page({ | ||
320 | isStart, | 321 | isStart, |
321 | monthgiftbag: monthgiftbag, | 322 | monthgiftbag: monthgiftbag, |
322 | sele_g: monthgiftbag, | 323 | sele_g: monthgiftbag, |
324 | + default_color:monthgiftbag.bg_color | ||
323 | }) | 325 | }) |
324 | th.init() | 326 | th.init() |
325 | }else{ | 327 | }else{ |
packageF/pages/free_delivery/free_delivery.wxss
@@ -72,7 +72,7 @@ | @@ -72,7 +72,7 @@ | ||
72 | background-size: 100% 100%; | 72 | background-size: 100% 100%; |
73 | position: relative; | 73 | position: relative; |
74 | border: 1rpx solid rgb(194, 194, 194); | 74 | border: 1rpx solid rgb(194, 194, 194); |
75 | - border-radius: 5rpx; | 75 | + border-radius: 15rpx; |
76 | overflow: hidden; | 76 | overflow: hidden; |
77 | text-align: center; | 77 | text-align: center; |
78 | line-height: 80rpx; | 78 | line-height: 80rpx; |
pages/cart/cart/cart.js
@@ -672,14 +672,25 @@ Page({ | @@ -672,14 +672,25 @@ Page({ | ||
672 | }) | 672 | }) |
673 | 673 | ||
674 | //只有一种活动,但是又是秒杀之类是互动,就要失效。不能是普通购买 | 674 | //只有一种活动,但是又是秒杀之类是互动,就要失效。不能是普通购买 |
675 | - if (prom && prom.length == 1 && [1, 2, 4, 6, 8, 9].indexOf(prom.prom_type) > -1 && !prom.is_integral_normal && !prom.is_pd_normal) { | 675 | + if (prom && prom.length == 1 && [1, 2, 4, 6, 8, 9].indexOf(prom[0].prom_type) > -1 && !item.is_integral_normal && !item.is_pd_normal) { |
676 | th.disInvalid(item); | 676 | th.disInvalid(item); |
677 | continue; | 677 | continue; |
678 | } | 678 | } |
679 | + | ||
679 | //只有秒杀和积分购的时候,不能是普通购买 | 680 | //只有秒杀和积分购的时候,不能是普通购买 |
680 | - if (prom && prom.length == 2 && [1, 4].indexOf(prom.prom_type) > -1 && [1, 4].indexOf(prom.prom_type) > -1 && !prom.is_integral_normal && !prom.is_pd_normal) { | ||
681 | - th.disInvalid(item); | ||
682 | - continue; | 681 | + if (prom && prom.length == 2 && !item.is_integral_normal && !item.is_pd_normal) { |
682 | + var idx=prom.findIndex(function (e){ | ||
683 | + return e.prom_type==1; | ||
684 | + }) | ||
685 | + var idx2=prom.findIndex(function (e){ | ||
686 | + return e.prom_type==4; | ||
687 | + }) | ||
688 | + //--如果是有秒杀和积分的时候-- | ||
689 | + if(idx>-1 && idx2>-1){ | ||
690 | + th.disInvalid(item); | ||
691 | + continue; | ||
692 | + } | ||
693 | + | ||
683 | } | 694 | } |
684 | 695 | ||
685 | } | 696 | } |
@@ -724,6 +735,8 @@ Page({ | @@ -724,6 +735,8 @@ Page({ | ||
724 | //商品已经下架 | 735 | //商品已经下架 |
725 | continue; | 736 | continue; |
726 | } | 737 | } |
738 | + //把活动写入 | ||
739 | + item.prom=prom; | ||
727 | 740 | ||
728 | //判断秒杀的限购 | 741 | //判断秒杀的限购 |
729 | if (item.goods_num + promgoodsbuynum > prom.buy_limit && prom.buy_limit > 0) { | 742 | if (item.goods_num + promgoodsbuynum > prom.buy_limit && prom.buy_limit > 0) { |
@@ -984,6 +997,8 @@ Page({ | @@ -984,6 +997,8 @@ Page({ | ||
984 | }, 0, 1); | 997 | }, 0, 1); |
985 | continue; | 998 | continue; |
986 | } | 999 | } |
1000 | + | ||
1001 | + item.prom=prom; | ||
987 | //判断秒杀的限购 | 1002 | //判断秒杀的限购 |
988 | var msNum = 0 | 1003 | var msNum = 0 |
989 | await getApp().request.promiseGet("/api/weshop/rechargeServicelist/getUserBuyGoodsNum", { | 1004 | await getApp().request.promiseGet("/api/weshop/rechargeServicelist/getUserBuyGoodsNum", { |
@@ -3327,6 +3342,18 @@ Page({ | @@ -3327,6 +3342,18 @@ Page({ | ||
3327 | if (res.data.code == 0) gd = res.data.data; | 3342 | if (res.data.code == 0) gd = res.data.data; |
3328 | }) | 3343 | }) |
3329 | 3344 | ||
3345 | + //判断秒杀的指定门店 | ||
3346 | + if(py_type==1 && i_arr[j].prom && i_arr[j].prom.pick_up_lists){ | ||
3347 | + var idx0=i_arr[j].prom.pick_up_lists.findIndex(function (e){ | ||
3348 | + return e.pickup_id==i_arr[j].pick_id; | ||
3349 | + }) | ||
3350 | + if(idx0<0){ | ||
3351 | + getApp().confirmBox(i_arr[j].goods_name + "秒杀活动的门店不可售"); | ||
3352 | + wx.hideLoading(); | ||
3353 | + return false; | ||
3354 | + } | ||
3355 | + } | ||
3356 | + | ||
3330 | if ([0, 3, 5, 7, 10].indexOf(py_type) > -1) { | 3357 | if ([0, 3, 5, 7, 10].indexOf(py_type) > -1) { |
3331 | //如果是指定门店,就要判断 | 3358 | //如果是指定门店,就要判断 |
3332 | if(gd.pick_group_ids){ | 3359 | if(gd.pick_group_ids){ |
@@ -3582,8 +3609,22 @@ Page({ | @@ -3582,8 +3609,22 @@ Page({ | ||
3582 | store_id: oo.stoid | 3609 | store_id: oo.stoid |
3583 | } | 3610 | } |
3584 | }); | 3611 | }); |
3612 | + | ||
3613 | + | ||
3614 | + //判断秒杀的指定门店 | ||
3615 | + if(i_arr[j].prom_type==1 && i_arr[j].prom && i_arr[j].prom.pick_up_lists && i_arr[j].selected){ | ||
3616 | + var idx0=i_arr[j].prom.pick_up_lists.findIndex(function (e){ | ||
3617 | + return e.pickup_id==i_arr[j].pick_id; | ||
3618 | + }) | ||
3619 | + if(idx0<0){ | ||
3620 | + getApp().confirmBox(i_arr[j].service_name + "秒杀活动的门店不可售"); | ||
3621 | + wx.hideLoading(); | ||
3622 | + return false; | ||
3623 | + } | ||
3624 | + } | ||
3585 | } | 3625 | } |
3586 | } | 3626 | } |
3627 | + | ||
3587 | //排除失效服务结算 | 3628 | //排除失效服务结算 |
3588 | this.data.invalidList.map(item => { | 3629 | this.data.invalidList.map(item => { |
3589 | if (item.selected && item.classType == 1) { | 3630 | if (item.selected && item.classType == 1) { |
@@ -3596,6 +3637,8 @@ Page({ | @@ -3596,6 +3637,8 @@ Page({ | ||
3596 | }); | 3637 | }); |
3597 | } | 3638 | } |
3598 | }) | 3639 | }) |
3640 | + | ||
3641 | + | ||
3599 | wx.hideLoading(); | 3642 | wx.hideLoading(); |
3600 | getApp().goto("/packageA/pages/cart2_ser/cart2_ser?is_cart=1"); | 3643 | getApp().goto("/packageA/pages/cart2_ser/cart2_ser?is_cart=1"); |
3601 | } | 3644 | } |
pages/cart/cart_wk/cart_wk.js
pages/cart/cart_wk/cart_wk.wxml
@@ -134,7 +134,7 @@ | @@ -134,7 +134,7 @@ | ||
134 | <text class='zf_left_wz'>支付合计:</text> | 134 | <text class='zf_left_wz'>支付合计:</text> |
135 | <text class='zf_left_red'>¥{{filters.toFix(order.tail_money+exp_price,2)}}</text> | 135 | <text class='zf_left_red'>¥{{filters.toFix(order.tail_money+exp_price,2)}}</text> |
136 | </view> --> | 136 | </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 ,2)}}</text></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> |
138 | <view class="zf_btn {{(submit || !same_ok)?'gray':''}}" bindtap="to_pay">支付尾款</view> | 138 | <view class="zf_btn {{(submit || !same_ok)?'gray':''}}" bindtap="to_pay">支付尾款</view> |
139 | </view> | 139 | </view> |
140 | 140 |
pages/goods/goodsInfo/goodsInfo.js
@@ -274,6 +274,8 @@ Page({ | @@ -274,6 +274,8 @@ Page({ | ||
274 | showFold:true, | 274 | showFold:true, |
275 | new_share_imgurl:'', //普通商品分享图片 | 275 | new_share_imgurl:'', //普通商品分享图片 |
276 | 276 | ||
277 | + adding:0 //加入购物车的避免重复 | ||
278 | + | ||
277 | }, | 279 | }, |
278 | 280 | ||
279 | //------初始化加载---------- | 281 | //------初始化加载---------- |
@@ -919,6 +921,8 @@ Page({ | @@ -919,6 +921,8 @@ Page({ | ||
919 | 921 | ||
920 | //---展示--- | 922 | //---展示--- |
921 | onShow: function () { | 923 | onShow: function () { |
924 | + //添加购物车的控制要清理0 | ||
925 | + this.data.adding=0; | ||
922 | 926 | ||
923 | getApp().check_can_share(this); | 927 | getApp().check_can_share(this); |
924 | 928 | ||
@@ -1389,6 +1393,15 @@ Page({ | @@ -1389,6 +1393,15 @@ Page({ | ||
1389 | return false; | 1393 | return false; |
1390 | } | 1394 | } |
1391 | 1395 | ||
1396 | + if(th.data.adding) return false; | ||
1397 | + th.data.adding=1; | ||
1398 | + | ||
1399 | + wx.showLoading({ | ||
1400 | + mask:true | ||
1401 | + }) | ||
1402 | + | ||
1403 | + | ||
1404 | + | ||
1392 | 1405 | ||
1393 | 1406 | ||
1394 | //如果是秒杀的话,要看redis够不够 | 1407 | //如果是秒杀的话,要看redis够不够 |
@@ -1403,7 +1416,8 @@ Page({ | @@ -1403,7 +1416,8 @@ Page({ | ||
1403 | 1416 | ||
1404 | this.getactLen(function (num) { | 1417 | this.getactLen(function (num) { |
1405 | if (num < th.data.goodsInputNum) { | 1418 | if (num < th.data.goodsInputNum) { |
1406 | - | 1419 | + wx.hideLoading(); |
1420 | + th.data.adding=0; | ||
1407 | // getApp().my_warnning("活动库存不足!", 0, th); | 1421 | // getApp().my_warnning("活动库存不足!", 0, th); |
1408 | wx.showToast({ | 1422 | wx.showToast({ |
1409 | title: '活动库存不足!', | 1423 | title: '活动库存不足!', |
@@ -1583,10 +1597,14 @@ Page({ | @@ -1583,10 +1597,14 @@ Page({ | ||
1583 | add_cart_func: function (t) { | 1597 | add_cart_func: function (t) { |
1584 | var i = getApp().request; | 1598 | var i = getApp().request; |
1585 | if (oo.user_id == null) { | 1599 | if (oo.user_id == null) { |
1600 | + wx.hideLoading(); | ||
1601 | + th.data.adding=0; | ||
1586 | return s.my_warnning("还未登录!", 0, this); | 1602 | return s.my_warnning("还未登录!", 0, this); |
1587 | } | 1603 | } |
1588 | 1604 | ||
1589 | if (!getApp().globalData.userInfo) { | 1605 | if (!getApp().globalData.userInfo) { |
1606 | + wx.hideLoading(); | ||
1607 | + th.data.adding=0; | ||
1590 | return s.my_warnning("还未登录!", 0, this); | 1608 | return s.my_warnning("还未登录!", 0, this); |
1591 | } | 1609 | } |
1592 | 1610 | ||
@@ -1601,6 +1619,8 @@ Page({ | @@ -1601,6 +1619,8 @@ Page({ | ||
1601 | //---判断商品是否超出限购--- | 1619 | //---判断商品是否超出限购--- |
1602 | if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) { | 1620 | if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) { |
1603 | if (th.data.goodsInputNum + th.data.g_buy_num.get(th.data.sele_g.goods_id) > th.data.sele_g.viplimited) { | 1621 | if (th.data.goodsInputNum + th.data.g_buy_num.get(th.data.sele_g.goods_id) > th.data.sele_g.viplimited) { |
1622 | + wx.hideLoading(); | ||
1623 | + th.data.adding=0; | ||
1604 | wx.showToast({ | 1624 | wx.showToast({ |
1605 | title: '超出商品限购', | 1625 | title: '超出商品限购', |
1606 | icon: 'none', | 1626 | icon: 'none', |
@@ -1612,6 +1632,8 @@ Page({ | @@ -1612,6 +1632,8 @@ Page({ | ||
1612 | //---判断商品是否超出活动限购--- | 1632 | //---判断商品是否超出活动限购--- |
1613 | if ((th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0) && !th.data.is_normal) { | 1633 | if ((th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0) && !th.data.is_normal) { |
1614 | if (th.data.goodsInputNum + th.data.prom_buy_num > th.data.prom_buy_limit) { | 1634 | if (th.data.goodsInputNum + th.data.prom_buy_num > th.data.prom_buy_limit) { |
1635 | + wx.hideLoading(); | ||
1636 | + th.data.adding=0; | ||
1615 | wx.showToast({ | 1637 | wx.showToast({ |
1616 | title: '超出商品活动限购', | 1638 | title: '超出商品活动限购', |
1617 | icon: 'none', | 1639 | icon: 'none', |
@@ -1621,12 +1643,20 @@ Page({ | @@ -1621,12 +1643,20 @@ Page({ | ||
1621 | } | 1643 | } |
1622 | } | 1644 | } |
1623 | 1645 | ||
1624 | - if (th.data.goodsInputNum <= 0) return s.my_warnning("商品数量不能为0", 0, th); | 1646 | + if (th.data.goodsInputNum <= 0){ |
1647 | + wx.hideLoading(); | ||
1648 | + th.data.adding=0; | ||
1649 | + return s.my_warnning("商品数量不能为0", 0, th); | ||
1650 | + } | ||
1625 | if (th.data.sto_sele_name == null || th.data.sto_sele_name == undefined) | 1651 | if (th.data.sto_sele_name == null || th.data.sto_sele_name == undefined) |
1626 | th.setData({ | 1652 | th.setData({ |
1627 | sto_sele_name: "" | 1653 | sto_sele_name: "" |
1628 | }); | 1654 | }); |
1629 | - if (th.data.sto_sele_name == "") return s.my_warnning("请选择门店", 0, th); | 1655 | + if (th.data.sto_sele_name == ""){ |
1656 | + wx.hideLoading(); | ||
1657 | + th.data.adding=0; | ||
1658 | + return s.my_warnning("请选择门店", 0, th); | ||
1659 | + } | ||
1630 | 1660 | ||
1631 | //--------------此时操作的数据------------ | 1661 | //--------------此时操作的数据------------ |
1632 | var newd = { | 1662 | var newd = { |
@@ -1703,6 +1733,8 @@ Page({ | @@ -1703,6 +1733,8 @@ Page({ | ||
1703 | th.check_CanOutQty(th.data.sele_g, pick, function (CanOutQty) { | 1733 | th.check_CanOutQty(th.data.sele_g, pick, function (CanOutQty) { |
1704 | if (CanOutQty) { | 1734 | if (CanOutQty) { |
1705 | if (CanOutQty < e.data.goodsInputNum) { | 1735 | if (CanOutQty < e.data.goodsInputNum) { |
1736 | + wx.hideLoading(); | ||
1737 | + th.data.adding=0; | ||
1706 | wx.showToast({ | 1738 | wx.showToast({ |
1707 | title: '库存不足!', | 1739 | title: '库存不足!', |
1708 | icon: 'none', | 1740 | icon: 'none', |
@@ -1712,6 +1744,8 @@ Page({ | @@ -1712,6 +1744,8 @@ Page({ | ||
1712 | 1744 | ||
1713 | th.add_cart_next(e, t, a, o, newd, CanOutQty); | 1745 | th.add_cart_next(e, t, a, o, newd, CanOutQty); |
1714 | } else { | 1746 | } else { |
1747 | + wx.hideLoading(); | ||
1748 | + th.data.adding=0; | ||
1715 | wx.showToast({ | 1749 | wx.showToast({ |
1716 | title: '库存不足!', | 1750 | title: '库存不足!', |
1717 | icon: 'none', | 1751 | icon: 'none', |
@@ -1723,47 +1757,52 @@ Page({ | @@ -1723,47 +1757,52 @@ Page({ | ||
1723 | 1757 | ||
1724 | } else { | 1758 | } else { |
1725 | if (o.store_count <= 0) { | 1759 | if (o.store_count <= 0) { |
1760 | + wx.hideLoading(); | ||
1761 | + th.data.adding=0; | ||
1726 | wx.showToast({ | 1762 | wx.showToast({ |
1727 | title: '库存已为空!', | 1763 | title: '库存已为空!', |
1728 | icon: 'none' | 1764 | icon: 'none' |
1729 | }); | 1765 | }); |
1730 | return false; | 1766 | return false; |
1731 | - }; | 1767 | + } |
1732 | if (o.store_count < e.data.goodsInputNum) { | 1768 | if (o.store_count < e.data.goodsInputNum) { |
1769 | + wx.hideLoading(); | ||
1770 | + th.data.adding=0; | ||
1733 | wx.showToast({ | 1771 | wx.showToast({ |
1734 | title: '库存不足!', | 1772 | title: '库存不足!', |
1735 | icon: 'none', | 1773 | icon: 'none', |
1736 | }); | 1774 | }); |
1737 | return false; | 1775 | return false; |
1738 | // return s.my_warnning("库存不足!", 0, th); | 1776 | // return s.my_warnning("库存不足!", 0, th); |
1739 | - }; | 1777 | + } |
1740 | th.add_cart_next(e, t, a, o, newd); //加入购物车下一步 | 1778 | th.add_cart_next(e, t, a, o, newd); //加入购物车下一步 |
1741 | }; | 1779 | }; |
1742 | - | ||
1743 | return false; | 1780 | return false; |
1744 | } | 1781 | } |
1745 | 1782 | ||
1746 | newd.goods_price = th.data.prom_price; | 1783 | newd.goods_price = th.data.prom_price; |
1747 | newd.member_goods_price = th.data.prom_price, | 1784 | newd.member_goods_price = th.data.prom_price, |
1748 | - newd.prom_type = th.data.prom_type; | 1785 | + newd.prom_type = th.data.prom_type; |
1749 | newd.prom_id = th.data.prom_id; | 1786 | newd.prom_id = th.data.prom_id; |
1750 | 1787 | ||
1751 | if (o.store_count <= 0) { | 1788 | if (o.store_count <= 0) { |
1789 | + wx.hideLoading(); | ||
1790 | + th.data.adding=0; | ||
1752 | wx.showToast({ | 1791 | wx.showToast({ |
1753 | title: '库存已为空!', | 1792 | title: '库存已为空!', |
1754 | icon: 'none', | 1793 | icon: 'none', |
1755 | }); | 1794 | }); |
1756 | return false; | 1795 | return false; |
1757 | - //return s.my_warnning("库存已为空!", 0, th); | ||
1758 | - }; | 1796 | + } |
1759 | if (o.store_count < e.data.goodsInputNum) { | 1797 | if (o.store_count < e.data.goodsInputNum) { |
1798 | + wx.hideLoading(); | ||
1799 | + th.data.adding=0; | ||
1760 | wx.showToast({ | 1800 | wx.showToast({ |
1761 | title: '库存不足!', | 1801 | title: '库存不足!', |
1762 | icon: 'none', | 1802 | icon: 'none', |
1763 | }); | 1803 | }); |
1764 | return false; | 1804 | return false; |
1765 | - }; | ||
1766 | - | 1805 | + } |
1767 | th.add_cart_next(e, t, a, o, newd); //加入购物车下一步 | 1806 | th.add_cart_next(e, t, a, o, newd); //加入购物车下一步 |
1768 | 1807 | ||
1769 | } else if (o.prom_type == 7) { | 1808 | } else if (o.prom_type == 7) { |
@@ -1776,6 +1815,8 @@ Page({ | @@ -1776,6 +1815,8 @@ Page({ | ||
1776 | newd.prom_id = th.data.sele_g.act.id; | 1815 | newd.prom_id = th.data.sele_g.act.id; |
1777 | newd.prom_type = 7; | 1816 | newd.prom_type = 7; |
1778 | if (o.store_count <= 0) { | 1817 | if (o.store_count <= 0) { |
1818 | + wx.hideLoading(); | ||
1819 | + th.data.adding=0; | ||
1779 | wx.showToast({ | 1820 | wx.showToast({ |
1780 | title: '库存已为空!', | 1821 | title: '库存已为空!', |
1781 | icon: 'none', | 1822 | icon: 'none', |
@@ -1783,6 +1824,8 @@ Page({ | @@ -1783,6 +1824,8 @@ Page({ | ||
1783 | return false; | 1824 | return false; |
1784 | }; | 1825 | }; |
1785 | if (o.store_count < e.data.goodsInputNum) { | 1826 | if (o.store_count < e.data.goodsInputNum) { |
1827 | + wx.hideLoading(); | ||
1828 | + th.data.adding=0; | ||
1786 | wx.showToast({ | 1829 | wx.showToast({ |
1787 | title: '库存不足!', | 1830 | title: '库存不足!', |
1788 | icon: 'none', | 1831 | icon: 'none', |
@@ -1801,6 +1844,8 @@ Page({ | @@ -1801,6 +1844,8 @@ Page({ | ||
1801 | if (CanOutQty) { | 1844 | if (CanOutQty) { |
1802 | 1845 | ||
1803 | if (CanOutQty < e.data.goodsInputNum) { | 1846 | if (CanOutQty < e.data.goodsInputNum) { |
1847 | + wx.hideLoading(); | ||
1848 | + th.data.adding=0; | ||
1804 | wx.showToast({ | 1849 | wx.showToast({ |
1805 | title: '库存不足!', | 1850 | title: '库存不足!', |
1806 | icon: 'none', | 1851 | icon: 'none', |
@@ -1810,6 +1855,8 @@ Page({ | @@ -1810,6 +1855,8 @@ Page({ | ||
1810 | 1855 | ||
1811 | th.add_cart_next(e, t, a, o, newd, CanOutQty); | 1856 | th.add_cart_next(e, t, a, o, newd, CanOutQty); |
1812 | } else { | 1857 | } else { |
1858 | + wx.hideLoading(); | ||
1859 | + th.data.adding=0; | ||
1813 | wx.showToast({ | 1860 | wx.showToast({ |
1814 | title: '库存不足!', | 1861 | title: '库存不足!', |
1815 | icon: 'none', | 1862 | icon: 'none', |
@@ -1820,6 +1867,8 @@ Page({ | @@ -1820,6 +1867,8 @@ Page({ | ||
1820 | 1867 | ||
1821 | } else { | 1868 | } else { |
1822 | if (o.store_count <= 0) { | 1869 | if (o.store_count <= 0) { |
1870 | + wx.hideLoading(); | ||
1871 | + th.data.adding=0; | ||
1823 | wx.showToast({ | 1872 | wx.showToast({ |
1824 | title: '库存已为空!', | 1873 | title: '库存已为空!', |
1825 | icon: 'none', | 1874 | icon: 'none', |
@@ -1828,6 +1877,8 @@ Page({ | @@ -1828,6 +1877,8 @@ Page({ | ||
1828 | //return s.my_warnning("库存已为空!", 0, th); | 1877 | //return s.my_warnning("库存已为空!", 0, th); |
1829 | }; | 1878 | }; |
1830 | if (o.store_count < e.data.goodsInputNum) { | 1879 | if (o.store_count < e.data.goodsInputNum) { |
1880 | + wx.hideLoading(); | ||
1881 | + th.data.adding=0; | ||
1831 | wx.showToast({ | 1882 | wx.showToast({ |
1832 | title: '库存不足!', | 1883 | title: '库存不足!', |
1833 | icon: 'none', | 1884 | icon: 'none', |
@@ -1854,6 +1905,8 @@ Page({ | @@ -1854,6 +1905,8 @@ Page({ | ||
1854 | if (CanOutQty) { | 1905 | if (CanOutQty) { |
1855 | 1906 | ||
1856 | if (CanOutQty < e.data.goodsInputNum) { | 1907 | if (CanOutQty < e.data.goodsInputNum) { |
1908 | + wx.hideLoading(); | ||
1909 | + th.data.adding=0; | ||
1857 | wx.showToast({ | 1910 | wx.showToast({ |
1858 | title: '库存不足!', | 1911 | title: '库存不足!', |
1859 | icon: 'none', | 1912 | icon: 'none', |
@@ -1863,6 +1916,7 @@ Page({ | @@ -1863,6 +1916,7 @@ Page({ | ||
1863 | 1916 | ||
1864 | th.add_cart_next(e, t, a, o, newd, CanOutQty); | 1917 | th.add_cart_next(e, t, a, o, newd, CanOutQty); |
1865 | } else { | 1918 | } else { |
1919 | + wx.hideLoading(); | ||
1866 | wx.showToast({ | 1920 | wx.showToast({ |
1867 | title: '库存不足!', | 1921 | title: '库存不足!', |
1868 | icon: 'none', | 1922 | icon: 'none', |
@@ -1873,6 +1927,7 @@ Page({ | @@ -1873,6 +1927,7 @@ Page({ | ||
1873 | 1927 | ||
1874 | } else { | 1928 | } else { |
1875 | if (o.store_count <= 0) { | 1929 | if (o.store_count <= 0) { |
1930 | + wx.hideLoading(); | ||
1876 | wx.showToast({ | 1931 | wx.showToast({ |
1877 | title: '库存已为空!', | 1932 | title: '库存已为空!', |
1878 | icon: 'none', | 1933 | icon: 'none', |
@@ -1881,13 +1936,14 @@ Page({ | @@ -1881,13 +1936,14 @@ Page({ | ||
1881 | //return s.my_warnning("库存已为空!", 0, th); | 1936 | //return s.my_warnning("库存已为空!", 0, th); |
1882 | }; | 1937 | }; |
1883 | if (o.store_count < e.data.goodsInputNum) { | 1938 | if (o.store_count < e.data.goodsInputNum) { |
1939 | + wx.hideLoading(); | ||
1884 | wx.showToast({ | 1940 | wx.showToast({ |
1885 | title: '库存不足!', | 1941 | title: '库存不足!', |
1886 | icon: 'none', | 1942 | icon: 'none', |
1887 | }); | 1943 | }); |
1888 | return false; | 1944 | return false; |
1889 | //return s.my_warnning("库存不足!", 0, th); | 1945 | //return s.my_warnning("库存不足!", 0, th); |
1890 | - }; | 1946 | + } |
1891 | th.add_cart_next(e, t, a, o, newd); //加入购物车下一步 | 1947 | th.add_cart_next(e, t, a, o, newd); //加入购物车下一步 |
1892 | } | 1948 | } |
1893 | } | 1949 | } |
@@ -1899,6 +1955,8 @@ Page({ | @@ -1899,6 +1955,8 @@ Page({ | ||
1899 | 1955 | ||
1900 | //---加入购物车的最后一步--- | 1956 | //---加入购物车的最后一步--- |
1901 | add_cart_next(e, t, a, o, newd, CanOutQty) { | 1957 | add_cart_next(e, t, a, o, newd, CanOutQty) { |
1958 | + | ||
1959 | + | ||
1902 | if (getApp().globalData.groupchat_id) { | 1960 | if (getApp().globalData.groupchat_id) { |
1903 | newd.groupchat_id = getApp().globalData.groupchat_id | 1961 | newd.groupchat_id = getApp().globalData.groupchat_id |
1904 | } | 1962 | } |
@@ -1933,26 +1991,10 @@ Page({ | @@ -1933,26 +1991,10 @@ Page({ | ||
1933 | //if (this.data.data.goods.is_virtual) return this.buyVirtualGoods(d); | 1991 | //if (this.data.data.goods.is_virtual) return this.buyVirtualGoods(d); |
1934 | if ("add" == t.currentTarget.dataset.action) { | 1992 | if ("add" == t.currentTarget.dataset.action) { |
1935 | 1993 | ||
1936 | - if ([3, 5, 10].indexOf(newd.prom_type) > -1) { | ||
1937 | - newd.prom_type = 0; | ||
1938 | - newd.prom_id = 0; | ||
1939 | - } | ||
1940 | - | ||
1941 | - //如果有搭配购的时候的时候 | ||
1942 | - if (th.data.collocationGoods && newd.prom_type == 0) { | ||
1943 | - newd.prom_type = 5; | ||
1944 | - newd.prom_id = th.data.collocationGoods.id; | ||
1945 | - } | ||
1946 | - | ||
1947 | - //如果有搭配购的时候的时候 | ||
1948 | - if (th.data.zh_act && (!th.data.zh_act.zh_num || th.data.zh_act.zh_buy_num < th.data.zh_act.zh_num) && newd.prom_type == 0) { | ||
1949 | - newd.prom_type = 7; | ||
1950 | - newd.prom_id = th.data.zh_act.id; | 1994 | + if( [3,5,7,10].indexOf(newd.prom_type)>-1){ |
1995 | + newd.prom_type=0; | ||
1996 | + newd.prom_id=0; | ||
1951 | } | 1997 | } |
1952 | - // if( [3,5,10].indexOf(newd.prom_type)>-1){ | ||
1953 | - // newd.prom_type=0; | ||
1954 | - // newd.prom_id=0; | ||
1955 | - // } | ||
1956 | // | 1998 | // |
1957 | // //如果有搭配购的时候的时候 | 1999 | // //如果有搭配购的时候的时候 |
1958 | // if(th.data.collocationGoods && newd.prom_type==0){ | 2000 | // if(th.data.collocationGoods && newd.prom_type==0){ |
@@ -1973,6 +2015,8 @@ Page({ | @@ -1973,6 +2015,8 @@ Page({ | ||
1973 | user_id: oo.user_id, | 2015 | user_id: oo.user_id, |
1974 | goods_id: a, | 2016 | goods_id: a, |
1975 | pick_id: e.data.sto_sele_id, | 2017 | pick_id: e.data.sto_sele_id, |
2018 | + prom_type: newd.prom_type, | ||
2019 | + prom_id: newd.prom_id, | ||
1976 | state: 0, | 2020 | state: 0, |
1977 | }, | 2021 | }, |
1978 | success: function (re) { | 2022 | success: function (re) { |
@@ -2002,6 +2046,8 @@ Page({ | @@ -2002,6 +2046,8 @@ Page({ | ||
2002 | //判断数量,要看下购物车中有没有该商品 | 2046 | //判断数量,要看下购物车中有没有该商品 |
2003 | if (CanOutQty) { | 2047 | if (CanOutQty) { |
2004 | if (item.goods_num + th.data.goodsInputNum > CanOutQty) { | 2048 | if (item.goods_num + th.data.goodsInputNum > CanOutQty) { |
2049 | + wx.hideLoading(); | ||
2050 | + th.data.adding=0; | ||
2005 | wx.showToast({ | 2051 | wx.showToast({ |
2006 | title: '库存不足!', | 2052 | title: '库存不足!', |
2007 | icon: 'none', | 2053 | icon: 'none', |
@@ -2011,6 +2057,8 @@ Page({ | @@ -2011,6 +2057,8 @@ Page({ | ||
2011 | } | 2057 | } |
2012 | } else { | 2058 | } else { |
2013 | if (item.goods_num + th.data.goodsInputNum > o.store_count) { | 2059 | if (item.goods_num + th.data.goodsInputNum > o.store_count) { |
2060 | + wx.hideLoading(); | ||
2061 | + th.data.adding=0; | ||
2014 | wx.showToast({ | 2062 | wx.showToast({ |
2015 | title: '库存不足!', | 2063 | title: '库存不足!', |
2016 | icon: 'none', | 2064 | icon: 'none', |
@@ -2019,7 +2067,10 @@ Page({ | @@ -2019,7 +2067,10 @@ Page({ | ||
2019 | //return s.my_warnning("库存不足!", 0, th); | 2067 | //return s.my_warnning("库存不足!", 0, th); |
2020 | } | 2068 | } |
2021 | 2069 | ||
2022 | - if (item.goods_num + th.data.goodsInputNum + th.data.prom_buy_num > th.data.prom_buy_limit && (th.data.prom_type == 1 || th.data.prom_type == 2)) { | 2070 | + //秒杀有限购的时候,同时不是普通购买 |
2071 | + if ( item.goods_num + th.data.goodsInputNum + th.data.prom_buy_num > th.data.prom_buy_limit && th.data.prom_buy_limit>0 && !newd.is_pd_normal && (th.data.prom_type == 1 || th.data.prom_type == 2)) { | ||
2072 | + wx.hideLoading(); | ||
2073 | + th.data.adding=0; | ||
2023 | wx.showToast({ | 2074 | wx.showToast({ |
2024 | title: '此商品已在购物车,去购物车结算!', | 2075 | title: '此商品已在购物车,去购物车结算!', |
2025 | icon: 'none', | 2076 | icon: 'none', |
@@ -2035,9 +2086,14 @@ Page({ | @@ -2035,9 +2086,14 @@ Page({ | ||
2035 | goods_price: newd.goods_price, | 2086 | goods_price: newd.goods_price, |
2036 | member_goods_price: newd.goods_price, | 2087 | member_goods_price: newd.goods_price, |
2037 | store_id: th.data.stoid, | 2088 | store_id: th.data.stoid, |
2038 | - prom_id: newd.prom_id //把活动id带上去(用于购物车失效变成有效商品) | 2089 | + prom_id: newd.prom_id, //把活动id带上去(用于购物车失效变成有效商品) |
2090 | + prom_type: newd.prom_type | ||
2039 | }; | 2091 | }; |
2040 | 2092 | ||
2093 | + if(newd.is_pd_normal){ | ||
2094 | + updata.is_pd_normal=1 | ||
2095 | + } | ||
2096 | + | ||
2041 | //---是不是从收藏夹出来的--- | 2097 | //---是不是从收藏夹出来的--- |
2042 | if (th.data.c_guide_id) { | 2098 | if (th.data.c_guide_id) { |
2043 | updata['guide_id'] = th.data.c_guide_id; | 2099 | updata['guide_id'] = th.data.c_guide_id; |
@@ -2055,6 +2111,8 @@ Page({ | @@ -2055,6 +2111,8 @@ Page({ | ||
2055 | getApp().request.put("/api/weshop/cart/update", { | 2111 | getApp().request.put("/api/weshop/cart/update", { |
2056 | data: updata, | 2112 | data: updata, |
2057 | success: function (t) { | 2113 | success: function (t) { |
2114 | + wx.hideLoading(); | ||
2115 | + th.data.adding=0; | ||
2058 | getApp().my_warnning('加入购物车成功', 1, th, 450); | 2116 | getApp().my_warnning('加入购物车成功', 1, th, 450); |
2059 | var c_num = th.data.cartGoodsNum + th.data.goodsInputNum; | 2117 | var c_num = th.data.cartGoodsNum + th.data.goodsInputNum; |
2060 | th.setData({ | 2118 | th.setData({ |
@@ -2067,6 +2125,8 @@ Page({ | @@ -2067,6 +2125,8 @@ Page({ | ||
2067 | getApp().request.post("/api/weshop/cart/save", { | 2125 | getApp().request.post("/api/weshop/cart/save", { |
2068 | data: newd, | 2126 | data: newd, |
2069 | success: function (t) { | 2127 | success: function (t) { |
2128 | + wx.hideLoading(); | ||
2129 | + th.data.adding=0; | ||
2070 | getApp().my_warnning('加入购物车成功', 1, th, 450); | 2130 | getApp().my_warnning('加入购物车成功', 1, th, 450); |
2071 | var c_num = th.data.cartGoodsNum + e.data.goodsInputNum; | 2131 | var c_num = th.data.cartGoodsNum + e.data.goodsInputNum; |
2072 | th.setData({ | 2132 | th.setData({ |
@@ -3223,6 +3283,7 @@ Page({ | @@ -3223,6 +3283,7 @@ Page({ | ||
3223 | //要把不匹配还原 | 3283 | //要把不匹配还原 |
3224 | if (th.data.def_pick_store && JSON.stringify(th.data.def_pick_store) != '{}'){ | 3284 | if (th.data.def_pick_store && JSON.stringify(th.data.def_pick_store) != '{}'){ |
3225 | th.data.def_pick_store.is_no_dis=0; | 3285 | th.data.def_pick_store.is_no_dis=0; |
3286 | + th.data.def_pick_store.is_no_dis_nor=0; | ||
3226 | th.setData({def_pick_store:th.data.def_pick_store}) | 3287 | th.setData({def_pick_store:th.data.def_pick_store}) |
3227 | } | 3288 | } |
3228 | 3289 | ||
@@ -3569,14 +3630,25 @@ Page({ | @@ -3569,14 +3630,25 @@ Page({ | ||
3569 | 3630 | ||
3570 | if (e.data.code == 0 && e.data.data && e.data.data.pageData && e.data.data.pageData.length > 0) { | 3631 | if (e.data.code == 0 && e.data.data && e.data.data.pageData && e.data.data.pageData.length > 0) { |
3571 | 3632 | ||
3633 | + var pickup_ids=th.data.sele_g.pickup_ids; | ||
3634 | + //不是单独购买的时候,要清空商品pickup_ids | ||
3635 | + if(!is_normal && th.data.prom_type>0){ | ||
3636 | + pickup_ids=null; | ||
3637 | + } | ||
3638 | + | ||
3639 | + //指定门店判断, 不是普通购买的时候,秒杀的时候,秒杀有指定门店 | ||
3640 | + if(!is_normal && th.data.prom_type==1 && th.data.prom_act.pick_up_lists){ | ||
3641 | + pickup_ids=th.data.prom_act.pick_up_lists | ||
3642 | + } | ||
3643 | + | ||
3572 | //-- 如果有指定门店的时候 -- | 3644 | //-- 如果有指定门店的时候 -- |
3573 | - if(th.data.sele_g.pickup_ids){ | 3645 | + if(pickup_ids){ |
3574 | 3646 | ||
3575 | var ok_arr=[]; | 3647 | var ok_arr=[]; |
3576 | for (let i in e.data.data.pageData) { | 3648 | for (let i in e.data.data.pageData) { |
3577 | let ite = e.data.data.pageData[i]; | 3649 | let ite = e.data.data.pageData[i]; |
3578 | //-- 查找一下门店有没有在 -- | 3650 | //-- 查找一下门店有没有在 -- |
3579 | - var idx=th.data.sele_g.pickup_ids.findIndex(function (e){ | 3651 | + var idx=pickup_ids.findIndex(function (e){ |
3580 | return e.pickup_id==ite.pickup_id; | 3652 | return e.pickup_id==ite.pickup_id; |
3581 | }) | 3653 | }) |
3582 | if(idx>-1){ | 3654 | if(idx>-1){ |
@@ -3588,22 +3660,44 @@ Page({ | @@ -3588,22 +3660,44 @@ Page({ | ||
3588 | if (th.data.def_pick_store && JSON.stringify(th.data.def_pick_store) != '{}'){ | 3660 | if (th.data.def_pick_store && JSON.stringify(th.data.def_pick_store) != '{}'){ |
3589 | 3661 | ||
3590 | //-- 查找一下门店有没有在 -- | 3662 | //-- 查找一下门店有没有在 -- |
3591 | - var idx1=th.data.sele_g.pickup_ids.findIndex(function (e){ | 3663 | + var idx1=pickup_ids.findIndex(function (e){ |
3592 | return e.pickup_id==th.data.def_pick_store.pickup_id; | 3664 | return e.pickup_id==th.data.def_pick_store.pickup_id; |
3593 | }) | 3665 | }) |
3594 | 3666 | ||
3595 | if(idx1<0){ | 3667 | if(idx1<0){ |
3596 | - th.data.def_pick_store.is_no_dis_nor=1; | ||
3597 | - that.setData({ | ||
3598 | - def_pick_store: th.data.def_pick_store | ||
3599 | - }) | 3668 | + //如果是秒杀的指定门店,就要设置秒杀的 |
3669 | + if(!is_normal && th.data.prom_type==1){ | ||
3670 | + th.data.def_pick_store.is_no_dis_act=1; | ||
3671 | + }else{ | ||
3672 | + th.data.def_pick_store.is_no_dis_nor=1; | ||
3673 | + } | ||
3674 | + | ||
3675 | + }else{ | ||
3676 | + th.data.def_pick_store.is_no_dis_nor=0; | ||
3677 | + th.data.def_pick_store.is_no_dis_act=0; | ||
3600 | } | 3678 | } |
3679 | + | ||
3680 | + that.setData({ | ||
3681 | + def_pick_store: th.data.def_pick_store | ||
3682 | + }) | ||
3683 | + | ||
3601 | } | 3684 | } |
3602 | 3685 | ||
3603 | 3686 | ||
3604 | - e.data.data.pageData=ok_arr; //数组重新赋值 | 3687 | + e.data.data.pageData=ok_arr; //数组重新赋值 |
3605 | e.data.data.total=ok_arr.length; //数组的长度 | 3688 | e.data.data.total=ok_arr.length; //数组的长度 |
3606 | } | 3689 | } |
3690 | + else{ | ||
3691 | + //-- 多规格指定门店优化 -- | ||
3692 | + if (th.data.def_pick_store && JSON.stringify(th.data.def_pick_store) != '{}'){ | ||
3693 | + th.data.def_pick_store.is_no_dis_nor=0; | ||
3694 | + th.data.def_pick_store.is_no_dis_act=0; | ||
3695 | + that.setData({ | ||
3696 | + def_pick_store: th.data.def_pick_store | ||
3697 | + }) | ||
3698 | + } | ||
3699 | + | ||
3700 | + } | ||
3607 | 3701 | ||
3608 | var his_cate_num = 0; | 3702 | var his_cate_num = 0; |
3609 | for (let i in e.data.data.pageData) { | 3703 | for (let i in e.data.data.pageData) { |
@@ -5087,6 +5181,13 @@ Page({ | @@ -5087,6 +5181,13 @@ Page({ | ||
5087 | //如果是拼单活动的普通购买 | 5181 | //如果是拼单活动的普通购买 |
5088 | if (ind == 1) { | 5182 | if (ind == 1) { |
5089 | 5183 | ||
5184 | + | ||
5185 | + //要把不匹配还原 | ||
5186 | + if (th.data.def_pick_store && JSON.stringify(th.data.def_pick_store) != '{}'){ | ||
5187 | + th.data.def_pick_store.is_no_dis_nor=0; | ||
5188 | + th.setData({def_pick_store:th.data.def_pick_store}) | ||
5189 | + } | ||
5190 | + | ||
5090 | if (!th.data.is_normal) { | 5191 | if (!th.data.is_normal) { |
5091 | th.data.g_buy_num = new Map(); | 5192 | th.data.g_buy_num = new Map(); |
5092 | } | 5193 | } |
@@ -5207,6 +5308,12 @@ Page({ | @@ -5207,6 +5308,12 @@ Page({ | ||
5207 | th = e, | 5308 | th = e, |
5208 | o = this.data.sele_g; | 5309 | o = this.data.sele_g; |
5209 | 5310 | ||
5311 | + if(th.data.adding) return false; | ||
5312 | + th.data.adding=0; | ||
5313 | + | ||
5314 | + wx.showLoading({ | ||
5315 | + mask:true | ||
5316 | + }) | ||
5210 | 5317 | ||
5211 | //----------添加到购物车时,要判断限购数量,-------- | 5318 | //----------添加到购物车时,要判断限购数量,-------- |
5212 | e.get_buy_num(o, async function (ee) { | 5319 | e.get_buy_num(o, async function (ee) { |
@@ -5214,6 +5321,9 @@ Page({ | @@ -5214,6 +5321,9 @@ Page({ | ||
5214 | //---判断商品是否超出限购--- | 5321 | //---判断商品是否超出限购--- |
5215 | if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) { | 5322 | if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) { |
5216 | if (th.data.goodsInputNum + th.data.g_buy_num.get(th.data.sele_g.goods_id) > th.data.sele_g.viplimited) { | 5323 | if (th.data.goodsInputNum + th.data.g_buy_num.get(th.data.sele_g.goods_id) > th.data.sele_g.viplimited) { |
5324 | + | ||
5325 | + wx.hideLoading(); | ||
5326 | + th.data.adding=0; | ||
5217 | wx.showToast({ | 5327 | wx.showToast({ |
5218 | title: '超出商品限购', | 5328 | title: '超出商品限购', |
5219 | icon: 'none', | 5329 | icon: 'none', |
@@ -5231,6 +5341,8 @@ Page({ | @@ -5231,6 +5341,8 @@ Page({ | ||
5231 | //---判断商品是否超出活动限购,拼团的普通购买不计算活动的限购--- | 5341 | //---判断商品是否超出活动限购,拼团的普通购买不计算活动的限购--- |
5232 | if (th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0 && th.data.is_normal != 1) { | 5342 | if (th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0 && th.data.is_normal != 1) { |
5233 | if (th.data.goodsInputNum + th.data.prom_buy_num > th.data.prom_buy_limit) { | 5343 | if (th.data.goodsInputNum + th.data.prom_buy_num > th.data.prom_buy_limit) { |
5344 | + wx.hideLoading(); | ||
5345 | + th.data.adding=0; | ||
5234 | wx.showToast({ | 5346 | wx.showToast({ |
5235 | title: '超出商品活动限购', | 5347 | title: '超出商品活动限购', |
5236 | icon: 'none', | 5348 | icon: 'none', |
@@ -5250,6 +5362,8 @@ Page({ | @@ -5250,6 +5362,8 @@ Page({ | ||
5250 | if (th.data.is_normal != 1) { | 5362 | if (th.data.is_normal != 1) { |
5251 | 5363 | ||
5252 | if (o.store_count <= 0) { | 5364 | if (o.store_count <= 0) { |
5365 | + wx.hideLoading(); | ||
5366 | + th.data.adding=0; | ||
5253 | wx.showToast({ | 5367 | wx.showToast({ |
5254 | title: '库存已为空!', | 5368 | title: '库存已为空!', |
5255 | icon: 'none', | 5369 | icon: 'none', |
@@ -5265,6 +5379,8 @@ Page({ | @@ -5265,6 +5379,8 @@ Page({ | ||
5265 | }) | 5379 | }) |
5266 | 5380 | ||
5267 | if (th.data.goodsInputNum > redis_num) { | 5381 | if (th.data.goodsInputNum > redis_num) { |
5382 | + wx.hideLoading(); | ||
5383 | + th.data.adding=0; | ||
5268 | wx.showToast({ | 5384 | wx.showToast({ |
5269 | title: '超出商品活动库存', | 5385 | title: '超出商品活动库存', |
5270 | icon: 'none', | 5386 | icon: 'none', |
@@ -5278,6 +5394,8 @@ Page({ | @@ -5278,6 +5394,8 @@ Page({ | ||
5278 | } | 5394 | } |
5279 | } else { | 5395 | } else { |
5280 | if (o.store_count <= 0) { | 5396 | if (o.store_count <= 0) { |
5397 | + wx.hideLoading(); | ||
5398 | + th.data.adding=0; | ||
5281 | wx.showToast({ | 5399 | wx.showToast({ |
5282 | title: '库存已为空!', | 5400 | title: '库存已为空!', |
5283 | icon: 'none', | 5401 | icon: 'none', |
@@ -5288,6 +5406,8 @@ Page({ | @@ -5288,6 +5406,8 @@ Page({ | ||
5288 | } | 5406 | } |
5289 | 5407 | ||
5290 | if (th.data.goodsInputNum <= 0) { | 5408 | if (th.data.goodsInputNum <= 0) { |
5409 | + wx.hideLoading(); | ||
5410 | + th.data.adding=0; | ||
5291 | wx.showToast({ | 5411 | wx.showToast({ |
5292 | title: '商品数量不能为0', | 5412 | title: '商品数量不能为0', |
5293 | icon: 'none', | 5413 | icon: 'none', |
@@ -5297,9 +5417,8 @@ Page({ | @@ -5297,9 +5417,8 @@ Page({ | ||
5297 | }; | 5417 | }; |
5298 | if (th.data.goodsInputNum > o.store_count) { | 5418 | if (th.data.goodsInputNum > o.store_count) { |
5299 | 5419 | ||
5300 | - // th.setData({ | ||
5301 | - // goodsInputNum: o.store_count | ||
5302 | - // }) | 5420 | + wx.hideLoading(); |
5421 | + th.data.adding=0; | ||
5303 | wx.showToast({ | 5422 | wx.showToast({ |
5304 | title: '超出商品库存', | 5423 | title: '超出商品库存', |
5305 | icon: 'none', | 5424 | icon: 'none', |
@@ -5312,7 +5431,11 @@ Page({ | @@ -5312,7 +5431,11 @@ Page({ | ||
5312 | th.setData({ | 5431 | th.setData({ |
5313 | sto_sele_name: "" | 5432 | sto_sele_name: "" |
5314 | }); | 5433 | }); |
5315 | - if (th.data.sto_sele_name == "") return s.my_warnning("请选择门店", 0, th); | 5434 | + if (th.data.sto_sele_name == ""){ |
5435 | + wx.hideLoading(); | ||
5436 | + th.data.adding=0; | ||
5437 | + return s.my_warnning("请选择门店", 0, th); | ||
5438 | + } | ||
5316 | //--------------此时操作的数据------------ | 5439 | //--------------此时操作的数据------------ |
5317 | var newd = { | 5440 | var newd = { |
5318 | goods_id: o.goods_id, | 5441 | goods_id: o.goods_id, |
@@ -7959,6 +8082,13 @@ Page({ | @@ -7959,6 +8082,13 @@ Page({ | ||
7959 | 8082 | ||
7960 | this.data.g_buy_num = new Map(); | 8083 | this.data.g_buy_num = new Map(); |
7961 | var th = this; | 8084 | var th = this; |
8085 | + | ||
8086 | + //要把不匹配还原 | ||
8087 | + if (th.data.def_pick_store && JSON.stringify(th.data.def_pick_store) != '{}'){ | ||
8088 | + th.data.def_pick_store.is_no_dis_nor=0; | ||
8089 | + th.setData({def_pick_store:th.data.def_pick_store}) | ||
8090 | + } | ||
8091 | + | ||
7962 | if (th.data.sku_g_pt) { | 8092 | if (th.data.sku_g_pt) { |
7963 | 8093 | ||
7964 | //要同步指定门店 | 8094 | //要同步指定门店 |
@@ -8031,9 +8161,25 @@ Page({ | @@ -8031,9 +8161,25 @@ Page({ | ||
8031 | url += "&groupchat_id=" + getApp().globalData.groupchat_id | 8161 | url += "&groupchat_id=" + getApp().globalData.groupchat_id |
8032 | } | 8162 | } |
8033 | 8163 | ||
8164 | + //获取有活动的取活动图片,没有活动的取主图 | ||
8165 | + var img = th.data.sele_g.original_img; | ||
8166 | + if(th.data.new_share_imgurl){ | ||
8167 | + img = th.data.iurl + th.data.new_share_imgurl | ||
8168 | + } | ||
8169 | + if (th.data.prom_type == 6 || th.data.prom_type == 1 || th.data.prom_type == 4) { | ||
8170 | + // title = th.data.prom_act.share_title; | ||
8171 | + // if (!title) title = th.data.prom_act.title; | ||
8172 | + // if (th.data.prom_type == 4) title = th.data.prom_act.name; | ||
8173 | + | ||
8174 | + if (th.data.prom_act.share_imgurl) | ||
8175 | + img = th.data.iurl + th.data.prom_act.share_imgurl; | ||
8176 | + } | ||
8177 | + let user_id = getApp().globalData.user_id | ||
8178 | + console.error(img); | ||
8034 | return { | 8179 | return { |
8035 | title: this.data.data.goods_name + '-' + store_name, | 8180 | title: this.data.data.goods_name + '-' + store_name, |
8036 | - imageUrl: this.data.gallery[0].image_url, | 8181 | + // imageUrl: this.data.gallery[0].image_url, |
8182 | + imageUrl: img, | ||
8037 | query: 'first_leader=' + user_id + url | 8183 | query: 'first_leader=' + user_id + url |
8038 | } | 8184 | } |
8039 | }, | 8185 | }, |
@@ -8486,7 +8632,16 @@ Page({ | @@ -8486,7 +8632,16 @@ Page({ | ||
8486 | open_ind_store: 5, | 8632 | open_ind_store: 5, |
8487 | }); //拼团直接给4 | 8633 | }); //拼团直接给4 |
8488 | 8634 | ||
8635 | + //要把不匹配还原 | ||
8636 | + if (th.data.def_pick_store && JSON.stringify(th.data.def_pick_store) != '{}'){ | ||
8637 | + th.data.def_pick_store.is_no_dis_nor=0; | ||
8638 | + th.setData({def_pick_store:th.data.def_pick_store}) | ||
8639 | + } | ||
8640 | + | ||
8489 | if (th.data.sku_g_pt) { | 8641 | if (th.data.sku_g_pt) { |
8642 | + //要同步指定门店 | ||
8643 | + th.set_sele_g(th.data.sku_g_pt); | ||
8644 | + | ||
8490 | this.get_sto(1) | 8645 | this.get_sto(1) |
8491 | this.setData({ | 8646 | this.setData({ |
8492 | openSpecModal_flash_normal: 1 | 8647 | openSpecModal_flash_normal: 1 |
pages/goods/goodsInfo/goodsInfo.wxml
@@ -712,6 +712,9 @@ | @@ -712,6 +712,9 @@ | ||
712 | <view class="no_store" wx:elif="{{def_pick_store && def_pick_store.is_no_dis_nor && prom_type==0}}"> | 712 | <view class="no_store" wx:elif="{{def_pick_store && def_pick_store.is_no_dis_nor && prom_type==0}}"> |
713 | (该店不可售) | 713 | (该店不可售) |
714 | </view> | 714 | </view> |
715 | + <view class="no_store" wx:elif="{{def_pick_store && def_pick_store.is_no_dis_act}}"> | ||
716 | + (该店不可售) | ||
717 | + </view> | ||
715 | <view class="no_store" wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules>=2 && prom_type==0 && !sele_g.whsle_id}}"> | 718 | <view class="no_store" wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules>=2 && prom_type==0 && !sele_g.whsle_id}}"> |
716 | (库存不足) | 719 | (库存不足) |
717 | </view> | 720 | </view> |
@@ -1325,7 +1328,10 @@ | @@ -1325,7 +1328,10 @@ | ||
1325 | <view wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">(库存不足)</view> | 1328 | <view wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">(库存不足)</view> |
1326 | <block wx:else> | 1329 | <block wx:else> |
1327 | <view class="no_store" wx:if="{{def_pick_store.is_no_dis}}">(配送不匹配)</view> | 1330 | <view class="no_store" wx:if="{{def_pick_store.is_no_dis}}">(配送不匹配)</view> |
1331 | + | ||
1328 | <view class="no_store" wx:elif="{{def_pick_store.is_no_dis_nor}}">(该店不可售)</view> | 1332 | <view class="no_store" wx:elif="{{def_pick_store.is_no_dis_nor}}">(该店不可售)</view> |
1333 | + <view class="no_store" wx:elif="{{def_pick_store.is_no_dis_nor && is_normal}}">(该店不可售)</view> | ||
1334 | + <view class="no_store" wx:elif="{{def_pick_store.is_no_dis_act && !is_normal}}">(该店不可售)</view> | ||
1329 | <view wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && !filters.is_virtual_gd(sele_g.is_virtual) && sales_rules>=2 && prom_type==0 &&!sele_g.whsle_id }}"> | 1335 | <view wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && !filters.is_virtual_gd(sele_g.is_virtual) && sales_rules>=2 && prom_type==0 &&!sele_g.whsle_id }}"> |
1330 | (库存不足) | 1336 | (库存不足) |
1331 | </view> | 1337 | </view> |
@@ -1385,6 +1391,12 @@ | @@ -1385,6 +1391,12 @@ | ||
1385 | <view wx:elif="{{def_pick_store && def_pick_store.is_no_dis_nor}}" class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;"> | 1391 | <view wx:elif="{{def_pick_store && def_pick_store.is_no_dis_nor}}" class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;"> |
1386 | 该店不可售 | 1392 | 该店不可售 |
1387 | </view> | 1393 | </view> |
1394 | + <view wx:elif="{{def_pick_store && def_pick_store.is_no_dis_nor && is_normal}}" class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;"> | ||
1395 | + 该店不可售 | ||
1396 | + </view> | ||
1397 | + <view wx:elif="{{def_pick_store && def_pick_store.is_no_dis_act && !is_normal}}" class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;"> | ||
1398 | + 该店不可售 | ||
1399 | + </view> | ||
1388 | <block wx:else> | 1400 | <block wx:else> |
1389 | <!-- 根本就找不到门店 --> | 1401 | <!-- 根本就找不到门店 --> |
1390 | <block wx:if="{{!only_pk && !def_pickpu_list}}"> | 1402 | <block wx:if="{{!only_pk && !def_pickpu_list}}"> |
@@ -1641,6 +1653,8 @@ | @@ -1641,6 +1653,8 @@ | ||
1641 | <text class="c-red22" wx:if="{{item.is_no_qyt}}">(库存不足)</text> | 1653 | <text class="c-red22" wx:if="{{item.is_no_qyt}}">(库存不足)</text> |
1642 | <text class="c-red22" wx:elif="{{item.is_no_dis}}">(配送不匹配)</text> | 1654 | <text class="c-red22" wx:elif="{{item.is_no_dis}}">(配送不匹配)</text> |
1643 | <text class="c-red22" wx:elif="{{item.is_no_dis_nor}}">(该店不可售)</text> | 1655 | <text class="c-red22" wx:elif="{{item.is_no_dis_nor}}">(该店不可售)</text> |
1656 | + <text class="c-red22" wx:elif="{{item.is_no_dis_nor && is_normal}}">(该店不可售)</text> | ||
1657 | + <text class="c-red22" wx:elif="{{item.is_no_dis_act && !is_normal}}">(该店不可售)</text> | ||
1644 | </view> | 1658 | </view> |
1645 | </view> | 1659 | </view> |
1646 | <view> | 1660 | <view> |
@@ -1670,6 +1684,8 @@ | @@ -1670,6 +1684,8 @@ | ||
1670 | <view class="fs30 xc-black3 address_name">{{item.pickup_name}} | 1684 | <view class="fs30 xc-black3 address_name">{{item.pickup_name}} |
1671 | <text class="c-red22" wx:if="{{item.is_no_dis}}">(配送不匹配)</text> | 1685 | <text class="c-red22" wx:if="{{item.is_no_dis}}">(配送不匹配)</text> |
1672 | <text class="c-red22" wx:elif="{{item.is_no_dis_nor}}">(该店不可售)</text> | 1686 | <text class="c-red22" wx:elif="{{item.is_no_dis_nor}}">(该店不可售)</text> |
1687 | + <text class="c-red22" wx:elif="{{item.is_no_dis_nor && is_normal}}">(该店不可售)</text> | ||
1688 | + <text class="c-red22" wx:elif="{{item.is_no_dis_act && !is_normal}}">(该店不可售)</text> | ||
1673 | <text class="c-red22" wx:elif="{{item.is_no_qyt }}">(库存不足)</text> | 1689 | <text class="c-red22" wx:elif="{{item.is_no_qyt }}">(库存不足)</text> |
1674 | </view> | 1690 | </view> |
1675 | </view> | 1691 | </view> |
pages/goods/goodsList/goodsList.js
@@ -43,10 +43,17 @@ Page({ | @@ -43,10 +43,17 @@ Page({ | ||
43 | fil_price_state:0, | 43 | fil_price_state:0, |
44 | limit_num:0, | 44 | limit_num:0, |
45 | gr_fir:0, //分组第一次 | 45 | gr_fir:0, //分组第一次 |
46 | + share_imgurl:'', //分享图片 | ||
46 | }, | 47 | }, |
47 | 48 | ||
48 | onLoad: function(t) { | 49 | onLoad: function(t) { |
50 | + //----------商品分组自定义分享图片---------- | ||
51 | + if (t.gid || t.group_id) { | ||
52 | + let id = t.gid || t.group_id | ||
53 | + this.get_share_imgurl(id) //获取分享图片 | ||
54 | + } | ||
49 | 55 | ||
56 | + //---------------------end------------ | ||
50 | this.data.rq_data=t; | 57 | this.data.rq_data=t; |
51 | 58 | ||
52 | //接受有没有导购的参数 | 59 | //接受有没有导购的参数 |
@@ -241,6 +248,18 @@ Page({ | @@ -241,6 +248,18 @@ Page({ | ||
241 | onShow:function () { | 248 | onShow:function () { |
242 | getApp().check_can_share(); | 249 | getApp().check_can_share(); |
243 | }, | 250 | }, |
251 | + //获取商品分组分享图片 | ||
252 | + get_share_imgurl(gid){ | ||
253 | + getApp().request.promiseGet("/api/weshop/goodsGroup/get/" + oo.stoid + "/" + gid, {}).then(res => { | ||
254 | + if (res.data.code == 0) { | ||
255 | + let prom = res.data.data; | ||
256 | + let share_imgurl =prom.share_imgurl | ||
257 | + this.setData({ | ||
258 | + share_imgurl | ||
259 | + }) | ||
260 | + } | ||
261 | + }) | ||
262 | + }, | ||
244 | //获取优惠活动 | 263 | //获取优惠活动 |
245 | async getprom(prom_id){ | 264 | async getprom(prom_id){ |
246 | await getApp().request.promiseGet("/api/weshop/promgoods/get/" + oo.stoid + "/" + prom_id, {}).then(res => { | 265 | await getApp().request.promiseGet("/api/weshop/promgoods/get/" + oo.stoid + "/" + prom_id, {}).then(res => { |
@@ -306,6 +325,10 @@ Page({ | @@ -306,6 +325,10 @@ Page({ | ||
306 | }, | 325 | }, |
307 | 326 | ||
308 | changeTab: function(t) { | 327 | changeTab: function(t) { |
328 | + | ||
329 | + //清空 | ||
330 | + this.data.gr_fir=0; | ||
331 | + | ||
309 | var ord = t.currentTarget.dataset.href; | 332 | var ord = t.currentTarget.dataset.href; |
310 | var ad = t.currentTarget.dataset.ad; | 333 | var ad = t.currentTarget.dataset.ad; |
311 | var url = this.data.requestUrl; | 334 | var url = this.data.requestUrl; |
@@ -335,7 +358,6 @@ Page({ | @@ -335,7 +358,6 @@ Page({ | ||
335 | t += "&orderField=" + e.data.tabname; | 358 | t += "&orderField=" + e.data.tabname; |
336 | t += "&orderType=" + e.data.adname; | 359 | t += "&orderType=" + e.data.adname; |
337 | } | 360 | } |
338 | - this.data.gr_fir=0; | ||
339 | 361 | ||
340 | 362 | ||
341 | t +="&page=" + e.data.currentPage; | 363 | t +="&page=" + e.data.currentPage; |
@@ -487,9 +509,11 @@ Page({ | @@ -487,9 +509,11 @@ Page({ | ||
487 | } | 509 | } |
488 | } | 510 | } |
489 | console.log("11-11"+pagePath); | 511 | console.log("11-11"+pagePath); |
512 | + let share_imgurl=this.data.iurl + this.data.share_imgurl | ||
490 | return { | 513 | return { |
491 | title: "商品列表", | 514 | title: "商品列表", |
492 | path:pagePath, | 515 | path:pagePath, |
516 | + imageUrl:share_imgurl | ||
493 | } | 517 | } |
494 | }, | 518 | }, |
495 | //---图片失败,默认图片--- | 519 | //---图片失败,默认图片--- |
@@ -547,11 +571,18 @@ Page({ | @@ -547,11 +571,18 @@ Page({ | ||
547 | }, | 571 | }, |
548 | 572 | ||
549 | /*-- 和筛选相关的 --*/ | 573 | /*-- 和筛选相关的 --*/ |
550 | - bind_pk_sort(e){ com_fil.bind_pk_sort(e,this); }, | 574 | + bind_pk_sort(e){ //清空 |
575 | + this.data.gr_fir=0; com_fil.bind_pk_sort(e,this); | ||
576 | + }, | ||
551 | set_screen(url){ com_fil.set_screen(url,this); }, | 577 | set_screen(url){ com_fil.set_screen(url,this); }, |
552 | - filterGoods(e){ com_fil.filterGoods(e,this); }, | 578 | + filterGoods(e){ |
579 | + //清空 | ||
580 | + this.data.gr_fir=0;com_fil.filterGoods(e,this); | ||
581 | + }, | ||
553 | open_more(e){ com_fil.open_more(e,this); }, | 582 | open_more(e){ com_fil.open_more(e,this); }, |
554 | - clear_fil(){ com_fil.clear_fil(this); } | 583 | + clear_fil(){ //清空 |
584 | + this.data.gr_fir=0;com_fil.clear_fil(this); | ||
585 | + } | ||
555 | 586 | ||
556 | 587 | ||
557 | }); | 588 | }); |
558 | \ No newline at end of file | 589 | \ No newline at end of file |
pages/user/index/index.js
@@ -699,7 +699,7 @@ Page({ | @@ -699,7 +699,7 @@ Page({ | ||
699 | //--跳到绑定页面-- | 699 | //--跳到绑定页面-- |
700 | gobindtel: function () { | 700 | gobindtel: function () { |
701 | wx.navigateTo({ | 701 | wx.navigateTo({ |
702 | - url: '/packageE/pages/togoin/togoin', | 702 | + url: '/packageE/pages/togoin/togoin?is_reg=1', |
703 | }) | 703 | }) |
704 | }, | 704 | }, |
705 | 705 |
pages/user/order_detail/order_detail.js
@@ -978,6 +978,19 @@ Page({ | @@ -978,6 +978,19 @@ Page({ | ||
978 | } | 978 | } |
979 | //----------如果有活动,并且在进行中,就不计算线下库存--------------- | 979 | //----------如果有活动,并且在进行中,就不计算线下库存--------------- |
980 | if (prom) { | 980 | if (prom) { |
981 | + | ||
982 | + //指定门店的控制 | ||
983 | + if (goodsinfo.prom_type == 1 && prom.pick_up_lists) { | ||
984 | + var idx0=prom.pick_up_lists.findIndex(function (e){ | ||
985 | + return e.pickup_id==order.pickup_id; | ||
986 | + }) | ||
987 | + if(idx0<0){ | ||
988 | + getApp().confirmBox(goodsinfo.goods_name + "秒杀活动的门店不可售"); | ||
989 | + th.setData({ paying: 0 }); | ||
990 | + return false; | ||
991 | + } | ||
992 | + } | ||
993 | + | ||
981 | var now = ut.gettimestamp(); | 994 | var now = ut.gettimestamp(); |
982 | if (prom.is_end == 1 && prom.end_time < now) { | 995 | if (prom.is_end == 1 && prom.end_time < now) { |
983 | var content = goodsinfo.goods_name + '商品的活动已经结束,请取消订单' | 996 | var content = goodsinfo.goods_name + '商品的活动已经结束,请取消订单' |
@@ -2119,7 +2132,7 @@ Page({ | @@ -2119,7 +2132,7 @@ Page({ | ||
2119 | good_url="/packageC/pages/presell/goodsInfo/goodsInfo?goods_id="+gd+"&prom_id="+item.act_id | 2132 | good_url="/packageC/pages/presell/goodsInfo/goodsInfo?goods_id="+gd+"&prom_id="+item.act_id |
2120 | break; | 2133 | break; |
2121 | default: | 2134 | default: |
2122 | - good_url="/pages/goods/goodsInfo/goodsInfo?goods_id="+gd+"&prom_id="+item.act_id+"&prom_type=1"; | 2135 | + good_url="/pages/goods/goodsInfo/goodsInfo?goods_id="+gd+"&prom_id="+item.act_id+"&prom_type="+item.prom_type; |
2123 | break | 2136 | break |
2124 | } | 2137 | } |
2125 | } | 2138 | } |
pages/user/order_list/order_list.js
@@ -1292,6 +1292,20 @@ Page({ | @@ -1292,6 +1292,20 @@ Page({ | ||
1292 | } | 1292 | } |
1293 | //----------如果有活动,并且在进行中,就不计算线下库存--------------- | 1293 | //----------如果有活动,并且在进行中,就不计算线下库存--------------- |
1294 | if (prom) { | 1294 | if (prom) { |
1295 | + | ||
1296 | + //指定门店的控制 | ||
1297 | + if (goodsinfo.prom_type == 1 && prom.pick_up_lists) { | ||
1298 | + var idx0=prom.pick_up_lists.findIndex(function (e){ | ||
1299 | + return e.pickup_id==order.pickup_id; | ||
1300 | + }) | ||
1301 | + if(idx0<0){ | ||
1302 | + getApp().confirmBox(goodsinfo.goods_name + "秒杀活动的门店不可售"); | ||
1303 | + th.setData({ paying: 0 }); | ||
1304 | + return false; | ||
1305 | + } | ||
1306 | + } | ||
1307 | + | ||
1308 | + | ||
1295 | var now = ut.gettimestamp(); | 1309 | var now = ut.gettimestamp(); |
1296 | if (prom.is_end == 1 && prom.end_time < now) { | 1310 | if (prom.is_end == 1 && prom.end_time < now) { |
1297 | var content = goodsinfo.goods_name + '商品的活动已经结束,请取消订单' | 1311 | var content = goodsinfo.goods_name + '商品的活动已经结束,请取消订单' |
@@ -2849,10 +2863,24 @@ Page({ | @@ -2849,10 +2863,24 @@ Page({ | ||
2849 | return false; | 2863 | return false; |
2850 | } | 2864 | } |
2851 | 2865 | ||
2866 | + | ||
2867 | + //指定门店的控制 | ||
2868 | + if (act_details.pick_up_lists) { | ||
2869 | + var idx0=act_details.pick_up_lists.findIndex(function (e){ | ||
2870 | + return e.pickup_id==it.pickup_id; | ||
2871 | + }) | ||
2872 | + if(idx0<0){ | ||
2873 | + getApp().confirmBox(it.service_name + "秒杀活动的门店不可售"); | ||
2874 | + th.setData({ paying: 0 }); | ||
2875 | + flag = false; | ||
2876 | + return false; | ||
2877 | + } | ||
2878 | + } | ||
2879 | + | ||
2852 | } | 2880 | } |
2853 | }); | 2881 | }); |
2854 | 2882 | ||
2855 | - if(act_details.buy_limit>0 && flag){ | 2883 | + if(act_details && act_details.buy_limit>0 && flag){ |
2856 | await getApp().request.promiseGet("/api/weshop/rechargeServicelist/getUserBuyGoodsNum", { | 2884 | await getApp().request.promiseGet("/api/weshop/rechargeServicelist/getUserBuyGoodsNum", { |
2857 | data: { | 2885 | data: { |
2858 | store_id: store_id, | 2886 | store_id: store_id, |