瀏覽代碼

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

张延森 5 年之前
父節點
當前提交
3cba24b4dd

+ 2
- 2
config/dev.js 查看文件

9
     WSS_HOST: '"wss://dev.jinchengjiaye.com"',
9
     WSS_HOST: '"wss://dev.jinchengjiaye.com"',
10
     // HOST: '"https://lt.pawoma.cn"',
10
     // HOST: '"https://lt.pawoma.cn"',
11
     // WSS_HOST: '"wss://lt.pawoma.cn"',
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
     Version: 'V3.5.5'
14
     Version: 'V3.5.5'
15
   },
15
   },
16
   weapp: {},
16
   weapp: {},

+ 14
- 14
src/pages/card/list/index.js 查看文件

19
     hasMore: true,
19
     hasMore: true,
20
     isEmpty: false,
20
     isEmpty: false,
21
     recordId: null,
21
     recordId: null,
22
-    pageIndex:1
22
+    pageIndex: 1
23
   }
23
   }
24
   componentWillMount() {
24
   componentWillMount() {
25
     savePoint({
25
     savePoint({
61
   }
61
   }
62
 
62
 
63
   handleChatClick(item, e) {
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
     e && e.stopPropagation()
66
     e && e.stopPropagation()
67
     const { userInfo: { person: { personId, nickname, name } } } = this.props
67
     const { userInfo: { person: { personId, nickname, name } } } = this.props
68
     const { userInfo: { miniApp: { tpls } } } = this.props
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
     wx.requestSubscribeMessage({
70
     wx.requestSubscribeMessage({
71
       tmplIds: [tplId],
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
         // App.zhuge.track('查看置业顾问列表')
79
         // App.zhuge.track('查看置业顾问列表')
80
         Taro.navigateTo({
80
         Taro.navigateTo({
81
           url: `/pages/im/index?sendId=${personId}&sendName=${encodeURIComponent(name || nickname)}&receiverId=${item.id}&receiverName=${encodeURIComponent(item.name)}`
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
   }
102
   }
103
 
103
 
104
   loadList(pageNumber) {
104
   loadList(pageNumber) {
105
- 
105
+
106
     const { buildingId } = this.$router.params
106
     const { buildingId } = this.$router.params
107
     const payload = { pageSize: 10, pageNumber, buildingId: '' }
107
     const payload = { pageSize: 10, pageNumber, buildingId: '' }
108
     if (buildingId) {
108
     if (buildingId) {
117
       list,
117
       list,
118
       isEmpty: total == 0,
118
       isEmpty: total == 0,
119
       hasMore: list.length >= total ? false : true,
119
       hasMore: list.length >= total ? false : true,
120
-      pageIndex:1
120
+      pageIndex: 1
121
     })
121
     })
122
     rest && rest()
122
     rest && rest()
123
   }
123
   }
125
   onScrollToLower = async (fn) => {
125
   onScrollToLower = async (fn) => {
126
     const { list } = this.state;
126
     const { list } = this.state;
127
     pageIndex++
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
     const newList = list.concat(records)
129
     const newList = list.concat(records)
130
     this.setState({
130
     this.setState({
131
       list: newList,
131
       list: newList,
132
       hasMore: newList.length >= total ? false : true,
132
       hasMore: newList.length >= total ? false : true,
133
-      pageIndex:this.state.pageIndex+1
133
+      pageIndex: this.state.pageIndex + 1
134
     });
134
     });
135
     fn && fn();
135
     fn && fn();
136
   }
136
   }
157
               <View className='item-main' key={item.id} onClick={this.handleConsuItemClick.bind(this, item)}>
157
               <View className='item-main' key={item.id} onClick={this.handleConsuItemClick.bind(this, item)}>
158
                 <View className="item">
158
                 <View className="item">
159
                   <View className="flex">
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
                     <View className='info'>
162
                     <View className='info'>
163
                       <View className='name-info'>
163
                       <View className='name-info'>
186
                   </View>
186
                   </View>
187
 
187
 
188
                 </View>
188
                 </View>
189
-                <View className='item-txt'>{item.description || ''}</View>
189
+                {item.description && <View className='item-txt'>{item.description}</View>}
190
               </View>
190
               </View>
191
 
191
 
192
             ))
192
             ))

+ 1
- 1
src/pages/person/customerAnalysis/followUpCustomer/index.js 查看文件

309
                     <View className="phone" >{item.phone}</View>
309
                     <View className="phone" >{item.phone}</View>
310
                     <Image className="phone-icon" onClick={this.handleTelClick.bind(this, item)} src={phoneImg} />
310
                     <Image className="phone-icon" onClick={this.handleTelClick.bind(this, item)} src={phoneImg} />
311
                     <Image className="goutong-icon" onClick={this.handleChatClick.bind(this, item)} src={communicateImg}></Image>
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
                   </View>
313
                   </View>
314
                 ))
314
                 ))
315
               }
