|
...
|
...
|
@@ -887,36 +887,42 @@ Page({ |
|
|
|
App.Activity.GetNewRecharge({
|
|
|
|
id
|
|
|
|
}).then(res => {
|
|
|
|
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 = '赠送' + recharge_list.price + '元余额';
|
|
|
|
if (recharge_list.is_score == '1') scoreInfo = '赠送' + 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);
|
|
|
|
let entry = this.data.titleList
|
|
|
|
if (this.data.hasValueRecharge && this.data.marketing.is_recharge == '1' && recharge_data) {
|
|
|
|
entry.push({
|
|
|
|
id: 2,
|
|
|
|
title: '会员充值优惠'
|
|
|
|
})
|
|
|
|
if (entry.length > 0) {
|
|
|
|
entry.sort((a, b) => a.id - b.id);
|
|
|
|
if (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;
|
|
|
|
detail.recharge_list = recharge_list;
|
|
|
|
detail.exp_date = exp_date;
|
|
|
|
if (recharge_list.is_price == '1') priceInfo = '赠送' + recharge_list.price + '元余额';
|
|
|
|
if (recharge_list.is_score == '1') scoreInfo = '赠送' + 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);
|
|
|
|
let entry = this.data.titleList
|
|
|
|
if (this.data.hasValueRecharge && this.data.marketing.is_recharge == '1' && recharge_data) {
|
|
|
|
entry.push({
|
|
|
|
id: 2,
|
|
|
|
title: '会员充值优惠'
|
|
|
|
})
|
|
|
|
if (entry.length > 0) {
|
|
|
|
entry.sort((a, b) => a.id - b.id);
|
|
|
|
}
|
|
|
|
recharge_data.timeStr = util.unixtoTime(recharge_data.stime, 'YYYY-MM-DD') + ' - ' + util.unixtoTime(recharge_data.etime, 'YYYY-MM-DD')
|
|
|
|
}
|
|
|
|
recharge_data.timeStr = util.unixtoTime(recharge_data.stime, 'YYYY-MM-DD') + ' - ' + util.unixtoTime(recharge_data.etime, 'YYYY-MM-DD')
|
|
|
|
this.setData({
|
|
|
|
titleList: entry,
|
|
|
|
activeTitle: entry.length > 0 ? entry[0].id : '',
|
|
|
|
recharge_data,
|
|
|
|
scoreInfo,
|
|
|
|
priceInfo,
|
|
|
|
certificate
|
|
|
|
})
|
|
|
|
} else {
|
|
|
|
this.setData({
|
|
|
|
recharge_data: {},
|
|
|
|
})
|
|
|
|
}
|
|
|
|
this.setData({
|
|
|
|
titleList: entry,
|
|
|
|
activeTitle: entry.length > 0 ? entry[0].id : '',
|
|
|
|
recharge_data,
|
|
|
|
scoreInfo,
|
|
|
|
priceInfo,
|
|
|
|
certificate
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
// 选择标题
|
...
|
...
|
|