|
@@ -2,9 +2,11 @@
|
|
|
<div class="invite-list">
|
|
|
<div class="head">
|
|
|
<img height="20" :src="require('@/assets/svg/icon-back-2.svg')" @click="clickBack" />
|
|
|
- <span>{{ state.inviteCount }} People Get Money</span>
|
|
|
+ <span>{{ state.detail.receiveCountWithAmount }} People Get Money</span>
|
|
|
</div>
|
|
|
<div class="content">
|
|
|
+ <img v-show="state.receive.loading && state.receive.list.length == 0"
|
|
|
+ :src="require('@/assets/svg/icon-loading-gray.svg')" alt="" class="loading" />
|
|
|
<div class="error" v-if="state.receive.list.length == 0 && state.receive.end">
|
|
|
Invite people to hunt treasure with you!
|
|
|
</div>
|
|
@@ -26,7 +28,7 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script setup>
|
|
|
-import { inviteList, inviteListRefresh } from '@/http/treasure'
|
|
|
+import { receiveListV2 } from '@/http/treasure'
|
|
|
import { inject, onMounted } from 'vue'
|
|
|
import { getBeforeTimeFormat } from "@/uilts/help"
|
|
|
import Report from "@/log-center/log"
|
|
@@ -41,7 +43,7 @@ let page_size = 10
|
|
|
let list_end = false
|
|
|
|
|
|
const clickBack = () => {
|
|
|
- state.page = '邀请页'
|
|
|
+ state.page_show = ''
|
|
|
}
|
|
|
|
|
|
onMounted(() => {
|
|
@@ -58,74 +60,29 @@ function handleScroll(e) {
|
|
|
}
|
|
|
e = e.target
|
|
|
if ((e.clientHeight + e.scrollTop) / e.scrollHeight > .8) {
|
|
|
+ if (page_num * page_size == state.receive.list.length) {
|
|
|
+ page_num++
|
|
|
+ }
|
|
|
list_end = true
|
|
|
- inviteListScroll()
|
|
|
+ list()
|
|
|
}
|
|
|
}
|
|
|
|
|
|
const list = () => {
|
|
|
- let last_timestamp = 0
|
|
|
- if (state.invited_list.length > 0) {
|
|
|
- last_timestamp = state.invited_list[0].timestamp
|
|
|
- }
|
|
|
-
|
|
|
- inviteListRefresh({
|
|
|
+ state.receive.loading = true
|
|
|
+ receiveListV2({
|
|
|
params: {
|
|
|
postId: state.postId,
|
|
|
- lastTimestamp: last_timestamp,
|
|
|
+ pageNum: page_num,
|
|
|
+ pageSize: page_size,
|
|
|
+ sortType: 0
|
|
|
}
|
|
|
}).then((res) => {
|
|
|
if (res.code == 0) {
|
|
|
- handleCommon(res.data)
|
|
|
+ state.receive.loading = false
|
|
|
+ state.receive.list = state.receive.list.concat(res.data)
|
|
|
state.receive.end = true
|
|
|
- }
|
|
|
- })
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-const handleCommon = (data) => {
|
|
|
- state.inviteCount = data.inviteCount
|
|
|
- if (state.inviteCount > 0) {
|
|
|
- state.tabs[1].txt = `invited(${state.inviteCount})`
|
|
|
- }
|
|
|
- if (data.inviteUsers.length > 0) {
|
|
|
- data.inviteUsers.forEach(item => {
|
|
|
- if (state.invited_list.filter((item2) => { return item2.userInfo.uid == item.userInfo.uid }).length == 0) {
|
|
|
- state.invited_list.push(item)
|
|
|
- }
|
|
|
- })
|
|
|
- state.invited_list = state.invited_list.sort((a, b) => {
|
|
|
- return b.timestamp - a.timestamp
|
|
|
- })
|
|
|
-
|
|
|
- list_end = false
|
|
|
- } else {
|
|
|
- list_end = false
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-// 滚动
|
|
|
-let inviteListScroll = () => {
|
|
|
- // state.invited_list
|
|
|
- let last_timestamp = 0
|
|
|
- let len = state.invited_list.length
|
|
|
- if (len > 0) {
|
|
|
- last_timestamp = state.invited_list[len - 1].timestamp
|
|
|
- }
|
|
|
-
|
|
|
- inviteList({
|
|
|
- params: {
|
|
|
- inviteCode: state.invite_code,
|
|
|
- postId: state.postId,
|
|
|
- lastTimestamp: last_timestamp,
|
|
|
- pageSize: page_size
|
|
|
- }
|
|
|
- }).then((res) => {
|
|
|
- if (res.code == 0) {
|
|
|
-
|
|
|
- handleCommon(res.data)
|
|
|
-
|
|
|
+ list_end = false
|
|
|
}
|
|
|
})
|
|
|
}
|
|
@@ -239,4 +196,25 @@ let inviteListScroll = () => {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+.loading {
|
|
|
+ width: 50px;
|
|
|
+ height: 50px;
|
|
|
+ position: fixed;
|
|
|
+ top: 50%;
|
|
|
+ left: 50%;
|
|
|
+ margin-left: -25px;
|
|
|
+ margin-top: -25px;
|
|
|
+ animation: rotation 1s linear infinite;
|
|
|
+}
|
|
|
+
|
|
|
+@keyframes rotation {
|
|
|
+ from {
|
|
|
+ -webkit-transform: rotate(0deg);
|
|
|
+ }
|
|
|
+
|
|
|
+ to {
|
|
|
+ -webkit-transform: rotate(360deg);
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|