|
|
@@ -80,14 +80,14 @@
|
|
|
</van-sticky>
|
|
|
<div class="data_display" v-if="active === 0">
|
|
|
<!-- 藏品展示 -->
|
|
|
- <van-list v-model:loading="loading" :finished="finished" @load="getAllCollections">
|
|
|
+ <van-list v-model:loading="loading" :loading-text="' '" :finished="finished" @load="getAllCollections">
|
|
|
<div class="data_display_fanter">
|
|
|
<template v-for="(item, index) in collections" :key="index">
|
|
|
<asset-info :info="item"></asset-info>
|
|
|
</template>
|
|
|
</div>
|
|
|
<van-empty
|
|
|
- v-if="collections.length === 0 && !loading"
|
|
|
+ v-if="empty && !loading"
|
|
|
:image="require(`@assets/empty-collection.png`)"
|
|
|
:image-size="`172`"
|
|
|
>
|
|
|
@@ -182,16 +182,18 @@ export default {
|
|
|
this.active = 1;
|
|
|
this.init();
|
|
|
},
|
|
|
- init() {
|
|
|
+ init(loading = true) {
|
|
|
if (!this.isLogin) {
|
|
|
this.empty = true;
|
|
|
this.loading = false;
|
|
|
return Promise.resolve();
|
|
|
}
|
|
|
- this.$toast.loading({
|
|
|
- message: '加载中...',
|
|
|
- forbidClick: true
|
|
|
- });
|
|
|
+ if (loading) {
|
|
|
+ this.$toast.loading({
|
|
|
+ message: '加载中...',
|
|
|
+ forbidClick: true
|
|
|
+ });
|
|
|
+ }
|
|
|
this.empty = false;
|
|
|
this.$http.get('/collection/myLikes').then(res => {
|
|
|
this.list = res;
|
|
|
@@ -203,7 +205,7 @@ export default {
|
|
|
this.$root.$el.scrollTop = 0;
|
|
|
},
|
|
|
// 获取全部库存藏品
|
|
|
- getAllCollections() {
|
|
|
+ getAllCollections(loading = true) {
|
|
|
if (!this.isLogin) {
|
|
|
this.empty = true;
|
|
|
this.loading = false;
|
|
|
@@ -212,6 +214,7 @@ export default {
|
|
|
if (this.page === 0) {
|
|
|
this.collections = [];
|
|
|
}
|
|
|
+ this.loading = true;
|
|
|
this.finished = false;
|
|
|
this.empty = false;
|
|
|
let form = {
|
|
|
@@ -223,10 +226,14 @@ export default {
|
|
|
...this.beforeQuery()
|
|
|
}
|
|
|
};
|
|
|
- this.$toast.loading({
|
|
|
- message: '加载中...',
|
|
|
- forbidClick: true
|
|
|
- });
|
|
|
+ console.log(loading);
|
|
|
+ if (loading) {
|
|
|
+ this.$toast.loading({
|
|
|
+ message: '加载中...',
|
|
|
+ forbidClick: true
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
return this.$http.post('/asset/all', form, { body: 'json' }).then(res => {
|
|
|
if (res.first) {
|
|
|
this.collections = [];
|
|
|
@@ -276,13 +283,14 @@ export default {
|
|
|
return form;
|
|
|
},
|
|
|
onRefresh() {
|
|
|
+ this.isLoading = true;
|
|
|
if (this.active === 0) {
|
|
|
this.page = 0;
|
|
|
- this.getAllCollections().then(() => {
|
|
|
+ this.getAllCollections(false).then(() => {
|
|
|
this.isLoading = false;
|
|
|
});
|
|
|
} else {
|
|
|
- Promise.all([this.init()]).then(res => {
|
|
|
+ Promise.all([this.init(false)]).then(res => {
|
|
|
this.isLoading = false;
|
|
|
});
|
|
|
}
|
|
|
@@ -401,6 +409,7 @@ export default {
|
|
|
padding: 0px 15px 16px;
|
|
|
box-sizing: border-box;
|
|
|
// background: #0F0F27;
|
|
|
+ min-height: calc(100vh - 100px);
|
|
|
.data_display_fanter {
|
|
|
width: 100%;
|
|
|
display: flex;
|