|
@@ -4,7 +4,13 @@
|
|
|
<div class="top">
|
|
<div class="top">
|
|
|
<div class="name">{{ pageName }}</div>
|
|
<div class="name">{{ pageName }}</div>
|
|
|
</div>
|
|
</div>
|
|
|
- <van-tabs v-model:active="sort" :ellipsis="false" line-width="16" line-height="2" @change="getList">
|
|
|
|
|
|
|
+ <van-tabs
|
|
|
|
|
+ v-model:active="sort"
|
|
|
|
|
+ :ellipsis="false"
|
|
|
|
|
+ line-width="16"
|
|
|
|
|
+ line-height="2"
|
|
|
|
|
+ @change="(page = 0), getList()"
|
|
|
|
|
+ >
|
|
|
<van-tab
|
|
<van-tab
|
|
|
:title="item.label"
|
|
:title="item.label"
|
|
|
:name="
|
|
:name="
|
|
@@ -24,12 +30,14 @@
|
|
|
</van-tab>
|
|
</van-tab>
|
|
|
</van-tabs>
|
|
</van-tabs>
|
|
|
</van-sticky>
|
|
</van-sticky>
|
|
|
- <div class="list">
|
|
|
|
|
|
|
+
|
|
|
|
|
+ <van-list v-model:loading="loading" :finished="finished" finished-text="" @load="getList">
|
|
|
<template v-for="(item, index) in list" :key="index">
|
|
<template v-for="(item, index) in list" :key="index">
|
|
|
<product-info v-model:info="list[index]" @update:info="init"></product-info>
|
|
<product-info v-model:info="list[index]" @update:info="init"></product-info>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
+
|
|
|
<van-empty v-if="empty" description="没有任何藏品哦~" />
|
|
<van-empty v-if="empty" description="没有任何藏品哦~" />
|
|
|
- </div>
|
|
|
|
|
|
|
+ </van-list>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -38,7 +46,7 @@ import ProductInfo from '../../components/product/productInfo.vue';
|
|
|
import product from '../../mixins/product';
|
|
import product from '../../mixins/product';
|
|
|
export default {
|
|
export default {
|
|
|
components: { ProductInfo },
|
|
components: { ProductInfo },
|
|
|
- inject: ['bs'],
|
|
|
|
|
|
|
+
|
|
|
mixins: [product],
|
|
mixins: [product],
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
@@ -64,7 +72,10 @@ export default {
|
|
|
value: ['price,desc', 'price,asc'],
|
|
value: ['price,desc', 'price,asc'],
|
|
|
type: 'select'
|
|
type: 'select'
|
|
|
}
|
|
}
|
|
|
- ]
|
|
|
|
|
|
|
+ ],
|
|
|
|
|
+ loading: false,
|
|
|
|
|
+ finished: false,
|
|
|
|
|
+ page: 0
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
computed: {
|
|
computed: {
|
|
@@ -79,7 +90,6 @@ export default {
|
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
|
this.stiky = this.$refs.top.$el.childNodes[0];
|
|
this.stiky = this.$refs.top.$el.childNodes[0];
|
|
|
});
|
|
});
|
|
|
- this.getList();
|
|
|
|
|
},
|
|
},
|
|
|
beforeUnmount() {
|
|
beforeUnmount() {
|
|
|
if (this.stiky.parentNode.nodeName == 'BODY') {
|
|
if (this.stiky.parentNode.nodeName == 'BODY') {
|
|
@@ -99,15 +109,17 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
getList() {
|
|
getList() {
|
|
|
- this.$toast.loading({
|
|
|
|
|
- message: '加载中...',
|
|
|
|
|
- forbidClick: true
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ if (this.page === 0) {
|
|
|
|
|
+ this.list = [];
|
|
|
|
|
+ }
|
|
|
|
|
+ this.loading = true;
|
|
|
|
|
+ this.finished = false;
|
|
|
|
|
+ this.empty = false;
|
|
|
this.$http
|
|
this.$http
|
|
|
.post(
|
|
.post(
|
|
|
'/collection/all',
|
|
'/collection/all',
|
|
|
{
|
|
{
|
|
|
- page: 0,
|
|
|
|
|
|
|
+ page: this.page,
|
|
|
size: 20,
|
|
size: 20,
|
|
|
query: {
|
|
query: {
|
|
|
type: this.type,
|
|
type: this.type,
|
|
@@ -119,9 +131,13 @@ export default {
|
|
|
{ body: 'json' }
|
|
{ body: 'json' }
|
|
|
)
|
|
)
|
|
|
.then(res => {
|
|
.then(res => {
|
|
|
- this.list = res.content;
|
|
|
|
|
|
|
+ this.list = [...this.list, ...res.content];
|
|
|
this.empty = res.empty;
|
|
this.empty = res.empty;
|
|
|
- this.$toast.clear();
|
|
|
|
|
|
|
+ this.loading = false;
|
|
|
|
|
+ this.finished = res.last;
|
|
|
|
|
+ if (!this.finished) {
|
|
|
|
|
+ this.page = this.page + 1;
|
|
|
|
|
+ }
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -133,6 +149,9 @@ export default {
|
|
|
background-color: #0f0f0f;
|
|
background-color: #0f0f0f;
|
|
|
padding-bottom: 100px;
|
|
padding-bottom: 100px;
|
|
|
}
|
|
}
|
|
|
|
|
+.van-list {
|
|
|
|
|
+ padding: 8px;
|
|
|
|
|
+}
|
|
|
.top {
|
|
.top {
|
|
|
background-color: #181818;
|
|
background-color: #181818;
|
|
|
padding: 0 16px;
|
|
padding: 0 16px;
|
|
@@ -146,11 +165,6 @@ export default {
|
|
|
line-height: 30px;
|
|
line-height: 30px;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-/deep/.van-tabs {
|
|
|
|
|
- .van-tabs__nav {
|
|
|
|
|
- padding-left: 16px;
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
// /deep/.van-tab {
|
|
// /deep/.van-tab {
|
|
|
// flex-grow: 0;
|
|
// flex-grow: 0;
|
|
|
// padding: 0 0 0 0;
|
|
// padding: 0 0 0 0;
|