Pārlūkot izejas kodu

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

张延森 5 gadus atpakaļ
vecāks
revīzija
3cba24b4dd

+ 2
- 2
config/dev.js Parādīt failu

@@ -9,8 +9,8 @@ module.exports = {
9 9
     WSS_HOST: '"wss://dev.jinchengjiaye.com"',
10 10
     // HOST: '"https://lt.pawoma.cn"',
11 11
     // WSS_HOST: '"wss://lt.pawoma.cn"',
12
-    // HOST: '"http://192.168.2.52:8080"',
13
-    // WSS_HOST: '"ws://192.168.2.52:8080"',
12
+    // HOST: '"http://192.168.2.51:8080"',
13
+    // WSS_HOST: '"ws://192.168.2.51:8080"',
14 14
     Version: 'V3.5.5'
15 15
   },
16 16
   weapp: {},

+ 14
- 14
src/pages/card/list/index.js Parādīt failu

@@ -19,7 +19,7 @@ export default class Index extends Component {
19 19
     hasMore: true,
20 20
     isEmpty: false,
21 21
     recordId: null,
22
-    pageIndex:1
22
+    pageIndex: 1
23 23
   }
24 24
   componentWillMount() {
25 25
     savePoint({
@@ -61,27 +61,27 @@ export default class Index extends Component {
61 61
   }
62 62
 
63 63
   handleChatClick(item, e) {
64
-    console.log(item,"item")
65
-    console.log(e,"eeeeeeeeeeeeeeeeeeeeeeeeeee")
64
+    console.log(item, "item")
65
+    console.log(e, "eeeeeeeeeeeeeeeeeeeeeeeeeee")
66 66
     e && e.stopPropagation()
67 67
     const { userInfo: { person: { personId, nickname, name } } } = this.props
68 68
     const { userInfo: { miniApp: { tpls } } } = this.props
69
-    const tplId=(tpls.filter(x => x.tplType == noticeType.TPL_NOTICE&&x.isSubscribe == true))[0].tplId
69
+    const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_NOTICE && x.isSubscribe == true))[0].tplId
70 70
     wx.requestSubscribeMessage({
71 71
       tmplIds: [tplId],
72
-      success (res) {
72
+      success(res) {
73 73
 
74 74
       },
75
-      fail(res){
75
+      fail(res) {
76 76
 
77 77
       },
78
-      complete(){
78
+      complete() {
79 79
         // App.zhuge.track('查看置业顾问列表')
80 80
         Taro.navigateTo({
81 81
           url: `/pages/im/index?sendId=${personId}&sendName=${encodeURIComponent(name || nickname)}&receiverId=${item.id}&receiverName=${encodeURIComponent(item.name)}`
82 82
         })
83 83
       }
84
-    })   
84
+    })
85 85
 
86 86
   }
87 87
 
@@ -102,7 +102,7 @@ export default class Index extends Component {
102 102
   }
103 103
 
104 104
   loadList(pageNumber) {
105
- 
105
+
106 106
     const { buildingId } = this.$router.params
107 107
     const payload = { pageSize: 10, pageNumber, buildingId: '' }
108 108
     if (buildingId) {
@@ -117,7 +117,7 @@ export default class Index extends Component {
117 117
       list,
118 118
       isEmpty: total == 0,
119 119
       hasMore: list.length >= total ? false : true,
120
-      pageIndex:1
120
+      pageIndex: 1
121 121
     })
122 122
     rest && rest()
123 123
   }
@@ -125,12 +125,12 @@ export default class Index extends Component {
125 125
   onScrollToLower = async (fn) => {
126 126
     const { list } = this.state;
127 127
     pageIndex++
128
-    const { records, total } = await this.loadList(this.state.pageIndex+1);
128
+    const { records, total } = await this.loadList(this.state.pageIndex + 1);
129 129
     const newList = list.concat(records)
130 130
     this.setState({
131 131
       list: newList,
132 132
       hasMore: newList.length >= total ? false : true,
133
-      pageIndex:this.state.pageIndex+1
133
+      pageIndex: this.state.pageIndex + 1
134 134
     });
135 135
     fn && fn();
136 136
   }
@@ -157,7 +157,7 @@ export default class Index extends Component {
157 157
               <View className='item-main' key={item.id} onClick={this.handleConsuItemClick.bind(this, item)}>
158 158
                 <View className="item">
159 159
                   <View className="flex">
160
-                  <Image className="avatar" mode="aspectFill" src={item.photo || item.avatar}></Image>
160
+                    <Image className="avatar" mode="aspectFill" src={item.photo || item.avatar}></Image>
161 161
 
162 162
                     <View className='info'>
163 163
                       <View className='name-info'>
@@ -186,7 +186,7 @@ export default class Index extends Component {
186 186
                   </View>
187 187
 
188 188
                 </View>
189
-                <View className='item-txt'>{item.description || ''}</View>
189
+                {item.description && <View className='item-txt'>{item.description}</View>}
190 190
               </View>
191 191
 
192 192
             ))

+ 1
- 1
src/pages/person/customerAnalysis/followUpCustomer/index.js Parādīt failu

@@ -309,7 +309,7 @@ export default class transactionCustomer extends Taro.Component {
309 309
                     <View className="phone" >{item.phone}</View>
310 310
                     <Image className="phone-icon" onClick={this.handleTelClick.bind(this, item)} src={phoneImg} />
311 311
                     <Image className="goutong-icon" onClick={this.handleChatClick.bind(this, item)} src={communicateImg}></Image>
312
-                    <View className="status">{item.status == 1 ? '报备' : item.status == 2 ? '到访' : item.status == 3 ? '认筹' : '签约'}</View>
312
+                    {/* <View className="status">{item.status == 1 ? '报备' : item.status == 2 ? '到访' : item.status == 3 ? '认筹' : '签约'}</View> */}
313 313
                   </View>
314 314
                 ))
315 315
               }

+ 8
- 72
src/pages/person/myShare/index.js Parādīt failu

@@ -6,7 +6,7 @@ import { getSharePersonList } from '@services/person'
6 6
 import { savePoint, updatePoint } from '@services/common'
7 7
 import { transferImage } from '@utils/tools'
8 8
 
9
-
9
+const emptyImg = require('@assets/empty.png')
10 10
 @connect(state => state.user)
11 11
 
12 12
 export default class Person extends Taro.Component {
@@ -93,69 +93,6 @@ export default class Person extends Taro.Component {
93 93
     })
94 94
   }
