|
@@ -9,27 +9,35 @@
|
|
|
show-action
|
|
show-action
|
|
|
autofocus
|
|
autofocus
|
|
|
:left-icon="require('../../assets/svgs/icon-sosuo.svg')"
|
|
:left-icon="require('../../assets/svgs/icon-sosuo.svg')"
|
|
|
- @search="getList"
|
|
|
|
|
|
|
+ @search="getSearch"
|
|
|
@cancel="$router.go(-1)"
|
|
@cancel="$router.go(-1)"
|
|
|
/>
|
|
/>
|
|
|
</van-sticky>
|
|
</van-sticky>
|
|
|
- <div class="list">
|
|
|
|
|
|
|
+ <van-list
|
|
|
|
|
+ class="list"
|
|
|
|
|
+ v-model:loading="loading"
|
|
|
|
|
+ :immediate-check="false"
|
|
|
|
|
+ :finished="finished"
|
|
|
|
|
+ finished-text=""
|
|
|
|
|
+ @load="getData"
|
|
|
|
|
+ >
|
|
|
<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>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
import ProductInfo from '../../components/product/productInfo.vue';
|
|
import ProductInfo from '../../components/product/productInfo.vue';
|
|
|
import product from '../../mixins/product';
|
|
import product from '../../mixins/product';
|
|
|
|
|
+import list from '../../mixins/list';
|
|
|
export default {
|
|
export default {
|
|
|
name: 'Search',
|
|
name: 'Search',
|
|
|
components: { ProductInfo },
|
|
components: { ProductInfo },
|
|
|
inject: ['bar'],
|
|
inject: ['bar'],
|
|
|
- mixins: [product],
|
|
|
|
|
|
|
+ mixins: [product, list],
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
list: [],
|
|
list: [],
|
|
@@ -37,62 +45,38 @@ export default {
|
|
|
search: '',
|
|
search: '',
|
|
|
stiky: null,
|
|
stiky: null,
|
|
|
type: '',
|
|
type: '',
|
|
|
- minterId: ''
|
|
|
|
|
|
|
+ minterId: '',
|
|
|
|
|
+ url: '/collection/all'
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
- beforeRouteLeave(to, from, next) {
|
|
|
|
|
- if (to.name !== 'productDetail') {
|
|
|
|
|
- this.setKeeps([]);
|
|
|
|
|
- }
|
|
|
|
|
- next();
|
|
|
|
|
- // ...
|
|
|
|
|
- },
|
|
|
|
|
computed: {
|
|
computed: {
|
|
|
pageName() {
|
|
pageName() {
|
|
|
return this.getLabelName(this.type, this.typeOptions);
|
|
return this.getLabelName(this.type, this.typeOptions);
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
mounted() {
|
|
mounted() {
|
|
|
- this.setKeeps(['Search']);
|
|
|
|
|
if (this.$route.query.type) {
|
|
if (this.$route.query.type) {
|
|
|
this.type = this.$route.query.type;
|
|
this.type = this.$route.query.type;
|
|
|
}
|
|
}
|
|
|
if (this.$route.query.minterId) {
|
|
if (this.$route.query.minterId) {
|
|
|
this.minterId = this.$route.query.minterId;
|
|
this.minterId = this.$route.query.minterId;
|
|
|
}
|
|
}
|
|
|
- this.$nextTick(() => {
|
|
|
|
|
- this.stiky = this.$refs.top.$el.childNodes[0];
|
|
|
|
|
- });
|
|
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
- getList(search) {
|
|
|
|
|
|
|
+ beforeData() {
|
|
|
|
|
+ return {
|
|
|
|
|
+ query: {
|
|
|
|
|
+ onShelf: true,
|
|
|
|
|
+ type: this.type,
|
|
|
|
|
+ minterId: this.minterId,
|
|
|
|
|
+ del: false
|
|
|
|
|
+ },
|
|
|
|
|
+ search: this.search
|
|
|
|
|
+ };
|
|
|
|
|
+ },
|
|
|
|
|
+ getSearch(search) {
|
|
|
this.search = search;
|
|
this.search = search;
|
|
|
- this.$toast.loading({
|
|
|
|
|
- message: '加载中...',
|
|
|
|
|
- forbidClick: true
|
|
|
|
|
- });
|
|
|
|
|
- this.$http
|
|
|
|
|
- .post(
|
|
|
|
|
- '/collection/all',
|
|
|
|
|
- {
|
|
|
|
|
- page: 0,
|
|
|
|
|
- size: 20,
|
|
|
|
|
- query: {
|
|
|
|
|
- onShelf: true,
|
|
|
|
|
- type: this.type,
|
|
|
|
|
- minterId: this.minterId,
|
|
|
|
|
- del: false
|
|
|
|
|
- },
|
|
|
|
|
- sort: 'createdAt,desc',
|
|
|
|
|
- search: this.search
|
|
|
|
|
- },
|
|
|
|
|
- { body: 'json' }
|
|
|
|
|
- )
|
|
|
|
|
- .then(res => {
|
|
|
|
|
- this.list = res.content;
|
|
|
|
|
- this.empty = res.empty;
|
|
|
|
|
- this.$toast.clear();
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ this.getData(true);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|