张延森 пре 5 година
родитељ
комит
754b1cf32c
3 измењених фајлова са 12 додато и 14 уклоњено
  1. 1
    1
      src/pages/person/index.js
  2. 10
    10
      src/pages/project/detail/index.js
  3. 1
    3
      src/pages/project/detail/index.scss

+ 1
- 1
src/pages/person/index.js Прегледај датотеку

194
 
194
 
195
   renderDetail() {
195
   renderDetail() {
196
     const { users, menus, roleName } = this.state
196
     const { users, menus, roleName } = this.state
197
-    const { user: { userInfo: { person: { org: { waterMark } }, miniApp: { name } } } } = this.props
197
+    const { user: { userInfo: { person: { org: { waterMark } = {} }, miniApp: { name } } } } = this.props
198
     
198
     
199
     // const showQRCode = user.personType === ROLE_CODE['CONSULTANT'] || ROLE_CODE['ESTATE_AGENT'] || ROLE_CODE['CHANNEL_AGENT']
199
     // const showQRCode = user.personType === ROLE_CODE['CONSULTANT'] || ROLE_CODE['ESTATE_AGENT'] || ROLE_CODE['CHANNEL_AGENT']
200
     // const isConsultant = user.personType == ROLE_CODE['CONSULTANT']
200
     // const isConsultant = user.personType == ROLE_CODE['CONSULTANT']

+ 10
- 10
src/pages/project/detail/index.js Прегледај датотеку

1314
     const { videoPlayShow } = this.state
1314
     const { videoPlayShow } = this.state
1315
     const { projectDetail } = this.props
1315
     const { projectDetail } = this.props
1316
     const { videoImage } = projectDetail
1316
     const { videoImage } = projectDetail
1317
-    const imgSrc = videoImage[0].url
1317
+    const imgSrc = videoImage ? videoImage[0].url : ''
1318
 
1318
 
1319
     return (
1319
     return (
1320
       <View
1320
       <View
1437
     const { uvList = {} } = projectDetail
1437
     const { uvList = {} } = projectDetail
1438
     const { total = 0, records = [] } = uvList
1438
     const { total = 0, records = [] } = uvList
1439
     const openDate = projectDetail.openingDate ? dayjs(projectDetail.openingDate).locale('zh-cn').format('YYYY年M月D日') : '暂无'
1439
     const openDate = projectDetail.openingDate ? dayjs(projectDetail.openingDate).locale('zh-cn').format('YYYY年M月D日') : '暂无'
1440
+    const showBuildingImgs = projectDetail.buildingImg && projectDetail.buildingImg.length > 0
1441
+    const showBuildingVRs = projectDetail.panoramaList && projectDetail.panoramaList.length > 0
1442
+    const shwoBuildingVideo = projectDetail.videoUrl ? true : false
1443
+    const showMediaBtn = showBuildingImgs + showBuildingVRs + shwoBuildingVideo > 1 // 满足2个就展示
1444
+
1440
     return (
1445
     return (
1441
       <Block>
1446
       <Block>
1442
         {
1447
         {
1447
           grantAvatarVisible &&
1452
           grantAvatarVisible &&
1448
           <AchieveAvatar user={userInfo.person} onSuccess={() => { this.setState({ grantAvatarVisible: false }) }} ></AchieveAvatar>
1453
           <AchieveAvatar user={userInfo.person} onSuccess={() => { this.setState({ grantAvatarVisible: false }) }} ></AchieveAvatar>
1449
         }
1454
         }
1450
-        {/* {
1451
-          (userInfo.person.personId && !userInfo.person.phone && !userInfo.person.tel) &&
1452
-          <AchievePhone user={userInfo.person} onSuccess={this.handleAuthPhoneSuccess}></AchievePhone>
1453
-        } */}
1454
         {
1455
         {
1455
           loaded && (
1456
           loaded && (
1456
             <View className='detail'>
1457
             <View className='detail'>
1463
               {btnstate === 2 && this.renderBannerPanorama()}
1464
               {btnstate === 2 && this.renderBannerPanorama()}
1464
 
1465
 
1465
               {
1466
               {
1466
-                projectDetail.buildingImg && projectDetail.buildingImg.length &&
1467
-                projectDetail.panoramaList && projectDetail.panoramaList.length &&
1467
+                showMediaBtn &&
1468
                 (
1468
                 (
1469
                   <View className="media-btn">
1469
                   <View className="media-btn">
1470
-                    {/* <View className={`btn ${btnstate === 1 && 'active'}`} onClick={this.handleBannerBtnClick.bind(this, 1)}>视频</View> */}
1471
-                    <View className={`btn ${btnstate === 2 && 'active'}`} onClick={this.handleBannerBtnClick.bind(this, 2)}>全景</View>
1472
-                    <View className={`btn ${!btnstate && 'active'}`} onClick={this.handleBannerBtnClick.bind(this, 0)}>图片</View>
1470
+                    {shwoBuildingVideo && <View className={`btn ${btnstate === 1 && 'active'}`} onClick={this.handleBannerBtnClick.bind(this, 1)}>视频</View>}
1471
+                    {showBuildingVRs && <View className={`btn ${btnstate === 2 && 'active'}`} onClick={this.handleBannerBtnClick.bind(this, 2)}>全景</View>}
1472
+                    {showBuildingImgs && <View className={`btn ${!btnstate && 'active'}`} onClick={this.handleBannerBtnClick.bind(this, 0)}>图片</View>}
1473
                   </View>
1473
                   </View>
1474
                 )
1474
                 )
1475
               }
1475
               }

+ 1
- 3
src/pages/project/detail/index.scss Прегледај датотеку

14
   padding-bottom: 50px;
14
   padding-bottom: 50px;
15
 
15
 
16
   .media-btn {
16
   .media-btn {
17
-    position: absolute;
18
-    width: 184px;
19
     height: 64px;
17
     height: 64px;
20
     top: 440px;
18
     top: 440px;
21
-    left: 284px;
22
     font-size: 30px;
19
     font-size: 30px;
23
     font-family: PingFangSC-Regular, PingFang SC;
20
     font-family: PingFangSC-Regular, PingFang SC;
24
     font-weight: 400;
21
     font-weight: 400;
27
     color: rgba(53, 53, 53, 1);
24
     color: rgba(53, 53, 53, 1);
28
     display: flex;
25
     display: flex;
29
     position: fixed;
26
     position: fixed;
27
+    transform: translateX(calc(50vw - 50%));
30
 
28
 
31
     .btn {
29
     .btn {
32
       width: 92px;
30
       width: 92px;