|
@@ -98,27 +98,38 @@ export default class Index extends Component {
|
98
|
98
|
this.toggleGrantAvatar()
|
99
|
99
|
}
|
100
|
100
|
|
101
|
|
- const id = this.$router.params.id
|
|
101
|
+ this.loadData()
|
|
102
|
+
|
|
103
|
+ // const id = this.$router.params.id
|
|
104
|
+
|
|
105
|
+ // // 没有找到 id , 再重新找一次
|
|
106
|
+ // if (this.$router.params.scene) {
|
|
107
|
+ // getQrCodeParams(this.$router.params.scene).then(res => {
|
|
108
|
+ // console.log(res, "扫码参数")
|
|
109
|
+ // this.setState({
|
|
110
|
+ // qrcodeParams: res
|
|
111
|
+ // })
|
|
112
|
+ // this.initPageData(res.id)
|
|
113
|
+ // }).catch(err => {
|
|
114
|
+ // Taro.showToast({
|
|
115
|
+ // title: '没有找到项目',
|
|
116
|
+ // icon: 'none'
|
|
117
|
+ // })
|
|
118
|
+ // })
|
|
119
|
+ // } else {
|
|
120
|
+ // console.log('有项目id,不请求扫码参数接口')
|
|
121
|
+ // this.initPageData(id)
|
|
122
|
+ // }
|
|
123
|
+ })
|
|
124
|
+ }
|
|
125
|
+ componentDidShow() {
|
|
126
|
+ console.log('3366633', this.$router.params)
|
102
|
127
|
|
103
|
|
- // 没有找到 id , 再重新找一次
|
104
|
|
- if (this.$router.params.scene) {
|
105
|
|
- getQrCodeParams(this.$router.params.scene).then(res => {
|
106
|
|
- console.log(res, "扫码参数")
|
107
|
|
- this.setState({
|
108
|
|
- qrcodeParams: res
|
109
|
|
- })
|
110
|
|
- this.initPageData(res.id)
|
111
|
|
- }).catch(err => {
|
112
|
|
- Taro.showToast({
|
113
|
|
- title: '没有找到项目',
|
114
|
|
- icon: 'none'
|
115
|
|
- })
|
116
|
|
- })
|
117
|
|
- } else {
|
118
|
|
- console.log('有项目id,不请求扫码参数接口')
|
119
|
|
- this.initPageData(id)
|
|
128
|
+ const fromCard = !!wx.getStorageSync('from-card')
|
|
129
|
+
|
|
130
|
+ if (fromCard) {
|
|
131
|
+ this.loadData()
|
120
|
132
|
}
|
121
|
|
- })
|
122
|
133
|
}
|
123
|
134
|
|
124
|
135
|
componentWillUnmount() {
|
|
@@ -144,6 +155,31 @@ export default class Index extends Component {
|
144
|
155
|
}
|
145
|
156
|
}
|
146
|
157
|
|
|
158
|
+ loadData() {
|
|
159
|
+ const id = this.$router.params.id
|
|
160
|
+
|
|
161
|
+ // 没有找到 id , 再重新找一次
|
|
162
|
+ if (this.$router.params.scene) {
|
|
163
|
+ getQrCodeParams(this.$router.params.scene).then(res => {
|
|
164
|
+ console.log(res, "扫码参数")
|
|
165
|
+ this.setState({
|
|
166
|
+ qrcodeParams: res
|
|
167
|
+ })
|
|
168
|
+ this.initPageData(res.id)
|
|
169
|
+ }).catch(err => {
|
|
170
|
+ Taro.showToast({
|
|
171
|
+ title: '没有找到项目',
|
|
172
|
+ icon: 'none'
|
|
173
|
+ })
|
|
174
|
+ })
|
|
175
|
+ } else {
|
|
176
|
+ console.log('有项目id,不请求扫码参数接口')
|
|
177
|
+ this.initPageData(id)
|
|
178
|
+ }
|
|
179
|
+
|
|
180
|
+ wx.removeStorageSync('from-card')
|
|
181
|
+ }
|
|
182
|
+
|
147
|
183
|
currentPageAndParams() {
|
148
|
184
|
const {
|
149
|
185
|
projectDetail: { buildingId },
|
|
@@ -201,6 +237,7 @@ export default class Index extends Component {
|
201
|
237
|
this.setState({
|
202
|
238
|
buildingId: id
|
203
|
239
|
}, () => {
|
|
240
|
+ console.log('12321312321321')
|
204
|
241
|
this.loadDetail()
|
205
|
242
|
this.loadNewsData()
|
206
|
243
|
// this.loadActivityData()
|
|
@@ -287,7 +324,8 @@ export default class Index extends Component {
|
287
|
324
|
}
|
288
|
325
|
|
289
|
326
|
loadDetail() {
|
290
|
|
- const { buildingId } = this.state
|
|
327
|
+ const sceneParams = this._$_scene || {}
|
|
328
|
+ const buildingId = this.state.buildingId || this.$router.params.id || sceneParams.id
|
291
|
329
|
const { dispatchProjectDetail } = this.props
|
292
|
330
|
this.setState({
|
293
|
331
|
loaded: false,
|