95 95
 
96
-  renderBuilding(item) {
97
-    return (
98
-      <View className="share-item" onClick={this.handleItemClick.bind(this, item.targetId)}>
99
-        <Image className="img" src={transferImage(item.drainageImg)}></Image>
100
-        <View className="building">{item.buildingName}</View>
101
-        <View className="price"> 均价{item.price ? item.price : ''}元/m² </View>
102
-        <View className="num"> {item.buildingNum ? item.buildingNum : '0'}人查看了分享 </View>
103
-        <View className="address"> {item.address} </View>
104
-      </View>
105
-    )
106
-  }
107
-
108
-  renderH5(item) {
109
-    return (
110
-      <View className="share-item" onClick={this.handleItemClick.bind(this, item.targetId)}>
111
-        <Image className="img" src={transferImage(item.drainageImg)}></Image>
112
-        <View className="name">{item.drainageName}</View>
113
-        <View className="num"> {item.drainageShareNum ? item.drainageShareNum : '0'}人查看了分享 </View>
114
-      </View>
115
-    )
116
-  }
117
-
118
-  renderGroup(item) {
119
-    return (
120
-      <View className="share-item" onClick={this.handleItemClick.bind(this, item.targetId)}>
121
-        <Image className="img" src={transferImage(item.groupActivityImg)}></Image>
122
-        <View className="name">{item.groupActivityName}</View>
123
-        <View className="num"> {item.groupActivityShareNum ? item.groupActivityShareNum : '0'}人查看了分享 </View>
124
-      </View>
125
-    )
126
-  }
127
-
128
-  renderHelp(item) {
129
-    return (
130
-      <View className="share-item" onClick={this.handleItemClick.bind(this, item.targetId)}>
131
-        <Image className="img" src={transferImage(item.helpActivityImg)}></Image>
132
-        <View className="name">{item.helpActivityName}</View>
133
-        <View className="num"> {item.helpActivityShareNum ? item.helpActivityShareNum : '0'}人查看了分享 </View>
134
-      </View>
135
-    )
136
-  }
137
-
138
-  renderNews(item) {
139
-    return (
140
-      <View className="share-item" onClick={this.handleItemClick.bind(this, item.targetId)}>
141
-        <Image className="img" src={transferImage(item.newsImg)}></Image>
142
-        <View className="name">{item.newsName}</View>
143
-        <View className="num"> {item.newsNum ? item.newsNum : '0'}人查看了分享 </View>
144
-      </View>
145
-    )
146
-  }
147
-
148
-  renderActivity(item) {
149
-    return (
150
-      <View className="share-item" onClick={this.handleItemClick.bind(this, item.targetId)}>
151
-        <Image className="img" src={transferImage(item.activityImg)}></Image>
152
-        <View className="name">{item.activityName}</View>
153
-        <View className="num"> {item.activityShareNum ? item.activityShareNum : '0'}人查看了分享 </View>
154
-      </View>
155
-    )
156
-  }
157
-
158
-
159 96
   render() {
160 97
     const { isEmpty, hasMore, recordList } = this.state
161 98
     return (
@@ -168,16 +105,15 @@ export default class Person extends Taro.Component {
168 105
         onPullDownRefresh={fn => this.onPullDownRefresh(fn)}
169 106
         onScrollToLower={fn => this.onScrollToLower(fn)}
170 107
       >
171
-        <View className="list" >
108
+        <View className='share-page'>
172 109
           {
173 110
             recordList.map(item => (
174
-              <View key={item.targetId + 'share'} className='share-page'>
175
-                {item.shareType == 'building' && this.renderBuilding(item)}
176
-                {item.shareType == 'h5' && this.renderH5(item)}
177
-                {item.shareType == 'group' && this.renderGroup(item)}
178
-                {item.shareType == 'help' && this.renderHelp(item)}
179
-                {item.shareType == 'news' && this.renderNews(item)}
180
-                {item.shareType == 'activity' && this.renderActivity(item)}
111
+              <View className="share-item" key={item.targetId + 'share'} onClick={this.handleItemClick.bind(this, item.targetId)}>
112
+                <Image className="img" src={transferImage(item.activityImg || emptyImg)}></Image>
113
+                <View className={item.eventType == 'building' ? 'building' : 'name'}>{item.activityName || ''}</View>
114
+                {item.eventType == 'building' && <View className="price"> {item.price ? '均价' + item.price + '元/m²' : '暂无'} </View>}
115
+                <View className="num"> {item.newsNum || '0'}人查看了分享 </View>
116
+                {item.eventType == 'building' && <View className="address"> {item.address || ''} </View>}
181 117
               </View>
182 118
             ))
183 119
           }

+ 57
- 30
src/pages/project/detail/index.js Parādīt failu

@@ -194,7 +194,7 @@ export default class Index extends Component {
194 194
     }, () => {
195 195
       this.loadDetail()
196 196
       this.loadNewsData()
197
-      this.loadActivityData()
197
+      // this.loadActivityData()
198 198
       this.loadHelpGroupList()
199 199
 
200 200
       addItemUv(id)
@@ -239,19 +239,22 @@ export default class Index extends Component {
239 239
       console.log(res, "buildingId")
240 240
       const helpList = []
241 241
       const groupList = []
242
+      const activityList = []
242 243
       res.map(item => {
243 244
         if (item.type == 'help') {
244 245
           helpList.push(item)
245
-        } else {
246
+        } else if (item.type == 'group') {
246 247
           groupList.push(item)
248
+        } else {
249
+          activityList.push(item)
247 250
         }
248 251
       })
249 252
       this.setState({
250 253
         helpList,
251
-        groupList
254
+        groupList,
255
+        activityList
252 256
       })
253
-    }
254
-    )
257
+    })
255 258
   }
