|
@@ -1,9 +1,61 @@
|
|
<template>
|
|
<template>
|
|
- <div class="content" v-show-log="state.log_invite_list_show">
|
|
+ <div class="content">
|
|
- <div class="error" v-if="state.invited_list.length == 0">
|
|
+ <div class="horizontal-invited-wrapper" v-if="state.invited_list.length">
|
|
- Invite people to hunt treasure with you!
|
|
+ invited({{state.inviteCount}})
|
|
|
|
+ <div class="horizontal-invited-list" @mouseleave="invitedListMouseleave($event)">
|
|
|
|
+ <template v-for="(item, index) in state.invited_list" :key="index" >
|
|
|
|
+ <div class="invited-item" v-if="index < 9" @mouseenter="invitedItemMouseenter(item)">
|
|
|
|
+ <img :src="item.userInfo.avatarUrl" />
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ </div>
|
|
|
|
+ <img class="more" v-if="state.invited_list.length > 9" :src="require('@/assets/svg/icon-invited-more.svg')" @mouseenter="moreMouseenter" @mouseleave="moreMouseleave" />
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <div class="invited-user-info" @mouseenter="invitedItemMouseenter()"
|
|
|
|
+ @mouseleave="invitedListMouseleave($event)" v-if="hoverInvitedUserInfo.userInfo">
|
|
|
|
+ <div class="left">
|
|
|
|
+ <img class="avatar" :src="hoverInvitedUserInfo.userInfo.avatarUrl" />
|
|
</div>
|
|
</div>
|
|
- <div class="list" v-else @scroll="handleScroll($event)">
|
|
+ <div class="right">
|
|
|
|
+ <div class="user-info">
|
|
|
|
+ <div class="name">
|
|
|
|
+ {{ hoverInvitedUserInfo.userInfo.nickName }}
|
|
|
|
+ </div>
|
|
|
|
+ <div class="time">
|
|
|
|
+ {{ getTime(hoverInvitedUserInfo.timestamp) }}
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <span class="channel">
|
|
|
|
+ <img class="app-icon" :src="hoverInvitedUserInfo.userInfo.avatarUrl" />
|
|
|
|
+ WhatsApp
|
|
|
|
+ </span>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <div class="vertical-invited-wrapper" v-if="showVerticalInvitedList" @mouseenter="moreMouseenter" @mouseleave="moreMouseleave" @scroll="handleScroll($event)">
|
|
|
|
+ <div class="invited-user-info" v-for="(item, index) in state.invited_list" :key="index">
|
|
|
|
+ <div class="left">
|
|
|
|
+ <img @click="clickItem(item)" class="avatar" :src="item.userInfo.avatarUrl" />
|
|
|
|
+ </div>
|
|
|
|
+ <div class="right">
|
|
|
|
+ <div class="user-info">
|
|
|
|
+ <div class="name">
|
|
|
|
+ {{ item.userInfo.nickName }}
|
|
|
|
+ </div>
|
|
|
|
+ <div class="time">
|
|
|
|
+ {{ getTime(item.timestamp) }}
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <span class="channel">
|
|
|
|
+ <img class="app-icon" :src="item.userInfo.avatarUrl" />
|
|
|
|
+ WhatsApp
|
|
|
|
+ </span>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <!-- <div class="list" @scroll="handleScroll($event)">
|
|
<div class="item" v-for="item in state.invited_list" :key="item.userInfo.uid">
|
|
<div class="item" v-for="item in state.invited_list" :key="item.userInfo.uid">
|
|
<div class="left">
|
|
<div class="left">
|
|
<img :src="item.userInfo.avatarUrl" alt="" @click="clickItem(item)" />
|
|
<img :src="item.userInfo.avatarUrl" alt="" @click="clickItem(item)" />
|
|
@@ -13,27 +65,32 @@
|
|
<div>{{ getTime(item.timestamp) }}</div>
|
|
<div>{{ getTime(item.timestamp) }}</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- </div>
|
|
+ </div> -->
|
|
- <div class="footer">
|
|
+ <!-- <div class="footer">
|
|
<v-btn :txt="state.open_btn.txt" :font-size="'17px'" class="btn" :icon="false" :loading="state.btn_loading"
|
|
<v-btn :txt="state.open_btn.txt" :font-size="'17px'" class="btn" :icon="false" :loading="state.btn_loading"
|
|
:disabled="state.open_btn.disabled" v-click-log="state.log_invite_btn_click" @onClick="clickBtn"
|
|
:disabled="state.open_btn.disabled" v-click-log="state.log_invite_btn_click" @onClick="clickBtn"
|
|
font-weight="600"></v-btn>
|
|
font-weight="600"></v-btn>
|
|
- </div>
|
|
+ </div>-->
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<script setup>
|
|
<script setup>
|
|
import VBtn from '@/view/iframe/treasure-hunt/components/btn.vue'
|
|
import VBtn from '@/view/iframe/treasure-hunt/components/btn.vue'
|
|
import { inviteList, inviteListRefresh } from '@/http/treasure'
|
|
import { inviteList, inviteListRefresh } from '@/http/treasure'
|
|
-import { inject, onMounted } from 'vue'
|
|
+import { inject, onMounted, ref } from 'vue'
|
|
import Report from "@/log-center/log"
|
|
import Report from "@/log-center/log"
|
|
|
|
|
|
var moment = require('moment')
|
|
var moment = require('moment')
|
|
let state = inject('state')
|
|
let state = inject('state')
|
|
state.invited_list = []
|
|
state.invited_list = []
|
|
let page_num = 1
|
|
let page_num = 1
|
|
-let page_size = 10
|
|
+let page_size = 100
|
|
let list_end = false
|
|
let list_end = false
|
|
|
|
|
|
|
|
+let hoverInvitedUserInfo = ref({});
|
|
|
|
+let showVerticalInvitedList = ref(false);
|
|
|
|
+let timer = null;
|
|
|
|
+let timer1 = null;
|
|
|
|
+
|
|
state.log_invite_btn_click = {
|
|
state.log_invite_btn_click = {
|
|
businessType: Report.businessType.buttonClick,
|
|
businessType: Report.businessType.buttonClick,
|
|
pageSource: Report.pageSource.inviteFriendsPage,
|
|
pageSource: Report.pageSource.inviteFriendsPage,
|
|
@@ -60,6 +117,30 @@ onMounted(() => {
|
|
list()
|
|
list()
|
|
})
|
|
})
|
|
|
|
|
|
|
|
+const invitedItemMouseenter = (params) => {
|
|
|
|
+ if(timer) clearTimeout(timer)
|
|
|
|
+ if(params) {
|
|
|
|
+ hoverInvitedUserInfo.value = params;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+const invitedListMouseleave = (params) => {
|
|
|
|
+ timer = setTimeout(function(){
|
|
|
|
+ hoverInvitedUserInfo.value = {};
|
|
|
|
+ },600);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+const moreMouseenter = () => {
|
|
|
|
+ if(timer1) clearTimeout(timer1)
|
|
|
|
+ showVerticalInvitedList.value = true;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+const moreMouseleave = () => {
|
|
|
|
+ timer1 = setTimeout(function(){
|
|
|
|
+ showVerticalInvitedList.value = false;
|
|
|
|
+ },600);
|
|
|
|
+}
|
|
|
|
+
|
|
const clickItem = (item) => {
|
|
const clickItem = (item) => {
|
|
window.open(`https://twitter.com/${item.userInfo.nickName}`)
|
|
window.open(`https://twitter.com/${item.userInfo.nickName}`)
|
|
}
|
|
}
|
|
@@ -93,16 +174,17 @@ state.inviteListRefresh = () => {
|
|
}
|
|
}
|
|
}).then((res) => {
|
|
}).then((res) => {
|
|
if (res.code == 0) {
|
|
if (res.code == 0) {
|
|
- handleCommon(res.data)
|
|
+ handleCommon(res.data)
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|
|
const handleCommon = (data) => {
|
|
const handleCommon = (data) => {
|
|
state.inviteCount = data.inviteCount
|
|
state.inviteCount = data.inviteCount
|
|
- if (state.inviteCount > 0) {
|
|
+ // if (state.inviteCount > 0) {
|
|
- state.tabs[1].txt = `invited(${state.inviteCount})`
|
|
+ // state.tabs[1].txt = `invited(${state.inviteCount})`
|
|
- }
|
|
+ // }
|
|
|
|
+
|
|
if (data.inviteUsers.length > 0) {
|
|
if (data.inviteUsers.length > 0) {
|
|
data.inviteUsers.forEach(item => {
|
|
data.inviteUsers.forEach(item => {
|
|
if (state.invited_list.filter((item2) => { return item2.userInfo.uid == item.userInfo.uid }).length == 0) {
|
|
if (state.invited_list.filter((item2) => { return item2.userInfo.uid == item.userInfo.uid }).length == 0) {
|
|
@@ -181,25 +263,139 @@ async function clickBtn() {
|
|
</script>
|
|
</script>
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
.content {
|
|
.content {
|
|
- position: relative;
|
|
+ position: absolute;
|
|
- height: 292px;
|
|
+ bottom: 0px;
|
|
|
|
+ width: 100%;
|
|
|
|
|
|
- .footer {
|
|
+ .horizontal-invited-wrapper {
|
|
- background: #fff;
|
|
+ width: 100%;
|
|
- padding: 10px 16px 25px 16px;
|
|
+ padding: 12px 14px;
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ font-weight: 400;
|
|
|
|
+ font-size: 12px;
|
|
|
|
+ color: #A7A39F;
|
|
|
|
+
|
|
|
|
+ .horizontal-invited-list {
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ margin-left: 5px;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+
|
|
|
|
+ .invited-item {
|
|
|
|
+ width: 16px;
|
|
|
|
+ height: 16px;
|
|
|
|
+ padding: 0 5px;
|
|
|
|
+ img {
|
|
|
|
+ width: 16px;
|
|
|
|
+ height: 16px;
|
|
|
|
+ border-radius: 50%;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .more {
|
|
|
|
+ margin-left: 5px;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
- .error {
|
|
+ .vertical-invited-wrapper {
|
|
- height: 204px;
|
|
+ width: 343px;
|
|
- color: #BABABA;
|
|
+ height: 308px;
|
|
- background-color: #fff;
|
|
+ background: #FFFFFF;
|
|
- font-weight: 500;
|
|
+ box-shadow: 0px 4px 14px rgba(0, 0, 0, 0.25);
|
|
- font-size: 15px;
|
|
+ border-radius: 16px;
|
|
- line-height: 204px;
|
|
+ overflow-y: scroll;
|
|
- text-align: center;
|
|
+ position: absolute;
|
|
|
|
+ bottom: -316px;
|
|
|
|
+ left: 16px;
|
|
|
|
+ animation: fade-in 0.25s linear forwards;
|
|
|
|
|
|
|
|
+ .invited-user-info {
|
|
|
|
+ position: static !important;
|
|
|
|
+ border-radius: 0px !important;
|
|
|
|
+ box-shadow: none !important;
|
|
|
|
+ padding: 0 !important;
|
|
|
|
+ animation: none !important;
|
|
|
|
+ .left, .right {
|
|
|
|
+ padding: 9px 0;
|
|
|
|
+ }
|
|
|
|
+ .left {
|
|
|
|
+ padding-left: 16px;
|
|
|
|
+ }
|
|
|
|
+ .right {
|
|
|
|
+ padding-right: 16px;
|
|
|
|
+ box-shadow: inset 0px -1px 0px #F2F2F2;
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ .invited-user-info {
|
|
|
|
+ width: 343px;
|
|
|
|
+ padding: 9px 16px;
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
+ background: #FFFFFF;
|
|
|
|
+ box-shadow: 0px 4px 14px rgba(0, 0, 0, 0.25);
|
|
|
|
+ border-radius: 16px;
|
|
|
|
+ position: absolute;
|
|
|
|
+ bottom: -62px;
|
|
|
|
+ left: 16px;
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: space-between;
|
|
|
|
+ animation: fade-in 0.25s linear forwards;
|
|
|
|
+
|
|
|
|
+ .left {
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ .avatar {
|
|
|
|
+ width: 30px;
|
|
|
|
+ height: 30px;
|
|
|
|
+ margin-right: 16px;
|
|
|
|
+ border-radius: 50%;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .right {
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: space-between;
|
|
|
|
+ width: 100%;
|
|
|
|
+
|
|
|
|
+ .user-info {
|
|
|
|
+ .name {
|
|
|
|
+ margin-bottom: 5px;
|
|
|
|
+ font-weight: 500;
|
|
|
|
+ font-size: 15px;
|
|
|
|
+ }
|
|
|
|
+ .time {
|
|
|
|
+ font-weight: 400;
|
|
|
|
+ font-size: 12px;
|
|
|
|
+ color: #A9A9A9;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .channel {
|
|
|
|
+ height: min-content;
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ font-weight: 400;
|
|
|
|
+ font-size: 12px;
|
|
|
|
+ color: #A9A9A9;
|
|
|
|
+
|
|
|
|
+ .app-icon {
|
|
|
|
+ width: 14px;
|
|
|
|
+ height: 14px;
|
|
|
|
+ margin-right: 4px;
|
|
|
|
+ border-radius: 50%;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
.list {
|
|
.list {
|
|
background: #fff;
|
|
background: #fff;
|
|
height: 204px;
|
|
height: 204px;
|
|
@@ -247,5 +443,14 @@ async function clickBtn() {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @keyframes fade-in {
|
|
|
|
+ from {
|
|
|
|
+ opacity: 0;
|
|
|
|
+ }
|
|
|
|
+ to {
|
|
|
|
+ opacity: 1;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|