Browse Source

Merge branch 'dev' of http://git.ycjcjy.com/zhiyuxing/miniapp-v3 into dev

张延森 5 years ago
parent
commit
8c19e8ee5d

+ 16
- 11
src/onlineSelling/pages/detail/index.js View File

22
     grantPhoneVisible: false, // 授权电话
22
     grantPhoneVisible: false, // 授权电话
23
     grantAvatarVisible: false, // 授权头像
23
     grantAvatarVisible: false, // 授权头像
24
     houseDetail: null,
24
     houseDetail: null,
25
+    popVisiable: false,
25
   }
26
   }
26
 
27
 
27
 
28
 
76
     console.log(this.props.userInfo, "this.props")
77
     console.log(this.props.userInfo, "this.props")
77
     return true
78
     return true
78
   }
79
   }
79
-  chooseBtn(id, buildingId) {
80
-    Taro.navigateTo({
81
-      url: `/onlineSelling/pages/detail/resultPage?type=add&id=${id}&buildingId=${buildingId}`
82
-    })
83
-  }
84
-  cancelChooseBtn(id, buildingId) {
80
+
81
+  chooseBtn(type) {
82
+    const { houseDetail: { houseId, buildingId } } = this.state
85
     Taro.navigateTo({
83
     Taro.navigateTo({
86
-      url: `/onlineSelling/pages/detail/resultPage?type=cancel&id=${id}&buildingId=${buildingId}`
84
+      url: `/onlineSelling/pages/detail/resultPage?type=${type}&id=${houseId}&buildingId=${buildingId}`
87
     })
85
     })
86
+    this.setState({ popVisiable: false })
88
   }
87
   }
89
 
88
 
89
+
90
   handleChat(buildingId) {
90
   handleChat(buildingId) {
91
     Taro.navigateTo({
91
     Taro.navigateTo({
92
       url: `/pages/card/list/index?buildingId=${buildingId}`
92
       url: `/pages/card/list/index?buildingId=${buildingId}`
95
 
95
 
96
 
96
 
97
   render() {
97
   render() {
98
-    const { grantPhoneVisible, grantAvatarVisible, houseDetail, buildingImgList } = this.state
99
-    const { userInfo = { person: {} } } = this.props
98
+    const { grantPhoneVisible, grantAvatarVisible, houseDetail, buildingImgList, popVisiable } = this.state
99
+    const { userInfo } = this.props
100
     const address = `${houseDetail.buildingName || ''}${houseDetail.termName || ''}${houseDetail.blockName || ''}${houseDetail.unitName || ''}${houseDetail.floorName || ''}${houseDetail.roomName || ''}`
100
     const address = `${houseDetail.buildingName || ''}${houseDetail.termName || ''}${houseDetail.blockName || ''}${houseDetail.unitName || ''}${houseDetail.floorName || ''}${houseDetail.roomName || ''}`
101
 
101
 
102
     return (
102
     return (
109
           grantAvatarVisible &&
109
           grantAvatarVisible &&
110
           <AchieveAvatar user={userInfo.person} onSuccess={() => { this.setState({ grantAvatarVisible: false }) }} ></AchieveAvatar>
110
           <AchieveAvatar user={userInfo.person} onSuccess={() => { this.setState({ grantAvatarVisible: false }) }} ></AchieveAvatar>
111
         }
111
         }
112
+        {popVisiable && <View className="pop-box">
113
+          <View className="title" >{!houseDetail.isPreselect ? `确认使用手机号${userInfo.person.phone || userInfo.person.tel}预选此房源?` : '确认取消预选此房源?'}</View>
114
+          <View className="sure" onClick={!houseDetail.isPreselect ? () => this.chooseBtn('add') : () => this.chooseBtn('cancel')}>确定</View>
115
+          <View className="cancel" onClick={() => this.setState({ popVisiable: false })}>取消</View>
116
+        </View>}
112
 
117
 
113
         <View className='detail'>
118
         <View className='detail'>
114
           <View className='detail-top'>
119
           <View className='detail-top'>
150
               </View>
155
               </View>
151
               <View style="padding: 0 30rpx;">
156
               <View style="padding: 0 30rpx;">
152
                 {!houseDetail.isPreselect ?
157
                 {!houseDetail.isPreselect ?
153
-                  <View className="choose-btn" onClick={() => this.chooseBtn(houseDetail.houseId, houseDetail.buildingId)}>
158
+                  <View className="choose-btn" onClick={() => this.setState({ popVisiable: true })}>
154
                     预选此房源
159
                     预选此房源
155
-                  </View> : <View className="choose-btn" onClick={() => this.cancelChooseBtn(houseDetail.houseId, houseDetail.buildingId)}>
160
+                  </View> : <View className="choose-btn" onClick={() => this.setState({ popVisiable: true })}>
156
                     取消预选
161
                     取消预选
157
                   </View>
162
                   </View>
158
                 }
163
                 }

+ 28
- 0
src/onlineSelling/pages/detail/index.scss View File

1
 @import "@/styles/mixins.scss";
1
 @import "@/styles/mixins.scss";
2
 @import "@/styles/theme.scss";
2
 @import "@/styles/theme.scss";
3
+.pop-box{
4
+  position: fixed;
5
+  bottom: 0;
6
+  width: 100%;
7
+  z-index: 999;
8
+  text-align: center;
9
+  background-color: #fff;
10
+  box-shadow: 0px -2px 10px rgb(189, 187, 187);
11
+  .title{
12
+    line-height: 130px;
13
+    font-size: 26px;
14
+    color: #666;
15
+    border-bottom: 2px solid rgba(26,22,22,0.32);
16
+  
17
+  }
18
+  .sure{
19
+    line-height: 94px;
20
+    font-size: 36px;
21
+    color: $primary-color;
22
+    border-bottom: 2px solid rgba(26,22,22,0.32);
23
+  }
24
+  .cancel{
25
+    line-height: 94px;
26
+    font-size: 36px;
27
+    color: #999;
28
+  }
29
+
30
+}
3
 .detail {
31
 .detail {
4
   position: relative;
32
   position: relative;
5
   width: 100%;
33
   width: 100%;

+ 18
- 7
src/onlineSelling/pages/houseList/index.js View File

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
               {/* 分享按钮 */}

+ 1
- 1
src/pages/project/detail/index.js View File

1307
 
1307
 
1308
   // onPause() {
1308
   // onPause() {
1309
   //   this.setState({
1309
   //   this.setState({
1310
-  //     videoPlayShow: 'flex'e.detail
1310
+  //     videoPlayShow: 'flex'
1311
   //   })
1311
   //   })
1312
   // }
1312
   // }
1313
   renderVideo() {
1313
   renderVideo() {