|
@@ -54,7 +54,7 @@ export default class Index extends Component {
|
54
|
54
|
recordId: null,
|
55
|
55
|
posterShow: 'none',
|
56
|
56
|
current: 1,
|
57
|
|
- btnstate: true,
|
|
57
|
+ btnstate: 1,// 1显示视频 0显示图片
|
58
|
58
|
}
|
59
|
59
|
|
60
|
60
|
componentWillMount () {
|
|
@@ -63,7 +63,6 @@ export default class Index extends Component {
|
63
|
63
|
const router = Taro.getStorageSync('router')
|
64
|
64
|
const id = this.$router.params.id || router.query.id
|
65
|
65
|
// const id='82b54f4a1f5b981df572253792afbfa1'
|
66
|
|
-
|
67
|
66
|
this.setState({
|
68
|
67
|
buildingId: id
|
69
|
68
|
}, () => {
|
|
@@ -96,15 +95,15 @@ export default class Index extends Component {
|
96
|
95
|
recordId && updatePoint(recordId)
|
97
|
96
|
}
|
98
|
97
|
|
99
|
|
- loadMapAround(building) {
|
|
98
|
+ loadMapAround (building) {
|
100
|
99
|
const [lat, lng] = (building.coordinate || '').split(',')
|
101
|
100
|
|
102
|
101
|
if (!lat || !lng) return Promise.reject()
|
103
|
102
|
|
104
|
|
- return getPoiAround({ lng, lat})
|
|
103
|
+ return getPoiAround({ lng, lat })
|
105
|
104
|
}
|
106
|
105
|
|
107
|
|
- loadHelpGroupList() {
|
|
106
|
+ loadHelpGroupList () {
|
108
|
107
|
const { buildingId } = this.state
|
109
|
108
|
queryHelpGroup({ buildingId: buildingId }).then(res => {
|
110
|
109
|
console.log(res, "buildingId")
|
|
@@ -125,7 +124,7 @@ export default class Index extends Component {
|
125
|
124
|
)
|
126
|
125
|
}
|
127
|
126
|
|
128
|
|
- loadDetail() {
|
|
127
|
+ loadDetail () {
|
129
|
128
|
const { buildingId } = this.state
|
130
|
129
|
const { dispatchProjectDetail } = this.props
|
131
|
130
|
this.setState({
|
|
@@ -859,15 +858,24 @@ export default class Index extends Component {
|
859
|
858
|
}
|
860
|
859
|
|
861
|
860
|
renderVideo () {
|
|
861
|
+ console.log('-------props------', this.props)
|
|
862
|
+ const { projectDetail } = this.props
|
862
|
863
|
return (
|
863
|
|
- <View style={{
|
864
|
|
- height: '278px'
|
865
|
|
- }}>123
|
866
|
|
- {/* <Video
|
867
|
|
- style={{
|
868
|
|
- height: '278px'
|
869
|
|
- }}
|
870
|
|
- ></Video> */}
|
|
864
|
+ <View
|
|
865
|
+ className="pro__banner"
|
|
866
|
+ >
|
|
867
|
+ { console.log('-------projectDetail.videoUrl------', projectDetail.videoUrl)}
|
|
868
|
+ <Video
|
|
869
|
+ src={projectDetail.videoUrl}
|
|
870
|
+ // src='http://wxsnsdy.tc.qq.com/105/20210/snsdyvideodownload?filekey=30280201010421301f0201690402534804102ca905ce620b1241b726bc41dcff44e00204012882540400&bizid=1023&hy=SH&fileparam=302c020101042530230204136ffd93020457e3c4ff02024ef202031e8d7f02030f42400204045a320a0201000400'
|
|
871
|
+ // poster='http://misc.aotu.io/booxood/mobile-video/cover_900x500.jpg'
|
|
872
|
+ initial-time='0.01'
|
|
873
|
+ style={{
|
|
874
|
+ height: '278px',
|
|
875
|
+ width: '375px'
|
|
876
|
+ }}
|
|
877
|
+ show-mute-btn='true'
|
|
878
|
+ ></Video>
|
871
|
879
|
</View>
|
872
|
880
|
)
|
873
|
881
|
}
|
|
@@ -888,13 +896,17 @@ export default class Index extends Component {
|
888
|
896
|
const { total = 0, records = [] } = uvList
|
889
|
897
|
const openDate = projectDetail.openingDate ? dayjs(projectDetail.openingDate).locale('zh-cn').format('YYYY年M月D日') : '暂无'
|
890
|
898
|
|
|
899
|
+ // if (projectDetail.videoUrl != null){
|
|
900
|
+ // setState({ btnstate: 1 }
|
|
901
|
+ // },
|
|
902
|
+
|
891
|
903
|
return (
|
892
|
904
|
<Block>
|
893
|
905
|
{
|
894
|
906
|
loaded && (
|
895
|
907
|
<View className='detail'>
|
896
|
908
|
<Notice></Notice>
|
897
|
|
- {btnstate && (
|
|
909
|
+ {(projectDetail.videoUrl == null || btnstate === 0) && (
|
898
|
910
|
<View
|
899
|
911
|
className="pro__banner"
|
900
|
912
|
onClick={this.previewImage.bind(this, projectDetail.buildingImg)}>
|
|
@@ -912,17 +924,17 @@ export default class Index extends Component {
|
912
|
924
|
</View>
|
913
|
925
|
)}
|
914
|
926
|
|
915
|
|
- {!btnstate && this.renderVideo()}
|
|
927
|
+ {btnstate === 1 && projectDetail.videoUrl != null && this.renderVideo()}
|
916
|
928
|
|
917
|
|
-
|
918
|
|
- {!btnstate && (<View className='media-btn'>
|
919
|
|
- <View className='video-btn' onClick={() => this.setState({ btnstate: true })} style={{ background: ' rgba(187, 156, 121, 1)', color: 'rgba(255, 255, 255, 1)' }} >视频</View>
|
920
|
|
- <View className='img-btn'>图片</View>
|
|
929
|
+ }
|
|
930
|
+ {btnstate === 1 && projectDetail.videoUrl != null && (<View className='media-btn'>
|
|
931
|
+ <View className='video-btn' style={{ background: ' rgba(187, 156, 121, 1)', color: 'rgba(255, 255, 255, 1)' }} >视频</View>
|
|
932
|
+ <View className='img-btn' onClick={() => this.setState({ btnstate: 0 })}>图片</View>
|
921
|
933
|
</View>)}
|
922
|
934
|
|
923
|
|
- {btnstate && (<View className='media-btn'>
|
924
|
|
- <View className='video-btn' >视频</View>
|
925
|
|
- <View className='img-btn' onClick={() => this.setState({ btnstate: false })} style={{ background: ' rgba(187, 156, 121, 1)', color: 'rgba(255, 255, 255, 1)' }}>图片</View>
|
|
935
|
+ {btnstate === 0 && projectDetail.videoUrl != null && (<View className='media-btn'>
|
|
936
|
+ <View className='video-btn' onClick={() => this.setState({ btnstate: 1 })} >视频</View>
|
|
937
|
+ <View className='img-btn' style={{ background: ' rgba(187, 156, 121, 1)', color: 'rgba(255, 255, 255, 1)' }}>图片</View>
|
926
|
938
|
</View>)}
|
927
|
939
|
|
928
|
940
|
|