uniapp api获取的排序参数如何使用筛选条件改变参数值
下面是html部分代码
<zb-dropdown-menu style="width: 100%">
<zb-dropdown-item :options="option" v-model="value1" @change="change1"></zb-dropdown-item>
<zb-dropdown-item :options="option2" v-model="value2" @change="change2"></zb-dropdown-item>
<zb-dropdown-item :options="option3" v-model="value3" @change="change3"></zb-dropdown-item>
</zb-dropdown-menu>
下面是JS部分代码
export default {
data() {
return {
List: [],
px: '0',
sousuo: [],
pageId: 1,
value1: 0,
value2: 'a',
value3: 4,
option: [{
text: '综合',
value: 0
},
{
text: '只看有券',
value: 1
},
{
text: '优惠券升序',
value: 2
},
{
text: '优惠券降序',
value: 3
}
],
option2: [{
text: '价格',
value: 'a'
},
{
text: '价格升序',
value: 'b'
},
{
text: '价格降序',
value: 'c'
},
],
option3: [{
text: '销量',
value: 4
},
{
text: '销量升序',
value: 5
},
{
text: '销量降序',
value: 6
},
],
title: 'Hello'
}
},
onLoad: function(e) { //页面加载事件//
console.log(e.vvv)
console.log(e.sort)
var that = this;
var obj = 0;
var obj = this.px;
this.sousuo = decodeURIComponent(e.vvv)
uni.request({
url: 'https://openapi.dataoke.com/api/goods/list-super-goods',
method: "GET",
data: {
appKey: '6736a7b20e87c',
type: 0,
version: 'v1.3.0',
pageId: 1,
keyWords: e.vvv, //搜索词
pageSize: 20,
sort: obj, //改代码为0时是综合排序 1为销量从高到低排序
},
header: {
},
success: (res) => {
console.log(res.data);
that.List = res.data.data.list;
},
});
},
如何让chenge1按钮点击切换后 改变sort的值 并且让排序数据