|
@@ -21,7 +21,7 @@ import dayjs from 'dayjs'
|
21
|
21
|
import 'dayjs/locale/zh-cn' // 按需加载
|
22
|
22
|
import ready from '@utils/ready'
|
23
|
23
|
import Notice from '@components/Notice'
|
24
|
|
-import { getDownloadURL, getThumbnail } from '@utils/tools'
|
|
24
|
+import { getDownloadURL, getThumbnail, sceneInShare } from '@utils/tools'
|
25
|
25
|
import { connect } from '@tarojs/redux'
|
26
|
26
|
import { dispatchProjectDetail } from '@actions/project'
|
27
|
27
|
import getUserPhone from '@utils/getUserPhone'
|
|
@@ -62,9 +62,22 @@ export default class Index extends Component {
|
62
|
62
|
}
|
63
|
63
|
|
64
|
64
|
componentWillMount() {
|
65
|
|
- // const { id = '78c3dd489791dc1d29472fa344b08c45' } = this.$router.params
|
66
|
|
-
|
67
|
65
|
ready.queue(() => {
|
|
66
|
+
|
|
67
|
+ // 分享场景需要先授权手机, 再授权头像
|
|
68
|
+ const options = wx.getLaunchOptionsSync()
|
|
69
|
+ if (sceneInShare(options.scene)) {
|
|
70
|
+ const { person = {} } = this.props.userInfo || {}
|
|
71
|
+ if ((person.tel || person.phone) && (person.avatarurl || '').indexOf('wx.qlogo.cn') === -1) {
|
|
72
|
+ Taro.reLaunch({ url: '/pages/auth/index' })
|
|
73
|
+ return
|
|
74
|
+ }
|
|
75
|
+
|
|
76
|
+ this.setState({
|
|
77
|
+ grantPhoneVisible: true,
|
|
78
|
+ })
|
|
79
|
+ }
|
|
80
|
+
|
68
|
81
|
this.initPageData()
|
69
|
82
|
})
|
70
|
83
|
}
|
|
@@ -102,16 +115,6 @@ export default class Index extends Component {
|
102
|
115
|
})
|
103
|
116
|
})
|
104
|
117
|
}
|
105
|
|
- componentDidMount() {
|
106
|
|
- const options = wx.getLaunchOptionsSync()
|
107
|
|
- const sceneList = [1011, 1012, 1013, 1031, 1032, 1036, 1047, 1048]
|
108
|
|
-
|
109
|
|
- if (sceneList.indexOf(options.scene) != -1) {
|
110
|
|
- this.setState({
|
111
|
|
- grantPhoneVisible: true,
|
112
|
|
- })
|
113
|
|
- }
|
114
|
|
- }
|
115
|
118
|
|
116
|
119
|
loadHelpGroupList() {
|
117
|
120
|
const { buildingId } = this.state
|
|
@@ -169,7 +172,7 @@ export default class Index extends Component {
|
169
|
172
|
queryActivityList(payload).then(res => {
|
170
|
173
|
console.log(res, 'Activity')
|
171
|
174
|
this.setState({
|
172
|
|
- activityList: res || []
|
|
175
|
+ activityList: res.list || []
|
173
|
176
|
})
|
174
|
177
|
})
|
175
|
178
|
}
|
|
@@ -242,9 +245,10 @@ export default class Index extends Component {
|
242
|
245
|
})
|
243
|
246
|
}
|
244
|
247
|
|
245
|
|
- toViewAlbum() {
|
|
248
|
+ toViewAlbum (index){
|
246
|
249
|
const { buildingId } = this.state
|
247
|
|
- this.navigateTo(`/pages/project/album/index?id=${buildingId}`)
|
|
250
|
+ console.log('1111111',index)
|
|
251
|
+ this.navigateTo(`/pages/project/album/index?id=${buildingId}¤t=${index}` )
|
248
|
252
|
}
|
249
|
253
|
|
250
|
254
|
onViewFans() {
|
|
@@ -488,6 +492,16 @@ export default class Index extends Component {
|
488
|
492
|
})
|
489
|
493
|
}
|
490
|
494
|
|
|
495
|
+ handleAuthPhoneSuccess = () => {
|
|
496
|
+ const { person = {} } = this.props.userInfo || {}
|
|
497
|
+ if ((person.avatarurl || '').indexOf('wx.qlogo.cn') === -1) {
|
|
498
|
+ Taro.reLaunch({ url: '/pages/auth/index' })
|
|
499
|
+ return
|
|
500
|
+ }
|
|
501
|
+
|
|
502
|
+ this.initPageData()
|
|
503
|
+ }
|
|
504
|
+
|
491
|
505
|
renderBottomMenu() {
|
492
|
506
|
const { userInfo: { person: { personType } } } = this.props
|
493
|
507
|
const { posterShow } = this.state
|
|
@@ -611,7 +625,7 @@ export default class Index extends Component {
|
611
|
625
|
<View className='photos__type'>
|
612
|
626
|
<View className='photos__type__title'>相册</View>
|
613
|
627
|
<ScrollView scrollX>
|
614
|
|
- <View className='photos__type__content' onClick={this.toViewAlbum}>
|
|
628
|
+ <View className='photos__type__content' >
|
615
|
629
|
|
616
|
630
|
<View className="around-tab">
|
617
|
631
|
{listimg.map((item, index) => {
|
|
@@ -622,19 +636,21 @@ export default class Index extends Component {
|
622
|
636
|
console.log(buildingImgUrl, 'buildingImgUrl')
|
623
|
637
|
|
624
|
638
|
// if (buildingImgUrl != null) {
|
625
|
|
- return (<View key={index + "listimg"}>
|
|
639
|
+ return ( <View key={index + "listimg"}>
|
626
|
640
|
{buildingImgUrl != null && (<View
|
627
|
641
|
style={{ marginRight: '8px' }}
|
|
642
|
+
|
628
|
643
|
>
|
629
|
644
|
|
630
|
645
|
<View>
|
631
|
|
- <Image className='albumimg' src={getThumbnail(buildingImgList[0].url)} ></Image>
|
|
646
|
+ <Image className='albumimg' src={getThumbnail(buildingImgList[0].url)} onClick={()=>this.toViewAlbum(index)}></Image>
|
632
|
647
|
<View style={{ width: '218rpx', display: 'flex', justifyContent: 'center' }} >
|
633
|
648
|
<View style={{ overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}> {apartmentName} </View>
|
634
|
649
|
<View> ({buildingImgList.length})</View>
|
635
|
650
|
</View>
|
636
|
651
|
</View>
|
637
|
|
- </View>)}</View>
|
|
652
|
+ </View>)}
|
|
653
|
+ </View>
|
638
|
654
|
)
|
639
|
655
|
// }
|
640
|
656
|
|
|
@@ -851,40 +867,22 @@ export default class Index extends Component {
|
851
|
867
|
)
|
852
|
868
|
}
|
853
|
869
|
renderActivities() {
|
854
|
|
- // renderGroup () {
|
855
|
|
- // const { groupList } = this.state
|
856
|
|
- // return (
|
857
|
|
- // <Block>
|
858
|
|
- // {groupList.length > 0 &&
|
859
|
|
- // <View className="activity">
|
860
|
|
- // <View className="title">拼团活动</View>
|
861
|
|
- // <View
|
862
|
|
- // style={{ position: 'relative' }}>
|
863
|
|
- // <HelpGroupBanner
|
864
|
|
- // style={{ height: '250rpx' }}
|
865
|
|
- // indicatorDots={false}
|
866
|
|
- // list={groupList}
|
867
|
|
- // onClick={this.handleGroupClick}>
|
868
|
|
- // </HelpGroupBanner>
|
869
|
|
- // </View>
|
870
|
|
- // </View>
|
871
|
|
- // }
|
872
|
|
- // </Block>
|
873
|
|
- // )
|
874
|
|
- // }
|
|
870
|
+
|
|
871
|
+
|
875
|
872
|
const { activityList } = this.state
|
|
873
|
+
|
876
|
874
|
return (
|
877
|
875
|
<Block>
|
878
|
876
|
{
|
879
|
877
|
activityList.length > 0 && (
|
880
|
878
|
<View className="activity" >
|
881
|
|
- {console.log(activityList, '----activityList-----')}
|
|
879
|
+
|
882
|
880
|
<View className="section-head">
|
883
|
|
- <Text className="section-head__title">热门活动</Text>
|
884
|
|
- <View className="section-head__more" onClick={this.handleActivityMoreClick}>
|
885
|
|
- 更多活动<Text className="iconfont icon-more"></Text>
|
886
|
|
- </View>
|
887
|
|
- </View>
|
|
881
|
+ <Text className="section-head__title" style={{margin: '10rpx 0 40rpx 35rpx'}}>热门活动</Text>
|
|
882
|
+ <View className="section-head__more" style={{marginRight: '20rpx'}} onClick={this.handleActivityMoreClick}>
|
|
883
|
+ 更多活动<Text className="iconfont icon-more"></Text>
|
|
884
|
+ </View>
|
|
885
|
+ </View>
|
888
|
886
|
<View
|
889
|
887
|
style={{ position: 'relative' }}>
|
890
|
888
|
<HelpGroupBanner
|
|
@@ -899,26 +897,7 @@ export default class Index extends Component {
|
899
|
897
|
|
900
|
898
|
</View>
|
901
|
899
|
</View>
|
902
|
|
- // <View classN ame="house-type">
|
903
|
|
- // <View className="section-head">
|
904
|
|
- // <Text className="section-head__title">热门活动</Text>
|
905
|
|
- // <View className="section-head__more" onClick={this.handleActivityMoreClick}>
|
906
|
|
- // 更多活动<Text className="iconfont icon-more"></Text>
|
907
|
|
- // </View>
|
908
|
|
- // </View>
|
909
|
|
- // <ScrollView scrollX>
|
910
|
|
- // <View className="house-type__list" style="margin-top:10px">
|
911
|
|
- // {
|
912
|
|
- // activityList.map(item => (
|
913
|
|
- // <View className="news-item" key={item.dynamicId} onClick={this.handActivityItemClick.bind(this, item.dynamicId)}>
|
914
|
|
- // <Image mode="widthFix" src={getThumbnail(item.imgUrl)} className="news-item__pic"></Image>
|
915
|
|
- // <View className="news-item__title">{item.title}</View>
|
916
|
|
- // </View>
|
917
|
|
- // ))
|
918
|
|
- // }
|
919
|
|
- // </View>
|
920
|
|
- // </ScrollView>
|
921
|
|
- // </View>
|
|
900
|
+
|
922
|
901
|
)
|
923
|
902
|
}
|
924
|
903
|
</Block>
|
|
@@ -1045,7 +1024,7 @@ export default class Index extends Component {
|
1045
|
1024
|
<Block>
|
1046
|
1025
|
{
|
1047
|
1026
|
(grantPhoneVisible && userInfo.person.personId && !userInfo.person.phone) &&
|
1048
|
|
- <AchievePhone user={userInfo.person} onSuccess={this.initPageData}></AchievePhone>
|
|
1027
|
+ <AchievePhone user={userInfo.person} onSuccess={this.handleAuthPhoneSuccess}></AchievePhone>
|
1049
|
1028
|
}
|
1050
|
1029
|
{
|
1051
|
1030
|
loaded && (
|