邓洁 : 修改搜索框bug

This commit is contained in:
dengj
2023-11-22 10:41:43 +08:00
parent 424d0bb7fa
commit 4bd637e4e9
8 changed files with 81 additions and 29 deletions

View File

@@ -4,7 +4,7 @@
<view class="bug-fix"></view>
<view class="search-box">
<view class="search-box-input">
<u-input 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>
@@ -33,12 +33,13 @@
data() {
return {
shopInfoList: [],
pageSize: 5,
pageSize: 3,
pageNum: 1,
customQuery: {},
shopListLength: '',
showNull: false,
refresh: false
refresh: false,
keyword: ''
}
},
onPullDownRefresh() {
@@ -58,6 +59,7 @@
},
onReachBottom() {
if (!this.refresh && this.shopListLength !== 0) {
this.keyword=''
this.pageNum++
this.getShopList()
console.log("触底加载");
@@ -69,16 +71,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: 1,
pageSize: this.pageSize,
pageNum: this.pageNum,
kw:val
kw: val
})
this.$api.getShopList(q).then(res => {
this.shopListLength = res.data.data.length