林凡 5 years ago
parent
commit
708f504d22
41 changed files with 1386 additions and 422 deletions
  1. 2
    2
      config/dev.js
  2. 1
    1
      config/prod.js
  3. 3
    1
      src/app.js
  4. BIN
      src/assets/person/cancel.png
  5. BIN
      src/assets/person/left.png
  6. BIN
      src/assets/person/message.png
  7. 96
    0
      src/components/consultant/index.js
  8. 93
    0
      src/components/consultant/index.scss
  9. 3
    0
      src/constants/api.js
  10. 8
    0
      src/constants/common.js
  11. 37
    10
      src/pages/activity/detail/assemble.js
  12. 34
    13
      src/pages/activity/detail/assistance.js
  13. 36
    18
      src/pages/activity/detail/index.js
  14. 35
    11
      src/pages/news/detail/index.js
  15. 13
    9
      src/pages/person/customerAnalysis/followUpCustomer/index.js
  16. 23
    0
      src/pages/person/customerAnalysis/followUpCustomer/index.scss
  17. 5
    5
      src/pages/person/customerAnalysis/index.scss
  18. 12
    1
      src/pages/person/customerAnalysis/myCustomer.js
  19. 14
    13
      src/pages/person/customerAnalysis/transactionCustomer/index.js
  20. 21
    0
      src/pages/person/customerAnalysis/transactionCustomer/index.scss
  21. 0
    134
      src/pages/person/index.scss
  22. 4
    4
      src/pages/person/menus.js
  23. 4
    61
      src/pages/person/myShare/accessRecord.js
  24. 124
    0
      src/pages/person/myShare/index.js
  25. 159
    0
      src/pages/person/myShare/index.scss
  26. 2
    2
      src/pages/project/detail/Around/Pannel.js
  27. 3
    3
      src/pages/project/detail/Around/Tab.js
  28. 78
    0
      src/pages/project/detail/Around/around.js
  29. 41
    0
      src/pages/project/detail/Around/around.scss
  30. 26
    13
      src/pages/project/detail/Around/index.js
  31. 48
    15
      src/pages/project/detail/Around/style.scss
  32. 63
    24
      src/pages/project/detail/index.js
  33. 1
    23
      src/pages/project/detail/index.scss
  34. 149
    0
      src/pages/project/detail/map.js
  35. 109
    47
      src/pages/project/h5Page.js
  36. 40
    5
      src/pages/project/index.js
  37. 7
    2
      src/services/common.js
  38. 4
    1
      src/utils/qrcode.js
  39. 12
    4
      src/utils/request.js
  40. 50
    0
      src/utils/rtLog.js
  41. 26
    0
      src/utils/tools.js

+ 2
- 2
config/dev.js View File

@@ -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.51:8080"',
13
-    // WSS_HOST: '"ws://192.168.2.51:8080"',
12
+    // HOST: '"http://127.0.0.1:8080"',
13
+    // WSS_HOST: '"ws://127.0.0.1:8080"',
14 14
     Version: 'V3.5.3'
15 15
   },
16 16
   weapp: {},

+ 1
- 1
config/prod.js View File

@@ -9,7 +9,7 @@ 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
-    Version:'V3.5.2.3'
12
+    Version:'V3.5.2.3_2019-12-16'
13 13
   },
14 14
   weapp: {},
15 15
   h5: {}

+ 3
- 1
src/app.js View File

@@ -45,7 +45,9 @@ class App extends Component {
45 45
       // 'pages/person/customerAnalysis/followUpCustomer/index',
46 46
       // 'pages/person/customerAnalysis/transactionCustomer/index',
47 47
       'pages/person/customerAnalysis/myCustomer',
48
-      'pages/person/accessRecord',
48
+      'pages/project/detail/map',
49
+      'pages/person/myShare/accessRecord',
50
+      'pages/person/myShare/index',
49 51
       'pages/shop/index',
50 52
       'pages/activity/activity',
51 53
       'pages/activity/myActivity',

BIN
src/assets/person/cancel.png View File


BIN
src/assets/person/left.png View File


BIN
src/assets/person/message.png View File


+ 96
- 0
src/components/consultant/index.js View File

@@ -0,0 +1,96 @@
1
+import Taro, { Component } from '@tarojs/taro';
2
+import './index.scss'
3
+import { transferImage } from '@utils/tools'
4
+import { reportClient } from '@services/report'
5
+
6
+export default class Index extends Component {
7
+    state = {
8
+        show: true,
9
+    }
10
+    static options = {
11
+        addGlobalClass: true,
12
+    };
13
+    static defaultProps = {
14
+        style: {},
15
+        data: []
16
+    }
17
+    componentDidMount() {
18
+
19
+    }
20
+    // 报备客户
21
+    reportClient() {
22
+
23
+        // const router = Taro.getStorageSync('router')
24
+        // const consultant = this.$router.params.consultant || router.query.consultant || ""
25
+        // const {
26
+        //     userInfo: { person: { phone, tel, userId } }
27
+        // } = this.props
28
+        // // debugger
29
+        // if (consultant && consultant != userId) {
30
+        //     const realPhone = phone || tel
31
+        //     const payload = {
32
+        //         realtyConsultant: consultant, //报备人 置业顾问
33
+        //         phone: realPhone,
34
+        //         showToast: false
35
+        //     }
36
+
37
+        //     reportClient(payload).then(res => {
38
+        //         console.log('恭喜您绑定成功')
39
+        //     }).catch(err => {
40
+        //         console.error(err)
41
+        //     })
42
+        // }
43
+    }
44
+    //   悬浮框显示隐藏
45
+    handleClick() {
46
+        setTimeout(() => {
47
+            this.setState({
48
+                show: false
49
+            })
50
+        }, 260)
51
+    }
52
+    handleClickTwo() {
53
+        setTimeout(() => {
54
+            this.setState({
55
+                show: true
56
+            })
57
+        }, 260)
58
+    }
59
+    // 拨打电话
60
+    handleTelClick(data, e) {
61
+        e.stopPropagation()
62
+        Taro.makePhoneCall({
63
+            phoneNumber: data.phone
64
+        })
65
+    }
66
+    handleChatClick(data, e) {
67
+        e.stopPropagation()
68
+        const { personId, name } = this.props
69
+        Taro.navigateTo({
70
+            url: `/pages/im/index?sendId=${personId}&sendName=${encodeURIComponent(name)}&receiverId=${data.id}&receiverName=${encodeURIComponent(data.name)}`
71
+        })
72
+    }
73
+    render() {
74
+        const { show } = this.state
75
+        const { data, style, smallStyle } = this.props
76
+        return (
77
+            <View >
78
+                <View className={show ? "consultant show" : "consultant hide"} style={smallStyle} onClick={this.handleClick}  >
79
+                    <Image src={require('@assets/person/left.png')} className='left-img'></Image>
80
+                    <Image src={transferImage(data.picture || require('@assets/default-avatar.png'))} className='img'></Image>
81
+                    <View className="text">{data.name || ''}</View>
82
+                </View>
83
+                <View className={show ? "consultant-more hide " : "consultant-more more-show "} style={style} >
84
+                    <Image src={require('@assets/person/cancel.png')} onClick={this.handleClickTwo} className='cancel-img'></Image>
85
+                    <Image src={transferImage(data.picture || require('@assets/default-avatar.png'))} className='touxiang'></Image>
86
+                    <View className="text">
87
+                        <View className="name">{data.name || ''}</View>
88
+                        <View className="company">{data.company || ''}</View>
89
+                    </View>
90
+                    <Image src={require('@assets/person/phone.png')} onClick={this.handleTelClick.bind(this, data)} className='phone-img'></Image>
91
+                    <Image src={require('@assets/person/message.png')} onClick={this.handleChatClick.bind(this, data)} className='message-img'></Image>
92
+                </View>
93
+            </View>
94
+        );
95
+    }
96
+}

+ 93
- 0
src/components/consultant/index.scss View File

@@ -0,0 +1,93 @@
1
+@import "@styles/theme.scss";
2
+.consultant {
3
+  position: fixed;
4
+  bottom: 169px;
5
+  right: 0;
6
+  height: 84px;
7
+  background-color: #fff;
8
+  box-shadow:0px 4px 12px 0px rgba(0,0,0,0.25);
9
+  border-radius:78px 0px 0px 78px;
10
+  z-index: 99;
11
+  display: flex;
12
+  align-items: center;
13
+  .left-img{
14
+      width: 18px;
15
+      height: 34px;
16
+      margin: 0 12px;
17
+  }
18
+  .img{
19
+    width: 48px;
20
+    height: 48px;
21
+    border-radius: 24px;
22
+    margin: 3px 0;
23
+  }
24
+  .text {
25
+    color: $primary-color;
26
+    font-size: 32px;
27
+    margin: 0 20px 0 10px;
28
+  }
29
+
30
+}
31
+    .show{
32
+    opacity: 1;
33
+    width: auto;
34
+    transition: 0.3s all ease-in;
35
+    }
36
+    .hide{
37
+    width: 0;
38
+    opacity: 0;
39
+    transition: 0.3s all ease-in;
40
+    }
41
+    .more-show{
42
+    width:706px;
43
+    opacity: 1;
44
+    transition: 0.3s all ease-in;
45
+    }
46
+
47
+.consultant-more{
48
+    height:140px;
49
+    background:rgba(0,0,0,0.5);
50
+    border-radius:146px 0px 0px 146px;
51
+    position: fixed;
52
+    bottom: 12%;
53
+    right: 0;
54
+    display: flex;
55
+    align-items: center;
56
+    z-index: 99;
57
+    .cancel-img{
58
+        width: 36px;
59
+        height: 36px;
60
+        margin: 0 16px;
61
+      }
62
+    .touxiang{
63
+        width: 86px;
64
+        height: 86px;
65
+        border-radius: 45px;
66
+        border:1px solid #fff;
67
+    }
68
+    .text{
69
+        margin:  0 10px;
70
+        .name{
71
+            font-size: 32px;
72
+            color: #fff;
73
+            width: 300px;
74
+            @include text-ellipsis;
75
+        }
76
+        .company{
77
+            font-size: 26px;
78
+            color: #fff;
79
+            margin-top: 12px;
80
+            width: 380px;
81
+            @include text-ellipsis;
82
+        }
83
+    }
84
+    .phone-img{
85
+        width:42px;
86
+        height:42px;
87
+    }
88
+    .message-img{
89
+        width:42px;
90
+        height:42px;
91
+        margin: 0 30px;
92
+    }
93
+}

+ 3
- 0
src/constants/api.js View File

@@ -184,3 +184,6 @@ export const API_ECHERTS_MONTH = resolvePath('customerStatisticMonthly')
184 184
 export const API_BUILDING_TYPE = resolvePath('getByBuildingIdSelectBuildingProjectType')
185 185
 export const API_CONSULTANT_VISIT_RECORD = resolvePath('visitRecord')
186 186
 export const API_MORE_ACTIVITY = resolvePath('visitRecord/activity')
187
+
188
+// 消息模板
189
+export const API_TEMPLATE_TYPE = resolvePath('template/of/')

+ 8
- 0
src/constants/common.js View File

@@ -0,0 +1,8 @@
1
+// 通知消息
2
+export const TPL_NOTICE = "notice";
3
+
4
+// 助力消息
5
+export const TPL_HELP = "help-result";
6
+
7
+// 拼团消息
8
+export const TPL_GROUP = "group-result";

+ 37
- 10
src/pages/activity/detail/assemble.js View File

@@ -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}`)
@@ -320,13 +337,18 @@ export default class Detail extends Component {
320 337
 
321 338
 
322 339
   onShareAppMessage = () => {
323
-    const { shares } = this.state
340
+    const { shares, detail: { groupActivityId } } = 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,
351
+      targetId: groupActivityId,
330 352
       data: '{}'
331 353
     })
332 354
 
@@ -502,6 +524,8 @@ export default class Detail extends Component {
502 524
       qrCode,
503 525
       leftTime,
504 526
       ltTicker,
527
+      consultData,
528
+      consultShow
505 529
     } = this.state
506 530
 
507 531
     const { userInfo } = this.props
@@ -531,6 +555,10 @@ export default class Detail extends Component {
531 555
 
532 556
     return (
533 557
       <Block>
558
+        <BackHomeBtn style={consultShow ? "bottom:310rpx" : ''}></BackHomeBtn>
559
+        {
560
+          consultShow && <Consultant style="bottom:150rpx" smallStyle="bottom:178rpx" personId={userInfo.person.personId} name={userInfo.person.name || userInfo.person.nickname} data={consultData}></Consultant>
561
+        }
534 562
         {/* 生成海报 */}
535 563
         {posterVisible && !ltTicker.processing &&
536 564
           (
@@ -546,7 +574,6 @@ export default class Detail extends Component {
546 574
           grantAvatarVisible &&
547 575
           <AchieveAvatar user={userInfo.person} onSuccess={() => { this.setState({ grantAvatarVisible: false }) }} ></AchieveAvatar>
548 576
         }
549
-        <BackHomeBtn></BackHomeBtn>
550 577
         {
551 578
           loaded && (
552 579
             <View className="ass-page">

+ 34
- 13
src/pages/activity/detail/assistance.js View File

@@ -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}`)
@@ -321,13 +338,18 @@ export default class Detail extends Component {
321 338
   }
