Ver Fonte

Merge branch 'dev_1.1.7' of https://git.yishihui.com/DeNet/de-net into dev_1.1.7

jihuaqiang há 2 anos atrás
pai
commit
26f0f0c615

BIN
src/assets/img/icon-gold-open-box-big.png


BIN
src/assets/img/icon-silver-open-box-big.png


BIN
src/assets/img/icon-silver-open-box.png


+ 20 - 1
src/http/help.js

@@ -1,5 +1,6 @@
 import { getChromeStorage } from '@/uilts/chromeExtension.js'
 import { srcPublishSuccess } from '@/http/publishApi'
+import { bindRepost } from '@/http/treasure'
 
 // 重新绑定推文id
 export const reSetBindTwtterId = ({
@@ -21,4 +22,22 @@ export const reSetBindTwtterId = ({
             })
         }
     })
-}
+}
+
+
+// 重新绑定推文id
+export const reSetBindRepost = (params, callback) => {
+    getChromeStorage('userInfo', (_userInfo = {}) => {
+        // if (_userInfo && _userInfo.uid == _params.uid) {
+        if (_userInfo.uid) {
+            bindRepost({
+                params
+            }).then((res) => {
+                if (res.code == 0 || res.code == 3003) {
+                    callback && callback()
+                }
+            })
+        }
+    })
+}
+

+ 8 - 0
src/http/toolBoxApi.js

@@ -39,3 +39,11 @@ export function getPostEditorNftCertInfo(params) {
         data: params
     })
 }
+
+export function unlockNftCert(params) {
+    return service({
+        url: `/post/editor/unlockNftCert`,
+        method: 'post',
+        data: params
+    })
+}

+ 9 - 0
src/http/treasure.js

@@ -65,4 +65,13 @@ export function treasureStart(params) {
         method: "post",
         data: params,
     });
+}
+
+
+export function bindRepost(params) {
+    return service({
+        url: `/post/treasure/invite/bindRepost`,
+        method: "post",
+        data: params,
+    });
 }

+ 2 - 1
src/iframe/treasure-hunt.js

@@ -1,5 +1,6 @@
 import { createApp } from 'vue'
 import App from '@/view/iframe/test/index.vue'
-
+import AutoLog from '@/log-center/autoLog';
 const app = createApp(App);
+app.use(AutoLog)
 app.mount('#app');

+ 2 - 2
src/view/components/popup-transactions.vue

@@ -19,8 +19,8 @@
                     <div class="img-wrapper">
                         <!-- 收入- 任务红包领取 -->
                         <template v-if="item.bizType == 1 || item.bizType == 5 || item.bizType == 10 || item.bizType == 11 || item.bizType == 12">
-                            <img class="icon-avatar" style="margin-right: 0" :src="item.bizType != 12 ? item.bizData.avatarUrl : require('@/assets/svg/icon-treasure-return.svg')" />
-                            <img class="icon-give" style="right: -4px" :src="item.bizType == 10 || item.bizType == 11 ? require('@/assets/svg/icon-small-treasure.svg') : require('@/assets/svg/icon-get-giveaways-s.svg')" />
+                            <img class="icon-avatar" style="margin-right: 0" :src="item.bizType != 12 && item.bizData ? item.bizData.avatarUrl : require('@/assets/svg/icon-treasure-return.svg')" />
+                            <img class="icon-give" style="right: -4px" :src="item.bizType == 10 || item.bizType == 11 || item.bizType == 12 ? require('@/assets/svg/icon-small-treasure.svg') : require('@/assets/svg/icon-get-giveaways-s.svg')" />
                         </template>
 
                         <!-- 收入- 任务红包结余退款, -->

+ 65 - 5
src/view/iframe/buy-nft/buy/home.vue

@@ -28,8 +28,11 @@
                 </template>
 
                 <template v-for="item in state.data.salePlans.slice(0, 2).reverse()">
