|
@@ -8,8 +8,8 @@
|
|
|
<view class="sort-list">
|
|
|
<view class="sort-item" :class="{ active: item.check }" v-for="(item, index) in sort" :key="index" @click="select(item, index)">
|
|
|
<text>{{ item.name }}</text>
|
|
|
- <text v-if="index > 0 && item.orderBy == 'desc'" class="icon"></text>
|
|
|
- <text v-if="index > 0 && item.orderBy == 'asc'" class="icon"></text>
|
|
|
+ <text v-if="index > 0 && item.isAsc == 'desc'" class="icon"></text>
|
|
|
+ <text v-if="index > 0 && item.isAsc == 'asc'" class="icon"></text>
|
|
|
</view>
|
|
|
<view class="type" @click="go()">
|
|
|
<text>{{ param.goodsType || '分类' }}</text>
|
|
@@ -43,10 +43,11 @@ export default {
|
|
|
return {
|
|
|
show: false,
|
|
|
user: this.getUser(),
|
|
|
+ isAsc: 'desc',
|
|
|
sort: [
|
|
|
- { name: '综合', sortType: 1, orderBy: 'desc', check: false },
|
|
|
- { name: '日期', sortType: 15, orderBy: 'desc', check: false },
|
|
|
- { name: '价格', sortType: 7, orderBy: 'desc', check: false }
|
|
|
+ { name: '综合', sortName: 'id', isAsc: 'desc', check: false },
|
|
|
+ { name: '日期', sortName: 'create_time', isAsc: 'desc', check: false },
|
|
|
+ { name: '价格', sortName: 'price', isAsc: 'desc', check: false }
|
|
|
],
|
|
|
list: [],
|
|
|
param: { pageNo: 1, pageSize: 10 },
|
|
@@ -68,11 +69,10 @@ export default {
|
|
|
this.sort.forEach(it => (it.check = false));
|
|
|
item.check = true;
|
|
|
if (index > 0) {
|
|
|
- this.orderBy = this.orderBy == 'desc' ? 'asc' : 'desc';
|
|
|
- item.orderBy = this.orderBy;
|
|
|
+ this.isAsc = this.isAsc == 'desc' ? 'asc' : 'desc';
|
|
|
+ item.isAsc = this.isAsc;
|
|
|
}
|
|
|
- this.param.orderBy = item.orderBy;
|
|
|
- this.param.sortType = item.sortType;
|
|
|
+ this.param.orderBy = item.sortName + ' ' + this.isAsc;
|
|
|
this.refresh();
|
|
|
},
|
|
|
getData() {
|
|
@@ -147,4 +147,4 @@ page {
|
|
|
.search {
|
|
|
padding: 12px 12px 0px 12px;
|
|
|
}
|
|
|
-</style>
|
|
|
+</style>
|