322 339
 
323 340
   onShareAppMessage = () => {
324
-    const { shares } = this.state
341
+    const { shares, id } = 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,
352
+      targetId: id,
331 353
       data: '{}'
332 354
     })
333 355
 
@@ -494,6 +516,8 @@ export default class Detail extends Component {
494 516
       qrCode,
495 517
       leftTime,
496 518
       ltTicker,
519
+      consultData,
520
+      consultShow
497 521
     } = this.state
498 522
 
499 523
     const { userInfo } = this.props
@@ -509,15 +533,16 @@ export default class Detail extends Component {
509 533
       date: dayjs().format('YYYY.MM.DD'),
510 534
       appName: (userInfo.miniApp || {}).name,
511 535
     }
512
-
513 536
     const posterConfigs = this.transTPLs2Configs(posterTpls, posterData)
514
-
515
-    console.log('------posterData------', posterData)
516
-    console.log('------posterConfigs------', posterConfigs)
537
+    // console.log('------posterData------', posterData)
538
+    // console.log('------posterConfigs------', posterConfigs)
517 539
     const isJoin = helpList.filter(x => x.personId === userInfo.person.personId)[0] || isStarter
518
-
519 540
     return (
520 541
       <View>
542
+        <BackHomeBtn style={consultShow ? "bottom:200rpx" : ''}></BackHomeBtn>
543
+        {
544
+          consultShow && <Consultant style="bottom:40rpx" smallStyle="bottom:68rpx" personId={userInfo.person.personId} name={userInfo.person.name || userInfo.person.nickname} data={consultData}></Consultant>
545
+        }
521 546
         {/* 生成海报 */}
522 547
         {posterVisible && !ltTicker.processing &&
523 548
           (
@@ -532,7 +557,6 @@ export default class Detail extends Component {
532 557
           grantAvatarVisible &&
533 558
           <AchieveAvatar user={userInfo.person} onSuccess={() => { this.setState({ grantAvatarVisible: false }) }} ></AchieveAvatar>
534 559
         }
535
-        <BackHomeBtn></BackHomeBtn>
536 560
         {
537 561
           loaded && (
538 562
             <View className="ass-page">
@@ -545,14 +569,11 @@ export default class Detail extends Component {
545 569
                   <Text className="row-text">{actState != ActFinished ? formateLeftTime(leftTime) : '活动已结束'}</Text>
546 570
                 </View>
547 571
                 {detail.successNum > 0 &&
548
-
549 572
                   <View className="success-num">
550 573
                     <View className="triangle"></View>
551 574
                     <View className="text">已成功 {detail.successNum}</View>
552 575
                   </View>
553
-
554 576
                 }
555
-
556 577
               </View>
557 578
               <ScrollView
558 579
                 scrollY
@@ -618,7 +639,7 @@ export default class Detail extends Component {
618 639
                     isStarter && actState === ActInProcess && helpState === HelpInProcess &&
619 640
                     // (<Block>
620 641
                     //   <View className="set-btn">生成海报</View>
621
-                      <View className="assistance-btn"><FormIdCollector><Button className="assistance-btn" onClick={this.askForHelp}>邀请好友助力</Button></FormIdCollector></View>
642
+                    <View className="assistance-btn"><FormIdCollector><Button className="assistance-btn" onClick={this.askForHelp}>邀请好友助力</Button></FormIdCollector></View>
622 643
                     // </Block>)
623 644
                   }
624 645
                   {

+ 36
- 18
src/pages/activity/detail/index.js View File

@@ -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,28 @@ 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,
142
+      targetId: dynamicId,
128 143
       data: '{}'
129 144
     }).then(res => {
130 145
       console.log('活动详情分享')
131 146
     })
132
-
147
+    const consultant = personType == ROLE_CODE['CONSULTANT'] ? personId : ""
133 148
     return {
134 149
       title: shareContents[0].shareContentTitle,
135
-      path: `/pages/activity/detail/index?id=${dynamicId}&from=dynamic_share&recommender=${personId}`,//分享地址
150
+      path: `/pages/activity/detail/index?id=${dynamicId}&from=dynamic_share&recommender=${personId}&consultant=${consultant}`,//分享地址
136 151
       imageUrl: shareContents[0].shareContentImg
137 152
     }
138 153
 
@@ -207,12 +222,16 @@ export default class Detail extends Component {
207 222
       }
208 223
 
209 224
       const { userInfo: { person, miniApp } } = this.props
210
-      const { avatarurl, nickname, personId } = person
225
+      const { avatarurl, nickname, personId, personType, phone, tel } = person
211 226
       const { detail: { dynamicId, posters, createDate } } = this.state
227
+      const consultant = personType == ROLE_CODE['CONSULTANT'] ? personId : ""
228
+      const phoneNum = phone || tel
229
+      
212 230
       const payload = {
213
-        "scene": `id=${dynamicId}&from=dynamic_share&recommender=${personId}`,
231
+        "scene": `id=${dynamicId}&from=dynamic_share&recommender=${personId}&consultant=${consultant}&phoneNum=${phoneNum}`,
214 232
         "page": 'pages/activity/detail/index',
215 233
       }
234
+   
216 235
       // debugger
217 236
       const _avatarurl = getDownloadURL(avatarurl, 'avatar');
218 237
       getMiniQrcode(payload).then(qrcode => {
@@ -328,8 +347,8 @@ export default class Detail extends Component {
328 347
   }
329 348
 
330 349
   render() {
331
-    const { detail, loaded, isSaved, isSign, posterVisible, posterData, posterShow } = this.state
332
-    const { userInfo: { person: { phone } } } = this.props
350
+    const { detail, loaded, isSaved, isSign, posterVisible, posterData, posterShow, consultData, consultShow } = this.state
351
+    const { userInfo: { person: { phone, personId, nickname, name } } } = this.props
333 352
     return (
334 353
       <Block>
335 354
         {/* 生成海报 */}
@@ -379,16 +398,15 @@ export default class Detail extends Component {
379 398
                     <template is='wxParse' data='{{wxParseData:article.nodes}}' /> */}
380 399
                   </View>
381 400
                   <View style="color:#999;font-size:15px;margin:0 auto 90px auto;text-align:center">已经到底了~</View>
382
-
383 401
                 </View>
384 402
               </ScrollView>
385
-
386
-              <View className="chat-entrance" onClick={this.handleMoreClick}>
403
+              {/* <View className="chat-entrance" onClick={this.handleMoreClick}>
387 404
                 <Text className="iconfont icon-chat"></Text>
388
-              </View>
389
-
390
-              <BackHomeBtn></BackHomeBtn>
391
-
405
+              </View> */}
406
+              <BackHomeBtn style={consultShow ? "bottom:300rpx" : ''}></BackHomeBtn>
407
+              {
408
+                consultShow && <Consultant style="bottom:140rpx" personId={personId} name={name || nickname} data={consultData}></Consultant>
409
+              }
392 410
               <View className="bot-nav flex">
393 411
                 {
394 412
                   posterShow && (

+ 35
- 11
src/pages/news/detail/index.js View File

@@ -9,6 +9,9 @@ import Notice from '@components/Notice'
9 9
 import { getMiniQrcode, savePoint, updatePoint } from '@services/common'
10 10
 import { getDownloadURL, 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
   addNewsUv,
14 17
   favorNews,
@@ -33,6 +36,8 @@ export default class NewsDetail extends Component {
33 36
     posterShow: 'none',
34 37
     posterData: {},
35 38
     posterVisible: false,
39
+    consultData: {}, // 分享的置业顾问信息
40
+    consultShow: false  // 置业顾问悬浮框显示隐藏
36 41
   }
37 42
 
38 43
   componentWillMount() {
@@ -44,6 +49,15 @@ export default class NewsDetail extends Component {
44 49
 
45 50
       const newsId = this.$router.params.id || router.query.id
46 51
 
52
+      const consultant = this.$router.params.consultant || router.query.consultant
53
+      if (consultant) {
54
+        getCardDetail(consultant).then(res => {
55
+          this.setState({
56
+            consultData: res,
57
+            consultShow: true
58
+          })
59
+        })
60
+      }
47 61
       if (!newsId) {
48 62
         getQrCodeParams(this.$router.params.scene).then(res => {
49 63
           this.setState({ newsId: res.id }, () => {
@@ -106,12 +120,18 @@ export default class NewsDetail extends Component {
106 120
     })
107 121
   }
108 122
   onShareAppMessage = () => {
109
-    const { detail: { shareContents,newsName, newsId, newsImg } } = this.state
110
-    const { userInfo: { person: { personId } } } = this.props
123
+    const { detail: { shareContents, newsName, newsId, newsImg } } = this.state
124
+    const { userInfo: { person: { personId, personType, userId } } } = this.props
125
+    const consultantId = personType == ROLE_CODE['CONSULTANT'] ? userId : ""
126
+    const consultant = personType == ROLE_CODE['CONSULTANT'] ? personId : ""
127
+
111 128
     savePoint({
112 129
       event: 'share',
113
-      eventType: 'activity',
130
+      eventType: 'news',
114 131
       propertyName: '资讯详情分享',
132
+      consultantId: consultantId,
133
+      sharePersonId: personId,
134
+      targetId:newsId,
115 135
       data: '{}'
116 136
     }).then(res => {
117 137
       console.info('资讯详情分享')
@@ -122,7 +142,7 @@ export default class NewsDetail extends Component {
122 142
 
123 143
     return {
124 144
       title: shareContents[0].shareContentTitle,
125
-      path: `/pages/news/detail/index?id=${newsId}&from=news_share&recommender=${personId}`,//分享地址
145
+      path: `/pages/news/detail/index?id=${newsId}&from=news_share&recommender=${personId}&consultant=${consultant}`,//分享地址
126 146
       imageUrl: shareContents[0].shareContentImg
127 147
     }
128 148
   }
@@ -170,10 +190,12 @@ export default class NewsDetail extends Component {
170 190
         return
171 191
       }
172 192
       const { userInfo: { person, miniApp } } = this.props
173
-      const { avatarurl, nickname, personId } = person
193
+      const { avatarurl, nickname, personId, personType, phone, tel } = person
174 194
       const { newsId, detail: { posters, newsName, createDate } } = this.state
195
+      const consultant = personType == ROLE_CODE['CONSULTANT'] ? personId : ""
196
+      const phoneNum = phone || tel
175 197
       const payload = {
176
-        "scene": `id=${newsId}&from=news_share&recommender=${personId}`,
198
+        "scene": `id=${newsId}&from=news_share&recommender=${personId}&consultant=${consultant}&phoneNum=${phoneNum}`,
177 199
         "page": 'pages/news/detail/index',
178 200
       }
179 201
       const _avatarurl = getDownloadURL(avatarurl, 'avatar');
@@ -188,6 +210,7 @@ export default class NewsDetail extends Component {
188 210
           createDate: createDate,//资讯时间
189 211
           poster: posters[0].posterImg,
190 212
           miniAppName: miniApp.name,
213
+
191 214
         }
192 215
         resolve(data)
193 216
       })
@@ -218,7 +241,8 @@ export default class NewsDetail extends Component {
218 241
     })
219 242
   }
220 243
   render() {
221
-    const { detail, loaded, isSaved, posterVisible, posterData, posterShow } = this.state
244
+    const { detail, loaded, isSaved, posterVisible, posterData, posterShow, consultData, consultShow } = this.state
245
+    const { userInfo: { person: { personId, nickname, name } } } = this.props
222 246
     return (
223 247
       <Block>
224 248
         {/* 生成海报 */}
@@ -234,7 +258,6 @@ export default class NewsDetail extends Component {
234 258
                     {/* <View><Text className="iconfont icon-fenxiang1"></Text>{detail.shareNum || 0}</View> */}
235 259
                     <View className='fenx'><Image src={require('@assets/person/fenxiang.png')} className='fenxiang1-img'></Image>{detail.shareNum || 0}</View>
236 260
                   </View>
237
-
238 261
                   <View>{dayjs(detail.createDate).format('YYYY-MM-DD')}</View>
239 262
                 </View>
240 263
                 {/* <Image mode="widthFix" style={{ width: '100%', marginTop: '20px' }} src={transferImage(detail.newsImg)}></Image> */}
@@ -243,10 +266,11 @@ export default class NewsDetail extends Component {
243 266
                   <template is='wxParse' data='{{wxParseData:article.nodes}}' />
244 267
                 </View>
245 268
               </ScrollView>
246
-              
247 269
               <Notice></Notice>
248
-              <BackHomeBtn></BackHomeBtn>
249
-
270
+              <BackHomeBtn style={consultShow ? "bottom:310rpx" : ''}></BackHomeBtn>
271
+              {
272
+                consultShow && <Consultant style="bottom:150rpx" smallStyle="bottom:178rpx" personId={personId} name={name || nickname} data={consultData}></Consultant>
273
+              }
250 274
               <View className="bot-nav flex">
251 275
                 <View className='btn poster-btn' style={{ display: posterShow }} onClick={() => { this.handleTogglePoster(true) }}>
252 276
                   {/* <Text className="iconfont icon-xiazai"></Text> */}

+ 13
- 9
src/pages/person/customerAnalysis/followUpCustomer/index.js View File

@@ -10,7 +10,8 @@ import { transferImage } from '@utils/tools'
10 10
 
11 11
 const maleImg = require('@assets/person/male.png')
12 12
 const femaleImg = require('@assets/person/female.png')
13
-const phoneImg = require('@assets/person/phone.png')
13
+const phoneImg = require('@assets/person/dianhua.png')
14
+const communicateImg = require('@assets/person/communicate.png')
14 15
 
15 16
 @connect(({ user, city }) => ({ user, city }))
16 17
 export default class transactionCustomer extends Taro.Component {
@@ -247,7 +248,13 @@ export default class transactionCustomer extends Taro.Component {
247 248
       </View>
248 249
     )
249 250
   }
250
-
251
+  handleChatClick(item, e) {
252
+    e.stopPropagation()
253
+    const { userInfo: { person: { personId, nickname, name } } } = this.props
254
+    Taro.navigateTo({
255
+      url: `/pages/im/index?sendId=${personId}&sendName=${encodeURIComponent(name || nickname)}&receiverId=${item.personId}&receiverName=${encodeURIComponent(item.name || item.nickname)}`
256
+    })
257
+  }
251 258
   render() {
252 259
     const { customerList, screenVisible, isEmpty, hasMore } = this.state
253 260
 
@@ -272,18 +279,13 @@ export default class transactionCustomer extends Taro.Component {
272 279
             onScrollToLower={fn => this.onScrollToLower(fn)}
273 280
           >
274 281
             <View className="list">
275
-              {
276
-                !customerList.length &&
277
-                <View></View>
278
-                // <View style="margin:50px auto;text-align:center;font-size:14px;color:#888">暂无跟进客户~</View>
279
-              }
280 282
               {
281 283
                 customerList.length &&
282 284
                 customerList.map((item, index) => (
283 285
                   <View class="item" key={index + 'customerList'} onClick={this.toMyCustomer.bind(this, item.customerId)}>
284 286
                     <Image src={transferImage(item.picture) || require('@assets/default-avatar.png')} className='img'></Image>
285 287
                     <View className="name">
286
-                      {item.name}
288
+                      <Text class="name-text">{item.name}</Text>
287 289
                       {
288 290
                         item.sex == '1' && <Image style="width:36rpx;height:38rpx;margin-left:10rpx" src={maleImg} />
289 291
                       }
@@ -291,7 +293,9 @@ export default class transactionCustomer extends Taro.Component {
291 293
                         item.sex == '2' && <Image src={femaleImg} style="width:36rpx;height:36rpx;margin-left:10rpx" />
292 294
                       }
293 295
                     </View>
294
-                    <View className="phone" onClick={this.handleTelClick.bind(this, item)}>{item.phone}<Image style="width:36rpx;height:36rpx;margin-left:20rpx;" src={phoneImg} /></View>
296
+                    <View className="phone" >{item.phone}</View>
297
+                    <Image className="phone-icon" onClick={this.handleTelClick.bind(this, item)} src={phoneImg} />
298
+                    <Image className="goutong-icon" onClick={this.handleChatClick.bind(this, item)} src={communicateImg}></Image>
295 299
                     <View className="status">{item.status == 1 ? '报备' : item.status == 2 ? '到访' : item.status == 3 ? '认筹' : '签约'}</View>
296 300
                   </View>
297 301
                 ))

+ 23
- 0
src/pages/person/customerAnalysis/followUpCustomer/index.scss View File

@@ -156,6 +156,12 @@
156 156
     top:24px;
157 157
     left:120px;
158 158
   }
159
+  .name-text{
160
+    display: inline-block;
161
+    max-width: 200px;
162
+    @include text-ellipsis;
163
+
164
+  }
159 165
   .phone{
160 166
     color: #333;
161 167
     font-size: 30px;
@@ -165,8 +171,25 @@
165 171
     display: flex;
166 172
     align-items: center;
167 173
   }
174
+  .goutong-icon{
175
+    position: absolute;
176
+    width:76px;
177
+    height:76px;
178
+    top: 36px;
179
+    right:222px;
180
+  }
181
+  .phone-icon{
182
+    position: absolute;
183
+    width:76px;
184
+    height:76px;
185
+    top: 36px;
186
+    right:100px;
187
+  }
168 188
   .status{
169 189
     color:$primary-color;
170 190
     font-size: 32px;
191
+    position: absolute;
192
+    top: 20px;
193
+    right: 20px;
171 194
   }
172 195
 }

+ 5
- 5
src/pages/person/customerAnalysis/index.scss View File

@@ -182,15 +182,15 @@
182 182
     border-radius: 50%;
183 183
     position: absolute;
184 184
     top:50%;
185
-    left: 128px;
185
+    left: 56px;
186 186
     margin-top: -88px;
187 187
   }
188 188
   .user__left__name{
189 189
     font-size:32px;
190 190
     color: $primary-color;
191 191
     position: absolute;
192
-    top:76px;
193
-    left:320px;
192
+    top:66px;
193
+    left:250px;
194 194
     display: flex;
195 195
     align-items: center;
196 196
     .text{
@@ -202,8 +202,8 @@
202 202
     font-size:32px;
203 203
     color: #333;
204 204
     position: absolute;
205
-    bottom:76px;
206
-    left:320px;
205
+    bottom:62px;
206
+    left:250px;
207 207
     display: flex;
208 208
     align-items: center;
209 209
   }

+ 12
- 1
src/pages/person/customerAnalysis/myCustomer.js View File

@@ -13,6 +13,7 @@ import emptyImg from '@assets/empty.png'
13 13
 const maleImg = require('@assets/person/male.png')
14 14
 const femaleImg = require('@assets/person/female.png')
15 15
 const phoneImg = require('@assets/person/phone.png')
16
+const messageImg = require('@assets/person/message.png')
16 17
 
17 18
 @connect(({ user, city }) => ({ user, city }))
18 19
 export default class myCustomer extends Taro.Component {
@@ -363,6 +364,13 @@ export default class myCustomer extends Taro.Component {
363 364
       followVisible: false,
364 365
     })
365 366
   }
367
+  handleChatClick(item, e) {
368
+    e.stopPropagation()
369
+    const { userInfo: { person: { personId, nickname, name } } } = this.props
370
+    Taro.navigateTo({
371
+      url: `/pages/im/index?sendId=${personId}&sendName=${encodeURIComponent(name || nickname)}&receiverId=${item.personId}&receiverName=${encodeURIComponent(item.name || item.nickname)}`
372
+    })
373
+  }
366 374
   renderBaseBox() {
367 375
     const { baseInfo, desc, selector, sexSelector } = this.state
368 376
     return (
@@ -462,7 +470,10 @@ export default class myCustomer extends Taro.Component {
462 470
               customerDetail.sex == '2' && <Image style="width:36rpx;height:36rpx;margin-left:10rpx" src={femaleImg} />
463 471
             }
464 472
           </View>
465
-          <View onClick={this.handleTelClick.bind(this, customerDetail)} className='user__left__phone'>{customerDetail.phone}<Image style="width:36rpx;height:36rpx;margin-left:20rpx;" src={phoneImg} /></View>
473
+          <View className='user__left__phone'>{customerDetail.phone}
474
+            <Image onClick={this.handleTelClick.bind(this, customerDetail)} style="width:36rpx;height:36rpx;margin-left:20rpx;background:rgba(255,219,179,0.2);padding: 14rpx;border-radius: 30rpx;" src={phoneImg} />
475
+            <Image onClick={this.handleChatClick.bind(this, item)} style="width:36rpx;height:36rpx;margin-left:40rpx;background:rgba(255,219,179,0.2);padding: 14rpx;border-radius: 30rpx;" src={messageImg} />
476
+          </View>
466 477
         </View>
467 478
         <AtTabs height="calc(100vh - 300rpx)" className="my-tab" current={this.state.current} tabList={tabList} onClick={this.handleClick.bind(this)}>
468 479
           <AtTabsPane current={this.state.current} index={0} >

+ 14
- 13
src/pages/person/customerAnalysis/transactionCustomer/index.js View File

@@ -7,7 +7,8 @@ import { transferImage } from '@utils/tools'
7 7
 
8 8
 const maleImg = require('@assets/person/male.png')
9 9
 const femaleImg = require('@assets/person/female.png')
10
-const phoneImg = require('@assets/person/phone.png')
10
+const phoneImg = require('@assets/person/dianhua.png')
11
+const communicateImg = require('@assets/person/communicate.png')
11 12
 
12 13
 
13 14
 @connect(({ user, city }) => ({ user, city }))
@@ -86,7 +87,13 @@ export default class transactionCustomer extends Taro.Component {
86 87
       followVisible: false,
87 88
     })
88 89
   }
89
-
90
+  handleChatClick(item, e) {
91
+    e.stopPropagation()
92
+    const { userInfo: { person: { personId, nickname, name } } } = this.props
93
+    Taro.navigateTo({
94
+      url: `/pages/im/index?sendId=${personId}&sendName=${encodeURIComponent(name || nickname)}&receiverId=${item.personId}&receiverName=${encodeURIComponent(item.name || item.nickname)}`
95
+    })
96
+  }
90 97
   render() {
91 98
     const { customerList, isEmpty, hasMore } = this.state
92 99
 
@@ -102,35 +109,29 @@ export default class transactionCustomer extends Taro.Component {
102 109
           onScrollToLower={fn => this.onScrollToLower(fn)}
103 110
         >
104 111
           <View className="list">
105
-            {
106
-              !customerList.length &&
107
-              <View></View>
108
-              // <View style="margin:50px auto;text-align:center;font-size:14px;color:#888">暂无成交客户~</View>
109
-            }
110 112
             {
111 113
               customerList.length &&
112 114
               customerList.map((item, index) => (
113 115
                 <View class="item" key={index + 'transaction'} onClick={this.toMyCustomer.bind(this, item.customerId)}>
114 116
                   <Image src={transferImage(item.picture) || require('@assets/default-avatar.png')} className='img'></Image>
115 117
                   <View className="name">
116
-                    {item.name}
118
+                    <Text class="name-text">{item.name}</Text>
117 119
                     {
118
-                      item.sex == '1' && <Image style="width:36rpx;height:38rpx;margin-left:10rpx" src={maleImg} />
120
+                      item.sex == '1' && <Image style="width:36rpx;height:38rpx;margin-left:20rpx" src={maleImg} />
119 121
                     }
120 122
                     {
121
-                      item.sex == '2' && <Image style="width:36rpx;height:36rpx;margin-left:10rpx" src={femaleImg} />
123
+                      item.sex == '2' && <Image style="width:36rpx;height:36rpx;margin-left:20rpx" src={femaleImg} />
122 124
                     }
123 125
                   </View>
124 126
                   <View className="phone">{item.phone} </View>
125
-                  <Image style="width:36rpx;height:36rpx;margin-right:20rpx" src={phoneImg} onClick={this.handleTelClick.bind(this, item)} />
127
+                  <Image className="phone-icon" src={phoneImg} onClick={this.handleTelClick.bind(this, item)} />
128
+                  <Image className="goutong-icon" onClick={this.handleChatClick.bind(this, item)} src={communicateImg} ></Image>
126 129
 
127 130
                 </View>
128 131
               ))
129 132
             }
130 133
           </View>
131 134
         </ListView>
132
-
133
-
134 135
       </View>
135 136
     )
136 137
   }

+ 21
- 0
src/pages/person/customerAnalysis/transactionCustomer/index.scss View File

@@ -20,6 +20,12 @@
20 20
     top:24px;
21 21
     left:120px;
22 22
   }
23
+  .name-text{
24
+    display: inline-block;
25
+    max-width: 200px;
26
+    @include text-ellipsis;
27
+
28
+  }
23 29
   .phone{
24 30
     color: #333;
25 31
     font-size: 30px;
@@ -27,4 +33,19 @@
27 33
     bottom:24px;
28 34
     left:120px;
29 35
   }
36
+ 
37
+  .goutong-icon{
38
+    position: absolute;
39
+    width:76px;
40
+    height:76px;
41
+    top: 36px;
42
+    right:220px;
43
+  }
44
+  .phone-icon{
45
+    position: absolute;
46
+    width:76px;
47
+    height:76px;
48
+    top: 36px;
49
+    right:98px;
50
+  }
30 51
 }

+ 0
- 134
src/pages/person/index.scss View File

@@ -329,138 +329,4 @@
329 329
     height: 40px;
330 330
   }
331 331
 }
332
-.access-page{
333
-  padding: 30px;
334
-  .item{
335
-    height: 268px;
336
-    background: rgba(255,255,255,1);
337
-    box-shadow: 0px 4px 20px 0px rgba(0,0,0,0.09);
338
-    border-radius: 12px;
339
-    padding: 30px;
340
-    position: relative;
341
-    margin-bottom: 20px;
342
-    .tag{
343
-      position: absolute;
344
-      left: 26px;
345
-      top: 102px;
346
-      width:96px;
347
-      height:32px;
348
-      line-height: 32px;
349
-      text-align: center;
350
-      background:rgba(237,202,115,1);
351
-      border-radius:2px;
352
-      font-size: 22px;
353
-      color: #fff;
354
-    }
355
-    .touxiang{
356
-      width:88px;
357
-      height:88px;
358
-      border-radius: 44px;
359
-    }
360
-    .info-top{
361
-      display: flex;
362
-      position: absolute;
363
-      top: 46px;
364
-      left:140px;
365
-      align-items: center;
366
-      justify-content: space-between;
367
-      width: 520px;
368
-      .name{
369
-        font-size: 40px;
370
-        color: #000;
371
-        font-weight: 500;
372
-        max-width: 300px;
373
-        @include text-ellipsis;
374
-      }
375
-      .goutong-icon{
376
-        width:44px;
377
-        height:44px;
378
-        background:rgba(255,219,179,0.2);
379
-        border-radius: 22px;
380
-        margin: 0 10px;
381
-      }
382
-      .goutong{
383
-        font-size: 38px;
384
-        color: $primary-color;
385
-        border-bottom: 4px solid #EDCA73;
386
-        line-height: 28px;
387
-      }
388 332
 
389
-    }
390
-    .right-icon{
391
-      position: absolute;
392
-      right: 30px;
393
-      top: 150px;
394
-      width:20px;
395
-      height:20px;
396
-      border-top: 3px solid #888888;
397
-      border-right: 3px solid #888888;
398
-      transform:rotate(45deg);
399
-    }
400
-    .activity-name{
401
-      font-size: 32px;
402
-      color: #353535;
403
-      width: 620px;
404
-      @include text-ellipsis;
405
-      line-height: 72px;
406
-    }
407
-    .activity-time{
408
-      font-size: 26px;
409
-      color:rgba(0,0,0,0.33);
410
-      line-height: 40px;
411
-      text-align: right;
412
-    }
413
-  }
414
-}
415
-.pop-box{
416
-    position: fixed;
417
-    width: 100vw;
418
-    height: 100vh;
419
-    left: 0;
420
-    top: 0;
421
-    z-index: 9999;
422
-    background: rgba(0, 0, 0, 0.22);
423
-    display: flex;
424
-    flex-direction: column;
425
-    justify-content: center;
426
-    align-items: center;
427
-    .content {
428
-      width: 92vw;
429
-      height: 600px;
430
-      position: absolute;
431
-      left: 4vw;
432
-      top: 12vh;
433
-      background-color: #fff;
434
-      border-radius: 12px;
435
-      padding: 20px 20px;
436
-
437
-      .scroll-con{
438
-        height: 500px;
439
-        width: 100%;
440
-        overflow-y: scroll;
441
-        .activity-item{
442
-          padding: 16px 30px;
443
-          border-bottom: 2px solid rgba(0,0,0,0.08);
444
-          .name{
445
-            font-size: 32px;
446
-            color: #353535;
447
-            width: 600px;
448
-            @include text-ellipsis;
449
-          }
450
-          .time{
451
-            font-size: 26px;
452
-            color:rgba(0,0,0,0.33);
453
-            text-align: right;
454
-            margin-top: 20px;
455
-          }
456
-        }
457
-
458
-      }
459
-
460
-    }
461
-    .close{
462
-      font-size: 48px;
463
-      color: rgba(0,0,0,0.3);
464
-      float: right;
465
-    }
466
-}

+ 4
- 4
src/pages/person/menus.js View File

@@ -17,7 +17,7 @@ const icons = {
17 17
   consultant: require('@assets/mine/consultant.png'),
18 18
   customerAnalysis: require('@assets/mine/customerAnalysis.png'),
19 19
   fenxi: require('@assets/mine/fenxi.png'),
20
-  accessrecord: require('@assets/mine/accessrecord.png'),
20
+  share: require('@assets/mine/accessrecord.png'),
21 21
 }
22 22
 
23 23
 const DRIFT = ROLE_CODE['DRIFT']
@@ -60,9 +60,9 @@ const menus = [
60 60
       style: '',
61 61
     },
62 62
     {
63
-      name: '访客信息',
64
-      url: '/pages/person/accessRecord',
65
-      icon: icons.accessrecord,
63
+      name: '我的分享',
64
+      url: '/pages/person/myShare/index',
65
+      icon: icons.share,
66 66
       extends: undefined,
67 67
       userTypes: [CONSULTANT],
68 68
       style: '',

src/pages/person/accessRecord.js → src/pages/person/myShare/accessRecord.js View File

@@ -2,7 +2,7 @@ import Taro, { Component } from '@tarojs/taro';
2 2
 import ListView from '@components/ListView'
3 3
 import { connect } from '@tarojs/redux'
4 4
 import './index.scss'
5
-import { getConsulantVisitRecord, getMoreVisitRecord } from '@services/person'
5
+import { getConsulantVisitRecord } from '@services/person'
6 6
 import { savePoint, updatePoint } from '@services/common'
7 7
 import dayjs from 'dayjs';
8 8
 
@@ -14,13 +14,11 @@ export default class Person extends Component {
14 14
   }
15 15
 
16 16
   state = {
17
-    popVisible: false,
18 17
     recordId: undefined, // 埋点ID
19 18
     recordList: [],
20 19
     hasMore: true,
21 20
     isEmpty: false,
22 21
     pageIndex: 1,
23
-    moreRecord: []
24 22
   }
25 23
 
26 24
   componentWillMount() {
@@ -41,12 +39,6 @@ export default class Person extends Component {
41 39
     const { recordId } = this.state
42 40
     recordId && updatePoint(recordId)
43 41
   }
44
-
45
-  handleMaskClose() {
46
-    this.setState({
47
-      popVisible: false,
48
-    })
49
-  }
50 42
   componentDidShow() {
51 43
     Taro.showLoading()
52 44
     this.loadList(1)
@@ -96,30 +88,6 @@ export default class Person extends Component {
96 88
     rest && rest()
97 89
     this.refreshing = false
98 90
   }
99
-
100
-
101
-  showActivityList(item) {
102
-    Taro.showLoading()
103
-    this.setState({
104
-      popVisible: true,
105
-    })
106
-
107
-    const { userInfo: { person } } = this.props
108
-    const payload = {
109
-      userId: person.userId,
110
-      personId: item.personId,
111
-    }
112
-    getMoreVisitRecord(payload).then(res => {
113
-      Taro.hideLoading()
114
-      this.setState({
115
-        moreRecord: res.records || []
116
-      })
117
-
118
-    }).catch(err => {
119
-      console.log(err, "获取更多访客信息err")
120
-      Taro.hideLoading()
121
-    })
122
-  }
123 91
   handleChatClick(item, e) {
124 92
     e.stopPropagation()
125 93
     const { userInfo: { person: { personId, nickname, name } } } = this.props
@@ -127,32 +95,12 @@ export default class Person extends Component {
127 95
       url: `/pages/im/index?sendId=${personId}&sendName=${encodeURIComponent(name || nickname)}&receiverId=${item.personId}&receiverName=${encodeURIComponent(item.name || item.nickname)}`
128 96
     })
129 97
   }
130
-  renderPop() {
131
-    const { moreRecord } = this.state
132
-    return (
133
-      <View className="pop-box">
134
-        <View className="content">
135
-          <Icon className="iconfont close icon-buoumaotubiao20" onClick={this.handleMaskClose}></Icon>
136
-          <View className="scroll-con">
137
-            {
138
-              moreRecord.map(item => (
139
-                <View className="activity-item">
140
-                  <View className="name">{item.activityName || ' '}</View>
141
-                  <View className="time">{`${dayjs(item.visitTime).format('YYYY-MM-DD HH:mm:ss')}`}</View>
142
-                </View>
143
-              ))
144
-            }
145
-          </View>
146
-        </View>
147
-      </View>
148
-    )
149
-  }
98
+
150 99
   render() {
151
-    const { popVisible, isEmpty, hasMore, recordList } = this.state
100
+    const { isEmpty, hasMore, recordList } = this.state
152 101
     return (
153
-      <Block>
154
-        {popVisible && this.renderPop()}
155 102
 
103
+      <Block>
156 104
         <ListView
157 105
           className="wrap"
158 106
           needInit
@@ -163,7 +111,6 @@ export default class Person extends Component {
163 111
           onScrollToLower={fn => this.onScrollToLower(fn)}
164 112
         >
165 113
           <View className='access-page'>
166
-
167 114
             {
168 115
               recordList.map(item => (
169 116
                 <View className='item' key={item + 'more'}>
@@ -173,10 +120,6 @@ export default class Person extends Component {
173 120
                     <View className="name">{item.userName || item.nickname || ' '}</View>
174 121
                     <View style="display: flex;align-items: center;" onClick={this.handleChatClick.bind(this, item)}><Image className="goutong-icon" src={require('@assets/person/zixun.png')}></Image><Text className="goutong">在线沟通</Text></View>
175 122
                   </View>
176
-                  <View className="activity-name" onClick={this.showActivityList.bind(this, item)}>
177
-                    {item.activityName || ' '}
178
-                  </View>
179
-                  <Text className="right-icon"></Text>
180 123
                   <View className="activity-time">
181 124
                     {`${dayjs(item.visitTime).format('YYYY-MM-DD HH:mm:ss')}`}
182 125
                   </View>

+ 124
- 0
src/pages/person/myShare/index.js View File

@@ -0,0 +1,124 @@
1
+import Taro, { Component } from '@tarojs/taro';
2
+import ListView from '@components/ListView'
3
+import { connect } from '@tarojs/redux'
4
+import './index.scss'
5
+// import { getConsulantVisitRecord} from '@services/person'
6
+import { savePoint, updatePoint } from '@services/common'
7
+import dayjs from 'dayjs';
8
+
9
+@connect(state => state.user)
10
+
11
+export default class Person extends Component {
12
+  config = {
13
+    navigationBarTitleText: '我的分享'
14
+  }
15
+
16
+  state = {
17
+    recordId: undefined, // 埋点ID
18
+    recordList: [],
19
+    hasMore: true,
20
+    isEmpty: false,
21
+    pageIndex: 1,
22
+  }
23
+
24
+  componentWillMount() {
25
+
26
+    savePoint({
27
+      event: 'list',
28
+      eventType: 'activity',
29
+      propertyName: '我的分享',
30
+      data: '{}'
31
+    }).then(res => {
32
+      this.setState({
33
+        recordId: res.recordId
34
+      })
35
+      console.log('我的分享')
36
+    })
37
+  }
38
+  componentWillUnmount() {
39
+    const { recordId } = this.state
40
+    recordId && updatePoint(recordId)
41
+  }
42
+
43
+  componentDidShow() {
44
+    // Taro.showLoading()
45
+    // this.loadList(1)
46
+  }
47
+  // loadList(pageNumber) {
48
+  //   console.log(this.props, "this.props")
49
+  //   const { userInfo: { person } } = this.props
50
+
51
+  //   let payload
52
+  //   if(person.userId){
53
+  //     payload = {
54
+  //       userId: person.userId,
55
+  //       pageNumber,
56
+  //       pageSize: 5
57
+  //     }
58
+  //   }else{
59
+  //    payload = {
60
+  //      userId: Taro.getStorageSync('userId'),
61
+  //      pageNumber,
62
+  //      pageSize: 5
63
+  //    }
64
+  //   }
65
+  //   getConsulantVisitRecord(payload).then(res => {
66
+
67
+  //     const { records, list, total, current, pages } = res || {}
68
+  //     const _list = records || list || []
69
+  //     const newList = current <= 1 ? _list : this.state.recordList.concat(_list)
70
+  //     this.setState({
71
+  //       recordList: newList,
72
+  //       isEmpty: total == 0 || !res,
73
+  //       hasMore: current < pages,
74
+  //       pageIndex: current >= pages ? pages : current
75
+  //     })
76
+  //     Taro.hideLoading()
77
+  //   })
78
+  // }
79
+  // onScrollToLower = async (fn) => {
80
+  //   const { pageIndex } = this.state;
81
+  //   this.loadList(pageIndex + 1)
82
+  //   fn && fn();
83
+  // }
84
+  // onPullDownRefresh = (rest) => {
85
+  //   // debugger
86
+  //   if (this.refreshing) return
87
+  //   this.refreshing = true
88
+  //   this.loadList(1)
89
+  //   rest && rest()
90
+  //   this.refreshing = false
91
+  // }
92
+
93
+  handleItemClick() {
94
+    Taro.navigateTo({
95
+      url: `/pages/person/myShare/accessRecord`
96
+    })
97
+  }
98
+
99
+  render() {
100
+    const { isEmpty, hasMore, recordList } = this.state
101
+    return (
102
+      <ListView
103
+        className="wrap"
104
+        needInit
105
+        isEmpty={isEmpty}
106
+        emptyText="暂无我的分享~"
107
+        hasMore={hasMore}
108
+        onPullDownRefresh={fn => this.onPullDownRefresh(fn)}
109
+        onScrollToLower={fn => this.onScrollToLower(fn)}
110
+      >
111
+        <View className='share-page'>
112
+          <View className="share-item" onClick={this.handleItemClick}>
113
+            <Image className="img" src={require('@assets/default-avatar.png')}></Image>
114
+            <View className="name">鱼嘴润府</View>
115
+            <View className="price"> 均价35000元/m² </View>
116
+            <View className="num"> 5人查看了分享 </View>
117
+            <View className="address"> 南京市锦创广场水西门大街2号 </View>
118
+          </View>
119
+        </View>
120
+      </ListView>
121
+
122
+    )
123
+  }
124
+}

+ 159
- 0
src/pages/person/myShare/index.scss View File

@@ -0,0 +1,159 @@
1
+@import "@styles/theme.scss";
2
+.share-page{
3
+  padding: 10px 30px;
4
+  .share-item{
5
+    padding: 20px 0;
6
+    border-bottom: 1px solid rgba(0,0,0,0.08);
7
+    position: relative;
8
+    .img{
9
+      width:220px;
10
+      height:176px;
11
+    }
12
+    .name{
13
+      position: absolute;
14
+      left: 240px;
15
+      top: 50px;
16
+      color: #333;
17
+      font-size: 34px;
18
+      max-width: 190px;
19
+      @include text-ellipsis;
20
+    }
21
+    .price{
22
+      position: absolute;
23
+      right: 0px;
24
+      top: 50px;
25
+      font-size: 34px;
26
+      color: #FF2359;
27
+      max-width: 260px;
28
+      @include text-ellipsis;
29
+    }
30
+    .num{
31
+      position: absolute;
32
+      left: 240px;
33
+      top: 114px;
34
+      font-size: 28px;
35
+      color: $primary-color;
36
+    }
37
+    .address{
38
+      font-size: 24px;
39
+      color: #888;
40
+      position: absolute;
41
+      right: 0px;
42
+      bottom: 20px;
43
+      max-width: 400px;
44
+      @include text-ellipsis;
45
+    }
46
+  }
47
+}
48
+.access-page{
49
+    padding: 0 30px;
50
+    .item{
51
+      padding: 30px 0 12px 0;
52
+      border-bottom: 1px solid rgba(0,0,0,0.08);
53
+      position: relative;
54
+      .tag{
55
+        position: absolute;
56
+        left: -2px;
57
+        top: 102px;
58
+        width:96px;
59
+        height:32px;
60
+        line-height: 32px;
61
+        text-align: center;
62
+        background:rgba(237,202,115,1);
63
+        border-radius:2px;
64
+        font-size: 22px;
65
+        color: #fff;
66
+      }
67
+      .touxiang{
68
+        width:88px;
69
+        height:88px;
70
+        border-radius: 44px;
71
+      }
72
+      .info-top{
73
+        display: flex;
74
+        position: absolute;
75
+        top: 46px;
76
+        left:112px;
77
+        align-items: center;
78
+        .name{
79
+          font-size: 40px;
80
+          color: #000;
81
+          font-weight: 500;
82
+          max-width: 300px;
83
+          @include text-ellipsis;
84
+          margin-right: 24px;
85
+        }
86
+        .goutong-icon{
87
+          width:44px;
88
+          height:44px;
89
+          background:rgba(255,219,179,0.2);
90
+          border-radius: 22px;
91
+          margin: 0 10px;
92
+        }
93
+        .goutong{
94
+          font-size: 38px;
95
+          color: $primary-color;
96
+          border-bottom: 4px solid #EDCA73;
97
+          line-height: 28px;
98
+        }
99
+  
100
+      }
101
+      .activity-time{
102
+        font-size: 26px;
103
+        color:rgba(0,0,0,0.33);
104
+        text-align: right;
105
+      }
106
+    }
107
+  }
108
+//   .pop-box{
109
+//       position: fixed;
110
+//       width: 100vw;
111
+//       height: 100vh;
112
+//       left: 0;
113
+//       top: 0;
114
+//       z-index: 9999;
115
+//       background: rgba(0, 0, 0, 0.22);
116
+//       display: flex;
117
+//       flex-direction: column;
118
+//       justify-content: center;
119
+//       align-items: center;
120
+//       .content {
121
+//         width: 92vw;
122
+//         height: 600px;
123
+//         position: absolute;
124
+//         left: 4vw;
125
+//         top: 12vh;
126
+//         background-color: #fff;
127
+//         border-radius: 12px;
128
+//         padding: 20px 20px;
129
+  
130
+//         .scroll-con{
131
+//           height: 500px;
132
+//           width: 100%;
133
+//           overflow-y: scroll;
134
+//           .activity-item{
135
+//             padding: 16px 30px;
136
+//             border-bottom: 2px solid rgba(0,0,0,0.08);
137
+//             .name{
138
+//               font-size: 32px;
139
+//               color: #353535;
140
+//               width: 600px;
141
+//               @include text-ellipsis;
142
+//             }
143
+//             .time{
144
+//               font-size: 26px;
145
+//               color:rgba(0,0,0,0.33);
146
+//               text-align: right;
147
+//               margin-top: 20px;
148
+//             }
149
+//           }
150
+  
151
+//         }
152
+  
153
+//       }
154
+//       .close{
155
+//         font-size: 48px;
156
+//         color: rgba(0,0,0,0.3);
157
+//         float: right;
158
+//       }
159
+//   }

+ 2
- 2
src/pages/project/detail/Around/Pannel.js View File

@@ -80,7 +80,7 @@ export default class Pannel extends Component {
80 80
     const fixdHeight = this.props.style || 'height: 300rpx'
81 81
 
82 82
     return (
83
-      <ScrollView scrollY style={fixdHeight} scrollTop={this.state.currentMarkerPos} onScroll={this.bindScroll}>
83
+      // <ScrollView scrollY style={fixdHeight} scrollTop={this.state.currentMarkerPos} onScroll={this.bindScroll}>
84 84
         <View className="around-pannel">
85 85
           {
86 86
             this.state.markerList.map((item, index) => {
@@ -114,7 +114,7 @@ export default class Pannel extends Component {
114 114
             })
115 115
           }
116 116
         </View>
117
-      </ScrollView>
117
+      // </ScrollView>
118 118
     )
119 119
   }
120 120
 }

+ 3
- 3
src/pages/project/detail/Around/Tab.js View File

@@ -7,7 +7,7 @@ export default function Tab(props) {
7 7
   const [current, setCurrent] = useState(props.default || 0)
8 8
   
9 9
   const tabList = props.dataset ? props.dataset : []
10
-  
10
+  const className = props.className
11 11
   const handleClick = index => () => {
12 12
     setCurrent(index)
13 13
     if (typeof props.onChange === 'function') {
@@ -16,14 +16,14 @@ export default function Tab(props) {
16 16
   }
17 17
 
18 18
   return (
19
-    <View className="around-tab">
19
+    <View className={className}>
20 20
       {tabList.map((item, index) => {
21 21
         const { key, label, num } = item || {}
22 22
         
23 23
         return (
24 24
           <View
25 25
             key={key}
26
-            className={`around-tab__item ${current === index ? 'active' : ''}`}
26
+            className={`${className}__item ${current === index ? 'active' : ''}`}
27 27
             onClick={handleClick(index)}
28 28
           >
29 29
             {`${label}(${num})`}

+ 78
- 0
src/pages/project/detail/Around/around.js View File

@@ -0,0 +1,78 @@
1
+import Taro, { useState } from '@tarojs/taro'
2
+import { View, CoverView } from '@tarojs/components'
3
+import PoiAround from '@components/amap/PoiAround'
4
+import Tab from './Tab'
5
+import { POI_TYPES } from '@utils/amap'
6
+import './around.scss'
7
+
8
+export default function Around(props) {
9
+    const detail = props.building || {}
10
+
11
+    const [lat, lng] = (detail.coordinate || '').split(',')
12
+    const poiDatas = typeof detail.mapJson === 'string' ? JSON.parse(detail.mapJson) : []
13
+
14
+    // 展示内容数组
15
+    const dataList = POI_TYPES.map((poi) => {
16
+        const jsonData = poiDatas.filter(x => x.key === poi.key)[0] || {}
17
+        const data = JSON.parse(jsonData.data || '[]')
18
+        const manualData = (detail[`building${poi.key}`] === '' ? [] : (detail[`building${poi.key}`] || '').split(','))
19
+
20
+        return {
21
+            ...poi,
22
+            data,
23
+            manualData,
24
+            num: data.length + manualData.length,
25
+        }
26
+    }).filter(x => x.num)
27
+
28
+    // 所有的 markers
29
+    const markersList = dataList.map((item) => {
30
+        const mapJson = item.data || '[]'
31
+        return (mapJson || []).map((it) => {
32
+            const [longitude, latitude] = (it.location || '').split(',')
33
+
34
+            return {
35
+                id: it.id,
36
+                latitude,
37
+                longitude,
38
+                name: it.name,
39
+                address: it.address,
40
+            }
41
+        })
42
+    })
43
+
44
+    // 部分默认值
45
+    const [curTab, setCurTab] = useState(0)
46
+    const [markers, setMarkers] = useState(markersList[curTab])
47
+    const [curMarker, setCurMarker] = useState()
48
+
49
+    // tab 切换
50
+    const handleTabChange = (index, tabItem) => {
51
+        setCurTab(index)
52
+        setMarkers(markersList[index])
53
+    }
54
+
55
+    // marker 点切换
56
+    const handleMarkerTap = (marker) => {
57
+        setCurMarker(marker.id)
58
+    }
59
+
60
+    const goto = () => {
61
+        if (typeof props.onAction === 'function') {
62
+            props.onAction()
63
+        }
64
+    }
65
+
66
+    return (
67
+        <View className="around-box">
68
+            <View className="around-header">
69
+                <CoverView style="width: 100%; height: 100%;">
70
+                    <PoiAround style="width: 100vw; height: 500rpx;" current={curMarker} markers={markers} longitude={lng} latitude={lat} onMarkerClick={handleMarkerTap} />
71
+                </CoverView>
72
+            </View>
73
+            <View className="around-body">
74
+                <Tab dataset={dataList} className="around-project" onChange={handleTabChange} />
75
+            </View>
76
+        </View>
77
+    )
78
+}

+ 41
- 0
src/pages/project/detail/Around/around.scss View File

@@ -0,0 +1,41 @@
1
+@import "@styles/mixins.scss";
2
+@import "@styles/theme.scss";
3
+
4
+.around-box {
5
+  width: 100vw;
6
+  background-color: #fff;
7
+    
8
+  .around-header {
9
+    width: 100%;
10
+    height: 500px;
11
+  }
12
+  .around-body {
13
+    padding: 0 30px;
14
+  
15
+  }
16
+}
17
+
18
+// .around-project {
19
+//   display: flex;
20
+//   flex-wrap:nowrap;
21
+//   align-items: center;
22
+//   overflow-x: scroll;
23
+//   scroll-behavior: smooth;
24
+//   padding: 24px 0;
25
+
26
+//   &__item {
27
+//     flex: 1 0 auto;
28
+//     font-size: 32px;
29
+//     color:#666;
30
+//     line-height: 44px;
31
+//     padding: 4px 0;
32
+//     &.active {
33
+//         color: #666;
34
+//         border-bottom: none;
35
+//     }
36
+    
37
+//     & + & {
38
+//       margin-left: 64px;
39
+//     }
40
+//   }
41
+// }

+ 26
- 13
src/pages/project/detail/Around/index.js View File

@@ -8,7 +8,7 @@ import './style.scss'
8 8
 
9 9
 export default function Around(props) {
10 10
   const detail = props.building || {}
11
-  
11
+
12 12
   const [lat, lng] = (detail.coordinate || '').split(',')
13 13
   const poiDatas = typeof detail.mapJson === 'string' ? JSON.parse(detail.mapJson) : []
14 14
 
@@ -25,7 +25,7 @@ export default function Around(props) {
25 25
       num: data.length + manualData.length,
26 26
     }
27 27
   }).filter(x => x.num)
28
-  
28
+
29 29
   // 所有的 markers
30 30
   const markersList = dataList.map((item) => {
31 31
     const mapJson = item.data || '[]'
@@ -46,7 +46,7 @@ export default function Around(props) {
46 46
   const [curTab, setCurTab] = useState(0)
47 47
   const [markers, setMarkers] = useState(markersList[curTab])
48 48
   const [curMarker, setCurMarker] = useState()
49
-  
49
+
50 50
   // tab 切换
51 51
   const handleTabChange = (index, tabItem) => {
52 52
     setCurTab(index)
@@ -63,18 +63,31 @@ export default function Around(props) {
63 63
       props.onAction()
64 64
     }
65 65
   }
66
-  
66
+
67 67
   return (
68
-    <View className="around-box">
69
-      <View className="around-header">
70
-        <PoiAround style="width: 100vw; height: 500rpx;" current={curMarker} markers={markers} longitude={lng} latitude={lat} onMarkerClick={handleMarkerTap}/>
71
-      </View>
72
-      <View className="around-body">
73
-        <Tab dataset={dataList} onChange={handleTabChange} />
74
-        <Pannel active={curMarker} dataset={dataList[curTab]} onChange={handleMarkerTap}/>
75
-        <View className="goto-map" onClick={goto}>立即前往</View>
76
-        <View className="around-hr" />
68
+    <View >
69
+      <View style="  position: fixed;top: 0; width: 100%; height: 840rpx;">
70
+        <PoiAround style="width: 100vw; height: 840rpx;" current={curMarker} markers={markers} longitude={lng} latitude={lat} onMarkerClick={handleMarkerTap} />
77 71
       </View>
72
+      <ScrollView
73
+        enableBackToTop
74
+        style=" padding-top: 830rpx; background: transparent;"
75
+        scrollY>
76
+        <View className="around-box" style="border-radius: 40rpx 40rpx 0 0;">
77
+          <View className="building-con">
78
+            <View>
79
+              <View className="building-name">{detail.buildingName}</View>
80
+              <View className="building-address">{detail.address}</View>
81
+            </View>
82
+            <View className="building-go" onClick={goto}>前往</View>
83
+          </View>
84
+          <View className="around-body">
85
+            <Tab dataset={dataList} className="around-tab" onChange={handleTabChange} />
86
+            <Pannel active={curMarker} dataset={dataList[curTab]} onChange={handleMarkerTap} />
87
+            <View className="around-hr" />
88
+          </View>
89
+        </View>
90
+      </ScrollView>
78 91
     </View>
79 92
   )
80 93
 }

+ 48
- 15
src/pages/project/detail/Around/style.scss View File

@@ -9,23 +9,8 @@
9 9
     width: 100%;
10 10
     height: 500px;
11 11
   }
12
-
13 12
   .around-body {
14 13
     padding: 0 30px;
15
-  
16
-    .goto-map {
17
-      width: 670px;
18
-      height: 94px;
19
-      background-color: #F8F8F8;
20
-      border-radius: 8px;
21
-      margin: 0 auto;
22
-      margin-top: 40px;
23
-      text-align: center;
24
-      font-size: 36px;
25
-      font-weight:400;
26
-      color:#BB9C79;
27
-      line-height: 94px;
28
-    }
29 14
   }
30 15
 }
31 16
 
@@ -104,6 +89,30 @@
104 89
     }
105 90
   }
106 91
 }
92
+.around-project {
93
+  display: flex;
94
+  flex-wrap:nowrap;
95
+  align-items: center;
96
+  overflow-x: scroll;
97
+  scroll-behavior: smooth;
98
+  padding: 24px 0;
99
+
100
+  &__item {
101
+    flex: 1 0 auto;
102
+    font-size: 32px;
103
+    color:#666;
104
+    line-height: 44px;
105
+    padding: 4px 0;
106
+    &.active {
107
+        color: #666;
108
+        border-bottom: none;
109
+    }
110
+    
111
+    & + & {
112
+      margin-left: 64px;
113
+    }
114
+  }
115
+}
107 116
 
108 117
 .around-cell-title {
109 118
   font-size: 32px;
@@ -111,4 +120,28 @@
111 120
   color:#666;
112 121
   line-height: 44px;
113 122
   margin: 42px auto 20px 0;
123
+}
124
+
125
+.building-con{
126
+  padding: 30px 30px 0px 30px;
127
+  display: flex;
128
+  justify-content: space-between;
129
+  .building-name{
130
+    font-size: 36px;
131
+    color: #333;
132
+  }
133
+  .building-address{
134
+    font-size: 28px;
135
+    color: #666;
136
+  }
137
+  .building-go{
138
+    width:130px;
139
+    height:72px;
140
+    line-height: 72px;
141
+    background:rgba(246,182,29,1);
142
+    border-radius:40px;
143
+    font-size: 28px;
144
+    color:#fff;
145
+    padding:0 20px;
146
+  }
114 147
 }

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

@@ -4,8 +4,8 @@ import './index.scss'
4 4
 import Banner from '../banner'
5 5
 import HelpGroupBanner from '../swiper'
6 6
 import Poster from './poster'
7
-import PoiAround from '@components/amap/PoiAround'
8
-import Around from './Around'
7
+
8
+import Around from './Around/around'
9 9
 import BackHomeBtn from '@components/BackHomeBtn'
10 10
 import AchievePhone from '@components/achievePhone'
11 11
 import {
@@ -27,6 +27,8 @@ import { connect } from '@tarojs/redux'
27 27
 import { dispatchProjectDetail } from '@actions/project'
28 28
 import getUserPhone from '@utils/getUserPhone'
29 29
 import { ROLE_CODE } from '@constants/user'
30
+import { getCardDetail } from '@services/card'
31
+import Consultant from '@components/consultant'
30 32
 const buildBg = 'https://estateagents.oss-cn-shanghai.aliyuncs.com/miniapp/images/buildbg.png'
31 33
 const dotImg = require('@assets/dot.png')
32 34
 
@@ -61,6 +63,8 @@ export default class Index extends Component {
61 63
     albumCurrent: 0,
62 64
     videoPlayShow: 'flex',
63 65
     grantPhoneVisible: false, // 授权手机弹框
66
+    consultData: {}, // 分享的置业顾问信息
67
+    consultShow: false  // 置业顾问悬浮框显示隐藏
64 68
   }
65 69
 
66 70
   componentWillMount() {
@@ -69,19 +73,31 @@ export default class Index extends Component {
69 73
       // const options = wx.getLaunchOptionsSync()
70 74
       // console.log('-------options----->', options)
71 75
       // if (sceneInShare(options.scene)) {
72
-        const { person = {} } = this.props.userInfo || {}
73
-        console.log('-------person----->', person)
74
-        if ((person.tel || person.phone) && (person.avatarurl || '').indexOf('wx.qlogo.cn') === -1) {
75
-          Taro.reLaunch({ url: '/pages/auth/index' })
76
-          return
77
-        }
78
-
79
-        this.setState({
80
-          grantPhoneVisible: true,
76
+      const router = Taro.getStorageSync('router')
77
+      const consultant = this.$router.params.consultant || router.query.consultant
78
+      if (consultant) {
79
+        console.log(consultant, "$$$$$$$$$$$$$$$$$$$$$$$$$$$4444")
80
+        getCardDetail(consultant).then(res => {
81
+          console.log(res, "$$$$$$$$$$$$$$$$$$$$$$$$$$$")
82
+          this.setState({
83
+            consultData: res,
84
+            consultShow: true
85
+          })
81 86
         })
87
+      }
88
+      const { person = {} } = this.props.userInfo || {}
89
+      console.log('-------person----->', person)
90
+      if ((person.tel || person.phone) && (person.avatarurl || '').indexOf('wx.qlogo.cn') === -1) {
91
+        Taro.reLaunch({ url: '/pages/auth/index' })
92
+        return
93
+      }
94
+
95
+      this.setState({
96
+        grantPhoneVisible: true,
97
+      })
82 98
       // }
83 99
 
84
-      const router = Taro.getStorageSync('router')
100
+
85 101
       const id = this.$router.params.id || router.query.id
86 102
 
87 103
       // 没有找到 id , 再重新找一次
@@ -276,25 +292,29 @@ export default class Index extends Component {
276 292
   }
277 293
 
278 294
   onShareAppMessage = () => {
295
+    console.log(this.props, "his.props")
279 296
     const {
280 297
       projectDetail: { shareContents, buildingName, buildingId, poster },
281
-      userInfo: { person: { personId } }
298
+      userInfo: { person: { personId, personType, userId } }
282 299
     } = this.props
300
+    const consultantId = personType == ROLE_CODE['CONSULTANT'] ? userId : ""
283 301
     // 分享埋点
284 302
     addItemShareNum(buildingId)
285
-
286 303
     savePoint({
287 304
       event: 'share',
288 305
       eventType: 'building',
289 306
       propertyName: '项目详情分享',
307
+      consultantId: consultantId,
308
+      sharePersonId: personId,
309
+      targetId: buildingId,
290 310
       data: '{}'
291 311
     }).then(res => {
292 312
       console.log('项目详情分享')
293 313
     })
294
-
314
+    const consultant = personType == ROLE_CODE['CONSULTANT'] ? personId : ""
295 315
     return {
296 316
       title: shareContents[0].shareContentTitle,//分享内容
297
-      path: `/pages/project/detail/index?id=${buildingId}&from=building_share&recommender=${personId}`,//分享地址
317
+      path: `/pages/project/detail/index?id=${buildingId}&from=building_share&recommender=${personId}&consultant=${consultant}`,//分享地址
298 318
       imageUrl: shareContents[0].shareContentImg
299 319
     }
300 320
   }
@@ -315,13 +335,16 @@ export default class Index extends Component {
315 335
         resolve(posterData)
316 336
         return
317 337
       }
338
+      con
318 339
       const {
319
-        userInfo: { person: { avatarurl, nickname, personId }, miniApp },
340
+        userInfo: { person: { avatarurl, nickname, personId, personType }, miniApp },
320 341
         projectDetail: { posters, buildingId, poster, price, buildingRestaurant, createDate, buildingName, tel, buildingTag, uvList = {} }
321 342
       } = this.props
322 343
       const { total = 0 } = uvList
344
+      const consultant = personType == ROLE_CODE['CONSULTANT'] ? personId : ""
345
+      const phoneNum = person.phone || person.tel
323 346
       const payload = {
324
-        "scene": `id=${buildingId}&from=building_share&recommender=${personId}`,
347
+        "scene": `id=${buildingId}&from=building_share&recommender=${personId}&consultant=${consultant}&phoneNum=${phoneNum}`,
325 348
         "page": 'pages/project/detail/index',
326 349
       }
327 350
       const _avatarurl = getDownloadURL(avatarurl, 'avatar');
@@ -512,6 +535,8 @@ export default class Index extends Component {
512 535
     })
513 536
   }
514 537
 
538
+
539
+
515 540
   handleAuthPhoneSuccess = () => {
516 541
     const { person = {} } = this.props.userInfo || {}
517 542
     if ((person.avatarurl || '').indexOf('wx.qlogo.cn') === -1) {
@@ -685,19 +710,31 @@ export default class Index extends Component {
685 710
       </Block>
686 711
     )
687 712
   }
713
+  tomapDetail() {
714
+    const { buildingId } = this.state
715
+    Taro.navigateTo({
716
+      url: `/pages/project/detail/map?id=` + buildingId
717
+    })
718
+  }
688 719
   rendercircum() {
689 720
     const building = {
690 721
       ...this.props.projectDetail
691 722
     }
692 723
 
693 724
     return (
694
-      <View style="margin-bottom:-5px">
725
+      <View style="margin-bottom:-5px" onClick={this.tomapDetail}>
695 726
         <View className="section circum">
696 727
           <View className="section-head">
697 728
             <Text className="section-head__title">位置及周边配套</Text>
729
+            <View className="section-head__more">
730
+              更多<Text className="iconfont icon-more"></Text>
731
+            </View>
698 732
           </View>
733
+          {/* <View className="section-head">
734
+            <Text className="section-head__title">位置及周边配套</Text>
735
+          </View> */}
699 736
         </View>
700
-        <Around building={building} onAction={this.openMap.bind(this)}></Around>
737
+        <Around building={building} ></Around>
701 738
       </View>
702 739
     )
703 740
   }
@@ -1056,17 +1093,16 @@ export default class Index extends Component {
1056 1093
   }
1057 1094
 
1058 1095
   render() {
1059
-    const { posterStatus, posterData, loaded, btnstate, grantPhoneVisible } = this.state
1096
+    const { posterStatus, posterData, loaded, btnstate, grantPhoneVisible, consultData, consultShow } = this.state
1060 1097
     const { projectDetail, userInfo } = this.props
1061 1098
     const { uvList = {} } = projectDetail
1062 1099
     const { total = 0, records = [] } = uvList
1063 1100
     const openDate = projectDetail.openingDate ? dayjs(projectDetail.openingDate).locale('zh-cn').format('YYYY年M月D日') : '暂无'
1064
-
1065 1101
     return (
1066 1102
       <Block>
1067 1103
         {
1068 1104
           (grantPhoneVisible && userInfo.person.personId && !userInfo.person.phone) &&
1069
-          <AchievePhone user={userInfo.person} onSuccess={this.handleAuthPhoneSuccess}></AchievePhone>
1105
+          <AchievePhone user={person} onSuccess={this.handleAuthPhoneSuccess}></AchievePhone>
1070 1106
         }
1071 1107
         {
1072 1108
           loaded && (
@@ -1217,7 +1253,10 @@ export default class Index extends Component {
1217 1253
                 <Text className="iconfont icon-shouyeshouye"></Text>
1218 1254
                 <Text className="text">首页</Text>
1219 1255
               </View> */}
1220
-              <BackHomeBtn></BackHomeBtn>
1256
+              <BackHomeBtn style={consultShow ? "bottom:320rpx" : ''}></BackHomeBtn>
1257
+              {
1258
+                consultShow && <Consultant style="bottom:160rpx" smallStyle="bottom:188rpx" personId={userInfo.person.personId} name={userInfo.person.name || userInfo.person.nickname} data={consultData}></Consultant>
1259
+              }
1221 1260
             </View>
1222 1261
           )
1223 1262
         }

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

@@ -785,7 +785,7 @@
785 785
   position: fixed;
786 786
   top: 0;
787 787
   width: 100%;
788
-  height: 500px;
788
+  height: 600px;
789 789
 
790 790
   &-img {
791 791
     width: 100%;
@@ -1057,29 +1057,7 @@
1057 1057
   }
1058 1058
 }
1059 1059
 
1060
-.around-tab {
1061
-  display: flex;
1062
-  flex-wrap: nowrap;
1063
-  align-items: center;
1064
-  overflow-x: scroll;
1065
-  scroll-behavior: smooth;
1066
-  padding: 24px 0;
1067 1060
 
1068
-  &__item {
1069
-    flex: 1 0 auto;
1070
-    font-size: 32px;
1071
-    color: #666;
1072
-    line-height: 44px;
1073
-    padding: 4px 0;
1074
-    &.active {
1075
-      color: #BB9C79;
1076
-      border-bottom: 1px solid #C8B299;
1077
-    }
1078
-    &+& {
1079
-      margin-left: 64px;
1080
-    }
1081
-  }
1082
-}
1083 1061
 
1084 1062
 .albumimg {
1085 1063
   width: 218px;

+ 149
- 0
src/pages/project/detail/map.js View File

@@ -0,0 +1,149 @@
1
+import Taro, { Component } from '@tarojs/taro';
2
+import { View } from '@tarojs/components'
3
+import './index.scss'
4
+import Around from './Around/index'
5
+import AchievePhone from '@components/achievePhone'
6
+import { savePoint, updatePoint } from '@services/common'
7
+import dayjs from 'dayjs'
8
+import 'dayjs/locale/zh-cn' // 按需加载
9
+import ready from '@utils/ready'
10
+import { getQrCodeParams } from '@utils/qrcode'
11
+import { connect } from '@tarojs/redux'
12
+import { dispatchProjectDetail } from '@actions/project'
13
+
14
+
15
+@connect(
16
+    ({ user, project }) => ({ ...user, ...project }),
17
+    { dispatchProjectDetail }
18
+)
19
+export default class Index extends Component {
20
+    config = {
21
+        navigationBarTitleText: '更多周边设施',
22
+    }
23
+
24
+    state = {
25
+        buildingId: null,
26
+    }
27
+
28
+    componentWillMount() {
29
+        ready.queue(() => {
30
+            const router = Taro.getStorageSync('router')
31
+            const id = this.$router.params.id || router.query.id
32
+            this.initPageData(id)
33
+
34
+        })
35
+    }
36
+    componentWillUnmount() {
37
+        const { recordId } = this.state
38
+        recordId && updatePoint(recordId)
39
+    }
40
+
41
+    initPageData(id) {
42
+
43
+        // const id='82b54f4a1f5b981df572253792afbfa1' 
44
+        this.setState({
45
+            buildingId: id
46
+        }, () => {
47
+            this.loadDetail()
48
+
49
+            // 埋点
50
+            //   savePoint({
51
+            //     event: 'detail',
52
+            //     eventType: 'building',
53
+            //     propertyName: '项目详情',
54
+            //     targetId: id,
55
+            //     buildingId: id,
56
+            //     data: '{}'
57
+            //   }).then(res => {
58
+            //     this.setState({
59
+            //       recordId: res.recordId
60
+            //     })
61
+            //     console.log('项目详情')
62
+            //   })
63
+        })
64
+    }
65
+
66
+
67
+
68
+    loadDetail() {
69
+        const { buildingId } = this.state
70
+        const { dispatchProjectDetail } = this.props
71
+        this.setState({
72
+            loaded: false,
73
+        })
74
+        Taro.showToast({
75
+            title: '正在加载数据',
76
+            icon: 'loading'
77
+        })
78
+
79
+        dispatchProjectDetail(buildingId).then(res => {
80
+            this.setState({
81
+                loaded: true,
82
+                // circumOpts: newCircumOpts,
83
+                isSaved: res.isSave
84
+            }, () => {
85
+                if (res.posters && res.posters.length) {
86
+                    this.setState({
87
+                        posterShow: 'flex'
88
+                    })
89
+                }
90
+            })
91
+            Taro.hideToast()
92
+        })
93
+    }
94
+
95
+
96
+
97
+    openMap() {
98
+        const {
99
+            buildingName,
100
+            address,
101
+            coordinate = ''
102
+        } = this.props.projectDetail
103
+
104
+        const coord = coordinate.split(',')
105
+        const latitude = parseFloat(coord[0])
106
+        const longitude = parseFloat(coord[1])
107
+        Taro.openLocation({
108
+            latitude,
109
+            longitude,
110
+            name: buildingName,
111
+            address,
112
+            scale: 18
113
+        })
114
+        savePoint({
115
+            event: 'navigation',
116
+            eventType: 'building',
117
+            propertyName: '查看项目地图',
118
+            data: '{}'
119
+        }).then(res => {
120
+            console.log('查看项目地图')
121
+        })
122
+    }
123
+
124
+    toViewAlbum(index) {
125
+        const { buildingId } = this.state
126
+        console.log('1111111', index)
127
+        this.navigateTo(`/pages/project/album/index?id=${buildingId}&current=${index}`)
128
+    }
129
+
130
+    HandleCircumTabClick(id) {
131
+        this.setState({
132
+            curTab: id
133
+        })
134
+    }
135
+
136
+
137
+    render() {
138
+        const building = {
139
+            ...this.props.projectDetail
140
+        }
141
+        return (
142
+            <Block>
143
+
144
+                <Around building={building} onAction={this.openMap.bind(this)}></Around>
145
+
146
+            </Block>
147
+        );
148
+    }
149
+}

+ 109
- 47
src/pages/project/h5Page.js View File

@@ -9,6 +9,8 @@ import { connect } from '@tarojs/redux'
9 9
 import { ROLE_CODE } from '@constants/user'
10 10
 import { getQrCodeParams } from '@utils/qrcode'
11 11
 import { getMiniQrcode, savePoint, updatePoint } from '@services/common'
12
+import { isEmpty } from '@utils/tools'
13
+
12 14
 const bgImg = require('@assets/helpgroup/bg.png')
13 15
 
14 16
 @connect(state => state.user, { ...actions })
@@ -19,31 +21,40 @@ export default class Index extends Component {
19 21
     avatarVisible: false,
20 22
     phoneVisible: false,
21 23
     webViewVisible: false,
24
+    // pageHide: true,
22 25
     pageInfo: {},
23 26
     codeParams: '', // 解析二维码参数
27
+    h5Id: undefined,
24 28
   }
25 29
 
26 30
   componentWillUnmount() {
27 31
     const { recordId } = this.state
28 32
     recordId && updatePoint(recordId)
29 33
   }
34
+
35
+  // componentDidHide() {
36
+  //   this.setState({ pageHide: true });
37
+  // }
38
+
39
+  // componentDidShow() {
40
+  //   this.setState({ pageHide: false });
41
+  // }
42
+
30 43
   // 埋点
31 44
   success() {
32
-    const { userInfo: { person } } = this.props
33
-
34
-    const router = Taro.getStorageSync('router')
45
+    const router = Taro.getStorageSync('router') || { query: {} }
35 46
     const firstShare = this.$router.params.firstShare || router.query.firstShare || ""
36 47
     const consultant = this.$router.params.consultant || router.query.consultant || ""
37 48
     const sharePersonId = this.$router.params.sharePersonId || router.query.sharePersonId || ""
38
-    const { pageInfo } = this.state
39
-    const targetId = pageInfo.drainageId || this.$router.params.id || router.query.id || ""
49
+    const { h5Id } = this.state
50
+
40 51
     savePoint({
41 52
       event: 'detail',
42 53
       eventType: 'h5',
43 54
       propertyName: 'h5活动',
44 55
       consultantId: consultant,
45 56
       sharePersonId: sharePersonId,
46
-      targetId: targetId,
57
+      targetId: h5Id,
47 58
       data: '{"firstShare":"' + firstShare + '"}'
48 59
     }).then(res => {
49 60
       this.setState({
@@ -52,6 +63,7 @@ export default class Index extends Component {
52 63
       console.log('访问记录')
53 64
     })
54 65
   }
66
+
55 67
   // 分享好友
56 68
   onShareAppMessage = () => {
57 69
     const { pageInfo } = this.state
@@ -74,23 +86,21 @@ export default class Index extends Component {
74 86
   //   })
75 87
   // }
76 88
 
77
-
78 89
   currentPageAndParams() {
79 90
     const { userInfo: { person } } = this.props
80
-    const router = Taro.getStorageSync('router')
91
+    const { h5Id } = this.state
92
+    const router = Taro.getStorageSync('router') || { query: {} }
81 93
 
82 94
     const consultant = person.personType == ROLE_CODE['CONSULTANT'] ? person.userId : ""
83
-    const firstShare = this.$router.params.firstShare || person.personId
84
-    const id = this.$router.params.id || router.query.id || ""
95
+    const firstShare = this.$router.params.firstShare || router.query.firstShare || person.personId
85 96
 
86 97
     let queryParams = [
87 98
       `sharePersonId=${person.personId}`,
88 99
       `consultant=${consultant}`,
89 100
       `firstShare=${firstShare}`,
90
-      `id=${id}`
101
+      `id=${h5Id}`
91 102
     ]
92 103
 
93
-
94 104
     const res = [
95 105
       'pages/project/h5Page',
96 106
       queryParams.join('&'),
@@ -98,45 +108,60 @@ export default class Index extends Component {
98 108
 
99 109
     return res
100 110
   }
111
+
101 112
   componentWillMount() {
102 113
     ready.queue(() => {
114
+
103 115
       Taro.showLoading()
104 116
       if (this.$router.params.scene) {
105 117
 
106
-        getQrCodeParams(this.$router.params.scene).then((_, codeParams) => {
118
+        getQrCodeParams(this.$router.params.scene).then((res) => {
107 119
           this.setState({
108
-            codeParams: codeParams || ''
120
+            codeParams: res['__raw'] || ''
109 121
           })
122
+
123
+          if (isEmpty(res.id)) {
124
+            Taro.showModal({
125
+              title: '提示',
126
+              content: '活动不存在',
127
+              success: (res) => {
128
+                if (res.confirm) {
129
+                  this.gotoIndex()
130
+                }
131
+              },
132
+            })
133
+            return;
134
+          }
135
+
136
+          if (!this.state.h5Id) {
137
+            this.loadH5Profile(res.id)
138
+          }
110 139
           // console.log(codeParams, "解析二维码返回值")
111 140
         })
112 141
       }
113 142
 
114
-      console.log(this.$router, "this.$router")
115
-      const router = Taro.getStorageSync('router')
116
-      console.log(router, "router")
117
-      const hFiveId = this.$router.params.id || router.query.id || ""
118
-      console.log(hFiveId, "hFiveId")
119
-      // h5id 、第一个分享人ID、置业顾问ID、分享人ID
120
-      getHFiveDetail(hFiveId).then(res => {
121
-        Taro.hideLoading()
122
-        if (res.status == 1) {
123
-          this.setState({
124
-            pageInfo: res
125
-          })
126
-        } else {
127
-          Taro.showModal({
128
-            title: '提示',
129
-            content: '活动已下架',
130
-            showCancel: false,
131
-          }).then(() => {
132
-            Taro.switchTab({
133
-              url: '/pages/project/index'
134
-            })
135
-          })
136
-        }
137
-      })
143
+      const router = Taro.getStorageSync('router') || { query: {} }
144
+      const hFiveId = this.$router.params.id || router.query.id
145
+
146
+      if (!isEmpty(hFiveId)) {
147
+        this.loadH5Profile(hFiveId)
148
+      }
149
+
150
+      // 没有 H5ID, 也没有分享
151
+      if (isEmpty(hFiveId) && !this.$router.params.scene) {
152
+        Taro.showModal({
153
+          title: '提示',
154
+          content: '活动不存在',
155
+          success: (res) => {
156
+            if (res.confirm) {
157
+              this.gotoIndex()
158
+            }
159
+          },
160
+        })
161
+        return;
162
+      }
163
+
138 164
       const { userInfo: { person: { avatarurl, phone } } } = this.props
139
-      console.log(this.props, "this.propsthis.propsthis.props")
140 165
 
141 166
       if (avatarurl && avatarurl.indexOf('wx.qlogo.cn') != -1) {
142 167
         console.log(avatarurl, "有头像哦~")
@@ -172,6 +197,34 @@ export default class Index extends Component {
172 197
       }
173 198
     })
174 199
   }
200
+
201
+  gotoIndex = () => {
202
+    Taro.switchTab({
203
+      url: '/pages/project/index'
204
+    })    
205
+  }
206
+
207
+  loadH5Profile = (id) => {
208
+    // h5id 、第一个分享人ID、置业顾问ID、分享人ID
209
+    getHFiveDetail(id).then(res => {
210
+      Taro.hideLoading()
211
+      if (res.status == 1) {
212
+        this.setState({
213
+          pageInfo: res,
214
+          h5Id: id,
215
+        })
216
+      } else {
217
+        Taro.showModal({
218
+          title: '提示',
219
+          content: '活动已下架',
220
+          showCancel: false,
221
+        }).then(() => {
222
+          this.gotoIndex()
223
+        })
224
+      }
225
+    })
226
+  }
227
+
175 228
   // 授权头像成功
176 229
   onAvatarSuccess() {
177 230
     this.setState({
@@ -222,6 +275,7 @@ export default class Index extends Component {
222 275
       }
223 276
     })
224 277
   }
278
+
225 279
   // 授权手机号
226 280
   getPhoneNumber(e) {
227 281
     getUserPhone(e, (phoneNumber) => {
@@ -241,15 +295,16 @@ export default class Index extends Component {
241 295
       }
242 296
     })
243 297
   }
298
+
244 299
   // 报备客户
245 300
   reportClient() {
246 301
 
247
-    const router = Taro.getStorageSync('router')
302
+    const router = Taro.getStorageSync('router') || { query: {} }
248 303
     const consultant = this.$router.params.consultant || router.query.consultant || ""
249 304
     const {
250 305
       userInfo: { person: { phone, tel, userId } }
251 306
     } = this.props
252
-    // debugger
307
+
253 308
     if (consultant && consultant != userId) {
254 309
       const realPhone = phone || tel
255 310
       const payload = {
@@ -267,12 +322,12 @@ export default class Index extends Component {
267 322
   }
268 323
 
269 324
   renderMaskBanner() {
270
-    const { avatarVisible, phoneVisible, pageInfo } = this.state
325
+    const { avatarVisible, phoneVisible, pageInfo, h5Id } = this.state
271 326
     return (
272 327
       <View>
273 328
         <Image src={pageInfo.middleImg || bgImg} mode='widthFix' className='bg_img'></Image>
274 329
         <View className="middle-page">
275
-          {avatarVisible &&
330
+          {avatarVisible && h5Id &&
276 331
             <View className="content">
277 332
               <View className="title">授权头像,围观活动</View>
278 333
               <View className="touxiang"><open-data type="userAvatarUrl"></open-data></View>
@@ -280,7 +335,7 @@ export default class Index extends Component {
280 335
               <Button className="btn" open-type="getUserInfo" lang="zh_CN" onGetUserInfo={this.getUserInfo}>好</Button>
281 336
             </View>
282 337
           }
283
-          {phoneVisible &&
338
+          {phoneVisible && h5Id &&
284 339
             <Button className="phone-btn" open-type="getPhoneNumber" lang="zh_CN" onGetphonenumber={this.getPhoneNumber}>点击授权查看详情</Button>
285 340
           }
286 341
         </View>
@@ -288,20 +343,27 @@ export default class Index extends Component {
288 343
     )
289 344
   }
290 345
   render() {
291
-    const { pageInfo, webViewVisible, codeParams } = this.state
346
+    const router = Taro.getStorageSync('router') || { query: {} }
347
+    const { pageInfo, webViewVisible, codeParams, pageHide, h5Id } = this.state
292 348
     const { userInfo: { person } } = this.props
293 349
     const consultant = person.personType == ROLE_CODE['CONSULTANT'] ? person.userId : ""
350
+    const firstShare = this.$router.params.firstShare || router.query.firstShare || person.personId
294 351
     const webUrlParams = [
295 352
       `personId=${person.personId}`,
296
-      `h5id=${this.$router.params.id}`,
353
+      `h5id=${h5Id}`,
297 354
       `consultant=${consultant}`,
355
+      `firstShare=${firstShare}`,
298 356
       `codeParams=${encodeURIComponent(codeParams)}`,
299 357
     ].join('&')
300 358
 
359
+    const showH5 = !isEmpty(h5Id) && pageInfo.h5Address && pageInfo.h5Address !== 'about' && pageInfo.h5Address !== 'http://about' && pageInfo.h5Address !== 'https://about'
360
+
361
+    console.log('----web-h5------>', showH5, `${pageInfo.h5Address}?${webUrlParams}`)
362
+
301 363
     return (
302 364
       <Block>
303 365
         {this.renderMaskBanner()}
304
-        {webViewVisible && <WebView src={`${pageInfo.h5Address}?${webUrlParams}`} />}
366
+        {webViewVisible && showH5 && <WebView src={`${pageInfo.h5Address}?${webUrlParams}`} />}
305 367
       </Block>
306 368
     )
307 369
   }

+ 40
- 5
src/pages/project/index.js View File

@@ -22,7 +22,44 @@ import Notice from '@components/Notice'
22 22
 import Authorize from '@components/authorize'
23 23
 
24 24
 
25
-const accountInfo = wx.getAccountInfoSync();
25
+const { miniProgram: { appId } } = wx.getAccountInfoSync();
26
+
27
+// 分享图
28
+let shareImageOfApp;
29
+// banner 广告图
30
+let advImageOfApp;
31
+
32
+switch (appId) {
33
+  case 'wx755faa4b3ec76cd3':
34
+    // 尾房宝
35
+    shareImageOfApp = 'https://estateagents.oss-cn-shanghai.aliyuncs.com/miniapp/cff400dab32e9230f6bf7498b8291d7.jpg';
36
+    advImageOfApp = 'https://estateagents.oss-cn-shanghai.aliyuncs.com/miniapp/f58480ff83787b64235b729bca5d805.jpg';
37
+    break;
38
+
39
+  case 'wx1d981b76761246ce':
40
+    // 橙蕉嘉房
41
+    shareImageOfApp = 'https://estateagents.oss-cn-shanghai.aliyuncs.com/miniapp/%E6%A9%99%E8%95%89%E5%98%89%E6%88%BF.jpg';
42
+    break;
43
+
44
+  case 'wxa431cc21403b51bb':
45
+    // 橙蕉海房
46
+    shareImageOfApp = 'https://estateagents.oss-cn-shanghai.aliyuncs.com/miniapp/%E6%A9%99%E8%95%89%E6%B5%B7%E6%88%BF.jpg';
47
+    break;
48
+
49
+  case 'wx25c971cd14b0e11d':
50
+    // 橙蕉越房
51
+    shareImageOfApp = 'https://estateagents.oss-cn-shanghai.aliyuncs.com/miniapp/%E6%A9%99%E8%95%89%E8%B6%8A%E6%88%BF.jpg';
52
+    break;
53
+
54
+  case 'wx593a402c7c27beb9':
55
+    // 橙蕉金房
56
+    shareImageOfApp = 'https://estateagents.oss-cn-shanghai.aliyuncs.com/miniapp/%E6%A9%99%E8%95%89%E9%87%91%E6%88%BF.jpg';
57
+    break;
58
+
59
+  default:
60
+    shareImageOfApp = 'https://estateagents.oss-cn-shanghai.aliyuncs.com/miniapp/upload/images/1574145199853-97feda7895c65be33aa234a7b81b37f.jpg';
61
+    break;
62
+}
26 63
 
27 64
 @connect(
28 65
   state => ({ ...state.project, ...state.city, ...state.user }),
@@ -37,10 +74,8 @@ export default class Index extends Component {
37 74
     keywords: '',
38 75
     loaded: false,
39 76
     maskBanner: '',
40
-    // shareImg: 'https://estateagents.oss-cn-shanghai.aliyuncs.com/miniapp/cff400dab32e9230f6bf7498b8291d7.jpg',
41
-    shareImg: 'https://estateagents.oss-cn-shanghai.aliyuncs.com/miniapp/upload/images/1574145199853-97feda7895c65be33aa234a7b81b37f.jpg',
42
-    // shareImg: 'https://estateagents.oss-cn-shanghai.aliyuncs.com/miniapp/upload/images/1565358322510-share.jpg',
43
-    // adImage: 'https://estateagents.oss-cn-shanghai.aliyuncs.com/miniapp/f58480ff83787b64235b729bca5d805.jpg',
77
+    shareImg: shareImageOfApp,
78
+    adImage: advImageOfApp,
44 79
     bannerList: [],
45 80
     helpGroupList: [],
46 81
     newsList: [],

+ 7
- 2
src/services/common.js View File

@@ -6,7 +6,8 @@ import {
6 6
   API_BANNER_LIST,
7 7
   API_QUERY_CODE_SCENE,
8 8
   API_BURIED_POINT,
9
-  API_CITY_LIST
9
+  API_CITY_LIST,
10
+  API_TEMPLATE_TYPE,
10 11
 } from '@constants/api'
11 12
 
12 13
 /**
@@ -55,4 +56,8 @@ export const updatePoint = (id, payload) => fetch({ url: `${API_BURIED_POINT}/${
55 56
 export const queryCityList = () => fetch({ url: API_CITY_LIST })
56 57
 
57 58
 
58
-
59
+/**
60
+ * 获取消息模板
61
+ * @param {*} 
62
+ */
63
+export const queryMessageTPL = type => fetch({ url: `${API_TEMPLATE_TYPE}/${type}` })

+ 4
- 1
src/utils/qrcode.js View File

@@ -21,7 +21,10 @@ export function getQrCodeParams(sceneID) {
21 21
 
22 22
       console.log('解析到二维码场景参数: ', params)
23 23
 
24
-      resolve(params, data.scene)
24
+      resolve({
25
+        ...params,
26
+        '__raw': data.scene,
27
+      })
25 28
     }).catch(err => {
26 29
       console.error('解析二维码场景参数失败', err)
27 30
       reject('解析二维码场景参数失败')

+ 12
- 4
src/utils/request.js View File

@@ -1,6 +1,8 @@
1 1
 import Taro from '@tarojs/taro'
2 2
 import { API_UPLOAD_IMAGE } from '@constants/api'
3 3
 import login from '@utils/login'
4
+import rtLog from './rtLog'
5
+
4 6
 const CODE_SUCCESS = 1000
5 7
 const CODE_UNLOGIN = 1001
6 8
 const CODE_AUTH_EXPIRED = 1002
@@ -82,7 +84,11 @@ export const fetch = async (options) => {
82 84
       throw res.data
83 85
     }
84 86
   }).catch((err) => {
85
-    console.error(err, url)
87
+    rtLog.error('[request]', "==================================")
88
+    rtLog.error('[request]', err)
89
+    rtLog.error('[request]', url)
90
+    rtLog.error('[request]', wx.getLaunchOptionsSync())
91
+    rtLog.error('[request]', "==================================")
86 92
 
87 93
     let errMessage = `请求失败: ${err.errMsg}`
88 94
     if (err.errMsg) {
@@ -90,13 +96,15 @@ export const fetch = async (options) => {
90 96
     }
91 97
 
92 98
     if (err.message) {
93
-      errMessage = err.message
99
+      console.error('请求失败', err.message)
100
+      errMessage = err.message.indexOf('java') > -1 ? '服务内部错误' : err.message
94 101
     }
95
-    if (showMessage) {
96 102
 
103
+    if (showMessage) {
97 104
       Taro.showToast({
98 105
         title: errMessage,
99
-        icon: 'none'
106
+        icon: 'none',
107
+        duration: 3000
100 108
       })
101 109
     }
102 110
 

+ 50
- 0
src/utils/rtLog.js View File

@@ -0,0 +1,50 @@
1
+
2
+let logger;
3
+
4
+function getLogger() {
5
+  if (wx.canIUse('getRealtimeLogManager')) {
6
+    return wx.getRealtimeLogManager()
7
+  }
8
+
9
+  return undefined;
10
+}
11
+
12
+function info(...args) {
13
+  if (!logger) {
14
+    logger = getLogger()
15
+  }
16
+
17
+  // 本地打印
18
+  console.info(...args)
19
+
20
+  // 远程提交
21
+  if (logger) {
22
+    logger.info(...args)
23
+  }
24
+}
25
+
26
+function error(...args) {
27
+  if (!logger) {
28
+    logger = getLogger()
29
+  }
30
+
31
+  console.error(...args)
32
+
33
+  if (logger) {
34
+    logger.error(...args)
35
+  }
36
+}
37
+
38
+function warn(...args) {
39
+  if (!logger) {
40
+    logger = getLogger()
41
+  }
42
+
43
+  console.warn(...args)
44
+
45
+  if (logger) {
46
+    logger.warn(...args)
47
+  }
48
+}
49
+
50
+export default { info, error, warn }

+ 26
- 0
src/utils/tools.js View File

@@ -1,5 +1,31 @@
1 1
 import Taro from '@tarojs/taro';
2 2
 
3
+/**
4
+ * 是否为空
5
+ * @param {*} o 
6
+ */
7
+export function isEmpty(o) {
8
+  if (typeof o === 'string') {
9
+    if (!o || o === 'null' || o === 'undefined') {
10
+      return true
11
+    }
12
+  }
13
+
14
+  if (typeof o === 'object') {
15
+    return !Object.keys(o).length
16
+  }
17
+
18
+  if (Array.isArray(o)) {
19
+    return !o.length
20
+  }
21
+
22
+  if (o === null || o === undefined) {
23
+    return true
24
+  }
25
+
26
+  return false
27
+}
28
+
3 29
 /**
4 30
  * 是否分享场景(含扫码)
5 31
  * @param {*} scene