1007395918@qq.com 5 лет назад
Родитель
Сommit
3c472a5777
1 измененных файлов: 18 добавлений и 7 удалений
  1. 18
    7
      src/onlineSelling/pages/houseList/index.js

+ 18
- 7
src/onlineSelling/pages/houseList/index.js Просмотреть файл

32
     showShareMenu: false,
32
     showShareMenu: false,
33
     showPoster: false,
33
     showPoster: false,
34
     tipsList: [],
34
     tipsList: [],
35
-    houseList: [],
35
+    houseList: [{}],
36
     id: null,
36
     id: null,
37
     qrcodeParams: {},
37
     qrcodeParams: {},
38
     current: 0,
38
     current: 0,
50
     posterConfig: [],
50
     posterConfig: [],
51
     consultData: {}, // 分享的置业顾问信息
51
     consultData: {}, // 分享的置业顾问信息
52
     consultShow: false,  // 置业顾问悬浮框显示隐藏
52
     consultShow: false,  // 置业顾问悬浮框显示隐藏
53
+    noRecord: false,
54
+
53
   }
55
   }
54
 
56
 
55
   componentDidShow() {
57
   componentDidShow() {
85
     }
87
     }
86
   }
88
   }
87
   initPageData() {
89
   initPageData() {
88
-    Taro.showLoading()
90
+    // Taro.showLoading({ mask: true, title: '加载中...' });
91
+    Taro.showToast({
92
+      title: '加载中...',
93
+      icon: 'loading'
94
+    })
89
     const id = this.$router.params.id
95
     const id = this.$router.params.id
90
 
96
 
91
     if (this.$router.params.scene) {
97
     if (this.$router.params.scene) {
125
     queryHouseList(params).then(res => {
131
     queryHouseList(params).then(res => {
126
       this.setState({
132
       this.setState({
127
         houseList: this.groupHouseList(res) || []
133
         houseList: this.groupHouseList(res) || []
134
+      }, () => {
135
+        Taro.hideToast()
128
       })
136
       })
129
-      Taro.hideLoading()
137
+
138
+
130
     }).catch(err => {
139
     }).catch(err => {
131
-      Taro.hideLoading()
140
+      Taro.hideToast()
132
       Taro.showToast({ title: '未找到房源批次', icon: 'none', duration: 2000 })
141
       Taro.showToast({ title: '未找到房源批次', icon: 'none', duration: 2000 })
133
     })
142
     })
134
   }
143
   }
139
       })
148
       })
140
     })
149
     })
141
     querySalesInfo(id).then(res => {
150
     querySalesInfo(id).then(res => {
151
+
142
       this.setState({
152
       this.setState({
143
         buildingId: res.buildingId,
153
         buildingId: res.buildingId,
144
         salesBatchDetail: res || {},
154
         salesBatchDetail: res || {},
155
+        noRecord: res.status == '1' ? false : true
145
       })
156
       })
146
       const { templates = [], posterImg = '' } = (res.posters || [])[0]
157
       const { templates = [], posterImg = '' } = (res.posters || [])[0]
147
 
158
 
557
     const {
568
     const {
558
       consultData,
569
       consultData,
559
       consultShow,
570
       consultShow,
560
-      salesBatchDetail,
561
       showShareMenu,
571
       showShareMenu,
562
       showPoster,
572
       showPoster,
563
       houseList,
573
       houseList,
564
       conditionVisible,
574
       conditionVisible,
565
       posterData,
575
       posterData,
566
       posterConfig,
576
       posterConfig,
577
+      noRecord,
567
     } = this.state
578
     } = this.state
568
 
579
 
569
     const { userInfo: { person } } = this.props
580
     const { userInfo: { person } } = this.props
581
         }
592
         }
582
         {/* 生成海报 */}
593
         {/* 生成海报 */}
583
         {showPoster && <Poster data={posterData} configs={posterConfig} onCancel={this.togglePosterStatus} onFinish={this.togglePosterStatus} ></Poster>}
594
         {showPoster && <Poster data={posterData} configs={posterConfig} onCancel={this.togglePosterStatus} onFinish={this.togglePosterStatus} ></Poster>}
584
-        {salesBatchDetail.status == "1" ?
595
+        {!noRecord ?
585
           <Block>
596
           <Block>
586
             {!conditionVisible && <Block>
597
             {!conditionVisible && <Block>
587
               <View className="houselist">
598
               <View className="houselist">
588
                 {this.renderBar()}
599
                 {this.renderBar()}
589
-                {!houseList.length ? this.renderBlank() : this.renderHouses()}
600
+                {houseList.length ? this.renderHouses() : this.renderBlank()}
590
                 {this.renderBottom()}
601
                 {this.renderBottom()}
591
               </View>
602
               </View>
592
               {/* 分享按钮 */}
603
               {/* 分享按钮 */}