|
@@ -11,7 +11,7 @@ import VCover from '@/view/iframe/treasure-hunt/cover.vue'
|
|
|
import VInvite from '@/view/iframe/treasure-hunt/invite.vue'
|
|
|
import VResult from '@/view/iframe/treasure-hunt/result.vue'
|
|
|
import { inviteDetail, treasureDetail, treasureOpen } from '@/http/treasure.js'
|
|
|
-import { reSetBindTwtterId, reSetBindRepost } from '@/http/help.js'
|
|
|
+import { reSetBindTwtterId, reSetBindPostContent, reSetBindRepost } from '@/http/help.js'
|
|
|
import { getQueryString } from '@/uilts/help'
|
|
|
import { getChromeStorage, sendChromeTabMessage } from '@/uilts/chromeExtension.js'
|
|
|
import VToast from '@/view/iframe/treasure-hunt/components/toast.vue'
|
|
@@ -77,7 +77,6 @@ state.init = (callback) => {
|
|
|
}
|
|
|
}).then((res) => {
|
|
|
if (res.code == 0) {
|
|
|
-
|
|
|
handleCommon(res, callback)
|
|
|
// 绑定repostSrcContentId
|
|
|
if (!res.data.repostSrcContentId) {
|
|
@@ -98,6 +97,15 @@ state.init = (callback) => {
|
|
|
}).then((res) => {
|
|
|
if (res.code == 0) {
|
|
|
handleCommon(res, callback)
|
|
|
+ // 原始链接绑定post content
|
|
|
+ if (!res.data.postSrcContent) {
|
|
|
+ sendChromeTabMessage({
|
|
|
+ actionType: "GET_CONTENT_BY_TWITTER_ID",
|
|
|
+ data: {
|
|
|
+ tweet_Id: state.tweetId
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
})
|
|
|
}
|
|
@@ -111,7 +119,7 @@ const reportOpenBoxLog = () => {
|
|
|
redPacketType: Report.redPacketType.treasure,
|
|
|
shareLinkId: state.invite_code,
|
|
|
myShareLinkId: state.detail.inviteCopyUrl,
|
|
|
- currentInvitedNum: state.detail.inviteCount,
|
|
|
+ currentInvitedNum: state.inviteCount,
|
|
|
postId: state.postId
|
|
|
});
|
|
|
state.open_box.showed = false
|
|
@@ -124,7 +132,7 @@ const reportOpenBoxLog = () => {
|
|
|
redPacketType: Report.redPacketType.treasure,
|
|
|
shareLinkId: state.invite_code,
|
|
|
myShareLinkId: state.detail.inviteCopyUrl,
|
|
|
- currentInvitedNum: state.detail.inviteCount,
|
|
|
+ currentInvitedNum: state.inviteCount,
|
|
|
postId: state.postId
|
|
|
});
|
|
|
state.open_box.clicked = false
|
|
@@ -191,7 +199,7 @@ state.treasureOpen = () => {
|
|
|
|
|
|
state.init(() => {
|
|
|
state.inviteInit()
|
|
|
- state.inviteList()
|
|
|
+ state.inviteListRefresh()
|
|
|
})
|
|
|
} else {
|
|
|
switch (String(res.code)) {
|
|
@@ -218,7 +226,7 @@ state.treasureOpen = () => {
|
|
|
|
|
|
state.init(() => {
|
|
|
state.inviteInit()
|
|
|
- state.inviteList()
|
|
|
+ state.inviteListRefresh()
|
|
|
})
|
|
|
}
|
|
|
}).catch(() => {
|
|
@@ -238,12 +246,11 @@ const handleStatus = (callback) => {
|
|
|
// 显示结束页面
|
|
|
|
|
|
let { status, joinStatus } = state.detail || {}
|
|
|
- state.open_btn.txt = 'Start'
|
|
|
// 如果 夺宝状态 = 未开始
|
|
|
if (status == 0) {
|
|
|
- state.page = '封面页'
|
|
|
-
|
|
|
+ // 未做处理
|
|
|
}
|
|
|
+
|
|
|
// 如果 夺宝状态 = 进行中
|
|
|
else if (status == 1) {
|
|
|
// 如果 夺宝参与状态 = 未参与夺宝
|
|
@@ -274,6 +281,14 @@ const handleStatus = (callback) => {
|
|
|
function onRuntimeMsg() {
|
|
|
chrome.runtime.onMessage.addListener((req, sender, sendResponse) => {
|
|
|
switch (req.actionType) {
|
|
|
+ case 'CONTENT_GET_TWEET_TXT':
|
|
|
+ if (req.data.tweet_Id == state.tweetId) {
|
|
|
+ reSetBindPostContent({
|
|
|
+ postId: state.postId || '',
|
|
|
+ postSrcContent: req.data.txt,
|
|
|
+ })
|
|
|
+ }
|
|
|
+ break
|
|
|
case 'CONTENT_API_GET_TWEET_USER_INFO_RES':
|
|
|
let twitterFans = 0;
|
|
|
let { user } = req.data || {};
|