|
@@ -70,6 +70,8 @@
|
|
|
<div class="btn" @click="clickGetGiveways">Get Giveaways</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+
|
|
|
+
|
|
|
<!-- success -->
|
|
|
<div v-else-if="data.status == 'success'" class="success">
|
|
|
<div class="header" :style="{ 'backgroundImage': `url(${require('../assets/svg/back-head-top.svg')})` }">
|
|
@@ -102,19 +104,23 @@
|
|
|
<img :src="require('../assets/svg/icon-dollar.svg')" alt />
|
|
|
<div class="luck-money-txt">{{ showLastTwoPlace(item.amountValue) || 0 }}</div>
|
|
|
</div>
|
|
|
- <div class="luck-king" v-if="item.isMaxAmount">
|
|
|
+ <div class="luck-king" v-if="item.maxAmount">
|
|
|
<img :src="require('../assets/svg/icon-king-hat.svg')" alt />
|
|
|
<span>Luckiest Draw</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+
|
|
|
+
|
|
|
<!-- no-open -->
|
|
|
<div v-else-if="data.status == 'not-open'" class="not-open">
|
|
|
<img :src="require('../assets/img/up.png')" alt class="up" />
|
|
|
<img :src="require('../assets/img/down.png')" alt class="down" />
|
|
|
<div class="open" @click="clickOpenRedPacket">OPEN</div>
|
|
|
</div>
|
|
|
+
|
|
|
+
|
|
|
<!-- 领取列表 -->
|
|
|
<div v-else-if="data.status == 'luck-peopel-list'" class="luck-peopel-list">
|
|
|
<div class="head">
|
|
@@ -138,7 +144,7 @@
|
|
|
<div class="luck-money-txt">{{ showLastTwoPlace(item.amountValue) }}</div>
|
|
|
</div>
|
|
|
|
|
|
- <div class="luck-king" v-if="item.isMaxAmount">
|
|
|
+ <div class="luck-king" v-if="item.maxAmount">
|
|
|
<img :src="require('../assets/svg/icon-king-hat.svg')" alt />
|
|
|
<span>Luckiest Draw</span>
|
|
|
</div>
|
|
@@ -168,7 +174,7 @@
|
|
|
<img :src="require('../assets/svg/icon-dollar.svg')" alt />
|
|
|
<div class="luck-money-txt">{{ showLastTwoPlace(item.amountValue) || 0 }}</div>
|
|
|
</div>
|
|
|
- <div class="luck-king" v-if="item.isMaxAmount">
|
|
|
+ <div class="luck-king" v-if="item.maxAmount">
|
|
|
<img :src="require('../assets/svg/icon-king-hat.svg')" alt />
|
|
|
<span>Luckiest Draw</span>
|
|
|
</div>
|
|
@@ -176,6 +182,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
+
|
|
|
<!-- error -->
|
|
|
<div v-else-if="data.status == 'error'" class="error">
|
|
|
<img :src="require('../assets/svg/icon-error.svg')" alt />
|
|
@@ -183,6 +190,8 @@
|
|
|
{{ data.error_txt }}
|
|
|
</div>
|
|
|
</div>
|
|
|
+
|
|
|
+
|
|
|
<!-- loading -->
|
|
|
<div v-show="data.loading_show" class="loading">
|
|
|
<img :src="require('../assets/svg/icon-loading.svg')" alt />
|
|
@@ -245,7 +254,7 @@ async function clickLickBtn() {
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
-function clickDone(){
|
|
|
+function clickDone() {
|
|
|
window.open(`${chrome.runtime.getURL('/iframe/home.html')}`)
|
|
|
}
|
|
|
function handleScroll(e) {
|
|
@@ -307,7 +316,7 @@ async function clickRetweetBtn() {
|
|
|
|
|
|
function getValidity() {
|
|
|
let _d1, _d2, _d3, _h, _m, _s
|
|
|
- if(!data.detail.myReceived.taskEndTimestamp){
|
|
|
+ if (!data.detail.myReceived.taskEndTimestamp) {
|
|
|
return
|
|
|
}
|
|
|
let timer = setInterval(() => {
|
|
@@ -367,19 +376,6 @@ async function clickFollowAll(item) {
|
|
|
|
|
|
function showLastTwoPlace(n) {
|
|
|
return n / 100
|
|
|
- // n = n / 100
|
|
|
- // let _s = n
|
|
|
- // // 如果是整数
|
|
|
- // if (Math.floor(n) === n) {
|
|
|
- // _s = n + '.00'
|
|
|
- // return _s
|
|
|
- // }
|
|
|
- // // 如果小数只有一位
|
|
|
- // if (_s.split('.')[1].length > 2) {
|
|
|
- // _s = _s + '0'
|
|
|
- // return _s
|
|
|
- // }
|
|
|
- // return _s
|
|
|
}
|
|
|
|
|
|
function init() {
|
|
@@ -396,23 +392,20 @@ function init() {
|
|
|
// data.status = 'error'
|
|
|
// return
|
|
|
// }
|
|
|
+
|
|
|
data.detail = JSON.parse(res.data.postBizData)
|
|
|
+ console.log(data.detail)
|
|
|
+
|
|
|
// 未开始
|
|
|
if (data.detail.status == 0) {
|
|
|
data.status = 'not-open'
|
|
|
- }
|
|
|
|
|
|
- // 进行中
|
|
|
- if (data.detail.status == 1) {
|
|
|
-
|
|
|
- if(data.detail.totalCount == data.detail.finishCount){
|
|
|
- data.status = 'close'
|
|
|
- data.close_title = 'Better luck next time!'
|
|
|
- return
|
|
|
- }
|
|
|
- data.status = 'opened'
|
|
|
+ // 进行中
|
|
|
+ } else if (data.detail.status == 1) {
|
|
|
+
|
|
|
if (data.detail.myReceived) {
|
|
|
data.status = 'opened'
|
|
|
+ data.money = data.detail.myReceived.amountValue
|
|
|
if (data.detail.myReceived.taskFinishStatus == 1) {
|
|
|
data.status = 'success'
|
|
|
}
|
|
@@ -420,33 +413,28 @@ function init() {
|
|
|
data.status = 'close'
|
|
|
data.close_title = res.msg
|
|
|
}
|
|
|
+ initTaskDetail()
|
|
|
+ getValidity()
|
|
|
+ } else if (data.detail.totalCount == data.detail.receiveCount) {
|
|
|
+ data.status = 'close'
|
|
|
+ data.close_title = 'Better luck next time!'
|
|
|
} else {
|
|
|
- if (data.detail.myReceived) {
|
|
|
- data.status = 'opened'
|
|
|
- } else {
|
|
|
- data.status = 'not-open'
|
|
|
- }
|
|
|
+ data.status = 'not-open'
|
|
|
}
|
|
|
data.detail.taskCondition = JSON.parse(data.detail.taskCondition)
|
|
|
data.detail.amountValue = showLastTwoPlace(data.detail.amountValue)
|
|
|
data.detail.receiveAmountValue = showLastTwoPlace(data.detail.receiveAmountValue)
|
|
|
- if (data.detail.myReceived) {
|
|
|
- data.money = data.detail.myReceived.amountValue
|
|
|
- getValidity()
|
|
|
- }
|
|
|
- console.log(data.detail)
|
|
|
- initTaskDetail()
|
|
|
- }
|
|
|
- // 已结束
|
|
|
- if (data.detail.status == 2) {
|
|
|
+
|
|
|
+ // 已结束
|
|
|
+ } else if (data.detail.status == 2) {
|
|
|
data.status = 'close'
|
|
|
}
|
|
|
break
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
-function initTaskDetail(){
|
|
|
- // 任务详情
|
|
|
+function initTaskDetail() {
|
|
|
+ // 任务详情
|
|
|
getTaskDetail({
|
|
|
params: {
|
|
|
postId: data.postId
|
|
@@ -978,6 +966,7 @@ body {
|
|
|
.item-content {
|
|
|
width: 100%;
|
|
|
flex: 1;
|
|
|
+
|
|
|
.item-follow-title {
|
|
|
display: flex;
|
|
|
align-items: center;
|