315
               }

+ 8
- 72
src/pages/person/myShare/index.js 查看文件

6
 import { savePoint, updatePoint } from '@services/common'
6
 import { savePoint, updatePoint } from '@services/common'
7
 import { transferImage } from '@utils/tools'
7
 import { transferImage } from '@utils/tools'
8
 
8
 
9
-
9
+const emptyImg = require('@assets/empty.png')
10
 @connect(state => state.user)
10
 @connect(state => state.user)
11
 
11
 
12
 export default class Person extends Taro.Component {
12
 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
   render() {
96
   render() {
160
     const { isEmpty, hasMore, recordList } = this.state
97
     const { isEmpty, hasMore, recordList } = this.state
161
     return (
98
     return (
168
         onPullDownRefresh={fn => this.onPullDownRefresh(fn)}
105
         onPullDownRefresh={fn => this.onPullDownRefresh(fn)}
169
         onScrollToLower={fn => this.onScrollToLower(fn)}
106
         onScrollToLower={fn => this.onScrollToLower(fn)}
170
       >
107
       >
171
-        <View className="list" >
108
+        <View className='share-page'>
172
           {
109
           {
173
             recordList.map(item => (
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
               </View>
117
               </View>
182
             ))
118
             ))
183
           }
119
           }

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

194
     }, () => {
194
     }, () => {
195
       this.loadDetail()
195
       this.loadDetail()
196
       this.loadNewsData()
196
       this.loadNewsData()
197
-      this.loadActivityData()
197
+      // this.loadActivityData()
198
       this.loadHelpGroupList()
198
       this.loadHelpGroupList()
199
 
199
 
200
       addItemUv(id)
200
       addItemUv(id)
239
       console.log(res, "buildingId")
239
       console.log(res, "buildingId")
240
       const helpList = []
240
       const helpList = []
241
       const groupList = []
241
       const groupList = []
242
+      const activityList = []
242
       res.map(item => {
243
       res.map(item => {
243
         if (item.type == 'help') {
244
         if (item.type == 'help') {
244
           helpList.push(item)
245
           helpList.push(item)
245
-        } else {
246
+        } else if (item.type == 'group') {
246
           groupList.push(item)
247
           groupList.push(item)
248
+        } else {
249
+          activityList.push(item)
247
         }
250
         }
248
       })
251
       })
249
       this.setState({
252
       this.setState({
250
         helpList,
253
         helpList,
251
-        groupList
254
+        groupList,
255
+        activityList
252
       })
256
       })
253
-    }
254
-    )
257
+    })
255
   }
258
   }
256
 
259
 
