Commit e2b1eafda4b4475dd72b650b583741f36d8598d2

Authored by WXD-SEASON\season
2 parents f32bb0aa be860f85

Merge branch 'test' of http://git.vipzhuang.cn/wxd/MShopWeApp into qa

app.json
@@ -196,8 +196,9 @@ @@ -196,8 +196,9 @@
196 "pages/user/monthgiftbag/giftpackbuy/giftpackbuy", 196 "pages/user/monthgiftbag/giftpackbuy/giftpackbuy",
197 "pages/cart/cart2_pt/cart2_pt", 197 "pages/cart/cart2_pt/cart2_pt",
198 "pages/cart/cart_wk/cart_wk", 198 "pages/cart/cart_wk/cart_wk",
199 - "pages/cart/cart2_inte/cart2_inte"  
200 - 199 + "pages/cart/cart2_inte/cart2_inte",
  200 + "pages/user/monthgiftbag/my_giftpackinfo/my_giftpackinfo"
  201 +
201 ] 202 ]
202 }, 203 },
203 { 204 {
packageA/pages/details_serviceCard/details_serviceCard.js
@@ -49,7 +49,8 @@ Page({ @@ -49,7 +49,8 @@ Page({
49 * 生命周期函数--监听页面显示 49 * 生命周期函数--监听页面显示
50 */ 50 */
51 onShow: function() { 51 onShow: function() {
52 - this.data.is_summit_ing=0; 52 +
  53 + this.setData({ is_summit_ing: 0 });
53 54
54 var th=this; 55 var th=this;
55 //判断是不是第一次进入 56 //判断是不是第一次进入
@@ -659,7 +660,9 @@ Page({ @@ -659,7 +660,9 @@ Page({
659 async pay() { 660 async pay() {
660 661
661 if(this.data.is_summit_ing) return false; 662 if(this.data.is_summit_ing) return false;
662 - this.data.is_summit_ing=1; 663 + this.setData({
  664 + is_summit_ing:1
  665 + })
663 666
664 var th=this; 667 var th=this;
665 let order_sn = this.data.details.order_sn; 668 let order_sn = this.data.details.order_sn;
@@ -676,6 +679,25 @@ Page({ @@ -676,6 +679,25 @@ Page({
676 679
677 //秒杀活动和拼团活动要重新计算一下 680 //秒杀活动和拼团活动要重新计算一下
678 for (const it of list) { 681 for (const it of list) {
  682 +
  683 + var card=null;
  684 + await getApp().request.promiseGet("/api/weshop/serviceCard/get/" + store_id + "/" + it.card_id, {}).then(res => {
  685 + if(res.data.code==0 && res.data.data){
  686 + card = res.data.data;
  687 + }
  688 + })
  689 +
  690 + if(card && card.storageId){
  691 + let the_c_key=it.pickup_keyid;
  692 + if (card.storageId.indexOf(the_c_key)==-1) {
  693 + getApp().confirmBox(it.service_name + "的门店不可售");
  694 + th.setData({ is_summit_ing: 0 });
  695 + flag = false;
  696 + return false;
  697 + }
  698 + }
  699 +
  700 +
679 if ([1,2].includes(it.prom_type)) { 701 if ([1,2].includes(it.prom_type)) {
680 let act_details = null; 702 let act_details = null;
681 let redis_num = 0; 703 let redis_num = 0;
@@ -717,7 +739,7 @@ Page({ @@ -717,7 +739,7 @@ Page({
717 }) 739 })
718 if(idx0<0){ 740 if(idx0<0){
719 getApp().confirmBox(it.service_name + "秒杀活动的门店不可售"); 741 getApp().confirmBox(it.service_name + "秒杀活动的门店不可售");
720 - th.setData({ paying: 0 }); 742 + th.setData({ is_summit_ing: 0 });
721 flag = false; 743 flag = false;
722 return false; 744 return false;
723 } 745 }
@@ -951,7 +973,7 @@ Page({ @@ -951,7 +973,7 @@ Page({
951 }) 973 })
952 974
953 if(!flag) { 975 if(!flag) {
954 - th.data.ser_paying=0; 976 + th.setData({ is_summit_ing: 0 });
955 return false; 977 return false;
956 } 978 }
957 979
@@ -1022,7 +1044,7 @@ Page({ @@ -1022,7 +1044,7 @@ Page({
1022 }, 1000) 1044 }, 1000)
1023 1045
1024 }, function (e) { 1046 }, function (e) {
1025 - th.data.is_summit_ing = 0; 1047 + th.setData({ is_summit_ing: 0 });
1026 wx.showToast({ 1048 wx.showToast({
1027 title: e, 1049 title: e,
1028 icon: 'none', 1050 icon: 'none',
@@ -1030,7 +1052,7 @@ Page({ @@ -1030,7 +1052,7 @@ Page({
1030 }); 1052 });
1031 }) 1053 })
1032 }else{ 1054 }else{
1033 - this.data.is_summit_ing=0; 1055 + th.setData({ is_summit_ing: 0 });
1034 } 1056 }
1035 1057
1036 }, 1058 },
packageA/pages/details_serviceCard/details_serviceCard.wxml
@@ -83,12 +83,18 @@ @@ -83,12 +83,18 @@
83 <!-- 待支付 --> 83 <!-- 待支付 -->
84 <block wx:if="{{details.pay_status == 0 && details.order_status==0 && details.prom_type!=6 }}"> 84 <block wx:if="{{details.pay_status == 0 && details.order_status==0 && details.prom_type!=6 }}">
85 <text class="btn btn-border" bindtap="cancle">取消订单</text> 85 <text class="btn btn-border" bindtap="cancle">取消订单</text>
86 - <text class="btn bg-red white mgl20" bindtap="pay">立即支付</text> 86 + <text class="btn bg-red white mgl20" bindtap="pay">
  87 + <block wx:if="{{is_summit_ing}}">支付中</block>
  88 + <block wx:else>立即支付</block>
  89 + </text>
87 </block> 90 </block>
88 91
89 <block wx:if="{{details.pt_status == 0 && details.order_status<2 && details.prom_type==6 }}"> 92 <block wx:if="{{details.pt_status == 0 && details.order_status<2 && details.prom_type==6 }}">
90 <text class="btn btn-border" bindtap="cancle">取消订单</text> 93 <text class="btn btn-border" bindtap="cancle">取消订单</text>
91 - <text class="btn bg-red white mgl20" bindtap="pay">立即支付</text> 94 + <text class="btn bg-red white mgl20" bindtap="pay">
  95 + <block wx:if="{{is_summit_ing}}">支付中</block>
  96 + <block wx:else>立即支付</block>
  97 + </text>
92 </block> 98 </block>
93 99
94 <block wx:if="{{details.pt_status == 2 && details.order_status<2 && details.prom_type==6 && details.pt_tail_money>0 }}"> 100 <block wx:if="{{details.pt_status == 2 && details.order_status<2 && details.prom_type==6 && details.pt_tail_money>0 }}">
packageA/pages/goodsInfo/goodsInfo.js
@@ -1201,7 +1201,7 @@ Page({ @@ -1201,7 +1201,7 @@ Page({
1201 } 1201 }
1202 1202
1203 // 以下为当前门店同类商品已经加入到购物车 1203 // 以下为当前门店同类商品已经加入到购物车
1204 - var totalNum = th.data.goodsInputNum + item.goods_num; 1204 + var totalNum = th.data.goodsInputNum + (item?item.goods_num:0);
1205 1205
1206 // 秒杀购物车购买 修正数量 1206 // 秒杀购物车购买 修正数量
1207 if (th.data.prom_type == 1 && !th.data.is_normal) { 1207 if (th.data.prom_type == 1 && !th.data.is_normal) {
@@ -1225,43 +1225,60 @@ Page({ @@ -1225,43 +1225,60 @@ Page({
1225 } 1225 }
1226 } 1226 }
1227 1227
1228 - var updata = {  
1229 - id: item.id,  
1230 - goods_num: totalNum,  
1231 - money: th.data.data.shop_price,  
1232 - store_id: os.stoid,  
1233 - };  
1234 -  
1235 - // 秒杀:单独购买的情况下,加入购物车显示的是零售价,否则显示秒杀活动价  
1236 - if(th.data.options.prom_type == 1) {  
1237 - // updata['prom_type'] = th.data.options.prom_type;  
1238 - // updata['prom_id'] = th.data.options.prom_id;  
1239 - if(th.data.openSpecModal_flash_normal) {  
1240 - updata['money'] = th.data.data.shop_price;  
1241 - updata['is_pd_normal'] = 1;  
1242 - } else {  
1243 - updata['money'] = th.data.prom_price;  
1244 - };  
1245 - };  
1246 -  
1247 - if (getApp().globalData.guide_id) {  
1248 - updata['guide_id'] = getApp().globalData.guide_id;  
1249 - updata['guide_type'] = 1;  
1250 - }  
1251 - if(getApp().globalData.groupchat_id){  
1252 - updata['groupchat_id'] = getApp().globalData.groupchat_id;  
1253 - }  
1254 - getApp().request.put("/api/weshop/cartService/update", {  
1255 - data: updata,  
1256 - success: function(t) {  
1257 - getApp().my_warnning('加入购物车成功', 1, th, 450);  
1258 - var c_num = th.data.cartGoodsNum + th.data.goodsInputNum;  
1259 - th.setData({  
1260 - cartGoodsNum: c_num  
1261 - });  
1262 - th.closeSpecModal();  
1263 - }  
1264 - }); 1228 + if(item) {
  1229 + var updata = {
  1230 + id: item.id,
  1231 + goods_num: totalNum,
  1232 + money: th.data.data.shop_price,
  1233 + store_id: os.stoid,
  1234 + };
  1235 +
  1236 + // 秒杀:单独购买的情况下,加入购物车显示的是零售价,否则显示秒杀活动价
  1237 + if (th.data.options.prom_type == 1) {
  1238 + // updata['prom_type'] = th.data.options.prom_type;
  1239 + // updata['prom_id'] = th.data.options.prom_id;
  1240 + if (th.data.openSpecModal_flash_normal) {
  1241 + updata['money'] = th.data.data.shop_price;
  1242 + updata['is_pd_normal'] = 1;
  1243 + } else {
  1244 + updata['money'] = th.data.prom_price;
  1245 + }
  1246 +
  1247 + }
  1248 +
  1249 +
  1250 + if (getApp().globalData.guide_id) {
  1251 + updata['guide_id'] = getApp().globalData.guide_id;
  1252 + updata['guide_type'] = 1;
  1253 + }
  1254 + if (getApp().globalData.groupchat_id) {
  1255 + updata['groupchat_id'] = getApp().globalData.groupchat_id;
  1256 + }
  1257 + getApp().request.put("/api/weshop/cartService/update", {
  1258 + data: updata,
  1259 + success: function (t) {
  1260 + getApp().my_warnning('加入购物车成功', 1, th, 450);
  1261 + var c_num = th.data.cartGoodsNum + th.data.goodsInputNum;
  1262 + th.setData({
  1263 + cartGoodsNum: c_num
  1264 + });
  1265 + th.closeSpecModal();
  1266 + }
  1267 + });
  1268 + }else{
  1269 + getApp().request.post("/api/weshop/cartService/save", {
  1270 + data: newd,
  1271 + success: function(t) {
  1272 + getApp().my_warnning('加入购物车成功', 1, th, 450);
  1273 + var c_num = th.data.cartGoodsNum + th.data.goodsInputNum;
  1274 + th.setData({
  1275 + cartGoodsNum: c_num
  1276 + });
  1277 + th.closeSpecModal();
  1278 + }
  1279 + });
  1280 +
  1281 + }
1265 } else { 1282 } else {
1266 getApp().request.post("/api/weshop/cartService/save", { 1283 getApp().request.post("/api/weshop/cartService/save", {
1267 data: newd, 1284 data: newd,
packageA/pages/goodsInfo/goodsInfo.wxml
@@ -602,7 +602,6 @@ @@ -602,7 +602,6 @@
602 <view class="shopping-cart cart-ico new_split pdh20"> 602 <view class="shopping-cart cart-ico new_split pdh20">
603 <navigator open-type="switchTab" url="/pages/cart/cart/cart" style="text-align: center"> 603 <navigator open-type="switchTab" url="/pages/cart/cart/cart" style="text-align: center">
604 <image class="sc-img" src="{{iurl}}/miniapp/images/shopping-cart.png"></image> 604 <image class="sc-img" src="{{iurl}}/miniapp/images/shopping-cart.png"></image>
605 - <view class="cart-num ellipsis-1"> {{cartGoodsNum}} </view>  
606 <view>购物车</view> 605 <view>购物车</view>
607 </navigator> 606 </navigator>
608 </view> 607 </view>
packageA/pages/profile/profile.js
@@ -1051,7 +1051,7 @@ Page({ @@ -1051,7 +1051,7 @@ Page({
1051 if (e.data.code == 0) { 1051 if (e.data.code == 0) {
1052 app.globalData.user_id = e.data.data.user_id; 1052 app.globalData.user_id = e.data.data.user_id;
1053 } else { 1053 } else {
1054 - return app.showWarning("授权登入失败!" + e.data.msg); 1054 + return ut.m_toast("授权登入失败!" + e.data.msg);
1055 } 1055 }
1056 getApp().globalData.login_back = 1; 1056 getApp().globalData.login_back = 1;
1057 wx.setStorageSync("userinfo", e.data.data); 1057 wx.setStorageSync("userinfo", e.data.data);
packageE/pages/cart/cart2/cart2.js
@@ -2708,6 +2708,9 @@ Page({ @@ -2708,6 +2708,9 @@ Page({
2708 item_map.monthlbtitle = get_data.monthlbtitle; 2708 item_map.monthlbtitle = get_data.monthlbtitle;
2709 } 2709 }
2710 2710
  2711 + //优惠促销新增的不包邮模板
  2712 + item_map.no_ex_id=rule.no_ex_id;
  2713 +
2711 //-- 单赠品和多赠品 -- 2714 //-- 单赠品和多赠品 --
2712 if (get_data.gift_id || parseInt(get_data.zp_mode) == 1) { 2715 if (get_data.gift_id || parseInt(get_data.zp_mode) == 1) {
2713 item_map.zp_by = rule.zp_by; 2716 item_map.zp_by = rule.zp_by;
@@ -2855,7 +2858,12 @@ Page({ @@ -2855,7 +2858,12 @@ Page({
2855 if (ord_goods[j].prom_type == 3 && ord_goods[j].prom_id == item_map.prom_id) { 2858 if (ord_goods[j].prom_type == 3 && ord_goods[j].prom_id == item_map.prom_id) {
2856 ord_goods[j].is_xz_yh = ord_goods[j].is_xz_yh ? ord_goods[j].is_xz_yh : item_map.is_xz_yh; 2859 ord_goods[j].is_xz_yh = ord_goods[j].is_xz_yh ? ord_goods[j].is_xz_yh : item_map.is_xz_yh;
2857 ord_goods[j].is_past = item_map.is_past; 2860 ord_goods[j].is_past = item_map.is_past;
2858 - if (ord_goods[j].is_gift) continue; //赠品不平摊 2861 +
  2862 + if (ord_goods[j].is_gift){
  2863 + //赠品要看赠品本身包不包邮
  2864 + if(!item_map.zp_by) ord_goods[j].is_past =0;
  2865 + continue; //赠品不平摊
  2866 + }
2859 2867
2860 // ord_goods[j].account_fir = th.item_map_get_goods(ord_goods[j].goods_id, item_map).account_fir; 2868 // ord_goods[j].account_fir = th.item_map_get_goods(ord_goods[j].goods_id, item_map).account_fir;
2861 // ord_goods[j].account_yu_fir = th.item_map_get_goods(ord_goods[j].goods_id, item_map).account_yu_fir; 2869 // ord_goods[j].account_yu_fir = th.item_map_get_goods(ord_goods[j].goods_id, item_map).account_yu_fir;
@@ -2883,6 +2891,38 @@ Page({ @@ -2883,6 +2891,38 @@ Page({
2883 if (fd_map_gd.account_yu != undefined) ord_goods[j].account_yu = fd_map_gd.account_yu; 2891 if (fd_map_gd.account_yu != undefined) ord_goods[j].account_yu = fd_map_gd.account_yu;
2884 } 2892 }
2885 2893
  2894 + //优惠促销包邮,但是又不包邮模板的时候
  2895 + if(ord_goods[j].is_past && item_map.no_ex_id>0){
  2896 +
  2897 + let by_mb=null;
  2898 + let by_mb_url="/api/weshop/areaFeemail/getAreaGoods";
  2899 + let by_mb_res= await getApp().request.promiseGet(by_mb_url, {
  2900 + data:{
  2901 + store_id:os.stoid,
  2902 + id:item_map.no_ex_id
  2903 + }
  2904 + })
  2905 +
  2906 + if(by_mb_res && by_mb_res.data.code==0 && by_mb_res.data.data && by_mb_res.data.data.length){
  2907 + by_mb=by_mb_res.data.data[0];
  2908 +
  2909 + //如果是不包邮区域的话
  2910 + if (by_mb.region_list && th.check_by_area(by_mb.region_list)) {
  2911 + ord_goods[j].is_past =0;
  2912 + }
  2913 + //如果是不包邮商品的时候
  2914 + else if (by_mb.goods_list) {
  2915 + var no_goods_arr = by_mb.goods_list.split(",");
  2916 + if (no_goods_arr.includes(ord_goods[j].goods_id+"")){
  2917 + ord_goods[j].is_past =0;
  2918 + }
  2919 + }
  2920 +
  2921 + }
  2922 +
  2923 + }
  2924 +
  2925 +
2886 } 2926 }
2887 } 2927 }
2888 } 2928 }
@@ -3581,7 +3621,7 @@ Page({ @@ -3581,7 +3621,7 @@ Page({
3581 //累积商品重量 每种商品的重量 * 数量 3621 //累积商品重量 每种商品的重量 * 数量
3582 goods_weight += item[j]['weight'] * item[j]['goods_num']; 3622 goods_weight += item[j]['weight'] * item[j]['goods_num'];
3583 3623
3584 - if (back_data && back_data.is_by_all && !back_data.no_free_goods) { 3624 + if (back_data && back_data.is_by_all && !back_data.no_free_goods && item[j].is_post_temp) {
3585 cut_good_weight += item[j]['weight'] * item[j]['goods_num']; 3625 cut_good_weight += item[j]['weight'] * item[j]['goods_num'];
3586 if (back_data.weight_free > 0) { 3626 if (back_data.weight_free > 0) {
3587 out_of_weight = (back_data.weight_free * 1000) - cut_good_weight; 3627 out_of_weight = (back_data.weight_free * 1000) - cut_good_weight;
packageE/pages/togoin/togoin.js
@@ -414,7 +414,13 @@ Page({ @@ -414,7 +414,13 @@ Page({
414 if (e.data.code == 0) { 414 if (e.data.code == 0) {
415 app.globalData.user_id = e.data.data.user_id; 415 app.globalData.user_id = e.data.data.user_id;
416 } else { 416 } else {
417 - return app.showWarning("授权登入失败!" + e.data.msg); 417 +
  418 + wx.showToast({
  419 + title: "授权登入失败!" + e.data.msg,
  420 + icon: 'none',
  421 + duration: 2000
  422 + });
  423 + return false;
418 } 424 }
419 getApp().globalData.login_back = 1; 425 getApp().globalData.login_back = 1;
420 wx.setStorageSync("userinfo", e.data.data); 426 wx.setStorageSync("userinfo", e.data.data);
packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo.js
@@ -72,30 +72,30 @@ Page({ @@ -72,30 +72,30 @@ Page({
72 openSpecModal: 0, 72 openSpecModal: 0,
73 73
74 sto_sele_name_1: '', 74 sto_sele_name_1: '',
75 - share_goods_img:'', //礼包的分享图  
76 - giftImageCover:null,  
77 - canvasHidden:true,  
78 - is_receive:0, 75 + share_goods_img: '', //礼包的分享图
  76 + giftImageCover: null,
  77 + canvasHidden: true,
  78 + is_receive: 0,
79 screenWidth: 0, 79 screenWidth: 0,
80 - monthgiftbag:{},  
81 - scene:"",  
82 - keyword:'', //门店搜索  
83 - sec_i:-1,//选中分类门店 下标 80 + monthgiftbag: {},
  81 + scene: "",
  82 + keyword: '', //门店搜索
  83 + sec_i: -1,//选中分类门店 下标
84 }, 84 },
85 onLoad: function (options) { 85 onLoad: function (options) {
86 //定义第一次进入 86 //定义第一次进入
87 - this.data.fir_in=1; 87 + this.data.fir_in = 1;
88 88
89 var th = this; 89 var th = this;
90 console.log('分享参数---'); 90 console.log('分享参数---');
91 console.log(options); 91 console.log(options);
92 if (options.lbId && !options.id) { 92 if (options.lbId && !options.id) {
93 - options.id=options.lbId  
94 - // options.lbId=options.id 93 + options.id = options.lbId
  94 + // options.lbId=options.id
95 } 95 }
96 if (options.id) { 96 if (options.id) {
97 - options.lbId=options.id  
98 - // options.lbId=options.id 97 + options.lbId = options.id
  98 + // options.lbId=options.id
99 } 99 }
100 100
101 101
@@ -105,18 +105,18 @@ Page({ @@ -105,18 +105,18 @@ Page({
105 getStorageID: a.stoid, 105 getStorageID: a.stoid,
106 }) 106 })
107 107
108 - if(!options.lbId && options.scene){ 108 + if (!options.lbId && options.scene) {
109 var gid_str = decodeURIComponent(options.scene); 109 var gid_str = decodeURIComponent(options.scene);
110 gid_str = gid_str.split("_"); 110 gid_str = gid_str.split("_");
111 - options.lbId=gid_str[0];  
112 - options.id=gid_str[0];  
113 - options.first_leader=gid_str[1];  
114 - options.isBuy=1; 111 + options.lbId = gid_str[0];
  112 + options.id = gid_str[0];
  113 + options.first_leader = gid_str[1];
  114 + options.isBuy = 1;
115 } 115 }
116 116
117 this.setData({ 117 this.setData({
118 params: options, 118 params: options,
119 - getGiftID:options.id 119 + getGiftID: options.id
120 }) 120 })
121 121
122 122
@@ -125,8 +125,8 @@ Page({ @@ -125,8 +125,8 @@ Page({
125 getGiftID: options.lbId, 125 getGiftID: options.lbId,
126 orderSn: options.orderSn, 126 orderSn: options.orderSn,
127 flag: options.flag, // 如果从商品详情页的促销处点击专享礼包跳转到此页,则flag为1 127 flag: options.flag, // 如果从商品详情页的促销处点击专享礼包跳转到此页,则flag为1
128 - record_list_id:options.record_list_id,  
129 - is_receive:options.is_receive 128 + record_list_id: options.record_list_id,
  129 + is_receive: options.is_receive
130 }) 130 })
131 if (options.lbId) th.data.lbId = options.lbId; 131 if (options.lbId) th.data.lbId = options.lbId;
132 //-- 获取分享人的ID -- 132 //-- 获取分享人的ID --
@@ -141,7 +141,7 @@ Page({ @@ -141,7 +141,7 @@ Page({
141 getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => { 141 getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
142 if (res.data.code == 0) { 142 if (res.data.code == 0) {
143 getApp().globalData.guide_id = res.data.data.id; 143 getApp().globalData.guide_id = res.data.data.id;
144 - getApp().globalData.guide_pick_id= res.data.data.pickup_id 144 + getApp().globalData.guide_pick_id = res.data.data.pickup_id
145 } 145 }
146 }) 146 })
147 } 147 }
@@ -150,7 +150,7 @@ Page({ @@ -150,7 +150,7 @@ Page({
150 150
151 151
152 getApp().getConfig(function (e) { 152 getApp().getConfig(function (e) {
153 - th.setData({sto_sele_name_1: e.store_name}) 153 + th.setData({ sto_sele_name_1: e.store_name })
154 }) 154 })
155 155
156 getApp().getConfig2(function (e) { 156 getApp().getConfig2(function (e) {
@@ -171,10 +171,10 @@ Page({ @@ -171,10 +171,10 @@ Page({
171 } 171 }
172 }); 172 });
173 173
174 - let monthgiftbag=wx.getStorageSync('monthgiftbag')  
175 - let monthgiftba_defpick=wx.getStorageSync('monthgiftba_defpick') 174 + let monthgiftbag = wx.getStorageSync('monthgiftbag')
  175 + let monthgiftba_defpick = wx.getStorageSync('monthgiftba_defpick')
176 var now = ut.gettimestamp(); 176 var now = ut.gettimestamp();
177 - var isStart=0; 177 + var isStart = 0;
178 // var str = res.data.data.starTime; 178 // var str = res.data.data.starTime;
179 // if (start < now) isStart = 1; 179 // if (start < now) isStart = 1;
180 // start = start / 1000; 180 // start = start / 1000;
@@ -188,32 +188,32 @@ Page({ @@ -188,32 +188,32 @@ Page({
188 // } 188 // }
189 189
190 // this.setData({ 190 // this.setData({
191 - // isStart,  
192 - // monthgiftbag,  
193 - // sele_g:monthgiftbag,  
194 - // def_pick_store:monthgiftba_defpick 191 + // isStart,
  192 + // monthgiftbag,
  193 + // sele_g:monthgiftbag,
  194 + // def_pick_store:monthgiftba_defpick
195 // }) 195 // })
196 - let scene=wx.getLaunchOptionsSync().scene;  
197 - if (scene==1154) { 196 + let scene = wx.getLaunchOptionsSync().scene;
  197 + if (scene == 1154) {
198 this.setData({ 198 this.setData({
199 - scene 199 + scene
200 }) 200 })
201 this.getList2() 201 this.getList2()
202 - } 202 + }
203 }, 203 },
204 init() { 204 init() {
205 205
206 - var th=this; 206 + var th = this;
207 //-- 检测一下有没有门店 -- 207 //-- 检测一下有没有门店 --
208 - th.check_guide(function (){  
209 - com.wait_for_store_config(th);  
210 - com.set_user_mo_store(th, os, function () {  
211 - if (th.data.sele_g.pickup_list && th.data.def_pick_store) {  
212 - com.check_def_pk(th);  
213 - }  
214 - });  
215 - com.get_sto(th, os);  
216 - }) 208 + th.check_guide(function () {
  209 + com.wait_for_store_config(th);
  210 + com.set_user_mo_store(th, os, function () {
  211 + if (th.data.sele_g.pickup_list && th.data.def_pick_store) {
  212 + com.check_def_pk(th);
  213 + }
  214 + });
  215 + com.get_sto(th, os);
  216 + })
217 // this.GetBuyGiftList(); 217 // this.GetBuyGiftList();
218 // if (this.data.flag == 1) { 218 // if (this.data.flag == 1) {
219 // this.getZxlbDetails(); 219 // this.getZxlbDetails();
@@ -227,201 +227,210 @@ Page({ @@ -227,201 +227,210 @@ Page({
227 // } 227 // }
228 228
229 }, 229 },
230 - logTab(){  
231 - wx.navigateTo({  
232 - url: '/packageE/pages/togoin/togoin',  
233 - }) 230 + logTab() {
  231 + wx.navigateTo({
  232 + url: '/packageE/pages/togoin/togoin',
  233 + })
234 }, 234 },
235 getListInfo: function (e) { 235 getListInfo: function (e) {
236 - var th = this;  
237 - getApp().request.get(`/api/weshop/marketing/marketingMonthgiftbagForm/get/${a.stoid}/${th.data.params.id}`, {  
238 - isShowLoading: true,  
239 - data: {  
240 - // store_id: a.stoid, //商家ID  
241 - // user_id: d.user_id, //用户ID  
242 - // page: 1,  
243 - // pageSize: 10,  
244 - // is_end:0,  
245 - // timetype:1,  
246 - // id:th.data.params.id  
247 - },  
248 - success: function (res) {  
249 - if (res.data.code == 0) {  
250 - // th.data.curpage++;  
251 - // var arr1 = th.data.wareCard;  
252 - let obj = res.data.data;  
253 - let monthgiftbag={  
254 - remark:obj.remark,  
255 - cover_img:obj.imageurl,  
256 - giftTitle:obj.act_name,  
257 - lbPrice:obj.oldPrice  
258 - }  
259 - let remark=monthgiftbag.remark.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block"')  
260 - monthgiftbag.remark=remark  
261 - th.setData({  
262 - monthgiftbag: monthgiftbag,  
263 - })  
264 - }else {  
265 - getApp().my_warnning("获取活动失败", 0, th); 236 + var th = this;
  237 + getApp().request.get(`/api/weshop/marketing/marketingMonthgiftbagForm/get/${a.stoid}/${th.data.params.id}`, {
  238 + isShowLoading: true,
  239 + data: {
  240 + // store_id: a.stoid, //商家ID
  241 + // user_id: d.user_id, //用户ID
  242 + // page: 1,
  243 + // pageSize: 10,
  244 + // is_end:0,
  245 + // timetype:1,
  246 + // id:th.data.params.id
  247 + },
  248 + success: function (res) {
  249 + if (res.data.code == 0) {
  250 + // th.data.curpage++;
  251 + // var arr1 = th.data.wareCard;
  252 + let obj = res.data.data;
  253 + let monthgiftbag = {
  254 + remark: obj.remark,
  255 + cover_img: obj.imageurl,
  256 + giftTitle: obj.act_name,
  257 + lbPrice: obj.oldPrice
  258 + }
  259 + let remark = monthgiftbag.remark.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block"')
  260 + monthgiftbag.remark = remark
  261 + th.setData({
  262 + monthgiftbag: monthgiftbag,
  263 + })
  264 +
  265 + th.get_lb_list();//获取从表
  266 +
  267 +
  268 + } else {
  269 + getApp().my_warnning("获取活动失败", 0, th);
  270 + }
  271 +
266 } 272 }
267 -  
268 - }  
269 - })  
270 - 273 + })
  274 +
271 }, 275 },
  276 +
272 getList: function (e) { 277 getList: function (e) {
273 - var th = this;  
274 - if (!d.user_id) {  
275 - th.getList2()  
276 - return  
277 - }  
278 - getApp().request.get('/api/weshop/marketing/marketingMonthgiftbagForm/page', {  
279 - isShowLoading: true,  
280 - data: {  
281 - store_id: a.stoid, //商家ID  
282 - user_id: d.user_id, //用户ID  
283 - page: 1,  
284 - pageSize: 10,  
285 - is_end:0,  
286 - timetype:1,  
287 - id:th.data.params.id  
288 - },  
289 - success: function (res) {  
290 - if (res.data.code == 0) {  
291 - th.data.curpage++;  
292 - // var arr1 = th.data.wareCard;  
293 - var arr2 = res.data.data.pageData;  
294 - for (let j = 0; j < arr2.length; j++) {  
295 - // arr2[j].starTime1=Date.parse(new Date(arr2[j].begindate.replace(/-/g, "/")))/1000  
296 - arr2[j].starTime1=arr2[j].begindate  
297 - arr2[j].starTime=i.formatTime(arr2[j].begindate, "yyyy-MM-dd hh:mm:ss");  
298 - arr2[j].endTime=i.formatTime(arr2[j].enddate, "yyyy-MM-dd hh:mm:ss");  
299 - arr2[j].giftPosPrice=arr2[j].oldPrice  
300 - arr2[j].payMoney=arr2[j].lbPrice  
301 - arr2[j].payIntegral=arr2[j].exchangeIntegral  
302 - arr2[j].giftQty=arr2[j].buynum  
303 - arr2[j].cover_img=arr2[j].imageurl  
304 - arr2[j].giftTitle=arr2[j].act_name  
305 - arr2[j].virtualsales=arr2[j].virtualSales  
306 - arr2[j].lbnum=arr2[j].lbNum  
307 -  
308 - }  
309 - if(arr2.length>0){  
310 - var monthgiftbag =arr2[0];  
311 - var ismore = 0;  
312 - // if (arr3.length == res.data.data.total) ismore = 1  
313 - var isStart=0;  
314 - if (monthgiftbag) {  
315 - var start = monthgiftbag.begindate;  
316 - let remark=monthgiftbag.remark.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block"')  
317 - monthgiftbag.remark=remark  
318 - var now = ut.gettimestamp();  
319 - if (start < now) isStart = 1;  
320 - }  
321 -  
322 -  
323 - th.setData({  
324 - isStart,  
325 - monthgiftbag: monthgiftbag,  
326 - sele_g: monthgiftbag,  
327 - default_color:monthgiftbag.bg_color  
328 - })  
329 - th.init()  
330 - }else{  
331 - wx.showModal({  
332 - title: '提示',  
333 - content:'会员身份不符,暂时无法参与',  
334 - showCancel:false,  
335 - success (res) {  
336 - if (res.confirm) {  
337 - console.log('用户点击确定')  
338 - wx.reLaunch({  
339 - url: '/pages/index/index/index'  
340 - })  
341 - } else if (res.cancel) {  
342 - console.log('用户点击取消')  
343 - } 278 + var th = this;
  279 + if (!d.user_id) {
  280 + th.getList2()
  281 + return
  282 + }
  283 + getApp().request.get('/api/weshop/marketing/marketingMonthgiftbagForm/page', {
  284 + isShowLoading: true,
  285 + data: {
  286 + store_id: a.stoid, //商家ID
  287 + user_id: d.user_id, //用户ID
  288 + page: 1,
  289 + pageSize: 10,
  290 + is_end: 0,
  291 + timetype: 1,
  292 + id: th.data.params.id
  293 + },
  294 + success: function (res) {
  295 + if (res.data.code == 0) {
  296 + th.data.curpage++;
  297 + // var arr1 = th.data.wareCard;
  298 + var arr2 = res.data.data.pageData;
  299 + for (let j = 0; j < arr2.length; j++) {
  300 + // arr2[j].starTime1=Date.parse(new Date(arr2[j].begindate.replace(/-/g, "/")))/1000
  301 + arr2[j].starTime1 = arr2[j].begindate
  302 + arr2[j].starTime = i.formatTime(arr2[j].begindate, "yyyy-MM-dd hh:mm:ss");
  303 + arr2[j].endTime = i.formatTime(arr2[j].enddate, "yyyy-MM-dd hh:mm:ss");
  304 + arr2[j].giftPosPrice = arr2[j].oldPrice
  305 + arr2[j].payMoney = arr2[j].lbPrice
  306 + arr2[j].payIntegral = arr2[j].exchangeIntegral
  307 + arr2[j].giftQty = arr2[j].buynum
  308 + arr2[j].cover_img = arr2[j].imageurl
  309 + arr2[j].giftTitle = arr2[j].act_name
  310 + arr2[j].virtualsales = arr2[j].virtualSales
  311 + arr2[j].lbnum = arr2[j].lbNum
  312 +
  313 + }
  314 + if (arr2.length > 0) {
  315 + var monthgiftbag = arr2[0];
  316 + var ismore = 0;
  317 + // if (arr3.length == res.data.data.total) ismore = 1
  318 + var isStart = 0;
  319 + if (monthgiftbag) {
  320 + var start = monthgiftbag.begindate;
  321 + let remark = monthgiftbag.remark.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block"')
  322 + monthgiftbag.remark = remark
  323 + var now = ut.gettimestamp();
  324 + if (start < now) isStart = 1;
  325 + }
  326 +
  327 +
  328 + th.setData({
  329 + isStart,
  330 + monthgiftbag: monthgiftbag,
  331 + sele_g: monthgiftbag,
  332 + default_color: monthgiftbag.bg_color
  333 + })
  334 + th.init()
  335 +
  336 + th.get_lb_list();//获取从表
  337 +
  338 + } else {
  339 + wx.showModal({
  340 + title: '提示',
  341 + content: '会员身份不符,暂时无法参与',
  342 + showCancel: false,
  343 + success(res) {
  344 + if (res.confirm) {
  345 + console.log('用户点击确定')
  346 + wx.reLaunch({
  347 + url: '/pages/index/index/index'
  348 + })
  349 + } else if (res.cancel) {
  350 + console.log('用户点击取消')
  351 + }
  352 + }
  353 + })
  354 +
  355 + // th.setData({
  356 + // qx_msg:'活动对象未符合,不能参与'
  357 + // })
  358 +
  359 + }
  360 + } else {
  361 + getApp().my_warnning("获取活动失败", 0, th);
344 } 362 }
345 - })  
346 -  
347 - // th.setData({  
348 - // qx_msg:'活动对象未符合,不能参与'  
349 - // })  
350 } 363 }
351 - } else {  
352 - getApp().my_warnning("获取活动失败", 0, th);  
353 - }  
354 - }  
355 - })  
356 - 364 + })
  365 +
357 }, 366 },
358 getList2: function (e) { 367 getList2: function (e) {
359 - var th = this;  
360 - getApp().request.get('/api/weshop/marketing/marketingMonthgiftbagForm/page', {  
361 - isShowLoading: true,  
362 - data: {  
363 - store_id: a.stoid, //商家ID  
364 - // user_id: d.user_id, //用户ID  
365 - page: 1,  
366 - pageSize: 10,  
367 - is_end:0,  
368 - timetype:1,  
369 - id:th.data.params.id  
370 - },  
371 - success: function (res) {  
372 - if (res.data.code == 0) {  
373 - th.data.curpage++;  
374 - // var arr1 = th.data.wareCard;  
375 - var arr2 = res.data.data.pageData;  
376 - for (let j = 0; j < arr2.length; j++) {  
377 - // arr2[j].starTime1=Date.parse(new Date(arr2[j].begindate.replace(/-/g, "/")))/1000  
378 - arr2[j].starTime1=arr2[j].begindate  
379 - arr2[j].starTime=i.formatTime(arr2[j].begindate, "yyyy-MM-dd hh:mm:ss");  
380 - arr2[j].endTime=i.formatTime(arr2[j].enddate, "yyyy-MM-dd hh:mm:ss");  
381 - arr2[j].giftPosPrice=arr2[j].oldPrice  
382 - arr2[j].payMoney=arr2[j].lbPrice  
383 - arr2[j].payIntegral=arr2[j].exchangeIntegral  
384 - arr2[j].giftQty=arr2[j].buynum  
385 - arr2[j].cover_img=arr2[j].imageurl  
386 - arr2[j].giftTitle=arr2[j].act_name  
387 - arr2[j].virtualsales=arr2[j].virtualSales  
388 - arr2[j].lbnum=arr2[j].lbNum  
389 - }  
390 - if(arr2.length>0){  
391 - var monthgiftbag =arr2[0];  
392 - var ismore = 0;  
393 - // if (arr3.length == res.data.data.total) ismore = 1  
394 - var isStart=0;  
395 - if (monthgiftbag) {  
396 - var start = monthgiftbag.begindate;  
397 - let remark=monthgiftbag.remark.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block"')  
398 - monthgiftbag.remark=remark  
399 - var now = ut.gettimestamp();  
400 - if (start < now) isStart = 1;  
401 - }  
402 -  
403 -  
404 - th.setData({  
405 - isStart,  
406 - monthgiftbag: monthgiftbag,  
407 - sele_g: monthgiftbag,  
408 - })  
409 - th.init() 368 + var th = this;
  369 + getApp().request.get('/api/weshop/marketing/marketingMonthgiftbagForm/page', {
  370 + isShowLoading: true,
  371 + data: {
  372 + store_id: a.stoid, //商家ID
  373 + // user_id: d.user_id, //用户ID
  374 + page: 1,
  375 + pageSize: 10,
  376 + is_end: 0,
  377 + timetype: 1,
  378 + id: th.data.params.id
  379 + },
  380 + success: function (res) {
  381 + if (res.data.code == 0) {
  382 + th.data.curpage++;
  383 + // var arr1 = th.data.wareCard;
  384 + var arr2 = res.data.data.pageData;
  385 + for (let j = 0; j < arr2.length; j++) {
  386 + // arr2[j].starTime1=Date.parse(new Date(arr2[j].begindate.replace(/-/g, "/")))/1000
  387 + arr2[j].starTime1 = arr2[j].begindate
  388 + arr2[j].starTime = i.formatTime(arr2[j].begindate, "yyyy-MM-dd hh:mm:ss");
  389 + arr2[j].endTime = i.formatTime(arr2[j].enddate, "yyyy-MM-dd hh:mm:ss");
  390 + arr2[j].giftPosPrice = arr2[j].oldPrice
  391 + arr2[j].payMoney = arr2[j].lbPrice
  392 + arr2[j].payIntegral = arr2[j].exchangeIntegral
  393 + arr2[j].giftQty = arr2[j].buynum
  394 + arr2[j].cover_img = arr2[j].imageurl
  395 + arr2[j].giftTitle = arr2[j].act_name
  396 + arr2[j].virtualsales = arr2[j].virtualSales
  397 + arr2[j].lbnum = arr2[j].lbNum
  398 + }
  399 + if (arr2.length > 0) {
  400 + var monthgiftbag = arr2[0];
  401 + var ismore = 0;
  402 + // if (arr3.length == res.data.data.total) ismore = 1
  403 + var isStart = 0;
  404 + if (monthgiftbag) {
  405 + var start = monthgiftbag.begindate;
  406 + let remark = monthgiftbag.remark.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block"')
  407 + monthgiftbag.remark = remark
  408 + var now = ut.gettimestamp();
  409 + if (start < now) isStart = 1;
  410 + }
  411 +
  412 +
  413 + th.setData({
  414 + isStart,
  415 + monthgiftbag: monthgiftbag,
  416 + sele_g: monthgiftbag,
  417 + })
  418 + th.init()
  419 + }
  420 + } else {
  421 + getApp().my_warnning("获取活动失败", 0, th);
  422 + }
410 } 423 }
411 - } else {  
412 - getApp().my_warnning("获取活动失败", 0, th);  
413 - }  
414 - }  
415 - })  
416 - 424 + })
  425 +
417 }, 426 },
418 427
419 onShow: function () { 428 onShow: function () {
420 - var th=this;  
421 - this.setData({submit:0}) 429 + var th = this;
  430 + this.setData({ submit: 0 })
422 431
423 - //res = res.data.data.result;  
424 - //if (!res) return false; 432 + //res = res.data.data.result;
  433 + //if (!res) return false;
425 this.setData({ 434 this.setData({
426 getUserID: d.user_id || 0, 435 getUserID: d.user_id || 0,
427 }); 436 });
@@ -434,19 +443,19 @@ Page({ @@ -434,19 +443,19 @@ Page({
434 getApp().goto('/packageE/pages/togoin/togoin'); 443 getApp().goto('/packageE/pages/togoin/togoin');
435 return false; 444 return false;
436 } 445 }
437 - 446 +
438 if (th.data.params && th.data.params.is_act) { 447 if (th.data.params && th.data.params.is_act) {
439 - this.getListInfo()  
440 - }else{  
441 - this.getList(); 448 + this.getListInfo()
  449 + } else {
  450 + this.getList();
442 } 451 }
443 }) 452 })
444 453
445 454
446 //判断是不是第一次进入 455 //判断是不是第一次进入
447 - if(this.data.fir_in){  
448 - this.data.fir_in=0;  
449 - }else { 456 + if (this.data.fir_in) {
  457 + this.data.fir_in = 0;
  458 + } else {
450 com.set_py_fir(); 459 com.set_py_fir();
451 460
452 setTimeout(() => { 461 setTimeout(() => {
@@ -463,60 +472,63 @@ Page({ @@ -463,60 +472,63 @@ Page({
463 }) 472 })
464 473
465 474
466 - if(th.data.back_ord){ 475 + if (th.data.back_ord) {
467 476
468 - var money=th.data.payMoney; 477 + var money = th.data.payMoney;
469 var bk_url = "/packageE/pages/user/monthgiftbag/payment/payment?money=" + money + "&order_sn=" + th.data.back_ord; 478 var bk_url = "/packageE/pages/user/monthgiftbag/payment/payment?money=" + money + "&order_sn=" + th.data.back_ord;
470 //-- 通联的第三方支付的返回优化 -- 479 //-- 通联的第三方支付的返回优化 --
471 - ut.is_pay_ok(th.data.back_ord,bk_url,"none",function (){  
472 - if(!th.data.back_ord) return false; 480 + ut.is_pay_ok(th.data.back_ord, bk_url, "none", function () {
  481 + if (!th.data.back_ord) return false;
473 getApp().request.promiseGet("/api/weshop/marketing/marketingMonthgiftbagRecord/page", 482 getApp().request.promiseGet("/api/weshop/marketing/marketingMonthgiftbagRecord/page",
474 - {data:{store_id:os.stoid,order_sn:th.data.back_ord,user_id:getApp().globalData.user_id}}).then(res=>{  
475 -  
476 - if(ut.ajax_ok(res)){  
477 - var item=res.data.data.pageData[0];  
478 - if(item.pay_state==1){  
479 - //支付支付,返回首页  
480 - ut.m_toast('支付成功');  
481 - th.data.back_ord=null;  
482 - setTimeout(()=>{  
483 - getApp().goto(bk_url);  
484 - },1000)  
485 -  
486 - }else{  
487 - //支付支付,返回首页  
488 - ut.m_toast('支付失败');  
489 - setTimeout(()=>{  
490 - getApp().goto("/pages/index/index/index");  
491 - },1000) 483 + { data: { store_id: os.stoid, order_sn: th.data.back_ord, user_id: getApp().globalData.user_id } }).then(res => {
  484 +
  485 + if (ut.ajax_ok(res)) {
  486 + var item = res.data.data.pageData[0];
  487 + if (item.pay_state == 1) {
  488 + //支付支付,返回首页
  489 + ut.m_toast('支付成功');
  490 + th.data.back_ord = null;
  491 + setTimeout(() => {
  492 + getApp().goto(bk_url);
  493 + }, 1000)
  494 +
  495 + } else {
  496 + //支付支付,返回首页
  497 + ut.m_toast('支付失败');
  498 + setTimeout(() => {
  499 + getApp().goto("/pages/index/index/index");
  500 + }, 1000)
  501 + }
492 } 502 }
493 - }  
494 - })  
495 - },null,null,1); 503 + })
  504 + }, null, null, 1);
496 505
497 - th.data.back_ord=null; 506 + th.data.back_ord = null;
498 } 507 }
499 508
500 509
501 }, 1000) 510 }, 1000)
502 } 511 }
503 512
  513 +
  514 +
  515 +
504 }, 516 },
505 GetBuyPrice: function (e) { 517 GetBuyPrice: function (e) {
506 var that = this.data; 518 var that = this.data;
507 var th = this; 519 var th = this;
508 - let scene=this.data.scene;  
509 - if (scene==1154) {  
510 - wx.navigateTo({  
511 - url: '/packageE/pages/togoin/togoin',  
512 - })  
513 - return 520 + let scene = this.data.scene;
  521 + if (scene == 1154) {
  522 + wx.navigateTo({
  523 + url: '/packageE/pages/togoin/togoin',
  524 + })
  525 + return
514 } 526 }
515 527
516 - if (!d || !d.user_id ) { 528 + if (!d || !d.user_id) {
517 getApp().my_warnning("请先登录", 0, th); 529 getApp().my_warnning("请先登录", 0, th);
518 return false; 530 return false;
519 - 531 +
520 } 532 }
521 //如果还没有开始的话 533 //如果还没有开始的话
522 if (th.data.isStart != 1) { 534 if (th.data.isStart != 1) {
@@ -525,14 +537,14 @@ Page({ @@ -525,14 +537,14 @@ Page({
525 } 537 }
526 538
527 this.data.payMoney = th.data.sele_g.payMoney; 539 this.data.payMoney = th.data.sele_g.payMoney;
528 - th.setData({buyType: 2}) 540 + th.setData({ buyType: 2 })
529 if (th.data.sele_g.is_pickup) { 541 if (th.data.sele_g.is_pickup) {
530 th.setData({ 542 th.setData({
531 openSpecModal: 1 543 openSpecModal: 1
532 }) 544 })
533 } else { 545 } else {
534 546
535 - if(this.data.submit) return false; 547 + if (this.data.submit) return false;
536 var my_confirm = th.selectComponent("#my_confirm"); //组件的id 548 var my_confirm = th.selectComponent("#my_confirm"); //组件的id
537 my_confirm.open( 549 my_confirm.open(
538 "是否确定购买该礼包", 550 "是否确定购买该礼包",
@@ -553,17 +565,17 @@ Page({ @@ -553,17 +565,17 @@ Page({
553 GetBuyIntegral: function (e) { 565 GetBuyIntegral: function (e) {
554 var that = this.data; 566 var that = this.data;
555 var th = this; 567 var th = this;
556 - let scene =this.data.scene;  
557 - if (scene==1154) {  
558 - wx.navigateTo({  
559 - url: '/packageE/pages/togoin/togoin',  
560 - })  
561 - return 568 + let scene = this.data.scene;
  569 + if (scene == 1154) {
  570 + wx.navigateTo({
  571 + url: '/packageE/pages/togoin/togoin',
  572 + })
  573 + return
562 } 574 }
563 - if (!d || !d.user_id ) { 575 + if (!d || !d.user_id) {
564 getApp().my_warnning("请先登录", 0, th); 576 getApp().my_warnning("请先登录", 0, th);
565 return false; 577 return false;
566 - 578 +
567 } 579 }
568 580
569 //如果还没有开始的话 581 //如果还没有开始的话
@@ -572,7 +584,7 @@ Page({ @@ -572,7 +584,7 @@ Page({
572 return false; 584 return false;
573 } 585 }
574 586
575 - th.setData({buyType: 1}); 587 + th.setData({ buyType: 1 });
576 if (th.data.sele_g.is_pickup) { 588 if (th.data.sele_g.is_pickup) {
577 th.setData({ 589 th.setData({
578 openSpecModal: 1 590 openSpecModal: 1
@@ -607,17 +619,17 @@ Page({ @@ -607,17 +619,17 @@ Page({
607 }, 619 },
608 success: function (res) { 620 success: function (res) {
609 if (res.data.code == 0) { 621 if (res.data.code == 0) {
610 - console.log('商品------++')  
611 - console.log(res) 622 + console.log('商品------++')
  623 + console.log(res)
612 th.setData({ 624 th.setData({
613 - giftImage: th.data.iurl + res.data.data.lbUrl,  
614 - giftImageCover: th.data.iurl + (th.data.params.cover_img ? th.data.params.cover_img: res.data.data.lbUrl), 625 + giftImage: th.data.iurl + res.data.data.lbUrl,
  626 + giftImageCover: th.data.iurl + (th.data.params.cover_img ? th.data.params.cover_img : res.data.data.lbUrl),
615 giftTitle: res.data.data.giftTitle, 627 giftTitle: res.data.data.giftTitle,
616 default_color: res.data.data.bgcolor 628 default_color: res.data.data.bgcolor
617 }) 629 })
618 630
619 if (res.data.data.iswarelbtype == 1) { 631 if (res.data.data.iswarelbtype == 1) {
620 - th.setData({iswarelbtype: 1}) 632 + th.setData({ iswarelbtype: 1 })
621 } 633 }
622 634
623 if (!res.data.data.giftRemark || res.data.data.giftRemark == '') { 635 if (!res.data.data.giftRemark || res.data.data.giftRemark == '') {
@@ -676,7 +688,7 @@ Page({ @@ -676,7 +688,7 @@ Page({
676 getApp().request.get("/api/weshop/pickup/get/" + os.stoid + "/" + res.data.data.pickup_id, { 688 getApp().request.get("/api/weshop/pickup/get/" + os.stoid + "/" + res.data.data.pickup_id, {
677 success: function (res) { 689 success: function (res) {
678 if (res.data.code == 0) { 690 if (res.data.code == 0) {
679 - th.setData({pick_up: res.data.data}); 691 + th.setData({ pick_up: res.data.data });
680 } 692 }
681 } 693 }
682 }); 694 });
@@ -693,26 +705,26 @@ Page({ @@ -693,26 +705,26 @@ Page({
693 705
694 }, 706 },
695 707
696 - check_guide(func){  
697 - var first_leader=this.data.first_leader;  
698 - if(!first_leader){ 708 + check_guide(func) {
  709 + var first_leader = this.data.first_leader;
  710 + if (!first_leader) {
699 func(); 711 func();
700 return false; 712 return false;
701 } 713 }
702 - if(this.data.is_geted_guide_pick){ 714 + if (this.data.is_geted_guide_pick) {
703 func(); 715 func();
704 return false; 716 return false;
705 } 717 }
706 - if(getApp().globalData.guide_pick_id){ 718 + if (getApp().globalData.guide_pick_id) {
707 func(); 719 func();
708 return false; 720 return false;
709 } 721 }
710 - var th=this; 722 + var th = this;
711 getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => { 723 getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
712 if (res.data.code == 0) { 724 if (res.data.code == 0) {
713 - getApp().globalData.guide_pick_id= res.data.data.pickup_id; 725 + getApp().globalData.guide_pick_id = res.data.data.pickup_id;
714 } 726 }
715 - th.data.is_geted_guide_pick=1; 727 + th.data.is_geted_guide_pick = 1;
716 func(); 728 func();
717 }) 729 })
718 }, 730 },
@@ -730,8 +742,8 @@ Page({ @@ -730,8 +742,8 @@ Page({
730 success: function success(res) { 742 success: function success(res) {
731 if (res.data.code == 0) { 743 if (res.data.code == 0) {
732 _this2.setData({ 744 _this2.setData({
733 - giftImage: th.iurl + res.data.data.lbUrl,  
734 - giftImageCover: th.iurl + (_this2.data.params.cover_img ? _this2.data.params.cover_img: res.data.data.lbUrl), 745 + giftImage: th.iurl + res.data.data.lbUrl,
  746 + giftImageCover: th.iurl + (_this2.data.params.cover_img ? _this2.data.params.cover_img : res.data.data.lbUrl),
735 // giftTitle: res.data.data.giftTitle, 747 // giftTitle: res.data.data.giftTitle,
736 giftTitle: res.data.data.lbTitle, 748 giftTitle: res.data.data.lbTitle,
737 default_color: res.data.data.bgcolor 749 default_color: res.data.data.bgcolor
@@ -774,7 +786,7 @@ Page({ @@ -774,7 +786,7 @@ Page({
774 if (!sele_g.is_pickup) return false; 786 if (!sele_g.is_pickup) return false;
775 787
776 //-- 检测一下有没有门店 -- 788 //-- 检测一下有没有门店 --
777 - _this2.check_guide(function (){ 789 + _this2.check_guide(function () {
778 com.wait_for_store_config(_this2); 790 com.wait_for_store_config(_this2);
779 com.set_user_mo_store(_this2, os, function () { 791 com.set_user_mo_store(_this2, os, function () {
780 if (sele_g.pickup_list && _this2.data.def_pick_store) { 792 if (sele_g.pickup_list && _this2.data.def_pick_store) {
@@ -807,7 +819,7 @@ Page({ @@ -807,7 +819,7 @@ Page({
807 if (res.data.code == 0) { 819 if (res.data.code == 0) {
808 th.setData({ 820 th.setData({
809 giftImage: th.data.iurl + res.data.data.lbUrl, 821 giftImage: th.data.iurl + res.data.data.lbUrl,
810 - giftImageCover: th.data.iurl + (th.data.params.cover_img ? th.data.params.cover_img: res.data.data.lbUrl), 822 + giftImageCover: th.data.iurl + (th.data.params.cover_img ? th.data.params.cover_img : res.data.data.lbUrl),
811 giftTitle: res.data.data.lbTitle, 823 giftTitle: res.data.data.lbTitle,
812 default_color: res.data.data.bgcolor 824 default_color: res.data.data.bgcolor
813 }) 825 })
@@ -951,7 +963,7 @@ Page({ @@ -951,7 +963,7 @@ Page({
951 onShareAppMessage: function (e) { 963 onShareAppMessage: function (e) {
952 getApp().globalData.no_clear = 1; 964 getApp().globalData.no_clear = 1;
953 965
954 - var ee=this; 966 + var ee = this;
955 var curPage = this; 967 var curPage = this;
956 var pagePath = curPage.route; //当前页面url 968 var pagePath = curPage.route; //当前页面url
957 if (pagePath.indexOf('/') != 0) { 969 if (pagePath.indexOf('/') != 0) {
@@ -959,7 +971,7 @@ Page({ @@ -959,7 +971,7 @@ Page({
959 } 971 }
960 972
961 973
962 - pagePath += "?isBuy=1" + "&id=" + this.data.sele_g.id + "&first_leader=" + this.data.getUserID; 974 + pagePath += "?isBuy=1" + "&id=" + this.data.sele_g.id + "&first_leader=" + this.data.getUserID;
963 console.log('分享路径'); 975 console.log('分享路径');
964 console.log(pagePath); 976 console.log(pagePath);
965 // if (this.data.isBuy == 0) { 977 // if (this.data.isBuy == 0) {
@@ -969,7 +981,7 @@ Page({ @@ -969,7 +981,7 @@ Page({
969 // } 981 // }
970 // console.log('pagePath', pagePath); 982 // console.log('pagePath', pagePath);
971 983
972 - var img =ee.data.iurl+(ee.data.sele_g.cover_img ? ee.data.sele_g.cover_img : ee.data.giftImage); 984 + var img = ee.data.iurl + (ee.data.sele_g.cover_img ? ee.data.sele_g.cover_img : ee.data.giftImage);
973 985
974 986
975 return { 987 return {
@@ -985,12 +997,12 @@ Page({ @@ -985,12 +997,12 @@ Page({
985 onShareTimeline() { 997 onShareTimeline() {
986 getApp().globalData.no_clear = 1; 998 getApp().globalData.no_clear = 1;
987 999
988 - var ee=this; 1000 + var ee = this;
989 var pagePath = "&isBuy=1" + "&id=" + this.data.sele_g.id + "&first_leader=" + this.data.getUserID; 1001 var pagePath = "&isBuy=1" + "&id=" + this.data.sele_g.id + "&first_leader=" + this.data.getUserID;
990 var user_id = getApp().globalData.user_id; 1002 var user_id = getApp().globalData.user_id;
991 if (!user_id) user_id = 0; 1003 if (!user_id) user_id = 0;
992 1004
993 - var img =ee.data.iurl+(ee.data.sele_g.cover_img ? ee.data.sele_g.cover_img : ee.data.giftImage); 1005 + var img = ee.data.iurl + (ee.data.sele_g.cover_img ? ee.data.sele_g.cover_img : ee.data.giftImage);
994 1006
995 return { 1007 return {
996 title: "礼包详情", 1008 title: "礼包详情",
@@ -1008,7 +1020,7 @@ Page({ @@ -1008,7 +1020,7 @@ Page({
1008 getApp().my_warnning("活动还没有开始", 0, th); 1020 getApp().my_warnning("活动还没有开始", 0, th);
1009 return false; 1021 return false;
1010 } 1022 }
1011 - th.setData({buyType: 3}); 1023 + th.setData({ buyType: 3 });
1012 if (th.data.sele_g.is_pickup) { 1024 if (th.data.sele_g.is_pickup) {
1013 th.setData({ 1025 th.setData({
1014 openSpecModal: 1 1026 openSpecModal: 1
@@ -1031,145 +1043,145 @@ Page({ @@ -1031,145 +1043,145 @@ Page({
1031 1043
1032 1044
1033 }, 1045 },
1034 - //获取搜索门店输入的值  
1035 - input_store: function(e) {  
1036 - this.setData({  
1037 - keyword: e.detail.value  
1038 - })  
1039 - },  
1040 - //搜索门店  
1041 - searchfn(){  
1042 - let choice_sort_store = this.data.choice_sort_store  
1043 - if (choice_sort_store==0) { //全局搜索  
1044 - let all_pick_list = this.data.all_pick_list  
1045 - let def_pickpu_list = this.data.def_pickpu_list  
1046 - let keyword = this.data.keyword  
1047 - if (keyword) {  
1048 - let arr=all_pick_list.filter( item =>{  
1049 - let i = item.pickup_name.indexOf(keyword)  
1050 - if (i > -1) {  
1051 - return true  
1052 - }else{  
1053 - return false  
1054 - }  
1055 - })  
1056 - if (arr && arr.length>0) {  
1057 - if(this.data.is_show_sto_cat==1){  
1058 - this.setData({  
1059 - def_pickpu_list:arr  
1060 - })  
1061 - }else{  
1062 - this.setData({  
1063 - only_pk:arr  
1064 - })  
1065 - }  
1066 - }else{  
1067 - wx.showToast({  
1068 - title: '没有搜索到门店',  
1069 - icon: 'none',  
1070 - duration: 2000  
1071 - })  
1072 - }  
1073 - }else{  
1074 - if (this.data.is_show_sto_cat==1) {  
1075 - this.setData({  
1076 - def_pickpu_list:all_pick_list.slice(0,10)  
1077 - })  
1078 - }else{  
1079 - this.setData({  
1080 - only_pk:all_pick_list  
1081 - })  
1082 - }  
1083 -  
1084 - }  
1085 - }else{ //分类下搜索  
1086 - let sec_i=this.data.sec_i  
1087 - let all_sto = this.data.all_sto  
1088 - let old_all_sto = this.data.old_all_sto  
1089 - if (!old_all_sto) { 1046 + //获取搜索门店输入的值
  1047 + input_store: function (e) {
1090 this.setData({ 1048 this.setData({
1091 - old_all_sto:JSON.parse(JSON.stringify(all_sto)) 1049 + keyword: e.detail.value
1092 }) 1050 })
1093 - }  
1094 - let sec_sto= this.data.sec_sto  
1095 - let sec_arr = this.data.old_all_sto[sec_i].s_arr  
1096 - let keyword = this.data.keyword  
1097 - let text='sec_sto.s_arr'  
1098 - if (keyword) {  
1099 - let arr=sec_arr.filter( item =>{  
1100 - let i = item.pickup_name.indexOf(keyword)  
1101 - if (i > -1) {  
1102 - return true  
1103 - }else{  
1104 - return false 1051 + },
  1052 + //搜索门店
  1053 + searchfn() {
  1054 + let choice_sort_store = this.data.choice_sort_store
  1055 + if (choice_sort_store == 0) { //全局搜索
  1056 + let all_pick_list = this.data.all_pick_list
  1057 + let def_pickpu_list = this.data.def_pickpu_list
  1058 + let keyword = this.data.keyword
  1059 + if (keyword) {
  1060 + let arr = all_pick_list.filter(item => {
  1061 + let i = item.pickup_name.indexOf(keyword)
  1062 + if (i > -1) {
  1063 + return true
  1064 + } else {
  1065 + return false
  1066 + }
  1067 + })
  1068 + if (arr && arr.length > 0) {
  1069 + if (this.data.is_show_sto_cat == 1) {
  1070 + this.setData({
  1071 + def_pickpu_list: arr
  1072 + })
  1073 + } else {
  1074 + this.setData({
  1075 + only_pk: arr
  1076 + })
  1077 + }
  1078 + } else {
  1079 + wx.showToast({
  1080 + title: '没有搜索到门店',
  1081 + icon: 'none',
  1082 + duration: 2000
  1083 + })
  1084 + }
  1085 + } else {
  1086 + if (this.data.is_show_sto_cat == 1) {
  1087 + this.setData({
  1088 + def_pickpu_list: all_pick_list.slice(0, 10)
  1089 + })
  1090 + } else {
  1091 + this.setData({
  1092 + only_pk: all_pick_list
  1093 + })
  1094 + }
  1095 +
1105 } 1096 }
1106 - })  
1107 - if (arr && arr.length>0) {  
1108 - this.setData({  
1109 - [text]:arr  
1110 - })  
1111 - }else{  
1112 - wx.showToast({  
1113 - title: '没有搜索到门店',  
1114 - icon: 'none',  
1115 - duration: 2000  
1116 - })  
1117 - }  
1118 - }else{  
1119 - if(this.data.old_all_sto){  
1120 - this.setData({  
1121 - [text]: this.data.old_all_sto[sec_i].s_arr  
1122 - })  
1123 - }else{  
1124 - this.setData({  
1125 - [text]: all_sto[sec_i].s_arr  
1126 - })  
1127 - } 1097 + } else { //分类下搜索
  1098 + let sec_i = this.data.sec_i
  1099 + let all_sto = this.data.all_sto
  1100 + let old_all_sto = this.data.old_all_sto
  1101 + if (!old_all_sto) {
  1102 + this.setData({
  1103 + old_all_sto: JSON.parse(JSON.stringify(all_sto))
  1104 + })
  1105 + }
  1106 + let sec_sto = this.data.sec_sto
  1107 + let sec_arr = this.data.old_all_sto[sec_i].s_arr
  1108 + let keyword = this.data.keyword
  1109 + let text = 'sec_sto.s_arr'
  1110 + if (keyword) {
  1111 + let arr = sec_arr.filter(item => {
  1112 + let i = item.pickup_name.indexOf(keyword)
  1113 + if (i > -1) {
  1114 + return true
  1115 + } else {
  1116 + return false
  1117 + }
  1118 + })
  1119 + if (arr && arr.length > 0) {
  1120 + this.setData({
  1121 + [text]: arr
  1122 + })
  1123 + } else {
  1124 + wx.showToast({
  1125 + title: '没有搜索到门店',
  1126 + icon: 'none',
  1127 + duration: 2000
  1128 + })
  1129 + }
  1130 + } else {
  1131 + if (this.data.old_all_sto) {
  1132 + this.setData({
  1133 + [text]: this.data.old_all_sto[sec_i].s_arr
  1134 + })
  1135 + } else {
  1136 + this.setData({
  1137 + [text]: all_sto[sec_i].s_arr
  1138 + })
  1139 + }
1128 1140
1129 - } 1141 + }
1130 1142
1131 1143
1132 - }  
1133 - },  
1134 -  
1135 - getGift(){  
1136 - var that=this;  
1137 -  
1138 - var json = {  
1139 - // "actId": '', //活动Id  
1140 - // "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销  
1141 - // "buyType":""+that.data.buyType, //1=积分兑换 2=余额购买  
1142 - // "giftBagId": id, //每月礼包主表id  
1143 - // "buyFrom": 2,  
1144 - "id":that.data.record_list_id,// "记录Id",  
1145 - "storeId": that.data.getStorageID, //商家Id  
1146 - "userId": that.data.getUserID, //用户ID  
1147 - }; 1144 + }
  1145 + },
  1146 +
  1147 + getGift() {
  1148 + var that = this;
  1149 +
  1150 + var json = {
  1151 + // "actId": '', //活动Id
  1152 + // "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销
  1153 + // "buyType":""+that.data.buyType, //1=积分兑换 2=余额购买
  1154 + // "giftBagId": id, //每月礼包主表id
  1155 + // "buyFrom": 2,
  1156 + "id": that.data.record_list_id,// "记录Id",
  1157 + "storeId": that.data.getStorageID, //商家Id
  1158 + "userId": that.data.getUserID, //用户ID
  1159 + };
1148 // var url ="/api/weshop/marketing/buy/receive/gift/record/insert"; 1160 // var url ="/api/weshop/marketing/buy/receive/gift/record/insert";
1149 // var url ="/api/weshop/marketing/marketingMonthgiftbagRecord/createOrder"; 1161 // var url ="/api/weshop/marketing/marketingMonthgiftbagRecord/createOrder";
1150 - var url ="/api/weshop/marketing/marketingMonthgiftbagRecord/recordReceive"; 1162 + var url = "/api/weshop/marketing/marketingMonthgiftbagRecord/recordReceive";
1151 getApp().request.json_post(url, json, 1163 getApp().request.json_post(url, json,
1152 function (res) { 1164 function (res) {
1153 - console.log('领取礼包');  
1154 - console.log(res); 1165 + console.log('领取礼包');
  1166 + console.log(res);
1155 if (res.data.code == 0 && res.data.data) { 1167 if (res.data.code == 0 && res.data.data) {
1156 - that.setData({  
1157 - is_receive:1  
1158 - })  
1159 - getApp().my_warnning("领取成功!", 1, that);  
1160 - that.closeSpecModal();  
1161 - setTimeout(()=>{  
1162 - wx.navigateBack({  
1163 - delta: 0, 1168 + that.setData({
  1169 + is_receive: 1
1164 }) 1170 })
1165 - },500) 1171 + getApp().my_warnning("领取成功!", 1, that);
  1172 + that.closeSpecModal();
  1173 + setTimeout(() => {
  1174 + wx.navigateBack({
  1175 + delta: 0,
  1176 + })
  1177 + }, 500)
1166 } else { 1178 } else {
1167 - that.setData({submit:0}) 1179 + that.setData({ submit: 0 })
1168 getApp().my_warnning(res.data.msg, 0, that); 1180 getApp().my_warnning(res.data.msg, 0, that);
1169 } 1181 }
1170 }, 1182 },
1171 function (res) { 1183 function (res) {
1172 - that.setData({submit:0}) 1184 + that.setData({ submit: 0 })
1173 } 1185 }
1174 ) 1186 )
1175 }, 1187 },
@@ -1189,7 +1201,7 @@ Page({ @@ -1189,7 +1201,7 @@ Page({
1189 // 选择门店 1201 // 选择门店
1190 choice_store: function (ee) { 1202 choice_store: function (ee) {
1191 this.setData({ 1203 this.setData({
1192 - keyword:'' 1204 + keyword: ''
1193 }) 1205 })
1194 1206
1195 //--先判断会员状态-- 1207 //--先判断会员状态--
@@ -1342,7 +1354,7 @@ Page({ @@ -1342,7 +1354,7 @@ Page({
1342 region_name: region_name, 1354 region_name: region_name,
1343 sort_store: 0, 1355 sort_store: 0,
1344 choice_sort_store: 1, 1356 choice_sort_store: 1,
1345 - sec_i:index, 1357 + sec_i: index,
1346 sec_sto: item, 1358 sec_sto: item,
1347 sec_pick_index: 0 1359 sec_pick_index: 0
1348 }); 1360 });
@@ -1368,7 +1380,7 @@ Page({ @@ -1368,7 +1380,7 @@ Page({
1368 if (th.data.is_show_sto_cat == 1) { 1380 if (th.data.is_show_sto_cat == 1) {
1369 item = th.data.def_pickpu_list[index]; 1381 item = th.data.def_pickpu_list[index];
1370 } else { 1382 } else {
1371 - item = th.data.only_pk?th.data.only_pk[index]:null; //当没有门店分类的时候 1383 + item = th.data.only_pk ? th.data.only_pk[index] : null; //当没有门店分类的时候
1372 } 1384 }
1373 1385
1374 } else { 1386 } else {
@@ -1376,7 +1388,7 @@ Page({ @@ -1376,7 +1388,7 @@ Page({
1376 item = th.data.sec_sto.s_arr[index]; 1388 item = th.data.sec_sto.s_arr[index];
1377 } 1389 }
1378 1390
1379 - if(!item) return false; 1391 + if (!item) return false;
1380 1392
1381 if (!th.data.sele_g) return false; 1393 if (!th.data.sele_g) return false;
1382 1394
@@ -1412,14 +1424,14 @@ Page({ @@ -1412,14 +1424,14 @@ Page({
1412 if (th.data.is_show_sto_cat == 1) { 1424 if (th.data.is_show_sto_cat == 1) {
1413 item = th.data.def_pickpu_list[index]; 1425 item = th.data.def_pickpu_list[index];
1414 } else { 1426 } else {
1415 - item = th.data.only_pk?th.data.only_pk[index]:null; //当没有门店分类的时候 1427 + item = th.data.only_pk ? th.data.only_pk[index] : null; //当没有门店分类的时候
1416 } 1428 }
1417 } else { 1429 } else {
1418 var index = th.data.sec_pick_index; 1430 var index = th.data.sec_pick_index;
1419 item = th.data.sec_sto.s_arr[index]; 1431 item = th.data.sec_sto.s_arr[index];
1420 } 1432 }
1421 1433
1422 - if(!item) return false; 1434 + if (!item) return false;
1423 1435
1424 th.setData({ 1436 th.setData({
1425 def_pick_store: item, 1437 def_pick_store: item,
@@ -1454,7 +1466,7 @@ Page({ @@ -1454,7 +1466,7 @@ Page({
1454 1466
1455 }, 1467 },
1456 closeSpecModal: function () { 1468 closeSpecModal: function () {
1457 - this.setData({openSpecModal: 0}); 1469 + this.setData({ openSpecModal: 0 });
1458 }, 1470 },
1459 1471
1460 buy_libao: function () { 1472 buy_libao: function () {
@@ -1496,10 +1508,10 @@ Page({ @@ -1496,10 +1508,10 @@ Page({
1496 // } 1508 // }
1497 1509
1498 if (this.data.share_hidden) { 1510 if (this.data.share_hidden) {
1499 - this.setData({share_hidden: false,}); 1511 + this.setData({ share_hidden: false, });
1500 } 1512 }
1501 1513
1502 - wx.showLoading({title: '生成中...',}) 1514 + wx.showLoading({ title: '生成中...', })
1503 var that = this, th = that; 1515 var that = this, th = that;
1504 //设置画板显示,才能开始绘图 1516 //设置画板显示,才能开始绘图
1505 that.setData({ 1517 that.setData({
@@ -1639,29 +1651,29 @@ Page({ @@ -1639,29 +1651,29 @@ Page({
1639 context.setFontSize(32 * unit); 1651 context.setFontSize(32 * unit);
1640 context.setFillStyle('#DE1117'); 1652 context.setFillStyle('#DE1117');
1641 1653
1642 - var price_txt="";  
1643 - if(price || giftIntegral){  
1644 - if(price){  
1645 - price_txt='¥' + price;  
1646 - if(giftIntegral){  
1647 - if(this.data.sele_g.money_type>0){  
1648 - price_txt+='+';  
1649 - }else{  
1650 - price_txt+='或';  
1651 - }  
1652 - }  
1653 - }  
1654 - if(giftIntegral) price_txt+=giftIntegral+'积分';  
1655 - }else{  
1656 - price_txt="免费领取"; 1654 + var price_txt = "";
  1655 + if (price || giftIntegral) {
  1656 + if (price) {
  1657 + price_txt = '¥' + price;
  1658 + if (giftIntegral) {
  1659 + if (this.data.sele_g.money_type > 0) {
  1660 + price_txt += '+';
  1661 + } else {
  1662 + price_txt += '或';
  1663 + }
  1664 + }
  1665 + }
  1666 + if (giftIntegral) price_txt += giftIntegral + '积分';
  1667 + } else {
  1668 + price_txt = "免费领取";
1657 } 1669 }
1658 1670
1659 context.fillText(price_txt, 54 * unit, 735 * unit); 1671 context.fillText(price_txt, 54 * unit, 735 * unit);
1660 1672
1661 1673
1662 - var wp= 62 * unit;  
1663 - var hp=765 * unit  
1664 - this.draw_pos_price(context,wp,hp,this.giftPosPrice,unit); 1674 + var wp = 62 * unit;
  1675 + var hp = 765 * unit
  1676 + this.draw_pos_price(context, wp, hp, this.giftPosPrice, unit);
1665 1677
1666 // 8.商品标题 1678 // 8.商品标题
1667 context.setFontSize(20 * unit); 1679 context.setFontSize(20 * unit);
@@ -1683,16 +1695,16 @@ Page({ @@ -1683,16 +1695,16 @@ Page({
1683 1695
1684 1696
1685 //---市场价划掉--- 1697 //---市场价划掉---
1686 - draw_pos_price(context,w,h,market_price,unit){ 1698 + draw_pos_price(context, w, h, market_price, unit) {
1687 1699
1688 - if(!this.is_retail_price) return false; 1700 + if (!this.is_retail_price) return false;
1689 1701
1690 context.setFillStyle("gray") 1702 context.setFillStyle("gray")
1691 context.setFontSize(22 * unit) 1703 context.setFontSize(22 * unit)
1692 var pri0 = "¥" + market_price.toFixed(2); 1704 var pri0 = "¥" + market_price.toFixed(2);
1693 context.fillText(pri0, w, h); 1705 context.fillText(pri0, w, h);
1694 1706
1695 - var c_h=h-6; 1707 + var c_h = h - 6;
1696 context.setStrokeStyle('gray'); 1708 context.setStrokeStyle('gray');
1697 context.setLineWidth(1 * unit); 1709 context.setLineWidth(1 * unit);
1698 context.moveTo(w - 5, c_h); 1710 context.moveTo(w - 5, c_h);
@@ -1708,7 +1720,7 @@ Page({ @@ -1708,7 +1720,7 @@ Page({
1708 tt(); 1720 tt();
1709 return false; 1721 return false;
1710 } 1722 }
1711 - var img_url =ee.data.iurl+(ee.data.sele_g.cover_img ? ee.data.sele_g.cover_img : ee.data.giftImage); 1723 + var img_url = ee.data.iurl + (ee.data.sele_g.cover_img ? ee.data.sele_g.cover_img : ee.data.giftImage);
1712 1724
1713 //获取商品是分享图信息 1725 //获取商品是分享图信息
1714 wx.getImageInfo({ 1726 wx.getImageInfo({
@@ -1721,8 +1733,8 @@ Page({ @@ -1721,8 +1733,8 @@ Page({
1721 fail: function (res) { 1733 fail: function (res) {
1722 //获取默认空白图 1734 //获取默认空白图
1723 wx.getImageInfo({ 1735 wx.getImageInfo({
1724 - src: ee.data.iurl+'/miniapp/images/default_g_img.gif',  
1725 - success: function(res) { 1736 + src: ee.data.iurl + '/miniapp/images/default_g_img.gif',
  1737 + success: function (res) {
1726 ee.data.share_goods_img = res.path; //分享的图片不能用网络的 1738 ee.data.share_goods_img = res.path; //分享的图片不能用网络的
1727 tt(); 1739 tt();
1728 } 1740 }
@@ -1742,13 +1754,39 @@ Page({ @@ -1742,13 +1754,39 @@ Page({
1742 }, 1754 },
1743 // 预览海报 1755 // 预览海报
1744 previewPoster() { 1756 previewPoster() {
1745 - getApp().globalData.no_clear=1; 1757 + getApp().globalData.no_clear = 1;
1746 wx.previewImage({ 1758 wx.previewImage({
1747 current: this.data.shareImgPath, // 当前显示图片的http链接 1759 current: this.data.shareImgPath, // 当前显示图片的http链接
1748 - urls: [this.data.shareImgPath] ,// 需要预览的图片http链接列表 1760 + urls: [this.data.shareImgPath],// 需要预览的图片http链接列表
1749 }); 1761 });
1750 }, 1762 },
1751 1763
1752 1764
  1765 + //-- 获取从表的信息 --
  1766 + get_lb_list() {
  1767 + let th = this;
  1768 + getApp().request.promiseGet("/api/weshop/marketing/marketingMonthgiftbagList/page", {
  1769 + data: {
  1770 + store_id:os.stoid,
  1771 + form_id:th.data.params.id,
  1772 + pageSize:50
  1773 + },
  1774 + }).then(res => {
  1775 + if(ut.ajax_ok(res)){
  1776 + th.setData({
  1777 + wareCard:res.data.data.pageData
  1778 + })
  1779 + }
  1780 + })
  1781 + },
  1782 +
  1783 +
  1784 + //不销毁界面跳转
  1785 + navigateTo: function (e) {
  1786 + var url = e.currentTarget.dataset.url;
  1787 + getApp().goto(url);
  1788 + }
  1789 +
  1790 +
1753 1791
1754 }); 1792 });
1755 \ No newline at end of file 1793 \ No newline at end of file
packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo.wxml
@@ -78,70 +78,41 @@ @@ -78,70 +78,41 @@
78 </view> --> 78 </view> -->
79 </view> 79 </view>
80 </view> 80 </view>
81 - <view class="box_ware data-v-3a5b7e36" wx:if="{{false}}"> 81 + <view class="box_ware data-v-3a5b7e36" >
82 <view class="box_ware_title data-v-3a5b7e36"> 82 <view class="box_ware_title data-v-3a5b7e36">
83 <text class="data-v-3a5b7e36">礼包内容</text> 83 <text class="data-v-3a5b7e36">礼包内容</text>
84 </view> 84 </view>
85 - <block wx:for="{{wareCard}}" wx:for-item="item" wx:for-index="index" wx:key="Id">  
86 - <view wx:if="{{item.couponName!=undefined}}" class="box_ware_box data-v-3a5b7e36">  
87 - <view class="box_ware_img data-v-3a5b7e36">  
88 - <block wx:if="{{item.lbType==1}}">  
89 - <image src="{{item.wareImage==''?iurl+'/miniapp/images/giftbag/gift01.png':iurl+item.wareImage}}" class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].wareImage"></image>  
90 - </block>  
91 - <block wx:if="{{item.lbType==2}}">  
92 - <image src="{{iurl+'/miniapp/images/giftbag/gift05.png'}}" class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].wareImage"></image>  
93 - </block>  
94 - <block wx:if="{{item.lbType==3}}">  
95 - <image src="{{iurl+'/miniapp/images/giftbag/gift02.png'}}" class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].wareImage"></image>  
96 - </block>  
97 - <block wx:if="{{item.lbType==4}}">  
98 - <image src="{{iurl+'/miniapp/images/giftbag/gift03.png'}}" class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].wareImage"></image>  
99 - </block>  
100 - <block wx:if="{{item.lbType==5}}">  
101 - <image src="{{iurl+'/miniapp/images/giftbag/gift04.png'}}" class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].wareImage"></image>  
102 - </block>  
103 - </view>  
104 - <view class="box_ware_item data-v-3a5b7e36">  
105 - <view class="box_ware_item_title data-v-3a5b7e36">  
106 - <text class="data-v-3a5b7e36">{{item.couponName}}</text>  
107 - </view>  
108 - <view class="box_ware_item_price data-v-3a5b7e36">  
109 - <text class="data-v-3a5b7e36"></text>  
110 - </view>  
111 - <view class="box_ware_item_qty data-v-3a5b7e36 flex">  
112 - <text class="data-v-3a5b7e36 ellipsis-1">  
113 - {{"数量:"+item.num}}  
114 - </text>  
115 - <block wx:if="{{isBuy==0 && !flag && item.lbType==1}}">  
116 - <text style="margin-left:10rpx" wx:if="{{item.useState}}">  
117 - 已核销  
118 - </text>  
119 - <text style="margin-left:10rpx" wx:else>  
120 - 未核销  
121 - </text>  
122 - </block>  
123 - </view>  
124 85
125 - <view class="box_ware_code data-v-3a5b7e36" wx:if="{{!flag}}">  
126 - <!-- <block wx:if="{{c_state==0}}"> --> 86 + <block wx:for="{{wareCard}}" wx:for-item="item" wx:for-index="index" >
  87 + <view bindtap="navigateTo"
  88 + data-url="/packageE/pages/user/monthgiftbag/giftpacklist/giftpacklist?only_show=1&lbId={{item.giftbagid}}&cover_img={{item.cover_img}}"
  89 + class="box_ware_box data-v-3a5b7e36">
  90 + <view class="box_ware_img data-v-3a5b7e36">
127 91
128 - <block wx:if="{{isBuy==0&item.lbType==1}}">  
129 - <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" lazy-load="true" bindtap="getcode" data-codeId="{{item.Id}}" class="data-v-3a5b7e36"></image>  
130 - </block> 92 + <image src="{{item.cover_img==''?iurl+'/miniapp/images/giftbag/gift01.png':iurl+item.cover_img}}" style="height: 150rpx; width: 150rpx;"
  93 + class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr2"
  94 + data-errorimg="wareCard[{{index}}].cover_img"></image>
131 95
132 - <block wx:if="{{isBuy==0&item.lbType==2}}">  
133 - <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" class="data-v-3a5b7e36" lazy-load="true" data-url="/packageD/pages/user/coupons/coupons" bindtap="goto"></image>  
134 - </block>  
135 - <block wx:if="{{isBuy==0&item.lbType==3}}">  
136 - <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" class="data-v-3a5b7e36" lazy-load="true" data-url="/pages/user/my_service/i_service" bindtap="goto"></image>  
137 - </block>  
138 - <block wx:if="{{isBuy==0&item.lbType>3}}">  
139 - <text class="data-v-3a5b7e36">奖励已发放</text>  
140 - </block> 96 + </view>
  97 + <view class="box_ware_item data-v-3a5b7e36">
  98 + <view class="box_ware_item_title data-v-3a5b7e36">
  99 + <view><text class="data-v-3a5b7e36">{{item.lbtitle}}</text></view>
  100 + </view>
  101 + <view class="box_ware_item_qty data-v-3a5b7e36 flex">
  102 + <text class="data-v-3a5b7e36 ellipsis-1" style="color:#797979">
  103 + {{"零售价:"+item.oldprice}}
  104 + </text>
  105 + </view>
  106 + <view class="box_ware_code data-v-3a5b7e36 fs34" >
  107 + <view class="month_btn flex fs26 ai-center jc-center">
  108 + <text>第{{index+1}}个月 ></text>
  109 + </view>
  110 + </view>
  111 +
  112 + </view>
141 </view> 113 </view>
142 - </view>  
143 - </view>  
144 - </block> 114 + </block>
  115 +
145 </view> 116 </view>
146 <view class="foot_box data-v-3a5b7e36"> 117 <view class="foot_box data-v-3a5b7e36">
147 <view class="foot_box_title data-v-3a5b7e36"> 118 <view class="foot_box_title data-v-3a5b7e36">
packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo.wxss
@@ -17,10 +17,10 @@ @@ -17,10 +17,10 @@
17 } 17 }
18 18
19 .box_title.data-v-3a5b7e36 { 19 .box_title.data-v-3a5b7e36 {
20 - margin: 10rpx 20rpx 20rpx 20rpx; 20 + margin: 18rpx 20rpx 20rpx 20rpx;
21 padding: 35rpx; 21 padding: 35rpx;
22 background-color: #fff; 22 background-color: #fff;
23 - border-radius: 40rpx; 23 + border-radius: 15rpx;
24 } 24 }
25 25
26 .top_title.data-v-3a5b7e36 { 26 .top_title.data-v-3a5b7e36 {
@@ -68,7 +68,7 @@ @@ -68,7 +68,7 @@
68 margin: 10rpx 20rpx 20rpx 20rpx; 68 margin: 10rpx 20rpx 20rpx 20rpx;
69 padding: 35rpx; 69 padding: 35rpx;
70 background-color: #fff; 70 background-color: #fff;
71 - border-radius: 40rpx; 71 + border-radius: 15rpx;
72 } 72 }
73 73
74 .box_ware_title.data-v-3a5b7e36 { 74 .box_ware_title.data-v-3a5b7e36 {
@@ -132,7 +132,7 @@ @@ -132,7 +132,7 @@
132 .box_ware_item_qty.data-v-3a5b7e36 { 132 .box_ware_item_qty.data-v-3a5b7e36 {
133 font-size: 22rpx; 133 font-size: 22rpx;
134 position: absolute; 134 position: absolute;
135 - bottom: 15rpx; 135 + bottom: 5rpx;
136 left: 0; 136 left: 0;
137 } 137 }
138 138
@@ -155,7 +155,7 @@ @@ -155,7 +155,7 @@
155 margin: 10rpx 20rpx 50rpx 20rpx; 155 margin: 10rpx 20rpx 50rpx 20rpx;
156 padding: 35rpx; 156 padding: 35rpx;
157 background-color: #fff; 157 background-color: #fff;
158 - border-radius: 40rpx; 158 + border-radius: 15rpx;
159 } 159 }
160 160
161 .foot_box_title.data-v-3a5b7e36 { 161 .foot_box_title.data-v-3a5b7e36 {
@@ -274,3 +274,8 @@ page.data-v-3a5b7e36 { @@ -274,3 +274,8 @@ page.data-v-3a5b7e36 {
274 padding-left: 30rpx; 274 padding-left: 30rpx;
275 } 275 }
276 276
  277 +.month_btn{
  278 + width: 165rpx;height: 54rpx;
  279 + background-color: #f85c97;
  280 + border-radius: 54rpx; color: #fff;
  281 +}
packageE/pages/user/monthgiftbag/giftpacklist/giftpacklist.js
@@ -73,9 +73,13 @@ Page({ @@ -73,9 +73,13 @@ Page({
73 share_goods_img:'', //礼包的分享图 73 share_goods_img:'', //礼包的分享图
74 giftImageCover:null, 74 giftImageCover:null,
75 canvasHidden:true, 75 canvasHidden:true,
76 - is_receive:1, //是否已经领取 76 + is_receive:0, //是否已经领取
77 screenWidth: 0, 77 screenWidth: 0,
78 islogin:false, 78 islogin:false,
  79 +
  80 +
  81 + record_list:null, //月包列表点击跳转过来的记录
  82 +
79 }, 83 },
80 onLoad: function (options) { 84 onLoad: function (options) {
81 85
@@ -126,13 +130,41 @@ Page({ @@ -126,13 +130,41 @@ Page({
126 } 130 }
127 131
128 132
  133 + let user_id= d.user_id || 0;
  134 + //判断是不是当前的, 同时未开始的也叫未领取
  135 + let is_cur_list=0;
  136 + if(options.record_list_id==options.cur_record_list_id){
  137 + is_cur_list=1;
  138 + }
  139 +
  140 + let recode_sn=options.recode_sn
  141 + let url="/api/weshop/marketing/marketingMonthgiftbagRecordList/pageUseMmonthgiftbagRecordList";
  142 + let rq={
  143 + store_id:os.stoid,
  144 + user_id:user_id,
  145 + order_sn:recode_sn,
  146 + id:options.record_list_id
  147 + }
  148 + getApp().request.promiseGet(url, {
  149 + data:rq
  150 + }).then(res => {
  151 + if(ut.ajax_ok(res)){
  152 + let ite=res.data.data.pageData[0]
  153 + th.setData({
  154 + record_list:ite,
  155 + is_receive:ite.is_receive //用RecordList的领取状态来确定data中is_receive
  156 + })
  157 + }
  158 + })
  159 +
  160 +
129 this.setData({ 161 this.setData({
130 isBuy: options.isBuy, 162 isBuy: options.isBuy,
131 getGiftID: options.lbId, 163 getGiftID: options.lbId,
132 orderSn: options.orderSn, 164 orderSn: options.orderSn,
133 flag: options.flag, // 如果从商品详情页的促销处点击专享礼包跳转到此页,则flag为1 165 flag: options.flag, // 如果从商品详情页的促销处点击专享礼包跳转到此页,则flag为1
134 record_list_id:options.record_list_id, 166 record_list_id:options.record_list_id,
135 - is_receive:options.is_receive 167 + is_cur_list:is_cur_list
136 }) 168 })
137 if (options.lbId) th.data.lbId = options.lbId; 169 if (options.lbId) th.data.lbId = options.lbId;
138 //-- 获取分享人的ID -- 170 //-- 获取分享人的ID --
packageE/pages/user/monthgiftbag/giftpacklist/giftpacklist.wxml
1 <com_top_nav title="礼包详情"></com_top_nav> 1 <com_top_nav title="礼包详情"></com_top_nav>
2 2
  3 +<wxs module="m_filter" src="../my_giftpackinfo/filter.wxs"></wxs>
  4 +
3 <view class="box data-v-3a5b7e36" style="background-color:{{default_color?default_color:'#e85f93'}}"> 5 <view class="box data-v-3a5b7e36" style="background-color:{{default_color?default_color:'#e85f93'}}">
4 <view class="box_top data-v-3a5b7e36"> 6 <view class="box_top data-v-3a5b7e36">
5 <image src="{{giftImage}}" class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr" data-errorimg="giftImage"></image> 7 <image src="{{giftImage}}" class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr" data-errorimg="giftImage"></image>
@@ -101,21 +103,25 @@ @@ -101,21 +103,25 @@
101 <view class="box_ware_item_title data-v-3a5b7e36"> 103 <view class="box_ware_item_title data-v-3a5b7e36">
102 <text class="data-v-3a5b7e36">{{item.couponName}}</text> 104 <text class="data-v-3a5b7e36">{{item.couponName}}</text>
103 </view> 105 </view>
104 - <view class="box_ware_item_price data-v-3a5b7e36"> 106 + <!-- <view class="box_ware_item_price data-v-3a5b7e36">
105 <text class="data-v-3a5b7e36"></text> 107 <text class="data-v-3a5b7e36"></text>
106 - </view> 108 + </view> -->
  109 +
  110 + <block wx:if="{{record_list.is_receive==1 && !flag && item.lbType==1 && !params.only_show}}">
  111 + <view class="sw_state_btn flex jc-center ai-center yhx" wx:if="{{item.useState}}">
  112 + 已核销
  113 + </view>
  114 + <view class="sw_state_btn flex jc-center ai-center red" wx:else>
  115 + 未核销
  116 + </view>
  117 + </block>
  118 +
  119 +
107 <view class="box_ware_item_qty data-v-3a5b7e36 flex"> 120 <view class="box_ware_item_qty data-v-3a5b7e36 flex">
108 <text class="data-v-3a5b7e36 ellipsis-1"> 121 <text class="data-v-3a5b7e36 ellipsis-1">
109 {{"数量:"+item.num}} 122 {{"数量:"+item.num}}
110 </text> 123 </text>
111 - <block wx:if="{{is_receive==1 && !flag && item.lbType==1}}">  
112 - <text style="margin-left:10rpx" wx:if="{{item.useState}}">  
113 - 已核销  
114 - </text>  
115 - <text style="margin-left:10rpx" wx:else>  
116 - 未核销  
117 - </text>  
118 - </block> 124 +
119 </view> 125 </view>
120 126
121 <view class="box_ware_code data-v-3a5b7e36" wx:if="{{!flag}}"> 127 <view class="box_ware_code data-v-3a5b7e36" wx:if="{{!flag}}">
@@ -151,10 +157,23 @@ @@ -151,10 +157,23 @@
151 157
152 <view class="foot_empty data-v-3a5b7e36"></view> 158 <view class="foot_empty data-v-3a5b7e36"></view>
153 159
154 - <block wx:if="{{flag != 1}}"> 160 + <block wx:if="{{flag != 1 && !params.only_show}}">
  161 +
  162 + <!-- 不是当月的礼包 -->
  163 + <block wx:if="{{!is_cur_list}}">
  164 + <view class="foot_button data-v-3a5b7e36">
  165 + <view class="foot_button_intalge data-v-3a5b7e36 {{m_filter.lb_type_color(record_list.lbstate)}} " >
  166 + <text wx:if="{{record_list.lbstate==1}}" class="data-v-3a5b7e36">未领取</text>
  167 + <text wx:if="{{record_list.lbstate==2}}" class="data-v-3a5b7e36">未核销</text>
  168 + <text wx:if="{{record_list.lbstate==3}}" class="data-v-3a5b7e36">部分核销</text>
  169 + <text wx:if="{{record_list.lbstate==4}}" class="data-v-3a5b7e36">已过期</text>
  170 + <text wx:if="{{record_list.lbstate==5}}" class="data-v-3a5b7e36">已全部核销</text>
  171 + </view>
  172 + </view>
  173 + </block>
155 174
156 <!-- 已经领取过的orderSn是有值的 --> 175 <!-- 已经领取过的orderSn是有值的 -->
157 - <block wx:if="{{isBuy==0 && orderSn}}"> 176 + <block wx:elif="{{isBuy==0 && orderSn}}">
158 <view class="foot_button data-v-3a5b7e36"> 177 <view class="foot_button data-v-3a5b7e36">
159 <block wx:if="{{is_lb!=1}}"> 178 <block wx:if="{{is_lb!=1}}">
160 <view class="foot_button_buy data-v-3a5b7e36 overdue"> 179 <view class="foot_button_buy data-v-3a5b7e36 overdue">
@@ -179,7 +198,7 @@ @@ -179,7 +198,7 @@
179 </block> 198 </block>
180 199
181 <!-- 没有订单号,说明要进来领取 --> 200 <!-- 没有订单号,说明要进来领取 -->
182 - <block wx:elif="{{isBuy==0 && giftTitle}}"> 201 + <block wx:elif="{{isBuy==0 && giftTitle && is_cur_list}}">
183 <block wx:if="{{isStart==1}}"> 202 <block wx:if="{{isStart==1}}">
184 <view class="foot_button data-v-3a5b7e36"> 203 <view class="foot_button data-v-3a5b7e36">
185 <!-- <block wx:if="{{giftPrice>0 && giftIntegral>0}}"> 204 <!-- <block wx:if="{{giftPrice>0 && giftIntegral>0}}">
packageE/pages/user/monthgiftbag/giftpacklist/giftpacklist.wxss
@@ -94,8 +94,8 @@ @@ -94,8 +94,8 @@
94 height: 190rpx; *//* background-color: rgba(138, 138, 138, 0.63); */ 94 height: 190rpx; *//* background-color: rgba(138, 138, 138, 0.63); */
95 border: 2rpx solid #fafaf9; 95 border: 2rpx solid #fafaf9;
96 border-radius: 4rpx; 96 border-radius: 4rpx;
97 - width: 120rpx;  
98 - height: 120rpx; 97 + width: 130rpx;
  98 + height: 130rpx;
99 background-color: #f8f8f8; 99 background-color: #f8f8f8;
100 } 100 }
101 101
@@ -113,6 +113,9 @@ @@ -113,6 +113,9 @@
113 -webkit-box-orient: vertical; 113 -webkit-box-orient: vertical;
114 -webkit-line-clamp: 2; 114 -webkit-line-clamp: 2;
115 overflow: hidden; 115 overflow: hidden;
  116 +
  117 + line-height: normal;
  118 +
116 } 119 }
117 120
118 .box_ware_count.data-v-3a5b7e36 { 121 .box_ware_count.data-v-3a5b7e36 {
@@ -132,7 +135,7 @@ @@ -132,7 +135,7 @@
132 .box_ware_item_qty.data-v-3a5b7e36 { 135 .box_ware_item_qty.data-v-3a5b7e36 {
133 font-size: 22rpx; 136 font-size: 22rpx;
134 position: absolute; 137 position: absolute;
135 - bottom: 15rpx; 138 + bottom: 0rpx;
136 left: 0; 139 left: 0;
137 } 140 }
138 141
@@ -251,3 +254,30 @@ page.data-v-3a5b7e36 { @@ -251,3 +254,30 @@ page.data-v-3a5b7e36 {
251 position: absolute; right:0; top: -10rpx; 254 position: absolute; right:0; top: -10rpx;
252 } 255 }
253 256
  257 +.sw_state_btn{
  258 + width: 115rpx; height: 34rpx;font-size: 23rpx;color: #fff;border-radius: 17rpx; margin-top: 10rpx;
  259 +}
  260 +
  261 +.sw_state_btn.red{
  262 + background-color: red;
  263 +}
  264 +.sw_state_btn.yhx{
  265 + background-color: #ffbb42;
  266 +}
  267 +
  268 +
  269 +.foot_button_intalge.data-v-3a5b7e36.no_rev {
  270 + background:#7ecef4
  271 +}
  272 +.foot_button_intalge.data-v-3a5b7e36.no_hx {
  273 + background:#ff0000
  274 +}
  275 +.foot_button_intalge.data-v-3a5b7e36.bf_hx {
  276 + background:#ffbb42
  277 +}
  278 +.foot_button_intalge.data-v-3a5b7e36.gq {
  279 + background:#898989
  280 +}
  281 +.foot_button_intalge.data-v-3a5b7e36.qb_hx {
  282 + background:#ffbb42; width: 150rpx;
  283 +}
254 \ No newline at end of file 284 \ No newline at end of file
packageE/pages/user/monthgiftbag/monthgiftbag.js
@@ -162,7 +162,6 @@ Page({ @@ -162,7 +162,6 @@ Page({
162 // arr2[j].lbnum=arr2[j].lbNum 162 // arr2[j].lbnum=arr2[j].lbNum
163 163
164 164
165 -  
166 if(!arr2[j].receive_ordersn){ 165 if(!arr2[j].receive_ordersn){
167 arr2[j].is_no_rev=1; 166 arr2[j].is_no_rev=1;
168 } 167 }
@@ -239,7 +238,13 @@ Page({ @@ -239,7 +238,13 @@ Page({
239 navigateTo: function (e) { 238 navigateTo: function (e) {
240 var th = this; 239 var th = this;
241 var url = e.currentTarget.dataset.url; 240 var url = e.currentTarget.dataset.url;
242 - let is_back = e.currentTarget.dataset.is_back 241 + let index =e.currentTarget.dataset.index;
  242 + let item=this.data.wareCard[index];
  243 +
  244 + var form_id = item.form_id;
  245 + let is_back = e.currentTarget.dataset.is_back;
  246 + let order_sn = item.order_sn;
  247 +
243 if (is_back==1) { 248 if (is_back==1) {
244 wx.showToast({ 249 wx.showToast({
245 title: '该礼包已退款', 250 title: '该礼包已退款',
@@ -247,7 +252,10 @@ Page({ @@ -247,7 +252,10 @@ Page({
247 duration: 2000 252 duration: 2000
248 }) 253 })
249 }else{ 254 }else{
  255 + //getApp().goto(url);
  256 + url="/packageE/pages/user/monthgiftbag/my_giftpackinfo/my_giftpackinfo?id="+form_id+"&order_sn="+order_sn;
250 getApp().goto(url); 257 getApp().goto(url);
  258 +
251 } 259 }
252 }, 260 },
253 //下拉事件 261 //下拉事件
packageE/pages/user/monthgiftbag/monthgiftbag.wxml
@@ -23,8 +23,11 @@ @@ -23,8 +23,11 @@
23 </view> 23 </view>
24 </view> 24 </view>
25 <block wx:for="{{wareCard}}" wx:for-item="item" wx:for-index="index" wx:key="index"> 25 <block wx:for="{{wareCard}}" wx:for-item="item" wx:for-index="index" wx:key="index">
  26 +
26 <view class="content_box"> 27 <view class="content_box">
27 - <view class="content_box_ware" bindtap="navigateTo" data-is_back="{{item.is_back}}" data-url="/packageE/pages/user/monthgiftbag/giftpacklist/giftpacklist?isBuy=0&lbId={{item.lbId}}&cover_img={{item.cover_img}}&orderSn={{item.receive_ordersn}}&record_list_id={{item.record_list_id}}&is_receive={{item.is_receive}}"> 28 + <view class="content_box_ware" bindtap="navigateTo" data-is_back="{{item.is_back}}"
  29 + data-index="{{index}}"
  30 + data-url="/packageE/pages/user/monthgiftbag/giftpacklist/giftpacklist?isBuy=0&lbId={{item.lbId}}&cover_img={{item.cover_img}}&orderSn={{item.receive_ordersn}}&record_list_id={{item.record_list_id}}&is_receive={{item.is_receive}}">
28 <view class="content_box_img"> 31 <view class="content_box_img">
29 <!-- <image src="{{$GetInfo.imgHttp+item.$orig.lbUrl}}"></image> --> 32 <!-- <image src="{{$GetInfo.imgHttp+item.$orig.lbUrl}}"></image> -->
30 <image wx:if="{{item.cover_img}}" src="{{iurl+item.cover_img}}" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].cover_img"></image> 33 <image wx:if="{{item.cover_img}}" src="{{iurl+item.cover_img}}" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].cover_img"></image>
@@ -104,6 +107,8 @@ @@ -104,6 +107,8 @@
104 </view> 107 </view>
105 </view> 108 </view>
106 <view wx:if="{{item.is_back !=1}}" class="content_box_button" bindtap="navigateTo" 109 <view wx:if="{{item.is_back !=1}}" class="content_box_button" bindtap="navigateTo"
  110 + data-index="{{index}}"
  111 + data-is_back="{{item.is_back}}"
107 data-url="/packageE/pages/user/monthgiftbag/giftpacklist/giftpacklist?isBuy=0&lbId={{item.lbId}}&cover_img={{item.cover_img}}&orderSn={{item.receive_ordersn}}&record_list_id={{item.record_list_id}}&is_receive={{item.is_receive}}"> 112 data-url="/packageE/pages/user/monthgiftbag/giftpacklist/giftpacklist?isBuy=0&lbId={{item.lbId}}&cover_img={{item.cover_img}}&orderSn={{item.receive_ordersn}}&record_list_id={{item.record_list_id}}&is_receive={{item.is_receive}}">
108 113
109 <button wx:if="{{item.is_detail || item.is_no_rev}}" class="white" style="margin-right:10rpx">查看详情</button> 114 <button wx:if="{{item.is_detail || item.is_no_rev}}" class="white" style="margin-right:10rpx">查看详情</button>
@@ -131,7 +136,7 @@ @@ -131,7 +136,7 @@
131 <button class="overdue">已领取</button> 136 <button class="overdue">已领取</button>
132 </block> 137 </block>
133 <!-- 未领取的 --> 138 <!-- 未领取的 -->
134 - <block wx:else> 139 + <block wx:elif="{{item.cur_giftid}}">
135 <button catchtap="getGift" data-index="{{index}}" data-record_list_id="{{item.record_list_id}}" data-id="{{item.lbId}}" >立即领取</button> 140 <button catchtap="getGift" data-index="{{index}}" data-record_list_id="{{item.record_list_id}}" data-id="{{item.lbId}}" >立即领取</button>
136 </block> 141 </block>
137 142
packageE/pages/user/monthgiftbag/my_giftpackinfo/filter.wxs 0 → 100644
  1 +function lb_type(ty){
  2 + switch(ty){
  3 + case 1: return '未领取';
  4 + case 2: return '未核销';
  5 + case 3: return '部分核销';
  6 + case 4: return '已过期';
  7 + case 5: return '已全部核销';
  8 + }
  9 +}
  10 +
  11 +
  12 +function lb_type_color(ty){
  13 + switch(ty){
  14 + case 1: return 'no_rev';
  15 + case 2: return 'no_hx';
  16 + case 3: return 'bf_hx';
  17 + case 4: return 'gq';
  18 + case 5: return 'qb_hx';
  19 + }
  20 +}
  21 +
  22 +
  23 +module.exports = {
  24 + lb_type: lb_type,
  25 + lb_type_color:lb_type_color
  26 +}
packageE/pages/user/monthgiftbag/my_giftpackinfo/my_giftpackinfo.js 0 → 100644
  1 +var e = getApp(),
  2 + a = e.globalData.setting,
  3 + os = a,
  4 + t = e.request,
  5 + d = e.globalData;
  6 +var ut = require("../../../../../utils/util.js");
  7 +var com = require("../public/buy_com.js");
  8 +const i = require("../../../../../utils/util.js");
  9 +
  10 +
  11 +Page({
  12 + data: {
  13 + url: a.url, //接口网址
  14 + iurl: a.imghost, //图片前缀网址
  15 + isBuy: 0,
  16 + getGiftID: '', //礼包id
  17 + giftImage: '',
  18 + giftTitle: '',
  19 + giftDate: '',
  20 + giftPrice: '',
  21 + giftIntegral: '',
  22 + giftPosPrice: '',
  23 + giftQty: '',
  24 + giftRemark: '',
  25 + giftType: '',
  26 + actTitle: '',
  27 + getUrl: '',
  28 + wareCard: [],
  29 + code: "", //核销码
  30 + c_state: "0", //判断是否已经使用, 0正常 1已使用 2已过期
  31 + is_lb: 0, //是否有礼包
  32 + default_color: null,
  33 + first_leader: e.globalData.first_leader || 0, // 推荐人ID
  34 +
  35 +
  36 + new_user: 0, //新用户
  37 +
  38 + sto_sele_name_1: '',
  39 + share_goods_img: '', //礼包的分享图
  40 + giftImageCover: null,
  41 + canvasHidden: true,
  42 + is_receive: 0,
  43 + screenWidth: 0,
  44 + monthgiftbag: {},
  45 + record: null,
  46 +
  47 + },
  48 +
  49 + onLoad: function (options) {
  50 + //定义第一次进入
  51 + this.data.fir_in = 1;
  52 + var th = this;
  53 +
  54 + var th = this;
  55 + this.setData({
  56 + getUserID: d.user_id,
  57 + getStorageID: a.stoid,
  58 + })
  59 +
  60 + if (!options.id && options.scene) {
  61 + var gid_str = decodeURIComponent(options.scene);
  62 + gid_str = gid_str.split("_");
  63 + options.id = gid_str[0];
  64 + options.first_leader = gid_str[1];
  65 + }
  66 +
  67 + this.setData({
  68 + params: options,
  69 + })
  70 +
  71 + //-- 获取分享人的ID --
  72 + var first_leader = options.first_leader || getApp().globalData.first_leader;
  73 + if (first_leader) {
  74 + this.setData({
  75 + first_leader,
  76 + })
  77 + //-- user_id代过来免登录 --
  78 + getApp().globalData.first_leader = first_leader;
  79 + //调用接口判断是不是会员
  80 + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
  81 + if (res.data.code == 0) {
  82 + getApp().globalData.guide_id = res.data.data.id;
  83 + getApp().globalData.guide_pick_id = res.data.data.pickup_id
  84 + }
  85 + })
  86 + }
  87 +
  88 + th.close();
  89 +
  90 + getApp().getConfig2(function (e) {
  91 + var json_d = JSON.parse(e.switch_list);
  92 + th.setData({
  93 + bconfig: e,
  94 + sys_switch: json_d,
  95 + is_retail_price: json_d.is_retail_price || 0
  96 + });
  97 + })
  98 + // com.get_sto(th,os)
  99 + //获取用户设备信息,屏幕宽度
  100 + wx.getSystemInfo({
  101 + success: res => {
  102 + th.setData({
  103 + screenWidth: res.screenWidth
  104 + })
  105 + }
  106 + });
  107 + },
  108 +
  109 + logTab() {
  110 + wx.navigateTo({
  111 + url: '/packageE/pages/togoin/togoin',
  112 + })
  113 + },
  114 +
  115 + getList2: async function (e) {
  116 + let th = this;
  117 + let user_id = getApp().globalData.user_id || 0;
  118 +
  119 +
  120 + await getApp().request.promiseGet("/api/weshop/marketing/marketingMonthgiftbagRecord/page", {
  121 + data: {
  122 + store_id: os.stoid,
  123 + user_id: user_id,
  124 + order_sn: this.data.params.order_sn,
  125 + isdetail: 1
  126 + }
  127 + }).then(res1 => {
  128 + if (ut.ajax_ok(res1)) {
  129 +
  130 +
  131 + var arr2 = res1.data.data.pageData;
  132 +
  133 + for (let j = 0; j < arr2.length; j++) {
  134 +
  135 + arr2[j].is_detail = 0;
  136 + if (arr2[j].detaillist) {
  137 + arr2[j].is_detail = 1;
  138 + } else {
  139 + continue;
  140 + }
  141 +
  142 +
  143 + arr2[j].lbType = 0;
  144 + if (arr2[j].detaillist.iswarelbtype) {
  145 + arr2[j].lbType = 1;
  146 + }
  147 + //---获取日期的时间戳---
  148 + var t_endtime = arr2[j].detaillist.endTime;
  149 + t_endtime = t_endtime.replace(/-/g, '/');
  150 + var t_date = new Date(t_endtime) / 1000;
  151 + var t_now = ut.gettimestamp();
  152 +
  153 + var t_starttime = arr2[j].detaillist.starTime;
  154 + t_starttime = t_starttime.replace(/-/g, '/');
  155 + var t_sdate = new Date(t_starttime) / 1000;
  156 +
  157 + arr2[j].c_state = 0
  158 + if (arr2[j].detaillist.goodsUseState)
  159 + arr2[j].c_state = 1
  160 + else if (t_date <= t_now)
  161 + arr2[j].c_state = 2
  162 + else if (t_sdate > t_now)
  163 + arr2[j].c_state = -1
  164 + }
  165 +
  166 + th.setData({
  167 + record: arr2[0]
  168 + })
  169 + }
  170 + })
  171 +
  172 +
  173 + getApp().request.get('/api/weshop/marketing/marketingMonthgiftbagForm/page', {
  174 + isShowLoading: true,
  175 + data: {
  176 + store_id: a.stoid, //商家ID
  177 + page: 1,
  178 + pageSize: 10,
  179 + id: th.data.params.id
  180 + },
  181 + success: function (res) {
  182 + if (res.data.code == 0) {
  183 +
  184 + // var arr1 = th.data.wareCard;
  185 + var arr2 = res.data.data.pageData;
  186 + for (let j = 0; j < arr2.length; j++) {
  187 + // arr2[j].starTime1=Date.parse(new Date(arr2[j].begindate.replace(/-/g, "/")))/1000
  188 + arr2[j].starTime1 = arr2[j].begindate
  189 + arr2[j].starTime = i.formatTime(arr2[j].begindate, "yyyy-MM-dd hh:mm:ss");
  190 + arr2[j].endTime = i.formatTime(arr2[j].enddate, "yyyy-MM-dd hh:mm:ss");
  191 + arr2[j].giftPosPrice = arr2[j].oldPrice
  192 + arr2[j].payMoney = arr2[j].lbPrice
  193 + arr2[j].payIntegral = arr2[j].exchangeIntegral
  194 + arr2[j].giftQty = arr2[j].buynum
  195 + arr2[j].cover_img = arr2[j].imageurl
  196 + arr2[j].giftTitle = arr2[j].act_name
  197 + arr2[j].virtualsales = arr2[j].virtualSales
  198 + arr2[j].lbnum = arr2[j].lbNum
  199 + }
  200 + if (arr2.length > 0) {
  201 + var monthgiftbag = arr2[0];
  202 + var ismore = 0;
  203 + // if (arr3.length == res.data.data.total) ismore = 1
  204 + var isStart = 0;
  205 + if (monthgiftbag) {
  206 + var start = monthgiftbag.begindate;
  207 + let remark = monthgiftbag.remark.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block"')
  208 + monthgiftbag.remark = remark
  209 + var now = ut.gettimestamp();
  210 + if (start < now) isStart = 1;
  211 + }
  212 +
  213 +
  214 + th.setData({
  215 + isStart,
  216 + monthgiftbag: monthgiftbag,
  217 + sele_g: monthgiftbag,
  218 + })
  219 +
  220 + //-- 获取每个月的内容 --
  221 + th.get_record_list();
  222 +
  223 + }
  224 + } else {
  225 + getApp().my_warnning("获取活动失败", 0, th);
  226 + }
  227 + }
  228 + })
  229 +
  230 + },
  231 +
  232 + onShow: function () {
  233 + var th = this;
  234 + this.setData({ submit: 0 })
  235 +
  236 + //res = res.data.data.result;
  237 + //if (!res) return false;
  238 + this.setData({
  239 + getUserID: d.user_id || 0,
  240 + });
  241 +
  242 + getApp().check_can_share(this);
  243 +
  244 + //--先判断会员状态--
  245 + var user_info = getApp().globalData.userInfo;
  246 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  247 + getApp().goto('/packageE/pages/togoin/togoin');
  248 + return false;
  249 + }
  250 +
  251 + this.getList2();
  252 +
  253 + },
  254 +
  255 + check_guide(func) {
  256 + var first_leader = this.data.first_leader;
  257 + if (!first_leader) {
  258 + func();
  259 + return false;
  260 + }
  261 + if (this.data.is_geted_guide_pick) {
  262 + func();
  263 + return false;
  264 + }
  265 + if (getApp().globalData.guide_pick_id) {
  266 + func();
  267 + return false;
  268 + }
  269 + var th = this;
  270 + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
  271 + if (res.data.code == 0) {
  272 + getApp().globalData.guide_pick_id = res.data.data.pickup_id;
  273 + }
  274 + th.data.is_geted_guide_pick = 1;
  275 + func();
  276 + })
  277 + },
  278 +
  279 +
  280 +
  281 + //显示核销码
  282 + code_show: function (e) {
  283 + var th = this;
  284 + //--获取成功的时候--
  285 + var no = th.data.code;
  286 + var qc_com = th.selectComponent("#qc_com"); //组件的id
  287 + var obj = {
  288 + val: no,
  289 + content: "请将二维码展示给核销员,收货更快捷"
  290 + };
  291 + qc_com.open(obj)
  292 + },
  293 +
  294 + //获取核销码
  295 + getcode: function (e) {
  296 + var th = this;
  297 + let codeId = e.currentTarget.dataset.codeid;
  298 + let orderSn = e.currentTarget.dataset.ordersn;
  299 + var json = {
  300 + "storeId": a.stoid,
  301 + "orderSn": orderSn,
  302 + }
  303 + if (codeId && codeId !== "") {
  304 + json.id = codeId
  305 + }
  306 + var data = JSON.stringify(json);
  307 + var url = th.data.url + "/api/weshop/marketing/gift/goods/verify/code/get"; //预约接口地址
  308 + getApp().request.json_post(url, json,
  309 + function (res) {
  310 + if (res.data.code == 0) {
  311 + th.setData({
  312 + code: res.data.data
  313 + })
  314 + th.code_show();
  315 + } else {
  316 + getApp().my_warnning(res.data.msg, 0, th);
  317 + }
  318 + },
  319 + function (res) {
  320 +
  321 + },
  322 + "put"
  323 + )
  324 +
  325 + },
  326 + //界面跳转
  327 + goto: function (e) {
  328 + var th = this;
  329 + var url = e.currentTarget.dataset.url;
  330 + getApp().goto(url);
  331 + },
  332 + //图片失败,默认图片
  333 + bind_bnerr2: function (e) {
  334 + var _errImg = e.target.dataset.errorimg;
  335 + var _errObj = {};
  336 + _errObj[_errImg] = "/miniapp/images/giftbag/gift01.png";
  337 + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
  338 + },
  339 +
  340 + //图片失败,默认图片
  341 + bind_bnerr: function (e) {
  342 + var _errImg = e.target.dataset.errorimg;
  343 + var _errObj = {};
  344 + _errObj[_errImg] = this.data.iurl + "miniapp/images/big_back.jpg";
  345 + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
  346 + //this.setData({ giftImage: this.data.iurl + "/miniapp/images/giftbag/gift01.png"});
  347 +
  348 + },
  349 +
  350 + //关闭导航
  351 + close: function () {
  352 + var th = this;
  353 + var nav_b = th.selectComponent("#nav_b"); //组件的id
  354 + nav_b.close_box();
  355 + nav_b.set_name("礼包", "/packageE/pages/user/monthgiftbag/monthgiftbag");
  356 + },
  357 +
  358 + //--- 分享设置 --
  359 + onShareAppMessage: function (e) {
  360 + getApp().globalData.no_clear = 1;
  361 +
  362 + var ee = this;
  363 + var curPage = this;
  364 + var pagePath = curPage.route; //当前页面url
  365 + if (pagePath.indexOf('/') != 0) {
  366 + pagePath = '/' + pagePath;
  367 + }
  368 +
  369 + pagePath += "?isBuy=1" + "&id=" + this.data.sele_g.id + "&first_leader=" + this.data.getUserID;
  370 + console.log('分享路径');
  371 + console.log(pagePath);
  372 + // if (this.data.isBuy == 0) {
  373 + // pagePath += "&orderSn=" + this.data.orderSn;
  374 + // } else {
  375 + // pagePath += "&lbId=" + this.data.getGiftID;
  376 + // }
  377 + // console.log('pagePath', pagePath);
  378 + var img = ee.data.iurl + (ee.data.sele_g.cover_img ? ee.data.sele_g.cover_img : ee.data.giftImage);
  379 +
  380 + return {
  381 + title: "礼包详情",
  382 + path: pagePath,
  383 + imageUrl: img,
  384 + }
  385 + },
  386 +
  387 + /**
  388 + * 用户分享朋友圈
  389 + */
  390 + onShareTimeline() {
  391 + getApp().globalData.no_clear = 1;
  392 +
  393 + var ee = this;
  394 + var pagePath = "&isBuy=1" + "&id=" + this.data.sele_g.id + "&first_leader=" + this.data.getUserID;
  395 + var user_id = getApp().globalData.user_id;
  396 + if (!user_id) user_id = 0;
  397 +
  398 + var img = ee.data.iurl + (ee.data.sele_g.cover_img ? ee.data.sele_g.cover_img : ee.data.giftImage);
  399 +
  400 + return {
  401 + title: "礼包详情",
  402 + query: 'first_leader=' + user_id + pagePath,
  403 + imageUrl: img,
  404 + }
  405 + },
  406 +
  407 + //--- 设置一下默认库存的数量 ----
  408 + set_def_storage(ee) {
  409 + var that = this, th = this;
  410 + that.data.fir_def_store = ee;
  411 +
  412 + that.setData({
  413 + def_pick_store: ee,
  414 + sto_sele_name: ee.pickup_name,
  415 + sto_sele_id: ee.pickup_id,
  416 + sto_sele_distr: ee.distr_type
  417 + })
  418 + },
  419 + // 选择门店
  420 + choice_store: function (ee) {
  421 + this.setData({
  422 + keyword: ''
  423 + })
  424 +
  425 + //--先判断会员状态--
  426 + var user_info = getApp().globalData.userInfo;
  427 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  428 + wx.navigateTo({
  429 + url: '/packageE/pages/togoin/togoin',
  430 + })
  431 + return false;
  432 + }
  433 +
  434 + var th = this;
  435 + var ind = ee.currentTarget.dataset.ind;
  436 + var bconfig = th.data.bconfig;
  437 +
  438 + //如果开启了,则不在选择门店
  439 + if (this.data.sys_switch.is_pricing_open_store && getApp().globalData.pk_store) {
  440 + return false;
  441 + }
  442 + // if (!th.data.only_pk && !th.data.def_pickpu_list) {
  443 + // getApp().confirmBox("门店库存不足", null, 25000, !1);
  444 + // return false;
  445 + // }
  446 +
  447 + if (th.data.only_pk && !th.data.only_pk.length) {
  448 + getApp().confirmBox("门店库存不足", null, 25000, !1);
  449 + return false;
  450 + }
  451 + if (th.data.def_pickpu_list && !th.data.def_pickpu_list.length) {
  452 + getApp().confirmBox("门店库存不足", null, 25000, !1);
  453 + return false;
  454 + }
  455 +
  456 +
  457 + if (bconfig && bconfig.is_sort_storage) {
  458 + wx.getLocation({
  459 + type: 'gcj02',
  460 + success: function (res) {
  461 +
  462 + th.data.lat = res.latitude;
  463 + th.data.lon = res.longitude;
  464 + th.data.is_get_local_ok = 1;
  465 + th.setData({
  466 + is_gps: 1
  467 + });
  468 + //th.onShow();
  469 + com.get_sto(th, os);
  470 + },
  471 + fail: function (res) {
  472 + //th.onShow();
  473 + th.data.is_get_local_ok = 1;
  474 + com.get_sto(th, os);
  475 + if (res.errCode == 2) {
  476 + th.setData({
  477 + is_gps: 0
  478 + });
  479 + if (th.data.is_gps == 0) {
  480 + getApp().confirmBox("请开启GPS定位", null, 25000, !1);
  481 + }
  482 + } else {
  483 + th.setData({
  484 + is_gps: "3"
  485 + });
  486 + }
  487 +
  488 + }
  489 + })
  490 + } else {
  491 + th.data.is_get_local_ok = 1;
  492 + com.get_sto(th, os);
  493 + }
  494 +
  495 + if (ind != undefined && ind != null) {
  496 + this.setData({
  497 + open_ind_store: ind,
  498 + store: 1,
  499 + openSpecModal: !1,
  500 + openSpecModal_pt: !1,
  501 + openSpecModal_flash_normal: !1,
  502 + })
  503 + } else {
  504 + this.setData({
  505 + store: 1,
  506 + openSpecModal: !1,
  507 + openSpecModal_pt: !1,
  508 + openSpecModal_flash_normal: !1
  509 +
  510 + })
  511 + }
  512 + },
  513 + //关闭选择门店
  514 + close_popup: function (e) {
  515 + var th = this;
  516 + this.setData({
  517 + store: 0,
  518 + choice_sort_store: 0,
  519 + sort_store: 0,
  520 + fir_pick_index: 0,
  521 + sec_pick_index: 0
  522 + })
  523 +
  524 + var openindstore = this.data.open_ind_store;
  525 + if (openindstore == 1) {
  526 + th.setData({
  527 + openSpecModal: !0,
  528 + openSpecModal_ind: openindstore,
  529 + });
  530 + } else if (openindstore == 2) {
  531 + th.setData({
  532 + openSpecModal: !0,
  533 + openSpecModal_ind: openindstore,
  534 + });
  535 + } else if (openindstore == 4) { //4就是拼团
  536 + th.setData({
  537 + openSpecModal_pt: 1, //打开拼团购买界面
  538 + store: 0, //关闭门店
  539 + choice_sort_store: 0, //关闭门店2级
  540 + sort_store: 0, //关闭门店2级
  541 + });
  542 + } else {
  543 + th.setData({
  544 + store: 0,
  545 + choice_sort_store: 0,
  546 + sort_store: 0
  547 + })
  548 + }
  549 +
  550 +
  551 + },
  552 +
  553 + //选择更多门店
  554 + more_store: function () {
  555 + this.setData({
  556 + sort_store: 1
  557 + });
  558 + },
  559 + // 返回按钮
  560 + returns: function () {
  561 + this.setData({
  562 + sort_store: 0,
  563 + choice_sort_store: 0
  564 + });
  565 + },
  566 + //---选择分类门店---
  567 + choice_sort_store: function (e) {
  568 + var index = e.currentTarget.dataset.index;
  569 + var region_name = e.currentTarget.dataset.region;
  570 + var item = this.data.all_sto[index];
  571 + this.setData({
  572 + region_name: region_name,
  573 + sort_store: 0,
  574 + choice_sort_store: 1,
  575 + sec_i: index,
  576 + sec_sto: item,
  577 + sec_pick_index: 0
  578 + });
  579 + },
  580 +
  581 + choose_for_store_fir: function (e) {
  582 + var index_c = e.currentTarget.dataset.ind;
  583 + var th = this;
  584 + th.setData({
  585 + fir_pick_index: index_c
  586 + })
  587 +
  588 + },
  589 +
  590 + //确定def_pick为选择的门店
  591 + sure_pick: function (e) {
  592 + var th = this;
  593 + var item = null;
  594 + var openindstore = th.data.open_ind_store;
  595 +
  596 + if (th.data.choice_sort_store == 0) {
  597 + var index = th.data.fir_pick_index;
  598 + if (th.data.is_show_sto_cat == 1) {
  599 + item = th.data.def_pickpu_list[index];
  600 + } else {
  601 + item = th.data.only_pk ? th.data.only_pk[index] : null; //当没有门店分类的时候
  602 + }
  603 +
  604 + } else {
  605 + var index = th.data.sec_pick_index;
  606 + item = th.data.sec_sto.s_arr[index];
  607 + }
  608 +
  609 + if (!item) return false;
  610 +
  611 + if (!th.data.sele_g) return false;
  612 +
  613 + th.setData({
  614 + def_pick_store: item,
  615 + sto_sele_name: item.pickup_name,
  616 + sto_sele_id: item.pickup_id,
  617 + sto_sele_distr: item.distr_type,
  618 + store: 0,
  619 + choice_sort_store: 0,
  620 + fir_pick_index: 0,
  621 + openSpecModal: !0,
  622 + });
  623 +
  624 +
  625 + },
  626 + //---点击二级之后的选择---
  627 + choose_for_store: function (e) {
  628 + var index_c = e.currentTarget.dataset.ind;
  629 + var th = this;
  630 + th.setData({
  631 + sec_pick_index: index_c,
  632 + fir_pick_index: index_c
  633 + })
  634 +
  635 + },
  636 + //把选择的门店设置成默认的门店def_pick
  637 + set_def_pick: function (e) {
  638 + var th = this;
  639 + var item = null;
  640 + if (th.data.choice_sort_store == 0) {
  641 + var index = th.data.fir_pick_index;
  642 + if (th.data.is_show_sto_cat == 1) {
  643 + item = th.data.def_pickpu_list[index];
  644 + } else {
  645 + item = th.data.only_pk ? th.data.only_pk[index] : null; //当没有门店分类的时候
  646 + }
  647 + } else {
  648 + var index = th.data.sec_pick_index;
  649 + item = th.data.sec_sto.s_arr[index];
  650 + }
  651 +
  652 + if (!item) return false;
  653 +
  654 + th.setData({
  655 + def_pick_store: item,
  656 + sto_sele_name: item.pickup_name,
  657 + sto_sele_id: item.pickup_id,
  658 + sto_sele_distr: item.distr_type,
  659 + store: 0,
  660 + choice_sort_store: 0,
  661 + openSpecModal: !0,
  662 + });
  663 +
  664 + var user_id = getApp().globalData.user_id;
  665 + var def_pickup_id = item.pickup_id;
  666 + getApp().request.put('/api/weshop/users/update', {
  667 + data: {
  668 + user_id: user_id,
  669 + def_pickup_id: def_pickup_id
  670 + },
  671 + success: function (res) {
  672 + if (res.data.code == 0) {
  673 + if (th.data.choice_sort_store == 0) th.setData({
  674 + fir_pick_index: 0
  675 + });
  676 + getApp().globalData.pk_store = item;
  677 + } else {
  678 + getApp().my_warnning("设置默认门店地址失败", 0, th)
  679 + }
  680 +
  681 + }
  682 + });
  683 +
  684 +
  685 + },
  686 + closeSpecModal: function () {
  687 + this.setData({ openSpecModal: 0 });
  688 + },
  689 +
  690 + buy_libao: function () {
  691 + com.buy_libao(this)
  692 + },
  693 +
  694 +
  695 + clickShare() {
  696 + // if (!getApp().globalData.user_id) {
  697 + // getApp().goto("/packageE/pages/togoin/togoin");
  698 + // return false;
  699 + // }
  700 + this.setData({
  701 + share_hidden: true,
  702 + });
  703 + },
  704 +
  705 + send() {
  706 + this.setData({
  707 + share_hidden: false,
  708 + });
  709 + },
  710 +
  711 + cancel() {
  712 + this.setData({
  713 + share_hidden: false,
  714 + });
  715 + },
  716 +
  717 +
  718 + //--定义的保存图片方法,分享团---
  719 + saveImageToPhotosAlbum: function () {
  720 + //--先判断会员状态--
  721 + // var user_info = getApp().globalData.userInfo;
  722 + // if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  723 + // //getApp().my_warnning("请先登录",0,this);
  724 + // wx.navigateTo({url: '/packageE/pages/togoin/togoin',})
  725 + // return false;
  726 + // }
  727 +
  728 + if (this.data.share_hidden) {
  729 + this.setData({ share_hidden: false, });
  730 + }
  731 +
  732 + wx.showLoading({ title: '生成中...', })
  733 + var that = this, th = that;
  734 + //设置画板显示,才能开始绘图
  735 + that.setData({
  736 + canvasHidden: false
  737 + })
  738 +
  739 + var app = getApp();
  740 + var unit = that.data.screenWidth / 750 * 1.35; //基础单位,
  741 + var scene = th.data.sele_g.id + "";
  742 +
  743 + var user_id = getApp().globalData.user_id ? getApp().globalData.user_id : 0;
  744 + if (user_id > 0) {
  745 + scene += "_" + user_id;
  746 + }
  747 + ///二微码
  748 + var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" +
  749 + os.stoid + "?sceneValue=" + scene + "&pageValue=packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo";
  750 +
  751 + // 读取文件成功则OK--
  752 + wx.getImageInfo({
  753 + src: path3,
  754 + success: function (res) {
  755 + th.get_goods_temp(function () {
  756 + var vpath = res.path;
  757 + var context = wx.createCanvasContext('share');
  758 + // let share_goods_img = th.params.cover_img
  759 + th.drawPoster(context, unit, th.data.share_goods_img, vpath, 0);
  760 +
  761 + //把画板内容绘制成图片,并回调 画板图片路径
  762 + context.draw(false, function () {
  763 + setTimeout(function () {
  764 + wx.canvasToTempFilePath({
  765 + x: 0,
  766 + y: 0,
  767 + width: 750,
  768 + height: 1217,
  769 + destWidth: 1.2 * 750 * 750 / that.data.screenWidth,
  770 + destHeight: 1.2 * 1217 * 750 / that.data.screenWidth,
  771 + canvasId: 'share',
  772 + success: function (res) {
  773 +
  774 + that.setData({
  775 + shareImgPath: res.tempFilePath,
  776 + canvasHidden: true
  777 + })
  778 +
  779 + if (!res.tempFilePath) {
  780 + wx.showModal({
  781 + title: '提示',
  782 + content: '图片绘制中,请稍后重试',
  783 + showCancel: false
  784 + })
  785 + return false;
  786 + }
  787 +
  788 + that.setData({
  789 + showPoster: true,
  790 + });
  791 + wx.hideLoading();
  792 + }
  793 + })
  794 + }, 800)
  795 +
  796 + });
  797 + })
  798 + },
  799 + fail: function (res) {
  800 + console.log(res);
  801 + wx.hideLoading();
  802 +
  803 + }
  804 + });
  805 + },
  806 +
  807 + //-- 小程序绘制海报 --
  808 + drawPoster(context, unit, img, vpath, type) {
  809 + // 1.灰色背景
  810 + context.setFillStyle('#f2f1f6');
  811 + context.rect(0, 0, 554 * unit, 899 * unit);
  812 + context.fill();
  813 +
  814 + // 2.商城名称
  815 + let shopName = this.data.sto_sele_name_1;
  816 + context.setTextAlign('center');
  817 + context.setFontSize(26 * unit);
  818 + context.setFillStyle('black');
  819 + context.fillText(shopName, 277 * unit, 60 * unit);
  820 +
  821 + // 3.推荐来源
  822 + let fromText = `来自${getApp().globalData.userInfo.nickname}的推荐`;
  823 + context.setTextAlign('center');
  824 + context.setFontSize(22 * unit);
  825 + context.setFillStyle('#96959a');
  826 + context.fillText(fromText, 277 * unit, 105 * unit);
  827 +
  828 + // 4.海报背景
  829 + context.setFillStyle('white');
  830 + context.fillRect(37 * unit, 157 * unit, 480 * unit, 673 * unit);
  831 +
  832 + // 5.商品图片
  833 + // 图片的x坐标
  834 + let bg_x = 37 * unit
  835 + // 图片的y坐标
  836 + let bg_y = 157 * unit
  837 + // 图片宽度
  838 + let bg_w = 480 * unit
  839 + // 图片高度
  840 + let bg_h = 474 * unit
  841 + // 图片圆角
  842 + let bg_r = 4
  843 + // 绘制海报背景图片圆角
  844 + context.save()
  845 + context.beginPath()
  846 + context.arc(bg_x + bg_r, bg_y + bg_r, bg_r, Math.PI, Math.PI * 1.5)
  847 + context.arc(bg_x + bg_w - bg_r, bg_y + bg_r, bg_r, Math.PI * 1.5, Math.PI * 2)
  848 + context.arc(bg_x + bg_w, bg_y + bg_h, bg_r, 0, Math.PI * 0.5)
  849 + context.arc(bg_x, bg_y + bg_h, 0, Math.PI * 0.5, Math.PI)
  850 + context.clip()
  851 + context.drawImage(img, bg_x, bg_y, bg_w, bg_h);
  852 + context.restore();
  853 +
  854 + // 6.强烈推荐
  855 + let src = '';
  856 + context.beginPath();
  857 + if (type == 0) { // 普通
  858 + src = '/images/share/q_tj.png';
  859 + context.drawImage(src, 54 * unit, 648 * unit, 85 * unit, 30 * unit);
  860 + context.setFontSize(16 * unit)
  861 + context.setFillStyle("white")
  862 + context.setTextAlign('left');
  863 + context.fillText('强烈推荐', 64 * unit, 668 * unit);
  864 + }
  865 +
  866 +
  867 + let price = this.data.sele_g.payMoney;
  868 + let giftIntegral = this.data.sele_g.payIntegral;
  869 + context.setFontSize(32 * unit);
  870 + context.setFillStyle('#DE1117');
  871 +
  872 + var price_txt = "";
  873 + if (price || giftIntegral) {
  874 + if (price) {
  875 + price_txt = '¥' + price;
  876 + if (giftIntegral) {
  877 + if (this.data.sele_g.money_type > 0) {
  878 + price_txt += '+';
  879 + } else {
  880 + price_txt += '或';
  881 + }
  882 + }
  883 + }
  884 + if (giftIntegral) price_txt += giftIntegral + '积分';
  885 + } else {
  886 + price_txt = "免费领取";
  887 + }
  888 +
  889 + context.fillText(price_txt, 54 * unit, 735 * unit);
  890 +
  891 +
  892 + var wp = 62 * unit;
  893 + var hp = 765 * unit
  894 + this.draw_pos_price(context, wp, hp, this.giftPosPrice, unit);
  895 +
  896 + // 8.商品标题
  897 + context.setFontSize(20 * unit);
  898 + context.setFillStyle('#898989');
  899 + getApp().draw_Text(context, this.data.giftTitle, 54 * unit, 800 * unit, 240 * unit, 280 * unit, unit, 1);
  900 +
  901 + // 9.小程序码
  902 + context.drawImage(vpath, 375 * unit, 660 * unit, 120 * unit, 120 * unit);
  903 + context.setFontSize(16 * unit);
  904 + context.setFillStyle('#777');
  905 + context.fillText('长按识别二维码', 378 * unit, 810 * unit);
  906 +
  907 + // 10.竖线
  908 + context.beginPath();
  909 + context.setFillStyle('#eee');
  910 + context.rect(354 * unit, 670 * unit, 1 * unit, 130 * unit);
  911 + context.fill();
  912 + },
  913 +
  914 +
  915 + //---市场价划掉---
  916 + draw_pos_price(context, w, h, market_price, unit) {
  917 +
  918 + if (!this.is_retail_price) return false;
  919 +
  920 + context.setFillStyle("gray")
  921 + context.setFontSize(22 * unit)
  922 + var pri0 = "¥" + market_price.toFixed(2);
  923 + context.fillText(pri0, w, h);
  924 +
  925 + var c_h = h - 6;
  926 + context.setStrokeStyle('gray');
  927 + context.setLineWidth(1 * unit);
  928 + context.moveTo(w - 5, c_h);
  929 + context.lineTo(w + ut.measureText(pri0, 22 * unit) + 5, c_h);
  930 + context.stroke();
  931 +
  932 + },
  933 +
  934 + //--获取商品图片的本地缓存,回调写法--
  935 + get_goods_temp: function (tt) {
  936 + var ee = this;
  937 + if (ee.data.share_goods_img) {
  938 + tt();
  939 + return false;
  940 + }
  941 + var img_url = ee.data.iurl + (ee.data.sele_g.cover_img ? ee.data.sele_g.cover_img : ee.data.giftImage);
  942 +
  943 + //获取商品是分享图信息
  944 + wx.getImageInfo({
  945 + src: img_url,
  946 + success: function (res) {
  947 + //res.path是网络图片的本地地址
  948 + ee.data.share_goods_img = res.path;
  949 + tt();
  950 + },
  951 + fail: function (res) {
  952 + //获取默认空白图
  953 + wx.getImageInfo({
  954 + src: ee.data.iurl + '/miniapp/images/default_g_img.gif',
  955 + success: function (res) {
  956 + ee.data.share_goods_img = res.path; //分享的图片不能用网络的
  957 + tt();
  958 + }
  959 + })
  960 + }
  961 + });
  962 + },
  963 +
  964 + closePoster() {
  965 + this.setData({
  966 + showPoster: false,
  967 + });
  968 + },
  969 + // 保存图片到手机
  970 + savePic() {
  971 + getApp().savePic(this);
  972 + },
  973 + // 预览海报
  974 + previewPoster() {
  975 + getApp().globalData.no_clear = 1;
  976 + wx.previewImage({
  977 + current: this.data.shareImgPath, // 当前显示图片的http链接
  978 + urls: [this.data.shareImgPath],// 需要预览的图片http链接列表
  979 + });
  980 + },
  981 +
  982 + //-- 获取每个月的内容 --
  983 + async get_record_list() {
  984 + let th = this;
  985 + let user_id = getApp().globalData.user_id || 0;
  986 + let url = "/api/weshop/marketing/marketingMonthgiftbagRecordList/pageUseMmonthgiftbagRecordList";
  987 + await getApp().request.promiseGet(url, {
  988 + data: {
  989 + store_id: os.stoid,
  990 + user_id: user_id,
  991 + order_sn: this.data.params.order_sn,
  992 + pageSize: 50
  993 + }
  994 + }).then(res => {
  995 + if (ut.ajax_ok(res)) {
  996 +
  997 + let list = res.data.data.pageData;
  998 + th.setData({
  999 + wareCard: list
  1000 + })
  1001 + }
  1002 +
  1003 + })
  1004 +
  1005 + },
  1006 +
  1007 + getGift(e) {
  1008 + var that = this;
  1009 + if (that.data.islogin) {
  1010 + return
  1011 + }
  1012 + that.setData({
  1013 + islogin: true
  1014 + })
  1015 +
  1016 + var record_list_id = e.currentTarget.dataset.record_list_id;
  1017 + var index = e.currentTarget.dataset.index;
  1018 +
  1019 + var json = {
  1020 + "id": record_list_id,// "记录Id",
  1021 + "storeId": that.data.getStorageID, //商家Id
  1022 + "userId": that.data.getUserID, //用户ID
  1023 + };
  1024 + // var url ="/api/weshop/marketing/buy/receive/gift/record/insert";
  1025 + // var url ="/api/weshop/marketing/marketingMonthgiftbagRecord/createOrder";
  1026 + var url = "/api/weshop/marketing/marketingMonthgiftbagRecord/recordReceive";
  1027 + getApp().request.json_post(url, json,
  1028 + function (res) {
  1029 + console.log('领取礼包');
  1030 + console.log(res);
  1031 + if (res.data.code == 0 && res.data.data) {
  1032 +
  1033 + var txt = "record.is_receive";
  1034 + that.setData({
  1035 + [txt]: 1
  1036 + })
  1037 + getApp().my_warnning("领取成功!", 1, that);
  1038 +
  1039 + that.get_record_list();//重新刷新每个月的数据
  1040 +
  1041 + } else {
  1042 + that.setData({ submit: 0 })
  1043 + getApp().my_warnning(res.data.msg, 0, that);
  1044 + }
  1045 + that.setData({
  1046 + islogin: false
  1047 + })
  1048 + },
  1049 + function (res) {
  1050 + that.setData({ submit: 0 })
  1051 + }
  1052 + )
  1053 + },
  1054 +
  1055 +
  1056 + //不销毁界面跳转
  1057 + navigateTo: function (e) {
  1058 +
  1059 + var url = e.currentTarget.dataset.url;
  1060 + let item = this.data.record;
  1061 + let is_back = item.is_back;
  1062 + let cur_record_list_id=item.record_list_id;
  1063 +
  1064 + //用于判断是不是当前的recode_list_id
  1065 + url+="&cur_record_list_id="+cur_record_list_id;
  1066 + url+="&recode_sn="+this.data.params.order_sn;
  1067 +
  1068 +
  1069 +
  1070 + if (is_back == 1) {
  1071 + wx.showToast({
  1072 + title: '该礼包已退款',
  1073 + icon: 'none',
  1074 + duration: 2000
  1075 + })
  1076 + } else {
  1077 + getApp().goto(url);
  1078 + }
  1079 + },
  1080 +
  1081 +
  1082 +
  1083 +
  1084 +
  1085 +});
0 \ No newline at end of file 1086 \ No newline at end of file
packageE/pages/user/monthgiftbag/my_giftpackinfo/my_giftpackinfo.json 0 → 100644
  1 +{
  2 + "navigationBarTitleText": "礼包详情",
  3 + "usingComponents": {
  4 + "warn": "/components/long_warn/long_warn",
  5 + "my_confirm": "/components/my_confirm/my_confirm",
  6 + "qr_code": "/components/qr_code/qr_code",
  7 + "nav_b": "/components/nav_b/nav_b",
  8 + "share": "/components/share/share",
  9 + "com_top_nav": "/components/com_top_nav/com_top_nav"
  10 + },
  11 + "navigationStyle": "custom"
  12 +}
0 \ No newline at end of file 13 \ No newline at end of file
packageE/pages/user/monthgiftbag/my_giftpackinfo/my_giftpackinfo.wxml 0 → 100644
  1 +<com_top_nav title="礼包详情"></com_top_nav>
  2 +<wxs module="filter" src="../../../../../utils/filter.wxs"></wxs>
  3 +<wxs module="m_filter" src="filter.wxs"></wxs>
  4 +
  5 +<view class="box data-v-3a5b7e36" style="background-color:{{default_color?default_color:'#e85f93'}};min-height: 100vh;">
  6 + <view class="box_top data-v-3a5b7e36">
  7 + <image src="{{iurl}}{{monthgiftbag.cover_img}}" class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr"
  8 + data-errorimg="giftImage"></image>
  9 + </view>
  10 + <view class="box_title data-v-3a5b7e36">
  11 + <!-- <view class="top_title data-v-3a5b7e36">
  12 + <text class="data-v-3a5b7e36 ellipsis-2" style="width:90%;">{{monthgiftbag.giftTitle}}</text>
  13 + <!-- 这个是分享按钮 -->
  14 + <!-- <view wx:if="{{c_state<2}}" class="xc-share-frame t-c" bindtap="clickShare">
  15 + <view class="iconfont icon-share fs40"></view>
  16 + <view class="fs22 c-7b">分享</view>
  17 + </view> -->
  18 + <!-- </view> -->
  19 +
  20 + <view class="fs30" style="font-weight: bolder;">{{monthgiftbag.act_name}}</view>
  21 +
  22 + <view class="top_price data-v-3a5b7e36">
  23 +
  24 + <block wx:if="{{monthgiftbag.money_type>0}}">
  25 + ¥<text class="fs46" style="font-weight: bolder;">{{monthgiftbag.lbPrice}}</text>+<text class="fs46" style="font-weight: bolder;">{{monthgiftbag.payIntegral}}</text> 积分
  26 + </block>
  27 + <block wx:else>
  28 + <block wx:if="{{monthgiftbag.lbPrice>0}}">
  29 + ¥<text style="font-weight: bolder;" class="fs46 data-v-3a5b7e36">{{monthgiftbag.lbPrice}}</text>
  30 + </block>
  31 + <block wx:if="{{monthgiftbag.lbPrice>0 && monthgiftbag.payIntegral>0}}">
  32 + <text class="fs46 data-v-3a5b7e36">/</text>
  33 + </block>
  34 + <block wx:if="{{monthgiftbag.payIntegral>0}}">
  35 + <text style="font-weight: bolder;" class="fs46 data-v-3a5b7e36">{{monthgiftbag.payIntegral}}</text> 积分
  36 + </block>
  37 + </block>
  38 + </view>
  39 +
  40 + <view class="top_foot data-v-3a5b7e36" wx:if="{{monthgiftbag.oldPrice}}">
  41 + <view class="top_foot_price data-v-3a5b7e36 no_line_x">
  42 + <text class="data-v-3a5b7e36"> {{monthgiftbag.oldPrice?'零售价:':''}}{{monthgiftbag.oldPrice+"元"}}</text>
  43 + </view>
  44 +
  45 + </view>
  46 + </view>
  47 + <view class="box_ware data-v-3a5b7e36">
  48 + <view class="box_ware_title data-v-3a5b7e36">
  49 + <text class="data-v-3a5b7e36">礼包内容</text>
  50 + </view>
  51 + <block wx:for="{{wareCard}}" wx:for-item="item" wx:for-index="index" wx:key="Id">
  52 + <view bindtap="navigateTo"
  53 + data-url="/packageE/pages/user/monthgiftbag/giftpacklist/giftpacklist?isBuy=0&lbId={{item.giftbagid}}&cover_img={{item.cover_img}}&orderSn={{item.receive_ordersn}}&record_list_id={{item.id}}"
  54 + class="box_ware_box data-v-3a5b7e36">
  55 + <view class="box_ware_img data-v-3a5b7e36">
  56 +
  57 + <image src="{{item.cover_img==''?iurl+'/miniapp/images/giftbag/gift01.png':iurl+item.cover_img}}"
  58 + class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr2"
  59 + data-errorimg="wareCard[{{index}}].cover_img"></image>
  60 +
  61 + </view>
  62 + <view class="box_ware_item data-v-3a5b7e36">
  63 + <view class="box_ware_item_title data-v-3a5b7e36">
  64 + <view><text class="data-v-3a5b7e36">{{item.lbtitle}}</text></view>
  65 +
  66 + </view>
  67 + <view wx:if="item.lbstate>0" class="sw_state_btn flex jc-center ai-center {{m_filter.lb_type_color(item.lbstate)}} ">
  68 + {{m_filter.lb_type(item.lbstate)}}
  69 + </view>
  70 +
  71 + <view class="box_ware_item_qty data-v-3a5b7e36 flex">
  72 + <text class="data-v-3a5b7e36 ellipsis-1" style="color:#797979">
  73 + {{"零售价:"+item.oldprice}}
  74 + </text>
  75 +
  76 + </view>
  77 +
  78 + <view class="box_ware_code data-v-3a5b7e36 fs34" >
  79 +
  80 + <view class="month_btn flex fs26 ai-center jc-center">
  81 + <text>{{item.giftbag_monthnum}} ></text>
  82 + </view>
  83 + </view>
  84 +
  85 + </view>
  86 + </view>
  87 + </block>
  88 + </view>
  89 +
  90 +
  91 + <view class="foot_box data-v-3a5b7e36">
  92 + <view class="foot_box_title data-v-3a5b7e36">
  93 + <text class="data-v-3a5b7e36">活动说明</text>
  94 + </view>
  95 + <view class="foot_box_remark data-v-3a5b7e36">
  96 + <rich-text nodes="{{monthgiftbag.remark}}" style="word-break:break-all;word-wrap:break-word"></rich-text>
  97 + </view>
  98 + </view>
  99 +
  100 + <view style="height: 20rpx;"></view>
  101 +
  102 +
  103 + <view class="foot_empty data-v-3a5b7e36"></view>
  104 +
  105 +
  106 +</view>
  107 +<!-- 引入提示组件 -->
  108 +<warn id="warn"></warn>
  109 +<my_confirm id="my_confirm"></my_confirm>
  110 +<!-- 弹出框扫描 -->
  111 +<qr_code id="qc_com"></qr_code>
  112 +<!-- 制作一个圆球导航 -->
  113 +<block wx:if="{{!params || (params && params.is_act !=1)}}">
  114 + <nav_b id="nav_b"></nav_b>
  115 +</block>
  116 +
  117 +<canvas canvas-id='share' style='width:750rpx;height:1217rpx;background-color:white;'
  118 + wx:if="{{!canvasHidden}}"></canvas>
  119 +<share id="share_button" bind:send="send" bind:cancel="cancel" bind:share_img="saveImageToPhotosAlbum"
  120 + wx:if="{{share_hidden}}"></share>
  121 +
  122 +<view wx:if="{{showPoster}}">
  123 + <view class="mask" catchtap="closePoster"></view>
  124 + <view class="poster-container">
  125 + <view class="poster-wrapper">
  126 + <view class="poster" bindtap="previewPoster">
  127 + <!-- <view class="poster" bindtap="previewImage"> -->
  128 + <image src="{{shareImgPath}}" class="poster-img"></image>
  129 + <view class="btn-close" catchtap="closePoster">
  130 + <text class="iconfont icon-close"></text>
  131 + </view>
  132 + </view>
  133 + <view class="btn-container">
  134 + <!-- <button class="btn-share" open-type="share" bindtap="">微信好友分享</button> -->
  135 + <button class="btn-share" bindtap="savePic">保存到相册</button>
  136 + </view>
  137 + </view>
  138 + </view>
  139 +</view>
0 \ No newline at end of file 140 \ No newline at end of file
packageE/pages/user/monthgiftbag/my_giftpackinfo/my_giftpackinfo.wxss 0 → 100644
  1 +@charset "UTF-8";
  2 +@import '../giftpackbuy/goodsInfo.wxss';
  3 +
  4 +page{
  5 + color: #313131;
  6 +}
  7 +
  8 +
  9 +.box.data-v-3a5b7e36 {
  10 + -webkit-align-content: center;
  11 + align-content: center;
  12 + background-color: #e85f93;
  13 +}
  14 +
  15 +.box_top.data-v-3a5b7e36 {
  16 + width: 100%;
  17 +}
  18 +
  19 +.box_top image.data-v-3a5b7e36 {
  20 + width: 100%;
  21 + max-height: 540rpx;
  22 +}
  23 +
  24 +.box_title.data-v-3a5b7e36 {
  25 + margin: 20rpx 20rpx 20rpx 20rpx;
  26 + padding:30rpx 34rpx 32rpx;
  27 + background-color: #fff;
  28 + border-radius: 10rpx;
  29 +}
  30 +
  31 +.top_title.data-v-3a5b7e36 {
  32 + font-size: 30rpx;
  33 + margin-bottom: 10rpx;
  34 + position: relative;
  35 +}
  36 +
  37 +.top_time.data-v-3a5b7e36 {
  38 + font-size: 27rpx;
  39 + color: #b9b5b5;
  40 +}
  41 +
  42 +.top_price.data-v-3a5b7e36 {
  43 + font-size: 30rpx;color: #d61b30;margin-bottom: 5rpx;
  44 + position: relative;line-height: normal;margin-top: 25rpx;
  45 +}
  46 +
  47 +.top_foot.data-v-3a5b7e36 {
  48 + display: -webkit-box;
  49 + display: -webkit-flex;
  50 + display: flex;
  51 +}
  52 +
  53 +.top_foot_price.data-v-3a5b7e36 {
  54 + font-size: 22rpx;
  55 + color: #b9b5b5;
  56 + width: 50%;
  57 + text-decoration: line-through;
  58 +}
  59 +
  60 +.top_foot_qty.data-v-3a5b7e36 {
  61 + font-size: 22rpx;
  62 + color: #b9b5b5;
  63 + width: 50%;
  64 + -webkit-align-content: flex-end;
  65 + align-content: flex-end;
  66 + text-align: right;
  67 +}
  68 +
  69 +.box_ware.data-v-3a5b7e36 {
  70 + margin: 10rpx 20rpx 20rpx 20rpx;
  71 + padding: 35rpx;
  72 + background-color: #fff;
  73 + border-radius:15rpx;
  74 +}
  75 +
  76 +.box_ware_title.data-v-3a5b7e36 {
  77 + font-size: 30rpx;
  78 + margin: 5rpx 0rpx 30rpx 0rpx;
  79 + font-weight: bolder;
  80 +}
  81 +
  82 +.box_ware_box.data-v-3a5b7e36 {
  83 + display: -webkit-box;
  84 + display: -webkit-flex;
  85 + display: flex;
  86 + margin: 10rpx 0rpx 25rpx 0rpx;
  87 +}
  88 +
  89 +/* .box_ware_img.data-v-3a5b7e36 {
  90 + width: 30%;
  91 + height: 180rpx;
  92 + border: #999999 solid 1rpx;
  93 +} */
  94 +
  95 +.box_ware_img image.data-v-3a5b7e36 {
  96 + /* width: 185rpx;
  97 + height: 190rpx; *//* background-color: rgba(138, 138, 138, 0.63); */
  98 + border: 2rpx solid #fafaf9;
  99 + border-radius: 4rpx;
  100 + width: 150rpx;
  101 + height: 150rpx;
  102 + background-color: #f8f8f8;
  103 +}
  104 +
  105 +.box_ware_item.data-v-3a5b7e36 {
  106 + width: 80%;
  107 + margin-left: 28rpx;
  108 + position: relative;
  109 +}
  110 +
  111 +.box_ware_item_title.data-v-3a5b7e36 {
  112 + font-size: 24rpx;
  113 + word-break: break-all;
  114 + text-overflow: ellipsis;
  115 + display: -webkit-box;
  116 + -webkit-box-orient: vertical;
  117 + -webkit-line-clamp: 2;
  118 + overflow: hidden;
  119 + line-height: 32rpx;
  120 +}
  121 +
  122 +.box_ware_count.data-v-3a5b7e36 {
  123 + display: -webkit-box;
  124 + display: -webkit-flex;
  125 + display: flex;
  126 +}
  127 +
  128 +.box_ware_item_price.data-v-3a5b7e36 {
  129 + font-size: 24rpx;
  130 + color: #b9b5b5;
  131 + position: absolute;
  132 + bottom: 60rpx;
  133 + left: 0;
  134 +}
  135 +
  136 +.box_ware_item_qty.data-v-3a5b7e36 {
  137 + font-size: 22rpx;
  138 + position: absolute;
  139 + bottom: 0rpx;
  140 + left: 0;
  141 +}
  142 +
  143 +.box_ware_code.data-v-3a5b7e36 {
  144 + position: absolute;
  145 + right: 0rpx;
  146 + bottom: 0rpx;
  147 +}
  148 +
  149 +.box_ware_code image.data-v-3a5b7e36 {
  150 + width: 50rpx;
  151 + height: 50rpx;
  152 +}
  153 +
  154 +.box_ware_code text.data-v-3a5b7e36 {
  155 + font-size: 20rpx;
  156 +}
  157 +
  158 +.foot_box.data-v-3a5b7e36 {
  159 + margin: 10rpx 20rpx 50rpx 20rpx;
  160 + padding: 35rpx;
  161 + background-color: #fff;
  162 + border-radius: 16rpx;
  163 +}
  164 +
  165 +.foot_box_title.data-v-3a5b7e36 {
  166 + font-size: 30rpx;
  167 + margin-bottom: 30rpx;
  168 + font-weight: bolder; color: #313131;
  169 +}
  170 +
  171 +.foot_box_remark.data-v-3a5b7e36 {
  172 + font-size: 27rpx;
  173 + line-height: 40rpx;
  174 +}
  175 +
  176 +.foot_empty.data-v-3a5b7e36 {
  177 + height: 90rpx;
  178 +}
  179 +
  180 +.foot_button.data-v-3a5b7e36 {
  181 + display: -webkit-box;
  182 + display: -webkit-flex;
  183 + display: flex;
  184 + margin: 20rpx 0rpx 0rpx 0rpx;
  185 + padding: 34rpx 0rpx 41rpx;
  186 + background: #fff;
  187 + text-align: center;
  188 + -webkit-box-pack: center;
  189 + -webkit-justify-content: center;
  190 + justify-content: center;
  191 + position: fixed;
  192 + bottom: 0;
  193 + left: 0;
  194 + width: 100%;
  195 +}
  196 +
  197 +.foot_button_left.data-v-3a5b7e36 {
  198 + background: #e4010c;
  199 + color: #fff;
  200 + width: 250rpx;
  201 + height: 70rpx;
  202 + font-size: 28rpx;
  203 + line-height: 70rpx;
  204 + border-radius: 15rpx;
  205 + margin-right: 20rpx;
  206 +}
  207 +
  208 +.foot_button_right.data-v-3a5b7e36 {
  209 + background: #ffbb42;
  210 + color: #fff;
  211 + width: 250rpx;
  212 + height: 70rpx;
  213 + font-size: 28rpx;
  214 + line-height: 70rpx;
  215 + border-radius: 40rpx;
  216 +}
  217 +
  218 +.foot_button_buy.data-v-3a5b7e36 {
  219 + background: #e4010c;
  220 + color: #fff;
  221 + width: 400rpx;
  222 + height: 70rpx;
  223 + font-size: 28rpx;
  224 + line-height: 70rpx;
  225 + border-radius: 40rpx;
  226 +}
  227 +
  228 +.foot_button_intalge.data-v-3a5b7e36 {
  229 + background: #ffbb42;
  230 + color: #fff;
  231 + width: 420rpx;
  232 + height: 70rpx;
  233 + font-size: 26rpx;
  234 +
  235 + border-radius: 40rpx;
  236 + display: flex;
  237 + align-items: center;
  238 + justify-content: center;
  239 + font-weight: bolder;
  240 +}
  241 +
  242 +page.data-v-3a5b7e36 {
  243 + background-color: #e85f93;
  244 +}
  245 +
  246 +.foot_box_remark.data-v-3a5b7e36 ._img {
  247 + width: 100%;
  248 +}
  249 +
  250 +.foot_box_remark.data-v-3a5b7e36 .img {
  251 + line-height: 0;
  252 +}
  253 +.overdue.data-v-3a5b7e36{
  254 + background-color: rgb(153,153,153);
  255 +}
  256 +
  257 +.foot_button_intalge.data-v-3a5b7e36.gray{ background-color: #aaa; }
  258 +
  259 +.xc-share-frame {
  260 + position: absolute; right:0; top: -10rpx;
  261 +}
  262 +
  263 +
  264 +.fs34{
  265 + font-size: 34rpx;
  266 +}
  267 +.fs46{
  268 + font-size: 46rpx;
  269 +}
  270 +
  271 +
  272 +.month_btn{
  273 + width: 165rpx;height: 54rpx;
  274 + background-color: #f85c97;
  275 + border-radius: 54rpx; color: #fff;
  276 +}
  277 +.sw_state_btn{
  278 + width: 115rpx; height: 34rpx;font-size: 23rpx;color: #fff;border-radius: 17rpx; margin-top: 10rpx;
  279 +}
  280 +
  281 +
  282 +.sw_state_btn.no_rev {
  283 + background-color:#7ecef4
  284 +}
  285 +.sw_state_btn.no_hx {
  286 + background-color:#ff0000
  287 +}
  288 +.sw_state_btn.bf_hx {
  289 + background-color:#ffbb42
  290 +}
  291 +.sw_state_btn.gq {
  292 + background-color:#898989
  293 +}
  294 +.sw_state_btn.qb_hx {
  295 + background-color:#ffbb42; width: 150rpx;
  296 +}
0 \ No newline at end of file 297 \ No newline at end of file
pages/cart/cart/cart.js
@@ -1001,6 +1001,8 @@ Page({ @@ -1001,6 +1001,8 @@ Page({
1001 continue; 1001 continue;
1002 } 1002 }
1003 1003
  1004 + carr[i].sto_list=good.storageId;
  1005 +
1004 if (item.prom_type == 0 && !item.is_integral_normal && !item.is_pd_normal ) { 1006 if (item.prom_type == 0 && !item.is_integral_normal && !item.is_pd_normal ) {
1005 var prom = null; 1007 var prom = null;
1006 var now = ut.gettimestamp(); 1008 var now = ut.gettimestamp();
@@ -1114,10 +1116,12 @@ Page({ @@ -1114,10 +1116,12 @@ Page({
1114 //------如果没有找到----- 1116 //------如果没有找到-----
1115 if (find == 0) { 1117 if (find == 0) {
1116 var pikname = ''; 1118 var pikname = '';
  1119 + var keyid='';
1117 //找到门店名称 1120 //找到门店名称
1118 for (var k = 0; k < th.data.allsto.length; k++) { 1121 for (var k = 0; k < th.data.allsto.length; k++) {
1119 if (pcid == th.data.allsto[k].pickup_id) { 1122 if (pcid == th.data.allsto[k].pickup_id) {
1120 pikname = th.data.allsto[k].pickup_name; 1123 pikname = th.data.allsto[k].pickup_name;
  1124 + keyid = th.data.allsto[k].keyid;
1121 break; 1125 break;
1122 } 1126 }
1123 } 1127 }
@@ -1127,7 +1131,8 @@ Page({ @@ -1127,7 +1131,8 @@ Page({
1127 pid: pcid, 1131 pid: pcid,
1128 pname: pikname, 1132 pname: pikname,
1129 goods: narr, 1133 goods: narr,
1130 - selected: 0 1134 + selected: 0,
  1135 + keyid: keyid,
1131 }; 1136 };
1132 arr.push(ie); 1137 arr.push(ie);
1133 } 1138 }
@@ -4109,6 +4114,17 @@ Page({ @@ -4109,6 +4114,17 @@ Page({
4109 } 4114 }
4110 }); 4115 });
4111 4116
  4117 + //-- 服务卡项的可售情况 --
  4118 + var sto_list=i_arr[j].sto_list;
  4119 + if(sto_list){
  4120 + let the_c_key=this.data.service_data[i].keyid
  4121 + if (sto_list.indexOf(the_c_key)==-1) {
  4122 + getApp().confirmBox(i_arr[j].service_name + "的门店不可售");
  4123 + th.clear_checkouting();
  4124 + return false;
  4125 + }
  4126 + }
  4127 +
4112 //判断秒杀的指定门店 4128 //判断秒杀的指定门店
4113 if( [1,2].includes(i_arr[j].prom_type) && i_arr[j].prom && i_arr[j].prom.pick_up_lists && i_arr[j].selected){ 4129 if( [1,2].includes(i_arr[j].prom_type) && i_arr[j].prom && i_arr[j].prom.pick_up_lists && i_arr[j].selected){
4114 var idx0=i_arr[j].prom.pick_up_lists.findIndex(function (e){ 4130 var idx0=i_arr[j].prom.pick_up_lists.findIndex(function (e){
pages/user/my_service/i_service.wxml
@@ -53,13 +53,15 @@ @@ -53,13 +53,15 @@
53 </view> 53 </view>
54 54
55 <view class="flex-center fs28 functionMax"> 55 <view class="flex-center fs28 functionMax">
56 -  
57 - <view wx:if="{{s_filter.is_acting(item.BeginDate)}}" class="flex-level Use" bindtap="open_fw" data-ind="{{index}}" data-service_id="{{item.ServiceID}}">  
58 - <view>立即使用</view>  
59 - </view>  
60 - <view wx:else class="flex-level Use nostart" data-ind="{{index}}" data-service_id="{{item.ServiceID}}">  
61 - <view>未开始</view>  
62 - </view> 56 + <!-- 无项目时id是固定的,不能立即使用 -->
  57 + <block wx:if="{{item.ServiceID !='0A2225CF-19A7-402B-A4E3-0226004DD068'}}">
  58 + <view wx:if="{{s_filter.is_acting(item.BeginDate)}}" class="flex-level Use" bindtap="open_fw" data-ind="{{index}}" data-service_id="{{item.ServiceID}}">
  59 + <view>立即使用</view>
  60 + </view>
  61 + <view wx:else class="flex-level Use nostart" data-ind="{{index}}" data-service_id="{{item.ServiceID}}">
  62 + <view>未开始</view>
  63 + </view>
  64 + </block>
63 65
64 <!-- 可预约 --> 66 <!-- 可预约 -->
65 <view wx:if="{{item.State>0}}" class="flex-level appointment yellow-b" data-url="/packageG/pages/user/my_service/appment_main?service_id={{item.ServiceID}}&BuyType={{item.BuyType}}&ProjectID={{item.ProjectID}}&Validay={{item.Validay}}" bindtap="correcting" data-service_id="{{item.ServiceID}}" data-project_id="{{item.ProjectID}}"> 67 <view wx:if="{{item.State>0}}" class="flex-level appointment yellow-b" data-url="/packageG/pages/user/my_service/appment_main?service_id={{item.ServiceID}}&BuyType={{item.BuyType}}&ProjectID={{item.ProjectID}}&Validay={{item.Validay}}" bindtap="correcting" data-service_id="{{item.ServiceID}}" data-project_id="{{item.ProjectID}}">
pages/user/order_list/order_list.js
@@ -153,7 +153,7 @@ Page({ @@ -153,7 +153,7 @@ Page({
153 153
154 ut.fy_back('', 0) 154 ut.fy_back('', 0)
155 th.setData({paying: 0}); 155 th.setData({paying: 0});
156 - th.data.ser_paying = 0; 156 + th.setData({ ser_paying: 0 });
157 157
158 t_pay.set_fir(); 158 t_pay.set_fir();
159 t.set_fir(); 159 t.set_fir();
@@ -3142,9 +3142,13 @@ Page({ @@ -3142,9 +3142,13 @@ Page({
3142 let th=this; 3142 let th=this;
3143 3143
3144 if(th.data.ser_paying) return false; 3144 if(th.data.ser_paying) return false;
3145 - th.data.ser_paying=1;  
3146 - 3145 + //th.data.ser_paying=1;
3147 let index = e.currentTarget.dataset.index; 3146 let index = e.currentTarget.dataset.index;
  3147 +
  3148 + //避免重复点击
  3149 + var txt="ser_paying["+index+"]";
  3150 + this.setData({[txt]:1});
  3151 +
3148 let item = this.data.cardList[index]; 3152 let item = this.data.cardList[index];
3149 let order_sn = item.order_sn; 3153 let order_sn = item.order_sn;
3150 let order_id = item.order_id; 3154 let order_id = item.order_id;
@@ -3157,7 +3161,24 @@ Page({ @@ -3157,7 +3161,24 @@ Page({
3157 var pt_act=null; //-- 拼团活动的优化 -- 3161 var pt_act=null; //-- 拼团活动的优化 --
3158 3162
3159 for (const it of list) { 3163 for (const it of list) {
3160 - 3164 +
  3165 + var card=null;
  3166 + await getApp().request.promiseGet("/api/weshop/serviceCard/get/" + store_id + "/" + it.card_id, {}).then(res => {
  3167 + if(res.data.code==0 && res.data.data){
  3168 + card = res.data.data;
  3169 + }
  3170 + })
  3171 +
  3172 + if(card && card.storageId){
  3173 + let the_c_key=it.pickup_keyid;
  3174 + if (card.storageId.indexOf(the_c_key)==-1) {
  3175 + getApp().confirmBox(it.service_name + "的门店不可售");
  3176 + th.setData({ ser_paying: 0 });
  3177 + flag = false;
  3178 + return false;
  3179 + }
  3180 + }
  3181 +
3161 //秒杀 3182 //秒杀
3162 if ([1,2].includes(it.prom_type)) { 3183 if ([1,2].includes(it.prom_type)) {
3163 let act_details = null; 3184 let act_details = null;
@@ -3209,7 +3230,7 @@ Page({ @@ -3209,7 +3230,7 @@ Page({
3209 }) 3230 })
3210 if(idx0<0){ 3231 if(idx0<0){
3211 getApp().confirmBox(it.service_name + "秒杀活动的门店不可售"); 3232 getApp().confirmBox(it.service_name + "秒杀活动的门店不可售");
3212 - th.setData({ paying: 0 }); 3233 + th.setData({ ser_paying: 0 });
3213 flag = false; 3234 flag = false;
3214 return false; 3235 return false;
3215 } 3236 }
@@ -3249,7 +3270,7 @@ Page({ @@ -3249,7 +3270,7 @@ Page({
3249 }) 3270 })
3250 if(idx0<0){ 3271 if(idx0<0){
3251 getApp().confirmBox(it.service_name + "秒杀活动的门店不可售"); 3272 getApp().confirmBox(it.service_name + "秒杀活动的门店不可售");
3252 - th.setData({ paying: 0 }); 3273 + th.setData({ ser_paying: 0 });
3253 flag = false; 3274 flag = false;
3254 return false; 3275 return false;
3255 } 3276 }
@@ -3287,7 +3308,7 @@ Page({ @@ -3287,7 +3308,7 @@ Page({
3287 3308
3288 }; 3309 };
3289 //-- 拼团 -- 3310 //-- 拼团 --
3290 - if (it.prom_type == 6) { 3311 + if (it.prom_type == 6 ) {
3291 let act_details = null; 3312 let act_details = null;
3292 let redis_num = 0; 3313 let redis_num = 0;
3293 let promcardbuynum = 0; 3314 let promcardbuynum = 0;
@@ -3378,7 +3399,7 @@ Page({ @@ -3378,7 +3399,7 @@ Page({
3378 3399
3379 } 3400 }
3380 //-- 预售 -- 3401 //-- 预售 --
3381 - if (it.prom_type == 8) { 3402 + if (it.prom_type == 8 ) {
3382 3403
3383 let act_details = null; 3404 let act_details = null;
3384 let promcardbuynum = 0; 3405 let promcardbuynum = 0;
@@ -3441,7 +3462,7 @@ Page({ @@ -3441,7 +3462,7 @@ Page({
3441 }) 3462 })
3442 3463
3443 if(!flag) { 3464 if(!flag) {
3444 - th.data.ser_paying=0; 3465 + th.setData({ ser_paying: 0 });
3445 return false; 3466 return false;
3446 } 3467 }
3447 3468
@@ -3506,7 +3527,7 @@ Page({ @@ -3506,7 +3527,7 @@ Page({
3506 3527
3507 3528
3508 }, function (e) { 3529 }, function (e) {
3509 - th.data.ser_paying=0; 3530 + th.setData({ ser_paying: 0 });
3510 wx.showToast({ 3531 wx.showToast({
3511 title: e, 3532 title: e,
3512 icon: 'none', 3533 icon: 'none',
@@ -3536,7 +3557,7 @@ Page({ @@ -3536,7 +3557,7 @@ Page({
3536 // // } 3557 // // }
3537 // }); 3558 // });
3538 }else { 3559 }else {
3539 - th.data.ser_paying=0; 3560 + th.setData({ ser_paying: 0 });
3540 } 3561 }
3541 3562
3542 }, 3563 },
pages/user/order_list/order_list.wxml
@@ -480,10 +480,18 @@ @@ -480,10 +480,18 @@
480 </block> 480 </block>
481 481
482 <navigator class="commodity_To_evaluate flex-level comment_go" 482 <navigator class="commodity_To_evaluate flex-level comment_go"
483 - bindtap="pay" data-index="{{index}}" wx:if="{{item.prom_type!=6 && item.order_status==0 && item.pay_status==0 && item.order_status<2}}">立即支付</navigator> 483 + bindtap="pay" data-index="{{index}}" wx:if="{{item.prom_type!=6 && item.order_status==0 && item.pay_status==0 && item.order_status<2}}">
  484 + <text wx:if="{{ser_paying && ser_paying[index]}}">支付中</text>
  485 + <text wx:else>立即支付</text>
  486 +
  487 + </navigator>
484 488
485 <navigator class="commodity_To_evaluate flex-level comment_go" 489 <navigator class="commodity_To_evaluate flex-level comment_go"
486 - bindtap="pay" data-index="{{index}}" wx:if="{{item.prom_type==6 && item.pt_status==0 && item.order_status<2}}">立即支付</navigator> 490 + bindtap="pay" data-index="{{index}}" wx:if="{{item.prom_type==6 && item.pt_status==0 && item.order_status<2}}">
  491 + <text wx:if="{{ser_paying && ser_paying[index]}}">支付中</text>
  492 + <text wx:else>立即支付</text>
  493 +
  494 + </navigator>
487 495
488 <navigator class="commodity_To_evaluate flex-level comment_go" url="/packageA/pages/serviceCard_pd/cart_wk/cart_wk?order_id={{item.order_id}}" 496 <navigator class="commodity_To_evaluate flex-level comment_go" url="/packageA/pages/serviceCard_pd/cart_wk/cart_wk?order_id={{item.order_id}}"
489 data-idx="{{index}}" wx:if="{{item.order_status<2 && item.pt_status==2 && item.pt_tail_money>0}}">支付尾款</navigator> 497 data-idx="{{index}}" wx:if="{{item.order_status<2 && item.pt_status==2 && item.pt_tail_money>0}}">支付尾款</navigator>