|
|
@ -18,7 +18,7 @@ |
|
|
|
<view class="searchContent"> |
|
|
|
<view class="searchContent"> |
|
|
|
<u-search :showAction="true" |
|
|
|
<u-search :showAction="true" |
|
|
|
actionText="搜索" |
|
|
|
actionText="搜索" |
|
|
|
placeholder="输入搜索内容" |
|
|
|
placeholder="请输入" |
|
|
|
style="padding:16upx 25upx;" |
|
|
|
style="padding:16upx 25upx;" |
|
|
|
bgColor="#F3F5F7" |
|
|
|
bgColor="#F3F5F7" |
|
|
|
v-if="noSearch" |
|
|
|
v-if="noSearch" |
|
|
@ -92,14 +92,18 @@ export default{ |
|
|
|
disabled:true, |
|
|
|
disabled:true, |
|
|
|
noSearch:true, |
|
|
|
noSearch:true, |
|
|
|
contentList:[], |
|
|
|
contentList:[], |
|
|
|
typedata:null |
|
|
|
typedata:null, |
|
|
|
|
|
|
|
originListRow:[], |
|
|
|
|
|
|
|
page:1, |
|
|
|
|
|
|
|
limit:20, |
|
|
|
|
|
|
|
total:0, |
|
|
|
|
|
|
|
wx_category_id:null |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
components: { |
|
|
|
components: { |
|
|
|
wybDropDown |
|
|
|
wybDropDown |
|
|
|
}, |
|
|
|
}, |
|
|
|
onLoad(option) { |
|
|
|
onLoad(option) { |
|
|
|
console.log(option,"uuu") |
|
|
|
|
|
|
|
this.catagoryId = option.id |
|
|
|
this.catagoryId = option.id |
|
|
|
this.typedata = option.typedata |
|
|
|
this.typedata = option.typedata |
|
|
|
this.getListData(option.id) |
|
|
|
this.getListData(option.id) |
|
|
@ -107,16 +111,22 @@ export default{ |
|
|
|
methods:{ |
|
|
|
methods:{ |
|
|
|
getContent(val){ |
|
|
|
getContent(val){ |
|
|
|
this.catagoryName = val; |
|
|
|
this.catagoryName = val; |
|
|
|
|
|
|
|
this.page=1 |
|
|
|
this.getListData(this.catagoryId) |
|
|
|
this.getListData(this.catagoryId) |
|
|
|
}, |
|
|
|
}, |
|
|
|
searchHandle(){ |
|
|
|
searchHandle(){ |
|
|
|
|
|
|
|
this.page=1 |
|
|
|
this.getListData(this.catagoryId) |
|
|
|
this.getListData(this.catagoryId) |
|
|
|
}, |
|
|
|
}, |
|
|
|
getListData(id){ |
|
|
|
getListData(id){ |
|
|
|
let params={ |
|
|
|
let params={ |
|
|
|
wx_menu_id:id, |
|
|
|
wx_menu_id:id, |
|
|
|
typedata:this.typedata, |
|
|
|
typedata:this.typedata, |
|
|
|
name:this.catagoryName |
|
|
|
name:this.catagoryName, |
|
|
|
|
|
|
|
page:this.page, |
|
|
|
|
|
|
|
limit:this.limit, |
|
|
|
|
|
|
|
wx_category_id:this.wx_category_id, |
|
|
|
|
|
|
|
sort:'weigh' |
|
|
|
} |
|
|
|
} |
|
|
|
listData(params).then(res=>{ |
|
|
|
listData(params).then(res=>{ |
|
|
|
if(res.searchList.length==0){ |
|
|
|
if(res.searchList.length==0){ |
|
|
@ -126,6 +136,35 @@ export default{ |
|
|
|
this.tagList = res.searchList |
|
|
|
this.tagList = res.searchList |
|
|
|
this.noSearch = false; |
|
|
|
this.noSearch = false; |
|
|
|
this.contentList = res.rows; |
|
|
|
this.contentList = res.rows; |
|
|
|
|
|
|
|
this.originListRow = res.rows; |
|
|
|
|
|
|
|
this.total = res.total; |
|
|
|
|
|
|
|
this.contentList.forEach(item=>{ |
|
|
|
|
|
|
|
let subobj = res.searchList.filter(i=>{ |
|
|
|
|
|
|
|
return item.wx_category_id==i.id |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
this.$set(item,'subName',subobj[0].name) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
getListData1(id){ |
|
|
|
|
|
|
|
let params={ |
|
|
|
|
|
|
|
wx_menu_id:id, |
|
|
|
|
|
|
|
typedata:this.typedata, |
|
|
|
|
|
|
|
name:this.catagoryName, |
|
|
|
|
|
|
|
page:this.page, |
|
|
|
|
|
|
|
limit:this.limit, |
|
|
|
|
|
|
|
wx_category_id:this.wx_category_id |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
listData(params).then(res=>{ |
|
|
|
|
|
|
|
if(res.searchList.length==0){ |
|
|
|
|
|
|
|
this.noSearch = true; |
|
|
|
|
|
|
|
this.contentList = res.rows |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
this.tagList = res.searchList |
|
|
|
|
|
|
|
this.noSearch = false; |
|
|
|
|
|
|
|
this.contentList.push(...res.rows); |
|
|
|
|
|
|
|
this.originListRow = res.rows; |
|
|
|
this.contentList.forEach(item=>{ |
|
|
|
this.contentList.forEach(item=>{ |
|
|
|
let subobj = res.searchList.filter(i=>{ |
|
|
|
let subobj = res.searchList.filter(i=>{ |
|
|
|
return item.wx_category_id==i.id |
|
|
|
return item.wx_category_id==i.id |
|
|
@ -137,12 +176,23 @@ export default{ |
|
|
|
}, |
|
|
|
}, |
|
|
|
clickSearchItem(item,index){ |
|
|
|
clickSearchItem(item,index){ |
|
|
|
console.log(item,index,"--==") |
|
|
|
console.log(item,index,"--==") |
|
|
|
this.options[0].header = item.name; |
|
|
|
this.page = 1 |
|
|
|
|
|
|
|
if(this.active==index){ |
|
|
|
this.active=index; |
|
|
|
this.options[0].header = '国家地区选择' |
|
|
|
this.contentList.filter(i=>{ |
|
|
|
this.active=-1; |
|
|
|
return i.wx_category_id == item.id |
|
|
|
this.wx_category_id = null, |
|
|
|
}) |
|
|
|
// this.contentList = this.originListRow |
|
|
|
|
|
|
|
this.getListData(this.catagoryId) |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
this.options[0].header = item.name; |
|
|
|
|
|
|
|
this.active=index; |
|
|
|
|
|
|
|
// let afterList = this.originListRow.filter(i=>{ |
|
|
|
|
|
|
|
// return i.wx_category_id == item.id |
|
|
|
|
|
|
|
// }) |
|
|
|
|
|
|
|
// this.contentList = afterList |
|
|
|
|
|
|
|
this.wx_category_id = item.id |
|
|
|
|
|
|
|
this.getListData(this.catagoryId) |
|
|
|
|
|
|
|
} |
|
|
|
this.$refs.dropDown.close() |
|
|
|
this.$refs.dropDown.close() |
|
|
|
}, |
|
|
|
}, |
|
|
|
clickHandle(){ |
|
|
|
clickHandle(){ |
|
|
@ -159,10 +209,22 @@ export default{ |
|
|
|
|
|
|
|
|
|
|
|
goNextSection(item){ |
|
|
|
goNextSection(item){ |
|
|
|
uni.navigateTo({ |
|
|
|
uni.navigateTo({ |
|
|
|
url:'/pages/detail/detail?id='+item.wx_category_id |
|
|
|
url:'/pages/detail/detail?id='+item.id |
|
|
|
|
|
|
|
// url:'/pages/detail/detail?id='+item.wx_category_id |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
onReachBottom(){ |
|
|
|
|
|
|
|
console.log('已触底'); |
|
|
|
|
|
|
|
if(this.contentList.length<this.total){ |
|
|
|
|
|
|
|
this.page++; |
|
|
|
|
|
|
|
this.getListData1(this.catagoryId) |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|