Commit bc2acacfa523c057a69811e696b027492c9a4e4b

Authored by taiyuan
1 parent 0c4eea0e

幸运购详情

packageC/pages/luckyGo/luckyGo_goodsInfo/buy_pt.wxml
... ... @@ -18,7 +18,7 @@
18 18 ¥ {{sele_g.shop_price}}
19 19 </block>
20 20 </view>
21   - <view class="spec-goods-price" wx:else>¥ {{prom_price}}</view>
  21 + <view class="spec-goods-price" wx:else>¥ {{prom_price || filters.div100(luckGoInfo.group_price)}}</view>
22 22 </view>
23 23  
24 24 <block wx:if="{{is_normal==1}}">
... ... @@ -31,13 +31,13 @@
31 31 <block wx:else><view class="spec-goods-stock">可售:{{sele_g.store_count}}</view></block>
32 32 </view>
33 33 </block>
34   - <block wx:if="{{is_normal==0}}">
  34 + <!-- <block wx:if="{{is_normal==0}}">
35 35 <view class="flex">
36 36 <view class="spec-goods-stock" wx:if="{{prom_st>0}}">已售:{{prom_act.buy_num}}</view>
37 37 <view class="spec-goods-stock" wx:else >已售:{{prom_act.buy_num}}</view>
38 38 <view class="spec-goods-stock">可售:{{prom_act.goods_num-prom_act.buy_num}}</view>
39 39 </view>
40   - </block>
  40 + </block> -->
41 41 </view>
42 42  
43 43 </view>
... ... @@ -102,14 +102,23 @@
102 102 <!--<image class="wh100" src="{{iurl}}/miniapp/images/icon-arrowdown.png"></image>-->
103 103 <!--</view>-->
104 104 <!--</view>-->
  105 +
  106 + <view class="b_num" hidden="{{ismend==1}}" style="margin-top: 20rpx" wx:if="{{is_normal==1}}">
  107 + <view>购买数量</view>
  108 + <view class="count">
  109 + <view bindtap="{{goodsInputNum <= 1 ? '':'subCartNum'}}" class="sub {{goodsInputNum <= 1 ? 'active':''}}">-</view>
  110 + <input bindblur="inputCartNum" class="xc-val-fream" type="number" value="{{goodsInputNum}}"></input>
  111 + <view bindtap="addCartNum" class="add">+</view>
  112 + </view>
  113 + </view>
105 114  
106 115  
107   - <view class="b_num" hidden="{{ismend==1}}" style="margin-top: 20rpx">
  116 + <view class="b_num" hidden="{{ismend==1}}" style="margin-top: 20rpx" wx:else>
108 117 <view>购买数量</view>
109 118 <view class="count">
110 119 <view bindtap="{{goodsInputNum <= 1 ? '':'subCartNum'}}" class="sub {{goodsInputNum <= 1 ? 'active':''}}">-</view>
111   - <input bindblur="inputCartNum" class="xc-val-fream" type="number" value="{{goodsInputNum}}"></input>
112   - <view bindtap="addCartNum" class="add">+</view>
  120 + <input bindblur="inputCartNum" class="xc-val-fream" type="number" value="{{goodsInputNum}}" disabled></input>
  121 + <view bindtap="" class="sub active">+</view>
