Commit 93c49f11be9182587997dcc2690e00a539db7174

Authored by pengye
1 parent e42b9d65

邀请函模板20,会员充值改为显示推荐的

@@ -24,9 +24,11 @@ Page({ @@ -24,9 +24,11 @@ Page({
24 signboard: {}, 24 signboard: {},
25 store: {}, 25 store: {},
26 recharge_data: {}, 26 recharge_data: {},
27 - activeData: {},  
28 coupon_dataList: [], 27 coupon_dataList: [],
29 seller: {}, 28 seller: {},
  29 + priceInfo: '',
  30 + scoreInfo: '',
  31 + certificate: '',
30 dataStr: Date.now() * 1 / 1000, 32 dataStr: Date.now() * 1 / 1000,
31 swich_phone: '0', //是否显示前台电话 33 swich_phone: '0', //是否显示前台电话
32 is_comments: '0', 34 is_comments: '0',
@@ -671,8 +673,10 @@ Page({ @@ -671,8 +673,10 @@ Page({
671 couponList = this.addCoupons(coupon_data_free,couponList); 673 couponList = this.addCoupons(coupon_data_free,couponList);
672 // 根据券ID获取券详情 674 // 根据券ID获取券详情
673 this.getActivityByIdFun(couponList) 675 this.getActivityByIdFun(couponList)
674 - // 获取所有充值活动  
675 - this.getRechargeDetail() 676 + // 根据充值ID获取充值详情
  677 + if (marketing && marketing.is_recharge && marketing.is_recharge == '1' && marketing.recharge_data) {
  678 + this.getRechargeDetail(marketing.recharge_data.id)
  679 + }
676 if (store && store.images && store.images.length > 0) store.images = util.determine(store.images); 680 if (store && store.images && store.images.length > 0) store.images = util.determine(store.images);
677 if (reserve && reserve.park_info_images && reserve.park_info_images.length > 0) reserve.park_info_images = util.determine(reserve.park_info_images); 681 if (reserve && reserve.park_info_images && reserve.park_info_images.length > 0) reserve.park_info_images = util.determine(reserve.park_info_images);
678 if (signboard && signboard.images && signboard.images.length > 0) signboard.images = util.determine(signboard.images); 682 if (signboard && signboard.images && signboard.images.length > 0) signboard.images = util.determine(signboard.images);
@@ -860,42 +864,31 @@ Page({ @@ -860,42 +864,31 @@ Page({
860 } 864 }
861 }, 865 },
862 // 根据充值ID获取充值详情 866 // 根据充值ID获取充值详情
863 - getRechargeDetail() {  
864 - App.Activity.GetNewRechargeList({  
865 - sellerid: this.data.detail.seller.id, 867 + getRechargeDetail(id) {
  868 + App.Activity.GetNewRecharge({
  869 + id
866 }).then(res => { 870 }).then(res => {
867 if (res.data) { 871 if (res.data) {
868 - let arr = []  
869 - res.data.forEach(i => {  
870 - if (i.status != '1') {  
871 - arr.push(i)  
872 - }  
873 - })  
874 - let recharge_data = arr;  
875 - recharge_data.forEach(item => {  
876 - item.recharge_list = item.recharge_list ? JSON.parse(item.recharge_list) : '';  
877 - let recharge_list = item.recharge_list;  
878 - item.priceInfo = '';  
879 - item.scoreInfo = '';  
880 - item.certificate = '';  
881 - if (recharge_list.is_price == '1') item.priceInfo = '会员充值满' + item.recharge_money + '元赠送' + item.recharge_list.price + '元余额';  
882 - if (recharge_list.is_score == '1') item.scoreInfo = '会员充值满' + item.recharge_money + '元赠送' + item.recharge_list.score + '积分';  
883 - if (recharge_list.is_coupons == '1' && recharge_list.coupons_names.length > 0) item.certificate = recharge_list.coupons_names.join('、');  
884 - item.timeStr = util.unixtoTime(item.stime, 'YYYY-MM-DD') + ' - ' + util.unixtoTime(item.etime, 'YYYY-MM-DD')  
885 - })  
886 - // 筛选出 未过期的 && 开启状态的充值活动  
887 - recharge_data = recharge_data.filter(item => {  
888 - return this.data.dataStr < (item.etime * 1) && item.is_open == '1'  
889 - }) 872 + let detail = res.data
  873 + let exp_date = res.data.exp_date ? JSON.parse(res.data.exp_date) : ''
  874 + let recharge_list = res.data.recharge_list ? JSON.parse(res.data.recharge_list) : ''
  875 + let priceInfo, scoreInfo, certificate;
  876 + detail.recharge_list = recharge_list;
  877 + detail.exp_date = exp_date;
  878 + if (recharge_list.is_price == '1') priceInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.price + '元余额';
  879 + if (recharge_list.is_score == '1') scoreInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.score + '积分';
  880 + if (recharge_list.is_coupons == '1' && recharge_list.coupons_names.length > 0) certificate = recharge_list.coupons_names.join('、');
  881 + let recharge_data = (this.data.dataStr < detail.etime * 1 && detail.is_open == '1') ? detail : ''
890 console.log('邀请函--------------充值', recharge_data); 882 console.log('邀请函--------------充值', recharge_data);
891 this.setData({ 883 this.setData({
892 recharge_data, 884 recharge_data,
893 - activeData: recharge_data.length > 0 ? recharge_data[0] : {}, 885 + scoreInfo,
  886 + priceInfo,
  887 + certificate
894 }) 888 })
895 } else { 889 } else {
896 this.setData({ 890 this.setData({
897 - recharge_data: [],  
898 - activeData: {}, 891 + recharge_data: {},
899 }) 892 })
900 } 893 }
901 }) 894 })
@@ -126,28 +126,25 @@ @@ -126,28 +126,25 @@
126 </block> 126 </block>
127 </view> 127 </view>
128 <!-- 充值 --> 128 <!-- 充值 -->
129 - <view class="publicModule preferentialCoupon" wx:if="{{(hasValueRecharge && marketing.is_recharge=='1' && recharge_data.length>0) || (hasValueRecharge && marketing.is_link=='1')}}"> 129 + <view class="publicModule preferentialCoupon" wx:if="{{(hasValueRecharge && marketing.is_recharge=='1' && recharge_data) || (hasValueRecharge && marketing.is_link=='1')}}">
130 <image class="titleImg6" src="https://qn.colorcun.com/invitation10Title2.png" mode="" /> 130 <image class="titleImg6" src="https://qn.colorcun.com/invitation10Title2.png" mode="" />
131 - <block wx:for="{{recharge_data}}" wx:key="index">  
132 - <view class="rechargeItems {{item.id == activeData.id ? 'rechargeActive' : ''}}" bindtap="checkRechargeData" data-id="{{item.id}}">  
133 - <image class="checkImg" wx:if="{{item.id == activeData.id}}" src="https://qn.colorcun.com/invitation10vector2.png" mode="" />  
134 - <view class="rechargeTitle font36r">{{item.rname}}</view>  
135 - <view class="limitation font24r" wx:if="{{item.priceInfo}}">  
136 - {{item.priceInfo}}{{(item.recharge_list.is_coupons=='0' && item.recharge_list.is_score=='0')?'。':';'}} 131 + <navigator wx:if="{{hasValueRecharge && marketing.is_recharge=='1' && recharge_data && recharge_data.id}}" url="/pack-activity/pack/vipRecharge?id={{recharge_data.id}}&name={{seller.name}}&sid={{seller.sid}}&oid={{detail.id}}&types=1&StyleType={{StyleType}}" hover-class="navigator-hover">
  132 + <view class="rechargeItems">
  133 + <view class="rechargeTitle font36r">{{recharge_data.rname}}</view>
  134 + <view class="limitation font24r" wx:if="{{priceInfo}}">
  135 + {{priceInfo}}{{(recharge_data.recharge_list.is_coupons=='0' && recharge_data.recharge_list.is_score=='0')?'。':';'}}
137 </view> 136 </view>
138 - <view class="limitation font24r" wx:if="{{item.scoreInfo}}">  
139 - {{item.scoreInfo}}{{item.recharge_list.is_coupons=='0'?'。':';'}} 137 + <view class="limitation font24r" wx:if="{{scoreInfo}}">
  138 + {{scoreInfo}}{{recharge_data.recharge_list.is_coupons=='0'?'。':';'}}
140 </view> 139 </view>
141 - <view class="limitation font24r" wx:if="{{item.recharge_list.is_coupons=='1'}}">  
142 - {{item.recharge_list.is_coupons=='1'?'会员充值满'+item.recharge_money+'元赠送'+item.certificate:''}}。 140 + <view class="limitation font24r" wx:if="{{recharge_data.recharge_list.is_coupons=='1'}}">
  141 + {{recharge_data.recharge_list.is_coupons=='1'?'会员充值满'+recharge_data.recharge_money+'元赠送'+certificate:''}}。
143 </view> 142 </view>
144 </view> 143 </view>
145 - </block>  
146 - <view class="rechargeBtn">  
147 - <navigator wx:if="{{activeData.id}}" url="/pack-activity/pack/vipRecharge?id={{activeData.id}}&name={{seller.name}}&sid={{seller.sid}}&oid={{detail.id}}&types=1&StyleType={{StyleType}}" hover-class="navigator-hover">  
148 - 立即充值  
149 - </navigator>  
150 - </view> 144 + <view class="rechargeBtn">
  145 + <view class="font28r">立即充值</view>
  146 + </view>
  147 + </navigator>
151 <view wx:if="{{hasValueRecharge && marketing.is_link=='1'}}" class="font24r favouredPolicy" bindtap="gotoFavourableList"> 148 <view wx:if="{{hasValueRecharge && marketing.is_link=='1'}}" class="font24r favouredPolicy" bindtap="gotoFavourableList">
152 了解更多会员优惠政策 149 了解更多会员优惠政策
153 </view> 150 </view>