邹能昇 4 months ago
parent
commit
de57a812f2

+ 9 - 1
nova-tourism/components/homestay/index.js

@@ -320,9 +320,17 @@ Component({
             const value = e.detail;
             if (!value) {
                 console.log('运行');
-                this.gethomestar()
+                this.clear()
             }
         },
+        clear(){
+            this.setData({
+                loadedItems:0,
+                noMoreItems:false,
+                storeList:[]
+            })
+            this.gethomestar()
+        },
         // 搜索函数
         async getRooms(value) {
             // 确保 value 不为空

+ 1 - 1
nova-tourism/components/homestay/index.wxml

@@ -7,7 +7,7 @@
         <!-- 日期 -->
         <view class="infobox">
             <view class="seach">
-                <van-search shape="round" model:value="{{ value }}" placeholder="请输入地点/门店名称/关键词" bind:search="search" bind:change="change" />
+                <van-search shape="round" model:value="{{ value }}" placeholder="请输入地点/门店名称/关键词" bind:search="search" bind:change="change" bind:clear='clear'/>
             </view>
             <view class="datebox" bindtap="onDisplay">
                 <view class="start">{{date_start}}</view>