Commit 22b7f46e06177b62958598e16066f90b3890ff3e

Authored by pengye
1 parent bfd997e6

邀请函、商家有礼、会员优惠链接、商家详情、评价领券加券有效时间、启用状态的判断

@@ -15,7 +15,8 @@ Page({ @@ -15,7 +15,8 @@ Page({
15 scoreInfo: '', 15 scoreInfo: '',
16 certificate: '', 16 certificate: '',
17 rid:'', 17 rid:'',
18 - list: [] 18 + list: [],
  19 + dataStr: Date.now() * 1 / 1000,
19 }, 20 },
20 /** 21 /**
21 * 生命周期函数--监听页面加载 22 * 生命周期函数--监听页面加载
@@ -47,9 +48,6 @@ Page({ @@ -47,9 +48,6 @@ Page({
47 }) 48 })
48 let list = arr; 49 let list = arr;
49 list.forEach((item,index) => { 50 list.forEach((item,index) => {
50 - if(item.is_open=='0'){  
51 - list.splice(index,1)  
52 - }  
53 item.recharge_lists = item.recharge_list ? JSON.parse(item.recharge_list) : ''; 51 item.recharge_lists = item.recharge_list ? JSON.parse(item.recharge_list) : '';
54 let recharge_lists = item.recharge_lists; 52 let recharge_lists = item.recharge_lists;
55 item.priceInfo = ''; 53 item.priceInfo = '';
@@ -59,6 +57,8 @@ Page({ @@ -59,6 +57,8 @@ Page({
59 if (recharge_lists.is_score == '1') item.scoreInfo = '会员充值满' + item.recharge_money + '元赠送' + item.recharge_lists.score + '积分'; 57 if (recharge_lists.is_score == '1') item.scoreInfo = '会员充值满' + item.recharge_money + '元赠送' + item.recharge_lists.score + '积分';
60 if (recharge_lists.is_coupons == '1' && recharge_lists.coupons_names.length > 0) item.certificate = recharge_lists.coupons_names.join('、'); 58 if (recharge_lists.is_coupons == '1' && recharge_lists.coupons_names.length > 0) item.certificate = recharge_lists.coupons_names.join('、');
61 }) 59 })
  60 + // 筛选出 未过期的 && 开启状态的充值活动
  61 + list = list.filter(item=>{return this.data.dataStr<(item.etime*1) && item.is_open == '1'})
62 this.setData({ 62 this.setData({
63 list 63 list
64 }) 64 })
@@ -59,6 +59,7 @@ Page({ @@ -59,6 +59,7 @@ Page({
59 paymentId: '', //定金id 59 paymentId: '', //定金id
60 wxml: null, 60 wxml: null,
61 imgSrc:'',//canvas图片地址 61 imgSrc:'',//canvas图片地址
  62 + couponData: '', //评价赠送优惠券数据
62 }, 63 },
63 tablestr: '', 64 tablestr: '',
64 urlsValue: [], 65 urlsValue: [],
@@ -556,7 +557,11 @@ Page({ @@ -556,7 +557,11 @@ Page({
556 if (marketing) { 557 if (marketing) {
557 is_comments = marketing.is_comments ? marketing.is_comments : ''; 558 is_comments = marketing.is_comments ? marketing.is_comments : '';
558 coupon = marketing.coupon_data ? util.determine(marketing.coupon_data) : ''; 559 coupon = marketing.coupon_data ? util.determine(marketing.coupon_data) : '';
559 - } 560 + let info = marketing.coupon_data_comments ? util.determine(marketing.coupon_data_comments) : '';
  561 + let couponDataId = info && info.length > 0 ? info[0].id : {}
  562 + // 根据券ID获取评价赠送的券详情
  563 + if(couponDataId) this.getEvaluateFun(couponDataId)
  564 + }
560 // is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示 565 // is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示
561 if (coupon && util.getType(coupon) == 'object') { 566 if (coupon && util.getType(coupon) == 'object') {
562 couponList.push({ 567 couponList.push({
@@ -821,14 +826,32 @@ Page({ @@ -821,14 +826,32 @@ Page({
821 if (recharge_list.is_price == '1') priceInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.price + '元余额'; 826 if (recharge_list.is_price == '1') priceInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.price + '元余额';
822 if (recharge_list.is_score == '1') scoreInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.score + '积分'; 827 if (recharge_list.is_score == '1') scoreInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.score + '积分';
823 if (recharge_list.is_coupons == '1' && recharge_list.coupons_names.length > 0) certificate = recharge_list.coupons_names.join('、'); 828 if (recharge_list.is_coupons == '1' && recharge_list.coupons_names.length > 0) certificate = recharge_list.coupons_names.join('、');
824 - this.setData({  
825 - recharge_data: detail, 829 + let recharge_data = (this.data.dataStr<detail.etime*1 && detail.is_open == '1') ? detail : ''
  830 + console.log('邀请函--------------充值',recharge_data);
  831 + this.setData({
  832 + recharge_data,
826 scoreInfo, 833 scoreInfo,
827 priceInfo, 834 priceInfo,
828 certificate 835 certificate
829 }) 836 })
830 }) 837 })
831 }, 838 },
  839 + // 获取评价赠送的券最新详情
  840 + getEvaluateFun(id){
  841 + App.Activity.GetActivityById({
  842 + id
  843 + }).then(res => {
  844 + if (res.data.length > 0) {
  845 + let couponData = res.data[0]
  846 + // showCoupon 代表赠送的券没过有效期 && 是开启状态
  847 + couponData.showCoupon = (this.data.dataStr<(couponData.etime*1) && couponData.is_open=='1') ? '1' : '0';
  848 + console.log('邀请函--------------------评价赠送的优惠券',couponData);
  849 + this.setData({
  850 + couponData:res.data[0]
  851 + })
  852 + }
  853 + })
  854 + },
832 // 根据券ID获取券详情 855 // 根据券ID获取券详情
833 getActivityByIdFun(ids, length) { 856 getActivityByIdFun(ids, length) {
834 let coupon_dataList = []; 857 let coupon_dataList = [];
@@ -846,8 +869,10 @@ Page({ @@ -846,8 +869,10 @@ Page({
846 let price = detail.price * 1; 869 let price = detail.price * 1;
847 detail.discount = cash != 0 ? ((price / cash) * 10).toFixed(1) : ''; 870 detail.discount = cash != 0 ? ((price / cash) * 10).toFixed(1) : '';
848 } 871 }
849 - coupon_dataList.push(detail);  
850 - if (length === ids.length) { 872 + coupon_dataList.push(detail);
  873 + if (length === coupon_dataList.length) {
  874 + coupon_dataList = coupon_dataList.filter(item=>{return this.data.dataStr<(item.etime*1) && item.is_open == '1'})
  875 + console.log('邀请函--------------------优惠券',coupon_dataList);
851 this.setData({ 876 this.setData({
852 coupon_dataList, 877 coupon_dataList,
853 }) 878 })
@@ -11,7 +11,7 @@ @@ -11,7 +11,7 @@
11 /> 11 />
12 <image class="giftImg" 12 <image class="giftImg"
13 bindtap="gotoSellerGift" 13 bindtap="gotoSellerGift"
14 - wx:if="{{(hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0) || (is_comments=='1' && !is_user_comments && marketing.is_comments_coupon=='1') || (hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data && (is_fix!='1' || (is_fix=='1' && dataStr<(recharge_data.exp_date.fix_edate*1))))}}" 14 + wx:if="{{(hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0) || (is_comments=='1' && !is_user_comments && marketing.is_comments_coupon=='1' && couponData && couponData.showCoupon =='1') || (hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data)}}"
15 src="https://nosqn.colorcun.com/sellerGift.png" mode=""/> 15 src="https://nosqn.colorcun.com/sellerGift.png" mode=""/>
16 <image wx:if="{{detail && detail.status =='4'}}" class="cannotImg" src="https://qn.colorcun.com/cancelImg.png" /> 16 <image wx:if="{{detail && detail.status =='4'}}" class="cannotImg" src="https://qn.colorcun.com/cancelImg.png" />
17 <image wx:if="{{options && options.isOrder == '1' && detail.status !='4'}}" class="cannotImg" src="https://qn.colorcun.com/overImg.png" /> 17 <image wx:if="{{options && options.isOrder == '1' && detail.status !='4'}}" class="cannotImg" src="https://qn.colorcun.com/overImg.png" />
@@ -82,7 +82,7 @@ @@ -82,7 +82,7 @@
82 </block> 82 </block>
83 <view class="preferentialCoupon" wx:if="{{hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0}}"> 83 <view class="preferentialCoupon" wx:if="{{hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0}}">
84 <block wx:for="{{coupon_dataList}}" wx:key="index" wx:for-index="index"> 84 <block wx:for="{{coupon_dataList}}" wx:key="index" wx:for-index="index">
85 - <view class="preferentialItems" wx:if="{{dataStr<(item.etime*1) && item.status == '1'}}"> 85 + <view class="preferentialItems">
86 <view class="itemLeft"> 86 <view class="itemLeft">
87 <text wx:if="{{item.discount!='0.00' && (item.use.is_cash=='1' || item.use.is_cash) && item.discount}}" class="discountText font24r">{{item.discount}}折</text> 87 <text wx:if="{{item.discount!='0.00' && (item.use.is_cash=='1' || item.use.is_cash) && item.discount}}" class="discountText font24r">{{item.discount}}折</text>
88 <view class="priceText" wx:if="{{item.price}}"> 88 <view class="priceText" wx:if="{{item.price}}">
@@ -110,8 +110,8 @@ @@ -110,8 +110,8 @@
110 </block> 110 </block>
111 </view> 111 </view>
112 <view wx:if="{{is_comments=='1' && !is_user_comments}}" class="evaluateBox" bindtap="evaluateFun"> 112 <view wx:if="{{is_comments=='1' && !is_user_comments}}" class="evaluateBox" bindtap="evaluateFun">
113 - <text wx:if="{{is_comments=='1' && marketing.is_comments_coupon!='1'}}">想<text>吐槽</text>?戳这里填写意见!--></text>  
114 - <text wx:if="{{marketing.is_comments_coupon=='1'}}">想<text>吐槽</text>?戳这里填写意见反馈赢好礼!</text> 113 + <text wx:if="{{is_comments=='1' && (marketing.is_comments_coupon!='1' || couponData.showCoupon!='1')}}">想<text class="font36r">吐槽</text>?戳这里填写意见!--></text>
  114 + <text wx:if="{{marketing.is_comments_coupon=='1' && couponData && couponData.showCoupon =='1'}}">想<text class="font36r">吐槽</text>?戳这里填写意见反馈赢好礼!</text>
115 <image wx:if="{{themeColor == 'pearlWhite'}}" src="https://nosqn.colorcun.com/evaluateWhite.png" mode="" /> 115 <image wx:if="{{themeColor == 'pearlWhite'}}" src="https://nosqn.colorcun.com/evaluateWhite.png" mode="" />
116 <image wx:elif="{{themeColor == 'turmeric' || themeColor == 'greenishYellow' || themeColor == 'golden'}}" src="https://nosqn.colorcun.com/evaluateYellow.png" mode="" /> 116 <image wx:elif="{{themeColor == 'turmeric' || themeColor == 'greenishYellow' || themeColor == 'golden'}}" src="https://nosqn.colorcun.com/evaluateYellow.png" mode="" />
117 <image wx:else src="https://nosqn.colorcun.com/evaluate2.png" mode="" /> 117 <image wx:else src="https://nosqn.colorcun.com/evaluate2.png" mode="" />
@@ -193,7 +193,7 @@ @@ -193,7 +193,7 @@
193 </view> 193 </view>
194 </view> 194 </view>
195 </view> 195 </view>
196 - <block wx:if="{{hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data && (is_fix!='1' || (is_fix=='1' && dataStr<(recharge_data.exp_date.fix_edate*1)))}}"> 196 + <block wx:if="{{hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data}}">
197 <view wx:if="{{titleType}}" class="chefText font36r"> 197 <view wx:if="{{titleType}}" class="chefText font36r">
198 <titleStyle isWhite="{{themeColor}}" titleStyleType="{{titleType}}" titleText="会员招募"></titleStyle> 198 <titleStyle isWhite="{{themeColor}}" titleStyleType="{{titleType}}" titleText="会员招募"></titleStyle>
199 </view> 199 </view>
@@ -59,6 +59,7 @@ Page({ @@ -59,6 +59,7 @@ Page({
59 paymentId: '', //定金id 59 paymentId: '', //定金id
60 wxml: null, 60 wxml: null,
61 imgSrc:'',//canvas图片地址 61 imgSrc:'',//canvas图片地址
  62 + couponData: '', //评价赠送优惠券数据
62 }, 63 },
63 tablestr: '', 64 tablestr: '',
64 urlsValue: [], 65 urlsValue: [],
@@ -556,7 +557,11 @@ Page({ @@ -556,7 +557,11 @@ Page({
556 if (marketing) { 557 if (marketing) {
557 is_comments = marketing.is_comments ? marketing.is_comments : ''; 558 is_comments = marketing.is_comments ? marketing.is_comments : '';
558 coupon = marketing.coupon_data ? util.determine(marketing.coupon_data) : ''; 559 coupon = marketing.coupon_data ? util.determine(marketing.coupon_data) : '';
559 - } 560 + let info = marketing.coupon_data_comments ? util.determine(marketing.coupon_data_comments) : '';
  561 + let couponDataId = info && info.length > 0 ? info[0].id : {}
  562 + // 根据券ID获取评价赠送的券详情
  563 + if(couponDataId) this.getEvaluateFun(couponDataId)
  564 + }
560 // is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示 565 // is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示
561 if (coupon && util.getType(coupon) == 'object') { 566 if (coupon && util.getType(coupon) == 'object') {
562 couponList.push({ 567 couponList.push({
@@ -776,14 +781,32 @@ Page({ @@ -776,14 +781,32 @@ Page({
776 if (recharge_list.is_price == '1') priceInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.price + '元余额'; 781 if (recharge_list.is_price == '1') priceInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.price + '元余额';
777 if (recharge_list.is_score == '1') scoreInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.score + '积分'; 782 if (recharge_list.is_score == '1') scoreInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.score + '积分';
778 if (recharge_list.is_coupons == '1' && recharge_list.coupons_names.length > 0) certificate = recharge_list.coupons_names.join('、'); 783 if (recharge_list.is_coupons == '1' && recharge_list.coupons_names.length > 0) certificate = recharge_list.coupons_names.join('、');
779 - this.setData({  
780 - recharge_data: detail, 784 + let recharge_data = (this.data.dataStr<detail.etime*1 && detail.is_open == '1') ? detail : ''
  785 + console.log('邀请函--------------充值',recharge_data);
  786 + this.setData({
  787 + recharge_data,
781 scoreInfo, 788 scoreInfo,
782 priceInfo, 789 priceInfo,
783 certificate 790 certificate
784 }) 791 })
785 }) 792 })
786 }, 793 },
  794 + // 获取评价赠送的券最新详情
  795 + getEvaluateFun(id){
  796 + App.Activity.GetActivityById({
  797 + id
  798 + }).then(res => {
  799 + if (res.data.length > 0) {
  800 + let couponData = res.data[0]
  801 + // showCoupon 代表赠送的券没过有效期 && 是开启状态
  802 + couponData.showCoupon = (this.data.dataStr<(couponData.etime*1) && couponData.is_open=='1') ? '1' : '0';
  803 + console.log('邀请函--------------------评价赠送的优惠券',couponData);
  804 + this.setData({
  805 + couponData:res.data[0]
  806 + })
  807 + }
  808 + })
  809 + },
787 // 根据券ID获取券详情 810 // 根据券ID获取券详情
788 getActivityByIdFun(ids, length) { 811 getActivityByIdFun(ids, length) {
789 let coupon_dataList = []; 812 let coupon_dataList = [];
@@ -801,8 +824,10 @@ Page({ @@ -801,8 +824,10 @@ Page({
801 let price = detail.price * 1; 824 let price = detail.price * 1;
802 detail.discount = cash != 0 ? ((price / cash) * 10).toFixed(1) : ''; 825 detail.discount = cash != 0 ? ((price / cash) * 10).toFixed(1) : '';
803 } 826 }
804 - coupon_dataList.push(detail);  
805 - if (length === ids.length) { 827 + coupon_dataList.push(detail);
  828 + if (length === coupon_dataList.length) {
  829 + coupon_dataList = coupon_dataList.filter(item=>{return this.data.dataStr<(item.etime*1) && item.is_open == '1'})
  830 + console.log('邀请函--------------------优惠券',coupon_dataList);
806 this.setData({ 831 this.setData({
807 coupon_dataList, 832 coupon_dataList,
808 }) 833 })
@@ -11,7 +11,7 @@ @@ -11,7 +11,7 @@
11 /> 11 />
12 <image class="giftImg" 12 <image class="giftImg"
13 bindtap="gotoSellerGift" 13 bindtap="gotoSellerGift"
14 - wx:if="{{(hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0) || (is_comments=='1' && !is_user_comments && marketing.is_comments_coupon=='1') || (hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data && (is_fix!='1' || (is_fix=='1' && dataStr<(recharge_data.exp_date.fix_edate*1))))}}" 14 + wx:if="{{(hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0) || (is_comments=='1' && !is_user_comments && marketing.is_comments_coupon=='1' && couponData && couponData.showCoupon =='1') || (hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data)}}"
15 src="https://nosqn.colorcun.com/sellerGift.png" mode=""/> 15 src="https://nosqn.colorcun.com/sellerGift.png" mode=""/>
16 <image wx:if="{{detail && detail.status =='4'}}" class="cannotImg" src="https://qn.colorcun.com/cancelImg.png" /> 16 <image wx:if="{{detail && detail.status =='4'}}" class="cannotImg" src="https://qn.colorcun.com/cancelImg.png" />
17 <image wx:if="{{options && options.isOrder == '1' && detail.status !='4'}}" class="cannotImg" src="https://qn.colorcun.com/overImg.png" /> 17 <image wx:if="{{options && options.isOrder == '1' && detail.status !='4'}}" class="cannotImg" src="https://qn.colorcun.com/overImg.png" />
@@ -84,7 +84,7 @@ @@ -84,7 +84,7 @@
84 </view> 84 </view>
85 <view class="preferentialCoupon" wx:if="{{hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0}}"> 85 <view class="preferentialCoupon" wx:if="{{hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0}}">
86 <block wx:for="{{coupon_dataList}}" wx:key="index" wx:for-index="index"> 86 <block wx:for="{{coupon_dataList}}" wx:key="index" wx:for-index="index">
87 - <view class="preferentialItems" wx:if="{{dataStr<(item.etime*1) && item.status == '1'}}"> 87 + <view class="preferentialItems">
88 <view class="itemLeft"> 88 <view class="itemLeft">
89 <text wx:if="{{item.discount!='0.00' && (item.use.is_cash=='1' || item.use.is_cash) && item.discount}}" class="discountText font24r">{{item.discount}}折</text> 89 <text wx:if="{{item.discount!='0.00' && (item.use.is_cash=='1' || item.use.is_cash) && item.discount}}" class="discountText font24r">{{item.discount}}折</text>
90 <view class="priceText" wx:if="{{item.price}}"> 90 <view class="priceText" wx:if="{{item.price}}">
@@ -112,8 +112,8 @@ @@ -112,8 +112,8 @@
112 </block> 112 </block>
113 </view> 113 </view>
114 <view wx:if="{{is_comments=='1' && !is_user_comments}}" class="evaluateBox" bindtap="evaluateFun"> 114 <view wx:if="{{is_comments=='1' && !is_user_comments}}" class="evaluateBox" bindtap="evaluateFun">
115 - <text wx:if="{{is_comments=='1' && marketing.is_comments_coupon!='1'}}">想<text>吐槽</text>?戳这里填写意见!--></text>  
116 - <text wx:if="{{marketing.is_comments_coupon=='1'}}">想<text>吐槽</text>?戳这里填写意见反馈赢好礼!</text> 115 + <text wx:if="{{is_comments=='1' && (marketing.is_comments_coupon!='1' || couponData.showCoupon!='1')}}">想<text class="font36r">吐槽</text>?戳这里填写意见!--></text>
  116 + <text wx:if="{{marketing.is_comments_coupon=='1' && couponData && couponData.showCoupon =='1'}}">想<text class="font36r">吐槽</text>?戳这里填写意见反馈赢好礼!</text>
117 <image wx:if="{{themeColor == 'pearlWhite'}}" src="https://nosqn.colorcun.com/evaluateWhite.png" mode="" /> 117 <image wx:if="{{themeColor == 'pearlWhite'}}" src="https://nosqn.colorcun.com/evaluateWhite.png" mode="" />
118 <image wx:elif="{{themeColor == 'turmeric' || themeColor == 'greenishYellow' || themeColor == 'golden'}}" src="https://nosqn.colorcun.com/evaluateYellow.png" mode="" /> 118 <image wx:elif="{{themeColor == 'turmeric' || themeColor == 'greenishYellow' || themeColor == 'golden'}}" src="https://nosqn.colorcun.com/evaluateYellow.png" mode="" />
119 <image wx:else src="https://nosqn.colorcun.com/evaluate2.png" mode="" /> 119 <image wx:else src="https://nosqn.colorcun.com/evaluate2.png" mode="" />
@@ -195,7 +195,7 @@ @@ -195,7 +195,7 @@
195 </view> 195 </view>
196 </view> 196 </view>
197 </view> 197 </view>
198 - <block wx:if="{{hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data && (is_fix!='1' || (is_fix=='1' && dataStr<(recharge_data.exp_date.fix_edate*1)))}}"> 198 + <block wx:if="{{hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data}}">
199 <view wx:if="{{titleType}}" class="chefText font36r"> 199 <view wx:if="{{titleType}}" class="chefText font36r">
200 <titleStyle isWhite="{{themeColor}}" titleStyleType="{{titleType}}" titleText="会员招募"></titleStyle> 200 <titleStyle isWhite="{{themeColor}}" titleStyleType="{{titleType}}" titleText="会员招募"></titleStyle>
201 </view> 201 </view>
@@ -59,6 +59,7 @@ Page({ @@ -59,6 +59,7 @@ Page({
59 paymentId: '', //定金id 59 paymentId: '', //定金id
60 wxml: null, 60 wxml: null,
61 imgSrc:'',//canvas图片地址 61 imgSrc:'',//canvas图片地址
  62 + couponData: '', //评价赠送优惠券数据
62 }, 63 },
63 tablestr: '', 64 tablestr: '',
64 urlsValue: [], 65 urlsValue: [],
@@ -556,7 +557,11 @@ Page({ @@ -556,7 +557,11 @@ Page({
556 if (marketing) { 557 if (marketing) {
557 is_comments = marketing.is_comments ? marketing.is_comments : ''; 558 is_comments = marketing.is_comments ? marketing.is_comments : '';
558 coupon = marketing.coupon_data ? util.determine(marketing.coupon_data) : ''; 559 coupon = marketing.coupon_data ? util.determine(marketing.coupon_data) : '';
559 - } 560 + let info = marketing.coupon_data_comments ? util.determine(marketing.coupon_data_comments) : '';
  561 + let couponDataId = info && info.length > 0 ? info[0].id : {}
  562 + // 根据券ID获取评价赠送的券详情
  563 + if(couponDataId) this.getEvaluateFun(couponDataId)
  564 + }
560 // is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示 565 // is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示
561 if (coupon && util.getType(coupon) == 'object') { 566 if (coupon && util.getType(coupon) == 'object') {
562 couponList.push({ 567 couponList.push({
@@ -776,14 +781,32 @@ Page({ @@ -776,14 +781,32 @@ Page({
776 if (recharge_list.is_price == '1') priceInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.price + '元余额'; 781 if (recharge_list.is_price == '1') priceInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.price + '元余额';
777 if (recharge_list.is_score == '1') scoreInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.score + '积分'; 782 if (recharge_list.is_score == '1') scoreInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.score + '积分';
778 if (recharge_list.is_coupons == '1' && recharge_list.coupons_names.length > 0) certificate = recharge_list.coupons_names.join('、'); 783 if (recharge_list.is_coupons == '1' && recharge_list.coupons_names.length > 0) certificate = recharge_list.coupons_names.join('、');
779 - this.setData({  
780 - recharge_data: detail, 784 + let recharge_data = (this.data.dataStr<detail.etime*1 && detail.is_open == '1') ? detail : ''
  785 + console.log('邀请函--------------充值',recharge_data);
  786 + this.setData({
  787 + recharge_data,
781 scoreInfo, 788 scoreInfo,
782 priceInfo, 789 priceInfo,
783 certificate 790 certificate
784 }) 791 })
785 }) 792 })
786 }, 793 },
  794 + // 获取评价赠送的券最新详情
  795 + getEvaluateFun(id){
  796 + App.Activity.GetActivityById({
  797 + id
  798 + }).then(res => {
  799 + if (res.data.length > 0) {
  800 + let couponData = res.data[0]
  801 + // showCoupon 代表赠送的券没过有效期 && 是开启状态
  802 + couponData.showCoupon = (this.data.dataStr<(couponData.etime*1) && couponData.is_open=='1') ? '1' : '0';
  803 + console.log('邀请函--------------------评价赠送的优惠券',couponData);
  804 + this.setData({
  805 + couponData:res.data[0]
  806 + })
  807 + }
  808 + })
  809 + },
787 // 根据券ID获取券详情 810 // 根据券ID获取券详情
788 getActivityByIdFun(ids, length) { 811 getActivityByIdFun(ids, length) {
789 let coupon_dataList = []; 812 let coupon_dataList = [];
@@ -801,8 +824,10 @@ Page({ @@ -801,8 +824,10 @@ Page({
801 let price = detail.price * 1; 824 let price = detail.price * 1;
802 detail.discount = cash != 0 ? ((price / cash) * 10).toFixed(1) : ''; 825 detail.discount = cash != 0 ? ((price / cash) * 10).toFixed(1) : '';
803 } 826 }
804 - coupon_dataList.push(detail);  
805 - if (length === ids.length) { 827 + coupon_dataList.push(detail);
  828 + if (length === coupon_dataList.length) {
  829 + coupon_dataList = coupon_dataList.filter(item=>{return this.data.dataStr<(item.etime*1) && item.is_open == '1'})
  830 + console.log('邀请函--------------------优惠券',coupon_dataList);
806 this.setData({ 831 this.setData({
807 coupon_dataList, 832 coupon_dataList,
808 }) 833 })
@@ -10,7 +10,7 @@ @@ -10,7 +10,7 @@
10 /> 10 />
11 <image class="giftImg" 11 <image class="giftImg"
12 bindtap="gotoSellerGift" 12 bindtap="gotoSellerGift"
13 - wx:if="{{(hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0) || (is_comments=='1' && !is_user_comments && marketing.is_comments_coupon=='1') || (hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data && (is_fix!='1' || (is_fix=='1' && dataStr<(recharge_data.exp_date.fix_edate*1))))}}" 13 + wx:if="{{(hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0) || (is_comments=='1' && !is_user_comments && marketing.is_comments_coupon=='1' && couponData && couponData.showCoupon =='1') || (hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data)}}"
14 src="https://nosqn.colorcun.com/sellerGift.png" mode=""/> 14 src="https://nosqn.colorcun.com/sellerGift.png" mode=""/>
15 <image wx:if="{{detail && detail.status =='4'}}" class="cannotImg" src="https://qn.colorcun.com/cancelImg.png" /> 15 <image wx:if="{{detail && detail.status =='4'}}" class="cannotImg" src="https://qn.colorcun.com/cancelImg.png" />
16 <image wx:if="{{options && options.isOrder == '1' && detail.status !='4'}}" class="cannotImg" src="https://qn.colorcun.com/overImg.png" /> 16 <image wx:if="{{options && options.isOrder == '1' && detail.status !='4'}}" class="cannotImg" src="https://qn.colorcun.com/overImg.png" />
@@ -67,7 +67,7 @@ @@ -67,7 +67,7 @@
67 </view> 67 </view>
68 <view class="preferentialCoupon" wx:if="{{hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0}}"> 68 <view class="preferentialCoupon" wx:if="{{hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0}}">
69 <block wx:for="{{coupon_dataList}}" wx:key="index" wx:for-index="index"> 69 <block wx:for="{{coupon_dataList}}" wx:key="index" wx:for-index="index">
70 - <view class="preferentialItems" wx:if="{{dataStr<(item.etime*1) && item.status == '1'}}"> 70 + <view class="preferentialItems">
71 <view class="itemLeft"> 71 <view class="itemLeft">
72 <text wx:if="{{item.discount!='0.00' && (item.use.is_cash=='1' || item.use.is_cash) && item.discount}}" class="discountText font24r">{{item.discount}}折</text> 72 <text wx:if="{{item.discount!='0.00' && (item.use.is_cash=='1' || item.use.is_cash) && item.discount}}" class="discountText font24r">{{item.discount}}折</text>
73 <view class="priceText" wx:if="{{item.price}}"> 73 <view class="priceText" wx:if="{{item.price}}">
@@ -95,8 +95,8 @@ @@ -95,8 +95,8 @@
95 </block> 95 </block>
96 </view> 96 </view>
97 <view wx:if="{{is_comments=='1' && !is_user_comments}}" class="evaluateBox" bindtap="evaluateFun"> 97 <view wx:if="{{is_comments=='1' && !is_user_comments}}" class="evaluateBox" bindtap="evaluateFun">
98 - <text wx:if="{{is_comments=='1' && marketing.is_comments_coupon!='1'}}">想<text>吐槽</text>?戳这里填写意见!--></text>  
99 - <text wx:if="{{marketing.is_comments_coupon=='1'}}">想<text>吐槽</text>?戳这里填写意见反馈赢好礼!</text> 98 + <text wx:if="{{is_comments=='1' && (marketing.is_comments_coupon!='1' || couponData.showCoupon!='1')}}">想<text class="font36r">吐槽</text>?戳这里填写意见!--></text>
  99 + <text wx:if="{{marketing.is_comments_coupon=='1' && couponData && couponData.showCoupon =='1'}}">想<text class="font36r">吐槽</text>?戳这里填写意见反馈赢好礼!</text>
100 <image wx:if="{{themeColor == 'pearlWhite'}}" src="https://nosqn.colorcun.com/evaluateWhite.png" mode="" /> 100 <image wx:if="{{themeColor == 'pearlWhite'}}" src="https://nosqn.colorcun.com/evaluateWhite.png" mode="" />
101 <image wx:elif="{{themeColor == 'turmeric' || themeColor == 'greenishYellow' || themeColor == 'golden'}}" src="https://nosqn.colorcun.com/evaluateYellow.png" mode="" /> 101 <image wx:elif="{{themeColor == 'turmeric' || themeColor == 'greenishYellow' || themeColor == 'golden'}}" src="https://nosqn.colorcun.com/evaluateYellow.png" mode="" />
102 <image wx:else src="https://nosqn.colorcun.com/evaluate2.png" mode="" /> 102 <image wx:else src="https://nosqn.colorcun.com/evaluate2.png" mode="" />
@@ -178,7 +178,7 @@ @@ -178,7 +178,7 @@
178 </view> 178 </view>
179 </view> 179 </view>
180 </view> 180 </view>
181 - <block wx:if="{{hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data && (is_fix!='1' || (is_fix=='1' && dataStr<(recharge_data.exp_date.fix_edate*1)))}}"> 181 + <block wx:if="{{hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data}}">
182 <view wx:if="{{titleType}}" class="chefText font36r"> 182 <view wx:if="{{titleType}}" class="chefText font36r">
183 <titleStyle isWhite="{{themeColor}}" titleStyleType="{{titleType}}" titleText="会员招募"></titleStyle> 183 <titleStyle isWhite="{{themeColor}}" titleStyleType="{{titleType}}" titleText="会员招募"></titleStyle>
184 </view> 184 </view>
@@ -58,6 +58,7 @@ Page({ @@ -58,6 +58,7 @@ Page({
58 paymentId: '', //定金id 58 paymentId: '', //定金id
59 wxml: null, 59 wxml: null,
60 imgSrc:'',//canvas图片地址 60 imgSrc:'',//canvas图片地址
  61 + couponData: '', //评价赠送优惠券数据
61 }, 62 },
62 tablestr: '', 63 tablestr: '',
63 urlsValue: [], 64 urlsValue: [],
@@ -555,7 +556,11 @@ Page({ @@ -555,7 +556,11 @@ Page({
555 if (marketing) { 556 if (marketing) {
556 is_comments = marketing.is_comments ? marketing.is_comments : ''; 557 is_comments = marketing.is_comments ? marketing.is_comments : '';
557 coupon = marketing.coupon_data ? util.determine(marketing.coupon_data) : ''; 558 coupon = marketing.coupon_data ? util.determine(marketing.coupon_data) : '';
558 - } 559 + let info = marketing.coupon_data_comments ? util.determine(marketing.coupon_data_comments) : '';
  560 + let couponDataId = info && info.length > 0 ? info[0].id : {}
  561 + // 根据券ID获取评价赠送的券详情
  562 + if(couponDataId) this.getEvaluateFun(couponDataId)
  563 + }
559 // is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示 564 // is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示
560 if (coupon && util.getType(coupon) == 'object') { 565 if (coupon && util.getType(coupon) == 'object') {
561 couponList.push({ 566 couponList.push({
@@ -775,14 +780,32 @@ Page({ @@ -775,14 +780,32 @@ Page({
775 if (recharge_list.is_price == '1') priceInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.price + '元余额'; 780 if (recharge_list.is_price == '1') priceInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.price + '元余额';
776 if (recharge_list.is_score == '1') scoreInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.score + '积分'; 781 if (recharge_list.is_score == '1') scoreInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.score + '积分';
777 if (recharge_list.is_coupons == '1' && recharge_list.coupons_names.length > 0) certificate = recharge_list.coupons_names.join('、'); 782 if (recharge_list.is_coupons == '1' && recharge_list.coupons_names.length > 0) certificate = recharge_list.coupons_names.join('、');
778 - this.setData({  
779 - recharge_data: detail, 783 + let recharge_data = (this.data.dataStr<detail.etime*1 && detail.is_open == '1') ? detail : ''
  784 + console.log('邀请函--------------充值',recharge_data);
  785 + this.setData({
  786 + recharge_data,
780 scoreInfo, 787 scoreInfo,
781 priceInfo, 788 priceInfo,
782 certificate 789 certificate
783 }) 790 })
784 }) 791 })
785 }, 792 },
  793 + // 获取评价赠送的券最新详情
  794 + getEvaluateFun(id){
  795 + App.Activity.GetActivityById({
  796 + id
  797 + }).then(res => {
  798 + if (res.data.length > 0) {
  799 + let couponData = res.data[0]
  800 + // showCoupon 代表赠送的券没过有效期 && 是开启状态
  801 + couponData.showCoupon = (this.data.dataStr<(couponData.etime*1) && couponData.is_open=='1') ? '1' : '0';
  802 + console.log('邀请函--------------------评价赠送的优惠券',couponData);
  803 + this.setData({
  804 + couponData:res.data[0]
  805 + })
  806 + }
  807 + })
  808 + },
786 // 根据券ID获取券详情 809 // 根据券ID获取券详情
787 getActivityByIdFun(ids, length) { 810 getActivityByIdFun(ids, length) {
788 let coupon_dataList = []; 811 let coupon_dataList = [];
@@ -800,8 +823,10 @@ Page({ @@ -800,8 +823,10 @@ Page({
800 let price = detail.price * 1; 823 let price = detail.price * 1;
801 detail.discount = cash != 0 ? ((price / cash) * 10).toFixed(1) : ''; 824 detail.discount = cash != 0 ? ((price / cash) * 10).toFixed(1) : '';
802 } 825 }
803 - coupon_dataList.push(detail);  
804 - if (length === ids.length) { 826 + coupon_dataList.push(detail);
  827 + if (length === coupon_dataList.length) {
  828 + coupon_dataList = coupon_dataList.filter(item=>{return this.data.dataStr<(item.etime*1) && item.is_open == '1'})
  829 + console.log('邀请函--------------------优惠券',coupon_dataList);
805 this.setData({ 830 this.setData({
806 coupon_dataList, 831 coupon_dataList,
807 }) 832 })
@@ -10,7 +10,7 @@ @@ -10,7 +10,7 @@
10 /> 10 />
11 <image class="giftImg" 11 <image class="giftImg"
12 bindtap="gotoSellerGift" 12 bindtap="gotoSellerGift"
13 - wx:if="{{(hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0) || (is_comments=='1' && !is_user_comments && marketing.is_comments_coupon=='1') || (hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data && (is_fix!='1' || (is_fix=='1' && dataStr<(recharge_data.exp_date.fix_edate*1))))}}" 13 + wx:if="{{(hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0) || (is_comments=='1' && !is_user_comments && marketing.is_comments_coupon=='1' && couponData && couponData.showCoupon =='1') || (hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data)}}"
14 src="https://nosqn.colorcun.com/sellerGift.png" mode=""/> 14 src="https://nosqn.colorcun.com/sellerGift.png" mode=""/>
15 <image wx:if="{{detail && detail.status =='4'}}" class="cannotImg" src="https://qn.colorcun.com/cancelImg.png" /> 15 <image wx:if="{{detail && detail.status =='4'}}" class="cannotImg" src="https://qn.colorcun.com/cancelImg.png" />
16 <image wx:if="{{options && options.isOrder == '1' && detail.status !='4'}}" class="cannotImg" src="https://qn.colorcun.com/overImg.png" /> 16 <image wx:if="{{options && options.isOrder == '1' && detail.status !='4'}}" class="cannotImg" src="https://qn.colorcun.com/overImg.png" />
@@ -65,7 +65,7 @@ @@ -65,7 +65,7 @@
65 </view> 65 </view>
66 <view class="preferentialCoupon" wx:if="{{hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0}}"> 66 <view class="preferentialCoupon" wx:if="{{hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0}}">
67 <block wx:for="{{coupon_dataList}}" wx:key="index" wx:for-index="index"> 67 <block wx:for="{{coupon_dataList}}" wx:key="index" wx:for-index="index">
68 - <view class="preferentialItems" wx:if="{{dataStr<(item.etime*1) && item.status == '1'}}"> 68 + <view class="preferentialItems">
69 <view class="itemLeft"> 69 <view class="itemLeft">
70 <text wx:if="{{item.discount!='0.00' && (item.use.is_cash=='1' || item.use.is_cash) && item.discount}}" class="discountText font24r">{{item.discount}}折</text> 70 <text wx:if="{{item.discount!='0.00' && (item.use.is_cash=='1' || item.use.is_cash) && item.discount}}" class="discountText font24r">{{item.discount}}折</text>
71 <view class="priceText" wx:if="{{item.price}}"> 71 <view class="priceText" wx:if="{{item.price}}">
@@ -93,8 +93,8 @@ @@ -93,8 +93,8 @@
93 </block> 93 </block>
94 </view> 94 </view>
95 <view wx:if="{{is_comments=='1' && !is_user_comments}}" class="evaluateBox" bindtap="evaluateFun"> 95 <view wx:if="{{is_comments=='1' && !is_user_comments}}" class="evaluateBox" bindtap="evaluateFun">
96 - <text wx:if="{{is_comments=='1' && marketing.is_comments_coupon!='1'}}">想<text>吐槽</text>?戳这里填写意见!--></text>  
97 - <text wx:if="{{marketing.is_comments_coupon=='1'}}">想<text>吐槽</text>?戳这里填写意见反馈赢好礼!</text> 96 + <text wx:if="{{is_comments=='1' && (marketing.is_comments_coupon!='1' || couponData.showCoupon!='1')}}">想<text class="font36r">吐槽</text>?戳这里填写意见!--></text>
  97 + <text wx:if="{{marketing.is_comments_coupon=='1' && couponData && couponData.showCoupon =='1'}}">想<text class="font36r">吐槽</text>?戳这里填写意见反馈赢好礼!</text>
98 <image wx:if="{{themeColor == 'pearlWhite'}}" src="https://nosqn.colorcun.com/evaluateWhite.png" mode="" /> 98 <image wx:if="{{themeColor == 'pearlWhite'}}" src="https://nosqn.colorcun.com/evaluateWhite.png" mode="" />
99 <image wx:elif="{{themeColor == 'turmeric' || themeColor == 'greenishYellow' || themeColor == 'golden'}}" src="https://nosqn.colorcun.com/evaluateYellow.png" mode="" /> 99 <image wx:elif="{{themeColor == 'turmeric' || themeColor == 'greenishYellow' || themeColor == 'golden'}}" src="https://nosqn.colorcun.com/evaluateYellow.png" mode="" />
100 <image wx:else src="https://nosqn.colorcun.com/evaluate2.png" mode="" /> 100 <image wx:else src="https://nosqn.colorcun.com/evaluate2.png" mode="" />
@@ -176,7 +176,7 @@ @@ -176,7 +176,7 @@
176 </view> 176 </view>
177 </view> 177 </view>
178 </view> 178 </view>
179 - <block wx:if="{{hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data && (is_fix!='1' || (is_fix=='1' && dataStr<(recharge_data.exp_date.fix_edate*1)))}}"> 179 + <block wx:if="{{hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data}}">
180 <view wx:if="{{titleType}}" class="chefText font36r"> 180 <view wx:if="{{titleType}}" class="chefText font36r">
181 <titleStyle isWhite="{{themeColor}}" titleStyleType="{{titleType}}" titleText="会员招募"></titleStyle> 181 <titleStyle isWhite="{{themeColor}}" titleStyleType="{{titleType}}" titleText="会员招募"></titleStyle>
182 </view> 182 </view>
@@ -59,6 +59,7 @@ Page({ @@ -59,6 +59,7 @@ Page({
59 paymentId: '', //定金id 59 paymentId: '', //定金id
60 wxml: null, 60 wxml: null,
61 imgSrc:'',//canvas图片地址 61 imgSrc:'',//canvas图片地址
  62 + couponData: '', //评价赠送优惠券数据
62 }, 63 },
63 screenHeight: '', 64 screenHeight: '',
64 attentionAnim: {}, 65 attentionAnim: {},
@@ -503,6 +504,10 @@ Page({ @@ -503,6 +504,10 @@ Page({
503 if (marketing) { 504 if (marketing) {
504 is_comments = marketing.is_comments ? marketing.is_comments : ''; 505 is_comments = marketing.is_comments ? marketing.is_comments : '';
505 coupon = marketing.coupon_data ? util.determine(marketing.coupon_data) : ''; 506 coupon = marketing.coupon_data ? util.determine(marketing.coupon_data) : '';
  507 + let info = marketing.coupon_data_comments ? util.determine(marketing.coupon_data_comments) : '';
  508 + let couponDataId = info && info.length > 0 ? info[0].id : {}
  509 + // 根据券ID获取评价赠送的券详情
  510 + if(couponDataId) this.getEvaluateFun(couponDataId)
506 } 511 }
507 // is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示 512 // is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示
508 if (coupon && util.getType(coupon) == 'object') { 513 if (coupon && util.getType(coupon) == 'object') {
@@ -727,14 +732,32 @@ Page({ @@ -727,14 +732,32 @@ Page({
727 if (recharge_list.is_price == '1') priceInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.price + '元余额'; 732 if (recharge_list.is_price == '1') priceInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.price + '元余额';
728 if (recharge_list.is_score == '1') scoreInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.score + '积分'; 733 if (recharge_list.is_score == '1') scoreInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.score + '积分';
729 if (recharge_list.is_coupons == '1' && recharge_list.coupons_names.length > 0) certificate = recharge_list.coupons_names.join('、'); 734 if (recharge_list.is_coupons == '1' && recharge_list.coupons_names.length > 0) certificate = recharge_list.coupons_names.join('、');
730 - this.setData({  
731 - recharge_data: detail, 735 + let recharge_data = (this.data.dataStr<detail.etime*1 && detail.is_open == '1') ? detail : ''
  736 + console.log('邀请函--------------充值',recharge_data);
  737 + this.setData({
  738 + recharge_data,
732 scoreInfo, 739 scoreInfo,
733 priceInfo, 740 priceInfo,
734 certificate 741 certificate
735 }) 742 })
736 }) 743 })
737 }, 744 },
  745 + // 获取评价赠送的券最新详情
  746 + getEvaluateFun(id){
  747 + App.Activity.GetActivityById({
  748 + id
  749 + }).then(res => {
  750 + if (res.data.length > 0) {
  751 + let couponData = res.data[0]
  752 + // showCoupon 代表赠送的券没过有效期 && 是开启状态
  753 + couponData.showCoupon = (this.data.dataStr<(couponData.etime*1) && couponData.is_open=='1') ? '1' : '0';
  754 + console.log('邀请函--------------------评价赠送的优惠券',couponData);
  755 + this.setData({
  756 + couponData:res.data[0]
  757 + })
  758 + }
  759 + })
  760 + },
738 // 根据券ID获取券详情 761 // 根据券ID获取券详情
739 getActivityByIdFun(ids, length) { 762 getActivityByIdFun(ids, length) {
740 let coupon_dataList = []; 763 let coupon_dataList = [];
@@ -752,8 +775,10 @@ Page({ @@ -752,8 +775,10 @@ Page({
752 let price = detail.price * 1; 775 let price = detail.price * 1;
753 detail.discount = cash != 0 ? ((price / cash) * 10).toFixed(1) : ''; 776 detail.discount = cash != 0 ? ((price / cash) * 10).toFixed(1) : '';
754 } 777 }
755 - coupon_dataList.push(detail);  
756 - if (length === ids.length) { 778 + coupon_dataList.push(detail);
  779 + if (length === coupon_dataList.length) {
  780 + coupon_dataList = coupon_dataList.filter(item=>{return this.data.dataStr<(item.etime*1) && item.is_open == '1'})
  781 + console.log('邀请函--------------------优惠券',coupon_dataList);
757 this.setData({ 782 this.setData({
758 coupon_dataList, 783 coupon_dataList,
759 }) 784 })
@@ -11,7 +11,7 @@ @@ -11,7 +11,7 @@
11 /> 11 />
12 <image class="giftImg" 12 <image class="giftImg"
13 bindtap="gotoSellerGift" 13 bindtap="gotoSellerGift"
14 - wx:if="{{(hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0) || (is_comments=='1' && !is_user_comments && marketing.is_comments_coupon=='1') || (hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data && (is_fix!='1' || (is_fix=='1' && dataStr<(recharge_data.exp_date.fix_edate*1))))}}" 14 + wx:if="{{(hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0) || (is_comments=='1' && !is_user_comments && marketing.is_comments_coupon=='1' && couponData && couponData.showCoupon =='1') || (hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data)}}"
15 src="https://nosqn.colorcun.com/sellerGift.png" mode=""/> 15 src="https://nosqn.colorcun.com/sellerGift.png" mode=""/>
16 <image wx:if="{{detail && detail.status =='4'}}" class="cannotImg" src="https://qn.colorcun.com/cancelImg.png" /> 16 <image wx:if="{{detail && detail.status =='4'}}" class="cannotImg" src="https://qn.colorcun.com/cancelImg.png" />
17 <image wx:if="{{options && options.isOrder == '1' && detail.status !='4'}}" class="cannotImg" src="https://qn.colorcun.com/overImg.png" /> 17 <image wx:if="{{options && options.isOrder == '1' && detail.status !='4'}}" class="cannotImg" src="https://qn.colorcun.com/overImg.png" />
@@ -87,7 +87,7 @@ @@ -87,7 +87,7 @@
87 </view> 87 </view>
88 <view class="preferential" wx:if="{{hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0}}"> 88 <view class="preferential" wx:if="{{hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0}}">
89 <block wx:for="{{coupon_dataList}}" wx:key="index" wx:for-index="index"> 89 <block wx:for="{{coupon_dataList}}" wx:key="index" wx:for-index="index">
90 - <view class="preferentialItems" wx:if="{{dataStr<(item.etime*1) && item.status == '1'}}"> 90 + <view class="preferentialItems">
91 <view class="left"> 91 <view class="left">
92 <view class="top"> 92 <view class="top">
93 <text class="font28r">{{item.aname}}</text> 93 <text class="font28r">{{item.aname}}</text>
@@ -114,8 +114,8 @@ @@ -114,8 +114,8 @@
114 </block> 114 </block>
115 </view> 115 </view>
116 <view wx:if="{{is_comments=='1' && !is_user_comments}}" class="evaluateBox" bindtap="evaluateFun"> 116 <view wx:if="{{is_comments=='1' && !is_user_comments}}" class="evaluateBox" bindtap="evaluateFun">
117 - <text wx:if="{{is_comments=='1' && marketing.is_comments_coupon!='1'}}">想吐槽?戳这里填写意见!--></text>  
118 - <text wx:if="{{marketing.is_comments_coupon=='1'}}">想吐槽?戳这里填写意见反馈赢好礼!</text> 117 + <text wx:if="{{is_comments=='1' && (marketing.is_comments_coupon!='1' || couponData.showCoupon!='1')}}">想<text class="font36r">吐槽</text>?戳这里填写意见!--></text>
  118 + <text wx:if="{{marketing.is_comments_coupon=='1' && couponData && couponData.showCoupon =='1'}}">想<text class="font36r">吐槽</text>?戳这里填写意见反馈赢好礼!</text>
119 <image src="https://qn.colorcun.com/evaluate.png" mode="" /> 119 <image src="https://qn.colorcun.com/evaluate.png" mode="" />
120 </view> 120 </view>
121 <view class="reserveBox" wx:if="{{reserveData && (reserveData.title || reserveData.content)}}"> 121 <view class="reserveBox" wx:if="{{reserveData && (reserveData.title || reserveData.content)}}">
@@ -236,12 +236,11 @@ @@ -236,12 +236,11 @@
236 </view> 236 </view>
237 </view> 237 </view>
238 </view> 238 </view>
239 - <view class="preferential" wx:if="{{hasValueRecharge && marketing && (marketing.is_coupon=='1' || marketing.is_recharge=='1')}}">  
240 - <view class="rubric rubric1" wx:if="{{marketing && marketing.is_recharge=='1' && recharge_data && (is_fix!='1' || (is_fix=='1' && dataStr<(recharge_data.exp_date.fix_edate*1)))}}"> 239 + <view class="preferential" wx:if="{{hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data}}">
  240 + <view class="rubric rubric1">
241 特别优惠 241 特别优惠
242 </view> 242 </view>
243 - <!-- 当前日期要大于限制结束日期 -->  
244 - <view class="preferentialItems" wx:if="{{marketing && marketing.is_recharge=='1' && recharge_data && (is_fix!='1' || (is_fix=='1' && dataStr<(recharge_data.exp_date.fix_edate*1)))}}"> 243 + <view class="preferentialItems">
245 <view class="left"> 244 <view class="left">
246 <view class="top"> 245 <view class="top">
247 <text class="font28r">{{recharge_data.rname}}</text> 246 <text class="font28r">{{recharge_data.rname}}</text>
@@ -59,6 +59,7 @@ Page({ @@ -59,6 +59,7 @@ Page({
59 paymentId: '', //定金id 59 paymentId: '', //定金id
60 wxml: null, 60 wxml: null,
61 imgSrc:'',//canvas图片地址 61 imgSrc:'',//canvas图片地址
  62 + couponData: '', //评价赠送优惠券数据
62 }, 63 },
63 tablestr: '', 64 tablestr: '',
64 urlsValue: [], 65 urlsValue: [],
@@ -556,7 +557,11 @@ Page({ @@ -556,7 +557,11 @@ Page({
556 if (marketing) { 557 if (marketing) {
557 is_comments = marketing.is_comments ? marketing.is_comments : ''; 558 is_comments = marketing.is_comments ? marketing.is_comments : '';
558 coupon = marketing.coupon_data ? util.determine(marketing.coupon_data) : ''; 559 coupon = marketing.coupon_data ? util.determine(marketing.coupon_data) : '';
559 - } 560 + let info = marketing.coupon_data_comments ? util.determine(marketing.coupon_data_comments) : '';
  561 + let couponDataId = info && info.length > 0 ? info[0].id : {}
  562 + // 根据券ID获取评价赠送的券详情
  563 + if(couponDataId) this.getEvaluateFun(couponDataId)
  564 + }
560 // is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示 565 // is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示
561 if (coupon && util.getType(coupon) == 'object') { 566 if (coupon && util.getType(coupon) == 'object') {
562 couponList.push({ 567 couponList.push({
@@ -776,14 +781,32 @@ Page({ @@ -776,14 +781,32 @@ Page({
776 if (recharge_list.is_price == '1') priceInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.price + '元余额'; 781 if (recharge_list.is_price == '1') priceInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.price + '元余额';
777 if (recharge_list.is_score == '1') scoreInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.score + '积分'; 782 if (recharge_list.is_score == '1') scoreInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.score + '积分';
778 if (recharge_list.is_coupons == '1' && recharge_list.coupons_names.length > 0) certificate = recharge_list.coupons_names.join('、'); 783 if (recharge_list.is_coupons == '1' && recharge_list.coupons_names.length > 0) certificate = recharge_list.coupons_names.join('、');
779 - this.setData({  
780 - recharge_data: detail, 784 + let recharge_data = (this.data.dataStr<detail.etime*1 && detail.is_open == '1') ? detail : ''
  785 + console.log('邀请函--------------充值',recharge_data);
  786 + this.setData({
  787 + recharge_data,
781 scoreInfo, 788 scoreInfo,
782 priceInfo, 789 priceInfo,
783 certificate 790 certificate
784 }) 791 })
785 }) 792 })
786 }, 793 },
  794 + // 获取评价赠送的券最新详情
  795 + getEvaluateFun(id){
  796 + App.Activity.GetActivityById({
  797 + id
  798 + }).then(res => {
  799 + if (res.data.length > 0) {
  800 + let couponData = res.data[0]
  801 + // showCoupon 代表赠送的券没过有效期 && 是开启状态
  802 + couponData.showCoupon = (this.data.dataStr<(couponData.etime*1) && couponData.is_open=='1') ? '1' : '0';
  803 + console.log('邀请函--------------------评价赠送的优惠券',couponData);
  804 + this.setData({
  805 + couponData:res.data[0]
  806 + })
  807 + }
  808 + })
  809 + },
787 // 根据券ID获取券详情 810 // 根据券ID获取券详情
788 getActivityByIdFun(ids, length) { 811 getActivityByIdFun(ids, length) {
789 let coupon_dataList = []; 812 let coupon_dataList = [];
@@ -801,8 +824,10 @@ Page({ @@ -801,8 +824,10 @@ Page({
801 let price = detail.price * 1; 824 let price = detail.price * 1;
802 detail.discount = cash != 0 ? ((price / cash) * 10).toFixed(1) : ''; 825 detail.discount = cash != 0 ? ((price / cash) * 10).toFixed(1) : '';
803 } 826 }
804 - coupon_dataList.push(detail);  
805 - if (length === ids.length) { 827 + coupon_dataList.push(detail);
  828 + if (length === coupon_dataList.length) {
  829 + coupon_dataList = coupon_dataList.filter(item=>{return this.data.dataStr<(item.etime*1) && item.is_open == '1'})
  830 + console.log('邀请函--------------------优惠券',coupon_dataList);
806 this.setData({ 831 this.setData({
807 coupon_dataList, 832 coupon_dataList,
808 }) 833 })
@@ -11,7 +11,7 @@ @@ -11,7 +11,7 @@
11 /> 11 />
12 <image class="giftImg" 12 <image class="giftImg"
13 bindtap="gotoSellerGift" 13 bindtap="gotoSellerGift"
14 - wx:if="{{(hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0) || (is_comments=='1' && !is_user_comments && marketing.is_comments_coupon=='1') || (hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data && (is_fix!='1' || (is_fix=='1' && dataStr<(recharge_data.exp_date.fix_edate*1))))}}" 14 + wx:if="{{(hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0) || (is_comments=='1' && !is_user_comments && marketing.is_comments_coupon=='1' && couponData && couponData.showCoupon =='1') || (hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data)}}"
15 src="https://nosqn.colorcun.com/sellerGift.png" mode=""/> 15 src="https://nosqn.colorcun.com/sellerGift.png" mode=""/>
16 <image wx:if="{{detail && detail.status =='4'}}" class="cannotImg" src="https://qn.colorcun.com/cancelImg.png" /> 16 <image wx:if="{{detail && detail.status =='4'}}" class="cannotImg" src="https://qn.colorcun.com/cancelImg.png" />
17 <image wx:if="{{options && options.isOrder == '1' && detail.status !='4'}}" class="cannotImg" src="https://qn.colorcun.com/overImg.png" /> 17 <image wx:if="{{options && options.isOrder == '1' && detail.status !='4'}}" class="cannotImg" src="https://qn.colorcun.com/overImg.png" />
@@ -80,7 +80,7 @@ @@ -80,7 +80,7 @@
80 </view> 80 </view>
81 <view class="preferentialCoupon" wx:if="{{hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0}}"> 81 <view class="preferentialCoupon" wx:if="{{hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0}}">
82 <block wx:for="{{coupon_dataList}}" wx:key="index" wx:for-index="index"> 82 <block wx:for="{{coupon_dataList}}" wx:key="index" wx:for-index="index">
83 - <view class="preferentialItems" wx:if="{{dataStr<(item.etime*1) && item.status == '1'}}"> 83 + <view class="preferentialItems">
84 <view class="itemLeft"> 84 <view class="itemLeft">
85 <text wx:if="{{item.discount!='0.00' && (item.use.is_cash=='1' || item.use.is_cash) && item.discount}}" class="discountText font24r">{{item.discount}}折</text> 85 <text wx:if="{{item.discount!='0.00' && (item.use.is_cash=='1' || item.use.is_cash) && item.discount}}" class="discountText font24r">{{item.discount}}折</text>
86 <view class="priceText" wx:if="{{item.price}}"> 86 <view class="priceText" wx:if="{{item.price}}">
@@ -108,8 +108,8 @@ @@ -108,8 +108,8 @@
108 </block> 108 </block>
109 </view> 109 </view>
110 <view wx:if="{{is_comments=='1' && !is_user_comments}}" class="evaluateBox" bindtap="evaluateFun"> 110 <view wx:if="{{is_comments=='1' && !is_user_comments}}" class="evaluateBox" bindtap="evaluateFun">
111 - <text wx:if="{{is_comments=='1' && marketing.is_comments_coupon!='1'}}">想<text>吐槽</text>?戳这里填写意见!--></text>  
112 - <text wx:if="{{marketing.is_comments_coupon=='1'}}">想<text>吐槽</text>?戳这里填写意见反馈赢好礼!</text> 111 + <text wx:if="{{is_comments=='1' && (marketing.is_comments_coupon!='1' || couponData.showCoupon!='1')}}">想<text class="font36r">吐槽</text>?戳这里填写意见!--></text>
  112 + <text wx:if="{{marketing.is_comments_coupon=='1' && couponData && couponData.showCoupon =='1'}}">想<text class="font36r">吐槽</text>?戳这里填写意见反馈赢好礼!</text>
113 <image wx:if="{{themeColor == 'pearlWhite'}}" src="https://nosqn.colorcun.com/evaluateWhite.png" mode="" /> 113 <image wx:if="{{themeColor == 'pearlWhite'}}" src="https://nosqn.colorcun.com/evaluateWhite.png" mode="" />
114 <image wx:elif="{{themeColor == 'turmeric' || themeColor == 'greenishYellow' || themeColor == 'golden'}}" src="https://nosqn.colorcun.com/evaluateYellow.png" mode="" /> 114 <image wx:elif="{{themeColor == 'turmeric' || themeColor == 'greenishYellow' || themeColor == 'golden'}}" src="https://nosqn.colorcun.com/evaluateYellow.png" mode="" />
115 <image wx:else src="https://nosqn.colorcun.com/evaluate2.png" mode="" /> 115 <image wx:else src="https://nosqn.colorcun.com/evaluate2.png" mode="" />
@@ -191,7 +191,7 @@ @@ -191,7 +191,7 @@
191 </view> 191 </view>
192 </view> 192 </view>
193 </view> 193 </view>
194 - <block wx:if="{{hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data && (is_fix!='1' || (is_fix=='1' && dataStr<(recharge_data.exp_date.fix_edate*1)))}}"> 194 + <block wx:if="{{hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data}}">
195 <view wx:if="{{titleType}}" class="chefText font36r"> 195 <view wx:if="{{titleType}}" class="chefText font36r">
196 <titleStyle isWhite="{{themeColor}}" titleStyleType="{{titleType}}" titleText="会员招募"></titleStyle> 196 <titleStyle isWhite="{{themeColor}}" titleStyleType="{{titleType}}" titleText="会员招募"></titleStyle>
197 </view> 197 </view>
@@ -59,6 +59,7 @@ Page({ @@ -59,6 +59,7 @@ Page({
59 paymentId: '', //定金id 59 paymentId: '', //定金id
60 wxml: null, 60 wxml: null,
61 imgSrc:'',//canvas图片地址 61 imgSrc:'',//canvas图片地址
  62 + couponData: '', //评价赠送优惠券数据
62 }, 63 },
63 tablestr: '', 64 tablestr: '',
64 urlsValue: [], 65 urlsValue: [],
@@ -555,7 +556,11 @@ Page({ @@ -555,7 +556,11 @@ Page({
555 if (marketing) { 556 if (marketing) {
556 is_comments = marketing.is_comments ? marketing.is_comments : ''; 557 is_comments = marketing.is_comments ? marketing.is_comments : '';
557 coupon = marketing.coupon_data ? util.determine(marketing.coupon_data) : ''; 558 coupon = marketing.coupon_data ? util.determine(marketing.coupon_data) : '';
558 - } 559 + let info = marketing.coupon_data_comments ? util.determine(marketing.coupon_data_comments) : '';
  560 + let couponDataId = info && info.length > 0 ? info[0].id : {}
  561 + // 根据券ID获取评价赠送的券详情
  562 + if(couponDataId) this.getEvaluateFun(couponDataId)
  563 + }
559 // is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示 564 // is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示
560 if (coupon && util.getType(coupon) == 'object') { 565 if (coupon && util.getType(coupon) == 'object') {
561 couponList.push({ 566 couponList.push({
@@ -775,14 +780,32 @@ Page({ @@ -775,14 +780,32 @@ Page({
775 if (recharge_list.is_price == '1') priceInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.price + '元余额'; 780 if (recharge_list.is_price == '1') priceInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.price + '元余额';
776 if (recharge_list.is_score == '1') scoreInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.score + '积分'; 781 if (recharge_list.is_score == '1') scoreInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.score + '积分';
777 if (recharge_list.is_coupons == '1' && recharge_list.coupons_names.length > 0) certificate = recharge_list.coupons_names.join('、'); 782 if (recharge_list.is_coupons == '1' && recharge_list.coupons_names.length > 0) certificate = recharge_list.coupons_names.join('、');
778 - this.setData({  
779 - recharge_data: detail, 783 + let recharge_data = (this.data.dataStr<detail.etime*1 && detail.is_open == '1') ? detail : ''
  784 + console.log('邀请函--------------充值',recharge_data);
  785 + this.setData({
  786 + recharge_data,
780 scoreInfo, 787 scoreInfo,
781 priceInfo, 788 priceInfo,
782 certificate 789 certificate
783 }) 790 })
784 }) 791 })
785 }, 792 },
  793 + // 获取评价赠送的券最新详情
  794 + getEvaluateFun(id){
  795 + App.Activity.GetActivityById({
  796 + id
  797 + }).then(res => {
  798 + if (res.data.length > 0) {
  799 + let couponData = res.data[0]
  800 + // showCoupon 代表赠送的券没过有效期 && 是开启状态
  801 + couponData.showCoupon = (this.data.dataStr<(couponData.etime*1) && couponData.is_open=='1') ? '1' : '0';
  802 + console.log('邀请函--------------------评价赠送的优惠券',couponData);
  803 + this.setData({
  804 + couponData:res.data[0]
  805 + })
  806 + }
  807 + })
  808 + },
786 // 根据券ID获取券详情 809 // 根据券ID获取券详情
787 getActivityByIdFun(ids, length) { 810 getActivityByIdFun(ids, length) {
788 let coupon_dataList = []; 811 let coupon_dataList = [];
@@ -800,8 +823,10 @@ Page({ @@ -800,8 +823,10 @@ Page({
800 let price = detail.price * 1; 823 let price = detail.price * 1;
801 detail.discount = cash != 0 ? ((price / cash) * 10).toFixed(1) : ''; 824 detail.discount = cash != 0 ? ((price / cash) * 10).toFixed(1) : '';
802 } 825 }
803 - coupon_dataList.push(detail);  
804 - if (length === ids.length) { 826 + coupon_dataList.push(detail);
  827 + if (length === coupon_dataList.length) {
  828 + coupon_dataList = coupon_dataList.filter(item=>{return this.data.dataStr<(item.etime*1) && item.is_open == '1'})
  829 + console.log('邀请函--------------------优惠券',coupon_dataList);
805 this.setData({ 830 this.setData({
806 coupon_dataList, 831 coupon_dataList,
807 }) 832 })
@@ -11,7 +11,7 @@ @@ -11,7 +11,7 @@
11 /> 11 />
12 <image class="giftImg" 12 <image class="giftImg"
13 bindtap="gotoSellerGift" 13 bindtap="gotoSellerGift"
14 - wx:if="{{(hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0) || (is_comments=='1' && !is_user_comments && marketing.is_comments_coupon=='1') || (hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data && (is_fix!='1' || (is_fix=='1' && dataStr<(recharge_data.exp_date.fix_edate*1))))}}" 14 + wx:if="{{(hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0) || (is_comments=='1' && !is_user_comments && marketing.is_comments_coupon=='1' && couponData && couponData.showCoupon =='1') || (hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data)}}"
15 src="https://nosqn.colorcun.com/sellerGift.png" mode=""/> 15 src="https://nosqn.colorcun.com/sellerGift.png" mode=""/>
16 <image wx:if="{{detail && detail.status =='4'}}" class="cannotImg" src="https://qn.colorcun.com/cancelImg.png" /> 16 <image wx:if="{{detail && detail.status =='4'}}" class="cannotImg" src="https://qn.colorcun.com/cancelImg.png" />
17 <image wx:if="{{options && options.isOrder == '1' && detail.status !='4'}}" class="cannotImg" src="https://qn.colorcun.com/overImg.png" /> 17 <image wx:if="{{options && options.isOrder == '1' && detail.status !='4'}}" class="cannotImg" src="https://qn.colorcun.com/overImg.png" />
@@ -77,7 +77,7 @@ @@ -77,7 +77,7 @@
77 </view> 77 </view>
78 <view class="preferentialCoupon" wx:if="{{hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0}}"> 78 <view class="preferentialCoupon" wx:if="{{hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0}}">
79 <block wx:for="{{coupon_dataList}}" wx:key="index" wx:for-index="index"> 79 <block wx:for="{{coupon_dataList}}" wx:key="index" wx:for-index="index">
80 - <view class="preferentialItems" wx:if="{{dataStr<(item.etime*1) && item.status == '1'}}"> 80 + <view class="preferentialItems">
81 <view class="itemLeft"> 81 <view class="itemLeft">
82 <text wx:if="{{item.discount!='0.00' && (item.use.is_cash=='1' || item.use.is_cash) && item.discount}}" class="discountText font24r">{{item.discount}}折</text> 82 <text wx:if="{{item.discount!='0.00' && (item.use.is_cash=='1' || item.use.is_cash) && item.discount}}" class="discountText font24r">{{item.discount}}折</text>
83 <view class="priceText" wx:if="{{item.price}}"> 83 <view class="priceText" wx:if="{{item.price}}">
@@ -105,8 +105,8 @@ @@ -105,8 +105,8 @@
105 </block> 105 </block>
106 </view> 106 </view>
107 <view wx:if="{{is_comments=='1' && !is_user_comments}}" class="evaluateBox" bindtap="evaluateFun"> 107 <view wx:if="{{is_comments=='1' && !is_user_comments}}" class="evaluateBox" bindtap="evaluateFun">
108 - <text wx:if="{{is_comments=='1' && marketing.is_comments_coupon!='1'}}">想<text>吐槽</text>?戳这里填写意见!--></text>  
109 - <text wx:if="{{marketing.is_comments_coupon=='1'}}">想<text>吐槽</text>?戳这里填写意见反馈赢好礼!</text> 108 + <text wx:if="{{is_comments=='1' && (marketing.is_comments_coupon!='1' || couponData.showCoupon!='1')}}">想<text class="font36r">吐槽</text>?戳这里填写意见!--></text>
  109 + <text wx:if="{{marketing.is_comments_coupon=='1' && couponData && couponData.showCoupon =='1'}}">想<text class="font36r">吐槽</text>?戳这里填写意见反馈赢好礼!</text>
110 <image wx:if="{{themeColor == 'pearlWhite'}}" src="https://nosqn.colorcun.com/evaluateWhite.png" mode="" /> 110 <image wx:if="{{themeColor == 'pearlWhite'}}" src="https://nosqn.colorcun.com/evaluateWhite.png" mode="" />
111 <image wx:elif="{{themeColor == 'turmeric' || themeColor == 'greenishYellow' || themeColor == 'golden'}}" src="https://nosqn.colorcun.com/evaluateYellow.png" mode="" /> 111 <image wx:elif="{{themeColor == 'turmeric' || themeColor == 'greenishYellow' || themeColor == 'golden'}}" src="https://nosqn.colorcun.com/evaluateYellow.png" mode="" />
112 <image wx:else src="https://nosqn.colorcun.com/evaluate2.png" mode="" /> 112 <image wx:else src="https://nosqn.colorcun.com/evaluate2.png" mode="" />
@@ -188,7 +188,7 @@ @@ -188,7 +188,7 @@
188 </view> 188 </view>
189 </view> 189 </view>
190 </view> 190 </view>
191 - <block wx:if="{{hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data && (is_fix!='1' || (is_fix=='1' && dataStr<(recharge_data.exp_date.fix_edate*1)))}}"> 191 + <block wx:if="{{hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data}}">
192 <view wx:if="{{titleType}}" class="chefText font36r"> 192 <view wx:if="{{titleType}}" class="chefText font36r">
193 <titleStyle isWhite="{{themeColor}}" titleStyleType="{{titleType}}" titleText="会员招募"></titleStyle> 193 <titleStyle isWhite="{{themeColor}}" titleStyleType="{{titleType}}" titleText="会员招募"></titleStyle>
194 </view> 194 </view>
@@ -67,6 +67,7 @@ Page({ @@ -67,6 +67,7 @@ Page({
67 wxml: null, 67 wxml: null,
68 imgSrc: '', //canvas图片地址 68 imgSrc: '', //canvas图片地址
69 colors:'',//导航栏颜色 69 colors:'',//导航栏颜色
  70 + couponData: '', //评价赠送优惠券数据
70 }, 71 },
71 tablestr: '', 72 tablestr: '',
72 urlsValue: [], 73 urlsValue: [],
@@ -592,6 +593,10 @@ Page({ @@ -592,6 +593,10 @@ Page({
592 if (marketing) { 593 if (marketing) {
593 is_comments = marketing.is_comments ? marketing.is_comments : ''; 594 is_comments = marketing.is_comments ? marketing.is_comments : '';
594 coupon = marketing.coupon_data ? util.determine(marketing.coupon_data) : ''; 595 coupon = marketing.coupon_data ? util.determine(marketing.coupon_data) : '';
  596 + let info = marketing.coupon_data_comments ? util.determine(marketing.coupon_data_comments) : '';
  597 + let couponDataId = info && info.length > 0 ? info[0].id : {}
  598 + // 根据券ID获取评价赠送的券详情
  599 + if(couponDataId) this.getEvaluateFun(couponDataId)
595 } 600 }
596 // is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示 601 // is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示
597 if (coupon && util.getType(coupon) == 'object') { 602 if (coupon && util.getType(coupon) == 'object') {
@@ -624,7 +629,7 @@ Page({ @@ -624,7 +629,7 @@ Page({
624 themeColor, 629 themeColor,
625 settingUrl, 630 settingUrl,
626 inviteImgUrl, 631 inviteImgUrl,
627 - colors, 632 + colors,
628 } 633 }
629 console.log('获取数据', { 634 console.log('获取数据', {
630 ...obj 635 ...obj
@@ -652,7 +657,7 @@ Page({ @@ -652,7 +657,7 @@ Page({
652 themeColor, 657 themeColor,
653 settingUrl, 658 settingUrl,
654 inviteImgUrl, 659 inviteImgUrl,
655 - colors, 660 + colors,
656 }) 661 })
657 // 开启语音播报 662 // 开启语音播报
658 if (reserve && reserve.swich_voice == '1') { 663 if (reserve && reserve.swich_voice == '1') {
@@ -809,7 +814,7 @@ Page({ @@ -809,7 +814,7 @@ Page({
809 App.Activity.GetNewRecharge({ 814 App.Activity.GetNewRecharge({
810 id 815 id
811 }).then(res => { 816 }).then(res => {
812 - let detail = res.data 817 + let detail = res.data
813 let exp_date = res.data.exp_date ? JSON.parse(res.data.exp_date) : '' 818 let exp_date = res.data.exp_date ? JSON.parse(res.data.exp_date) : ''
814 let recharge_list = res.data.recharge_list ? JSON.parse(res.data.recharge_list) : '' 819 let recharge_list = res.data.recharge_list ? JSON.parse(res.data.recharge_list) : ''
815 let priceInfo, scoreInfo, certificate; 820 let priceInfo, scoreInfo, certificate;
@@ -818,14 +823,32 @@ Page({ @@ -818,14 +823,32 @@ Page({
818 if (recharge_list.is_price == '1') priceInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.price + '元余额'; 823 if (recharge_list.is_price == '1') priceInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.price + '元余额';
819 if (recharge_list.is_score == '1') scoreInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.score + '积分'; 824 if (recharge_list.is_score == '1') scoreInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.score + '积分';
820 if (recharge_list.is_coupons == '1' && recharge_list.coupons_names.length > 0) certificate = recharge_list.coupons_names.join('、'); 825 if (recharge_list.is_coupons == '1' && recharge_list.coupons_names.length > 0) certificate = recharge_list.coupons_names.join('、');
821 - this.setData({  
822 - recharge_data: detail, 826 + let recharge_data = (this.data.dataStr<detail.etime*1 && detail.is_open == '1') ? detail : ''
  827 + console.log('邀请函--------------充值',recharge_data);
  828 + this.setData({
  829 + recharge_data,
823 scoreInfo, 830 scoreInfo,
824 priceInfo, 831 priceInfo,
825 certificate 832 certificate
826 }) 833 })
827 }) 834 })
828 - }, 835 + },
  836 + // 获取评价赠送的券最新详情
  837 + getEvaluateFun(id){
  838 + App.Activity.GetActivityById({
  839 + id
  840 + }).then(res => {
  841 + if (res.data.length > 0) {
  842 + let couponData = res.data[0]
  843 + // showCoupon 代表赠送的券没过有效期 && 是开启状态
  844 + couponData.showCoupon = (this.data.dataStr<(couponData.etime*1) && couponData.is_open=='1') ? '1' : '0';
  845 + console.log('邀请函--------------------评价赠送的优惠券',couponData);
  846 + this.setData({
  847 + couponData:res.data[0]
  848 + })
  849 + }
  850 + })
  851 + },
829 // 根据券ID获取券详情 852 // 根据券ID获取券详情
830 getActivityByIdFun(ids, length) { 853 getActivityByIdFun(ids, length) {
831 let coupon_dataList = []; 854 let coupon_dataList = [];
@@ -842,9 +865,11 @@ Page({ @@ -842,9 +865,11 @@ Page({
842 let cash = detail.use.cash * 1; 865 let cash = detail.use.cash * 1;
843 let price = detail.price * 1; 866 let price = detail.price * 1;
844 detail.discount = cash != 0 ? ((price / cash) * 10).toFixed(1) : ''; 867 detail.discount = cash != 0 ? ((price / cash) * 10).toFixed(1) : '';
845 - }  
846 - coupon_dataList.push(detail);  
847 - if (length === ids.length) { 868 + }
  869 + coupon_dataList.push(detail);
  870 + if (length === coupon_dataList.length) {
  871 + coupon_dataList = coupon_dataList.filter(item=>{return this.data.dataStr<(item.etime*1) && item.is_open == '1'})
  872 + console.log('邀请函--------------------优惠券',coupon_dataList);
848 this.setData({ 873 this.setData({
849 coupon_dataList, 874 coupon_dataList,
850 }) 875 })
@@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@
5 <image wx:if="{{hasValueBroadcast && reserve && reserve.swich_voice && reserve.swich_voice=='1'}}" class="musicImg" src="{{isPlay=='1'?'https://qn.colorcun.com/open.svg':'https://qn.colorcun.com/close.svg'}}" bindtap="stopMusic" animation="{{attentionAnim}}" /> 5 <image wx:if="{{hasValueBroadcast && reserve && reserve.swich_voice && reserve.swich_voice=='1'}}" class="musicImg" src="{{isPlay=='1'?'https://qn.colorcun.com/open.svg':'https://qn.colorcun.com/close.svg'}}" bindtap="stopMusic" animation="{{attentionAnim}}" />
6 <image class="giftImg" 6 <image class="giftImg"
7 bindtap="gotoSellerGift" 7 bindtap="gotoSellerGift"
8 - wx:if="{{(hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0) || (is_comments=='1' && !is_user_comments && marketing.is_comments_coupon=='1') || (hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data && (is_fix!='1' || (is_fix=='1' && dataStr<(recharge_data.exp_date.fix_edate*1))))}}" 8 + wx:if="{{(hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0) || (is_comments=='1' && !is_user_comments && marketing.is_comments_coupon=='1' && couponData && couponData.showCoupon =='1') || (hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data)}}"
9 src="https://nosqn.colorcun.com/sellerGift.png" mode=""/> 9 src="https://nosqn.colorcun.com/sellerGift.png" mode=""/>
10 <image wx:if="{{detail && detail.status =='4'}}" class="cannotImg" src="https://qn.colorcun.com/cancelImg.png" /> 10 <image wx:if="{{detail && detail.status =='4'}}" class="cannotImg" src="https://qn.colorcun.com/cancelImg.png" />
11 <image wx:if="{{options && options.isOrder == '1' && detail.status !='4'}}" class="cannotImg" src="https://qn.colorcun.com/overImg.png" /> 11 <image wx:if="{{options && options.isOrder == '1' && detail.status !='4'}}" class="cannotImg" src="https://qn.colorcun.com/overImg.png" />
@@ -82,7 +82,7 @@ @@ -82,7 +82,7 @@
82 </view> 82 </view>
83 <view class="preferentialCoupon" wx:if="{{hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0}}"> 83 <view class="preferentialCoupon" wx:if="{{hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0}}">
84 <block wx:for="{{coupon_dataList}}" wx:key="index" wx:for-index="index"> 84 <block wx:for="{{coupon_dataList}}" wx:key="index" wx:for-index="index">
85 - <view class="preferentialItems" wx:if="{{dataStr<(item.etime*1) && item.status == '1'}}"> 85 + <view class="preferentialItems">
86 <view class="itemLeft"> 86 <view class="itemLeft">
87 <text wx:if="{{item.discount!='0.00' && (item.use.is_cash=='1' || item.use.is_cash) && item.discount}}" class="discountText font24r">{{item.discount}}折</text> 87 <text wx:if="{{item.discount!='0.00' && (item.use.is_cash=='1' || item.use.is_cash) && item.discount}}" class="discountText font24r">{{item.discount}}折</text>
88 <view class="priceText" wx:if="{{item.price}}"> 88 <view class="priceText" wx:if="{{item.price}}">
@@ -110,8 +110,8 @@ @@ -110,8 +110,8 @@
110 </block> 110 </block>
111 </view> 111 </view>
112 <view wx:if="{{is_comments=='1' && !is_user_comments}}" class="evaluateBox" bindtap="evaluateFun"> 112 <view wx:if="{{is_comments=='1' && !is_user_comments}}" class="evaluateBox" bindtap="evaluateFun">
113 - <text wx:if="{{is_comments=='1' && marketing.is_comments_coupon!='1'}}">想<text class="font36r">吐槽</text>?戳这里填写意见!--></text>  
114 - <text wx:if="{{marketing.is_comments_coupon=='1'}}">想<text class="font36r">吐槽</text>?戳这里填写意见反馈赢好礼!</text> 113 + <text wx:if="{{is_comments=='1' && (marketing.is_comments_coupon!='1' || couponData.showCoupon!='1')}}">想<text class="font36r">吐槽</text>?戳这里填写意见!--></text>
  114 + <text wx:if="{{marketing.is_comments_coupon=='1' && couponData && couponData.showCoupon =='1'}}">想<text class="font36r">吐槽</text>?戳这里填写意见反馈赢好礼!</text>
115 <image src="https://nosqn.colorcun.com/evaluate2.png" mode="" /> 115 <image src="https://nosqn.colorcun.com/evaluate2.png" mode="" />
116 </view> 116 </view>
117 <view class="reserveBox" wx:if="{{reserveData && (reserveData.title || reserveData.content)}}"> 117 <view class="reserveBox" wx:if="{{reserveData && (reserveData.title || reserveData.content)}}">
@@ -193,7 +193,7 @@ @@ -193,7 +193,7 @@
193 </view> 193 </view>
194 </view> 194 </view>
195 <view class="introduce introduceBottom"> 195 <view class="introduce introduceBottom">
196 - <block wx:if="{{hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data && (is_fix!='1' || (is_fix=='1' && dataStr<(recharge_data.exp_date.fix_edate*1)))}}"> 196 + <block wx:if="{{hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data}}">
197 <block wx:if="{{titleType}}"> 197 <block wx:if="{{titleType}}">
198 <titleStyle titleStyleType="{{titleType}}" titleText="会员招募"></titleStyle> 198 <titleStyle titleStyleType="{{titleType}}" titleText="会员招募"></titleStyle>
199 </block> 199 </block>
@@ -21,6 +21,8 @@ Page({ @@ -21,6 +21,8 @@ Page({
21 coupon:'', 21 coupon:'',
22 is_user_comments:'', 22 is_user_comments:'',
23 showLoading:false, 23 showLoading:false,
  24 + couponData: '', //评价赠送优惠券数据
  25 + dataStr: Date.now() * 1 / 1000,
24 }, 26 },
25 text: '', 27 text: '',
26 /** 28 /**
@@ -74,24 +76,11 @@ Page({ @@ -74,24 +76,11 @@ Page({
74 marketing = util.determine(data.marketing); 76 marketing = util.determine(data.marketing);
75 if(marketing){ 77 if(marketing){
76 is_comments = marketing.is_comments?marketing.is_comments:''; 78 is_comments = marketing.is_comments?marketing.is_comments:'';
77 - marketing.coupon_data_comments=(is_comments=='1' && marketing.is_comments_coupon=='1')?util.determine(marketing.coupon_data_comments):'';  
78 - }  
79 - let coupon_data_comments=marketing.coupon_data_comments;//赠送优惠券的列表  
80 - let coupon=(marketing && marketing.is_comments=='1' && marketing.is_comments_coupon=='1')?'1':'0';//评价赠送优惠券  
81 - let couponId,price,use;  
82 - if(coupon && coupon_data_comments && coupon_data_comments.length>0){  
83 - let obj=coupon_data_comments[0];  
84 - console.log('填写意见获取的券的信息',obj);  
85 - couponId=obj.id;  
86 - price=obj.price;  
87 - use=JSON.stringify(obj.use) 79 + let info = marketing.coupon_data_comments ? util.determine(marketing.coupon_data_comments) : '';
  80 + let couponDataId = info && info.length > 0 ? info[0].id : {}
  81 + // 根据券ID获取评价赠送的券详情
  82 + if (couponDataId) this.getEvaluateFun(couponDataId, is_comments, marketing.is_comments_coupon)
88 } 83 }
89 - this.setData({  
90 - coupon:coupon || '',  
91 - couponId:couponId || '',  
92 - price:price || '',  
93 - use:use || '',  
94 - })  
95 this.setData({ 84 this.setData({
96 marketing, 85 marketing,
97 }) 86 })
@@ -99,6 +88,28 @@ Page({ @@ -99,6 +88,28 @@ Page({
99 console.log('GetSellerTemplateConf请求失败'); 88 console.log('GetSellerTemplateConf请求失败');
100 }) 89 })
101 }, 90 },
  91 + // 获取评价赠送的券最新详情
  92 + getEvaluateFun(id, is_comments, is_comments_coupon) {
  93 + App.Activity.GetActivityById({
  94 + id
  95 + }).then(res => {
  96 + if (res.data.length > 0) {
  97 + let couponData = res.data[0]
  98 + // showCoupon 代表赠送的券没过有效期 && 是开启状态
  99 + couponData.showCoupon = (this.data.dataStr < (couponData.etime * 1) && couponData.is_open == '1') ? '1' : '0';
  100 + let coupon = (is_comments == '1' && is_comments_coupon == '1' && couponData.showCoupon == '1') ? '1' : '0'; //评价赠送优惠券
  101 + console.log('邀请函--------------------评价赠送的优惠券', couponData);
  102 + console.log('邀请函--------------------是否要赠送优惠券', coupon);
  103 + this.setData({
  104 + coupon: coupon || '',
  105 + couponId: id || '',
  106 + price: couponData.price || '',
  107 + use: JSON.stringify(couponData.use) || '',
  108 + couponData,
  109 + })
  110 + }
  111 + })
  112 + },
102 // 获取上传的图片或者视频 113 // 获取上传的图片或者视频
103 tpupload(e) { 114 tpupload(e) {
104 this.setData({ 115 this.setData({
@@ -147,10 +158,10 @@ Page({ @@ -147,10 +158,10 @@ Page({
147 let options = this.data.options 158 let options = this.data.options
148 console.log('options',options); 159 console.log('options',options);
149 // 有券 160 // 有券
150 - if (this.data.coupon == '1') { 161 + if (this.data.coupon == '1' && this.data.couponData.showCoupon == '1') {
151 url = util.http_build_query({ 162 url = util.http_build_query({
152 sellerName: options.sellerName, 163 sellerName: options.sellerName,
153 - coupon: this.data.coupon, 164 + coupon: '1',
154 couponId: this.data.couponId, 165 couponId: this.data.couponId,
155 price: this.data.price, 166 price: this.data.price,
156 use: this.data.use, 167 use: this.data.use,
@@ -160,7 +171,7 @@ Page({ @@ -160,7 +171,7 @@ Page({
160 } else { //没券 171 } else { //没券
161 url = util.http_build_query({ 172 url = util.http_build_query({
162 sellerName: options.sellerName, 173 sellerName: options.sellerName,
163 - coupon: this.data.coupon, //1有券 2没有券 174 + coupon: '0', //1有券 0没有券
164 couponId: this.data.couponId || '', 175 couponId: this.data.couponId || '',
165 sellid: options.sellerid, 176 sellid: options.sellerid,
166 }, './opinionSuccess') 177 }, './opinionSuccess')
@@ -96,7 +96,7 @@ button[disabled]:not([type]) { @@ -96,7 +96,7 @@ button[disabled]:not([type]) {
96 } 96 }
97 97
98 .loading-image { 98 .loading-image {
99 - width: 60rpx; 99 + width: 80rpx;
100 height: 60rpx; 100 height: 60rpx;
101 } 101 }
102 102
@@ -34,29 +34,32 @@ Page({ @@ -34,29 +34,32 @@ Page({
34 }).then(res => { 34 }).then(res => {
35 if(res.ret==200){ 35 if(res.ret==200){
36 let data=res.data 36 let data=res.data
37 - let marketing,is_comments;  
38 - marketing = util.determine(data.marketing);  
39 - if(marketing){  
40 - is_comments = marketing.is_comments?marketing.is_comments:'';  
41 - marketing.coupon_data_comments=(is_comments=='1' && marketing.is_comments_coupon=='1')?util.determine(marketing.coupon_data_comments):'';  
42 - }  
43 - console.log('marketingmarketing',{...marketing});  
44 - let coupon_data_comments=marketing && marketing.coupon_data_comments?marketing.coupon_data_comments:[];//赠送优惠券的列表  
45 - let coupon=(marketing && marketing.is_comments=='1' && marketing.is_comments_coupon=='1')?'1':'0';//评价赠送优惠券  
46 - let couponId,price,use;  
47 - if(coupon && coupon_data_comments && coupon_data_comments.length>0){  
48 - let obj=coupon_data_comments[0];  
49 - console.log('填写意见获取的券的信息',obj);  
50 - couponId=obj.id;  
51 - price=obj.price;  
52 - use=JSON.stringify(obj.use) 37 + let marketing = util.determine(data.marketing);
  38 + if (marketing) {
  39 + let info = marketing.coupon_data_comments ? util.determine(marketing.coupon_data_comments) : '';
  40 + let couponDataId = info && info.length > 0 ? info[0].id : {}
  41 + // 根据券ID获取评价赠送的券详情
  42 + if (couponDataId) this.getEvaluateFun(couponDataId, sid)
53 } 43 }
54 this.setData({ 44 this.setData({
55 - 'options.price':price || '',  
56 - 'options.use':use || '',  
57 - 'options.coupon':coupon || '',  
58 - 'options.couponId':couponId || '',  
59 - StyleType:data.type 45 + StyleType: data.type
  46 + })
  47 + }else{
  48 + console.log('GetSellerTemplateConf请求失败');
  49 + }
  50 + })
  51 + },
  52 + // 根据券ID获取评价赠送的券详情
  53 + getEvaluateFun(id,sid){
  54 + App.Activity.GetActivityById({
  55 + id
  56 + }).then(res => {
  57 + if (res.data.length > 0) {
  58 + let couponData = res.data[0]
  59 + this.setData({
  60 + 'options.price':couponData.price || '',
  61 + 'options.use':couponData.use || '',
  62 + 'options.couponId':id || '',
60 }) 63 })
61 setTimeout(() => { 64 setTimeout(() => {
62 // 金额为0 直接领券后 65 // 金额为0 直接领券后
@@ -78,11 +81,9 @@ Page({ @@ -78,11 +81,9 @@ Page({
78 }) 81 })
79 } 82 }
80 }, 100); 83 }, 100);
81 - }else{  
82 - console.log('GetSellerTemplateConf请求失败');  
83 } 84 }
84 - })  
85 - }, 85 + })
  86 + },
86 seeCoupon() { 87 seeCoupon() {
87 wx.showLoading({ 88 wx.showLoading({
88 title: '加载中', 89 title: '加载中',
@@ -116,19 +116,16 @@ Page({ @@ -116,19 +116,16 @@ Page({
116 let data = res.data 116 let data = res.data
117 console.log('data', data); 117 console.log('data', data);
118 let couponList = [] 118 let couponList = []
119 - let StyleType, couponData, marketing, coupon, is_comments; 119 + let StyleType, marketing, coupon, is_comments;
120 marketing = util.determine(data.marketing); 120 marketing = util.determine(data.marketing);
121 StyleType = data.type; 121 StyleType = data.type;
122 if (marketing) { 122 if (marketing) {
123 is_comments = marketing.is_comments ? marketing.is_comments : ''; 123 is_comments = marketing.is_comments ? marketing.is_comments : '';
124 coupon = marketing.coupon_data ? util.determine(marketing.coupon_data) : ''; 124 coupon = marketing.coupon_data ? util.determine(marketing.coupon_data) : '';
125 - couponData = marketing.coupon_data_comments ? util.determine(marketing.coupon_data_comments) : '';  
126 - couponData = couponData && couponData.length > 0 ? couponData[0] : {}  
127 - if ((couponData.use && (!couponData.use.is_cash || couponData.use.is_cash == '1'))) {  
128 - let cash = couponData.use.cash * 1;  
129 - let price = couponData.price * 1;  
130 - couponData.discount = cash != 0 ? ((price / cash) * 10).toFixed(1) : '';  
131 - } 125 + let info = marketing.coupon_data_comments ? util.determine(marketing.coupon_data_comments) : '';
  126 + let couponDataId = info && info.length > 0 ? info[0].id : {}
  127 + // 根据券ID获取评价赠送的券详情
  128 + if(couponDataId) this.getEvaluateFun(couponDataId)
132 } 129 }
133 // is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示 130 // is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示
134 if (coupon && util.getType(coupon) == 'object') { 131 if (coupon && util.getType(coupon) == 'object') {
@@ -150,7 +147,6 @@ Page({ @@ -150,7 +147,6 @@ Page({
150 coupon, 147 coupon,
151 couponList, 148 couponList,
152 is_comments, 149 is_comments,
153 - couponData,  
154 StyleType, 150 StyleType,
155 } 151 }
156 console.log('获取数据', { 152 console.log('获取数据', {
@@ -167,13 +163,33 @@ Page({ @@ -167,13 +163,33 @@ Page({
167 coupon, 163 coupon,
168 is_comments, 164 is_comments,
169 couponList, 165 couponList,
170 - couponData,  
171 StyleType, 166 StyleType,
172 }) 167 })
173 }).catch(res => { 168 }).catch(res => {
174 console.log('GetSellerTemplateConf请求失败'); 169 console.log('GetSellerTemplateConf请求失败');
175 }) 170 })
176 }, 171 },
  172 + // 获取评价赠送的券最新详情
  173 + getEvaluateFun(id){
  174 + App.Activity.GetActivityById({
  175 + id
  176 + }).then(res => {
  177 + if (res.data.length > 0) {
  178 + let couponData = res.data[0]
  179 + if ((couponData.use && (!couponData.use.is_cash || couponData.use.is_cash == '1'))) {
  180 + let cash = couponData.use.cash * 1;
  181 + let price = couponData.price * 1;
  182 + couponData.discount = cash != 0 ? ((price / cash) * 10).toFixed(1) : '';
  183 + }
  184 + // showCoupon 代表赠送的券没过有效期 && 是开启状态
  185 + couponData.showCoupon = (this.data.dataStr<(couponData.etime*1) && couponData.is_open=='1') ? '1' : '0';
  186 + console.log('邀请函--------------------评价赠送的优惠券',couponData);
  187 + this.setData({
  188 + couponData:res.data[0]
  189 + })
  190 + }
  191 + })
  192 + },
177 // 根据充值ID获取充值详情 193 // 根据充值ID获取充值详情
178 getRechargeDetail(id) { 194 getRechargeDetail(id) {
179 App.Activity.GetNewRecharge({ 195 App.Activity.GetNewRecharge({
@@ -188,8 +204,10 @@ Page({ @@ -188,8 +204,10 @@ Page({
188 if (recharge_list.is_price == '1') priceInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.price + '元余额'; 204 if (recharge_list.is_price == '1') priceInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.price + '元余额';
189 if (recharge_list.is_score == '1') scoreInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.score + '积分'; 205 if (recharge_list.is_score == '1') scoreInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.score + '积分';
190 if (recharge_list.is_coupons == '1' && recharge_list.coupons_names.length > 0) certificate = recharge_list.coupons_names.join('、'); 206 if (recharge_list.is_coupons == '1' && recharge_list.coupons_names.length > 0) certificate = recharge_list.coupons_names.join('、');
  207 + let recharge_data = (this.data.dataStr<detail.etime*1 && detail.is_open == '1') ? detail : ''
  208 + console.log('邀请函--------------充值',recharge_data);
191 this.setData({ 209 this.setData({
192 - recharge_data: detail, 210 + recharge_data,
193 scoreInfo, 211 scoreInfo,
194 priceInfo, 212 priceInfo,
195 certificate 213 certificate
@@ -214,11 +232,13 @@ Page({ @@ -214,11 +232,13 @@ Page({
214 detail.discount = cash != 0 ? ((price / cash) * 10).toFixed(1) : ''; 232 detail.discount = cash != 0 ? ((price / cash) * 10).toFixed(1) : '';
215 } 233 }
216 coupon_dataList.push(detail); 234 coupon_dataList.push(detail);
217 - if (length === ids.length) {  
218 - this.setData({  
219 - coupon_dataList,  
220 - })  
221 - } 235 + if (length === coupon_dataList.length) {
  236 + coupon_dataList = coupon_dataList.filter(item=>{return this.data.dataStr<(item.etime*1) && item.is_open == '1'})
  237 + console.log('邀请函--------------------优惠券',coupon_dataList);
  238 + this.setData({
  239 + coupon_dataList,
  240 + })
  241 + }
222 } 242 }
223 }) 243 })
224 }) 244 })
@@ -6,7 +6,7 @@ @@ -6,7 +6,7 @@
6 <view class="sign"></view><text class="font32r">专属优惠券</text> 6 <view class="sign"></view><text class="font32r">专属优惠券</text>
7 </view> 7 </view>
8 <block wx:for="{{coupon_dataList}}" wx:key="index" wx:for-index="index"> 8 <block wx:for="{{coupon_dataList}}" wx:key="index" wx:for-index="index">
9 - <view class="preferentialItems" wx:if="{{dataStr<(item.etime*1) && item.status == '1'}}"> 9 + <view class="preferentialItems">
10 <view class="itemLeft"> 10 <view class="itemLeft">
11 <text wx:if="{{item.discount!='0.00' && (item.use.is_cash=='1' || item.use.is_cash) && item.discount}}" class="discountText font24r">{{item.discount}}折</text> 11 <text wx:if="{{item.discount!='0.00' && (item.use.is_cash=='1' || item.use.is_cash) && item.discount}}" class="discountText font24r">{{item.discount}}折</text>
12 <text wx:if="{{item.use.is_dish=='1'}}" class="discountText font24r">特惠菜品</text> 12 <text wx:if="{{item.use.is_dish=='1'}}" class="discountText font24r">特惠菜品</text>
@@ -35,7 +35,7 @@ @@ -35,7 +35,7 @@
35 </view> 35 </view>
36 </block> 36 </block>
37 </view> 37 </view>
38 -<view class="box" wx:if="{{hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data && (is_fix!='1' || (is_fix=='1' && dataStr<(recharge_data.exp_date.fix_edate*1)))}}"> 38 +<view class="box" wx:if="{{hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data}}">
39 <view class="title"> 39 <view class="title">
40 <view class="sign"></view><text class="font32r">会员充值优惠</text> 40 <view class="sign"></view><text class="font32r">会员充值优惠</text>
41 </view> 41 </view>
@@ -62,11 +62,11 @@ @@ -62,11 +62,11 @@
62 </view> 62 </view>
63 </view> 63 </view>
64 <!-- 启用评价 && 是否评价过 && 评价赠送优惠券 && 赠送的优惠券有数据--> 64 <!-- 启用评价 && 是否评价过 && 评价赠送优惠券 && 赠送的优惠券有数据-->
65 -<view class="box" wx:if="{{is_comments=='1' && !is_user_comments && marketing.is_comments_coupon=='1' && couponData}}"> 65 +<view class="box" wx:if="{{is_comments=='1' && !is_user_comments && marketing.is_comments_coupon=='1' && couponData && couponData.showCoupon =='1'}}">
66 <view class="title"> 66 <view class="title">
67 <view class="sign"></view><text class="font32r">反馈有礼</text> 67 <view class="sign"></view><text class="font32r">反馈有礼</text>
68 </view> 68 </view>
69 - <view class="preferentialItems" wx:if="{{couponData && dataStr<(couponData.etime*1) && couponData.status == '1'}}"> 69 + <view class="preferentialItems">
70 <view class="itemLeft"> 70 <view class="itemLeft">
71 <text wx:if="{{couponData.discount!='0.00' && (couponData.use.is_cash=='1' || couponData.use.is_cash) && couponData.discount}}" class="discountText font24r">{{couponData.discount}}折</text> 71 <text wx:if="{{couponData.discount!='0.00' && (couponData.use.is_cash=='1' || couponData.use.is_cash) && couponData.discount}}" class="discountText font24r">{{couponData.discount}}折</text>
72 <view class="priceText" wx:if="{{couponData.price}}"> 72 <view class="priceText" wx:if="{{couponData.price}}">
@@ -77,7 +77,7 @@ @@ -77,7 +77,7 @@
77 <view class="btns"> 77 <view class="btns">
78 <text class="font40r">{{couponData.aname}}</text> 78 <text class="font40r">{{couponData.aname}}</text>
79 <view bindtap="evaluateFun" class="font24r orderingFood"> 79 <view bindtap="evaluateFun" class="font24r orderingFood">
80 - 抢购 80 + 领取
81 </view> 81 </view>
82 </view> 82 </view>
83 <text wx:if="{{couponData.exp_date.is_week=='1' || couponData.exp_date.is_week===true}}" class="bottom font24r">{{couponData.exp_date.week_show?couponData.exp_date.week_show+'可用':''}}{{couponData.desc?','+couponData.desc+'。':'。'}}</text> 83 <text wx:if="{{couponData.exp_date.is_week=='1' || couponData.exp_date.is_week===true}}" class="bottom font24r">{{couponData.exp_date.week_show?couponData.exp_date.week_show+'可用':''}}{{couponData.desc?','+couponData.desc+'。':'。'}}</text>
@@ -89,14 +89,23 @@ Page({ @@ -89,14 +89,23 @@ Page({
89 }) 89 })
90 }, 90 },
91 // 获取商家版本,不是超能版或者没有开通对应模块,不显示 91 // 获取商家版本,不是超能版或者没有开通对应模块,不显示
92 - getSellerVersionFun(sellerid){ 92 + getSellerVersionFun(sellerid) {
93 App.SellerVersion.GetSellerVersion({ 93 App.SellerVersion.GetSellerVersion({
94 sellerid 94 sellerid
95 }).then((res) => { 95 }).then((res) => {
96 - console.log('版本列表',res.data);  
97 - if(res.data && res.data.length>0){  
98 - const hasValueCertificate = res.data.some(item => item.vid == '1' || item.vid == '2' || item.vid == '3' || item.vid == '8');  
99 - const hasValueRecharge = res.data.some(item => item.vid == '1' || item.vid == '2' || item.vid == '3' || item.vid == '9'); 96 + let data = res.data;
  97 + console.log('版本列表', data);
  98 + if (data && data.length > 0) {
  99 + data.sort((a, b) => b.cdate * 1 - a.cdate * 1);
  100 + // 获取店铺当前版本 (cdate最大最后一个充入的 && 当前时间有效 && 当前版本)
  101 + let obj = data.find(item => item.vtype == 1 || item.vtype == 2 || item.vtype == 4);
  102 + console.log('当前版本', {
  103 + ...obj
  104 + });
  105 + // 优惠券功能:超能版 || 高级版 || 有优惠券模块
  106 + const hasValueCertificate = obj.vtype == '1' || obj.vtype == '4' || data.some(item => item.vid == '8');
  107 + // 充值功能:超能版 || 有充值模块
  108 + const hasValueRecharge = obj.vtype == '1' || data.some(item => item.vid == '9');
100 this.setData({ 109 this.setData({
101 hasValueCertificate, 110 hasValueCertificate,
102 hasValueRecharge, 111 hasValueRecharge,
@@ -209,8 +218,10 @@ Page({ @@ -209,8 +218,10 @@ Page({
209 if (recharge_list.is_price == '1') priceInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.price + '元余额'; 218 if (recharge_list.is_price == '1') priceInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.price + '元余额';
210 if (recharge_list.is_score == '1') scoreInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.score + '积分'; 219 if (recharge_list.is_score == '1') scoreInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.score + '积分';
211 if (recharge_list.is_coupons == '1' && recharge_list.coupons_names.length > 0) certificate = recharge_list.coupons_names.join('、'); 220 if (recharge_list.is_coupons == '1' && recharge_list.coupons_names.length > 0) certificate = recharge_list.coupons_names.join('、');
212 - this.setData({  
213 - recharge_data: detail, 221 + let recharge_data = (this.data.dataStr<detail.etime*1 && detail.is_open == '1') ? detail : ''
  222 + console.log('商家详情--------------充值',recharge_data);
  223 + this.setData({
  224 + recharge_data,
214 scoreInfo, 225 scoreInfo,
215 priceInfo, 226 priceInfo,
216 certificate 227 certificate
@@ -235,10 +246,12 @@ Page({ @@ -235,10 +246,12 @@ Page({
235 detail.discount = cash != 0 ? ((price / cash) * 10).toFixed(1) : ''; 246 detail.discount = cash != 0 ? ((price / cash) * 10).toFixed(1) : '';
236 } 247 }
237 coupon_dataList.push(detail); 248 coupon_dataList.push(detail);
238 - if (length === ids.length) { 249 + if (length === coupon_dataList.length) {
  250 + coupon_dataList = coupon_dataList.filter(item=>{return this.data.dataStr<(item.etime*1) && item.is_open == '1'})
  251 + console.log('商家详情--------------------优惠券',coupon_dataList);
239 this.setData({ 252 this.setData({
240 coupon_dataList, 253 coupon_dataList,
241 - }) 254 + })
242 } 255 }
243 } 256 }
244 }) 257 })
@@ -21,7 +21,7 @@ @@ -21,7 +21,7 @@
21 </view> 21 </view>
22 <view class="preferential" wx:if="{{hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0}}"> 22 <view class="preferential" wx:if="{{hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0}}">
23 <block wx:for="{{coupon_dataList}}" wx:key="index" wx:for-index="index"> 23 <block wx:for="{{coupon_dataList}}" wx:key="index" wx:for-index="index">
24 - <view class="preferentialItems" wx:if="{{dataStr<(item.etime*1) && item.status == '1'}}"> 24 + <view class="preferentialItems">
25 <view class="itemLeft couponItem"> 25 <view class="itemLeft couponItem">
26 <view class="itemTop"> 26 <view class="itemTop">
27 <text class="font28r">{{item.aname}}</text> 27 <text class="font28r">{{item.aname}}</text>
@@ -94,12 +94,11 @@ @@ -94,12 +94,11 @@
94 </block> 94 </block>
95 </view> 95 </view>
96 </view> 96 </view>
97 - <view class="preferential" wx:if="{{hasValueRecharge && marketing && (marketing.is_coupon=='1' || marketing.is_recharge=='1')}}">  
98 - <view class="chefText font36r" wx:if="{{marketing && marketing.is_recharge=='1' && recharge_data && (is_fix!='1' || (is_fix=='1' && dataStr<(recharge_data.exp_date.fix_edate*1)))}}"> 97 + <view class="preferential">
  98 + <view class="chefText font36r">
99 特别优惠 99 特别优惠
100 </view> 100 </view>
101 - <!-- 当前日期要大于限制结束日期 -->  
102 - <view class="preferentialItems" wx:if="{{marketing && marketing.is_recharge=='1' && recharge_data && (is_fix!='1' || (is_fix=='1' && dataStr<(recharge_data.exp_date.fix_edate*1)))}}"> 101 + <view class="preferentialItems" wx:if="{{hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data}}">
103 <view class="itemLeft"> 102 <view class="itemLeft">
104 <view class="itemTop font28r"> 103 <view class="itemTop font28r">
105 <text>{{recharge_data.rname}}</text> 104 <text>{{recharge_data.rname}}</text>