|
@@ -184,7 +184,7 @@
|
|
|
success: function (res) {
|
|
|
if(res.status === 0){
|
|
|
$('.card-wrap').eq(0).text('');
|
|
|
- let time = `${res.data.startTime.substr(0,4)}年${res.data.startTime.substring(5,7)}月${res.data.startTime.substring(8,10)}日-${res.data.endTime.substring(5,7)}月${res.data.endTime.substring(8,10)}日`;
|
|
|
+ let time = `活动时间 :${res.data.startTime.substr(0,4)}年${res.data.startTime.substring(5,7)}月${res.data.startTime.substring(8,10)}日-${res.data.endTime.substring(5,7)}月${res.data.endTime.substring(8,10)}日`;
|
|
|
$('.activity-time').eq(0).text(time);
|
|
|
let str = '',
|
|
|
cardData = [{name: '天',imgName: 'day'},{name: '周',imgName: 'week'},{name: '月',imgName: 'mouth'},
|
|
@@ -213,7 +213,7 @@
|
|
|
}
|
|
|
if(notReceive > 0){
|
|
|
receive = 0;
|
|
|
- notReceive = notReceive > 99 ? 99 : notReceive;
|
|
|
+ notReceive = notReceive > 99 ? '99+' : notReceive;
|
|
|
$('.tab-wrap').eq(0).css('display', 'flex');
|
|
|
$('.record-wrap').eq(0).css('marginTop', '0.2rem');
|
|
|
$('.record-wrap').eq(0).css('height', '5.38rem');
|
|
@@ -282,6 +282,9 @@
|
|
|
},false);
|
|
|
//点击领取按钮
|
|
|
$('.tab-wrap')[0].addEventListener('click',(e) => {
|
|
|
+ if(e.target.className === 'tab-wrap'){
|
|
|
+ return
|
|
|
+ }
|
|
|
receive = e.target.dataset.index;
|
|
|
if(receive == 1){
|
|
|
$('.award-change-btn')[0].className = 'award-change-btn'
|
|
@@ -322,13 +325,13 @@
|
|
|
handleAward(5)
|
|
|
}
|
|
|
},false);
|
|
|
- //点击再抽 获取次数
|
|
|
+ //点击再抽
|
|
|
$('.left-btn')[0].addEventListener('click',() => {
|
|
|
let val = $('.report-times').eq(0).text();
|
|
|
handleAward(val,'report')
|
|
|
},false);
|
|
|
function handleAward(times,type) {
|
|
|
- if(surplus === 0 || (times === 5 && surplus < 5)){
|
|
|
+ if(surplus === 0 || (times == 5 && surplus < 5)){
|
|
|
$('.have-times-wrap').eq(0).css('display', 'none');
|
|
|
$('.no-times-wrap').eq(0).css('display', 'block');
|
|
|
$('.award-result-dialog').animate({top: '1.86rem'},"fast");
|
|
@@ -368,14 +371,12 @@
|
|
|
},
|
|
|
list = res.data.list;
|
|
|
if(list.length === 1){
|
|
|
- $('.report-times').eq(0).text(1);
|
|
|
$('.award-result-wrap')[0].className = 'card-wrap award-result-wrap one-result';
|
|
|
str = `<div class="card-item">
|
|
|
<img class="one-card" src="../static/img/springFestivalActivity/${cardObj[list[0].duration]}.png" />
|
|
|
<div class="card-text">星曜${list[0].duration}卡</div>
|
|
|
</div> `
|
|
|
}else{
|
|
|
- $('.report-times').eq(0).text(5);
|
|
|
$('.award-result-wrap')[0].className = 'card-wrap award-result-wrap'
|
|
|
for (var i = 0; i < list.length; i++) {
|
|
|
str += `<div class="card-item">
|
|
@@ -384,6 +385,7 @@
|
|
|
</div>`
|
|
|
}
|
|
|
}
|
|
|
+ $('.report-times').eq(0).text(times);
|
|
|
if(notReceive > 0){
|
|
|
$('.join-result-tip').eq(0).css('opacity', '0');
|
|
|
}
|
|
@@ -488,37 +490,42 @@
|
|
|
},false);
|
|
|
//点击获取次数
|
|
|
$('.get-times')[0].addEventListener('click',() => {
|
|
|
- if(activityState === 2){
|
|
|
+ if(activityState === 1){
|
|
|
+ stopManyClick(() =>{
|
|
|
+ if (isMiniprogram) { // 小程序
|
|
|
+ if(phoneRemainQuantity > 0){
|
|
|
+ wx.miniProgram.navigateTo({
|
|
|
+ url: '/packageA/order/buy/index?type=activity'
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ wx.miniProgram.navigateTo({
|
|
|
+ url: '/packageA/order/renew/index?type=activity'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ } else if (isAndroid) { // 安卓
|
|
|
+ if(phoneRemainQuantity > 0){
|
|
|
+ window.native.startPurchase(1, 365);
|
|
|
+ } else {
|
|
|
+ window.native.startRenew();
|
|
|
+ }
|
|
|
+ } else if (isiOS) {
|
|
|
+ if(phoneRemainQuantity > 0){
|
|
|
+ window.webkit.messageHandlers.startPurchase.postMessage({ type: 1, day: 365 });
|
|
|
+ } else {
|
|
|
+ window.webkit.messageHandlers.startRenew.postMessage({ type: 1, day: 365 });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }else if(activityState === 0) {
|
|
|
+ stopManyClick(() =>{
|
|
|
+ toastr.error('该活动暂未开启,请稍安勿躁');
|
|
|
+ })
|
|
|
+ } else {
|
|
|
stopManyClick(() =>{
|
|
|
toastr.error('活动已结束,期待下次的见面');
|
|
|
})
|
|
|
- return
|
|
|
}
|
|
|
- stopManyClick(() =>{
|
|
|
- if (isMiniprogram) { // 小程序
|
|
|
- if(phoneRemainQuantity > 0){
|
|
|
- wx.miniProgram.navigateTo({
|
|
|
- url: '/packageA/order/buy/index?type=activity'
|
|
|
- })
|
|
|
- } else {
|
|
|
- wx.miniProgram.navigateTo({
|
|
|
- url: '/packageA/order/renew/index?type=activity'
|
|
|
- })
|
|
|
- }
|
|
|
- } else if (isAndroid) { // 安卓
|
|
|
- if(phoneRemainQuantity > 0){
|
|
|
- window.native.startPurchase(1, 365);
|
|
|
- } else {
|
|
|
- window.native.startRenew();
|
|
|
- }
|
|
|
- } else if (isiOS) {
|
|
|
- if(phoneRemainQuantity > 0){
|
|
|
- window.webkit.messageHandlers.startPurchase.postMessage({ type: 1, day: 365 });
|
|
|
- } else {
|
|
|
- window.webkit.messageHandlers.startRenew.postMessage({ type: 1, day: 365 });
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
+
|
|
|
},false);
|
|
|
// 点击查看
|
|
|
$('.look-btn')[0].addEventListener('click',() => {
|
|
@@ -547,6 +554,8 @@
|
|
|
$('.dialog').animate({top: '2.24rem'},"fast");
|
|
|
$('.award-record-mask').show();
|
|
|
document.documentElement.style.overflow='hidden';
|
|
|
+ $('.award-change-btn')[1].className = 'award-change-btn'
|
|
|
+ $('.award-change-btn')[0].className = 'award-change-btn active'
|
|
|
receive = 0;
|
|
|
pageNum = 1;
|
|
|
pages = 0;
|
|
@@ -593,7 +602,10 @@
|
|
|
records = res.data.records;
|
|
|
pages = res.data.pages;
|
|
|
if(records.length === 0){
|
|
|
+ $('.title-row').eq(0).css('display', 'none');
|
|
|
str = '<div class="no-award">没有抽奖记录,我都替你着急</div>'
|
|
|
+ }else{
|
|
|
+ $('.title-row').eq(0).css('display', 'flex');
|
|
|
}
|
|
|
for (var i = 0; i < records.length; i++) {
|
|
|
str += `<div class="data-row">
|