Commit dbf8c236b3f579966cc4cc3dc7680dd1e427cb29
1 parent
64ceccfc
OA单的提交优化
Showing
16 changed files
with
1776 additions
and
26 deletions
packageA/pages/details_serviceCard/details_serviceCard.js
| @@ -676,6 +676,25 @@ Page({ | @@ -676,6 +676,25 @@ Page({ | ||
| 676 | 676 | ||
| 677 | //秒杀活动和拼团活动要重新计算一下 | 677 | //秒杀活动和拼团活动要重新计算一下 |
| 678 | for (const it of list) { | 678 | for (const it of list) { |
| 679 | + | ||
| 680 | + var card=null; | ||
| 681 | + await getApp().request.promiseGet("/api/weshop/serviceCard/get/" + store_id + "/" + it.card_id, {}).then(res => { | ||
| 682 | + if(res.data.code==0 && res.data.data){ | ||
| 683 | + card = res.data.data; | ||
| 684 | + } | ||
| 685 | + }) | ||
| 686 | + | ||
| 687 | + if(card && card.storageId){ | ||
| 688 | + let the_c_key=it.pickup_keyid; | ||
| 689 | + if (card.storageId.indexOf(the_c_key)==-1) { | ||
| 690 | + getApp().confirmBox(it.service_name + "的门店不可售"); | ||
| 691 | + th.setData({ paying: 0 }); | ||
| 692 | + flag = false; | ||
| 693 | + return false; | ||
| 694 | + } | ||
| 695 | + } | ||
| 696 | + | ||
| 697 | + | ||
| 679 | if ([1,2].includes(it.prom_type)) { | 698 | if ([1,2].includes(it.prom_type)) { |
| 680 | let act_details = null; | 699 | let act_details = null; |
| 681 | let redis_num = 0; | 700 | let redis_num = 0; |
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/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}}"> | ||
| 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}}"> |
| @@ -153,8 +159,21 @@ | @@ -153,8 +159,21 @@ | ||
| 153 | 159 | ||
| 154 | <block wx:if="{{flag != 1}}"> | 160 | <block wx:if="{{flag != 1}}"> |
| 155 | 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> | ||
| 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> |
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/order_list/order_list.js
| @@ -3157,7 +3157,24 @@ Page({ | @@ -3157,7 +3157,24 @@ Page({ | ||
| 3157 | var pt_act=null; //-- 拼团活动的优化 -- | 3157 | var pt_act=null; //-- 拼团活动的优化 -- |
| 3158 | 3158 | ||
| 3159 | for (const it of list) { | 3159 | for (const it of list) { |
| 3160 | - | 3160 | + |
| 3161 | + var card=null; | ||
| 3162 | + await getApp().request.promiseGet("/api/weshop/serviceCard/get/" + store_id + "/" + it.card_id, {}).then(res => { | ||
| 3163 | + if(res.data.code==0 && res.data.data){ | ||
| 3164 | + card = res.data.data; | ||
| 3165 | + } | ||
| 3166 | + }) | ||
| 3167 | + | ||
| 3168 | + if(card && card.storageId){ | ||
| 3169 | + let the_c_key=it.pickup_keyid; | ||
| 3170 | + if (card.storageId.indexOf(the_c_key)==-1) { | ||
| 3171 | + getApp().confirmBox(it.service_name + "的门店不可售"); | ||
| 3172 | + th.setData({ paying: 0 }); | ||
| 3173 | + flag = false; | ||
| 3174 | + return false; | ||
| 3175 | + } | ||
| 3176 | + } | ||
| 3177 | + | ||
| 3161 | //秒杀 | 3178 | //秒杀 |
| 3162 | if ([1,2].includes(it.prom_type)) { | 3179 | if ([1,2].includes(it.prom_type)) { |
| 3163 | let act_details = null; | 3180 | let act_details = null; |