瀏覽代碼

[edit][bug]

zhangwei 2 年之前
父節點
當前提交
23667ce1f1

+ 1 - 1
src/view/iframe/treasure-hunt/components/dialog.vue

@@ -1,5 +1,5 @@
 <template>
-    <div class="content" v-show="">
+    <div class="content">
         <div class="background"></div>
         <!-- 开奖页 -->
         <div class="dialog">

+ 4 - 13
src/view/iframe/treasure-hunt/components/invite-friends.vue

@@ -21,9 +21,8 @@
 <script setup>
 import VBtn from '@/view/iframe/treasure-hunt/components/btn.vue'
 import VToast from '@/view/iframe/treasure-hunt/components/toast.vue'
-import OpenBox from '@/view/iframe/treasure-hunt/components/dialog.vue'
+import OpenBox from '@/view/iframe/treasure-hunt/components/open-box.vue'
 import { inviteChannel } from '@/http/treasure'
-import { treasureOpen } from '@/http/treasure'
 import { inject, onMounted } from 'vue'
 let ClipboardJS = require('clipboard');
 let state = inject('state')
@@ -43,19 +42,11 @@ onMounted(() => {
 })
 
 const clickBtn = () => {
-    treasureOpen({
-        params: {
-            postId: state.postId,
-            treasureId: state.treasureId,
-        }
-    }).then((res) => {
-        if (res.code == 0) {
-            state.open_box.show = true
-            state.open_box = res.data
-        }
-    })
+    state.treasureOpen()
 }
 
+
+
 const clickShare = (item) => {
     window.open(item.redirectPath)
 }

+ 3 - 14
src/view/iframe/treasure-hunt/components/invite-list.vue

@@ -24,16 +24,15 @@
 import VBtn from '@/view/iframe/treasure-hunt/components/btn.vue'
 import { inviteList } from '@/http/treasure'
 import { inject, onMounted } from 'vue'
-import { treasureOpen } from '@/http/treasure'
 
 var moment = require('moment')
 let state = inject('state')