256 259
 
257 260
   loadDetail() {
@@ -282,16 +285,16 @@ export default class Index extends Component {
282 285
     })
283 286
   }
284 287
 
285
-  loadActivityData() {
286
-    const { buildingId } = this.state
287
-    const payload = { pageSize: 999, pageNumber: 1, buildingId }
288
-    queryActivityList(payload).then(res => {
289
-      console.log(res, 'Activity')
290
-      this.setState({
291
-        activityList: res.list || []
292
-      })
293
-    })
294
-  }
288
+  // loadActivityData() {
289
+  //   const { buildingId } = this.state
290
+  //   const payload = { pageSize: 999, pageNumber: 1, buildingId }
291
+  //   queryActivityList(payload).then(res => {
292
+  //     console.log(res, 'Activity')
293
+  //     this.setState({
294
+  //       activityList: res.list || []
295
+  //     })
296
+  //   })
297
+  // }
295 298
 
296 299
   loadNewsData() {
297 300
     const { buildingId } = this.state
@@ -403,7 +406,6 @@ export default class Index extends Component {
403 406
         resolve(posterData)
404 407
         return
405 408
       }
406
-      con
407 409
       const {
408 410
         userInfo: { person: { avatarurl, nickname, personId, personType, userId }, miniApp },
409 411
         projectDetail: { posters, buildingId, poster, price, buildingRestaurant, createDate, buildingName, tel, buildingTag, uvList = {} }
@@ -437,6 +439,7 @@ export default class Index extends Component {
437 439
 
438 440
   // 开始生成海报
439 441
   togglePosterStatus = (flag) => {
442
+    console.log(flag, "flag")
440 443
     if (flag) {
441 444
       // App.zhuge.track('生成海报')
442 445
 
@@ -462,22 +465,38 @@ export default class Index extends Component {
462 465
     }
463 466
   }
464 467
 
465
-  makePhoneCall = () => {
466
-    const { tel: phoneNumber } = this.props.projectDetail
467
-    Taro.makePhoneCall({
468
-      phoneNumber
469
-    })
468
+  callPhone = () => {
469
+    console.log(this.props, "this.props")
470
+    const router = Taro.getStorageSync('router')
471
+    const consultant = this.$router.params.consultant || router.query.consultant
472
+    if (consultant) {
473
+      this.handleTelClick(this.state.consultData)
474
+    } else {
475
+      const { tel } = this.props.projectDetail
476
+      if (tel) {
477
+        Taro.makePhoneCall({
478
+          phoneNumber: tel
479
+        })
480
+      } else {
481
+        Taro.showToast({
482
+          title: '暂无联系电话',
483
+          icon: 'none'
484
+        })
485
+      }
486
+
487
+    }
488
+
470 489
   }
471 490
 
472 491
   handleTelClick(item, e) {
473
-    e.stopPropagation()
492
+    // e.stopPropagation()
474 493
     Taro.makePhoneCall({
475
-      phoneNumber: item.phone
494
+      phoneNumber: item.phone || item.tel
476 495
     })
477 496
   }
478 497
 
479 498
   handleChatClick(item, e) {
480
-    e.stopPropagation()
499
+    // e.stopPropagation()
481 500
     const { userInfo: { person: { personId, nickname, name } } } = this.props
482 501
     const { userInfo: { miniApp: { tpls } } } = this.props
483 502
     const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_NOTICE && x.isSubscribe == true))[0].tplId
@@ -506,11 +525,20 @@ export default class Index extends Component {
506 525
   }
507 526
 
508 527
   handleMoreClick() {
509
-    const { userInfo: { miniApp: { tpls } } } = this.props
528
+
510 529
     Taro.navigateTo({
511 530
       url: `/pages/card/list/index?buildingId=${this.state.buildingId}`
512 531
     })
513 532
   }
533
+  ChatOnlineClick() {
534
+    const router = Taro.getStorageSync('router')
535
+    const consultant = this.$router.params.consultant || router.query.consultant
536
+    if (consultant) {
537
+      this.handleChatClick(this.state.consultData)
538
+    } else {
539
+      this.handleMoreClick()
540
+    }
541
+  }
514 542
 
515 543
   handleStopPropagation(e) {
516 544
     e.stopPropagation()
@@ -564,7 +592,7 @@ export default class Index extends Component {
564 592
 
565 593
   handActivityItemClick(item) {
566 594
     Taro.navigateTo({
567
-      url: '/pages/activity/detail/index?id=' + item.dynamicId
595
+      url: '/pages/activity/detail/index?id=' + item.activityId
568 596
     })
569 597
   }
570 598
 
@@ -652,10 +680,10 @@ export default class Index extends Component {
652 680
           }
653 681
 
654 682
         </View>
655
-        <Button className='bt-nav__item  bt-nav__right' onClick={this.handleMoreClick}>
683
+        <Button className='bt-nav__item  bt-nav__right' onClick={this.ChatOnlineClick}>
656 684
           <Text className="text">在线聊</Text>
657 685
         </Button>
658
-        <Button className='bt-nav__item  bt-nav__right bt-nav__right2' onClick={this.makePhoneCall}>
686
+        <Button className='bt-nav__item  bt-nav__right bt-nav__right2' onClick={this.callPhone}>
659 687
           <Text className="iconfont icon-tel"></Text>
660 688
           <Text className="text">打电话</Text>
661 689
         </Button>
@@ -812,7 +840,7 @@ export default class Index extends Component {
812 840
             <Text className="section-head__title">位置及周边配套</Text>
813 841
           </View> */}
814 842
         </View>
815
-        <Around building={building}  buildingId={this.state.buildingId} ></Around>
843
+        <Around building={building} buildingId={this.state.buildingId} ></Around>
816 844
       </View>
817 845
     )
818 846
   }
@@ -935,7 +963,6 @@ export default class Index extends Component {
935 963
       <Block>
936 964
         {groupList.length > 0 &&
937 965
           <View className="activity">
938
-            {console.log(groupList, '----groupList-----')}
939 966
             <View className="title">拼团活动</View>
940 967
             <View
941 968
               style={{ position: 'relative' }}>