完成湖畔好店的搜索功能

This commit is contained in:
赵毅 2025-10-11 11:16:23 +08:00
parent c765dd65da
commit 3c26c8c1a0

View File

@ -15,7 +15,7 @@
<image
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_communitySearchIcon.png"
mode="aspectFill"></image>
<input type="text" placeholder="请输入您想搜索的内容" />
<input type="text" v-model="searchText" placeholder="请输入您想搜索的内容" @confirm="handleSearch" />
</view>
</view>
</view>
@ -141,6 +141,7 @@ export default {
page_num: 1,
flag: false,
merchatList: [],
searchText: ''
};
},
onLoad(options) {
@ -196,12 +197,19 @@ export default {
}
});
},
//
handleSearch() {
this.page_num = 1;
this.merchatList = [];
this.getMechantList();
},
//
async getMechantList() {
let that = this;
await request(apiArr.getMerchantList, "POST", {
page_num: that.page_num,
page_size: that.page_size,
merchant_name: that.searchText
}).then((res) => {
let latitude = uni.getStorageSync("location").lat;
let longitude = uni.getStorageSync("location").lng;