邓洁:搜索框吸顶

This commit is contained in:
邓洁
2023-11-27 23:47:51 +08:00
parent 096440bbfc
commit 93d2bb04c7
9 changed files with 59 additions and 80 deletions

View File

@@ -5,7 +5,7 @@
<view class="bug-fix"></view>
<view class="search-box">
<view class="search-box-input">
<u-input v-model="keyword" placeholder="热门搜索" placeholder-style="color: #969696" prefixIcon="search"
<u-input v-model="keyword" placeholder="请输入标题进行搜索" placeholder-style="color: #969696" prefixIcon="search"
prefixIconStyle="font-size: 24px;color: #909399;" border="true" @change="getInput">
</u-input>
</view>
@@ -16,7 +16,7 @@
<DropDown @getQueryInfo="getShopList" ref="dropdown" @cancelPageNum="cancelPageNum"></DropDown>
</view>
</view>
<view class="marginLR10">
<ShowShopList :showStyle="2" :adlinkPath="adlinkPath" :listType="3" :shopInfoList="shopInfoList" />
</view>
@@ -64,7 +64,7 @@
},
onReachBottom() {
if (this.shopListLength !== 0) {
this.keyword=''
this.keyword = ''
this.pageNum++
this.getShopList()
console.log("触底加载");
@@ -76,16 +76,16 @@
this.getShopList()
},
methods: {
getInput(val){
console.log('搜索值',val);
if(this.pageNum!==1){
this.pageNum=1
getInput(val) {
console.log('搜索值', val);
if (this.pageNum !== 1) {
this.pageNum = 1
}
const q = this.$u.queryParams({
type: 3,
pageSize: this.pageSize,
pageNum: this.pageNum,
kw:val
kw: val
})
this.$api.getShopList(q).then(res => {
this.shopListLength = res.data.data.length