|
...
|
...
|
@@ -24,9 +24,11 @@ Page({ |
|
|
|
signboard: {},
|
|
|
|
store: {},
|
|
|
|
recharge_data: {},
|
|
|
|
activeData: {},
|
|
|
|
coupon_dataList: [],
|
|
|
|
seller: {},
|
|
|
|
priceInfo: '',
|
|
|
|
scoreInfo: '',
|
|
|
|
certificate: '',
|
|
|
|
dataStr: Date.now() * 1 / 1000,
|
|
|
|
swich_phone: '0', //是否显示前台电话
|
|
|
|
is_comments: '0',
|
|
...
|
...
|
@@ -671,8 +673,10 @@ Page({ |
|
|
|
couponList = this.addCoupons(coupon_data_free,couponList);
|
|
|
|
// 根据券ID获取券详情
|
|
|
|
this.getActivityByIdFun(couponList)
|
|
|
|
// 获取所有充值活动
|
|
|
|
this.getRechargeDetail()
|
|
|
|
// 根据充值ID获取充值详情
|
|
|
|
if (marketing && marketing.is_recharge && marketing.is_recharge == '1' && marketing.recharge_data) {
|
|
|
|
this.getRechargeDetail(marketing.recharge_data.id)
|
|
|
|
}
|
|
|
|
if (store && store.images && store.images.length > 0) store.images = util.determine(store.images);
|
|
|
|
if (reserve && reserve.park_info_images && reserve.park_info_images.length > 0) reserve.park_info_images = util.determine(reserve.park_info_images);
|
|
|
|
if (signboard && signboard.images && signboard.images.length > 0) signboard.images = util.determine(signboard.images);
|
|
...
|
...
|
@@ -860,42 +864,31 @@ Page({ |
|
|
|
}
|
|
|
|
},
|
|
|
|
// 根据充值ID获取充值详情
|
|
|
|
getRechargeDetail() {
|
|
|
|
App.Activity.GetNewRechargeList({
|
|
|
|
sellerid: this.data.detail.seller.id,
|
|
|
|
getRechargeDetail(id) {
|
|
|
|
App.Activity.GetNewRecharge({
|
|
|
|
id
|
|
|
|
}).then(res => {
|
|
|
|
if (res.data) {
|
|
|
|
let arr = []
|
|
|
|
res.data.forEach(i => {
|
|
|
|
if (i.status != '1') {
|
|
|
|
arr.push(i)
|
|
|
|
}
|
|
|
|
})
|
|
|
|
let recharge_data = arr;
|
|
|
|
recharge_data.forEach(item => {
|
|
|
|
item.recharge_list = item.recharge_list ? JSON.parse(item.recharge_list) : '';
|
|
|
|
let recharge_list = item.recharge_list;
|
|
|
|
item.priceInfo = '';
|
|
|
|
item.scoreInfo = '';
|
|
|
|
item.certificate = '';
|
|
|
|
if (recharge_list.is_price == '1') item.priceInfo = '会员充值满' + item.recharge_money + '元赠送' + item.recharge_list.price + '元余额';
|
|
|
|
if (recharge_list.is_score == '1') item.scoreInfo = '会员充值满' + item.recharge_money + '元赠送' + item.recharge_list.score + '积分';
|
|
|
|
if (recharge_list.is_coupons == '1' && recharge_list.coupons_names.length > 0) item.certificate = recharge_list.coupons_names.join('、');
|
|
|
|
item.timeStr = util.unixtoTime(item.stime, 'YYYY-MM-DD') + ' - ' + util.unixtoTime(item.etime, 'YYYY-MM-DD')
|
|
|
|
})
|
|
|
|
// 筛选出 未过期的 && 开启状态的充值活动
|
|
|
|
recharge_data = recharge_data.filter(item => {
|
|
|
|
return this.data.dataStr < (item.etime * 1) && item.is_open == '1'
|
|
|
|
})
|
|
|
|
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;
|
|
|
|
detail.recharge_list = recharge_list;
|
|
|
|
detail.exp_date = exp_date;
|
|
|
|
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,
|
|
|
|
activeData: recharge_data.length > 0 ? recharge_data[0] : {},
|
|
|
|
scoreInfo,
|
|
|
|
priceInfo,
|
|
|
|
certificate
|
|
|
|
})
|
|
|
|
} else {
|
|
|
|
this.setData({
|
|
|
|
recharge_data: [],
|
|
|
|
activeData: {},
|
|
|
|
recharge_data: {},
|
|
|
|
})
|
|
|
|
}
|
|
|
|
})
|
...
|
...
|
|