罗世杰:fixed:修复各个使用下拉框处异常请求问题
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<view class="root">
|
||||
<view class="mask" @click="handleMask"></view>
|
||||
<view class="list-container">
|
||||
<view class="item" v-for="(item,index) in list" :key="item" :class="{isActive: activeIndex === index}"
|
||||
<view class="item" v-for="(item,index) in list" :key="item" :class="{isActive: (activeChoose == index)}"
|
||||
@click="handleActive(index)">
|
||||
<text class="list-text">{{item}}</text>
|
||||
</view>
|
||||
@@ -22,10 +22,15 @@
|
||||
}
|
||||
},
|
||||
type: {
|
||||
type: String,
|
||||
default () {
|
||||
return ''
|
||||
}
|
||||
},
|
||||
activeChoose: {
|
||||
type: Number,
|
||||
default () {
|
||||
return 0
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@@ -40,87 +45,75 @@
|
||||
},
|
||||
sendQueryInfo() {
|
||||
console.log(this.queryInfo);
|
||||
console.log(this.type);
|
||||
console.log(this.activeIndex);
|
||||
|
||||
if (this.type === '行业') {
|
||||
|
||||
if(this.list[this.activeIndex] == '全部'){
|
||||
this.queryInfo = {
|
||||
business: ''
|
||||
}
|
||||
}else{
|
||||
this.queryInfo = {
|
||||
business: this.activeIndex
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
if (this.type === '区域') {
|
||||
|
||||
} else if (this.type === '区域') {
|
||||
if(this.list[this.activeIndex] == '全区域'){
|
||||
this.queryInfo = {
|
||||
region: ''
|
||||
}
|
||||
}else{
|
||||
this.queryInfo = {
|
||||
region: this.activeIndex
|
||||
}
|
||||
|
||||
}
|
||||
if (this.type === '面积') {
|
||||
|
||||
}
|
||||
} else if (this.type === '面积') {
|
||||
if(this.list[this.activeIndex] == '任意面积'){
|
||||
this.queryInfo = {
|
||||
areatype: ''
|
||||
}
|
||||
}else {
|
||||
this.queryInfo = {
|
||||
areatype: this.activeIndex
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
if (this.type === '筛选') {
|
||||
|
||||
} else if (this.type === '筛选') {
|
||||
if(this.list[this.activeIndex] == '全部'){
|
||||
this.queryInfo = {
|
||||
sortType: ''
|
||||
}
|
||||
}else{
|
||||
this.queryInfo = {
|
||||
sortType: this.activeIndex
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
// if (this.type === '行业') {
|
||||
// if(this.list[this.activeIndex] == '全部'){
|
||||
// this.queryInfo = {
|
||||
// business: ''
|
||||
// }
|
||||
// }else{
|
||||
// this.queryInfo = {
|
||||
// business: this.activeIndex
|
||||
// }
|
||||
// }
|
||||
|
||||
// } else if (this.type === '区域') {
|
||||
// if(this.list[this.activeIndex] == '全区域'){
|
||||
// this.queryInfo = {
|
||||
// region: ''
|
||||
// }
|
||||
// }else{
|
||||
// this.queryInfo = {
|
||||
// region: this.activeIndex
|
||||
// }
|
||||
// }
|
||||
// } else if (this.type === '面积') {
|
||||
// if(this.list[this.activeIndex] == '任意面积'){
|
||||
// this.queryInfo = {
|
||||
// areatype: ''
|
||||
// }
|
||||
// }else {
|
||||
// this.queryInfo = {
|
||||
// areatype: this.activeIndex
|
||||
// }
|
||||
// }
|
||||
|
||||
// } else if (this.type === '筛选') {
|
||||
// if(this.list[this.activeIndex] == '全部'){
|
||||
// this.queryInfo = {
|
||||
// sortType: ''
|
||||
// }
|
||||
// }else{
|
||||
// this.queryInfo = {
|
||||
// sortType: this.activeIndex
|
||||
// }
|
||||
// }
|
||||
|
||||
// }
|
||||
// 发送queryInfo
|
||||
console.log(this.queryInfo, 'sendqueryInfo');
|
||||
this.$emit('getQueryInfo', this.queryInfo);
|
||||
},
|
||||
resetQueryInfo(){
|
||||
console.log("重置了DropdownItem");
|
||||
this.currentClassActive = 0
|
||||
this.currentRegionActive = 0
|
||||
this.currentAreaActive = 0
|
||||
this.currentFilterActive = 0
|
||||
this.activeIndex = 0
|
||||
this.queryInfo = {
|
||||
region: '',
|
||||
sortType: '',
|
||||
areatype: '',
|
||||
business: ''
|
||||
}
|
||||
},
|
||||
async handleActive(index) {
|
||||
this.activeIndex = index;
|
||||
// 取消当前页面的pageNum参数
|
||||
this.$emit('cancelPageNum');
|
||||
this.sendQueryInfo();
|
||||
// 设置一个定时器,等待200毫秒
|
||||
const delayPromise = this.delay(200);
|
||||
|
||||
Reference in New Issue
Block a user