Просмотр исходного кода

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

Yansen 5 лет назад
Родитель
Сommit
3311a4da68

+ 5
- 5
config/dev.js Просмотреть файл

@@ -3,13 +3,13 @@ module.exports = {
3 3
     NODE_ENV: '"development"'
4 4
   },
5 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 10
     OSS_PATH: "https://njcj.oss-cn-shanghai.aliyuncs.com/",
11 11
     OSS_FAST_PATH: "https://njcj.oss-accelerate.aliyuncs.com/",
12
-    Version: "V3.5.26"
12
+    Version: "V3.5.28"
13 13
   },
14 14
   weapp: {},
15 15
   h5: {}

+ 1
- 1
config/prod.js Просмотреть файл

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

+ 3
- 2
src/actions/project.js Просмотреть файл

@@ -39,9 +39,10 @@ export const dispatchIndexProjects = payload => createAction({
39 39
  * 获取项目信息
40 40
  * @param {*} id 
41 41
  */
42
-export const dispatchProjectDetail = id => createAction({
42
+export const dispatchProjectDetail = (id, params) => createAction({
43 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,6 +44,7 @@ export const API_CHAT_READED = resolvePath('chat/message')
44 44
 export const API_CARDS_LIST = resolvePath('cards')
45 45
 export const API_CARDS_APPLY = resolvePath('cards/apply')
46 46
 export const API_FORM_ID = resolvePath('formid')
47
+export const API_UPDATE_PHOTO = resolvePath('userInfo/updatePhoto')
47 48
 
48 49
 // project
49 50
 export const API_ITEMS_LIST = resolvePath('building/list')

+ 9
- 25
src/pages/activity/detail/assemble.js Просмотреть файл

@@ -371,8 +371,9 @@ export default class Detail extends Component {
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 377
     const { userInfo: { person: { personId, personType, userId } } } = this.props
377 378
     const consultant = personType == ROLE_CODE['CONSULTANT'] ? personId : ""
378 379
     const consultantId = personType == ROLE_CODE['CONSULTANT'] ? userId : ""
@@ -383,11 +384,11 @@ export default class Detail extends Component {
383 384
       `recommender=${personId}`,
384 385
       `consultant=${consultant}`,
385 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 392
     const res = [
392 393
       'pages/activity/detail/assemble',
393 394
       queryParams.join('&'),
@@ -399,7 +400,8 @@ export default class Detail extends Component {
399 400
 
400 401
   onShareAppMessage = (res) => {
401 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 405
     const { userInfo: { person: { personId, personType, userId } } } = this.props
404 406
     const consultantId = personType == ROLE_CODE['CONSULTANT'] ? userId : ""
405 407
 
@@ -415,26 +417,8 @@ export default class Detail extends Component {
415 417
       data: '{}'
416 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 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 422
     return {
439 423
       title: shareData.shareContentTitle,
440 424
       path: currentPage,//分享地址

+ 8
- 5
src/pages/activity/detail/assistance.js Просмотреть файл

@@ -375,7 +375,8 @@ export default class Detail extends Component {
375 375
   }
376 376
 
377 377
   currentPageAndParams(shareFrom) {
378
-    const { id, initiateId } = this.state
378
+    // currentPageAndParams(shareFrom) {
379
+    const { id, initiateId = '' } = this.state
379 380
     const { userInfo: { person: { personId, personType, userId } } } = this.props
380 381
     const consultant = personType == ROLE_CODE['CONSULTANT'] ? personId : ""
381 382
     const consultantId = personType == ROLE_CODE['CONSULTANT'] ? userId : ""
@@ -386,11 +387,12 @@ export default class Detail extends Component {
386 387
       `recommender=${personId}`,
387 388
       `consultant=${consultant}`,
388 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 397
     const res = [
396 398
       'pages/activity/detail/assistance',
@@ -404,7 +406,8 @@ export default class Detail extends Component {
404 406
   onShareAppMessage = (res) => {
405 407
 
406 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 411
     const { userInfo: { person: { personId, personType, userId } } } = this.props
409 412
     const consultantId = personType == ROLE_CODE['CONSULTANT'] ? userId : ""
410 413
     shareSavePoint({

+ 50
- 5
src/pages/card/index.js Просмотреть файл

@@ -10,6 +10,7 @@ import AchievePhone from '@/components/achievePhone'
10 10
 import AchieveAvatar from '@/components/achieveAvatar'
11 11
 import { sceneInShare } from '@/utils/tools'
12 12
 import { ROLE_CODE } from '@/constants/user'
13
+import { uploadFiles } from '@/utils/request'
13 14
 import {
14 15
   addCardUv,
15 16
   //  addCardShareNum,
@@ -22,6 +23,7 @@ import { share as shareSavePoint } from '@/utils/shareSavePoint'
22 23
 import * as actions from '@/actions/card'
23 24
 import { dispatchProjectDetail } from '@/actions/project'
24 25
 import { getQrCodeParams } from '@/utils/qrcode'
26
+import { Button } from '@tarojs/components'
25 27
 
26 28
 
27 29
 @connect(
@@ -64,10 +66,28 @@ export default class Index extends Component {
64 66
   }
65 67
 
66 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 93
   initPageData() {
@@ -86,7 +106,6 @@ export default class Index extends Component {
86 106
         })
87 107
       })
88 108
     } else {
89
-
90 109
       this.setState({ cardId: id }, this.loadCardDetail)
91 110
       addCardUv(id)
92 111
     }
@@ -505,6 +524,29 @@ export default class Index extends Component {
505 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 550
   render() {
509 551
     const { makePosterStatus, posterData, grantPhoneVisible, grantAvatarVisible, cardId } = this.state
510 552
     const { userInfo, cardInfo, projectDetail } = this.props
@@ -522,7 +564,7 @@ export default class Index extends Component {
522 564
       buildingId: buildingId || '',
523 565
       targetName: '个人主页',
524 566
       targetType: 'other',
525
-      targetId: cardId  || '',
567
+      targetId: cardId || '',
526 568
     }
527 569
     console.log(achieveParams, "achieveParamsachieveParamsachieveParamsachieveParams")
528 570
     return (
@@ -547,6 +589,9 @@ export default class Index extends Component {
547 589
                 <View className='mycard__user__imgox'>
548 590
                   <Image className='mycard__user__img' src={picture} mode="widthFix"></Image>
549 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 595
                 </View>
551 596
                 <Image src={require('@/assets/person/top.png')} className='top-img' mode="aspectFill"></Image>
552 597
               </View>

+ 31
- 0
src/pages/card/index.scss Просмотреть файл

@@ -81,6 +81,14 @@
81 81
       border: 4px solid rgba(255, 255, 255, 1);
82 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 94
   &__img {
@@ -621,4 +629,27 @@
621 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 Просмотреть файл

@@ -0,0 +1,62 @@
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,6 +15,9 @@ import { ROLE_CODE } from '@/constants/user'
15 15
 import Consultant from '@/components/consultant'
16 16
 import AchievePhone from '@/components/achievePhone'
17 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 21
 // import AuthorizationComponent from '@/components/authorizationComponent'
19 22
 // import { reportClient } from '@/services/report'
20 23
 import {
@@ -27,7 +30,11 @@ import {
27 30
 import { connect } from '@tarojs/redux'
28 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 38
 export default class NewsDetail extends Component {
32 39
   config = {
33 40
     navigationBarTitleText: '资讯详情'
@@ -244,6 +251,7 @@ export default class NewsDetail extends Component {
244 251
     const consultant = this.$router.params.consultant || qrcodeParams.consultant
245 252
     const consultantId = this.$router.params.consultantId || qrcodeParams.consultantId || ""
246 253
     const recommender = this.$router.params.recommender || qrcodeParams.recommender || ""
254
+    const { dispatchProjectDetail } = this.props
247 255
     Taro.showLoading()
248 256
     console.log(newsId, "newsIdnewsIdnewsIdnewsIdnewsId")
249 257
     queryNewsDetail(newsId).then(res => {
@@ -264,6 +272,9 @@ export default class NewsDetail extends Component {
264 272
         })
265 273
         console.info('资讯详情')
266 274
       })
275
+      if (res.buildingId) {
276
+        dispatchProjectDetail(res.buildingId, { showToast: false, })
277
+      }
267 278
 
268 279
       this.setState({
269 280
         detail: res,
@@ -353,14 +364,15 @@ export default class NewsDetail extends Component {
353 364
       buildingId: buildingId || '',
354 365
       data: '{}'
355 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 372
   render() {
361 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 376
     const achieveParams = {
365 377
       buildingId: detail.buildingId || '',
366 378
       targetName: detail.newsName || '',
@@ -403,6 +415,7 @@ export default class NewsDetail extends Component {
403 415
                   </View>
404 416
                 </ScrollView>
405 417
                 <Notice></Notice>
418
+                {projectDetail.buildingId && <View className="pro__info"><ProjectItem data={projectDetail} onClick={this.toProjectDetail.bind(this)} /></View>}
406 419
                 <BackHomeBtn style={consultShow ? "bottom:310rpx" : ''}></BackHomeBtn>
407 420
                 {
408 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,7 +71,10 @@
71 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 79
 .bot-nav {
77 80
   position: fixed;

+ 3
- 2
src/pages/person/index.js Просмотреть файл

@@ -213,7 +213,7 @@ export default class Person extends Component {
213 213
 
214 214
   renderDetail() {
215 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 218
     // const showQRCode = user.personType === ROLE_CODE['CONSULTANT'] || ROLE_CODE['ESTATE_AGENT'] || ROLE_CODE['CHANNEL_AGENT']
219 219
     // const isConsultant = user.personType == ROLE_CODE['CONSULTANT']
@@ -229,7 +229,8 @@ export default class Person extends Component {
229 229
           <View className="content">
230 230
             <View className="info-block">
231 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 234
                 <View className="info-intro">{roleName}</View>
234 235
               </View>
235 236
 

+ 99
- 5
src/pages/project/detail/index.js Просмотреть файл

@@ -84,6 +84,8 @@ export default class Index extends Component {
84 84
     qrcodeParams: '',
85 85
     grantPhoneVisible: false, // 授权电话
86 86
     grantAvatarVisible: false, // 授权头像
87
+    maskVisible: false,
88
+    extendContent: []
87 89
   }
88 90
 
89 91
   componentWillPreload(params) {
@@ -125,11 +127,11 @@ export default class Index extends Component {
125 127
   componentDidShow() {
126 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 137
   componentWillUnmount() {
@@ -336,8 +338,11 @@ export default class Index extends Component {
336 338
     })
337 339
 
338 340
     dispatchProjectDetail(buildingId).then(res => {
341
+      const maskVisible = (res.extendContent || []).length
339 342
       this.setState({
340 343
         loaded: true,
344
+        maskVisible,
345
+        extendContent: res.extendContent[0],
341 346
         // circumOpts: newCircumOpts,
342 347
         isSaved: res.isSave
343 348
       }, () => {
@@ -1504,9 +1509,95 @@ export default class Index extends Component {
1504 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 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 1601
     const { projectDetail, userInfo = { person: {} } } = this.props
1511 1602
     const { uvList = {} } = projectDetail
1512 1603
     const { total = 0, records = [] } = uvList
@@ -1533,6 +1624,9 @@ export default class Index extends Component {
1533 1624
           grantAvatarVisible &&
1534 1625
           <AchieveAvatar user={userInfo.person} onSuccess={() => { this.setState({ grantAvatarVisible: false }) }} ></AchieveAvatar>
1535 1626
         }
1627
+
1628
+        {maskVisible && this.renderMaskBanner()}
1629
+
1536 1630
         {
1537 1631
           loaded && (
1538 1632
             <View className='detail'>

+ 36
- 0
src/pages/project/detail/index.scss Просмотреть файл

@@ -200,6 +200,42 @@
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 239
 .bt-nav {
204 240
   position: fixed;
205 241
   width: 100%;

+ 1
- 1
src/pages/project/index.js Просмотреть файл

@@ -141,7 +141,7 @@ export default class Index extends Component {
141 141
 
142 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 145
       const maskVisible = maskBanner.contentId && this.props.screenShow !== maskBanner.contentId
146 146
 
147 147
       // 首页 banner

+ 6
- 0
src/routes.js Просмотреть файл

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

+ 8
- 1
src/services/card.js Просмотреть файл

@@ -7,7 +7,8 @@ import {
7 7
   API_CARDS_LIKE,
8 8
   API_FORM_ID,
9 9
   API_CARDS_SHARE,
10
-  API_CARD_FAVOR
10
+  API_CARD_FAVOR,
11
+  API_UPDATE_PHOTO
11 12
 } from '@/constants/api'
12 13
 
13 14
 
@@ -42,6 +43,12 @@ export const addCardUv = id => fetch({ url: `${API_CARDS_UV}/${id}`, method: 'PO
42 43
  */
43 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 54
  * @param {*} id  名片id