|
|
@@ -66,31 +66,55 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <van-sticky>
|
|
|
+ <van-sticky ref="top" @change="change">
|
|
|
<div class="menu">
|
|
|
- <div class="menu-item" :class="{ active: type === 'DEFAULT' }">
|
|
|
+ <div
|
|
|
+ class="menu-item"
|
|
|
+ @click="changeMenu('DEFAULT')"
|
|
|
+ :class="{ active: type === 'DEFAULT' }"
|
|
|
+ >
|
|
|
藏品类目
|
|
|
</div>
|
|
|
- <div class="menu-item" :class="{ active: type === 'BLIND_BOX' }">
|
|
|
+ <div
|
|
|
+ class="menu-item"
|
|
|
+ @click="changeMenu('BLIND_BOX')"
|
|
|
+ :class="{ active: type === 'BLIND_BOX' }"
|
|
|
+ >
|
|
|
盲盒类目
|
|
|
</div>
|
|
|
<div class="flex1"></div>
|
|
|
- <div class="search">
|
|
|
+ <div
|
|
|
+ class="search"
|
|
|
+ @click="$router.push(`/productSearch?minterId=${info.id}`)"
|
|
|
+ >
|
|
|
<img src="../../assets/svgs/search.svg" alt="" />
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <van-tabs v-model:active="status" line-width="16" line-height="2">
|
|
|
- <van-tab title="全部"></van-tab>
|
|
|
- <van-tab title="售卖"></van-tab>
|
|
|
+ <van-tabs
|
|
|
+ v-model:active="onShelf"
|
|
|
+ @change="getList"
|
|
|
+ line-width="16"
|
|
|
+ line-height="2"
|
|
|
+ >
|
|
|
+ <van-tab title="全部" name=""></van-tab>
|
|
|
+ <van-tab title="售卖" :name="true"></van-tab>
|
|
|
</van-tabs>
|
|
|
</van-sticky>
|
|
|
+ <div class="list">
|
|
|
+ <template v-for="(item, index) in list" :key="index">
|
|
|
+ <product-info v-model:info="list[index]"></product-info
|
|
|
+ ></template>
|
|
|
+ <van-empty v-if="empty" description="没有任何收藏品哦~" />
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import { mapState } from "vuex";
|
|
|
+import productInfo from "../../components/product/productInfo.vue";
|
|
|
export default {
|
|
|
+ components: { productInfo },
|
|
|
computed: {
|
|
|
...mapState(["userInfo"]),
|
|
|
},
|
|
|
@@ -99,13 +123,35 @@ export default {
|
|
|
return {
|
|
|
info: {},
|
|
|
type: "DEFAULT",
|
|
|
- status: 0,
|
|
|
+ onShelf: "",
|
|
|
+ stiky: null,
|
|
|
+ list: [],
|
|
|
+ empty: false,
|
|
|
};
|
|
|
},
|
|
|
+ beforeUnmount() {
|
|
|
+ if (this.stiky.parentNode.nodeName == "BODY") {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ document.body.removeChild(this.stiky);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
mounted() {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.stiky = this.$refs.top.$el.childNodes[0];
|
|
|
+ });
|
|
|
this.getInfo();
|
|
|
},
|
|
|
methods: {
|
|
|
+ change(isFixed) {
|
|
|
+ if (isFixed) {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ document.body.appendChild(this.stiky);
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$refs.top.$el.appendChild(this.stiky);
|
|
|
+ }
|
|
|
+ },
|
|
|
copy() {
|
|
|
this.$copyText(this.info.id).then(
|
|
|
(e) => {
|
|
|
@@ -125,9 +171,7 @@ export default {
|
|
|
});
|
|
|
this.$http.get("/user/get/" + this.$route.query.id).then((res) => {
|
|
|
this.info = res;
|
|
|
- setTimeout(() => {
|
|
|
- this.bs.value.refresh();
|
|
|
- }, 500);
|
|
|
+ this.getList();
|
|
|
});
|
|
|
},
|
|
|
follow() {
|
|
|
@@ -143,6 +187,38 @@ export default {
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
+ getList() {
|
|
|
+ this.$toast.loading({
|
|
|
+ message: "加载中...",
|
|
|
+ forbidClick: true,
|
|
|
+ });
|
|
|
+ this.$http
|
|
|
+ .post(
|
|
|
+ "/collection/all",
|
|
|
+ {
|
|
|
+ page: 0,
|
|
|
+ size: 20,
|
|
|
+ query: {
|
|
|
+ type: this.type,
|
|
|
+ onShelf: this.onShelf,
|
|
|
+ minterId: this.info.id,
|
|
|
+ },
|
|
|
+ sort: this.sort,
|
|
|
+ },
|
|
|
+ { body: "json" }
|
|
|
+ )
|
|
|
+ .then((res) => {
|
|
|
+ this.list = res.content;
|
|
|
+ this.empty = res.empty;
|
|
|
+ setTimeout(() => {
|
|
|
+ this.bs.value.refresh();
|
|
|
+ }, 500);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ changeMenu(menu) {
|
|
|
+ this.type = menu;
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
|
@@ -284,4 +360,8 @@ export default {
|
|
|
min-width: 70px;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+.list {
|
|
|
+ padding: 8px 8px 100px;
|
|
|
+}
|
|
|
</style>
|