瀏覽代碼

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

Yansen 5 年之前
父節點
當前提交
3311a4da68

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

3
     NODE_ENV: '"development"'
3
     NODE_ENV: '"development"'
4
   },
4
   },
5
   defineConstants: {
5
   defineConstants: {
6
-    HOST: '"https://dev.fangdeal.cn"', //测试
7
-    WSS_HOST: '"wss://dev.fangdeal.cn"',
8
-    // HOST: '"http://192.168.2.43:8080"',
9
-    // WSS_HOST: '"ws://192.168.2.43:8080"',
6
+    // HOST: '"https://dev.fangdeal.cn"', //测试
7
+    // WSS_HOST: '"wss://dev.fangdeal.cn"',
8
+    HOST: '"http://192.168.2.43:8080"',
9
+    WSS_HOST: '"ws://192.168.2.43:8080"',
10
     OSS_PATH: "https://njcj.oss-cn-shanghai.aliyuncs.com/",
10
     OSS_PATH: "https://njcj.oss-cn-shanghai.aliyuncs.com/",
11
     OSS_FAST_PATH: "https://njcj.oss-accelerate.aliyuncs.com/",
11
     OSS_FAST_PATH: "https://njcj.oss-accelerate.aliyuncs.com/",
12
-    Version: "V3.5.26"
12
+    Version: "V3.5.28"
13
   },
13
   },
14
   weapp: {},
14
   weapp: {},
15
   h5: {}
15
   h5: {}

+ 1
- 1
config/prod.js 查看文件

9
     WSS_HOST: '"wss://wx.fangdeal.cn"',
9
     WSS_HOST: '"wss://wx.fangdeal.cn"',
10
     OSS_PATH: "https://njcj.oss-cn-shanghai.aliyuncs.com/",
10
     OSS_PATH: "https://njcj.oss-cn-shanghai.aliyuncs.com/",
11
     OSS_FAST_PATH: "https://njcj.oss-accelerate.aliyuncs.com/",
11
     OSS_FAST_PATH: "https://njcj.oss-accelerate.aliyuncs.com/",
12
-    Version: "V3.5.26"
12
+    Version: "V3.5.28"
13
   },
13
   },
14
   weapp: {},
14
   weapp: {},
15
   h5: {}
15
   h5: {}

+ 3
- 2
src/actions/project.js 查看文件

39
  * 获取项目信息
39
  * 获取项目信息
40
  * @param {*} id 
40
  * @param {*} id 
41
  */
41
  */
42
-export const dispatchProjectDetail = id => createAction({
42
+export const dispatchProjectDetail = (id, params) => createAction({
43
   url: `${API_ITEMS_DETAIL}/${id}`,
43
   url: `${API_ITEMS_DETAIL}/${id}`,
44
-  type: PROJECT_DETAIL
44
+  type: PROJECT_DETAIL,
45
+  fetchOptions: params || {}
45
 })
46
 })
46
 
47
 
