This commit is contained in:
zmj 2024-06-25 16:07:40 +08:00
parent e5d13a791f
commit 754bac1994
1 changed files with 28 additions and 4 deletions

View File

@ -117,8 +117,17 @@
<view class="order-by"> <view class="order-by">
<view class="item" :class="{ 'order-active': where.order == '' }" @click="changeOrder('')">综合 <view class="item" :class="{ 'order-active': where.order == '' }" @click="changeOrder('')">综合
</view> </view>
<view class="item" :class="{ 'order-active': where.order == 'desc' || where.order == 'asc' }" <view class="item" style="display: flex;align-items: center;"
@click="changeOrder(where.order == 'asc' ? 'desc' : 'asc')">价格</view> :class="{ 'order-active': where.order == 'desc' || where.order == 'asc' }"
@click="changeOrder(where.order == 'asc' ? 'desc' : 'asc')">
价格
<view style="color: black;">
<up-icon name="arrow-up-fill" :color="where.order=='asc'?'#20b128':'' "
size="8"></up-icon>
<up-icon name="arrow-down-fill" :color="where.order=='desc'?'#20b128':'' "
size="8"></up-icon>
</view>
</view>
<view class="item" :class="{ 'order-active': where.order == 'sales' }" <view class="item" :class="{ 'order-active': where.order == 'sales' }"
@click="changeOrder('sales')">销量 @click="changeOrder('sales')">销量
</view> </view>
@ -158,7 +167,8 @@
</view> </view>
</view> </view>
<view class="title"> <view class="title">
<view class="name u-line-2"><text> 原价:</text> {{ item.store_name }}</view> <view style="color: #999999;font-size: 22rpx;"><text> &ensp; :</text>44.00
</view>
</view> </view>
<view style="display: flex;" v-if='item.batch > 0'> <view style="display: flex;" v-if='item.batch > 0'>
<view style="color: red;">规格: {{ item.price }}/{{ item.unit_name }}</view> <view style="color: red;">规格: {{ item.price }}/{{ item.unit_name }}</view>
@ -354,6 +364,19 @@
} }
const changeOrder = (order) => { const changeOrder = (order) => {
switch (order) {
case 'asc':
where.value.field = 'price'
break;
case 'desc':
where.value.field = 'price'
break;
case 'sales':
where.value.field = 'sales'
break;
default:
where.value.field = ''
}
where.value.order = order; where.value.order = order;
getGoodList(); getGoodList();
} }
@ -364,7 +387,8 @@
name: '', name: '',
order: '', order: '',
store_name: '', store_name: '',
store_id: '' store_id: '',
field: "",
}) })
const loading = ref(true); const loading = ref(true);