|
@@ -36,6 +36,7 @@ import { share as shareSavePoint } from '@/utils/shareSavePoint'
|
36
|
36
|
|
37
|
37
|
const buildBg = 'https://njcj.oss-cn-shanghai.aliyuncs.com/miniapp/images/buildbg.png'
|
38
|
38
|
const dotImg = require('@/assets/dot.png')
|
|
39
|
+const vrLogo = require('@/assets/vr.png');
|
39
|
40
|
|
40
|
41
|
@connect(
|
41
|
42
|
({ user, project }) => ({ ...user, ...project }),
|
|
@@ -72,7 +73,7 @@ export default class Index extends Component {
|
72
|
73
|
recordId: null,
|
73
|
74
|
posterShow: 'none',
|
74
|
75
|
current: 1,
|
75
|
|
- btnstate: 0,// 1显示视频 0显示图片
|
|
76
|
+ btnstate: 0,// 1显示视频 0显示图片 2显示全景
|
76
|
77
|
albumCurrent: 0,
|
77
|
78
|
videoPlayShow: 'flex',
|
78
|
79
|
consultData: {}, // 分享的置业顾问信息
|
|
@@ -1042,6 +1043,15 @@ export default class Index extends Component {
|
1042
|
1043
|
url: '/pages/activity/detail/assemble?id=' + item.activityId
|
1043
|
1044
|
})
|
1044
|
1045
|
}
|
|
1046
|
+
|
|
1047
|
+ handleHouseTypePosterClick(apartment, imgList) {
|
|
1048
|
+ if (apartment.panoramaArr) {
|
|
1049
|
+ this.goToPanorama(apartment.panoramaArr[0])
|
|
1050
|
+ } else {
|
|
1051
|
+ this.handlePreviewHxImage(apartment.buildingImgList[0].url, imgList)
|
|
1052
|
+ }
|
|
1053
|
+ }
|
|
1054
|
+
|
1045
|
1055
|
renderGroup() {
|
1046
|
1056
|
const { groupList } = this.state
|
1047
|
1057
|
return (
|
|
@@ -1066,13 +1076,23 @@ export default class Index extends Component {
|
1066
|
1076
|
|
1067
|
1077
|
renderHouseTypeList() {
|
1068
|
1078
|
const { statusOpts, statusBgColors } = this.state
|
1069
|
|
- const { projectDetail: { buildingApartment } } = this.props
|
|
1079
|
+ const { projectDetail: { buildingApartment, panoramaList } } = this.props
|
1070
|
1080
|
const list = buildingApartment.filter(item => item.apartmentType === 'apart')
|
|
1081
|
+
|
|
1082
|
+ // 挂载全景图设置
|
|
1083
|
+ list.forEach(apartment => {
|
|
1084
|
+ const panoramaArr = (panoramaList || []).filter(x => x.buildingId === apartment.buildingId && x.apartmentId === apartment.apartmentId )
|
|
1085
|
+ if (panoramaArr.length) {
|
|
1086
|
+ apartment.panoramaArr = panoramaArr
|
|
1087
|
+ }
|
|
1088
|
+ })
|
|
1089
|
+
|
1071
|
1090
|
let imgUrls = list.reduce((prev, cur) => {
|
1072
|
1091
|
prev = prev.concat(cur.buildingImgList)
|
1073
|
1092
|
return prev
|
1074
|
1093
|
}, [])
|
1075
|
1094
|
imgUrls = imgUrls.map(item => item.url)
|
|
1095
|
+
|
1076
|
1096
|
return (
|
1077
|
1097
|
<Block>
|
1078
|
1098
|
{
|
|
@@ -1086,10 +1106,17 @@ export default class Index extends Component {
|
1086
|
1106
|
<View className='item' key={item.apartmentId}>
|
1087
|
1107
|
{
|
1088
|
1108
|
item && (
|
1089
|
|
- <View className='house__img-info'>
|
1090
|
|
- <Image className='house__img' src={transferImage(item.buildingImgList[0].url)} mode="widthFix" onClick={this.handlePreviewHxImage.bind(this, item.buildingImgList[0].url, imgUrls)}></Image>
|
|
1109
|
+ <Block>
|
1091
|
1110
|
<View className='house-type__state' style={`background-color: ${statusBgColors[item.marketStatus - 1]}`}>{statusOpts[item.marketStatus - 1]}</View>
|
1092
|
|
- </View>
|
|
1111
|
+ <View className='house__img-info'>
|
|
1112
|
+ <Image className='house__img' src={transferImage(item.buildingImgList[0].url)} mode="widthFix" onClick={this.handleHouseTypePosterClick.bind(this, item, imgUrls)}></Image>
|
|
1113
|
+ {item.panoramaArr && (
|
|
1114
|
+ <View className='house-type__panorama'>
|
|
1115
|
+ <Image mode="aspectFill" src={vrLogo} style={{ width: '100%', height: '100%' }} />
|
|
1116
|
+ </View>
|
|
1117
|
+ )}
|
|
1118
|
+ </View>
|
|
1119
|
+ </Block>
|
1093
|
1120
|
)
|
1094
|
1121
|
}
|
1095
|
1122
|
<View className="rest-info">
|
|
@@ -1232,7 +1259,6 @@ export default class Index extends Component {
|
1232
|
1259
|
<View
|
1233
|
1260
|
className="pro__banner"
|
1234
|
1261
|
>
|
1235
|
|
- {console.log(projectDetail)}
|
1236
|
1262
|
<Video
|
1237
|
1263
|
src={projectDetail.videoUrl}
|
1238
|
1264
|
// src='http://wxsnsdy.tc.qq.com/105/20210/snsdyvideodownload?filekey=30280201010421301f0201690402534804102ca905ce620b1241b726bc41dcff44e00204012882540400&bizid=1023&hy=SH&fileparam=302c020101042530230204136ffd93020457e3c4ff02024ef202031e8d7f02030f42400204045a320a0201000400'
|
|
@@ -1281,6 +1307,69 @@ export default class Index extends Component {
|
1281
|
1307
|
})
|
1282
|
1308
|
}
|
1283
|
1309
|
|
|
1310
|
+ handleBannerBtnClick(btnstate) {
|
|
1311
|
+ this.setState({ btnstate, current: 1 })
|
|
1312
|
+ }
|
|
1313
|
+
|
|
1314
|
+ goToPanorama(panorama) {
|
|
1315
|
+ const url = (panorama || {}).panoramaLink
|
|
1316
|
+
|
|
1317
|
+ if (!url) return;
|
|
1318
|
+
|
|
1319
|
+ this.navigateTo(`/pages/project/panorama/index?url=${encodeURIComponent(url)}`)
|
|
1320
|
+ }
|
|
1321
|
+
|
|
1322
|
+ handlePanoramaClick(panorama) {
|
|
1323
|
+ this.goToPanorama(panorama)
|
|
1324
|
+ }
|
|
1325
|
+
|
|
1326
|
+ renderBannerImages() {
|
|
1327
|
+ const { projectDetail } = this.props
|
|
1328
|
+ const { current = 1 } = this.state
|
|
1329
|
+
|
|
1330
|
+ return (
|
|
1331
|
+ <View
|
|
1332
|
+ className="pro__banner"
|
|
1333
|
+ onClick={this.previewImage.bind(this, projectDetail.buildingImg)}>
|
|
1334
|
+ <Banner
|
|
1335
|
+ list={projectDetail.buildingImg}
|
|
1336
|
+ indicatorDots={false}
|
|
1337
|
+ // current
|
|
1338
|
+ // isChange = {true}
|
|
1339
|
+ onChange={this.changeCurrent.bind(this)}
|
|
1340
|
+ style={{
|
|
1341
|
+ height: '600rpx'
|
|
1342
|
+ }}
|
|
1343
|
+
|
|
1344
|
+ ></Banner>
|
|
1345
|
+ <Text className="pro__banner-text">{current}/{(projectDetail.buildingImg && projectDetail.buildingImg.length) || 0}</Text>
|
|
1346
|
+ </View>
|
|
1347
|
+ );
|
|
1348
|
+ }
|
|
1349
|
+
|
|
1350
|
+ renderBannerPanorama() {
|
|
1351
|
+ const { projectDetail } = this.props
|
|
1352
|
+ const { current = 1 } = this.state
|
|
1353
|
+
|
|
1354
|
+ return (
|
|
1355
|
+ <View className="pro__banner">
|
|
1356
|
+ <Banner
|
|
1357
|
+ list={projectDetail.panoramaList || []}
|
|
1358
|
+ indicatorDots={false}
|
|
1359
|
+ // current
|
|
1360
|
+ // isChange = {true}
|
|
1361
|
+ onChange={this.changeCurrent.bind(this)}
|
|
1362
|
+ onClick={this.handlePanoramaClick.bind(this)}
|
|
1363
|
+ style={{
|
|
1364
|
+ height: '600rpx'
|
|
1365
|
+ }}
|
|
1366
|
+ logo={vrLogo}
|
|
1367
|
+ ></Banner>
|
|
1368
|
+ <Text className="pro__banner-text">{current}/{(projectDetail.panoramaList && projectDetail.panoramaList.length) || 0}</Text>
|
|
1369
|
+ </View>
|
|
1370
|
+ );
|
|
1371
|
+ }
|
|
1372
|
+
|
1284
|
1373
|
render() {
|
1285
|
1374
|
const { grantPhoneVisible, grantAvatarVisible, posterStatus, posterData, loaded, btnstate, consultData, consultShow } = this.state
|
1286
|
1375
|
const { projectDetail, userInfo = { person: {} } } = this.props
|
|
@@ -1305,36 +1394,24 @@ export default class Index extends Component {
|
1305
|
1394
|
loaded && (
|
1306
|
1395
|
<View className='detail'>
|
1307
|
1396
|
<Notice></Notice>
|
1308
|
|
- {/* {(projectDetail.videoUrl == null || btnstate === 0) && ( */}
|
1309
|
|
- <View
|
1310
|
|
- className="pro__banner"
|
1311
|
|
- onClick={this.previewImage.bind(this, projectDetail.buildingImg)}>
|
1312
|
|
- <Banner
|
1313
|
|
- list={projectDetail.buildingImg}
|
1314
|
|
- indicatorDots={false}
|
1315
|
|
- // current
|
1316
|
|
- // isChange = {true}
|
1317
|
|
- onChange={this.changeCurrent.bind(this)}
|
1318
|
|
- style={{
|
1319
|
|
- height: '600rpx'
|
1320
|
|
- }}
|
1321
|
|
-
|
1322
|
|
- ></Banner>
|
1323
|
|
- <Text className="pro__banner-text">{this.current}/{(projectDetail.buildingImg && projectDetail.buildingImg.length) || 0}</Text>
|
1324
|
|
- </View>
|
1325
|
|
- {/* )} */}
|
1326
|
|
-
|
1327
|
|
- {/* {btnstate === 1 && projectDetail.videoUrl != null && this.renderVideo()} */}
|
1328
|
1397
|
|
1329
|
|
- {/* {btnstate === 1 && projectDetail.videoUrl != null && (<View className='media-btn'>
|
1330
|
|
- <View className='video-btn' style={{ background: ' rgba(187, 156, 121, 1)', color: 'rgba(255, 255, 255, 1)' }} >视频</View>
|
1331
|
|
- <View className='img-btn' onClick={() => this.setState({ btnstate: 0 })}>图片</View>
|
1332
|
|
- </View>)} */}
|
|
1398
|
+ { !btnstate && this.renderBannerImages() }
|
|
1399
|
+
|
|
1400
|
+ { btnstate === 1 && this.renderVideo() }
|
|
1401
|
+
|
|
1402
|
+ { btnstate === 2 && this.renderBannerPanorama() }
|
1333
|
1403
|
|
1334
|
|
- {/* {btnstate === 0 && projectDetail.videoUrl != null && (<View className='media-btn'>
|
1335
|
|
- <View className='video-btn' onClick={() => this.setState({ btnstate: 1 })} >视频</View>
|
1336
|
|
- <View className='img-btn' style={{ background: ' rgba(187, 156, 121, 1)', color: 'rgba(255, 255, 255, 1)' }}>图片</View>
|
1337
|
|
- </View>)} */}
|
|
1404
|
+ {
|
|
1405
|
+ projectDetail.buildingImg && projectDetail.buildingImg.length &&
|
|
1406
|
+ projectDetail.panoramaList && projectDetail.panoramaList.length &&
|
|
1407
|
+ (
|
|
1408
|
+ <View className="media-btn">
|
|
1409
|
+ {/* <View className={`btn ${btnstate === 1 && 'active'}`} onClick={this.handleBannerBtnClick.bind(this, 1)}>视频</View> */}
|
|
1410
|
+ <View className={`btn ${btnstate === 2 && 'active'}`} onClick={this.handleBannerBtnClick.bind(this, 2)}>全景</View>
|
|
1411
|
+ <View className={`btn ${!btnstate && 'active'}`} onClick={this.handleBannerBtnClick.bind(this, 0)}>图片</View>
|
|
1412
|
+ </View>
|
|
1413
|
+ )
|
|
1414
|
+ }
|
1338
|
1415
|
|
1339
|
1416
|
<ScrollView
|
1340
|
1417
|
enableBackToTop
|