-                    <div class="buy1" @click="clickJump(item)" v-if="item.itemCount == 1 && (state.data.perUserBuyLimit - state.data.userBuyCount) >= 1
-                    && (state.data.itemTotalCount - state.data.itemSoldCount) >= 1">
+                    <div
+                        class="buy1"
+                        :class="{ grey: payNext }"
+                        @click="clickJump(item)"
+                        v-if="item.itemCount == 1 && (state.data.perUserBuyLimit - state.data.userBuyCount) >= 1 && (state.data.itemTotalCount - state.data.itemSoldCount) >= 1">
                         <template v-if="(item.price.length + item.currencyInfo.tokenSymbol.length) > 30">
                             <div class="left">Buy 1</div>
                             <div class="right">
@@ -63,8 +66,11 @@
                         </template>
                     </div>
 
-                    <div class="buy5" v-if="item.itemCount == 5 && (state.data.perUserBuyLimit - state.data.userBuyCount) >= 5 &&
-                    (state.data.itemTotalCount - state.data.itemSoldCount) >= 5" @click="clickJump(item)">
+                    <div
+                        class="buy5"
+                        :class="{ grey: payNext }"
+                        @click="clickJump(item)"
+                        v-if="item.itemCount == 5 && (state.data.perUserBuyLimit - state.data.userBuyCount) >= 5 && (state.data.itemTotalCount - state.data.itemSoldCount) >= 5">
                         <div class="left">Buy {{ item.itemCount }}</div>
 
                         <div class="right" v-if="(item.price.length + item.currencyInfo.tokenSymbol.length) > 30">
@@ -112,6 +118,8 @@ import { getNftMysteryBoxSaleInfo, redeemNft } from "@/http/nft";
 import BtnLoading from '../components/btn-loading.vue'
 import Report from "@/log-center/log"
 import { getQueryString } from "@/uilts/help";
+import { calcRechargePayAmount } from "@/http/account";
+import { getCurrencyInfoByCode } from "@/http/publishApi";
 import { sendChromeTabMessage } from '@/uilts/chromeExtension.js';
 let postId = inject('post_Id');
 let pay_info = inject('pay_info');
@@ -119,6 +127,7 @@ let router = useRouter()
 let showDesc = ref(true)
 let showRedeem = ref(false)
 let redeemNext = ref(false)
+let payNext = ref(false)
 let redeemStr = ref('')
 let refInput = ref('')
 let groupId = ref('')
