Commit 22b7f46e06177b62958598e16066f90b3890ff3e

Authored by pengye
1 parent bfd997e6

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

... ... @@ -15,7 +15,8 @@ Page({
scoreInfo: '',
certificate: '',
rid:'',
list: []
list: [],
dataStr: Date.now() * 1 / 1000,
},
/**
* 生命周期函数--监听页面加载
... ... @@ -47,9 +48,6 @@ Page({
})
let list = arr;
list.forEach((item,index) => {
if(item.is_open=='0'){
list.splice(index,1)
}
item.recharge_lists = item.recharge_list ? JSON.parse(item.recharge_list) : '';
let recharge_lists = item.recharge_lists;
item.priceInfo = '';
... ... @@ -59,6 +57,8 @@ Page({
if (recharge_lists.is_score == '1') item.scoreInfo = '会员充值满' + item.recharge_money + '元赠送' + item.recharge_lists.score + '积分';
if (recharge_lists.is_coupons == '1' && recharge_lists.coupons_names.length > 0) item.certificate = recharge_lists.coupons_names.join('、');
})
// 筛选出 未过期的 && 开启状态的充值活动
list = list.filter(item=>{return this.data.dataStr<(item.etime*1) && item.is_open == '1'})
this.setData({
list
})
... ...
... ... @@ -59,6 +59,7 @@ Page({
paymentId: '', //定金id
wxml: null,
imgSrc:'',//canvas图片地址
couponData: '', //评价赠送优惠券数据
},
tablestr: '',
urlsValue: [],
... ... @@ -556,7 +557,11 @@ Page({
if (marketing) {
is_comments = marketing.is_comments ? marketing.is_comments : '';
coupon = marketing.coupon_data ? util.determine(marketing.coupon_data) : '';
}
let info = marketing.coupon_data_comments ? util.determine(marketing.coupon_data_comments) : '';
let couponDataId = info && info.length > 0 ? info[0].id : {}
// 根据券ID获取评价赠送的券详情
if(couponDataId) this.getEvaluateFun(couponDataId)
}
// is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示
if (coupon && util.getType(coupon) == 'object') {
couponList.push({
... ... @@ -821,14 +826,32 @@ Page({
if (recharge_list.is_price == '1') priceInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.price + '元余额';
if (recharge_list.is_score == '1') scoreInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.score + '积分';
if (recharge_list.is_coupons == '1' && recharge_list.coupons_names.length > 0) certificate = recharge_list.coupons_names.join('、');
this.setData({
recharge_data: detail,
let recharge_data = (this.data.dataStr<detail.etime*1 && detail.is_open == '1') ? detail : ''
console.log('邀请函--------------充值',recharge_data);
this.setData({
recharge_data,
scoreInfo,
priceInfo,
certificate
})
})
},
// 获取评价赠送的券最新详情
getEvaluateFun(id){
App.Activity.GetActivityById({
id
}).then(res => {
if (res.data.length > 0) {
let couponData = res.data[0]
// showCoupon 代表赠送的券没过有效期 && 是开启状态
couponData.showCoupon = (this.data.dataStr<(couponData.etime*1) && couponData.is_open=='1') ? '1' : '0';
console.log('邀请函--------------------评价赠送的优惠券',couponData);
this.setData({
couponData:res.data[0]
})
}
})
},
// 根据券ID获取券详情
getActivityByIdFun(ids, length) {
let coupon_dataList = [];
... ... @@ -846,8 +869,10 @@ Page({
let price = detail.price * 1;
detail.discount = cash != 0 ? ((price / cash) * 10).toFixed(1) : '';
}
coupon_dataList.push(detail);
if (length === ids.length) {
coupon_dataList.push(detail);
if (length === coupon_dataList.length) {
coupon_dataList = coupon_dataList.filter(item=>{return this.data.dataStr<(item.etime*1) && item.is_open == '1'})
console.log('邀请函--------------------优惠券',coupon_dataList);
this.setData({
coupon_dataList,
})
... ...
... ... @@ -11,7 +11,7 @@
/>
<image class="giftImg"
bindtap="gotoSellerGift"
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))))}}"
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)}}"
src="https://nosqn.colorcun.com/sellerGift.png" mode=""/>
<image wx:if="{{detail && detail.status =='4'}}" class="cannotImg" src="https://qn.colorcun.com/cancelImg.png" />
<image wx:if="{{options && options.isOrder == '1' && detail.status !='4'}}" class="cannotImg" src="https://qn.colorcun.com/overImg.png" />
... ... @@ -82,7 +82,7 @@
</block>
<view class="preferentialCoupon" wx:if="{{hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0}}">
<block wx:for="{{coupon_dataList}}" wx:key="index" wx:for-index="index">
<view class="preferentialItems" wx:if="{{dataStr<(item.etime*1) && item.status == '1'}}">
<view class="preferentialItems">
<view class="itemLeft">
<text wx:if="{{item.discount!='0.00' && (item.use.is_cash=='1' || item.use.is_cash) && item.discount}}" class="discountText font24r">{{item.discount}}折</text>
<view class="priceText" wx:if="{{item.price}}">
... ... @@ -110,8 +110,8 @@
</block>
</view>
<view wx:if="{{is_comments=='1' && !is_user_comments}}" class="evaluateBox" bindtap="evaluateFun">
<text wx:if="{{is_comments=='1' && marketing.is_comments_coupon!='1'}}">想<text>吐槽</text>?戳这里填写意见!--></text>
<text wx:if="{{marketing.is_comments_coupon=='1'}}">想<text>吐槽</text>?戳这里填写意见反馈赢好礼!</text>
<text wx:if="{{is_comments=='1' && (marketing.is_comments_coupon!='1' || couponData.showCoupon!='1')}}">想<text class="font36r">吐槽</text>?戳这里填写意见!--></text>
<text wx:if="{{marketing.is_comments_coupon=='1' && couponData && couponData.showCoupon =='1'}}">想<text class="font36r">吐槽</text>?戳这里填写意见反馈赢好礼!</text>
<image wx:if="{{themeColor == 'pearlWhite'}}" src="https://nosqn.colorcun.com/evaluateWhite.png" mode="" />
<image wx:elif="{{themeColor == 'turmeric' || themeColor == 'greenishYellow' || themeColor == 'golden'}}" src="https://nosqn.colorcun.com/evaluateYellow.png" mode="" />
<image wx:else src="https://nosqn.colorcun.com/evaluate2.png" mode="" />
... ... @@ -193,7 +193,7 @@
</view>
</view>
</view>
<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)))}}">
<block wx:if="{{hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data}}">
<view wx:if="{{titleType}}" class="chefText font36r">
<titleStyle isWhite="{{themeColor}}" titleStyleType="{{titleType}}" titleText="会员招募"></titleStyle>
</view>
... ...
... ... @@ -59,6 +59,7 @@ Page({
paymentId: '', //定金id
wxml: null,
imgSrc:'',//canvas图片地址
couponData: '', //评价赠送优惠券数据
},
tablestr: '',
urlsValue: [],
... ... @@ -556,7 +557,11 @@ Page({
if (marketing) {
is_comments = marketing.is_comments ? marketing.is_comments : '';
coupon = marketing.coupon_data ? util.determine(marketing.coupon_data) : '';
}
let info = marketing.coupon_data_comments ? util.determine(marketing.coupon_data_comments) : '';
let couponDataId = info && info.length > 0 ? info[0].id : {}
// 根据券ID获取评价赠送的券详情
if(couponDataId) this.getEvaluateFun(couponDataId)
}
// is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示
if (coupon && util.getType(coupon) == 'object') {
couponList.push({
... ... @@ -776,14 +781,32 @@ Page({
if (recharge_list.is_price == '1') priceInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.price + '元余额';
if (recharge_list.is_score == '1') scoreInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.score + '积分';
if (recharge_list.is_coupons == '1' && recharge_list.coupons_names.length > 0) certificate = recharge_list.coupons_names.join('、');
this.setData({
recharge_data: detail,
let recharge_data = (this.data.dataStr<detail.etime*1 && detail.is_open == '1') ? detail : ''
console.log('邀请函--------------充值',recharge_data);
this.setData({
recharge_data,
scoreInfo,
priceInfo,
certificate
})
})
},
// 获取评价赠送的券最新详情
getEvaluateFun(id){
App.Activity.GetActivityById({
id
}).then(res => {
if (res.data.length > 0) {
let couponData = res.data[0]
// showCoupon 代表赠送的券没过有效期 && 是开启状态
couponData.showCoupon = (this.data.dataStr<(couponData.etime*1) && couponData.is_open=='1') ? '1' : '0';
console.log('邀请函--------------------评价赠送的优惠券',couponData);
this.setData({
couponData:res.data[0]
})
}
})
},
// 根据券ID获取券详情
getActivityByIdFun(ids, length) {
let coupon_dataList = [];
... ... @@ -801,8 +824,10 @@ Page({
let price = detail.price * 1;
detail.discount = cash != 0 ? ((price / cash) * 10).toFixed(1) : '';
}
coupon_dataList.push(detail);
if (length === ids.length) {
coupon_dataList.push(detail);
if (length === coupon_dataList.length) {
coupon_dataList = coupon_dataList.filter(item=>{return this.data.dataStr<(item.etime*1) && item.is_open == '1'})
console.log('邀请函--------------------优惠券',coupon_dataList);
this.setData({
coupon_dataList,
})
... ...
... ... @@ -11,7 +11,7 @@
/>
<image class="giftImg"
bindtap="gotoSellerGift"
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))))}}"
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)}}"
src="https://nosqn.colorcun.com/sellerGift.png" mode=""/>
<image wx:if="{{detail && detail.status =='4'}}" class="cannotImg" src="https://qn.colorcun.com/cancelImg.png" />
<image wx:if="{{options && options.isOrder == '1' && detail.status !='4'}}" class="cannotImg" src="https://qn.colorcun.com/overImg.png" />
... ... @@ -84,7 +84,7 @@
</view>
<view class="preferentialCoupon" wx:if="{{hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0}}">
<block wx:for="{{coupon_dataList}}" wx:key="index" wx:for-index="index">
<view class="preferentialItems" wx:if="{{dataStr<(item.etime*1) && item.status == '1'}}">
<view class="preferentialItems">
<view class="itemLeft">
<text wx:if="{{item.discount!='0.00' && (item.use.is_cash=='1' || item.use.is_cash) && item.discount}}" class="discountText font24r">{{item.discount}}折</text>
<view class="priceText" wx:if="{{item.price}}">
... ... @@ -112,8 +112,8 @@
</block>
</view>
<view wx:if="{{is_comments=='1' && !is_user_comments}}" class="evaluateBox" bindtap="evaluateFun">
<text wx:if="{{is_comments=='1' && marketing.is_comments_coupon!='1'}}">想<text>吐槽</text>?戳这里填写意见!--></text>
<text wx:if="{{marketing.is_comments_coupon=='1'}}">想<text>吐槽</text>?戳这里填写意见反馈赢好礼!</text>
<text wx:if="{{is_comments=='1' && (marketing.is_comments_coupon!='1' || couponData.showCoupon!='1')}}">想<text class="font36r">吐槽</text>?戳这里填写意见!--></text>
<text wx:if="{{marketing.is_comments_coupon=='1' && couponData && couponData.showCoupon =='1'}}">想<text class="font36r">吐槽</text>?戳这里填写意见反馈赢好礼!</text>
<image wx:if="{{themeColor == 'pearlWhite'}}" src="https://nosqn.colorcun.com/evaluateWhite.png" mode="" />
<image wx:elif="{{themeColor == 'turmeric' || themeColor == 'greenishYellow' || themeColor == 'golden'}}" src="https://nosqn.colorcun.com/evaluateYellow.png" mode="" />
<image wx:else src="https://nosqn.colorcun.com/evaluate2.png" mode="" />
... ... @@ -195,7 +195,7 @@
</view>
</view>
</view>
<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)))}}">
<block wx:if="{{hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data}}">
<view wx:if="{{titleType}}" class="chefText font36r">
<titleStyle isWhite="{{themeColor}}" titleStyleType="{{titleType}}" titleText="会员招募"></titleStyle>
</view>
... ...
... ... @@ -59,6 +59,7 @@ Page({
paymentId: '', //定金id
wxml: null,
imgSrc:'',//canvas图片地址
couponData: '', //评价赠送优惠券数据
},
tablestr: '',
urlsValue: [],
... ... @@ -556,7 +557,11 @@ Page({
if (marketing) {
is_comments = marketing.is_comments ? marketing.is_comments : '';
coupon = marketing.coupon_data ? util.determine(marketing.coupon_data) : '';
}
let info = marketing.coupon_data_comments ? util.determine(marketing.coupon_data_comments) : '';
let couponDataId = info && info.length > 0 ? info[0].id : {}
// 根据券ID获取评价赠送的券详情
if(couponDataId) this.getEvaluateFun(couponDataId)
}
// is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示
if (coupon && util.getType(coupon) == 'object') {
couponList.push({
... ... @@ -776,14 +781,32 @@ Page({
if (recharge_list.is_price == '1') priceInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.price + '元余额';
if (recharge_list.is_score == '1') scoreInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.score + '积分';
if (recharge_list.is_coupons == '1' && recharge_list.coupons_names.length > 0) certificate = recharge_list.coupons_names.join('、');
this.setData({
recharge_data: detail,
let recharge_data = (this.data.dataStr<detail.etime*1 && detail.is_open == '1') ? detail : ''
console.log('邀请函--------------充值',recharge_data);
this.setData({
recharge_data,
scoreInfo,
priceInfo,
certificate
})
})
},
// 获取评价赠送的券最新详情
getEvaluateFun(id){
App.Activity.GetActivityById({
id
}).then(res => {
if (res.data.length > 0) {
let couponData = res.data[0]
// showCoupon 代表赠送的券没过有效期 && 是开启状态
couponData.showCoupon = (this.data.dataStr<(couponData.etime*1) && couponData.is_open=='1') ? '1' : '0';
console.log('邀请函--------------------评价赠送的优惠券',couponData);
this.setData({
couponData:res.data[0]
})
}
})
},
// 根据券ID获取券详情
getActivityByIdFun(ids, length) {
let coupon_dataList = [];
... ... @@ -801,8 +824,10 @@ Page({
let price = detail.price * 1;
detail.discount = cash != 0 ? ((price / cash) * 10).toFixed(1) : '';
}
coupon_dataList.push(detail);
if (length === ids.length) {
coupon_dataList.push(detail);
if (length === coupon_dataList.length) {
coupon_dataList = coupon_dataList.filter(item=>{return this.data.dataStr<(item.etime*1) && item.is_open == '1'})
console.log('邀请函--------------------优惠券',coupon_dataList);
this.setData({
coupon_dataList,
})
... ...
... ... @@ -10,7 +10,7 @@
/>
<image class="giftImg"
bindtap="gotoSellerGift"
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))))}}"
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)}}"
src="https://nosqn.colorcun.com/sellerGift.png" mode=""/>
<image wx:if="{{detail && detail.status =='4'}}" class="cannotImg" src="https://qn.colorcun.com/cancelImg.png" />
<image wx:if="{{options && options.isOrder == '1' && detail.status !='4'}}" class="cannotImg" src="https://qn.colorcun.com/overImg.png" />
... ... @@ -67,7 +67,7 @@
</view>
<view class="preferentialCoupon" wx:if="{{hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0}}">
<block wx:for="{{coupon_dataList}}" wx:key="index" wx:for-index="index">
<view class="preferentialItems" wx:if="{{dataStr<(item.etime*1) && item.status == '1'}}">
<view class="preferentialItems">
<view class="itemLeft">
<text wx:if="{{item.discount!='0.00' && (item.use.is_cash=='1' || item.use.is_cash) && item.discount}}" class="discountText font24r">{{item.discount}}折</text>
<view class="priceText" wx:if="{{item.price}}">
... ... @@ -95,8 +95,8 @@
</block>
</view>
<view wx:if="{{is_comments=='1' && !is_user_comments}}" class="evaluateBox" bindtap="evaluateFun">
<text wx:if="{{is_comments=='1' && marketing.is_comments_coupon!='1'}}">想<text>吐槽</text>?戳这里填写意见!--></text>
<text wx:if="{{marketing.is_comments_coupon=='1'}}">想<text>吐槽</text>?戳这里填写意见反馈赢好礼!</text>
<text wx:if="{{is_comments=='1' && (marketing.is_comments_coupon!='1' || couponData.showCoupon!='1')}}">想<text class="font36r">吐槽</text>?戳这里填写意见!--></text>
<text wx:if="{{marketing.is_comments_coupon=='1' && couponData && couponData.showCoupon =='1'}}">想<text class="font36r">吐槽</text>?戳这里填写意见反馈赢好礼!</text>
<image wx:if="{{themeColor == 'pearlWhite'}}" src="https://nosqn.colorcun.com/evaluateWhite.png" mode="" />
<image wx:elif="{{themeColor == 'turmeric' || themeColor == 'greenishYellow' || themeColor == 'golden'}}" src="https://nosqn.colorcun.com/evaluateYellow.png" mode="" />
<image wx:else src="https://nosqn.colorcun.com/evaluate2.png" mode="" />
... ... @@ -178,7 +178,7 @@
</view>
</view>
</view>
<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)))}}">
<block wx:if="{{hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data}}">
<view wx:if="{{titleType}}" class="chefText font36r">
<titleStyle isWhite="{{themeColor}}" titleStyleType="{{titleType}}" titleText="会员招募"></titleStyle>
</view>
... ...
... ... @@ -58,6 +58,7 @@ Page({
paymentId: '', //定金id
wxml: null,
imgSrc:'',//canvas图片地址
couponData: '', //评价赠送优惠券数据
},
tablestr: '',
urlsValue: [],
... ... @@ -555,7 +556,11 @@ Page({
if (marketing) {
is_comments = marketing.is_comments ? marketing.is_comments : '';
coupon = marketing.coupon_data ? util.determine(marketing.coupon_data) : '';
}
let info = marketing.coupon_data_comments ? util.determine(marketing.coupon_data_comments) : '';
let couponDataId = info && info.length > 0 ? info[0].id : {}
// 根据券ID获取评价赠送的券详情
if(couponDataId) this.getEvaluateFun(couponDataId)
}
// is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示
if (coupon && util.getType(coupon) == 'object') {
couponList.push({
... ... @@ -775,14 +780,32 @@ Page({
if (recharge_list.is_price == '1') priceInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.price + '元余额';
if (recharge_list.is_score == '1') scoreInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.score + '积分';
if (recharge_list.is_coupons == '1' && recharge_list.coupons_names.length > 0) certificate = recharge_list.coupons_names.join('、');
this.setData({
recharge_data: detail,
let recharge_data = (this.data.dataStr<detail.etime*1 && detail.is_open == '1') ? detail : ''
console.log('邀请函--------------充值',recharge_data);
this.setData({
recharge_data,
scoreInfo,
priceInfo,
certificate
})
})
},
// 获取评价赠送的券最新详情
getEvaluateFun(id){
App.Activity.GetActivityById({
id
}).then(res => {
if (res.data.length > 0) {
let couponData = res.data[0]
// showCoupon 代表赠送的券没过有效期 && 是开启状态
couponData.showCoupon = (this.data.dataStr<(couponData.etime*1) && couponData.is_open=='1') ? '1' : '0';
console.log('邀请函--------------------评价赠送的优惠券',couponData);
this.setData({
couponData:res.data[0]
})
}
})
},
// 根据券ID获取券详情
getActivityByIdFun(ids, length) {
let coupon_dataList = [];
... ... @@ -800,8 +823,10 @@ Page({
let price = detail.price * 1;
detail.discount = cash != 0 ? ((price / cash) * 10).toFixed(1) : '';
}
coupon_dataList.push(detail);
if (length === ids.length) {
coupon_dataList.push(detail);
if (length === coupon_dataList.length) {
coupon_dataList = coupon_dataList.filter(item=>{return this.data.dataStr<(item.etime*1) && item.is_open == '1'})
console.log('邀请函--------------------优惠券',coupon_dataList);
this.setData({
coupon_dataList,
})
... ...
... ... @@ -10,7 +10,7 @@
/>
<image class="giftImg"
bindtap="gotoSellerGift"
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))))}}"
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)}}"
src="https://nosqn.colorcun.com/sellerGift.png" mode=""/>
<image wx:if="{{detail && detail.status =='4'}}" class="cannotImg" src="https://qn.colorcun.com/cancelImg.png" />
<image wx:if="{{options && options.isOrder == '1' && detail.status !='4'}}" class="cannotImg" src="https://qn.colorcun.com/overImg.png" />
... ... @@ -65,7 +65,7 @@
</view>
<view class="preferentialCoupon" wx:if="{{hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0}}">
<block wx:for="{{coupon_dataList}}" wx:key="index" wx:for-index="index">
<view class="preferentialItems" wx:if="{{dataStr<(item.etime*1) && item.status == '1'}}">
<view class="preferentialItems">
<view class="itemLeft">
<text wx:if="{{item.discount!='0.00' && (item.use.is_cash=='1' || item.use.is_cash) && item.discount}}" class="discountText font24r">{{item.discount}}折</text>
<view class="priceText" wx:if="{{item.price}}">
... ... @@ -93,8 +93,8 @@
</block>
</view>
<view wx:if="{{is_comments=='1' && !is_user_comments}}" class="evaluateBox" bindtap="evaluateFun">
<text wx:if="{{is_comments=='1' && marketing.is_comments_coupon!='1'}}">想<text>吐槽</text>?戳这里填写意见!--></text>
<text wx:if="{{marketing.is_comments_coupon=='1'}}">想<text>吐槽</text>?戳这里填写意见反馈赢好礼!</text>
<text wx:if="{{is_comments=='1' && (marketing.is_comments_coupon!='1' || couponData.showCoupon!='1')}}">想<text class="font36r">吐槽</text>?戳这里填写意见!--></text>
<text wx:if="{{marketing.is_comments_coupon=='1' && couponData && couponData.showCoupon =='1'}}">想<text class="font36r">吐槽</text>?戳这里填写意见反馈赢好礼!</text>
<image wx:if="{{themeColor == 'pearlWhite'}}" src="https://nosqn.colorcun.com/evaluateWhite.png" mode="" />
<image wx:elif="{{themeColor == 'turmeric' || themeColor == 'greenishYellow' || themeColor == 'golden'}}" src="https://nosqn.colorcun.com/evaluateYellow.png" mode="" />
<image wx:else src="https://nosqn.colorcun.com/evaluate2.png" mode="" />
... ... @@ -176,7 +176,7 @@
</view>
</view>
</view>
<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)))}}">
<block wx:if="{{hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data}}">
<view wx:if="{{titleType}}" class="chefText font36r">
<titleStyle isWhite="{{themeColor}}" titleStyleType="{{titleType}}" titleText="会员招募"></titleStyle>
</view>
... ...
... ... @@ -59,6 +59,7 @@ Page({
paymentId: '', //定金id
wxml: null,
imgSrc:'',//canvas图片地址
couponData: '', //评价赠送优惠券数据
},
screenHeight: '',
attentionAnim: {},
... ... @@ -503,6 +504,10 @@ Page({
if (marketing) {
is_comments = marketing.is_comments ? marketing.is_comments : '';
coupon = marketing.coupon_data ? util.determine(marketing.coupon_data) : '';
let info = marketing.coupon_data_comments ? util.determine(marketing.coupon_data_comments) : '';
let couponDataId = info && info.length > 0 ? info[0].id : {}
// 根据券ID获取评价赠送的券详情
if(couponDataId) this.getEvaluateFun(couponDataId)
}
// is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示
if (coupon && util.getType(coupon) == 'object') {
... ... @@ -727,14 +732,32 @@ Page({
if (recharge_list.is_price == '1') priceInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.price + '元余额';
if (recharge_list.is_score == '1') scoreInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.score + '积分';
if (recharge_list.is_coupons == '1' && recharge_list.coupons_names.length > 0) certificate = recharge_list.coupons_names.join('、');
this.setData({
recharge_data: detail,
let recharge_data = (this.data.dataStr<detail.etime*1 && detail.is_open == '1') ? detail : ''
console.log('邀请函--------------充值',recharge_data);
this.setData({
recharge_data,
scoreInfo,
priceInfo,
certificate
})
})
},
// 获取评价赠送的券最新详情
getEvaluateFun(id){
App.Activity.GetActivityById({
id
}).then(res => {
if (res.data.length > 0) {
let couponData = res.data[0]
// showCoupon 代表赠送的券没过有效期 && 是开启状态
couponData.showCoupon = (this.data.dataStr<(couponData.etime*1) && couponData.is_open=='1') ? '1' : '0';
console.log('邀请函--------------------评价赠送的优惠券',couponData);
this.setData({
couponData:res.data[0]
})
}
})
},
// 根据券ID获取券详情
getActivityByIdFun(ids, length) {
let coupon_dataList = [];
... ... @@ -752,8 +775,10 @@ Page({
let price = detail.price * 1;
detail.discount = cash != 0 ? ((price / cash) * 10).toFixed(1) : '';
}
coupon_dataList.push(detail);
if (length === ids.length) {
coupon_dataList.push(detail);
if (length === coupon_dataList.length) {
coupon_dataList = coupon_dataList.filter(item=>{return this.data.dataStr<(item.etime*1) && item.is_open == '1'})
console.log('邀请函--------------------优惠券',coupon_dataList);
this.setData({
coupon_dataList,
})
... ...
... ... @@ -11,7 +11,7 @@
/>
<image class="giftImg"
bindtap="gotoSellerGift"
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))))}}"
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)}}"
src="https://nosqn.colorcun.com/sellerGift.png" mode=""/>
<image wx:if="{{detail && detail.status =='4'}}" class="cannotImg" src="https://qn.colorcun.com/cancelImg.png" />
<image wx:if="{{options && options.isOrder == '1' && detail.status !='4'}}" class="cannotImg" src="https://qn.colorcun.com/overImg.png" />
... ... @@ -87,7 +87,7 @@
</view>
<view class="preferential" wx:if="{{hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0}}">
<block wx:for="{{coupon_dataList}}" wx:key="index" wx:for-index="index">
<view class="preferentialItems" wx:if="{{dataStr<(item.etime*1) && item.status == '1'}}">
<view class="preferentialItems">
<view class="left">
<view class="top">
<text class="font28r">{{item.aname}}</text>
... ... @@ -114,8 +114,8 @@
</block>
</view>
<view wx:if="{{is_comments=='1' && !is_user_comments}}" class="evaluateBox" bindtap="evaluateFun">
<text wx:if="{{is_comments=='1' && marketing.is_comments_coupon!='1'}}">想吐槽?戳这里填写意见!--></text>
<text wx:if="{{marketing.is_comments_coupon=='1'}}">想吐槽?戳这里填写意见反馈赢好礼!</text>
<text wx:if="{{is_comments=='1' && (marketing.is_comments_coupon!='1' || couponData.showCoupon!='1')}}">想<text class="font36r">吐槽</text>?戳这里填写意见!--></text>
<text wx:if="{{marketing.is_comments_coupon=='1' && couponData && couponData.showCoupon =='1'}}">想<text class="font36r">吐槽</text>?戳这里填写意见反馈赢好礼!</text>
<image src="https://qn.colorcun.com/evaluate.png" mode="" />
</view>
<view class="reserveBox" wx:if="{{reserveData && (reserveData.title || reserveData.content)}}">
... ... @@ -236,12 +236,11 @@
</view>
</view>
</view>
<view class="preferential" wx:if="{{hasValueRecharge && marketing && (marketing.is_coupon=='1' || marketing.is_recharge=='1')}}">
<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)))}}">
<view class="preferential" wx:if="{{hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data}}">
<view class="rubric rubric1">
特别优惠
</view>
<!-- 当前日期要大于限制结束日期 -->
<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)))}}">
<view class="preferentialItems">
<view class="left">
<view class="top">
<text class="font28r">{{recharge_data.rname}}</text>
... ...
... ... @@ -59,6 +59,7 @@ Page({
paymentId: '', //定金id
wxml: null,
imgSrc:'',//canvas图片地址
couponData: '', //评价赠送优惠券数据
},
tablestr: '',
urlsValue: [],
... ... @@ -556,7 +557,11 @@ Page({
if (marketing) {
is_comments = marketing.is_comments ? marketing.is_comments : '';
coupon = marketing.coupon_data ? util.determine(marketing.coupon_data) : '';
}
let info = marketing.coupon_data_comments ? util.determine(marketing.coupon_data_comments) : '';
let couponDataId = info && info.length > 0 ? info[0].id : {}
// 根据券ID获取评价赠送的券详情
if(couponDataId) this.getEvaluateFun(couponDataId)
}
// is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示
if (coupon && util.getType(coupon) == 'object') {
couponList.push({
... ... @@ -776,14 +781,32 @@ Page({
if (recharge_list.is_price == '1') priceInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.price + '元余额';
if (recharge_list.is_score == '1') scoreInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.score + '积分';
if (recharge_list.is_coupons == '1' && recharge_list.coupons_names.length > 0) certificate = recharge_list.coupons_names.join('、');
this.setData({
recharge_data: detail,
let recharge_data = (this.data.dataStr<detail.etime*1 && detail.is_open == '1') ? detail : ''
console.log('邀请函--------------充值',recharge_data);
this.setData({
recharge_data,
scoreInfo,
priceInfo,
certificate
})
})
},
// 获取评价赠送的券最新详情
getEvaluateFun(id){
App.Activity.GetActivityById({
id
}).then(res => {
if (res.data.length > 0) {
let couponData = res.data[0]
// showCoupon 代表赠送的券没过有效期 && 是开启状态
couponData.showCoupon = (this.data.dataStr<(couponData.etime*1) && couponData.is_open=='1') ? '1' : '0';
console.log('邀请函--------------------评价赠送的优惠券',couponData);
this.setData({
couponData:res.data[0]
})
}
})
},
// 根据券ID获取券详情
getActivityByIdFun(ids, length) {
let coupon_dataList = [];
... ... @@ -801,8 +824,10 @@ Page({
let price = detail.price * 1;
detail.discount = cash != 0 ? ((price / cash) * 10).toFixed(1) : '';
}
coupon_dataList.push(detail);
if (length === ids.length) {
coupon_dataList.push(detail);
if (length === coupon_dataList.length) {
coupon_dataList = coupon_dataList.filter(item=>{return this.data.dataStr<(item.etime*1) && item.is_open == '1'})
console.log('邀请函--------------------优惠券',coupon_dataList);
this.setData({
coupon_dataList,
})
... ...
... ... @@ -11,7 +11,7 @@
/>
<image class="giftImg"
bindtap="gotoSellerGift"
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))))}}"
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)}}"
src="https://nosqn.colorcun.com/sellerGift.png" mode=""/>
<image wx:if="{{detail && detail.status =='4'}}" class="cannotImg" src="https://qn.colorcun.com/cancelImg.png" />
<image wx:if="{{options && options.isOrder == '1' && detail.status !='4'}}" class="cannotImg" src="https://qn.colorcun.com/overImg.png" />
... ... @@ -80,7 +80,7 @@
</view>
<view class="preferentialCoupon" wx:if="{{hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0}}">
<block wx:for="{{coupon_dataList}}" wx:key="index" wx:for-index="index">
<view class="preferentialItems" wx:if="{{dataStr<(item.etime*1) && item.status == '1'}}">
<view class="preferentialItems">
<view class="itemLeft">
<text wx:if="{{item.discount!='0.00' && (item.use.is_cash=='1' || item.use.is_cash) && item.discount}}" class="discountText font24r">{{item.discount}}折</text>
<view class="priceText" wx:if="{{item.price}}">
... ... @@ -108,8 +108,8 @@
</block>
</view>
<view wx:if="{{is_comments=='1' && !is_user_comments}}" class="evaluateBox" bindtap="evaluateFun">
<text wx:if="{{is_comments=='1' && marketing.is_comments_coupon!='1'}}">想<text>吐槽</text>?戳这里填写意见!--></text>
<text wx:if="{{marketing.is_comments_coupon=='1'}}">想<text>吐槽</text>?戳这里填写意见反馈赢好礼!</text>
<text wx:if="{{is_comments=='1' && (marketing.is_comments_coupon!='1' || couponData.showCoupon!='1')}}">想<text class="font36r">吐槽</text>?戳这里填写意见!--></text>
<text wx:if="{{marketing.is_comments_coupon=='1' && couponData && couponData.showCoupon =='1'}}">想<text class="font36r">吐槽</text>?戳这里填写意见反馈赢好礼!</text>
<image wx:if="{{themeColor == 'pearlWhite'}}" src="https://nosqn.colorcun.com/evaluateWhite.png" mode="" />
<image wx:elif="{{themeColor == 'turmeric' || themeColor == 'greenishYellow' || themeColor == 'golden'}}" src="https://nosqn.colorcun.com/evaluateYellow.png" mode="" />
<image wx:else src="https://nosqn.colorcun.com/evaluate2.png" mode="" />
... ... @@ -191,7 +191,7 @@
</view>
</view>
</view>
<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)))}}">
<block wx:if="{{hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data}}">
<view wx:if="{{titleType}}" class="chefText font36r">
<titleStyle isWhite="{{themeColor}}" titleStyleType="{{titleType}}" titleText="会员招募"></titleStyle>
</view>
... ...
... ... @@ -59,6 +59,7 @@ Page({
paymentId: '', //定金id
wxml: null,
imgSrc:'',//canvas图片地址
couponData: '', //评价赠送优惠券数据
},
tablestr: '',
urlsValue: [],
... ... @@ -555,7 +556,11 @@ Page({
if (marketing) {
is_comments = marketing.is_comments ? marketing.is_comments : '';
coupon = marketing.coupon_data ? util.determine(marketing.coupon_data) : '';
}
let info = marketing.coupon_data_comments ? util.determine(marketing.coupon_data_comments) : '';
let couponDataId = info && info.length > 0 ? info[0].id : {}
// 根据券ID获取评价赠送的券详情
if(couponDataId) this.getEvaluateFun(couponDataId)
}
// is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示
if (coupon && util.getType(coupon) == 'object') {
couponList.push({
... ... @@ -775,14 +780,32 @@ Page({
if (recharge_list.is_price == '1') priceInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.price + '元余额';
if (recharge_list.is_score == '1') scoreInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.score + '积分';
if (recharge_list.is_coupons == '1' && recharge_list.coupons_names.length > 0) certificate = recharge_list.coupons_names.join('、');
this.setData({
recharge_data: detail,
let recharge_data = (this.data.dataStr<detail.etime*1 && detail.is_open == '1') ? detail : ''
console.log('邀请函--------------充值',recharge_data);
this.setData({
recharge_data,
scoreInfo,
priceInfo,
certificate
})
})
},
// 获取评价赠送的券最新详情
getEvaluateFun(id){
App.Activity.GetActivityById({
id
}).then(res => {
if (res.data.length > 0) {
let couponData = res.data[0]
// showCoupon 代表赠送的券没过有效期 && 是开启状态
couponData.showCoupon = (this.data.dataStr<(couponData.etime*1) && couponData.is_open=='1') ? '1' : '0';
console.log('邀请函--------------------评价赠送的优惠券',couponData);
this.setData({
couponData:res.data[0]
})
}
})
},
// 根据券ID获取券详情
getActivityByIdFun(ids, length) {
let coupon_dataList = [];
... ... @@ -800,8 +823,10 @@ Page({
let price = detail.price * 1;
detail.discount = cash != 0 ? ((price / cash) * 10).toFixed(1) : '';
}
coupon_dataList.push(detail);
if (length === ids.length) {
coupon_dataList.push(detail);
if (length === coupon_dataList.length) {
coupon_dataList = coupon_dataList.filter(item=>{return this.data.dataStr<(item.etime*1) && item.is_open == '1'})
console.log('邀请函--------------------优惠券',coupon_dataList);
this.setData({
coupon_dataList,
})
... ...
... ... @@ -11,7 +11,7 @@
/>
<image class="giftImg"
bindtap="gotoSellerGift"
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))))}}"
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)}}"
src="https://nosqn.colorcun.com/sellerGift.png" mode=""/>
<image wx:if="{{detail && detail.status =='4'}}" class="cannotImg" src="https://qn.colorcun.com/cancelImg.png" />
<image wx:if="{{options && options.isOrder == '1' && detail.status !='4'}}" class="cannotImg" src="https://qn.colorcun.com/overImg.png" />
... ... @@ -77,7 +77,7 @@
</view>
<view class="preferentialCoupon" wx:if="{{hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0}}">
<block wx:for="{{coupon_dataList}}" wx:key="index" wx:for-index="index">
<view class="preferentialItems" wx:if="{{dataStr<(item.etime*1) && item.status == '1'}}">
<view class="preferentialItems">
<view class="itemLeft">
<text wx:if="{{item.discount!='0.00' && (item.use.is_cash=='1' || item.use.is_cash) && item.discount}}" class="discountText font24r">{{item.discount}}折</text>
<view class="priceText" wx:if="{{item.price}}">
... ... @@ -105,8 +105,8 @@
</block>
</view>
<view wx:if="{{is_comments=='1' && !is_user_comments}}" class="evaluateBox" bindtap="evaluateFun">
<text wx:if="{{is_comments=='1' && marketing.is_comments_coupon!='1'}}">想<text>吐槽</text>?戳这里填写意见!--></text>
<text wx:if="{{marketing.is_comments_coupon=='1'}}">想<text>吐槽</text>?戳这里填写意见反馈赢好礼!</text>
<text wx:if="{{is_comments=='1' && (marketing.is_comments_coupon!='1' || couponData.showCoupon!='1')}}">想<text class="font36r">吐槽</text>?戳这里填写意见!--></text>
<text wx:if="{{marketing.is_comments_coupon=='1' && couponData && couponData.showCoupon =='1'}}">想<text class="font36r">吐槽</text>?戳这里填写意见反馈赢好礼!</text>
<image wx:if="{{themeColor == 'pearlWhite'}}" src="https://nosqn.colorcun.com/evaluateWhite.png" mode="" />
<image wx:elif="{{themeColor == 'turmeric' || themeColor == 'greenishYellow' || themeColor == 'golden'}}" src="https://nosqn.colorcun.com/evaluateYellow.png" mode="" />
<image wx:else src="https://nosqn.colorcun.com/evaluate2.png" mode="" />
... ... @@ -188,7 +188,7 @@
</view>
</view>
</view>
<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)))}}">
<block wx:if="{{hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data}}">
<view wx:if="{{titleType}}" class="chefText font36r">
<titleStyle isWhite="{{themeColor}}" titleStyleType="{{titleType}}" titleText="会员招募"></titleStyle>
</view>
... ...
... ... @@ -67,6 +67,7 @@ Page({
wxml: null,
imgSrc: '', //canvas图片地址
colors:'',//导航栏颜色
couponData: '', //评价赠送优惠券数据
},
tablestr: '',
urlsValue: [],
... ... @@ -592,6 +593,10 @@ Page({
if (marketing) {
is_comments = marketing.is_comments ? marketing.is_comments : '';
coupon = marketing.coupon_data ? util.determine(marketing.coupon_data) : '';
let info = marketing.coupon_data_comments ? util.determine(marketing.coupon_data_comments) : '';
let couponDataId = info && info.length > 0 ? info[0].id : {}
// 根据券ID获取评价赠送的券详情
if(couponDataId) this.getEvaluateFun(couponDataId)
}
// is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示
if (coupon && util.getType(coupon) == 'object') {
... ... @@ -624,7 +629,7 @@ Page({
themeColor,
settingUrl,
inviteImgUrl,
colors,
colors,
}
console.log('获取数据', {
...obj
... ... @@ -652,7 +657,7 @@ Page({
themeColor,
settingUrl,
inviteImgUrl,
colors,
colors,
})
// 开启语音播报
if (reserve && reserve.swich_voice == '1') {
... ... @@ -809,7 +814,7 @@ Page({
App.Activity.GetNewRecharge({
id
}).then(res => {
let detail = res.data
let detail = res.data
let exp_date = res.data.exp_date ? JSON.parse(res.data.exp_date) : ''
let recharge_list = res.data.recharge_list ? JSON.parse(res.data.recharge_list) : ''
let priceInfo, scoreInfo, certificate;
... ... @@ -818,14 +823,32 @@ Page({
if (recharge_list.is_price == '1') priceInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.price + '元余额';
if (recharge_list.is_score == '1') scoreInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.score + '积分';
if (recharge_list.is_coupons == '1' && recharge_list.coupons_names.length > 0) certificate = recharge_list.coupons_names.join('、');
this.setData({
recharge_data: detail,
let recharge_data = (this.data.dataStr<detail.etime*1 && detail.is_open == '1') ? detail : ''
console.log('邀请函--------------充值',recharge_data);
this.setData({
recharge_data,
scoreInfo,
priceInfo,
certificate
})
})
},
},
// 获取评价赠送的券最新详情
getEvaluateFun(id){
App.Activity.GetActivityById({
id
}).then(res => {
if (res.data.length > 0) {
let couponData = res.data[0]
// showCoupon 代表赠送的券没过有效期 && 是开启状态
couponData.showCoupon = (this.data.dataStr<(couponData.etime*1) && couponData.is_open=='1') ? '1' : '0';
console.log('邀请函--------------------评价赠送的优惠券',couponData);
this.setData({
couponData:res.data[0]
})
}
})
},
// 根据券ID获取券详情
getActivityByIdFun(ids, length) {
let coupon_dataList = [];
... ... @@ -842,9 +865,11 @@ Page({
let cash = detail.use.cash * 1;
let price = detail.price * 1;
detail.discount = cash != 0 ? ((price / cash) * 10).toFixed(1) : '';
}
coupon_dataList.push(detail);
if (length === ids.length) {
}
coupon_dataList.push(detail);
if (length === coupon_dataList.length) {
coupon_dataList = coupon_dataList.filter(item=>{return this.data.dataStr<(item.etime*1) && item.is_open == '1'})
console.log('邀请函--------------------优惠券',coupon_dataList);
this.setData({
coupon_dataList,
})
... ...
... ... @@ -5,7 +5,7 @@
<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}}" />
<image class="giftImg"
bindtap="gotoSellerGift"
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))))}}"
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)}}"
src="https://nosqn.colorcun.com/sellerGift.png" mode=""/>
<image wx:if="{{detail && detail.status =='4'}}" class="cannotImg" src="https://qn.colorcun.com/cancelImg.png" />
<image wx:if="{{options && options.isOrder == '1' && detail.status !='4'}}" class="cannotImg" src="https://qn.colorcun.com/overImg.png" />
... ... @@ -82,7 +82,7 @@
</view>
<view class="preferentialCoupon" wx:if="{{hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0}}">
<block wx:for="{{coupon_dataList}}" wx:key="index" wx:for-index="index">
<view class="preferentialItems" wx:if="{{dataStr<(item.etime*1) && item.status == '1'}}">
<view class="preferentialItems">
<view class="itemLeft">
<text wx:if="{{item.discount!='0.00' && (item.use.is_cash=='1' || item.use.is_cash) && item.discount}}" class="discountText font24r">{{item.discount}}折</text>
<view class="priceText" wx:if="{{item.price}}">
... ... @@ -110,8 +110,8 @@
</block>
</view>
<view wx:if="{{is_comments=='1' && !is_user_comments}}" class="evaluateBox" bindtap="evaluateFun">
<text wx:if="{{is_comments=='1' && marketing.is_comments_coupon!='1'}}">想<text class="font36r">吐槽</text>?戳这里填写意见!--></text>
<text wx:if="{{marketing.is_comments_coupon=='1'}}">想<text class="font36r">吐槽</text>?戳这里填写意见反馈赢好礼!</text>
<text wx:if="{{is_comments=='1' && (marketing.is_comments_coupon!='1' || couponData.showCoupon!='1')}}">想<text class="font36r">吐槽</text>?戳这里填写意见!--></text>
<text wx:if="{{marketing.is_comments_coupon=='1' && couponData && couponData.showCoupon =='1'}}">想<text class="font36r">吐槽</text>?戳这里填写意见反馈赢好礼!</text>
<image src="https://nosqn.colorcun.com/evaluate2.png" mode="" />
</view>
<view class="reserveBox" wx:if="{{reserveData && (reserveData.title || reserveData.content)}}">
... ... @@ -193,7 +193,7 @@
</view>
</view>
<view class="introduce introduceBottom">
<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)))}}">
<block wx:if="{{hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data}}">
<block wx:if="{{titleType}}">
<titleStyle titleStyleType="{{titleType}}" titleText="会员招募"></titleStyle>
</block>
... ...
... ... @@ -21,6 +21,8 @@ Page({
coupon:'',
is_user_comments:'',
showLoading:false,
couponData: '', //评价赠送优惠券数据
dataStr: Date.now() * 1 / 1000,
},
text: '',
/**
... ... @@ -74,24 +76,11 @@ Page({
marketing = util.determine(data.marketing);
if(marketing){
is_comments = marketing.is_comments?marketing.is_comments:'';
marketing.coupon_data_comments=(is_comments=='1' && marketing.is_comments_coupon=='1')?util.determine(marketing.coupon_data_comments):'';
}
let coupon_data_comments=marketing.coupon_data_comments;//赠送优惠券的列表
let coupon=(marketing && marketing.is_comments=='1' && marketing.is_comments_coupon=='1')?'1':'0';//评价赠送优惠券
let couponId,price,use;
if(coupon && coupon_data_comments && coupon_data_comments.length>0){
let obj=coupon_data_comments[0];
console.log('填写意见获取的券的信息',obj);
couponId=obj.id;
price=obj.price;
use=JSON.stringify(obj.use)
let info = marketing.coupon_data_comments ? util.determine(marketing.coupon_data_comments) : '';
let couponDataId = info && info.length > 0 ? info[0].id : {}
// 根据券ID获取评价赠送的券详情
if (couponDataId) this.getEvaluateFun(couponDataId, is_comments, marketing.is_comments_coupon)
}
this.setData({
coupon:coupon || '',
couponId:couponId || '',
price:price || '',
use:use || '',
})
this.setData({
marketing,
})
... ... @@ -99,6 +88,28 @@ Page({
console.log('GetSellerTemplateConf请求失败');
})
},
// 获取评价赠送的券最新详情
getEvaluateFun(id, is_comments, is_comments_coupon) {
App.Activity.GetActivityById({
id
}).then(res => {
if (res.data.length > 0) {
let couponData = res.data[0]
// showCoupon 代表赠送的券没过有效期 && 是开启状态
couponData.showCoupon = (this.data.dataStr < (couponData.etime * 1) && couponData.is_open == '1') ? '1' : '0';
let coupon = (is_comments == '1' && is_comments_coupon == '1' && couponData.showCoupon == '1') ? '1' : '0'; //评价赠送优惠券
console.log('邀请函--------------------评价赠送的优惠券', couponData);
console.log('邀请函--------------------是否要赠送优惠券', coupon);
this.setData({
coupon: coupon || '',
couponId: id || '',
price: couponData.price || '',
use: JSON.stringify(couponData.use) || '',
couponData,
})
}
})
},
// 获取上传的图片或者视频
tpupload(e) {
this.setData({
... ... @@ -147,10 +158,10 @@ Page({
let options = this.data.options
console.log('options',options);
// 有券
if (this.data.coupon == '1') {
if (this.data.coupon == '1' && this.data.couponData.showCoupon == '1') {
url = util.http_build_query({
sellerName: options.sellerName,
coupon: this.data.coupon,
coupon: '1',
couponId: this.data.couponId,
price: this.data.price,
use: this.data.use,
... ... @@ -160,7 +171,7 @@ Page({
} else { //没券
url = util.http_build_query({
sellerName: options.sellerName,
coupon: this.data.coupon, //1有券 2没有券
coupon: '0', //1有券 0没有券
couponId: this.data.couponId || '',
sellid: options.sellerid,
}, './opinionSuccess')
... ...
... ... @@ -96,7 +96,7 @@ button[disabled]:not([type]) {
}
.loading-image {
width: 60rpx;
width: 80rpx;
height: 60rpx;
}
... ...
... ... @@ -34,29 +34,32 @@ Page({
}).then(res => {
if(res.ret==200){
let data=res.data
let marketing,is_comments;
marketing = util.determine(data.marketing);
if(marketing){
is_comments = marketing.is_comments?marketing.is_comments:'';
marketing.coupon_data_comments=(is_comments=='1' && marketing.is_comments_coupon=='1')?util.determine(marketing.coupon_data_comments):'';
}
console.log('marketingmarketing',{...marketing});
let coupon_data_comments=marketing && marketing.coupon_data_comments?marketing.coupon_data_comments:[];//赠送优惠券的列表
let coupon=(marketing && marketing.is_comments=='1' && marketing.is_comments_coupon=='1')?'1':'0';//评价赠送优惠券
let couponId,price,use;
if(coupon && coupon_data_comments && coupon_data_comments.length>0){
let obj=coupon_data_comments[0];
console.log('填写意见获取的券的信息',obj);
couponId=obj.id;
price=obj.price;
use=JSON.stringify(obj.use)
let marketing = util.determine(data.marketing);
if (marketing) {
let info = marketing.coupon_data_comments ? util.determine(marketing.coupon_data_comments) : '';
let couponDataId = info && info.length > 0 ? info[0].id : {}
// 根据券ID获取评价赠送的券详情
if (couponDataId) this.getEvaluateFun(couponDataId, sid)
}
this.setData({
'options.price':price || '',
'options.use':use || '',
'options.coupon':coupon || '',
'options.couponId':couponId || '',
StyleType:data.type
StyleType: data.type
})
}else{
console.log('GetSellerTemplateConf请求失败');
}
})
},
// 根据券ID获取评价赠送的券详情
getEvaluateFun(id,sid){
App.Activity.GetActivityById({
id
}).then(res => {
if (res.data.length > 0) {
let couponData = res.data[0]
this.setData({
'options.price':couponData.price || '',
'options.use':couponData.use || '',
'options.couponId':id || '',
})
setTimeout(() => {
// 金额为0 直接领券后
... ... @@ -78,11 +81,9 @@ Page({
})
}
}, 100);
}else{
console.log('GetSellerTemplateConf请求失败');
}
})
},
})
},
seeCoupon() {
wx.showLoading({
title: '加载中',
... ...
... ... @@ -116,19 +116,16 @@ Page({
let data = res.data
console.log('data', data);
let couponList = []
let StyleType, couponData, marketing, coupon, is_comments;
let StyleType, marketing, coupon, is_comments;
marketing = util.determine(data.marketing);
StyleType = data.type;
if (marketing) {
is_comments = marketing.is_comments ? marketing.is_comments : '';
coupon = marketing.coupon_data ? util.determine(marketing.coupon_data) : '';
couponData = marketing.coupon_data_comments ? util.determine(marketing.coupon_data_comments) : '';
couponData = couponData && couponData.length > 0 ? couponData[0] : {}
if ((couponData.use && (!couponData.use.is_cash || couponData.use.is_cash == '1'))) {
let cash = couponData.use.cash * 1;
let price = couponData.price * 1;
couponData.discount = cash != 0 ? ((price / cash) * 10).toFixed(1) : '';
}
let info = marketing.coupon_data_comments ? util.determine(marketing.coupon_data_comments) : '';
let couponDataId = info && info.length > 0 ? info[0].id : {}
// 根据券ID获取评价赠送的券详情
if(couponDataId) this.getEvaluateFun(couponDataId)
}
// is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示
if (coupon && util.getType(coupon) == 'object') {
... ... @@ -150,7 +147,6 @@ Page({
coupon,
couponList,
is_comments,
couponData,
StyleType,
}
console.log('获取数据', {
... ... @@ -167,13 +163,33 @@ Page({
coupon,
is_comments,
couponList,
couponData,
StyleType,
})
}).catch(res => {
console.log('GetSellerTemplateConf请求失败');
})
},
// 获取评价赠送的券最新详情
getEvaluateFun(id){
App.Activity.GetActivityById({
id
}).then(res => {
if (res.data.length > 0) {
let couponData = res.data[0]
if ((couponData.use && (!couponData.use.is_cash || couponData.use.is_cash == '1'))) {
let cash = couponData.use.cash * 1;
let price = couponData.price * 1;
couponData.discount = cash != 0 ? ((price / cash) * 10).toFixed(1) : '';
}
// showCoupon 代表赠送的券没过有效期 && 是开启状态
couponData.showCoupon = (this.data.dataStr<(couponData.etime*1) && couponData.is_open=='1') ? '1' : '0';
console.log('邀请函--------------------评价赠送的优惠券',couponData);
this.setData({
couponData:res.data[0]
})
}
})
},
// 根据充值ID获取充值详情
getRechargeDetail(id) {
App.Activity.GetNewRecharge({
... ... @@ -188,8 +204,10 @@ Page({
if (recharge_list.is_price == '1') priceInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.price + '元余额';
if (recharge_list.is_score == '1') scoreInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.score + '积分';
if (recharge_list.is_coupons == '1' && recharge_list.coupons_names.length > 0) certificate = recharge_list.coupons_names.join('、');
let recharge_data = (this.data.dataStr<detail.etime*1 && detail.is_open == '1') ? detail : ''
console.log('邀请函--------------充值',recharge_data);
this.setData({
recharge_data: detail,
recharge_data,
scoreInfo,
priceInfo,
certificate
... ... @@ -214,11 +232,13 @@ Page({
detail.discount = cash != 0 ? ((price / cash) * 10).toFixed(1) : '';
}
coupon_dataList.push(detail);
if (length === ids.length) {
this.setData({
coupon_dataList,
})
}
if (length === coupon_dataList.length) {
coupon_dataList = coupon_dataList.filter(item=>{return this.data.dataStr<(item.etime*1) && item.is_open == '1'})
console.log('邀请函--------------------优惠券',coupon_dataList);
this.setData({
coupon_dataList,
})
}
}
})
})
... ...
... ... @@ -6,7 +6,7 @@
<view class="sign"></view><text class="font32r">专属优惠券</text>
</view>
<block wx:for="{{coupon_dataList}}" wx:key="index" wx:for-index="index">
<view class="preferentialItems" wx:if="{{dataStr<(item.etime*1) && item.status == '1'}}">
<view class="preferentialItems">
<view class="itemLeft">
<text wx:if="{{item.discount!='0.00' && (item.use.is_cash=='1' || item.use.is_cash) && item.discount}}" class="discountText font24r">{{item.discount}}折</text>
<text wx:if="{{item.use.is_dish=='1'}}" class="discountText font24r">特惠菜品</text>
... ... @@ -35,7 +35,7 @@
</view>
</block>
</view>
<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)))}}">
<view class="box" wx:if="{{hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data}}">
<view class="title">
<view class="sign"></view><text class="font32r">会员充值优惠</text>
</view>
... ... @@ -62,11 +62,11 @@
</view>
</view>
<!-- 启用评价 && 是否评价过 && 评价赠送优惠券 && 赠送的优惠券有数据-->
<view class="box" wx:if="{{is_comments=='1' && !is_user_comments && marketing.is_comments_coupon=='1' && couponData}}">
<view class="box" wx:if="{{is_comments=='1' && !is_user_comments && marketing.is_comments_coupon=='1' && couponData && couponData.showCoupon =='1'}}">
<view class="title">
<view class="sign"></view><text class="font32r">反馈有礼</text>
</view>
<view class="preferentialItems" wx:if="{{couponData && dataStr<(couponData.etime*1) && couponData.status == '1'}}">
<view class="preferentialItems">
<view class="itemLeft">
<text wx:if="{{couponData.discount!='0.00' && (couponData.use.is_cash=='1' || couponData.use.is_cash) && couponData.discount}}" class="discountText font24r">{{couponData.discount}}折</text>
<view class="priceText" wx:if="{{couponData.price}}">
... ... @@ -77,7 +77,7 @@
<view class="btns">
<text class="font40r">{{couponData.aname}}</text>
<view bindtap="evaluateFun" class="font24r orderingFood">
抢购
领取
</view>
</view>
<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({
})
},
// 获取商家版本,不是超能版或者没有开通对应模块,不显示
getSellerVersionFun(sellerid){
getSellerVersionFun(sellerid) {
App.SellerVersion.GetSellerVersion({
sellerid
}).then((res) => {
console.log('版本列表',res.data);
if(res.data && res.data.length>0){
const hasValueCertificate = res.data.some(item => item.vid == '1' || item.vid == '2' || item.vid == '3' || item.vid == '8');
const hasValueRecharge = res.data.some(item => item.vid == '1' || item.vid == '2' || item.vid == '3' || item.vid == '9');
let data = res.data;
console.log('版本列表', data);
if (data && data.length > 0) {
data.sort((a, b) => b.cdate * 1 - a.cdate * 1);
// 获取店铺当前版本 (cdate最大最后一个充入的 && 当前时间有效 && 当前版本)
let obj = data.find(item => item.vtype == 1 || item.vtype == 2 || item.vtype == 4);
console.log('当前版本', {
...obj
});
// 优惠券功能:超能版 || 高级版 || 有优惠券模块
const hasValueCertificate = obj.vtype == '1' || obj.vtype == '4' || data.some(item => item.vid == '8');
// 充值功能:超能版 || 有充值模块
const hasValueRecharge = obj.vtype == '1' || data.some(item => item.vid == '9');
this.setData({
hasValueCertificate,
hasValueRecharge,
... ... @@ -209,8 +218,10 @@ Page({
if (recharge_list.is_price == '1') priceInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.price + '元余额';
if (recharge_list.is_score == '1') scoreInfo = '会员充值满' + detail.recharge_money + '元赠送' + recharge_list.score + '积分';
if (recharge_list.is_coupons == '1' && recharge_list.coupons_names.length > 0) certificate = recharge_list.coupons_names.join('、');
this.setData({
recharge_data: detail,
let recharge_data = (this.data.dataStr<detail.etime*1 && detail.is_open == '1') ? detail : ''
console.log('商家详情--------------充值',recharge_data);
this.setData({
recharge_data,
scoreInfo,
priceInfo,
certificate
... ... @@ -235,10 +246,12 @@ Page({
detail.discount = cash != 0 ? ((price / cash) * 10).toFixed(1) : '';
}
coupon_dataList.push(detail);
if (length === ids.length) {
if (length === coupon_dataList.length) {
coupon_dataList = coupon_dataList.filter(item=>{return this.data.dataStr<(item.etime*1) && item.is_open == '1'})
console.log('商家详情--------------------优惠券',coupon_dataList);
this.setData({
coupon_dataList,
})
})
}
}
})
... ...
... ... @@ -21,7 +21,7 @@
</view>
<view class="preferential" wx:if="{{hasValueCertificate && marketing && marketing.is_coupon=='1' && coupon_dataList.length>0}}">
<block wx:for="{{coupon_dataList}}" wx:key="index" wx:for-index="index">
<view class="preferentialItems" wx:if="{{dataStr<(item.etime*1) && item.status == '1'}}">
<view class="preferentialItems">
<view class="itemLeft couponItem">
<view class="itemTop">
<text class="font28r">{{item.aname}}</text>
... ... @@ -94,12 +94,11 @@
</block>
</view>
</view>
<view class="preferential" wx:if="{{hasValueRecharge && marketing && (marketing.is_coupon=='1' || marketing.is_recharge=='1')}}">
<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)))}}">
<view class="preferential">
<view class="chefText font36r">
特别优惠
</view>
<!-- 当前日期要大于限制结束日期 -->
<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)))}}">
<view class="preferentialItems" wx:if="{{hasValueRecharge && marketing && marketing.is_recharge=='1' && recharge_data}}">
<view class="itemLeft">
<view class="itemTop font28r">
<text>{{recharge_data.rname}}</text>
... ...