113 122 </view>
114 123 </view>
115 124  
... ...
packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js
... ... @@ -435,34 +435,34 @@ Page({
435 435 var swithc_list = e.switch_list;
436 436 var sw_arr = JSON.parse(swithc_list);
437 437 //---如果后台又开等级卡的开关---
438   - // if (sw_arr.rank_switch && sw_arr.rank_switch == "2") {
439   - // th.setData({ rank_switch: true });
440   - // //---回调卡的列表---
441   - // th.getPlusCardType(function (ob) {
442   - // th.setData({ card_list: ob.card_list });
443   - // var ti = setInterval(function () {
444   - // var user = getApp().globalData.userInfo;
445   - // if (!user) return false;
446   - // clearInterval(ti);
447   -
448   - // if (user.card_field && user['card_expiredate']) {
449   - // var str = user['card_expiredate'].replace(/-/g, '/');
450   - // var end = new Date(str);
451   - // end = Date.parse(end) / 1000;
452   - // var now = ut.gettimestamp();
453   - // //--- 判断是等级会员,且在有效期范围内 ---
454   - // if (user.card_field && now < end) {
455   - // var card_name = ob.name_map.get(user.card_field);
456   - // //if(card_name.length>6) card_name=card_name.substring(0,6);
457   -
458   - // var is_near_date = 0;
459   - // if (end - now < 60 * 60 * 30 * 24) is_near_date = 1; //如果小于30天
460   - // th.setData({ card_field: user.card_field, card_name: card_name, card_list: ob.card_list, is_near_date: is_near_date });
461   - // }
462   - // }
463   - // }, 500)
464   - // })
465   - // }
  438 + if (sw_arr.rank_switch && sw_arr.rank_switch == "2") {
  439 + th.setData({ rank_switch: true });
  440 + //---回调卡的列表---
  441 + th.getPlusCardType(function (ob) {
  442 + th.setData({ card_list: ob.card_list });
  443 + var ti = setInterval(function () {
  444 + var user = getApp().globalData.userInfo;
  445 + if (!user) return false;
  446 + clearInterval(ti);
  447 +
  448 + if (user.card_field && user['card_expiredate']) {
  449 + var str = user['card_expiredate'].replace(/-/g, '/');
  450 + var end = new Date(str);
  451 + end = Date.parse(end) / 1000;
  452 + var now = ut.gettimestamp();
  453 + //--- 判断是等级会员,且在有效期范围内 ---
  454 + if (user.card_field && now < end) {
  455 + var card_name = ob.name_map.get(user.card_field);
  456 + //if(card_name.length>6) card_name=card_name.substring(0,6);
  457 +
  458 + var is_near_date = 0;
  459 + if (end - now < 60 * 60 * 30 * 24) is_near_date = 1; //如果小于30天
  460 + th.setData({ card_field: user.card_field, card_name: card_name, card_list: ob.card_list, is_near_date: is_near_date });
  461 + }
  462 + }
  463 + }, 500)
  464 + })
  465 + }
466 466  
467 467 }, 1);
468 468  
... ... @@ -877,6 +877,7 @@ Page({
877 877 e.wxParseAddFullImageUrl(ee, "content");
878 878  
879 879 if(ee.data.prom_type){
  880 + //999
880 881 t.data.data.prom_type=ee.data.prom_type;
881 882 t.data.data.prom_id=ee.data.prom_id;
882 883 }
... ... @@ -891,17 +892,17 @@ Page({
891 892 //获取统一条形码,普通商品和优惠促销的商品
892 893 if (ee.data.data.prom_type == 0 || ee.data.data.prom_type == 2 || ee.data.data.prom_type == 3 || ee.data.data.prom_type == 5 || ee.data.data.prom_type == 7) {
893 894 //默认门店要拿下门店库存
894   - if (that.data.sales_rules == 2 && that.data.is_newsales_rules) {
895   - //获取门店
896   - ee.get_sto();
  895 + // if (that.data.sales_rules == 2 && that.data.is_newsales_rules) {
  896 + // //获取门店
  897 + // ee.get_sto(1);
897 898  
898   - } else {
899   - //获取门店
900   - ee.get_sto();
901   - }
  899 + // } else {
  900 + // //获取门店
  901 + // ee.get_sto();
  902 + // }
902 903  
903   - ee.get_sku(o.stoid, t.data.data, gid);
904   - ee.check_has_flash();
  904 + // ee.get_sku(o.stoid, t.data.data, gid);
  905 + // ee.check_has_flash();
905 906  
906 907 }
907 908 else {
... ... @@ -1018,7 +1019,7 @@ Page({
1018 1019 }
1019 1020 }).then(res => {
1020 1021 if (res.data.code == 0) {
1021   - console.log('成团信息=======》', res.data.data);
  1022 + // console.log('成团信息=======》', res.data.data);
1022 1023 th.setData({
1023 1024 luckGoInfo: res.data.data.pageData[0],
1024 1025 team_id: res.data.data.pageData[0].team_id,
... ... @@ -1039,7 +1040,7 @@ Page({
1039 1040 }
1040 1041 }).then(res => {
1041 1042 if (res.data.code == 0) {
1042   - console.log(th.data.team_id,'参团成员===============》', res.data.data.pageData);
  1043 + // console.log(th.data.team_id,'参团成员===============》', res.data.data.pageData);
1043 1044 th.setData({
1044 1045 luckGoMembers: res.data.data.pageData,
1045 1046 });
... ... @@ -1057,19 +1058,22 @@ Page({
1057 1058  
1058 1059 },
1059 1060  
  1061 + // 暂时无用
  1062 + // enterAddress: function () {
  1063 + // this.data.enterAddressPage = !0, wx.navigateTo({
  1064 + // url: "/pages/user/address_list/address_list?operate=selectAddress"
  1065 + // });
  1066 + // },
1060 1067  
1061   - enterAddress: function () {
1062   - this.data.enterAddressPage = !0, wx.navigateTo({
1063   - url: "/pages/user/address_list/address_list?operate=selectAddress"
1064   - });
1065   - },
1066 1068  
  1069 + // 页面卸载
1067 1070 onUnload: function () {
1068 1071 for (var i = 1; i < 100; i++) {
1069 1072 clearInterval(i);
1070 1073 }
1071 1074 },
1072 1075  
  1076 + // 页面隐藏
1073 1077 onHide: function () {
1074 1078 this.data.is_timer = 0;
1075 1079 for (var i = 1; i < 100; i++) {
... ... @@ -1077,7 +1081,7 @@ Page({
1077 1081 }
1078 1082 },
1079 1083  
1080   - //----------三个选项按钮-----------
  1084 + // 点击顶部选项卡
1081 1085 tabClick: function (t) {
1082 1086 var e = t.currentTarget.id;
1083 1087 this.setData({
... ... @@ -1092,6 +1096,8 @@ Page({
1092 1096 // });
1093 1097 // },
1094 1098  
  1099 +
  1100 + // 点击评价选项卡下的各评价按钮
1095 1101 tabClick3: function (t) {
1096 1102 var e = this;
1097 1103 if (t.currentTarget.id != this.data.activeCategoryId3) {
... ... @@ -1104,6 +1110,7 @@ Page({
1104 1110 }
1105 1111 },
1106 1112  
  1113 + // 滚动到顶部
1107 1114 doScrollTop: function () {
1108 1115 wx.pageScrollTo({
1109 1116 scrollTop: 0
... ... @@ -1116,7 +1123,8 @@ Page({
1116 1123 }), this.data.comments || this.requestComments_new();
1117 1124 },
1118 1125  
1119   - //商品详情的时候调用
  1126 +
  1127 + //商品详情里表格信息:类别、品牌、国别
1120 1128 tabGoodsContent: function () {
1121 1129 var th = this,
1122 1130 i = getApp().request;
... ... @@ -3761,64 +3769,73 @@ Page({
3761 3769 openSpecModal_pt: 1
3762 3770 });
3763 3771 });
  3772 +
  3773 + th.setData({
  3774 + is_normal: ind,
  3775 + openSpecModal_pt: 1
  3776 + });
3764 3777 };
3765 3778 th.check_is_youhui(th.data.gid, 1);
3766   - }
3767   -
3768   - else {
3769   -
3770   - //拼单商品从这里进,先判断有没有买过商品,
3771   - getApp().request.get("/api/weshop/order/page", {
3772   - data: {
3773   - pt_prom_id: th.data.prom_act.id,
3774   - user_id: oo.user_id,
3775   - store_id: os.stoid,
3776   - pageSize: 1,
3777   - page: 1
3778   - },
3779   - success: function (e) {
3780   - //--跳转到已经购买的情况--
3781   - if (e.data.data.pageData.length > 0) {
3782   - var odr = e.data.data.pageData[0];
3783   - //还未支付
3784   - if (odr.pt_status == 0 && (odr.order_status == 1 || odr.order_status == 0)) {
3785   - wx.showModal({
3786   - title: "您已经购买了该商品待支付中",
3787   - success: function (a) {
3788   - if (a.confirm) {
3789   - wx.navigateTo({
3790   - url: "/pages/user/order_detail/order_detail?order_id=" + odr.order_id,
3791   - });
3792   - }
3793   - }
3794   - });
3795   - } else if (odr.pt_status == 1 && odr.order_status == 1) {
3796   -
3797   - if (this.data.is_go_to_team_show) return false;
3798   - this.data.is_go_to_team_show = 1;
3799   - wx.showLoading();
3800   -
3801   - /*---
3802   - wx.redirectTo({
3803   - url: "/pages/team/team_success/team_success?ordersn=" + odr.order_sn,
3804   - });--*/
3805   - getApp().goto("/pages/team/team_success/team_success?ordersn=" + odr.order_sn);
  3779 + } else {
3806 3780  
3807   - } else {
3808   - th.setData({
3809   - is_normal: ind,
3810   - openSpecModal_pt: 1
3811   - });
3812   - }
  3781 + // //拼单商品从这里进,先判断有没有买过商品,
  3782 + // getApp().request.get("/api/weshop/order/page", {
  3783 + // data: {
  3784 + // // pt_prom_id: th.data.prom_act.id,
  3785 + // user_id: oo.user_id,
  3786 + // store_id: os.stoid,
  3787 + // pageSize: 1,
  3788 + // page: 1
  3789 + // },
  3790 + // success: function (e) {
  3791 + // //--跳转到已经购买的情况--
  3792 + // if (e.data.data.pageData.length > 0) {
  3793 + // var odr = e.data.data.pageData[0];
  3794 + // //还未支付
  3795 + // if (odr.pt_status == 0 && (odr.order_status == 1 || odr.order_status == 0)) {
  3796 + // wx.showModal({
  3797 + // title: "您已经购买了该商品待支付中",
  3798 + // success: function (a) {
  3799 + // if (a.confirm) {
  3800 + // wx.navigateTo({
  3801 + // url: "/pages/user/order_detail/order_detail?order_id=" + odr.order_id,
  3802 + // });
  3803 + // }
  3804 + // }
  3805 + // });
  3806 + // } else if (odr.pt_status == 1 && odr.order_status == 1) {
  3807 +
  3808 + // if (this.data.is_go_to_team_show) return false;
  3809 + // this.data.is_go_to_team_show = 1;
  3810 + // wx.showLoading();
  3811 +
  3812 + // /*---
  3813 + // wx.redirectTo({
  3814 + // url: "/pages/team/team_success/team_success?ordersn=" + odr.order_sn,
  3815 + // });--*/
  3816 + // getApp().goto("/pages/team/team_success/team_success?ordersn=" + odr.order_sn);
  3817 +
  3818 + // } else {
  3819 + // th.setData({
  3820 + // is_normal: ind,
  3821 + // openSpecModal_pt: 1
  3822 + // });
  3823 + // }
3813 3824  
3814   - } else {
3815   - th.setData({
3816   - is_normal: ind,
3817   - openSpecModal_pt: 1
3818   - });
3819   - }
3820   - }
3821   - });
  3825 + // } else {
  3826 + // th.setData({
  3827 + // is_normal: ind,
  3828 + // openSpecModal_pt: 1
  3829 + // });
  3830 + // }
  3831 + // }
  3832 + // });
  3833 + th.get_sto(1);
  3834 + th.setData({
  3835 + is_normal: 0,
  3836 + openSpecModal_pt: 1
  3837 + });
  3838 +
3822 3839 }
3823 3840 },
3824 3841  
... ...
packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.wxml
... ... @@ -889,7 +889,7 @@
889 889 </view>
890 890 <!-- data-ind="2" -->
891 891 <!-- openSpecModel_pt -->
892   - <view class="btn-red f1 flex ai-center jc-center" bindtap="openSpecModel_pt" data-openSpecModal_ind="{{openSpecModal_ind}}" data-action="buy" data-ind="1">立即参团2</view>
  892 + <view class="btn-red f1 flex ai-center jc-center" bindtap="openSpecModel_pt" data-openSpecModal_ind="{{openSpecModal_ind}}" data-action="buy" data-ind="0">立即参团2</view>
893 893 <!-- <view class="btn-red f1 flex ai-center jc-center" bindtap="addCart" data-openSpecModal_ind="{{openSpecModal_ind}}" data-action="buy">立即参团</view> -->
894 894 </view>
895 895 <!-- <view bindtap="openSpecModel" data-ind="1" class="btn-buy flex fdc jc-center">
... ...