|
|
@@ -165,7 +165,7 @@
|
|
|
<script type="text/html" id="distribution">
|
|
|
<div class="distribution-item">
|
|
|
<div class="distribution-main-content">
|
|
|
- <img class="phone-logo" src="../static/img/awardActivity/home_list_icon_xingyao.jpg" />
|
|
|
+ <img class="phone-logo" src="{{icon}}" />
|
|
|
<div class="distribution-info">
|
|
|
<div class="distribution-name">{{diskName}}</div>
|
|
|
<div class="distribution-time">{{timeLeft}}</div>
|
|
|
@@ -181,7 +181,7 @@
|
|
|
<script type="text/html" id="record">
|
|
|
<div class="award-record-list-item">
|
|
|
<div class="award-record-list-content">{{diskName}}</div>
|
|
|
- <div class="award-record-list-content">{{exceptTime}}</div>
|
|
|
+ <div class="award-record-list-content">{{createTime}}</div>
|
|
|
<div class="award-record-list-content">{{validTime}}</div>
|
|
|
</div>
|
|
|
</script>
|
|
|
@@ -302,7 +302,6 @@
|
|
|
}
|
|
|
operate('mfhd_2022_h5_tab分配奖励');
|
|
|
$('.tab-bg1').eq(0).css('display', 'none');
|
|
|
- $('.tab-wrap').eq(0).css('height', '14.75rem');
|
|
|
$('.award-title')[0].className = 'award-title';
|
|
|
$('.award-title')[1].className = 'award-title active-title';
|
|
|
$('.distribution-list-wrap').eq(0).css('display', 'block');
|
|
|
@@ -460,7 +459,8 @@
|
|
|
return lotteryResult[key];
|
|
|
})
|
|
|
goodsList();
|
|
|
- tabHandle2();
|
|
|
+ pageNum = 1;
|
|
|
+ rewardList();
|
|
|
allotTimeCardList();
|
|
|
$('.main-contain').eq(0).append(result)
|
|
|
$('.times').eq(0).text(lotteryResult.lotteryCount)
|
|
|
@@ -470,7 +470,6 @@
|
|
|
if(!GetRequest().token){
|
|
|
return
|
|
|
}
|
|
|
- console.log(pageNum)
|
|
|
$.ajax({
|
|
|
url: baseUrl + '/api/activity/gratis/rewardList',
|
|
|
type: 'get',
|
|
|
@@ -627,6 +626,7 @@
|
|
|
// 分配云手机列表
|
|
|
function allotTimeCardList(type){
|
|
|
pageNum1 = 0;
|
|
|
+ recordFlag1 = false;
|
|
|
$('.distribution-container').eq(0).empty();
|
|
|
if(!GetRequest().token){
|
|
|
return
|
|
|
@@ -662,15 +662,25 @@
|
|
|
function pageCardList() {
|
|
|
let result = '';
|
|
|
recordFlag1 = true;
|
|
|
- let list = cardList.slice(pageNum1 * 5, (pageNum1 * 5) + 5)
|
|
|
+ let list = cardList.slice(pageNum1 * 5, (pageNum1 * 5) + 5);
|
|
|
+ let mealTypeObj = {
|
|
|
+ VIP: 'card1.png',
|
|
|
+ SVIP: 'card2.jpg',
|
|
|
+ STAR: 'card3.png',
|
|
|
+ STARPRO: 'card4.png'
|
|
|
+ }
|
|
|
list.map((item, index) => {
|
|
|
item.index = pageNum1 * 5 + index
|
|
|
+ item.icon = `../static/img/awardActivity/${mealTypeObj[item.buyVipType]}`
|
|
|
result += $('#distribution').text().replace(/{{(.*?)}}/g, function(node, key) {
|
|
|
return item[key];
|
|
|
})
|
|
|
})
|
|
|
$('.distribution-container').eq(0).append(result);
|
|
|
for (var i = 0; i < list.length; i++) {
|
|
|
+ console.log(pageNum1)
|
|
|
+ console.log(pageNum1 * 5 + i)
|
|
|
+ console.log($('.num-ipt')[pageNum1 * 5 + i])
|
|
|
$('.num-ipt')[pageNum1 * 5 + i].oninput = function (e) {
|
|
|
const id = e.target.dataset.id;
|
|
|
let oldDuration = 0;
|
|
|
@@ -741,7 +751,7 @@
|
|
|
let clientHeight = $('.distribution-container')[0].clientHeight;
|
|
|
let scrollHeight = $('.distribution-container')[0].scrollHeight;
|
|
|
if(scrollTop + clientHeight + 100 > scrollHeight){
|
|
|
- if(recordFlag1 && pageNum1 < cardList.length && cardList.length > 1){
|
|
|
+ if(recordFlag1 && pageNum1 < (cardList.length/5) && (cardList.length/5) > 1){
|
|
|
recordFlag1 = false;
|
|
|
pageNum1++;
|
|
|
pageCardList();
|
|
|
@@ -818,9 +828,6 @@
|
|
|
return
|
|
|
}
|
|
|
if(!lotteryFlag) {
|
|
|
- // stopManyClick(() =>{
|
|
|
- // toastr.error('抽奖进行中,请等待抽奖结束!');
|
|
|
- // })
|
|
|
return
|
|
|
}
|
|
|
if(type != 'bug') {
|
|
|
@@ -938,6 +945,9 @@
|
|
|
}
|
|
|
});
|
|
|
function distributionTime(e) {
|
|
|
+ if(!lotteryFlag) {
|
|
|
+ return
|
|
|
+ }
|
|
|
operate('mfhd_2022_h5_分配奖励');
|
|
|
distributionList = distributionList.filter(item => item.allotTime != 0);
|
|
|
console.log(distributionList)
|
|
|
@@ -988,6 +998,11 @@
|
|
|
})
|
|
|
distributionList = [];
|
|
|
cardList = [];
|
|
|
+ $('.tab-bg4').eq(0).css('display', 'none');
|
|
|
+ $('.tab-bg3').eq(0).css('display', 'none');
|
|
|
+ $('.tab-bg2').eq(0).css('display', 'block');
|
|
|
+ $('.award-record-list').eq(0).css('display', 'block');
|
|
|
+ $('.tab-wrap').eq(0).css('height', '14.75rem');
|
|
|
toastr.error('分配成功,请前往云机列表查看');
|
|
|
} else {
|
|
|
console.log(res.msg)
|