|
|
@@ -25,10 +25,8 @@
|
|
|
<van-tabs v-model:active="type" line-width="16" line-height="2" :ellipsis="false" @click="changeTab">
|
|
|
<van-tab
|
|
|
:title="item.label"
|
|
|
- :name="
|
|
|
- item.type === 'select' ? (type === item.value[0] ? item.value[1] : item.value[0]) : item.value
|
|
|
- "
|
|
|
- :title-class="item.type === 'select' && type === item.value[0] ? '' : 'asc'"
|
|
|
+ :name="item.value"
|
|
|
+ :title-class="item.type === 'select' && sortDes ? sortDes : ''"
|
|
|
:key="index"
|
|
|
v-for="(item, index) in typeOptions"
|
|
|
>
|
|
|
@@ -112,7 +110,8 @@ export default {
|
|
|
page: 0,
|
|
|
name1: '',
|
|
|
name: '',
|
|
|
- scrollTop: 0
|
|
|
+ scrollTop: 0,
|
|
|
+ sortDes: ''
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -121,38 +120,44 @@ export default {
|
|
|
return [
|
|
|
{
|
|
|
label: '全部',
|
|
|
- value: ''
|
|
|
+ value: '',
|
|
|
+ type: ''
|
|
|
},
|
|
|
{
|
|
|
label: '寄售',
|
|
|
- value: 'ON_SALE'
|
|
|
+ value: 'ON_SALE',
|
|
|
+ type: ''
|
|
|
},
|
|
|
{
|
|
|
label: '仅展示',
|
|
|
- value: 'NORMAL'
|
|
|
+ value: 'NORMAL',
|
|
|
+ type: ''
|
|
|
}
|
|
|
];
|
|
|
} else if (this.active === 'creator') {
|
|
|
return [
|
|
|
{
|
|
|
label: '全部',
|
|
|
- value: 'createdAt,desc'
|
|
|
- },
|
|
|
- {
|
|
|
- label: '价格',
|
|
|
- value: ['sellPrice,desc', 'sellPrice,asc'],
|
|
|
- type: 'select'
|
|
|
+ value: 'createdAt,desc',
|
|
|
+ type: ''
|
|
|
}
|
|
|
+ // {
|
|
|
+ // label: '价格',
|
|
|
+ // value: 'price',
|
|
|
+ // type: 'select'
|
|
|
+ // }
|
|
|
];
|
|
|
} else {
|
|
|
return [
|
|
|
{
|
|
|
label: '未使用',
|
|
|
- value: 'CAN_USE'
|
|
|
+ value: 'CAN_USE',
|
|
|
+ type: ''
|
|
|
},
|
|
|
{
|
|
|
label: '不可用',
|
|
|
- value: 'CANNOT_USE'
|
|
|
+ value: 'CANNOT_USE',
|
|
|
+ type: ''
|
|
|
}
|
|
|
];
|
|
|
}
|
|
|
@@ -254,7 +259,7 @@ export default {
|
|
|
let form = {
|
|
|
page: this.page,
|
|
|
size: 20,
|
|
|
- sort: this.sort,
|
|
|
+ sort: this.sort === 'price' ? this.sort + this.sortDes : this.sort,
|
|
|
query: {
|
|
|
userId: this.$store.state.userInfo.id,
|
|
|
...this.beforeQuery()
|
|
|
@@ -314,7 +319,10 @@ export default {
|
|
|
});
|
|
|
}, 100);
|
|
|
},
|
|
|
- changeTab() {
|
|
|
+ changeTab(info) {
|
|
|
+ if (info.name === 'price') {
|
|
|
+ this.sortDes = this.sortDes == 'desc' ? 'asc' : 'desc';
|
|
|
+ }
|
|
|
if (this.active !== 'coupon') {
|
|
|
this.loading = true;
|
|
|
this.page = 0;
|