-state.invited_list = [
-]
+state.invited_list = []
 
 onMounted(() => {
     inviteList({
         params: {
+            inviteCode: state.invite_code,
             postId: state.postId,
             pageNum: 1,
             pageSize: 10,
@@ -76,17 +75,7 @@ const getTime = (timestamp) => {
 }
 
 const clickBtn = () => {
-    treasureOpen({
-        params: {
-            postId: state.postId,
-            treasureId: state.treasureId,
-        }
-    }).then((res) => {
-        if (res.code == 0) {
-            state.open_box.show = true
-            state.open_box = res.data
-        }
-    })
+    state.treasureOpen()
 }
 
 </script>

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

@@ -1,5 +1,5 @@
 <template>
-    <div>
+    <div class="open-box">
         <div class="background"></div>
         <!-- 开奖页 -->
         <div class="content">
@@ -30,85 +30,94 @@ const clickBtn = () => {
 }
 </script>
 <style lang="scss" scoped>
-.background {
-    background: #000000;
-    opacity: .9;
+.open-box {
     position: fixed;
-    width: 100%;
-    height: 100%;
-    z-index: 1;
-}
-
-.content {
-    z-index: 2;
-    width: 375px;
-    height: 500px;
-    text-align: center;
-    position: relative;
-
+    left: 0;
+    top: 0;
+    z-index: 999;
 
 
-    img {
-        margin-top: 15px;
+    .background {
+        background: #000000;
+        opacity: .9;
+        position: fixed;
+        width: 100%;
+        height: 100%;
     }
 
-    .mark {
-        position: absolute;
-        top: 246px;
+    .content {
+        z-index: 2;
         width: 375px;
+        height: 500px;
+        text-align: center;
+        position: relative;
 
-        p {
-            margin: 0;
-            padding: 0;
-            text-align: center;
 
+
+        img {
+            margin-top: 15px;
+            width: 250px;
+            height: 250px;
         }
 
+        .mark {
+            position: absolute;
+            top: 246px;
+            width: 375px;
 
-        p:nth-child(1) {
-            margin-bottom: 10px;
-            color: #FFFFFF;
-            font-weight: 800;
-            font-size: 18px;
-        }
+            p {
+                margin: 0;
+                padding: 0;
+                text-align: center;
 
-        .txt {
-            color: #FFC83A;
-            font-weight: 800;
-            font-size: 24px;
+            }
 
-        }
 
-        .money {
-            color: #FFC83A;
-            font-weight: 800;
-            font-size: 34px;
-        }
+            p:nth-child(1) {
+                margin-bottom: 10px;
+                color: #FFFFFF;
+                font-weight: 800;
+                font-size: 18px;
+            }
 
-        .mark2 {
-            margin-top: 10px;
-            display: flex;
-            justify-content: center;
+            .txt {
+                color: #FFC83A;
+                font-weight: 800;
+                font-size: 24px;
 
-            img {
-                width: 17px;
-                height: 17px;
-                margin: 0;
             }
 
-            div {
-                color: #A9A49F;
-                font-weight: 400;
-                font-size: 12px;
+            .money {
+                color: #FFC83A;
+                font-weight: 800;
+                font-size: 34px;
+            }
+
+            .mark2 {
+                margin-top: 10px;
+                display: flex;
+                justify-content: center;
 
+                img {
+                    width: 17px;
+                    height: 17px;
+                    margin: 0;
+                }
+
+                div {
+                    color: #A9A49F;
+                    font-weight: 400;
+                    font-size: 12px;
+
+                }
             }
         }
-    }
 
-    .btn {
-        position: absolute;
-        bottom: 25px;
-        left: 15px;
+        .btn {
+            position: absolute;
+            bottom: 25px;
+            left: 15px;
+        }
     }
 }
 </style>

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

@@ -23,8 +23,8 @@
                 <span>{{ state.detail.remainAmountValue }}</span>
             </div>
             <div class="coin">
-                <img :src="state.detail.imagePath" alt="" />
-                <span>{{ state.detail.amountCurrencyCode }}</span>
+                <img :src="state.detail.currencyIconPath" alt="" />
+                <span>{{ state.detail.currencySymbol }}</span>
             </div>
         </template>
 

+ 21 - 2
src/view/iframe/treasure-hunt/index.vue

@@ -11,6 +11,7 @@ import VResult from '@/view/iframe/treasure-hunt/result.vue'
 import { inviteDetail, treasureDetail } from '@/http/treasure.js'
 import { reSetBindTwtterId } from '@/http/help.js'
 import { getQueryString } from '@/uilts/help'
+import { treasureOpen } from '@/http/treasure'
 
 let state = reactive({
     page: '',
@@ -26,12 +27,16 @@ let state = reactive({
 })
 provide('state', state)
 
+let params = {}
 onMounted(() => {
-    let params = JSON.parse(getQueryString('params') || '{}')
+    params = JSON.parse(getQueryString('params') || '{}')
     state.postId = params.post_Id || ''
     state.tweetId = params.tweet_Id || ''
     state.invite_code = params.invite_code || ''
+    state.init()
+})
 
+state.init = () => {
     if (params.page_type == '邀请链接') {
         // 邀请链接
         inviteDetail({
@@ -73,8 +78,22 @@ onMounted(() => {
             }
         })
     }
+}
 
-})
+state.treasureOpen = () => {
+    treasureOpen({
+        params: {
+            postId: state.postId,
+            treasureId: state.treasureId,
+        }
+    }).then((res) => {
+        if (res.code == 0) {
+            state.open_box.show = true
+            state.open_box = res.data
+            state.init()
+        }
+    })
+}
 
 const handleStatus = () => {
     // 如果 夺宝状态 = 未开始

+ 1 - 0
src/view/iframe/treasure-hunt/invite.vue

@@ -50,6 +50,7 @@ let state = inject('state')
 state.success_message_list = []
 
 
+
 // ---- box 区域
 let silver_close_box = require('@/assets/img/icon-silver-close-box.png')
 let silver_open_box = require('@/assets/img/icon-silver-open-box.png')

+ 1 - 0
src/view/iframe/treasure-hunt/result.vue

@@ -32,6 +32,7 @@ import VBtn from '@/view/iframe/treasure-hunt/components/btn.vue'
 let state = inject('state')
 
 const clickBtn = () => {
+    state.init()
     state.page = '邀请页'
 }