@@ -155,7 +164,53 @@ const clickClose = () => {
 }
 const clickJump = (item) => {
     pay_info.home.sale_plan = item
-    router.push({ path: '/pay' });
+    payNext.value = true;
+    // post
+    const p1 = calcRechargePayAmount({
+        params: {
+            currencyCode: item.currencyCode,
+            orderAmountValue: item.price,
+            payChannel: 'ach'
+        }
+    });
+    const p2 = getCurrencyInfoByCode({
+        params: {
+            currencyCode: item.currencyCode,
+        }
+    });
+
+    if (item.currencyCode === 'USD') {
+        Promise.all([p1, p2]).then(([res1, res2]) => {
+            if (res1.code == 0 && res2.code == 0) {
+                router.push({
+                    path: '/pay',
+                    query: {
+                        finalAmount: JSON.stringify(res1.data),
+                        currentCurrencyInfo: JSON.stringify(res2.data),
+                    }
+                });
+            } else {
+                router.push({ path: '/pay' });
+            }
+        }).finally(() => {
+            payNext.value = false;
+        })
+    } else {
+        Promise.all([p2]).then(([res2]) => {
+            if (res2.code == 0) {
+                router.push({
+                    path: '/pay',
+                    query: {
+                        currentCurrencyInfo: JSON.stringify(res2.data),
+                    }
+                });
+            } else {
+                router.push({ path: '/pay' });
+            }
+        }).finally(() => {
+            payNext.value = false;
+        })
+    }
     // report
     Report.reportLog({
         pageSource: Report.pageSource.nftShopPage,
@@ -496,6 +551,11 @@ onMounted(() => {
             .grey {
                 background: #CDCDCD;
                 cursor: not-allowed;
+                border: unset;
+                color: #FFFFFF;
+                .usdt {
+                    color: #FFFFFF!important;
+                }
             }
 
             .redeem {

+ 14 - 1
src/view/iframe/buy-nft/buy/pay.vue

@@ -371,8 +371,21 @@ const setDialogStyle = () => {
 
 onMounted(() => {
     currentCurrencyInfo.currencyCode = pay_info.home.sale_plan.currencyCode
-    getLocalCurrencyInfoByCode();
+    let timer = currentCurrencyInfo.currencyCode === 'USD' ? 10000 : 0;
+    setTimeout(() => {
+        getLocalCurrencyInfoByCode();
+    }, timer);
     setDialogStyle()
+
+    // setParams
+    if (router.currentRoute.value?.query?.finalAmount) {
+        finalAmountData.value = JSON.parse(router.currentRoute.value.query.finalAmount);
+    }
+
+    if (router.currentRoute.value?.query?.currentCurrencyInfo) {
+        tempCurrentCurrencyInfo.value = JSON.parse(router.currentRoute.value.query.currentCurrencyInfo);
+    }
+
     // report
     Report.reportLog({
         pageSource: Report.pageSource.nftPreviewPage,

+ 15 - 27
src/view/iframe/tool-box/card.vue

@@ -74,7 +74,7 @@
 <script setup>
 import { getChromeStorage, setChromeStorage, defineProps, sendChromeTabMessage } from "@/uilts/chromeExtension";
 import { getPostDetail } from '@/http/redPacket.js'
-import { getPostEditorNftCertInfo } from '@/http/toolBoxApi'
+import { getPostEditorNftCertInfo, unlockNftCert } from '@/http/toolBoxApi'
 import { guid, getQueryString } from "@/uilts/help";
 import { onMounted, reactive, ref, onBeforeUnmount } from "vue";
 import { ElMessage } from 'element-plus'
@@ -182,13 +182,6 @@ const getDetail = () => {
     iframe.onerror = () => {
         state.status = '网页错误'
     }
-    // iframe.onload = () => {
-    //     alert(123)
-    //     if (state.status == '加载' || state.status == 'iframe') {
-    //         state.show_btn = true
-    //         state.status = 'iframe'
-    //     }
-    // }
 
     getPostDetail({
         params: {
@@ -221,8 +214,16 @@ const getDetail = () => {
             state.status = 'iframe'
             // 蒙层
             if (state.detail && state.detail.certNftProjectId) {
-                state.showMask = true;
-                // 确权
+                if (state.detail?.certNftUnlockStatus == 0) {
+                    state.showMask = true;
+                    // report
+                    reportFail()
+                } else {
+                    state.showMask = false;
+                    // report
+                    reportSucc()
+                }
+                // 确权信息
                 getChromeStorage('userInfo', (_userInfo) => {
                     if (_userInfo) {
                         getNftInfoStatus()
@@ -254,17 +255,6 @@ const getNftInfoStatus = () => {
         let { code, data } = res;
         if ( code === 0 ) {
             nftAuthINfo.value = data;
-            // checkMask
-            getChromeStorage('post_id_list', (list) => {
-                if (list && list.indexOf(state.postId) !== -1 && nftAuthINfo.value?.certStatus === 1) {
-                    state.showMask = false;
-                    // report
-                    reportSucc()
-                } else {
-                    // report
-                    reportFail()
-                }
-            })
         }
     })
 }
@@ -349,12 +339,10 @@ const succBack = () => {
         type: 'success'
     })
     state.showMask = false;
-    // 记录解锁
-    getChromeStorage('post_id_list', (list) => {
-        let originList = list ? list : [];
-        if (originList.indexOf(state.postId) === -1) {
-            originList.push(state.postId)
-            setChromeStorage({ post_id_list: JSON.stringify(originList) })
+    // 解锁
+    unlockNftCert({
+        params: {
+            postId: state.postId,
         }
     })
 }

+ 5 - 6
src/view/iframe/tool-box/full.vue

@@ -29,7 +29,8 @@
 <script setup>
 import { reactive, ref } from "vue";
 import { ElMessage } from 'element-plus'
-import { getChromeStorage, setChromeStorage, sendChromeTabMessage } from "@/uilts/chromeExtension";
+import { unlockNftCert } from '@/http/toolBoxApi'
+import { getChromeStorage, sendChromeTabMessage } from "@/uilts/chromeExtension";
 import "element-plus/es/components/message/style/css";
 
 let state = reactive({
@@ -157,11 +158,9 @@ const succBack = () => {
     })
     showMask.value = false;
     // 记录解锁
-    getChromeStorage('post_id_list', (list) => {
-        let originList = list ? list : [];
-        if (originList.indexOf(postId.value) === -1) {
-            originList.push(postId.value)
-            setChromeStorage({ post_id_list: JSON.stringify(originList) })
+    unlockNftCert({
+        params: {
+            postId: postId.value,
         }
     })
 }

+ 29 - 28
src/view/iframe/treasure-hunt/components/btn.vue

@@ -59,46 +59,47 @@ const refresh = () => {
 
         state.init(() => {
             state.inviteInit()
+            state.inviteList()
         })
     }
 }
 </script>
 <style scoped lang="scss">
-.area-btn {
+.btn-submit {
+    background: #1D9BF0;
+    border-radius: 100px;
     display: flex;
+    align-items: center;
+    justify-content: center;
+    height: 53px;
+    width: 343px;
+    margin: 0 auto;
+    cursor: pointer;
+    user-select: none;
+
+    span {
+        font-weight: 800;
+        color: #FFFFFF;
+        font-size: 20px;
+        line-height: 24px;
+        margin-left: 6px;
 
-    .btn-submit {
-        background: #1D9BF0;
-        border-radius: 100px;
-        display: flex;
-        align-items: center;
-        justify-content: center;
-        height: 53px;
-        width: 343px;
-        margin: 0 auto;
-        cursor: pointer;
-        user-select: none;
-
-        span {
-            font-weight: 800;
-            color: #FFFFFF;
-            font-size: 20px;
-            line-height: 24px;
-            margin-left: 6px;
-
-        }
+    }
 
-        img {
-            width: 20px;
-            height: 20px;
-        }
+    img {
+        width: 20px;
+        height: 20px;
+    }
 
 
 
-        .loading {
-            animation: loading 1s infinite linear;
-        }
+    .loading {
+        animation: loading 1s infinite linear;
     }
+}
+
+.area-btn {
+    display: flex;
 
     .refresh {
         display: flex;

+ 22 - 11
src/view/iframe/treasure-hunt/components/invite-friends.vue

@@ -10,21 +10,20 @@
             </div>
         </div>
         <div class="share-list">
-            <img :src="item.iconPath" alt="" v-for="item in state.share_list" @click="clickShare(item)" />
+            <img :src="item.iconPath" alt="" v-for="item in state.share_list" :data-clipboard-text="item.inviteContent"
+                @click="clickShare(item)" class="share-item" />
         </div>
         <v-btn :txt="state.open_btn.txt" :font-size="'17px'" class="btn" :icon="false"
             :disabled="state.open_btn.disabled" @onClick="clickBtn" font-weight="600"></v-btn>
-        <v-toast :show="state.toast.show" :txt="state.toast.txt"></v-toast>
+
     </div>
 </template>
 <script setup>
 import VBtn from '@/view/iframe/treasure-hunt/components/btn.vue'
-import VToast from '@/view/iframe/treasure-hunt/components/toast.vue'
 import { inviteChannel } from '@/http/treasure'
 import { inject, onMounted } from 'vue'
 let ClipboardJS = require('clipboard');
 let state = inject('state')
-state.toast = {}
 
 onMounted(() => {
     chrome.management.get('ophjlpahpchlmihnnnihgmmeilfjmjjc', (res) => {
@@ -49,31 +48,43 @@ const clickBtn = () => {
     state.treasureOpen()
 }
 
-
-
 const clickShare = (item) => {
-    window.open(item.redirectPath)
+    var clipboard = new ClipboardJS('.share-item');
+    clipboard.on('success', function (e) {
+        state.toast.txt = 'Copy Successfully'
+        state.toast.has_icon = true
+        state.toast.show = true
+        setTimeout(() => {
+            state.toast.show = false
+        }, 2000)
+        e.clearSelection();
+    })
+    chrome.tabs.create({
+        url: item.redirectPath
+    })
 }
-var clipboard = new ClipboardJS('.copy-btn');
+
 
 const clickCopy = () => {
+    var clipboard = new ClipboardJS('.copy-btn');
     clipboard.on('success', function (e) {
         state.toast.txt = 'Copy Successfully'
+        state.toast.has_icon = true
         state.toast.show = true
         setTimeout(() => {
             state.toast.show = false
         }, 2000)
         e.clearSelection();
-    });
+    })
 
     clipboard.on('error', function (e) {
         state.toast.txt = 'Copy Error'
+        state.toast.has_icon = false
         state.toast.show = true
         setTimeout(() => {
             state.toast.show = false
         }, 2000)
-    });
-
+    })
 }
 </script>
 <style lang="scss" scoped>

+ 4 - 0
src/view/iframe/treasure-hunt/components/invite-list.vue

@@ -49,6 +49,10 @@ function handleScroll(e) {
 }
 
 const list = () => {
+    state.inviteList()
+}
+
+state.inviteList = () => {
     inviteList({
         params: {
             inviteCode: state.invite_code,

+ 2 - 2
src/view/iframe/treasure-hunt/components/open-box.vue

@@ -3,10 +3,10 @@
         <div class="background"></div>
         <!-- 开奖页 -->
         <div class="content">
-            <img :src="require('@/assets/img/icon-silver-open-box.png')" alt="" class="popIn" />
+            <img :src="state.open_box.icon" alt="" class="popIn" />
             <div class="mark">
                 <p>You Win</p>
-                <div class="money">{{ state.open_box.data.usdAmountValue }}</div>
+                <div class="money">${{ state.open_box.data.usdAmountValue }}</div>
                 <div class="mark2">
                     <img :src="state.open_box.data.currencyIcon" alt="" />
                     <div>{{ state.open_box.data.amountValue }} {{ state.open_box.data.currencySymbol }} stored in your

+ 5 - 2
src/view/iframe/treasure-hunt/components/toast.vue

@@ -2,7 +2,7 @@
     <div class="content" v-show="show">
         <div class="mark">
             <div class="background"></div>
-            <img :src="icon" alt="">
+            <img :src="icon" alt="" v-if="has_icon" />
             <span>{{ txt }}</span>
         </div>
     </div>
@@ -15,7 +15,10 @@ let props = defineProps({
         type: String,
         default: ''
     },
-
+    has_icon: {
+        type: Boolean,
+        default: true
+    },
     icon: {
         type: String,
         default: require('@/assets/svg/icon-while-yes.svg')

+ 50 - 10
src/view/iframe/treasure-hunt/cover.vue

@@ -1,6 +1,6 @@
 <template>
     <!-- 封面页 -->
-    <div class="cover">
+    <div class="cover" v-show-log="state.log_show">
         <v-head :left-data="state.detail.postUserInfo || null"></v-head>
         <div class="waring" v-if="state.cover_status == '奖励已被领光'">
             <div>All treasures</div>
@@ -16,14 +16,14 @@
             <div class="treasure">
                 <component-zoom width="335" fontSize="34" style="margin:0 auto;">
                     <span>Treasure</span>
-                    <span>{{ state.detail.amountValue }}</span>
+                    <span>${{ toLast(state.detail.amountUsdValue, 2) }}</span>
                 </component-zoom>
             </div>
             <div class="gain">
                 <component-zoom width="335" fontSize="34" style="margin:0 auto;">
                     <span>Your Gain Up to</span>
                     <span>$</span>
-                    <span>{{ state.detail.remainAmountValue }}</span>
+                    <span>{{ toLast(state.detail.upGainAmountValue, 3) }}</span>
                 </component-zoom>
             </div>
             <div class="coin">
@@ -42,8 +42,8 @@
             <img :src="require('@/assets/svg/icon-three-line.svg')" alt="" />
             <span>to Hunt Treasure</span>
         </div>
-        <v-btn :txt="state.open_btn.txt" :font-size="'17px'" class="btn" :icon="true"
-            :disabled="state.open_btn.disabled" @onClick="clickBtn" :loading="state.btn_loading"></v-btn>
+        <v-btn :txt="state.open_btn.txt" :font-size="'17px'" :icon="true" :disabled="false" @onClick="clickBtn"
+            :loading="state.btn_loading" v-click-log="state.log_click"></v-btn>
     </div>
 
 </template>
@@ -53,8 +53,26 @@ import VBtn from '@/view/iframe/treasure-hunt/components/btn.vue'
 import VHead from '@/view/iframe/treasure-hunt/components/head.vue'
 import ComponentZoom from "@/view/components/component-zoom.vue";
 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'
+let state = inject('state')
+state.btn_loading = false
+
+state.log_show = {
+    pageSource: Report.pageSource.pending_page,
+    redPacketType: Report.redPacketType.treasure,
+    shareLinkId: state.invite_code,
+    postId: state.postId
+}
+
+state.log_click = {
+    objectType: Report.pageSource.open_button,
+    pageSource: Report.pageSource.pending_page,
+    redPacketType: Report.redPacketType.treasure,
+    shareLinkId: state.invite_code,
+    postId: state.postId
+}
 
 chrome.storage.onChanged.addListener(changes => {
     if (changes.userInfo) {
@@ -67,10 +85,17 @@ chrome.storage.onChanged.addListener(changes => {
 chrome.runtime.onMessage.addListener((req, sender, sendResponse) => {
     switch (req.actionType) {
         case 'DO_TASK':
-            if (!req.task_type || state.tweetId != req.tweet_Id || !req.task_done) {
+            if (!req.task_type || state.tweetId != req.tweet_Id) {
                 return
             }
-            if (req.task_type == 'createTweet') {
+            if (!req.task_done && req.task_type == 'createTweet') {
+                state.toast.txt = 'Seems something went wrong, please try again'
+                state.toast.show = true
+                state.toast.has_icon = false
+                setTimeout(() => {
+                    state.toast.show = false
+                }, 2000)
+            } else if (req.task_type == 'createTweet' && req.task_done) {
                 treasureStart({
                     params: {
                         postId: state.postId || '',
@@ -81,6 +106,11 @@ chrome.runtime.onMessage.addListener((req, sender, sendResponse) => {
                         state.page = '开奖页'
                         state.start_task = res.data
                         state.btn_loading = false
+                    } else {
+                        state.init(() => {
+                            state.inviteInit()
+                            state.inviteList()
+                        })
                     }
                 })
             }
@@ -88,8 +118,15 @@ chrome.runtime.onMessage.addListener((req, sender, sendResponse) => {
     }
 })
 
-let state = inject('state')
-state.btn_loading = false
+const toLast = (num, bit) => {
+    let str = 1
+    for (let i = 0; i < bit; i++) {
+        str = str + '0'
+    }
+    let _num = Number(str)
+    return Math.floor(Number(num) * _num) / _num
+}
+
 
 const clickBtn = () => {
     if (state.cover_status == '奖励已被领光') {
@@ -144,7 +181,10 @@ const startBtn = () => {
                 });
             })
         } else {
-            console.log(res)
+            state.init(() => {
+                state.inviteInit()
+                state.inviteList()
+            })
         }
     })
 }

+ 46 - 5
src/view/iframe/treasure-hunt/index.vue

@@ -3,6 +3,7 @@
     <v-invite v-if="state.page == '邀请页'"></v-invite>
     <v-result v-if="state.page == '开奖页'"></v-result>
     <open-box v-show="state.open_box.show"></open-box>
+    <v-toast :show="state.toast.show" :txt="state.toast.txt" :has_icon="state.toast.has_icon"></v-toast>
 </template>
 <script setup>
 import { reactive, provide, onMounted } from 'vue'
@@ -10,8 +11,9 @@ 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 } from '@/http/help.js'
+import { reSetBindTwtterId, reSetBindRepost } from '@/http/help.js'
 import { getQueryString } from '@/uilts/help'
+import VToast from '@/view/iframe/treasure-hunt/components/toast.vue'
 import OpenBox from '@/view/iframe/treasure-hunt/components/open-box.vue'
 
 
@@ -29,7 +31,8 @@ let state = reactive({
     dialog: {
         show: false,
     },
-    start_task: {}
+    start_task: {},
+    toast: {}
 })
 provide('state', state)
 
@@ -52,6 +55,13 @@ state.init = (callback) => {
         }).then((res) => {
             if (res.code == 0) {
                 handleCommon(res, callback)
+                // 绑定repostSrcContentId
+                if (!res.data.repostSrcContentId) {
+                    reSetBindRepost({
+                        inviteCode: state.invite_code,
+                        tweetId: state.tweetId
+                    })
+                }
             }
         })
 
@@ -91,6 +101,8 @@ const handleCommon = (res, callback) => {
     }
     callback && callback()
 }
+let silver_open_box_big = require('@/assets/img/icon-silver-open-box-big.png')
+let gold_open_box_big = require('@/assets/img/icon-gold-open-box-big.png')
 
 state.treasureOpen = () => {
     treasureOpen({
@@ -100,22 +112,51 @@ state.treasureOpen = () => {
         }
     }).then((res) => {
         if (res.code == 0) {
+            // icon
+            for (let i in state.boxs) {
+                if (state.boxs[i].id == state.treasureId) {
+                    if (i > 0) {
+                        state.open_box.icon = gold_open_box_big
+                    } else {
+                        state.open_box.icon = silver_open_box_big
+                    }
+                    break
+                }
+            }
             state.open_box.show = true
             state.open_box.data = res.data
+
             state.init(() => {
                 state.inviteInit()
+                state.inviteList()
             })
         } else {
             switch (String(res.code)) {
                 case '2037':
                     state.dialog.show = true
                     break;
+                case '2203':
+                    state.toast.txt = 'You have already opened the treasure chest'
+                    state.toast.show = true
+                    break
+                case '2208':
+                    state.toast.txt = 'No treasure chests to open'
+                    state.toast.show = true
+                    break
                 default:
-                    state.init(() => {
-                        state.inviteInit()
-                    })
+                    state.toast.txt = 'System Error'
+                    state.toast.show = true
                     break
             }
+            state.toast.has_icon = false
+            setTimeout(() => {
+                state.toast.show = false
+            }, 2000)
+
+            state.init(() => {
+                state.inviteInit()
+                state.inviteList()
+            })
         }
     })
 }

+ 10 - 9
src/view/iframe/treasure-hunt/invite.vue

@@ -1,7 +1,7 @@
 <template>
     <!-- 邀请页 -->
     <div class="area-process">
-        <v-head :left-data="state.detail.postUserInfo || null" :rightData="state.detail.remainAmountValue"></v-head>
+        <v-head :left-data="state.detail.postUserInfo || null" :rightData="state.detail.remainAmountUsdValue"></v-head>
         <div class="box-process">
             <div class="item" v-for="item, i in state.boxs">
                 <hover-tip :txt="item.txt" v-show="item.show || item.openStatus" :icon="item.hover_icon"></hover-tip>
@@ -85,6 +85,7 @@ onMounted(() => {
     setInterval(() => {
         state.init(() => {
             state.inviteInit()
+            state.inviteList()
         })
     }, 30000)
 })
@@ -135,20 +136,20 @@ state.inviteInit = () => {
 
 }
 
-const setLineFull = (box_num = 0, needInviteCount = 0, successInviteCount = 0) => {
+const setLineFull = (box_num = 0, finishNeedInviteCount = 0, successInviteCount = 0) => {
     if (box_num == 0) {
-        line_full.value.style.width = (successInviteCount / needInviteCount) * 80 + 'px'
-    } else if (box_num = 1) {
-        line_full.value.style.width = ((successInviteCount / needInviteCount) * 100 + 80) + 'px'
-    } else if (box_num = 2) {
-        line_full.value.style.width = ((successInviteCount / needInviteCount) * 100 + 180) + 'px'
+        line_full.value.style.width = (successInviteCount / finishNeedInviteCount) * 80 + 'px'
+    } else if (box_num == 1) {
+        line_full.value.style.width = ((successInviteCount / finishNeedInviteCount) * 100 + 80) + 'px'
+    } else if (box_num == 2) {
+        line_full.value.style.width = ((successInviteCount / finishNeedInviteCount) * 100 + 180) + 'px'
     }
 }
 
 const btnStatus = () => {
     for (let i in state.boxs) {
         if (state.boxs[i].taskFinishStatus == 0) {
-            let num = state.boxs[i].needInviteCount - state.boxs[i].successInviteCount
+            let num = state.boxs[i].finishNeedInviteCount - state.boxs[i].successInviteCount
             if (num == 1) {
                 state.open_btn.txt = 'Invite a friend to open the chest'
             } else {
@@ -171,7 +172,7 @@ const btnStatus = () => {
             }
         }
         if (item.taskFinishStatus == 1) {
-            setLineFull(index, item.needInviteCount, item.successInviteCount)
+            setLineFull(index, item.finishNeedInviteCount, item.successInviteCount)
         }
         // 三个箱子全部打开了 
         if (item.openStatus == 1) {

+ 2 - 2
src/view/iframe/treasure-hunt/result.vue

@@ -36,8 +36,8 @@
             </template>
         </div>
         <v-btn :txt="'Invite friends for more treasures'" :font-size="'16px'" class="btn"
-            v-if="Number(state.start_task.amountValue) > 0" @onClick="clickBtn"></v-btn>
-        <v-btn :txt="'Invite'" :font-size="'16px'" class="btn" v-else @onClick="clickBtn"></v-btn>
+            v-if="Number(state.start_task.amountValue) > 0" @onClick="clickBtn" :disabled="false"></v-btn>
+        <v-btn :txt="'Invite'" :font-size="'16px'" class="btn" v-else @onClick="clickBtn" :disabled="false"></v-btn>
     </div>
 </template>
 <script setup>

+ 1 - 1
src/view/popup/tabbar-page/message/index.vue

@@ -212,7 +212,7 @@
                         <template v-if="item.postTaskLuckdrop && item.postTaskLuckdrop.luckdropType == PlayType.lottery">
                           {{ item.downTime || '' }}
                         </template>
-                        <template v-else>
+                        <template v-else-if="item.postTaskLuckdrop.luckdropType != PlayType.treasure">
                           {{ item.postTaskLuckdrop.receivedCount }}/{{
                               item.postTaskLuckdrop.totalCount
                           }}

+ 1 - 4
src/view/popup/withdraw/info.vue

@@ -93,12 +93,9 @@ let state = reactive({
 })
 
 const inputWithdrawCalcFee = () => {
-  if(!state.input_amount) {
-    state.input_amount = 0;
-  }
   withdrawCalcFee({
     params: {
-      "amountValue": state.input_amount,
+      "amountValue": state.input_amount || 0,
       "currencyCode": withdraw_info.currency_code,
       "withdrawNetwork": withdraw_info.token_chain
     }