邹能昇 4 months ago
parent
commit
795d297b7f
1 changed files with 7 additions and 2 deletions
  1. 7 2
      nova-tourism/components/homestay/index.js

+ 7 - 2
nova-tourism/components/homestay/index.js

@@ -105,7 +105,7 @@ Component({
             return `${date.getMonth() + 1}月${date.getDate()}日`;
         },
         //选好日期点击完成后
-        onConfirm(event) {
+     async   onConfirm(event) {
             const [start, end] = event.detail;
             const daysBetween = this.calculateDaysBetween(start, end); // 计算天数差
             this.setData({
@@ -127,7 +127,12 @@ Component({
                 })
                 console.log(this.data.istoday);
             }
-            this.gethomestar()
+            this.setData({
+                loadedItems:0,
+                noMoreItems:false,
+                storeList:[]
+            })
+          await  this.gethomestar()
             console.log(`入住日期: ${this.data.date_start}, 离店日期: ${this.data.date_end}, 天数差: ${daysBetween}天`);
         },
         gourl(e) {