|
|
@@ -10,15 +10,13 @@
|
|
|
:ellipsis="false"
|
|
|
line-width="16"
|
|
|
line-height="2"
|
|
|
- @change="getData(true)"
|
|
|
+ @click-tab="changeTab"
|
|
|
:class="{ trans: source == 'TRANSFER' }"
|
|
|
>
|
|
|
<van-tab
|
|
|
:title="item.label"
|
|
|
- :name="
|
|
|
- item.type === 'select' ? (sort === item.value[0] ? item.value[1] : item.value[0]) : item.value
|
|
|
- "
|
|
|
- :title-class="item.type === 'select' && sort === item.value[0] ? '' : 'asc'"
|
|
|
+ :name="item.value"
|
|
|
+ :title-class="item.type === 'select' && sortDes ? sortDes : ''"
|
|
|
:key="index"
|
|
|
v-for="(item, index) in selectOptions"
|
|
|
>
|
|
|
@@ -64,6 +62,7 @@ export default {
|
|
|
list: [],
|
|
|
empty: false,
|
|
|
sort: 'id,desc',
|
|
|
+ sortDes: '',
|
|
|
type: '',
|
|
|
source: '',
|
|
|
minterId: '',
|
|
|
@@ -82,7 +81,7 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
label: '价格',
|
|
|
- value: ['price,desc', 'price,asc'],
|
|
|
+ value: 'price',
|
|
|
type: 'select'
|
|
|
}
|
|
|
],
|
|
|
@@ -106,6 +105,8 @@ export default {
|
|
|
if (this.$route.query.source) {
|
|
|
this.source = this.$route.query.source;
|
|
|
this.salable = true;
|
|
|
+ this.sort = 'price';
|
|
|
+ this.sortDes = 'asc';
|
|
|
}
|
|
|
|
|
|
if (this.$route.query.minterId) {
|
|
|
@@ -121,7 +122,19 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ changeTab(info) {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ if (info.name === 'price') {
|
|
|
+ this.sortDes = this.sortDes == 'desc' ? 'asc' : 'desc';
|
|
|
+ }
|
|
|
+ this.getData(true);
|
|
|
+ });
|
|
|
+ },
|
|
|
beforeData() {
|
|
|
+ let sort = this.sort;
|
|
|
+ if (sort == 'price') {
|
|
|
+ sort = 'price,' + this.sortDes;
|
|
|
+ }
|
|
|
return {
|
|
|
query: {
|
|
|
type: this.type,
|
|
|
@@ -131,7 +144,7 @@ export default {
|
|
|
minterId: this.minterId,
|
|
|
salable: this.salable || ''
|
|
|
},
|
|
|
- sort: this.sort === 'id,desc' ? this.sortOptions[this.title] || this.sort : this.sort
|
|
|
+ sort: sort === 'id,desc' ? this.sortOptions[this.title] || sort : sort
|
|
|
};
|
|
|
},
|
|
|
goSearch() {
|