47
 /**
48
 /**

二進制
src/assets/edit.png 查看文件


+ 1
- 0
src/constants/api.js 查看文件

44
 export const API_CARDS_LIST = resolvePath('cards')
44
 export const API_CARDS_LIST = resolvePath('cards')
45
 export const API_CARDS_APPLY = resolvePath('cards/apply')
45
 export const API_CARDS_APPLY = resolvePath('cards/apply')
46
 export const API_FORM_ID = resolvePath('formid')
46
 export const API_FORM_ID = resolvePath('formid')
47
+export const API_UPDATE_PHOTO = resolvePath('userInfo/updatePhoto')
47
 
48
 
48
 // project
49
 // project
49
 export const API_ITEMS_LIST = resolvePath('building/list')
50
 export const API_ITEMS_LIST = resolvePath('building/list')

+ 9
- 25
src/pages/activity/detail/assemble.js 查看文件

371
     }
371
     }
372
   }
372
   }
373
 
373
 
374
-  currentPageAndParams(shareFrom) {
375
-    const { id, recordId } = this.state
374
+  currentPageAndParams() {
375
+    // currentPageAndParams(shareFrom) {
376
+    const { id, recordId = '' } = this.state
376
     const { userInfo: { person: { personId, personType, userId } } } = this.props
377
     const { userInfo: { person: { personId, personType, userId } } } = this.props
377
     const consultant = personType == ROLE_CODE['CONSULTANT'] ? personId : ""
378
     const consultant = personType == ROLE_CODE['CONSULTANT'] ? personId : ""
378
     const consultantId = personType == ROLE_CODE['CONSULTANT'] ? userId : ""
379
     const consultantId = personType == ROLE_CODE['CONSULTANT'] ? userId : ""
383
       `recommender=${personId}`,
384
       `recommender=${personId}`,
384
       `consultant=${consultant}`,
385
       `consultant=${consultant}`,
385
       `consultantId=${consultantId}`,
386
       `consultantId=${consultantId}`,
387
+      `recordId=${recordId}`
386
     ]
388
     ]
387
-    if (recordId && shareFrom != 'menu') {
388
-      queryParams.push(`recordId=${recordId}`)
389
-    }
390
-
389
+    // if (recordId && shareFrom != 'menu') {
390
+    //   queryParams.push(`recordId=${recordId}`)
391
+    // }
391
     const res = [
392
     const res = [
392
       'pages/activity/detail/assemble',
393
       'pages/activity/detail/assemble',
393
       queryParams.join('&'),
394
       queryParams.join('&'),
399
 
400
 
400
   onShareAppMessage = (res) => {
401
   onShareAppMessage = (res) => {
401
     const { shares, detail: { groupActivityId, activityName, mainImg, buildingId } } = this.state
402
     const { shares, detail: { groupActivityId, activityName, mainImg, buildingId } } = this.state
402
-    const currentPage = `/${this.currentPageAndParams(res.from).join('?')}`
403
+    const currentPage = `/${this.currentPageAndParams().join('?')}`
404
+    // const currentPage = `/${this.currentPageAndParams(res.from).join('?')}`
403
     const { userInfo: { person: { personId, personType, userId } } } = this.props
405
     const { userInfo: { person: { personId, personType, userId } } } = this.props
404
     const consultantId = personType == ROLE_CODE['CONSULTANT'] ? userId : ""
406
     const consultantId = personType == ROLE_CODE['CONSULTANT'] ? userId : ""
405
 
407
 
415
       data: '{}'
417
       data: '{}'
416
     }, 'group')
418
     }, 'group')
417
 
419
 
418
-    // savePoint({
419
-    //   event: 'share',
420
-    //   eventType: 'activity',
421
-    //   targetType: 'group',
422
-    //   propertyName: '拼团详情分享',
423
-    //   consultantId: consultantId,
424
-    //   sharePersonId: personId,
425
-    //   targetId: groupActivityId,
426
-    //   data: '{}'
427
-    // })
428
     const shareData = shares && shares.length ? shares[0] : { shareContentTitle: activityName, shareContentImg: mainImg };
420
     const shareData = shares && shares.length ? shares[0] : { shareContentTitle: activityName, shareContentImg: mainImg };
429
 
421
 
430
-    // if (!shares || !shares.length) {
431
-    //   return {
432
-    //     title: shareData.shareContentTitle,
433
-    //     path: currentPage,//分享地址
434
-    //     imageUrl: shareData.shareContentImg
435
-    //   }
436
-    // }
437
-
438
     return {
422
     return {
439
       title: shareData.shareContentTitle,
423
       title: shareData.shareContentTitle,
440
       path: currentPage,//分享地址
424
       path: currentPage,//分享地址

+ 8
- 5
src/pages/activity/detail/assistance.js 查看文件

375
   }
375
   }
376
 
376
 
377
   currentPageAndParams(shareFrom) {
377
   currentPageAndParams(shareFrom) {
378
-    const { id, initiateId } = this.state
378
+    // currentPageAndParams(shareFrom) {
379
+    const { id, initiateId = '' } = this.state
379
     const { userInfo: { person: { personId, personType, userId } } } = this.props
380
     const { userInfo: { person: { personId, personType, userId } } } = this.props
380
     const consultant = personType == ROLE_CODE['CONSULTANT'] ? personId : ""
381
     const consultant = personType == ROLE_CODE['CONSULTANT'] ? personId : ""
381
     const consultantId = personType == ROLE_CODE['CONSULTANT'] ? userId : ""
382
     const consultantId = personType == ROLE_CODE['CONSULTANT'] ? userId : ""
386
       `recommender=${personId}`,
387
       `recommender=${personId}`,
387
       `consultant=${consultant}`,
388
       `consultant=${consultant}`,
388
       `consultantId=${consultantId}`,
389
       `consultantId=${consultantId}`,
390
+      `initiateId=${initiateId}`
389
     ]
391
     ]
390
 
392
 
391
-    if (initiateId && shareFrom != 'menu') {
392
-      queryParams.push(`initiateId=${initiateId}`)
393
-    }
393
+    // if (initiateId && shareFrom != 'menu') {
394
+    //   queryParams.push(`initiateId=${initiateId}`)
395
+    // }
394
 
396
 
395
     const res = [
397
     const res = [
396
       'pages/activity/detail/assistance',
398
       'pages/activity/detail/assistance',
404
   onShareAppMessage = (res) => {
406
   onShareAppMessage = (res) => {
405
 
407
 
406
     const { shares, id, detail: { title, img, buildingId } } = this.state
408
     const { shares, id, detail: { title, img, buildingId } } = this.state
407
-    const currentPage = `/${this.currentPageAndParams(res.from).join('?')}`
409
+    const currentPage = `/${this.currentPageAndParams().join('?')}`
410
+    // const currentPage = `/${this.currentPageAndParams(res.from).join('?')}`
408
     const { userInfo: { person: { personId, personType, userId } } } = this.props
411
     const { userInfo: { person: { personId, personType, userId } } } = this.props
409
     const consultantId = personType == ROLE_CODE['CONSULTANT'] ? userId : ""
412
     const consultantId = personType == ROLE_CODE['CONSULTANT'] ? userId : ""
410
     shareSavePoint({
413
     shareSavePoint({

+ 50
- 5
src/pages/card/index.js 查看文件

10
 import AchieveAvatar from '@/components/achieveAvatar'
10
 import AchieveAvatar from '@/components/achieveAvatar'
11
 import { sceneInShare } from '@/utils/tools'
11
 import { sceneInShare } from '@/utils/tools'
12
 import { ROLE_CODE } from '@/constants/user'
12
 import { ROLE_CODE } from '@/constants/user'
13
+import { uploadFiles } from '@/utils/request'
13
 import {
14
 import {
14
   addCardUv,
15
   addCardUv,
15
   //  addCardShareNum,
16
   //  addCardShareNum,
22
 import * as actions from '@/actions/card'
23
 import * as actions from '@/actions/card'
23
 import { dispatchProjectDetail } from '@/actions/project'
24
 import { dispatchProjectDetail } from '@/actions/project'
24
 import { getQrCodeParams } from '@/utils/qrcode'
25
 import { getQrCodeParams } from '@/utils/qrcode'
26
+import { Button } from '@tarojs/components'
25
 
27
 
26
 
28
 
27
 @connect(
29
 @connect(
64
   }
66
   }
65
 
67
 
66
   componentDidShow() {
68
   componentDidShow() {
67
-      wx.setStorage({
68
-        key: "from-card",
69
-        data: "true"
69
+
70
+    wx.setStorage({
71
+      key: "from-card",
72
+      data: "true"
73
+    })
74
+    if (this.$router.params.loadInfo == 'need') {
75
+      Taro.navigateBack({ delta: 1 })
76
+      const { cardId } = this.state
77
+      const { dispatchCardInfo, dispatchProjectDetail } = this.props
78
+      Taro.showLoading()
79
+      dispatchCardInfo(cardId).then(res => {
80
+        Taro.hideLoading()
81
+        this.setState({
82
+          loaded: true,
83
+          isSave: res.isSave
84
+        })
85
+        let buildingId = (res.projects || [])[0]
86
+        if (buildingId) {
87
+          dispatchProjectDetail(buildingId)
88
+        }
70
       })
89
       })
90
+    }
71
   }
91
   }
72
 
92
 
73
   initPageData() {
93
   initPageData() {
86
         })
106
         })
87
       })
107
       })
88
     } else {
108
     } else {
89
-
90
       this.setState({ cardId: id }, this.loadCardDetail)
109
       this.setState({ cardId: id }, this.loadCardDetail)
91
       addCardUv(id)
110
       addCardUv(id)
92
     }
111
     }
505
       icon: 'none'
524
       icon: 'none'
506
     })
525
     })
507
   }
526
   }
527
+
528
+  // 选择图片
529
+  bindAlbumClick(e) {
530
+
531
+    e.stopPropagation()
532
+
533
+    Taro.showLoading({
534
+      title: '加载中',
535
+    })
536
+    Taro.chooseImage({
537
+      count: 1,
538
+      sizeType: ['original', 'compressed'],  //可选择原图或压缩后的图片
539
+      sourceType: ['album', 'camera'], //可选择性开放访问相册、相机
540
+      success: res => {
541
+        uploadFiles(res.tempFilePaths).then(data => {
542
+          Taro.navigateTo({
543
+            url: `/pages/card/photo?photoUrl=${encodeURIComponent(data[0])}`
544
+          })
545
+        })
546
+      },
547
+    })
548
+  }
549
+
508
   render() {
550
   render() {
509
     const { makePosterStatus, posterData, grantPhoneVisible, grantAvatarVisible, cardId } = this.state
551
     const { makePosterStatus, posterData, grantPhoneVisible, grantAvatarVisible, cardId } = this.state
510
     const { userInfo, cardInfo, projectDetail } = this.props
552
     const { userInfo, cardInfo, projectDetail } = this.props
522
       buildingId: buildingId || '',
564
       buildingId: buildingId || '',
523
       targetName: '个人主页',
565
       targetName: '个人主页',
524
       targetType: 'other',
566
       targetType: 'other',
525
-      targetId: cardId  || '',
567
+      targetId: cardId || '',
526
     }
568
     }
527
     console.log(achieveParams, "achieveParamsachieveParamsachieveParamsachieveParams")
569
     console.log(achieveParams, "achieveParamsachieveParamsachieveParamsachieveParams")
528
     return (
570
     return (
547
                 <View className='mycard__user__imgox'>
589
                 <View className='mycard__user__imgox'>
548
                   <Image className='mycard__user__img' src={picture} mode="widthFix"></Image>
590
                   <Image className='mycard__user__img' src={picture} mode="widthFix"></Image>
549
                   <Image src={picture} mode="aspectFill" className='head__img'></Image>
591
                   <Image src={picture} mode="aspectFill" className='head__img'></Image>
592
+                  {
593
+                    isSelf && <Image src={require('@/assets/edit.png')} className='edit-img' onClick={this.bindAlbumClick} mode="aspectFill"></Image>
594
+                  }
550
                 </View>
595
                 </View>
551
                 <Image src={require('@/assets/person/top.png')} className='top-img' mode="aspectFill"></Image>
596
                 <Image src={require('@/assets/person/top.png')} className='top-img' mode="aspectFill"></Image>
552
               </View>
597
               </View>

+ 31
- 0
src/pages/card/index.scss 查看文件

81
       border: 4px solid rgba(255, 255, 255, 1);
81
       border: 4px solid rgba(255, 255, 255, 1);
82
       z-index: 2;
82
       z-index: 2;
83
     }
83
     }
84
+    .edit-img {
85
+      position: absolute;
86
+      bottom: 0%;
87
+      left: 24%;
88
+      width: 36px;
89
+      height: 36px;
90
+      z-index: 3;
91
+    }
84
   }
92
   }
85
 
93
 
86
   &__img {
94
   &__img {
621
       font-size: 36px;
629
       font-size: 36px;
622
     }
630
     }
623
   }
631
   }
632
+}
633
+.avatar-pop{
634
+  width: 100vw;
635
+  height: 100vh;
636
+  position: fixed;
637
+  background-color: #000;
638
+  z-index: 999;
639
+  text-align: center;
640
+  .avatar-img{
641
+    width: 400px ;
642
+    height: 400px ;
643
+    margin-top: 20vh;
644
+    border-radius: 200px;
645
+  }
646
+  .save-btn{
647
+    position: absolute;
648
+    width: 170px;
649
+    height: 70px;
650
+    line-height: 70px;
651
+    font-size: 28px;
652
+    bottom:10vh;
653
+    left: 290px;
654
+  }
624
 }
655
 }

+ 62
- 0
src/pages/card/photo.js 查看文件

1
+import Taro, { Component } from '@tarojs/taro'
2
+import './index.scss'
3
+import { updatePhoto } from '@/services/card'
4
+import { connect } from '@tarojs/redux'
5
+
6
+@connect(
7
+  ({ user }) => ({ ...user })
8
+)
9
+
10
+export default class Panorama extends Component {
11
+  state = {
12
+    avatarImg: ''
13
+  }
14
+
15
+  // 选择图片
16
+  bindAlbumClick(e) {
17
+
18
+    e.stopPropagation()
19
+
20
+    Taro.showLoading({
21
+      title: '加载中',
22
+    })
23
+    Taro.chooseImage({
24
+      count: 1,
25
+      sizeType: ['original', 'compressed'],  //可选择原图或压缩后的图片
26
+      sourceType: ['album', 'camera'], //可选择性开放访问相册、相机
27
+      success: res => {
28
+        uploadFiles(res.tempFilePaths).then(data => {
29
+          this.setState({
30
+            avatarImg: data[0]
31
+          })
32
+        })
33
+      },
34
+      complete: res => {
35
+        Taro.hideLoading()
36
+      }
37
+    })
38
+  }
39
+  saveBtn() {
40
+    const { avatarImg } = this.state
41
+    const photoUrl = this.$router.params.photoUrl || avatarImg
42
+    const { userInfo: { person: { personId } } } = this.props
43
+    updatePhoto({ photoUrl }).then(res => {
44
+      // Taro.navigateBack({ delta: 1 })
45
+      Taro.redirectTo({ url: `/pages/card/index?id=${personId}&loadInfo=need` })
46
+    })
47
+  }
48
+
49
+  render() {
50
+
51
+    const { avatarImg } = this.state
52
+    const photoUrl = this.$router.params.photoUrl || avatarImg
53
+
54
+    return (
55
+      <View className="avatar-pop">
56
+        <Image src={photoUrl} className='avatar-img' onClick={this.bindAlbumClick} mode="aspectFill"></Image>
57
+        <Button className="save-btn" onClick={this.saveBtn}>保存</Button>
58
+      </View>
59
+
60
+    )
61
+  }
62
+}

+ 19
- 6
src/pages/news/detail/index.js 查看文件

15
 import Consultant from '@/components/consultant'
15
 import Consultant from '@/components/consultant'
16
 import AchievePhone from '@/components/achievePhone'
16
 import AchievePhone from '@/components/achievePhone'
17
 import AchieveAvatar from '@/components/achieveAvatar'
17
 import AchieveAvatar from '@/components/achieveAvatar'
18
+import { dispatchProjectDetail } from '@/actions/project'
19
+import * as actions from '@/actions/card'
20
+import ProjectItem from '../../project/item'
18
 // import AuthorizationComponent from '@/components/authorizationComponent'
21
 // import AuthorizationComponent from '@/components/authorizationComponent'
19
 // import { reportClient } from '@/services/report'
22
 // import { reportClient } from '@/services/report'
20
 import {
23
 import {
27
 import { connect } from '@tarojs/redux'
30
 import { connect } from '@tarojs/redux'
28
 import { share as shareSavePoint } from '@/utils/shareSavePoint'
31
 import { share as shareSavePoint } from '@/utils/shareSavePoint'
29
 
32
 
30
-@connect(state => state.user)
33
+// @connect(state => state.user)
34
+@connect(
35
+  ({ user, card, project }) => ({ ...user, ...card, ...project }),
36
+  { dispatchProjectDetail, ...actions }
37
+)
31
 export default class NewsDetail extends Component {
38
 export default class NewsDetail extends Component {
32
   config = {
39
   config = {
33
     navigationBarTitleText: '资讯详情'
40
     navigationBarTitleText: '资讯详情'
244
     const consultant = this.$router.params.consultant || qrcodeParams.consultant
251
     const consultant = this.$router.params.consultant || qrcodeParams.consultant
245
     const consultantId = this.$router.params.consultantId || qrcodeParams.consultantId || ""
252
     const consultantId = this.$router.params.consultantId || qrcodeParams.consultantId || ""
246
     const recommender = this.$router.params.recommender || qrcodeParams.recommender || ""
253
     const recommender = this.$router.params.recommender || qrcodeParams.recommender || ""
254
+    const { dispatchProjectDetail } = this.props
247
     Taro.showLoading()
255
     Taro.showLoading()
248
     console.log(newsId, "newsIdnewsIdnewsIdnewsIdnewsId")
256
     console.log(newsId, "newsIdnewsIdnewsIdnewsIdnewsId")
249
     queryNewsDetail(newsId).then(res => {
257
     queryNewsDetail(newsId).then(res => {
264
         })
272
         })
265
         console.info('资讯详情')
273
         console.info('资讯详情')
266
       })
274
       })
275
+      if (res.buildingId) {
276
+        dispatchProjectDetail(res.buildingId, { showToast: false, })
277
+      }
267
 
278
 
268
       this.setState({
279
       this.setState({
269
         detail: res,
280
         detail: res,
353
       buildingId: buildingId || '',
364
       buildingId: buildingId || '',
354
       data: '{}'
365
       data: '{}'
355
     }, 'news')
366
     }, 'news')
356
-
357
-
358
   }
367
   }
359
-
368
+  toProjectDetail = () => {
369
+    const { projectDetail: { buildingId } } = this.props
370
+    this.navigateTo(`/pages/project/detail/index?id=${buildingId}`)
371
+  }
360
   render() {
372
   render() {
361
     const { webViewVisible, grantPhoneVisible, grantAvatarVisible, detail, loaded, isSaved, posterVisible, posterData, posterShow, consultData, consultShow } = this.state
373
     const { webViewVisible, grantPhoneVisible, grantAvatarVisible, detail, loaded, isSaved, posterVisible, posterData, posterShow, consultData, consultShow } = this.state
362
-    const { userInfo = { person: {} } } = this.props
363
-    
374
+    const { userInfo = { person: {} }, cardInfo, projectDetail = {} } = this.props
375
+
364
     const achieveParams = {
376
     const achieveParams = {
365
       buildingId: detail.buildingId || '',
377
       buildingId: detail.buildingId || '',
366
       targetName: detail.newsName || '',
378
       targetName: detail.newsName || '',
403
                   </View>
415
                   </View>
404
                 </ScrollView>
416
                 </ScrollView>
405
                 <Notice></Notice>
417
                 <Notice></Notice>
418
+                {projectDetail.buildingId && <View className="pro__info"><ProjectItem data={projectDetail} onClick={this.toProjectDetail.bind(this)} /></View>}
406
                 <BackHomeBtn style={consultShow ? "bottom:310rpx" : ''}></BackHomeBtn>
419
                 <BackHomeBtn style={consultShow ? "bottom:310rpx" : ''}></BackHomeBtn>
407
                 {
420
                 {
408
                   consultShow && <Consultant style="bottom:150rpx" smallStyle="bottom:178rpx" personId={userInfo.person.personId} name={userInfo.person.name || userInfo.person.nickname} data={consultData}></Consultant>
421
                   consultShow && <Consultant style="bottom:150rpx" smallStyle="bottom:178rpx" personId={userInfo.person.personId} name={userInfo.person.name || userInfo.person.nickname} data={consultData}></Consultant>

+ 4
- 1
src/pages/news/detail/index.scss 查看文件

71
     margin-top: 30px;
71
     margin-top: 30px;
72
   }
72
   }
73
 }
73
 }
74
-
74
+.pro__info {
75
+  padding: 30px  30px 50px 30px;
76
+  background: white;
77
+}
75
 
78
 
76
 .bot-nav {
79
 .bot-nav {
77
   position: fixed;
80
   position: fixed;

+ 3
- 2
src/pages/person/index.js 查看文件

213
 
213
 
214
   renderDetail() {
214
   renderDetail() {
215
     const { users, menus, roleName } = this.state
215
     const { users, menus, roleName } = this.state
216
-    const { user: { userInfo: { person: { org: { waterMark } = {} }, miniApp: { name } } } } = this.props
216
+    const { user: { userInfo: { person: { avatarurl, org: { waterMark } = {} }, miniApp: { name } } } } = this.props
217
 
217
 
218
     // const showQRCode = user.personType === ROLE_CODE['CONSULTANT'] || ROLE_CODE['ESTATE_AGENT'] || ROLE_CODE['CHANNEL_AGENT']
218
     // const showQRCode = user.personType === ROLE_CODE['CONSULTANT'] || ROLE_CODE['ESTATE_AGENT'] || ROLE_CODE['CHANNEL_AGENT']
219
     // const isConsultant = user.personType == ROLE_CODE['CONSULTANT']
219
     // const isConsultant = user.personType == ROLE_CODE['CONSULTANT']
229
           <View className="content">
229
           <View className="content">
230
             <View className="info-block">
230
             <View className="info-block">
231
               <View className="avatar" onClick={this.goPersonDetail}>
231
               <View className="avatar" onClick={this.goPersonDetail}>
232
-                <Image className="info__headimg" src={users.avatar} />
232
+                <Image className="info__headimg" src={avatarurl} />
233
+                {/* <Image className="info__headimg" src={users.avatar} /> */}
233
                 <View className="info-intro">{roleName}</View>
