xujing 5 vuotta sitten
vanhempi
commit
4151adf966

+ 3
- 3
src/components/consultant/index.js Näytä tiedosto

@@ -15,7 +15,7 @@ export default class Index extends Component {
15 15
         data: []
16 16
     }
17 17
     componentDidMount() {
18
-        
18
+
19 19
     }
20 20
     // 报备客户
21 21
     reportClient() {
@@ -72,10 +72,10 @@ export default class Index extends Component {
72 72
     }
73 73
     render() {
74 74
         const { show } = this.state
75
-        const { data, style } = this.props
75
+        const { data, style, smallStyle } = this.props
76 76
         return (
77 77
             <View >
78
-                <View className={show ? "consultant show" : "consultant hide"} style={style} onClick={this.handleClick}  >
78
+                <View className={show ? "consultant show" : "consultant hide"} style={smallStyle} onClick={this.handleClick}  >
79 79
                     <Image src={require('@assets/person/left.png')} className='left-img'></Image>
80 80
                     <Image src={transferImage(data.picture || require('@assets/default-avatar.png'))} className='img'></Image>
81 81
                     <View className="text">{data.name || ''}</View>

+ 1
- 3
src/components/consultant/index.scss Näytä tiedosto

@@ -10,8 +10,6 @@
10 10
   z-index: 99;
11 11
   display: flex;
12 12
   align-items: center;
13
- 
14
-  transition: all 1s;
15 13
   .left-img{
16 14
       width: 18px;
17 15
       height: 34px;
@@ -55,7 +53,7 @@
55 53
     right: 0;
56 54
     display: flex;
57 55
     align-items: center;
58
-   
56
+    z-index: 99;
59 57
     .cancel-img{
60 58
         width: 36px;
61 59
         height: 36px;

+ 35
- 9
src/pages/activity/detail/assemble.js Näytä tiedosto

@@ -23,6 +23,9 @@ import {
23 23
   updatePoint
24 24
 } from '@services/common'
25 25
 import { connect } from '@tarojs/redux'
26
+import { getCardDetail } from '@services/card'
27
+import { ROLE_CODE } from '@constants/user'
28
+import Consultant from '@components/consultant'
26 29
 
27 30
 const waitImg = require('@assets/helpgroup/wait.png')
28 31
 const memberImg = require('@assets/helpgroup/group/member.png')
@@ -68,6 +71,8 @@ export default class Detail extends Component {
68 71
     grantPhoneVisible: false, // 授权电话
69 72
     grantAvatarVisible: false, // 授权头像
70 73
     pointRecordId: undefined, // 埋点ID
74
+    consultData: {}, // 分享的置业顾问信息
75
+    consultShow: false  // 置业顾问悬浮框显示隐藏
71 76
   }
72 77
 
73 78
   componentWillMount() {
@@ -78,6 +83,16 @@ export default class Detail extends Component {
78 83
       }
79 84
       this.initPageData()
80 85
     })
86
+    const router = Taro.getStorageSync('router')
87
+    const consultant = this.$router.params.consultant || router.query.consultant
88
+    if (consultant) {
89
+      getCardDetail(consultant).then(res => {
90
+        this.setState({
91
+          consultData: res,
92
+          consultShow: true
93
+        })
94
+      })
95
+    }
81 96
   }
82 97
 
83 98
   componentWillUnmount() {
@@ -134,15 +149,15 @@ export default class Detail extends Component {
134 149
   }
135 150
 
136 151
 
137
-   // 调起授权电话
138
-   toggleGrantPhone = () => {
152
+  // 调起授权电话
153
+  toggleGrantPhone = () => {
139 154
     const { userInfo: { person: { phone, tel } } } = this.props
140 155
     if (!phone && !tel) {
141 156
       this.setState({ grantPhoneVisible: true })
142 157
       return false
143 158
     }
144
-    console.log('phone:',phone,'tel:',tel,'!!!!!')
145
-    console.log(this.props,'this.propsphone!!!!!')
159
+    console.log('phone:', phone, 'tel:', tel, '!!!!!')
160
+    console.log(this.props, 'this.propsphone!!!!!')
146 161
 
147 162
     return true
148 163
   }
@@ -156,8 +171,8 @@ export default class Detail extends Component {
156 171
       return false
157 172
     }
158 173
 
159
-    console.log(avatarurl,"avatarurl")
160
-    console.log(this.props.userInfo,"this.props")
174
+    console.log(avatarurl, "avatarurl")
175
+    console.log(this.props.userInfo, "this.props")
161 176
     return true
162 177
   }
163 178
 
@@ -298,12 +313,14 @@ export default class Detail extends Component {
298 313
 
299 314
   currentPageAndParams() {
300 315
     const { id, recordId } = this.state
301
-    const { userInfo: { person: { personId } } } = this.props
316
+    const { userInfo: { person: { personId, personType } } } = this.props
317
+    const consultant = personType == ROLE_CODE['CONSULTANT'] ? personId : ""
302 318
 
303 319
     let queryParams = [
304 320
       `id=${id}`,
305 321
       `from=group_share`,
306
-      `recommender=${personId}`
322
+      `recommender=${personId}`,
323
+      `consultant=${consultant}`,
307 324
     ]
308 325
     if (recordId) {
309 326
       queryParams.push(`recordId=${recordId}`)
@@ -322,11 +339,15 @@ export default class Detail extends Component {
322 339
   onShareAppMessage = () => {
323 340
     const { shares } = this.state
324 341
     const currentPage = this.currentPageAndParams().join('?')
342
+    const { userInfo: { person: { personId, personType, userId } } } = this.props
343
+    const consultantId = personType == ROLE_CODE['CONSULTANT'] ? userId : ""
325 344
 
326 345
     savePoint({
327 346
       event: 'share',
328 347
       eventType: 'group',
329 348
       propertyName: '拼团详情分享',
349
+      consultantId: consultantId,
350
+      sharePersonId: personId,
330 351
       data: '{}'
331 352
     })
332 353
 
@@ -502,6 +523,8 @@ export default class Detail extends Component {
502 523
       qrCode,
503 524
       leftTime,
504 525
       ltTicker,
526
+      consultData,
527
+      consultShow
505 528
     } = this.state
506 529
 
507 530
     const { userInfo } = this.props
@@ -531,6 +554,10 @@ export default class Detail extends Component {
531 554
 
532 555
     return (
533 556
       <Block>
557
+        <BackHomeBtn style={consultShow ? "bottom:310rpx" : ''}></BackHomeBtn>
558
+        {
559
+          consultShow && <Consultant style="bottom:150rpx" smallStyle="bottom:178rpx" personId={userInfo.person.personId} name={userInfo.person.name || userInfo.person.nickname} data={consultData}></Consultant>
560
+        }
534 561
         {/* 生成海报 */}
535 562
         {posterVisible && !ltTicker.processing &&
536 563
           (
@@ -546,7 +573,6 @@ export default class Detail extends Component {
546 573
           grantAvatarVisible &&
547 574
           <AchieveAvatar user={userInfo.person} onSuccess={() => { this.setState({ grantAvatarVisible: false }) }} ></AchieveAvatar>
548 575
         }
549
-        <BackHomeBtn></BackHomeBtn>
550 576
         {
551 577
           loaded && (
552 578
             <View className="ass-page">

+ 32
- 12
src/pages/activity/detail/assistance.js Näytä tiedosto

@@ -23,6 +23,9 @@ import {
23 23
   updatePoint
24 24
 } from '@services/common'
25 25
 import { connect } from '@tarojs/redux'
26
+import { getCardDetail } from '@services/card'
27
+import { ROLE_CODE } from '@constants/user'
28
+import Consultant from '@components/consultant'
26 29
 
27 30
 const successImg = 'https://estateagents.oss-cn-shanghai.aliyuncs.com/miniapp/images/helpgroup/help/success2.png'
28 31
 const failImg = 'https://estateagents.oss-cn-shanghai.aliyuncs.com/miniapp/images/helpgroup/help/help%20failure.png'
@@ -67,6 +70,8 @@ export default class Detail extends Component {
67 70
     grantAvatarVisible: false, // 授权头像
68 71
     handleHelpBtn: true, // 立即助力好友
69 72
     pointRecordId: undefined, // 埋点ID
73
+    consultData: {}, // 分享的置业顾问信息
74
+    consultShow: false  // 置业顾问悬浮框显示隐藏
70 75
   }
71 76
 
72 77
   componentWillMount() {
@@ -77,6 +82,16 @@ export default class Detail extends Component {
77 82
       }
78 83
 
79 84
       this.initPageData()
85
+      const router = Taro.getStorageSync('router')
86
+      const consultant = this.$router.params.consultant || router.query.consultant
87
+      if (consultant) {
88
+        getCardDetail(consultant).then(res => {
89
+          this.setState({
90
+            consultData: res,
91
+            consultShow: true
92
+          })
93
+        })
94
+      }
80 95
     })
81 96
   }
82 97
 
@@ -300,12 +315,14 @@ export default class Detail extends Component {
300 315
 
301 316
   currentPageAndParams() {
302 317
     const { id, initiateId } = this.state
303
-    const { userInfo: { person: { personId } } } = this.props
318
+    const { userInfo: { person: { personId, personType } } } = this.props
319
+    const consultant = personType == ROLE_CODE['CONSULTANT'] ? personId : ""
304 320
 
305 321
     let queryParams = [
306 322
       `id=${id}`,
307 323
       `from=help_share`,
308
-      `recommender=${personId}`
324
+      `recommender=${personId}`,
325
+      `consultant=${consultant}`,
309 326
     ]
310 327
     if (initiateId) {
311 328
       queryParams.push(`initiateId=${initiateId}`)
@@ -323,11 +340,15 @@ export default class Detail extends Component {
323 340
   onShareAppMessage = () => {
324 341
     const { shares } = this.state
325 342
     const currentPage = this.currentPageAndParams().join('?')
343
+    const { userInfo: { person: { personId, personType, userId } } } = this.props
344
+    const consultantId = personType == ROLE_CODE['CONSULTANT'] ? userId : ""
326 345
 
327 346
     savePoint({
328 347
       event: 'share',
329 348
       eventType: 'help',
330 349
       propertyName: '助力详情分享',
350
+      consultantId: consultantId,
351
+      sharePersonId: personId,
331 352
       data: '{}'
332 353
     })
333 354
 
@@ -494,6 +515,8 @@ export default class Detail extends Component {
494 515
       qrCode,
495 516
       leftTime,
496 517
       ltTicker,
518
+      consultData,
519
+      consultShow
497 520
     } = this.state
498 521
 
499 522
     const { userInfo } = this.props
@@ -509,15 +532,16 @@ export default class Detail extends Component {
509 532
       date: dayjs().format('YYYY.MM.DD'),
510 533
       appName: (userInfo.miniApp || {}).name,
511 534
     }
512
-
513 535
     const posterConfigs = this.transTPLs2Configs(posterTpls, posterData)
514
-
515
-    console.log('------posterData------', posterData)
516
-    console.log('------posterConfigs------', posterConfigs)
536
+    // console.log('------posterData------', posterData)
537
+    // console.log('------posterConfigs------', posterConfigs)
517 538
     const isJoin = helpList.filter(x => x.personId === userInfo.person.personId)[0] || isStarter
518
-
519 539
     return (
520 540
       <View>
541
+        <BackHomeBtn style={consultShow ? "bottom:200rpx" : ''}></BackHomeBtn>
542
+        {
543
+          consultShow && <Consultant style="bottom:40rpx" smallStyle="bottom:68rpx" personId={userInfo.person.personId} name={userInfo.person.name || userInfo.person.nickname} data={consultData}></Consultant>
544
+        }
521 545
         {/* 生成海报 */}
522 546
         {posterVisible && !ltTicker.processing &&
523 547
           (
@@ -532,7 +556,6 @@ export default class Detail extends Component {
532 556
           grantAvatarVisible &&
533 557
           <AchieveAvatar user={userInfo.person} onSuccess={() => { this.setState({ grantAvatarVisible: false }) }} ></AchieveAvatar>
534 558
         }
535
-        <BackHomeBtn></BackHomeBtn>
536 559
         {
537 560
           loaded && (
538 561
             <View className="ass-page">
@@ -545,14 +568,11 @@ export default class Detail extends Component {
545 568
                   <Text className="row-text">{actState != ActFinished ? formateLeftTime(leftTime) : '活动已结束'}</Text>
546 569
                 </View>
547 570
                 {detail.successNum > 0 &&
548
-
549 571
                   <View className="success-num">
550 572
                     <View className="triangle"></View>
551 573
                     <View className="text">已成功 {detail.successNum}</View>
552 574
                   </View>
553
-
554 575
                 }
555
-
556 576
               </View>
557 577
               <ScrollView
558 578
                 scrollY
@@ -618,7 +638,7 @@ export default class Detail extends Component {
618 638
                     isStarter && actState === ActInProcess && helpState === HelpInProcess &&
619 639
                     // (<Block>
620 640
                     //   <View className="set-btn">生成海报</View>
621
-                      <View className="assistance-btn"><FormIdCollector><Button className="assistance-btn" onClick={this.askForHelp}>邀请好友助力</Button></FormIdCollector></View>
641
+                    <View className="assistance-btn"><FormIdCollector><Button className="assistance-btn" onClick={this.askForHelp}>邀请好友助力</Button></FormIdCollector></View>
622 642
                     // </Block>)
623 643
                   }
624 644
                   {

+ 29
- 16
src/pages/activity/detail/index.js Näytä tiedosto

@@ -9,6 +9,9 @@ import getUserPhone from '@utils/getUserPhone'
9 9
 import ready from '@utils/ready'
10 10
 import { getDownloadURL, times, transferImage } from '@utils/tools'
11 11
 import { getQrCodeParams } from '@utils/qrcode'
12
+import { getCardDetail } from '@services/card'
13
+import { ROLE_CODE } from '@constants/user'
14
+import Consultant from '@components/consultant'
12 15
 import {
13 16
   addActivityShareNum,
14 17
   signupActivity,
@@ -42,14 +45,23 @@ export default class Detail extends Component {
42 45
     selector: [],
43 46
     selectorChecked: '1',
44 47
     canChoose: 'none',
45
-    inputName: ''
48
+    inputName: '',
49
+    consultData: {}, // 分享的置业顾问信息
50
+    consultShow: false  // 置业顾问悬浮框显示隐藏
46 51
   }
47 52
 
48 53
   componentWillMount() {
49 54
     ready.queue(() => {
50 55
       const router = Taro.getStorageSync('router')
51
-      // const id = this.$router.params.id || router.query.id || '2fe920719b8b0db50011441462e647ad'
52
-
56
+      const consultant = this.$router.params.consultant || router.query.consultant
57
+      if (consultant) {
58
+        getCardDetail(consultant).then(res => {
59
+          this.setState({
60
+            consultData: res,
61
+            consultShow: true
62
+          })
63
+        })
64
+      }
53 65
       const id = this.$router.params.id || router.query.id
54 66
       if (!id) {
55 67
         getQrCodeParams(this.$router.params.scene).then(res => {
@@ -114,25 +126,27 @@ export default class Detail extends Component {
114 126
   }
115 127
   onShareAppMessage = () => {
116 128
     const { detail: { shareContents, title, dynamicId, url } } = this.state
117
-    const { userInfo: { person: { personId } } } = this.props
129
+    const { userInfo: { person: { personId, personType,userId } } } = this.props
118 130
     console.log(dynamicId, "path")
119 131
     console.log(personId, "personId")
120 132
 
121 133
     addActivityShareNum(dynamicId)
122 134
 
123
-
135
+    const consultantId = personType == ROLE_CODE['CONSULTANT'] ? userId : ""
124 136
     savePoint({
125 137
       event: 'share',
126 138
       eventType: 'activity',
127 139
       propertyName: '活动详情分享',
140
+      consultantId: consultantId,
141
+      sharePersonId: personId,
128 142
       data: '{}'
129 143
     }).then(res => {
130 144
       console.log('活动详情分享')
131 145
     })
132
-
146
+    const consultant = personType == ROLE_CODE['CONSULTANT'] ? personId : ""
133 147
     return {
134 148
       title: shareContents[0].shareContentTitle,
135
-      path: `/pages/activity/detail/index?id=${dynamicId}&from=dynamic_share&recommender=${personId}`,//分享地址
149
+      path: `/pages/activity/detail/index?id=${dynamicId}&from=dynamic_share&recommender=${personId}&consultant=${consultant}`,//分享地址
136 150
       imageUrl: shareContents[0].shareContentImg
137 151
     }
138 152
 
@@ -328,8 +342,8 @@ export default class Detail extends Component {
328 342
   }
329 343
 
330 344
   render() {
331
-    const { detail, loaded, isSaved, isSign, posterVisible, posterData, posterShow } = this.state
332
-    const { userInfo: { person: { phone } } } = this.props
345
+    const { detail, loaded, isSaved, isSign, posterVisible, posterData, posterShow, consultData, consultShow } = this.state
346
+    const { userInfo: { person: { phone, personId, nickname, name } } } = this.props
333 347
     return (
334 348
       <Block>
335 349
         {/* 生成海报 */}
@@ -379,16 +393,15 @@ export default class Detail extends Component {
379 393
                     <template is='wxParse' data='{{wxParseData:article.nodes}}' /> */}
380 394
                   </View>
381 395
                   <View style="color:#999;font-size:15px;margin:0 auto 90px auto;text-align:center">已经到底了~</View>
382
-
383 396
                 </View>
384 397
               </ScrollView>
385
-
386
-              <View className="chat-entrance" onClick={this.handleMoreClick}>
398
+              {/* <View className="chat-entrance" onClick={this.handleMoreClick}>
387 399
                 <Text className="iconfont icon-chat"></Text>
388
-              </View>
389
-
390
-              <BackHomeBtn></BackHomeBtn>
391
-
400
+              </View> */}
401
+              <BackHomeBtn style={consultShow ? "bottom:300rpx" : ''}></BackHomeBtn>
402
+              {
403
+                consultShow && <Consultant style="bottom:140rpx" personId={personId} name={name || nickname} data={consultData}></Consultant>
404
+              }
392 405
               <View className="bot-nav flex">
393 406
                 {
394 407
                   posterShow && (

+ 8
- 8
src/pages/news/detail/index.js Näytä tiedosto

@@ -36,8 +36,8 @@ export default class NewsDetail extends Component {
36 36
     posterShow: 'none',
37 37
     posterData: {},
38 38
     posterVisible: false,
39
-    consultData: {},
40
-    consultShow: false
39
+    consultData: {}, // 分享的置业顾问信息
40
+    consultShow: false  // 置业顾问悬浮框显示隐藏
41 41
   }
42 42
 
43 43
   componentWillMount() {
@@ -52,14 +52,12 @@ export default class NewsDetail extends Component {
52 52
       const consultant = this.$router.params.consultant || router.query.consultant
53 53
       if (consultant) {
54 54
         getCardDetail(consultant).then(res => {
55
-
56 55
           this.setState({
57 56
             consultData: res,
58 57
             consultShow: true
59 58
           })
60 59
         })
61 60
       }
62
-
63 61
       if (!newsId) {
64 62
         getQrCodeParams(this.$router.params.scene).then(res => {
65 63
           this.setState({ newsId: res.id }, () => {
@@ -123,13 +121,16 @@ export default class NewsDetail extends Component {
123 121
   }
124 122
   onShareAppMessage = () => {
125 123
     const { detail: { shareContents, newsName, newsId, newsImg } } = this.state
126
-    const { userInfo: { person: { personId, personType } } } = this.props
124
+    const { userInfo: { person: { personId, personType,userId } } } = this.props
125
+    const consultantId = personType == ROLE_CODE['CONSULTANT'] ? userId : ""
127 126
     const consultant = personType == ROLE_CODE['CONSULTANT'] ? personId : ""
128 127
 
129 128
     savePoint({
130 129
       event: 'share',
131 130
       eventType: 'activity',
132 131
       propertyName: '资讯详情分享',
132
+      consultantId: consultantId,
133
+      sharePersonId: personId,
133 134
       data: '{}'
134 135
     }).then(res => {
135 136
       console.info('资讯详情分享')
@@ -253,7 +254,6 @@ export default class NewsDetail extends Component {
253 254
                     {/* <View><Text className="iconfont icon-fenxiang1"></Text>{detail.shareNum || 0}</View> */}
254 255
                     <View className='fenx'><Image src={require('@assets/person/fenxiang.png')} className='fenxiang1-img'></Image>{detail.shareNum || 0}</View>
255 256
                   </View>
256
-
257 257
                   <View>{dayjs(detail.createDate).format('YYYY-MM-DD')}</View>
258 258
                 </View>
259 259
                 {/* <Image mode="widthFix" style={{ width: '100%', marginTop: '20px' }} src={transferImage(detail.newsImg)}></Image> */}
@@ -263,9 +263,9 @@ export default class NewsDetail extends Component {
263 263
                 </View>
264 264
               </ScrollView>
265 265
               <Notice></Notice>
266
-              <BackHomeBtn style={consultShow ? "bottom:320rpx" : ''}></BackHomeBtn>
266
+              <BackHomeBtn style={consultShow ? "bottom:310rpx" : ''}></BackHomeBtn>
267 267
               {
268
-                consultShow && <Consultant personId={personId} name={name || nickname} data={consultData}></Consultant>
268
+                consultShow && <Consultant style="bottom:150rpx" smallStyle="bottom:178rpx" personId={personId} name={name || nickname} data={consultData}></Consultant>
269 269
               }
270 270
               <View className="bot-nav flex">
271 271
                 <View className='btn poster-btn' style={{ display: posterShow }} onClick={() => { this.handleTogglePoster(true) }}>

+ 14
- 13
src/pages/project/detail/index.js Näytä tiedosto

@@ -294,21 +294,22 @@ export default class Index extends Component {
294 294
   onShareAppMessage = () => {
295 295
     const {
296 296
       projectDetail: { shareContents, buildingName, buildingId, poster },
297
-      userInfo: { person: { personId } }
297
+      userInfo: { person: { personId, personType, userId } }
298 298
     } = this.props
299
+    const consultantId = personType == ROLE_CODE['CONSULTANT'] ? userId : ""
299 300
     // 分享埋点
300 301
     addItemShareNum(buildingId)
301
-
302
-    savePoint({
303
-      event: 'share',
304
-      eventType: 'building',
305
-      propertyName: '项目详情分享',
306
-      data: '{}'
307
-    }).then(res => {
308
-      console.log('项目详情分享')
309
-    })
310
-    const router = Taro.getStorageSync('router')
311
-    const consultant = this.$router.params.consultant || router.query.consultant || " "
302
+        savePoint({
303
+          event: 'share',
304
+          eventType: 'building',
305
+          propertyName: '项目详情分享',
306
+          consultantId: consultantId,
307
+          sharePersonId: personId,
308
+          data: '{}'
309
+        }).then(res => {
310
+          console.log('项目详情分享')
311
+        })
312
+    const consultant = personType == ROLE_CODE['CONSULTANT'] ? personId : ""
312 313
     return {
313 314
       title: shareContents[0].shareContentTitle,//分享内容
314 315
       path: `/pages/project/detail/index?id=${buildingId}&from=building_share&recommender=${personId}&consultant=${consultant}`,//分享地址
@@ -1235,7 +1236,7 @@ export default class Index extends Component {
1235 1236
               </View> */}
1236 1237
               <BackHomeBtn style={consultShow ? "bottom:320rpx" : ''}></BackHomeBtn>
1237 1238
               {
1238
-                consultShow && <Consultant style="bottom:170rpx" personId={userInfo.person.personId} name={userInfo.person.name || userInfo.person.nickname} data={consultData}></Consultant>
1239
+                consultShow && <Consultant style="bottom:160rpx" smallStyle="bottom:188rpx" personId={userInfo.person.personId} name={userInfo.person.name || userInfo.person.nickname} data={consultData}></Consultant>
1239 1240
               }
1240 1241
             </View>
1241 1242
           )