瀏覽代碼

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

张延森 5 年之前
父節點
當前提交
8c19e8ee5d

+ 16
- 11
src/onlineSelling/pages/detail/index.js 查看文件

@@ -22,6 +22,7 @@ export default class Index extends Component {
22 22
     grantPhoneVisible: false, // 授权电话
23 23
     grantAvatarVisible: false, // 授权头像
24 24
     houseDetail: null,
25
+    popVisiable: false,
25 26
   }
26 27
 
27 28
 
@@ -76,17 +77,16 @@ export default class Index extends Component {
76 77
     console.log(this.props.userInfo, "this.props")
77 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 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 90
   handleChat(buildingId) {
91 91
     Taro.navigateTo({
92 92
       url: `/pages/card/list/index?buildingId=${buildingId}`
@@ -95,8 +95,8 @@ export default class Index extends Component {
95 95
 
96 96
 
97 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 100
     const address = `${houseDetail.buildingName || ''}${houseDetail.termName || ''}${houseDetail.blockName || ''}${houseDetail.unitName || ''}${houseDetail.floorName || ''}${houseDetail.roomName || ''}`
101 101
 
102 102
     return (
@@ -109,6 +109,11 @@ export default class Index extends Component {
109 109
           grantAvatarVisible &&
110 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 118
         <View className='detail'>
114 119
           <View className='detail-top'>
@@ -150,9 +155,9 @@ export default class Index extends Component {
150 155
               </View>
151 156
               <View style="padding: 0 30rpx;">
152 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 162
                   </View>
158 163
                 }

+ 28
- 0
src/onlineSelling/pages/detail/index.scss 查看文件

@@ -1,5 +1,33 @@
1 1
 @import "@/styles/mixins.scss";
2 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 31
 .detail {
4 32
   position: relative;
5 33
   width: 100%;

+ 18
- 7
src/onlineSelling/pages/houseList/index.js 查看文件

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

+ 1
- 1
src/pages/project/detail/index.js 查看文件

@@ -1307,7 +1307,7 @@ export default class Index extends Component {
1307 1307
 
1308 1308
   // onPause() {
1309 1309
   //   this.setState({
1310
-  //     videoPlayShow: 'flex'e.detail
1310
+  //     videoPlayShow: 'flex'
1311 1311
   //   })
1312 1312
   // }
1313 1313
   renderVideo() {