|
|
@@ -7,12 +7,13 @@
|
|
|
line-width="16"
|
|
|
line-height="2"
|
|
|
:ellipsis="false"
|
|
|
+ @change="changeType"
|
|
|
>
|
|
|
<van-tab :title="item.label" :name="item.value" :key="index" v-for="(item, index) in typeOptions">
|
|
|
</van-tab>
|
|
|
</van-tabs>
|
|
|
|
|
|
- <div class="price-sort">
|
|
|
+ <div class="price-sort" :class="[{ prim: sort === 'price' }, priceSort]" @click="changeSort">
|
|
|
<span>价格排序</span>
|
|
|
<van-icon size="8" name="arrow-up" />
|
|
|
<van-icon size="8" name="arrow-down" />
|
|
|
@@ -86,7 +87,8 @@ export default {
|
|
|
url: '/order/newestOrder',
|
|
|
isFormData: true,
|
|
|
size: 2,
|
|
|
- sort: 'payTime,desc'
|
|
|
+ sort: 'payTime,desc',
|
|
|
+ priceSort: 'asc'
|
|
|
};
|
|
|
},
|
|
|
mixins: [list, product],
|
|
|
@@ -94,6 +96,12 @@ export default {
|
|
|
this.getStatics();
|
|
|
},
|
|
|
methods: {
|
|
|
+ changeType(type) {
|
|
|
+ console.log(type);
|
|
|
+ this.sort = 'payTime,desc';
|
|
|
+ this.getData(true);
|
|
|
+ this.getStatics();
|
|
|
+ },
|
|
|
getStatics() {
|
|
|
this.$http
|
|
|
.post('/order/domainOrderStatistic', {
|
|
|
@@ -106,8 +114,22 @@ export default {
|
|
|
beforeData() {
|
|
|
return {
|
|
|
type: this.type,
|
|
|
- sort: this.sort
|
|
|
+ sort: this.sort === 'price' ? this.sort + ',' + this.priceSort : this.sort
|
|
|
};
|
|
|
+ },
|
|
|
+ changeSort() {
|
|
|
+ console.log(this.sort);
|
|
|
+ if (this.sort === 'price') {
|
|
|
+ if (this.priceSort === 'asc') {
|
|
|
+ this.priceSort = 'desc';
|
|
|
+ } else {
|
|
|
+ this.sort = 'payTime,desc';
|
|
|
+ this.priceSort = 'asc';
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.sort = 'price';
|
|
|
+ }
|
|
|
+ this.getData(true);
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
@@ -122,7 +144,9 @@ export default {
|
|
|
background-color: #161414;
|
|
|
}
|
|
|
.tabs {
|
|
|
- position: relative;
|
|
|
+ position: sticky;
|
|
|
+ z-index: 20;
|
|
|
+ top: calc(var(--safe-top) + 46px);
|
|
|
}
|
|
|
.price-sort {
|
|
|
position: absolute;
|
|
|
@@ -146,6 +170,31 @@ export default {
|
|
|
bottom: 12px;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ &.prim {
|
|
|
+ color: #00fe1e;
|
|
|
+ font-weight: bold;
|
|
|
+
|
|
|
+ &.desc {
|
|
|
+ .van-icon {
|
|
|
+ &.van-icon-arrow-down {
|
|
|
+ color: #00fe1e;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ &.asc {
|
|
|
+ .van-icon {
|
|
|
+ &.van-icon-arrow-up {
|
|
|
+ color: #00fe1e;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ &::after {
|
|
|
+ width: 34px;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
.datas-box {
|