张延森 5 år sedan
förälder
incheckning
754b1cf32c
3 ändrade filer med 12 tillägg och 14 borttagningar
  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 Visa fil

@@ -194,7 +194,7 @@ export default class Person extends Component {
194 194
 
195 195
   renderDetail() {
196 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 199
     // const showQRCode = user.personType === ROLE_CODE['CONSULTANT'] || ROLE_CODE['ESTATE_AGENT'] || ROLE_CODE['CHANNEL_AGENT']
200 200
     // const isConsultant = user.personType == ROLE_CODE['CONSULTANT']

+ 10
- 10
src/pages/project/detail/index.js Visa fil

@@ -1314,7 +1314,7 @@ export default class Index extends Component {
1314 1314
     const { videoPlayShow } = this.state
1315 1315
     const { projectDetail } = this.props
1316 1316
     const { videoImage } = projectDetail
1317
-    const imgSrc = videoImage[0].url
1317
+    const imgSrc = videoImage ? videoImage[0].url : ''
1318 1318
 
1319 1319
     return (
1320 1320
       <View
@@ -1437,6 +1437,11 @@ export default class Index extends Component {
1437 1437
     const { uvList = {} } = projectDetail
1438 1438
     const { total = 0, records = [] } = uvList
1439 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 1445
     return (
1441 1446
       <Block>
1442 1447
         {
@@ -1447,10 +1452,6 @@ export default class Index extends Component {
1447 1452
           grantAvatarVisible &&
1448 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 1456
           loaded && (
1456 1457
             <View className='detail'>
@@ -1463,13 +1464,12 @@ export default class Index extends Component {
1463 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 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 1473
                   </View>
1474 1474
                 )
1475 1475
               }

+ 1
- 3
src/pages/project/detail/index.scss Visa fil

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