|
@@ -94,9 +94,12 @@
|
|
|
<div class="winner">
|
|
|
<p>Winners</p>
|
|
|
<div class="right">
|
|
|
- <template v-if="state.detail.allReceived" v-for="item, i in state.detail.allReceived.slice(0, 3)" v-bind:key="i">
|
|
|
- <img v-if="item.simpleUserInfoVO.avatarUrl" :src="item.simpleUserInfoVO.avatarUrl" alt :style="{ left: `${(i) * 16}px`, zIndex: `${10 - i}` }" />
|
|
|
- <img v-else :src="require('@/assets/svg/icon-twitter.svg')" alt :style="{ left: `${(i) * 16}px`, zIndex: `${10 - i}` }" />
|
|
|
+ <template v-if="state.detail.allReceived" v-for="item, i in state.detail.allReceived.slice(0, 3)"
|
|
|
+ v-bind:key="i">
|
|
|
+ <img v-if="item.simpleUserInfoVO.avatarUrl" :src="item.simpleUserInfoVO.avatarUrl" alt
|
|
|
+ :style="{ left: `${(i) * 16}px`, zIndex: `${10 - i}` }" />
|
|
|
+ <img v-else :src="require('@/assets/svg/icon-twitter.svg')" alt
|
|
|
+ :style="{ left: `${(i) * 16}px`, zIndex: `${10 - i}` }" />
|
|
|
</template>
|
|
|
<img v-if="state.detail.allReceived > 3" :src="require('@/assets/svg/icon-winner-more.svg')" alt
|
|
|
:style="{ left: `${3 * 16}px`, zIndex: `${10 - 3}` }" />
|
|
@@ -129,7 +132,8 @@
|
|
|
</div>
|
|
|
<div class="luck-list max" @scroll="handleScroll($event)">
|
|
|
<div class="luck-item" v-for="item, i in state.detail.allReceived" v-bind:key="i">
|
|
|
- <img v-if="item.simpleUserInfoVO.avatarUrl" :src="item.simpleUserInfoVO.avatarUrl" @click="openTwitterDetail(item)" alt />
|
|
|
+ <img v-if="item.simpleUserInfoVO.avatarUrl" :src="item.simpleUserInfoVO.avatarUrl"
|
|
|
+ @click="openTwitterDetail(item)" alt />
|
|
|
<img v-else :src="require('@/assets/svg/icon-twitter.svg')" alt />
|
|
|
<div class="luck-content">
|
|
|
<div class="luck-title" v-if="item.simpleUserInfoVO.nickName">{{ item.simpleUserInfoVO.nickName }}</div>
|
|
@@ -175,7 +179,7 @@
|
|
|
<!-- 领取列表 -->
|
|
|
<div v-else-if="state.status == 'luck-peopel-list'" class="luck-peopel-list">
|
|
|
<div class="head">
|
|
|
- <img :src="require('@/assets/svg/icon-back.svg')" alt />
|
|
|
+ <img :src="require('@/assets/svg/icon-back.svg')" alt />
|
|
|
</div>
|
|
|
<div class="luck-list-title">
|
|
|
<div>{{ state.detail.receiveCount || 0 }}/{{ state.detail.totalCount || 0 }} Winners</div>
|
|
@@ -185,7 +189,8 @@
|
|
|
</div>
|
|
|
<div class="luck-list" @scroll="handleScroll">
|
|
|
<div class="luck-item" v-for="item, i in state.detail.allReceived" v-bind:key="i">
|
|
|
- <img v-if="item.simpleUserInfoVO.avatarUrl" :src="item.simpleUserInfoVO.avatarUrl" alt @click="openTwitterDetail(item)" />
|
|
|
+ <img v-if="item.simpleUserInfoVO.avatarUrl" :src="item.simpleUserInfoVO.avatarUrl" alt
|
|
|
+ @click="openTwitterDetail(item)" />
|
|
|
<img v-else :src="require('@/assets/svg/icon-twitter.svg')" alt />
|
|
|
<div class="luck-content">
|
|
|
<div class="luck-title" v-if="item.simpleUserInfoVO.nickName">{{ item.simpleUserInfoVO.nickName }}</div>
|
|
@@ -230,8 +235,9 @@
|
|
|
</div>
|
|
|
|
|
|
<div class="luck-list max" @scroll="handleScroll">
|
|
|
- <div class="luck-item" v-for="item, i in state.detail.allReceived" v-bind:key="i" >
|
|
|
- <img v-if="item.simpleUserInfoVO.avatarUrl" :src="item.simpleUserInfoVO.avatarUrl" alt @click="openTwitterDetail(item)"/>
|
|
|
+ <div class="luck-item" v-for="item, i in state.detail.allReceived" v-bind:key="i">
|
|
|
+ <img v-if="item.simpleUserInfoVO.avatarUrl" :src="item.simpleUserInfoVO.avatarUrl" alt
|
|
|
+ @click="openTwitterDetail(item)" />
|
|
|
<img v-else :src="require('@/assets/svg/icon-twitter.svg')" alt />
|
|
|
<div class="luck-content">
|
|
|
<div class="luck-title" v-if="item.simpleUserInfoVO.nickName">{{ item.simpleUserInfoVO.nickName }}</div>
|
|
@@ -392,8 +398,8 @@ function handleReceivedList() {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
-const openTwitterDetail = (item)=>{
|
|
|
- if(item.simpleUserInfoVO.nickName){
|
|
|
+const openTwitterDetail = (item) => {
|
|
|
+ if (item.simpleUserInfoVO.nickName) {
|
|
|
window.open(`https://twitter.com/${item.simpleUserInfoVO.nickName}`)
|
|
|
}
|
|
|
}
|
|
@@ -537,10 +543,13 @@ function showLastTwoPlace(n) {
|
|
|
return n
|
|
|
}
|
|
|
|
|
|
-const showCloseEndTimePage = () => {
|
|
|
+const showCloseEndTimePage = ()=>{
|
|
|
state.status = 'close'
|
|
|
state.close_status = '红包过期了'
|
|
|
state.close_text = [`This Giveaways`, `expired on ${moment(state.detail.endTimestamp).format('MM-DD')}`]
|
|
|
+}
|
|
|
+
|
|
|
+const showCloseEndTimePageReport = () => {
|
|
|
// 埋点
|
|
|
Report.reportLog({
|
|
|
pageSource: Report.pageSource.expired_page,
|
|
@@ -580,6 +589,14 @@ const showOpenedPage = () => {
|
|
|
const showRabbitPage = () => {
|
|
|
state.status = 'close'
|
|
|
state.close_status = '没有领到钱'
|
|
|
+
|
|
|
+
|
|
|
+}
|
|
|
+const showRabbitPageReport = ()=> {
|
|
|
+ Report.reportLog({
|
|
|
+ pageSource: Report.pageSource.received_empty_rewards_page,
|
|
|
+ businessType: Report.businessType.pageView,
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
const handleStatusPage = () => {
|
|
@@ -630,15 +647,16 @@ const handleStatusPage = () => {
|
|
|
// 领取到空红包
|
|
|
if (state.receiveAmount == 0) {
|
|
|
showRabbitPage()
|
|
|
+ showRabbitPageReport()
|
|
|
} else {
|
|
|
// 显示成功页面
|
|
|
showSuccessPage()
|
|
|
}
|
|
|
-
|
|
|
// 如果 任务完成状态 = 已经过期
|
|
|
} else {
|
|
|
// 显示已经过期页面
|
|
|
showCloseEndTimePage()
|
|
|
+ showCloseEndTimePageReport()
|
|
|
}
|
|
|
// 如果 我没有领取过
|
|
|
} else {
|
|
@@ -648,6 +666,7 @@ const handleStatusPage = () => {
|
|
|
if (state.detail.receiveTimeExpired) {
|
|
|
// 显示过期页面
|
|
|
showCloseEndTimePage()
|
|
|
+ showCloseEndTimePageReport()
|
|
|
// 如果 过了红包的领取截止时间 = false
|
|
|
} else {
|
|
|
// 显示未打开页面
|
|
@@ -657,6 +676,7 @@ const handleStatusPage = () => {
|
|
|
} else {
|
|
|
// 显示过期页面
|
|
|
showCloseEndTimePage()
|
|
|
+ showCloseEndTimePageReport()
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -684,67 +704,8 @@ function init() {
|
|
|
}
|
|
|
state.detail = JSON.parse(res.data.postBizData)
|
|
|
console.log(state.detail)
|
|
|
-
|
|
|
- handleStatusPage()
|
|
|
|
|
|
- // // 红包未开始
|
|
|
- // if (state.detail.status == 0) {
|
|
|
- // state.status = 'not-open'
|
|
|
- // Report.reportLog({
|
|
|
- // pageSource: Report.pageSource.pending_page,
|
|
|
- // businessType: Report.businessType.pageView
|
|
|
- // });
|
|
|
- // return
|
|
|
- // // 任务进行中
|
|
|
- // } else if (state.detail.status == 1) {
|
|
|
- // // 我领取过的状态
|
|
|
- // if (state.detail.myReceived) {
|
|
|
- // myReceivedState()
|
|
|
- // } else {
|
|
|
- // // 任务已经被领完了
|
|
|
- // if (state.detail.totalCount == state.detail.receiveCount) {
|
|
|
- // state.status = 'close'
|
|
|
- // state.close_status = '红包过期了'
|
|
|
- // state.close_text = ['All the rewards have', 'been taken out, come', 'earlier next time! ']
|
|
|
- // // 埋点
|
|
|
- // Report.reportLog({
|
|
|
- // pageSource: Report.pageSource.been_claimed_page,
|
|
|
- // businessType: Report.businessType.pageView,
|
|
|
- // });
|
|
|
- // } else if (state.detail.receiveTimeExpired) {
|
|
|
- // // 大红包不可以领取了
|
|
|
- // state.status = 'close'
|
|
|
- // state.close_status = '红包过期了'
|
|
|
- // state.close_text = [`This Giveaways`, `expired on ${moment(state.detail.endTimestamp).format('MM-DD')}`]
|
|
|
- // // 埋点
|
|
|
- // Report.reportLog({
|
|
|
- // pageSource: Report.pageSource.expired_page,
|
|
|
- // businessType: Report.businessType.pageView,
|
|
|
- // });
|
|
|
- // } else {
|
|
|
- // state.status = 'not-open'
|
|
|
- // Report.reportLog({
|
|
|
- // pageSource: Report.pageSource.pending_page,
|
|
|
- // businessType: Report.businessType.pageView
|
|
|
- // });
|
|
|
- // }
|
|
|
- // }
|
|
|
-
|
|
|
- // // 任务已经结束了
|
|
|
- // } else if (state.detail.status == 2 || state.detail.status == 3 || state.detail.status == 4) {
|
|
|
- // // 我领取过的状态
|
|
|
- // if (state.detail.myReceived) {
|
|
|
- // myReceivedState()
|
|
|
- // } else {
|
|
|
- // state.status = 'close'
|
|
|
- // state.close_status = '红包过期了'
|
|
|
- // state.close_text = [`This Giveaways`, `expired on ${moment(state.detail.endTimestamp).format('MM-DD')}`]
|
|
|
- // Report.reportLog({
|
|
|
- // pageSource: Report.pageSource.expired_page,
|
|
|
- // businessType: Report.businessType.pageView,
|
|
|
- // });
|
|
|
- // }
|
|
|
- // }
|
|
|
+ handleStatusPage()
|
|
|
} else {
|
|
|
handleErrorCode(res)
|
|
|
}
|
|
@@ -806,7 +767,10 @@ function handleRedPacket() {
|
|
|
}
|
|
|
}).then((res) => {
|
|
|
if (res.code == 0) {
|
|
|
- showOpenedPage()
|
|
|
+ state.status = 'opened'
|
|
|
+ state.detail.taskCondition = JSON.parse(state.detail.taskCondition)
|
|
|
+ initTaskDetail()
|
|
|
+ init()
|
|
|
} else {
|
|
|
handleErrorCode(res)
|
|
|
}
|
|
@@ -869,11 +833,12 @@ function handleFinishRedPacket() {
|
|
|
if (res.code == 0) {
|
|
|
if (res.data.finished) {
|
|
|
state.receiveAmount = res.data.receiveAmount
|
|
|
- if(state.receiveAmount == 0){
|
|
|
+ if (state.receiveAmount == 0) {
|
|
|
showRabbitPage()
|
|
|
- }else{
|
|
|
- showSuccessPage()
|
|
|
+ } else {
|
|
|
+ state.status = 'success'
|
|
|
}
|
|
|
+ init()
|
|
|
// 埋点
|
|
|
Report.reportLog({
|
|
|
pageSource: Report.pageSource.task_page,
|
|
@@ -997,12 +962,16 @@ function handleErrorCode(res) {
|
|
|
break
|
|
|
// 红包金额已经被领取完了
|
|
|
case '2007':
|
|
|
- showCloseEndTimePage()
|
|
|
+ state.status = 'close'
|
|
|
+ state.close_status = '红包过期了'
|
|
|
+ state.close_text = [`This Giveaways`, `expired on ${moment(state.detail.endTimestamp).format('MM-DD')}`]
|
|
|
init()
|
|
|
break
|
|
|
// 红包个数已经被领取完了
|
|
|
case '2008':
|
|
|
- showCloseEndTimePage()
|
|
|
+ state.status = 'close'
|
|
|
+ state.close_status = '红包过期了'
|
|
|
+ state.close_text = [`This Giveaways`, `expired on ${moment(state.detail.endTimestamp).format('MM-DD')}`]
|
|
|
init()
|
|
|
break
|
|
|
// 该用户不满足领取条件
|
|
@@ -1054,7 +1023,10 @@ function handleErrorCode(res) {
|
|
|
break
|
|
|
// 不是红包任务的推文
|
|
|
case '2030':
|
|
|
-
|
|
|
+ break
|
|
|
+ case '2037':
|
|
|
+ showCloseEndTimePage()
|
|
|
+ init()
|
|
|
break
|
|
|
//用户没有领取过红包,无法重抽
|
|
|
case '2031':
|
|
@@ -1063,6 +1035,8 @@ function handleErrorCode(res) {
|
|
|
case '1010':
|
|
|
discordAuth('reAuth');
|
|
|
break
|
|
|
+ default:
|
|
|
+ init()
|
|
|
}
|
|
|
}
|
|
|
|