|
@@ -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
|
|
@@ -488,6 +491,16 @@ export default class Index extends Component {
|
488
|
491
|
})
|
489
|
492
|
}
|
490
|
493
|
|
|
494
|
+ handleAuthPhoneSuccess = () => {
|
|
495
|
+ const { person = {} } = this.props.userInfo || {}
|
|
496
|
+ if ((person.avatarurl || '').indexOf('wx.qlogo.cn') === -1) {
|
|
497
|
+ Taro.reLaunch({ url: '/pages/auth/index' })
|
|
498
|
+ return
|
|
499
|
+ }
|
|
500
|
+
|
|
501
|
+ this.initPageData()
|
|
502
|
+ }
|
|
503
|
+
|
491
|
504
|
renderBottomMenu() {
|
492
|
505
|
const { userInfo: { person: { personType } } } = this.props
|
493
|
506
|
const { posterShow } = this.state
|
|
@@ -1045,7 +1058,7 @@ export default class Index extends Component {
|
1045
|
1058
|
<Block>
|
1046
|
1059
|
{
|
1047
|
1060
|
(grantPhoneVisible && userInfo.person.personId && !userInfo.person.phone) &&
|
1048
|
|
- <AchievePhone user={userInfo.person} onSuccess={this.initPageData}></AchievePhone>
|
|
1061
|
+ <AchievePhone user={userInfo.person} onSuccess={this.handleAuthPhoneSuccess}></AchievePhone>
|
1049
|
1062
|
}
|
1050
|
1063
|
{
|
1051
|
1064
|
loaded && (
|