|
@@ -98,7 +98,7 @@
|
|
<div class="card-wrap award-result-wrap"></div>
|
|
<div class="card-wrap award-result-wrap"></div>
|
|
<div class="btn-row">
|
|
<div class="btn-row">
|
|
<img class="award-btn continue-lighten" src="../static/img/anniversaryCelebrate/continue-lighten.png" />
|
|
<img class="award-btn continue-lighten" src="../static/img/anniversaryCelebrate/continue-lighten.png" />
|
|
- <img class="award-btn distribution-award" src="../static/img/anniversaryCelebrate/distribution-award.png" />
|
|
|
|
|
|
+ <img class="award-btn distribution-award" src="../static/img/anniversaryCelebrate/sure-btn.png" />
|
|
</div>
|
|
</div>
|
|
<div class="times-text">还剩次数:<span class="times-text-number"></span>次</div>
|
|
<div class="times-text">还剩次数:<span class="times-text-number"></span>次</div>
|
|
</div>
|
|
</div>
|
|
@@ -183,10 +183,7 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="no-start-mask">
|
|
<div class="no-start-mask">
|
|
- <div class="no-start-dialog">
|
|
|
|
- <div>活动暂未开启</div>
|
|
|
|
- <div>请稍安勿躁</div>
|
|
|
|
- </div>
|
|
|
|
|
|
+ <div class="no-start-dialog"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script>
|
|
<script>
|
|
@@ -243,10 +240,18 @@
|
|
success: function (res) {
|
|
success: function (res) {
|
|
if(res.status === 0){
|
|
if(res.status === 0){
|
|
residueDegree = res.data.residueDegree;
|
|
residueDegree = res.data.residueDegree;
|
|
|
|
+ anniversarySwitch = res.data.anniversarySwitch;
|
|
result = res.data.lighten;
|
|
result = res.data.lighten;
|
|
lighten = result.split(','), str = '';
|
|
lighten = result.split(','), str = '';
|
|
$('.rest-number').eq(0).text(residueDegree);
|
|
$('.rest-number').eq(0).text(residueDegree);
|
|
$('.light-number').eq(0).text(res.data.allTotal);
|
|
$('.light-number').eq(0).text(res.data.allTotal);
|
|
|
|
+ if(anniversarySwitch !== 0){
|
|
|
|
+ let awardText = anniversarySwitch == 1 ? '<div>活动暂未开启</div>请稍安勿躁' : '<div>活动已结束</div>期待下次的见面'
|
|
|
|
+ $('.no-start-dialog').eq(0).append(awardText);
|
|
|
|
+ $('.no-start-dialog').animate({top: '50%'},"fast");
|
|
|
|
+ $('.no-start-mask').show();
|
|
|
|
+ document.documentElement.style.overflow='hidden';
|
|
|
|
+ }
|
|
if(result == ''){
|
|
if(result == ''){
|
|
return
|
|
return
|
|
}
|
|
}
|
|
@@ -273,6 +278,7 @@
|
|
//点击抽奖
|
|
//点击抽奖
|
|
$('.once-btn')[0].addEventListener('click',() => {
|
|
$('.once-btn')[0].addEventListener('click',() => {
|
|
if(!animationFlag) return;
|
|
if(!animationFlag) return;
|
|
|
|
+ $('.continue-lighten')[0].src = '../static/img/anniversaryCelebrate/continue-lighten.png';
|
|
if(lighten.length == 9){
|
|
if(lighten.length == 9){
|
|
$('.point-wrap').eq(0).empty();
|
|
$('.point-wrap').eq(0).empty();
|
|
$('.light-show').show();
|
|
$('.light-show').show();
|
|
@@ -286,6 +292,7 @@
|
|
},false);
|
|
},false);
|
|
$('.five-btn')[0].addEventListener('click',() => {
|
|
$('.five-btn')[0].addEventListener('click',() => {
|
|
if(!animationFlag) return;
|
|
if(!animationFlag) return;
|
|
|
|
+ $('.continue-lighten')[0].src = '../static/img/anniversaryCelebrate/five-click.png';
|
|
if(lighten.length + 5 >= 10){
|
|
if(lighten.length + 5 >= 10){
|
|
$('.point-wrap').eq(0).empty();
|
|
$('.point-wrap').eq(0).empty();
|
|
$('.light-show').show();
|
|
$('.light-show').show();
|
|
@@ -457,7 +464,7 @@
|
|
$('.get-award-text')[1].className = 'get-award-text';
|
|
$('.get-award-text')[1].className = 'get-award-text';
|
|
},false);
|
|
},false);
|
|
//获取抽奖记录
|
|
//获取抽奖记录
|
|
- function getAward(){
|
|
|
|
|
|
+ function getAward(type){
|
|
$.ajax({
|
|
$.ajax({
|
|
url: baseUrl + `/api/activity/v1/anniversary/rewardList?pageNum=${pageNum}&pageSize=10&receive=${receive}`,
|
|
url: baseUrl + `/api/activity/v1/anniversary/rewardList?pageNum=${pageNum}&pageSize=10&receive=${receive}`,
|
|
type: 'get',
|
|
type: 'get',
|
|
@@ -473,7 +480,9 @@
|
|
let str = '',
|
|
let str = '',
|
|
records = res.data.records;
|
|
records = res.data.records;
|
|
pages = res.data.pages;
|
|
pages = res.data.pages;
|
|
- $('.light-content-list').eq(0).empty();
|
|
|
|
|
|
+ if(type != 'down'){
|
|
|
|
+ $('.light-content-list').eq(0).empty();
|
|
|
|
+ }
|
|
if(records.length === 0){
|
|
if(records.length === 0){
|
|
$('.title-row').eq(0).css('display', 'none');
|
|
$('.title-row').eq(0).css('display', 'none');
|
|
if(receive == 1 && parseInt(notReceive) > 0){
|
|
if(receive == 1 && parseInt(notReceive) > 0){
|
|
@@ -488,7 +497,7 @@
|
|
str += `<div class="light-content-wrap">
|
|
str += `<div class="light-content-wrap">
|
|
<div class="light-content-text">获得星曜${records[i].awardDurations}天时长</div>
|
|
<div class="light-content-text">获得星曜${records[i].awardDurations}天时长</div>
|
|
<div class="light-content-time" >${records[i].createTime.substr(6)}</div>
|
|
<div class="light-content-time" >${records[i].createTime.substr(6)}</div>
|
|
- <div class="get-btn ${records[i].receive === 1 ? 'btn-active' : ''}" data-awardid=${records[i].id} data-awardName=${records[i].userName}>领取</div>
|
|
|
|
|
|
+ <div class="get-btn ${records[i].receive === 1 ? 'btn-active' : ''}" data-awardid=${records[i].id} data-day=${records[i].day}>领取</div>
|
|
</div>`
|
|
</div>`
|
|
}
|
|
}
|
|
$('.light-content-list').eq(0).append(str)
|
|
$('.light-content-list').eq(0).append(str)
|
|
@@ -503,20 +512,17 @@
|
|
}
|
|
}
|
|
//点击领取按钮
|
|
//点击领取按钮
|
|
$('.light-content-list')[0].addEventListener('click',(e) => {
|
|
$('.light-content-list')[0].addEventListener('click',(e) => {
|
|
- console.log(e)
|
|
|
|
if (e.target.className === 'get-btn ') {
|
|
if (e.target.className === 'get-btn ') {
|
|
let awardId = parseInt(e.target.dataset.awardid);
|
|
let awardId = parseInt(e.target.dataset.awardid);
|
|
- let awardName = e.target.dataset.awardname;
|
|
|
|
- console.log(awardId)
|
|
|
|
- console.log(awardName)
|
|
|
|
|
|
+ let day = parseInt(e.target.dataset.day);
|
|
if (isMiniprogram) { // 小程序
|
|
if (isMiniprogram) { // 小程序
|
|
wx.miniProgram.navigateTo({
|
|
wx.miniProgram.navigateTo({
|
|
- url: `/packageA/activityCloudPhone/index?id=${awardId.toString()}&awardName=${awardName}`
|
|
|
|
|
|
+ url: `/packageA/activityCloudPhone/index?id=${awardId.toString()}&day=${day}`
|
|
})
|
|
})
|
|
} else if (isAndroid) { // 安卓
|
|
} else if (isAndroid) { // 安卓
|
|
- window.native.activatePhone(2, awardId, awardName);
|
|
|
|
|
|
+ window.native.activatePhone(3, awardId, day);
|
|
} else if (isiOS) {
|
|
} else if (isiOS) {
|
|
- window.webkit.messageHandlers.activatePhone.postMessage({ type: 2, awardId: awardId, awardName: awardName });
|
|
|
|
|
|
+ window.webkit.messageHandlers.activatePhone.postMessage({ type: 3, awardId: awardId, day: day });
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},false);
|
|
},false);
|
|
@@ -546,7 +552,7 @@
|
|
},false);
|
|
},false);
|
|
//点击获取次数
|
|
//点击获取次数
|
|
$('.get-times')[0].addEventListener('click',() => {
|
|
$('.get-times')[0].addEventListener('click',() => {
|
|
- operate('sf_2022_h5_获取次数按钮');
|
|
|
|
|
|
+ operate('znq_2022_h5_获取次数按钮');
|
|
stopManyClick(() =>{
|
|
stopManyClick(() =>{
|
|
if (isMiniprogram) { // 小程序
|
|
if (isMiniprogram) { // 小程序
|
|
if(phoneRemainQuantity > 0){
|
|
if(phoneRemainQuantity > 0){
|
|
@@ -560,7 +566,7 @@
|
|
}
|
|
}
|
|
} else if (isAndroid) { // 安卓
|
|
} else if (isAndroid) { // 安卓
|
|
if(phoneRemainQuantity > 0){
|
|
if(phoneRemainQuantity > 0){
|
|
- window.native.startPurchase(1, 365);
|
|
|
|
|
|
+ window.native.startPurchase('SVIP', 365);
|
|
} else {
|
|
} else {
|
|
window.native.startRenew();
|
|
window.native.startRenew();
|
|
}
|
|
}
|
|
@@ -573,6 +579,19 @@
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},false);
|
|
},false);
|
|
|
|
+ //抽奖记录数据下拉加载
|
|
|
|
+ $('.light-content-list')[0].addEventListener('scroll',function () {
|
|
|
|
+ let scrollTop = $('.light-content-list')[0].scrollTop;
|
|
|
|
+ let clientHeight = $('.light-content-list')[0].clientHeight;
|
|
|
|
+ let scrollHeight = $('.light-content-list')[0].scrollHeight;
|
|
|
|
+ if(scrollTop + clientHeight + 100 > scrollHeight){
|
|
|
|
+ if(recordFlag && pageNum < pages && pages > 1){
|
|
|
|
+ recordFlag = false;
|
|
|
|
+ pageNum++;
|
|
|
|
+ getAward('down');
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
//获取云机数量
|
|
//获取云机数量
|
|
getPhoneNumber();
|
|
getPhoneNumber();
|
|
function getPhoneNumber(){
|
|
function getPhoneNumber(){
|