|
@@ -2,27 +2,8 @@
|
|
|
<!-- 邀请页 -->
|
|
|
<div class="area-process" v-show-log="state.log_invite_show">
|
|
|
<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>
|
|
|
- <img :src="item.icon" alt="" @mouseenter="mouseItem(i)" @mouseleave="mouseLeaveItem(i)" />
|
|
|
- <img :src="require('@/assets/img/icon-flash-active.png')" alt="" class="flash"
|
|
|
- v-if="item.openStatus == 0 && item.taskFinishStatus == 1" />
|
|
|
- </div>
|
|
|
- <div class="line">
|
|
|
- <div class="full" ref="line_full"></div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="area-success-message" @mouseover="mouseOver" @mouseleave="mouseLeave">
|
|
|
- <div class="content-success-message" ref="content_success_message">
|
|
|
- <div class="success-message" v-for="item, index in state.success_message_list" :key="index"
|
|
|
- @click="clickItem(item)">
|
|
|
- <img :src="item.userInfo.avatarUrl" alt="" />
|
|
|
- <span>{{ item.userInfo.nickName }} </span>
|
|
|
- <span>Opened Treasure Chest</span>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ <v-carousel></v-carousel>
|
|
|
+ <v-boxs></v-boxs>
|
|
|
</div>
|
|
|
|
|
|
<div class="area-nav">
|
|
@@ -43,16 +24,18 @@
|
|
|
</template>
|
|
|
<script setup>
|
|
|
import { ref, onMounted, watch, inject } from 'vue'
|
|
|
-import { receiveList } from '@/http/treasure.js'
|
|
|
+
|
|
|
import VHead from '@/view/iframe/treasure-hunt/components/head.vue'
|
|
|
import InviteList from '@/view/iframe/treasure-hunt/components/invite-list.vue'
|
|
|
import HoverTip from '@/view/iframe/treasure-hunt/components/hover-tip.vue'
|
|
|
import InviteFriends from '@/view/iframe/treasure-hunt/components/invite-friends.vue'
|
|
|
import VDialog from '@/view/iframe/treasure-hunt/components/dialog.vue'
|
|
|
+import VBoxs from '@/view/iframe/treasure-hunt/components/boxs.vue'
|
|
|
+import VCarousel from '@/view/iframe/treasure-hunt/components/carousel.vue'
|
|
|
|
|
|
import Report from "@/log-center/log"
|
|
|
|
|
|
-let content_success_message = ref(null)
|
|
|
+
|
|
|
let state = inject('state')
|
|
|
|
|
|
state.log_invite_show = {
|
|
@@ -65,15 +48,6 @@ state.log_invite_show = {
|
|
|
postId: state.postId
|
|
|
}
|
|
|
|
|
|
-// ---- 走马灯
|
|
|
-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')
|
|
|
-let gold_open_box = require('@/assets/img/icon-gold-open-box.png')
|
|
|
-let gold_close_box = require('@/assets/img/icon-gold-close-box.png')
|
|
|
-
|
|
|
|
|
|
// ---- tab区域 ----
|
|
|
state.tab_index = 0
|
|
@@ -83,7 +57,6 @@ state.tabs = [{
|
|
|
txt: 'Invited'
|
|
|
}]
|
|
|
|
|
|
-state.boxs = []
|
|
|
|
|
|
let line_full = ref(null)
|
|
|
onMounted(() => {
|
|
@@ -100,73 +73,10 @@ const clickItem = (item) => {
|
|
|
window.open(`https://twitter.com/${item.userInfo.nickName}`)
|
|
|
}
|
|
|
state.inviteInit = () => {
|
|
|
- state.boxs = []
|
|
|
- state.detail.treasureRecords.forEach((item, index) => {
|
|
|
- if (item.openStatus == 0) {
|
|
|
- item.hover_icon = require('@/assets/svg/icon-user.svg')
|
|
|
- if (index > 0) {
|
|
|
- item.icon = gold_close_box
|
|
|
- } else {
|
|
|
- item.icon = silver_close_box
|
|
|
- }
|
|
|
- item.txt = item.inviteProgress
|
|
|
- } else {
|
|
|
- item.icon = silver_open_box
|
|
|
- item.hover_icon = require('@/assets/svg/icon-green-yes.svg')
|
|
|
- // 最后一条
|
|
|
- if (index > 0) {
|
|
|
- item.icon = gold_open_box
|
|
|
- } else {
|
|
|
- item.icon = silver_open_box
|
|
|
- }
|
|
|
- item.txt = '$' + item.amountUsdValue
|
|
|
- }
|
|
|
-
|
|
|
- state.boxs.push(item)
|
|
|
- })
|
|
|
-
|
|
|
- receiveList({
|
|
|
- params: {
|
|
|
- postId: state.postId,
|
|
|
- pageNum: 1,
|
|
|
- pageSize: 100,
|
|
|
- }
|
|
|
- }).then((res) => {
|
|
|
- if (res.code == 0) {
|
|
|
- state.success_message_list = res.data
|
|
|
- state.success_message_list = state.success_message_list.concat(state.success_message_list)
|
|
|
- state.success_message_list = state.success_message_list.concat(state.success_message_list)
|
|
|
-
|
|
|
- if (content_success_message && content_success_message.value) {
|
|
|
- let dom = content_success_message.value
|
|
|
- let s = state.success_message_list.length * 4
|
|
|
- dom.style.animationDuration = s + 's'
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
+ // state.boxs = []
|
|
|
btnStatus()
|
|
|
|
|
|
}
|
|
|
-let line_width = 0
|
|
|
-const setLineFull = (box_num = 0, finishNeedInviteCount = 0, successInviteCount = 0) => {
|
|
|
- if (box_num == 0) {
|
|
|
- // 第一个宝箱起点是0,终点是55
|
|
|
- line_width = (successInviteCount / finishNeedInviteCount) * 55
|
|
|
- } else if (box_num == 1) {
|
|
|
- if (line_width == 55) {
|
|
|
- // 第二个宝箱起点88,终点是155
|
|
|
- line_width = 88
|
|
|
- line_width = (successInviteCount / finishNeedInviteCount) * (155 - line_width) + line_width
|
|
|
- }
|
|
|
- } else if (box_num == 2) {
|
|
|
- if (line_width == 155) {
|
|
|
- line_width = 192
|
|
|
- // 第二个宝箱起点是192,终点是260
|
|
|
- line_width = (successInviteCount / finishNeedInviteCount) * (260 - line_width) + line_width
|
|
|
- }
|
|
|
- }
|
|
|
- line_full.value.style.width = line_width + 'px'
|
|
|
-}
|
|
|
|
|
|
const btnStatus = () => {
|
|
|
for (let i in state.boxs) {
|
|
@@ -193,7 +103,7 @@ const btnStatus = () => {
|
|
|
state.treasureId = item.id
|
|
|
}
|
|
|
}
|
|
|
- setLineFull(index, item.finishNeedInviteCount, item.successInviteCount)
|
|
|
+ // setLineFull(index, item.finishNeedInviteCount, item.successInviteCount)
|
|
|
// 三个箱子全部打开了
|
|
|
if (item.openStatus == 1) {
|
|
|
open_num++
|
|
@@ -205,23 +115,9 @@ const btnStatus = () => {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
-const mouseItem = (i) => {
|
|
|
- state.boxs[i].show = true
|
|
|
-}
|
|
|
-const mouseLeaveItem = (i) => {
|
|
|
- state.boxs[i].show = false
|
|
|
-}
|
|
|
|
|
|
-const mouseOver = () => {
|
|
|
- if (content_success_message && content_success_message.value && content_success_message.value.style) {
|
|
|
- content_success_message.value.style.animationPlayState = 'paused'
|
|
|
- }
|
|
|
-}
|
|
|
-const mouseLeave = () => {
|
|
|
- if (content_success_message && content_success_message.value && content_success_message.value.style) {
|
|
|
- content_success_message.value.style.animationPlayState = 'running'
|
|
|
- }
|
|
|
-}
|
|
|
+
|
|
|
+
|
|
|
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
@@ -230,144 +126,8 @@ const mouseLeave = () => {
|
|
|
height: 170px;
|
|
|
background: linear-gradient(179.96deg, #735931 0.04%, #0E0803 53.64%);
|
|
|
position: relative;
|
|
|
-
|
|
|
- .box-process {
|
|
|
- width: 350px;
|
|
|
- height: 90px;
|
|
|
- margin: 0 auto;
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- position: absolute;
|
|
|
- top: 32px;
|
|
|
- left: 13px;
|
|
|
-
|
|
|
- img {
|
|
|
- width: 60px;
|
|
|
- height: 60px;
|
|
|
- z-index: 2;
|
|
|
- }
|
|
|
-
|
|
|
- .item {
|
|
|
- z-index: 2;
|
|
|
- display: flex;
|
|
|
- justify-content: center;
|
|
|
- position: relative;
|
|
|
-
|
|
|
- .flash {
|
|
|
- position: absolute;
|
|
|
- top: 0;
|
|
|
- left: 0;
|
|
|
- z-index: 0;
|
|
|
- width: 100%;
|
|
|
- height: 100%;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .item:nth-child(1) {
|
|
|
-
|
|
|
- margin-left: 56px;
|
|
|
- }
|
|
|
-
|
|
|
- .item:nth-child(2) {
|
|
|
- width: 60px;
|
|
|
- height: 60px;
|
|
|
- margin-left: 40px;
|
|
|
- }
|
|
|
-
|
|
|
- .item:nth-child(3) {
|
|
|
- img {
|
|
|
- width: 90px;
|
|
|
- height: 90px;
|
|
|
- }
|
|
|
-
|
|
|
- margin-left: 40px;
|
|
|
- }
|
|
|
-
|
|
|
- .line {
|
|
|
- width: 300px;
|
|
|
- height: 4px;
|
|
|
- background: rgba(255, 210, 59, 0.2);
|
|
|
- position: absolute;
|
|
|
- border-radius: 100px;
|
|
|
- overflow: hidden;
|
|
|
- left: 13px;
|
|
|
- top: 45px;
|
|
|
-
|
|
|
- .full {
|
|
|
- position: absolute;
|
|
|
- left: 0;
|
|
|
- top: 0;
|
|
|
- height: 4px;
|
|
|
- width: 0px;
|
|
|
- background: #FFD23B;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- .area-success-message {
|
|
|
- height: 30px;
|
|
|
- width: 100%;
|
|
|
- position: absolute;
|
|
|
- bottom: 13px;
|
|
|
- overflow: hidden;
|
|
|
-
|
|
|
- .content-success-message {
|
|
|
- width: fit-content;
|
|
|
- display: flex;
|
|
|
- animation: rolling 18s linear infinite;
|
|
|
- animation-duration: 10s;
|
|
|
- animation-play-state: running;
|
|
|
-
|
|
|
- .success-message {
|
|
|
- cursor: pointer;
|
|
|
- width: fit-content;
|
|
|
- height: 30px;
|
|
|
- padding: 0 9px;
|
|
|
- border-radius: 100px;
|
|
|
- background: rgba(255, 255, 255, 0.1);
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- overflow: hidden;
|
|
|
- margin-right: 15px;
|
|
|
-
|
|
|
- img {
|
|
|
- width: 20px;
|
|
|
- height: 20px;
|
|
|
- border-radius: 100px;
|
|
|
- margin-right: 8px;
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- span {
|
|
|
- font-style: normal;
|
|
|
- font-weight: 500;
|
|
|
- font-size: 12px;
|
|
|
- line-height: 14px;
|
|
|
- white-space: nowrap;
|
|
|
- }
|
|
|
-
|
|
|
- span:nth-child(2) {
|
|
|
- color: #1D9BF0;
|
|
|
- }
|
|
|
-
|
|
|
- span:nth-child(3) {
|
|
|
- color: #A8A8A8;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
-@keyframes rolling {
|
|
|
- from {
|
|
|
- transform: translateX(0);
|
|
|
- }
|
|
|
-
|
|
|
- to {
|
|
|
- transform: translateX(-50%);
|
|
|
- }
|
|
|
-}
|
|
|
|
|
|
.area-nav {
|
|
|
width: 375px;
|