234
                 <View className="info-intro">{roleName}</View>
234
               </View>
235
               </View>
235
 
236
 

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

84
     qrcodeParams: '',
84
     qrcodeParams: '',
85
     grantPhoneVisible: false, // 授权电话
85
     grantPhoneVisible: false, // 授权电话
86
     grantAvatarVisible: false, // 授权头像
86
     grantAvatarVisible: false, // 授权头像
87
+    maskVisible: false,
88
+    extendContent: []
87
   }
89
   }
88
 
90
 
89
   componentWillPreload(params) {
91
   componentWillPreload(params) {
125
   componentDidShow() {
127
   componentDidShow() {
126
     console.log('3366633', this.$router.params)
128
     console.log('3366633', this.$router.params)
127
 
129
 
128
-      const fromCard = !!wx.getStorageSync('from-card')
130
+    const fromCard = !!wx.getStorageSync('from-card')
129
 
131
 
130
-      if (fromCard) {
131
-        this.loadData()
132
-      }
132
+    if (fromCard) {
133
+      this.loadData()
134
+    }
133
   }
135
   }
134
 
136
 
135
   componentWillUnmount() {
137
   componentWillUnmount() {
336
     })
338
     })
337
 
339
 
338
     dispatchProjectDetail(buildingId).then(res => {
340
     dispatchProjectDetail(buildingId).then(res => {
341
+      const maskVisible = (res.extendContent || []).length
339
       this.setState({
342
       this.setState({
340
         loaded: true,
343
         loaded: true,
344
+        maskVisible,
345
+        extendContent: res.extendContent[0],
341
         // circumOpts: newCircumOpts,
346
         // circumOpts: newCircumOpts,
342
         isSaved: res.isSave
347
         isSaved: res.isSave
343
       }, () => {
348
       }, () => {
1504
       </View>
1509
       </View>
1505
     );
1510
     );
1506
   }
1511
   }
1512
+  handleMaskBannerClick(data) {
1513
+    this.redirectTo(data)
1514
+  }
1515
+  redirectTo({ targetId, contentType, buildingId } = {}) {
1516
+    switch (contentType) {
1517
+      // 项目
1518
+      case 'project':
1519
+        Taro.navigateTo({
1520
+          url: '/pages/project/detail/index?id=' + buildingId
1521
+        })
1522
+        return;
1507
 
1523
 
1524
+      // 活动
1525
+      case 'activity':
1526
+        Taro.navigateTo({
1527
+          url: '/pages/activity/detail/index?id=' + targetId
1528
+        })
1529
+        return;
1530
+
1531
+      // 助力
1532
+      case 'help':
1533
+        Taro.navigateTo({
1534
+          url: '/pages/activity/detail/assistance?id=' + targetId
1535
+        })
1536
+        return;
1537
+
1538
+      // 拼团
1539
+      case 'group':
1540
+        Taro.navigateTo({
1541
+          url: '/pages/activity/detail/assemble?id=' + targetId
1542
+        })
1543
+        return;
1544
+
1545
+      // 资讯
1546
+      case 'news':
1547
+        Taro.navigateTo({
1548
+          url: '/pages/news/detail/index?id=' + targetId
1549
+        })
1550
+        return;
1551
+      // h5
1552
+      case 'h5':
1553
+        Taro.navigateTo({
1554
+          url: '/pages/project/h5Page?id=' + targetId
1555
+        })
1556
+        return;
1557
+      // live
1558
+      case 'live':
1559
+        Taro.navigateTo({
1560
+          url: '/onlineSelling/pages/live/index?id=' + targetId
1561
+        })
1562
+        return;
1563
+      // salesBatch
1564
+      case 'salesBatch':
1565
+        Taro.navigateTo({
1566
+          url: `/onlineSelling/pages/houseList/index?id=${targetId}`
1567
+        })
1568
+        return;
1569
+
1570
+      // 其他
1571
+      case 'others':
1572
+      default:
1573
+        this.handleMaskClose()
1574
+        return;
1575
+    }
1576
+  }
1577
+  handleMaskClose() {
1578
+    this.setState({
1579
+      maskVisible: false
1580
+    })
1581
+  }
1582
+  renderMaskBanner() {
1583
+
1584
+    const { extendContent = [] } = this.state
1585
+    return (
1586
+      <View className="mask-banner">
1587
+        <View className="content">
1588
+          <Image
1589
+            mode="widthFix"
1590
+            className="img"
1591
+            src={transferImage(extendContent.image)}
1592
+            onClick={this.handleMaskBannerClick.bind(this, extendContent)}>
1593
+          </Image>
1594
+          <Icon className="iconfont close icon-buoumaotubiao20" onClick={this.handleMaskClose}></Icon>
1595
+        </View>
1596
+      </View>
1597
+    )
1598
+  }
1508
   render() {
1599
   render() {
1509
-    const { grantPhoneVisible, grantAvatarVisible, posterStatus, posterData, loaded, btnstate, consultData, consultShow } = this.state
1600
+    const { grantPhoneVisible, grantAvatarVisible, maskVisible, posterStatus, posterData, loaded, btnstate, consultData, consultShow } = this.state
1510
     const { projectDetail, userInfo = { person: {} } } = this.props
1601
     const { projectDetail, userInfo = { person: {} } } = this.props
1511
     const { uvList = {} } = projectDetail
1602
     const { uvList = {} } = projectDetail
1512
     const { total = 0, records = [] } = uvList
1603
     const { total = 0, records = [] } = uvList
1533
           grantAvatarVisible &&
1624
           grantAvatarVisible &&
1534
           <AchieveAvatar user={userInfo.person} onSuccess={() => { this.setState({ grantAvatarVisible: false }) }} ></AchieveAvatar>
1625
           <AchieveAvatar user={userInfo.person} onSuccess={() => { this.setState({ grantAvatarVisible: false }) }} ></AchieveAvatar>
1535
         }
1626
         }
1627
+
1628
+        {maskVisible && this.renderMaskBanner()}
1629
+
1536
         {
1630
         {
1537
           loaded && (
1631
           loaded && (
1538
             <View className='detail'>
1632
             <View className='detail'>

+ 36
- 0
src/pages/project/detail/index.scss 查看文件

200
   }
200
   }
201
 }
201
 }
202
 
202
 
203
+.mask-banner {
204
+  position: fixed;
205
+  width: 100vw;
206
+  height: 100vh;
207
+  left: 0;
208
+  top: 0;
209
+  z-index: 9999;
210
+  background: rgba(0, 0, 0, 0.8);
211
+  display: flex;
212
+  flex-direction: column;
213
+  justify-content: center;
214
+  align-items: center;
215
+
216
+  .content {
217
+    width: 500px;
218
+    height: 600px;
219
+    position: absolute;
220
+    left: 50%;
221
+    top: 40%;
222
+    margin-left: -250px;
223
+    transform: translateY(-50%);
224
+    text-align: center;
225
+
226
+    .img {
227
+      width: 100%;
228
+      height: 600px;
229
+      border-radius: 30px;
230
+    }
231
+
232
+    .close {
233
+      font-size: 48px;
234
+      color: white;
235
+    }
236
+  }
237
+}
238
+
203
 .bt-nav {
239
 .bt-nav {
204
   position: fixed;
240
   position: fixed;
205
   width: 100%;
241
   width: 100%;

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

141
 
141
 
142
     queryExtContents({ cityId: curCity.id }).then(res => {
142
     queryExtContents({ cityId: curCity.id }).then(res => {
143
       // 开屏广告
143
       // 开屏广告
144
-      const maskBanner = (res || []).filter(x => x.showType === 'screen')[0] || {}
144
+      const maskBanner = (res || []).filter(x => x.showType === 'screen' && x.showPosition === 'index')[0] || {}
145
       const maskVisible = maskBanner.contentId && this.props.screenShow !== maskBanner.contentId
145
       const maskVisible = maskBanner.contentId && this.props.screenShow !== maskBanner.contentId
146
 
146
 
147
       // 首页 banner
147
       // 首页 banner

+ 6
- 0
src/routes.js 查看文件

149
     pkg: 'main',
149
     pkg: 'main',
150
     type: 'card',
150
     type: 'card',
151
   },
151
   },
152
+  {
153
+    name: '更换头像',
154
+    page: 'pages/card/photo',
155
+    pkg: 'main',
156
+    type: 'card',
157
+  },
152
   {
158
   {
153
     name: '我的客户',
159
     name: '我的客户',
154
     page: 'pages/person/myGuest/index',
160
     page: 'pages/person/myGuest/index',

+ 8
- 1
src/services/card.js 查看文件

7
   API_CARDS_LIKE,
7
   API_CARDS_LIKE,
8
   API_FORM_ID,
8
   API_FORM_ID,
9
   API_CARDS_SHARE,
9
   API_CARDS_SHARE,
10
-  API_CARD_FAVOR
10
+  API_CARD_FAVOR,
11
+  API_UPDATE_PHOTO
11
 } from '@/constants/api'
12
 } from '@/constants/api'
12
 
13
 
13
 
14
 
42
  */
43
  */
43
 export const addLike = id => fetch({ url: `${API_CARDS_LIKE}/${id}`, method: 'POST' })
44
 export const addLike = id => fetch({ url: `${API_CARDS_LIKE}/${id}`, method: 'POST' })
44
 
45
 
46
+/**
47
+ * 置业顾问换头像
48
+ * @param {*} payload
49
+ */
50
+export const updatePhoto = payload => fetch({ url: API_UPDATE_PHOTO, payload, method: 'PUT' })
51
+
45
 /**
52
 /**
46
  * 名片取消点赞
53
  * 名片取消点赞
47
  * @param {*} id  名片id
54
  * @param {*} id  名片id