xujing il y a 5 ans
Parent
révision
510770d762
5 fichiers modifiés avec 28 ajouts et 11 suppressions
  1. 1
    1
      config/dev.js
  2. 1
    1
      config/prod.js
  3. 3
    2
      src/actions/project.js
  4. 19
    6
      src/pages/news/detail/index.js
  5. 4
    1
      src/pages/news/detail/index.scss

+ 1
- 1
config/dev.js Voir le fichier

@@ -9,7 +9,7 @@ module.exports = {
9 9
     // WSS_HOST: '"ws://192.168.2.43:8080"',
10 10
     OSS_PATH: "https://njcj.oss-cn-shanghai.aliyuncs.com/",
11 11
     OSS_FAST_PATH: "https://njcj.oss-accelerate.aliyuncs.com/",
12
-    Version: "V3.5.26"
12
+    Version: "V3.5.28"
13 13
   },
14 14
   weapp: {},
15 15
   h5: {}

+ 1
- 1
config/prod.js Voir le fichier

@@ -9,7 +9,7 @@ module.exports = {
9 9
     WSS_HOST: '"wss://wx.fangdeal.cn"',
10 10
     OSS_PATH: "https://njcj.oss-cn-shanghai.aliyuncs.com/",
11 11
     OSS_FAST_PATH: "https://njcj.oss-accelerate.aliyuncs.com/",
12
-    Version: "V3.5.26"
12
+    Version: "V3.5.28"
13 13
   },
14 14
   weapp: {},
15 15
   h5: {}

+ 3
- 2
src/actions/project.js Voir le fichier

@@ -39,9 +39,10 @@ export const dispatchIndexProjects = payload => createAction({
39 39
  * 获取项目信息
40 40
  * @param {*} id 
41 41
  */
42
-export const dispatchProjectDetail = id => createAction({
42
+export const dispatchProjectDetail = (id, params) => createAction({
43 43
   url: `${API_ITEMS_DETAIL}/${id}`,
44
-  type: PROJECT_DETAIL
44
+  type: PROJECT_DETAIL,
45
+  fetchOptions: params || {}
45 46
 })
46 47
 
47 48
 /**

+ 19
- 6
src/pages/news/detail/index.js Voir le fichier

@@ -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>

+ 4
- 1
src/pages/news/detail/index.scss Voir le fichier

@@ -71,7 +71,10 @@
71 71
     margin-top: 30px;
72 72
   }
73 73
 }
74
-
74
+.pro__info {
75
+  padding: 30px  30px 50px 30px;
76
+  background: white;
77
+}
75 78
 
76 79
 .bot-nav {
77 80
   position: fixed;