|
@@ -8,11 +8,12 @@
|
|
|
</div>
|
|
|
<!-- 邀请人 -->
|
|
|
<template v-else>
|
|
|
- <div class="invite" v-if="state.detail.inviteUserInfo">
|
|
|
+ <div class="invite"
|
|
|
+ v-if="state.detail.inviteUserInfo && state.detail.inviteUserInfo.nickName != state.detail.postUserInfo.nickName">
|
|
|
<img :src="state.detail.inviteUserInfo.avatarUrl" alt="" />
|
|
|
- <span>{{ state.detail.inviteUserInfo.nickName }}</span>
|
|
|
+ <span>{{ state.detail.inviteUserInfo.nickName }} invites you</span>
|
|
|
</div>
|
|
|
- <div class="in" v-else></div>
|
|
|
+ <div class="in-invite" v-else></div>
|
|
|
<div class="treasure">
|
|
|
<component-zoom width="335" fontSize="34" style="margin:0 auto;">
|
|
|
<span>Treasure</span>
|
|
@@ -26,12 +27,11 @@
|
|
|
<span>{{ toLast(state.detail.upGainAmountValue, 3) }}</span>
|
|
|
</component-zoom>
|
|
|
</div>
|
|
|
- <div class="coin">
|
|
|
+ <div class="coin" v-if="state.detail.currencySymbol != 'USD'">
|
|
|
<img :src="state.detail.currencyIconPath" alt="" />
|
|
|
- <span> {{ state.detail.currencySymbol }}
|
|
|
- <template v-if="state.detail.currencySymbol != 'USD'">equivalent (Crypto)</template>
|
|
|
- </span>
|
|
|
+ <span> {{ state.detail.currencySymbol }} </span>
|
|
|
</div>
|
|
|
+ <div class="coin" v-else></div>
|
|
|
</template>
|
|
|
|
|
|
<div class="box">
|
|
@@ -56,8 +56,8 @@ import { pageUrl } from "@/http/configAPI.js"
|
|
|
import Report from "@/log-center/log"
|
|
|
import { prepareStart, treasureStart } from '@/http/treasure.js'
|
|
|
import { getChromeCookie, removeChromeCookie } from '@/uilts/chromeExtension.js'
|
|
|
+import { reSetBindRepost } from '@/http/help.js'
|
|
|
let state = inject('state')
|
|
|
-state.btn_loading = false
|
|
|
|
|
|
state.log_show = {
|
|
|
pageSource: Report.pageSource.pending_page,
|
|
@@ -82,6 +82,33 @@ chrome.storage.onChanged.addListener(changes => {
|
|
|
}
|
|
|
})
|
|
|
|
|
|
+const toStart = (req) => {
|
|
|
+ treasureStart({
|
|
|
+ params: {
|
|
|
+ postId: state.postId || '',
|
|
|
+ inviteCode: state.invite_code || ''
|
|
|
+ }
|
|
|
+ }).then((res) => {
|
|
|
+ if (res.code == 0) {
|
|
|
+ state.page = '开奖页'
|
|
|
+ state.start_task = res.data
|
|
|
+ state.btn_loading = false
|
|
|
+ if (req.response) {
|
|
|
+ let repost_tweetId = req.response.data.data.create_tweet.tweet_results.result.rest_id
|
|
|
+ reSetBindRepost({
|
|
|
+ inviteCode: res.data.inviteCode,
|
|
|
+ tweetId: repost_tweetId
|
|
|
+ })
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ state.init()
|
|
|
+ }
|
|
|
+
|
|
|
+ }).catch((error) => {
|
|
|
+ console.error(error)
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
chrome.runtime.onMessage.addListener((req, sender, sendResponse) => {
|
|
|
switch (req.actionType) {
|
|
|
case 'DO_TASK':
|
|
@@ -96,23 +123,7 @@ chrome.runtime.onMessage.addListener((req, sender, sendResponse) => {
|
|
|
state.toast.show = false
|
|
|
}, 2000)
|
|
|
} else if (req.task_type == 'createTweet' && req.task_done) {
|
|
|
- treasureStart({
|
|
|
- params: {
|
|
|
- postId: state.postId || '',
|
|
|
- inviteCode: state.invite_code || ''
|
|
|
- }
|
|
|
- }).then((res) => {
|
|
|
- if (res.code == 0) {
|
|
|
- state.page = '开奖页'
|
|
|
- state.start_task = res.data
|
|
|
- state.btn_loading = false
|
|
|
- } else {
|
|
|
- state.init(() => {
|
|
|
- state.inviteInit()
|
|
|
- state.inviteList()
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
+ toStart(req)
|
|
|
}
|
|
|
break
|
|
|
}
|
|
@@ -181,10 +192,7 @@ const startBtn = () => {
|
|
|
});
|
|
|
})
|
|
|
} else {
|
|
|
- state.init(() => {
|
|
|
- state.inviteInit()
|
|
|
- state.inviteList()
|
|
|
- })
|
|
|
+ state.init()
|
|
|
}
|
|
|
})
|
|
|
}
|
|
@@ -230,6 +238,12 @@ const startBtn = () => {
|
|
|
height: 58px;
|
|
|
}
|
|
|
|
|
|
+ .in-invite {
|
|
|
+ height: 28px;
|
|
|
+ margin-top: 20px;
|
|
|
+ margin-bottom: 10px;
|
|
|
+ }
|
|
|
+
|
|
|
.invite {
|
|
|
background: rgba(255, 255, 255, 0.1);
|
|
|
height: 28px;
|
|
@@ -310,6 +324,7 @@ const startBtn = () => {
|
|
|
}
|
|
|
|
|
|
.coin {
|
|
|
+ height: 17px;
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
justify-content: center;
|