257
   loadDetail() {
260
   loadDetail() {
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
   loadNewsData() {
299
   loadNewsData() {
297
     const { buildingId } = this.state
300
     const { buildingId } = this.state
403
         resolve(posterData)
406
         resolve(posterData)
404
         return
407
         return
405
       }
408
       }
406
-      con
407
       const {
409
       const {
408
         userInfo: { person: { avatarurl, nickname, personId, personType, userId }, miniApp },
410
         userInfo: { person: { avatarurl, nickname, personId, personType, userId }, miniApp },
409
         projectDetail: { posters, buildingId, poster, price, buildingRestaurant, createDate, buildingName, tel, buildingTag, uvList = {} }
411
         projectDetail: { posters, buildingId, poster, price, buildingRestaurant, createDate, buildingName, tel, buildingTag, uvList = {} }
437
 
439
 
438
   // 开始生成海报
440
   // 开始生成海报
439
   togglePosterStatus = (flag) => {
441
   togglePosterStatus = (flag) => {
442
+    console.log(flag, "flag")
440
     if (flag) {
443
     if (flag) {
441
       // App.zhuge.track('生成海报')
444
       // App.zhuge.track('生成海报')
442
 
445
 
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
   handleTelClick(item, e) {
491
   handleTelClick(item, e) {
473
-    e.stopPropagation()
492
+    // e.stopPropagation()
474
     Taro.makePhoneCall({
493
     Taro.makePhoneCall({
475
-      phoneNumber: item.phone
494
+      phoneNumber: item.phone || item.tel
476
     })
495
     })
477
   }
496
   }
478
 
497
 
479
   handleChatClick(item, e) {
498
   handleChatClick(item, e) {
480
-    e.stopPropagation()
499
+    // e.stopPropagation()
481
     const { userInfo: { person: { personId, nickname, name } } } = this.props
500
     const { userInfo: { person: { personId, nickname, name } } } = this.props
482
     const { userInfo: { miniApp: { tpls } } } = this.props
501
     const { userInfo: { miniApp: { tpls } } } = this.props
483
     const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_NOTICE && x.isSubscribe == true))[0].tplId
502
     const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_NOTICE && x.isSubscribe == true))[0].tplId
506
   }
525
   }
507
 
526
 
508
   handleMoreClick() {
527
   handleMoreClick() {
509
-    const { userInfo: { miniApp: { tpls } } } = this.props
528
+
510
     Taro.navigateTo({
529
     Taro.navigateTo({
511
       url: `/pages/card/list/index?buildingId=${this.state.buildingId}`
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
   handleStopPropagation(e) {
543
   handleStopPropagation(e) {
516
     e.stopPropagation()
544
     e.stopPropagation()
564
 
592
 
565
   handActivityItemClick(item) {
593
   handActivityItemClick(item) {
566
     Taro.navigateTo({
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
           }
680
           }
653
 
681
 
654
         </View>
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
           <Text className="text">在线聊</Text>
684
           <Text className="text">在线聊</Text>
657
         </Button>
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
           <Text className="iconfont icon-tel"></Text>
687
           <Text className="iconfont icon-tel"></Text>
660
           <Text className="text">打电话</Text>
688
           <Text className="text">打电话</Text>
661
         </Button>
689
         </Button>
812
             <Text className="section-head__title">位置及周边配套</Text>
840
             <Text className="section-head__title">位置及周边配套</Text>
813
           </View> */}
841
           </View> */}
814
         </View>
842
         </View>
815
-        <Around building={building}  buildingId={this.state.buildingId} ></Around>
843
+        <Around building={building} buildingId={this.state.buildingId} ></Around>
816
       </View>
844
       </View>
817
     )
845
     )
818
   }
846
   }
935
       <Block>
963
       <Block>
936
         {groupList.length > 0 &&
964
         {groupList.length > 0 &&
937
           <View className="activity">
965
           <View className="activity">
938
-            {console.log(groupList, '----groupList-----')}
939
             <View className="title">拼团活动</View>
966
             <View className="title">拼团活动</View>
940
             <View
967
             <View
941
               style={{ position: 'relative' }}>
968
               style={{ position: 'relative' }}>