|
@@ -309,14 +309,14 @@
|
|
|
success: function (res) {
|
|
|
if (res.status == 0 || res.status == 4106) {
|
|
|
operate('dt_双11_mp_领取红包');
|
|
|
- phoneNumber = res.data.data;
|
|
|
+ phoneNumber = res.data;
|
|
|
let node = `<div class="packet">
|
|
|
<img class="fxhb" src="../static/img/doubleElevenActivity/fxhb.png" />
|
|
|
<div class="money"><span class="money-mark">¥</span><span class="money-val">${obj.money}</span></div>
|
|
|
<div class="packet-title">云手机无门槛抵扣券</div>
|
|
|
<div class="packet-time">${obj.startTime.substring(5,10)}-${obj.endTime.substring(5,10)}日有效</div>
|
|
|
</div>
|
|
|
- <div class="account">优惠券已放入您的账户${phoneNumber}</div>`
|
|
|
+ <div class="account">优惠券已放入您的账户${phoneNumber.substring(0,3)}****${phoneNumber.substring(7,11)}</div>`
|
|
|
$('.red-packet').eq(0).append(node);
|
|
|
$('.activity-btn-text').eq(0).text('在双子星APP使用红包');
|
|
|
} else {
|
|
@@ -330,11 +330,6 @@
|
|
|
}
|
|
|
//调用获取数据列表接口
|
|
|
function getList(){
|
|
|
- // if(!id){
|
|
|
- // stopManyClick(() => {
|
|
|
- // toastr.error('不支持当前环境!');
|
|
|
- // })
|
|
|
- // }
|
|
|
$.ajax({
|
|
|
url: baseUrl + '/api/user/v1/activity/orderRedEnvelopeSharing',
|
|
|
type: 'post',
|
|
@@ -374,15 +369,15 @@
|
|
|
<div class="user-time">${item.createTime}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="meal">${item.state === 0?totalMoney/shareCount+'元红包':getReceivePhoneDuration(item)}</div>
|
|
|
+ <div class="meal">${item.state === 0?totalMoney/quantity+'元红包':getReceivePhoneDuration(item)}</div>
|
|
|
<div class="${['receive no-user','receive',' receive usered'][item.state]}" data-state=${item.state} data-id=${item.id}>${['未使用','领取','已领取'][item.state]}</div>
|
|
|
</div>`
|
|
|
})
|
|
|
str += `<div class="packet">
|
|
|
- <img class="fxhb" data-index=${i} src="../static/img/doubleElevenActivity/fxhb.png" />
|
|
|
- <div class="money"><span class="money-mark">¥</span><span class="money-val" data-index=${i}>${totalMoney}</span></div>
|
|
|
- <div class="packet-titles" data-index=${i}>无门槛</div>
|
|
|
- <div class="packet-times">${startTime.substring(5,11)}-${endTime.substring(5,11)}日有效</div>
|
|
|
+ <img class="fxhb" data-index=${i} data-dataList=${JSON.stringify(dataList)} src="../static/img/doubleElevenActivity/fxhb.png" />
|
|
|
+ <div class="money" data-index=${i} data-dataList=${JSON.stringify(dataList)}><span class="money-mark">¥</span><span class="money-val">${totalMoney}</span></div>
|
|
|
+ <div class="packet-titles" data-index=${i} data-dataList=${JSON.stringify(dataList)}>无门槛</div>
|
|
|
+ <div class="packet-times" data-index=${i} data-dataList=${JSON.stringify(dataList)}>${startTime.substring(5,11)}-${endTime.substring(5,11)}日有效</div>
|
|
|
<div class="share-btn">
|
|
|
<img class="share" data-obj=${
|
|
|
JSON.stringify({
|
|
@@ -444,16 +439,16 @@
|
|
|
//点击红包
|
|
|
$('.red-packet-next')[0].addEventListener('click',(e) => {
|
|
|
let index = e.target.dataset.index;
|
|
|
- console.log(index)
|
|
|
- if(['fxhb','packet-titles','money-val'].includes(e.target.className)){
|
|
|
- $('.user-list').eq(0).toggle();
|
|
|
- const flag = $('.user-list').eq(0).attr('flag');
|
|
|
- if(flag === '1'){
|
|
|
- $('.icon').eq(0).attr('src','../static/img/doubleElevenActivity/icon_up.png');
|
|
|
- $('.user-list').eq(0).attr('flag','2');
|
|
|
- }else{
|
|
|
- $('.icon').eq(0).attr('src','../static/img/doubleElevenActivity/icon_down.png');
|
|
|
- $('.user-list').eq(0).attr('flag','1');
|
|
|
+ let dataList = e.target.dataset.dataList;
|
|
|
+ if(['fxhb','packet-titles','money','packet-times'].includes(e.target.className)){
|
|
|
+ $('.user-list').eq(index).toggle();
|
|
|
+ const flag = $('.user-list').eq(index).attr('flag');
|
|
|
+ if(flag === '1' && dataList.length > 5){
|
|
|
+ $('.icon').eq(index).attr('src','../static/img/doubleElevenActivity/icon_up.png');
|
|
|
+ $('.user-list').eq(index).attr('flag','2');
|
|
|
+ }else if(dataList && dataList.length > 5){
|
|
|
+ $('.icon').eq(index).attr('src','../static/img/doubleElevenActivity/icon_down.png');
|
|
|
+ $('.user-list').eq(index).attr('flag','1');
|
|
|
}
|
|
|
}
|
|
|
})
|
|
@@ -490,12 +485,11 @@
|
|
|
if(!e.target.dataset.obj){
|
|
|
return
|
|
|
}
|
|
|
- // try{
|
|
|
- var obj = JSON.parse(e.target.dataset.obj);
|
|
|
- // }catch(error){
|
|
|
- // console.log(error)
|
|
|
- // }
|
|
|
+ var obj = JSON.parse(e.target.dataset.obj);
|
|
|
if(obj.shareCount === obj.quantity){
|
|
|
+ stopManyClick(() => {
|
|
|
+ toastr.error('没有剩余红包可以分享!');
|
|
|
+ })
|
|
|
return
|
|
|
}else{
|
|
|
$('.share-num-text').eq(0).text(`还有${obj.quantity - obj.shareCount}张优惠券可以分享`);
|