|
@@ -15,6 +15,9 @@ import { ROLE_CODE } from '@/constants/user'
|
15
|
15
|
import Consultant from '@/components/consultant'
|
16
|
16
|
import AchievePhone from '@/components/achievePhone'
|
17
|
17
|
import AchieveAvatar from '@/components/achieveAvatar'
|
|
18
|
+import { dispatchProjectDetail } from '@/actions/project'
|
|
19
|
+import * as actions from '@/actions/card'
|
|
20
|
+import ProjectItem from '../../project/item'
|
18
|
21
|
// import AuthorizationComponent from '@/components/authorizationComponent'
|
19
|
22
|
// import { reportClient } from '@/services/report'
|
20
|
23
|
import {
|
|
@@ -27,7 +30,11 @@ import {
|
27
|
30
|
import { connect } from '@tarojs/redux'
|
28
|
31
|
import { share as shareSavePoint } from '@/utils/shareSavePoint'
|
29
|
32
|
|
30
|
|
-@connect(state => state.user)
|
|
33
|
+// @connect(state => state.user)
|
|
34
|
+@connect(
|
|
35
|
+ ({ user, card, project }) => ({ ...user, ...card, ...project }),
|
|
36
|
+ { dispatchProjectDetail, ...actions }
|
|
37
|
+)
|
31
|
38
|
export default class NewsDetail extends Component {
|
32
|
39
|
config = {
|
33
|
40
|
navigationBarTitleText: '资讯详情'
|
|
@@ -244,6 +251,7 @@ export default class NewsDetail extends Component {
|
244
|
251
|
const consultant = this.$router.params.consultant || qrcodeParams.consultant
|
245
|
252
|
const consultantId = this.$router.params.consultantId || qrcodeParams.consultantId || ""
|
246
|
253
|
const recommender = this.$router.params.recommender || qrcodeParams.recommender || ""
|
|
254
|
+ const { dispatchProjectDetail } = this.props
|
247
|
255
|
Taro.showLoading()
|
248
|
256
|
console.log(newsId, "newsIdnewsIdnewsIdnewsIdnewsId")
|
249
|
257
|
queryNewsDetail(newsId).then(res => {
|
|
@@ -264,6 +272,9 @@ export default class NewsDetail extends Component {
|
264
|
272
|
})
|
265
|
273
|
console.info('资讯详情')
|
266
|
274
|
})
|
|
275
|
+ if (res.buildingId) {
|
|
276
|
+ dispatchProjectDetail(res.buildingId, { showToast: false, })
|
|
277
|
+ }
|
267
|
278
|
|
268
|
279
|
this.setState({
|
269
|
280
|
detail: res,
|
|
@@ -353,14 +364,15 @@ export default class NewsDetail extends Component {
|
353
|
364
|
buildingId: buildingId || '',
|
354
|
365
|
data: '{}'
|
355
|
366
|
}, 'news')
|
356
|
|
-
|
357
|
|
-
|
358
|
367
|
}
|
359
|
|
-
|
|
368
|
+ toProjectDetail = () => {
|
|
369
|
+ const { projectDetail: { buildingId } } = this.props
|
|
370
|
+ this.navigateTo(`/pages/project/detail/index?id=${buildingId}`)
|
|
371
|
+ }
|
360
|
372
|
render() {
|
361
|
373
|
const { webViewVisible, grantPhoneVisible, grantAvatarVisible, detail, loaded, isSaved, posterVisible, posterData, posterShow, consultData, consultShow } = this.state
|
362
|
|
- const { userInfo = { person: {} } } = this.props
|
363
|
|
-
|
|
374
|
+ const { userInfo = { person: {} }, cardInfo, projectDetail = {} } = this.props
|
|
375
|
+
|
364
|
376
|
const achieveParams = {
|
365
|
377
|
buildingId: detail.buildingId || '',
|
366
|
378
|
targetName: detail.newsName || '',
|
|
@@ -403,6 +415,7 @@ export default class NewsDetail extends Component {
|
403
|
415
|
</View>
|
404
|
416
|
</ScrollView>
|
405
|
417
|
<Notice></Notice>
|
|
418
|
+ {projectDetail.buildingId && <View className="pro__info"><ProjectItem data={projectDetail} onClick={this.toProjectDetail.bind(this)} /></View>}
|
406
|
419
|
<BackHomeBtn style={consultShow ? "bottom:310rpx" : ''}></BackHomeBtn>
|
407
|
420
|
{
|
408
|
421
|
consultShow && <Consultant style="bottom:150rpx" smallStyle="bottom:178rpx" personId={userInfo.person.personId} name={userInfo.person.name || userInfo.person.nickname} data={consultData}></Consultant>
|