소스 검색

sharepersonid

xujing 5 년 전
부모
커밋
f07276cd56
7개의 변경된 파일51개의 추가작업 그리고 33개의 파일을 삭제
  1. 1
    1
      config/prod.js
  2. 1
    1
      project.config.json
  3. BIN
      src/assets/mine/share.png
  4. 18
    11
      src/pages/activity/detail/assistance.js
  5. 14
    9
      src/pages/activity/detail/index.js
  6. 16
    10
      src/pages/news/detail/index.js
  7. 1
    1
      src/pages/person/menus.js

+ 1
- 1
config/prod.js 파일 보기

9
     WSS_HOST: '"wss://dev.jinchengjiaye.com"',
9
     WSS_HOST: '"wss://dev.jinchengjiaye.com"',
10
     // HOST: '"https://lt.pawoma.cn"',
10
     // HOST: '"https://lt.pawoma.cn"',
11
     // WSS_HOST: '"wss://lt.pawoma.cn"',
11
     // WSS_HOST: '"wss://lt.pawoma.cn"',
12
-    Version:'V3.5.4_2019-12-182140'
12
+    Version:'V3.5.4_2019-12-191441'
13
   },
13
   },
14
   weapp: {},
14
   weapp: {},
15
   h5: {}
15
   h5: {}

+ 1
- 1
project.config.json 파일 보기

1
 {
1
 {
2
 	"miniprogramRoot": "dist/",
2
 	"miniprogramRoot": "dist/",
3
 	"projectname": "mini-chengjiao",
3
 	"projectname": "mini-chengjiao",
4
-	"description": "知与行互动",
4
+	"description": "知与行联调",
5
 	"appid": "wxd9ee3a9480a4e544",
5
 	"appid": "wxd9ee3a9480a4e544",
6
 	"setting": {
6
 	"setting": {
7
 		"urlCheck": false,
7
 		"urlCheck": false,

BIN
src/assets/mine/share.png 파일 보기


+ 18
- 11
src/pages/activity/detail/assistance.js 파일 보기

257
     const { userInfo } = this.props
257
     const { userInfo } = this.props
258
 
258
 
259
     Taro.showLoading()
259
     Taro.showLoading()
260
+    const router = Taro.getStorageSync('router')
261
+    const consultant = this.$router.params.consultant || router.query.consultant
262
+    const consultantId = this.$router.params.consultantId || router.query.consultantId || ""
263
+    const recommender = this.$router.params.recommender || router.query.recommender || ""
260
     getHelpDetail(id, initiateId).then(res => {
264
     getHelpDetail(id, initiateId).then(res => {
261
       this.stopTicker()
265
       this.stopTicker()
262
 
266
 
297
         eventType: 'help',
301
         eventType: 'help',
298
         propertyName: '助力详情',
302
         propertyName: '助力详情',
299
         buildingId: res.helpActivity.buildingId,
303
         buildingId: res.helpActivity.buildingId,
304
+        consultantId: consultantId,
305
+        sharePersonId: recommender,
300
         targetId: id,
306
         targetId: id,
301
         data: '{"initiateId":"' + initiateId + '"}'
307
         data: '{"initiateId":"' + initiateId + '"}'
302
       }).then((res) => {
308
       }).then((res) => {
303
         this.setState({ pointRecordId: res.recordId })
309
         this.setState({ pointRecordId: res.recordId })
304
       })
310
       })
305
     })
311
     })
306
-    const router = Taro.getStorageSync('router')
307
-    const consultant = this.$router.params.consultant || router.query.consultant
312
+
308
     if (consultant) {
313
     if (consultant) {
309
       this.reportClientFn()
314
       this.reportClientFn()
310
       getCardDetail(consultant).then(res => {
315
       getCardDetail(consultant).then(res => {
339
 
344
 
340
   currentPageAndParams() {
345
   currentPageAndParams() {
341
     const { id, initiateId } = this.state
346
     const { id, initiateId } = this.state
342
-    const { userInfo: { person: { personId, personType } } } = this.props
347
+    const { userInfo: { person: { personId, personType, userId } } } = this.props
343
     const consultant = personType == ROLE_CODE['CONSULTANT'] ? personId : ""
348
     const consultant = personType == ROLE_CODE['CONSULTANT'] ? personId : ""
349
+    const consultantId = personType == ROLE_CODE['CONSULTANT'] ? userId : ""
344
 
350
 
345
     let queryParams = [
351
     let queryParams = [
346
       `id=${id}`,
352
       `id=${id}`,
347
       `from=help_share`,
353
       `from=help_share`,
348
       `recommender=${personId}`,
354
       `recommender=${personId}`,
349
       `consultant=${consultant}`,
355
       `consultant=${consultant}`,
356
+      `&consultantId=${consultantId}`,
350
     ]
357
     ]
351
     if (initiateId) {
358
     if (initiateId) {
352
       queryParams.push(`initiateId=${initiateId}`)
359
       queryParams.push(`initiateId=${initiateId}`)
396
   handleHelp = () => {
403
   handleHelp = () => {
397
     const { userInfo: { miniApp: { tpls } } } = this.props
404
     const { userInfo: { miniApp: { tpls } } } = this.props
398
     const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_HELP && x.isSubscribe == true))[0].tplId
405
     const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_HELP && x.isSubscribe == true))[0].tplId
399
-    const that=this
406
+    const that = this
400
     wx.requestSubscribeMessage({
407
     wx.requestSubscribeMessage({
401
       tmplIds: [tplId],
408
       tmplIds: [tplId],
402
       success(res) {
409
       success(res) {
412
         that.setState({ submitting: true }, () => {
419
         that.setState({ submitting: true }, () => {
413
           const { detail, initiateDetail } = that.state
420
           const { detail, initiateDetail } = that.state
414
           const person = that.props.userInfo.person
421
           const person = that.props.userInfo.person
415
-    
422
+
416
           giveFriendHelp({
423
           giveFriendHelp({
417
             buildingId: detail.buildingId,
424
             buildingId: detail.buildingId,
418
             helpActivityId: detail.helpActivityId,
425
             helpActivityId: detail.helpActivityId,
425
             Taro.hideLoading()
432
             Taro.hideLoading()
426
             const helpList = that.state.helpList || []
433
             const helpList = that.state.helpList || []
427
             helpList.push(res.helpRecord)
434
             helpList.push(res.helpRecord)
428
-    
435
+
429
             that.setState({
436
             that.setState({
430
               submitting: false,
437
               submitting: false,
431
               helpList,
438
               helpList,
433
               initiateId: res.helpInitiateRecord.helpRecordInitiateId,
440
               initiateId: res.helpInitiateRecord.helpRecordInitiateId,
434
               helpState: res.helpInitiateRecord.status === undefined ? HelpInProcess : res.helpInitiateRecord.status,
441
               helpState: res.helpInitiateRecord.status === undefined ? HelpInProcess : res.helpInitiateRecord.status,
435
             })
442
             })
436
-    
443
+
437
             Taro.showToast({
444
             Taro.showToast({
438
               title: '助力成功',
445
               title: '助力成功',
439
               icon: 'success'
446
               icon: 'success'
440
             })
447
             })
441
-    
448
+
442
           }).catch(err => {
449
           }).catch(err => {
443
             console.log('err:', err)
450
             console.log('err:', err)
444
             Taro.hideLoading()
451
             Taro.hideLoading()
445
-    
452
+
446
             Taro.showToast({
453
             Taro.showToast({
447
               title: '失败: ' + err.message,
454
               title: '失败: ' + err.message,
448
               icon: 'none'
455
               icon: 'none'
455
         })
462
         })
456
       }
463
       }
457
     })
464
     })
458
-   
465
+
459
   }
466
   }
460
 
467
 
461
   // 发起我的助力
468
   // 发起我的助力
501
   askForHelp = () => {
508
   askForHelp = () => {
502
     const { userInfo: { miniApp: { tpls } } } = this.props
509
     const { userInfo: { miniApp: { tpls } } } = this.props
503
     const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_HELP && x.isSubscribe == true))[0].tplId
510
     const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_HELP && x.isSubscribe == true))[0].tplId
504
-    const that=this
511
+    const that = this
505
     wx.requestSubscribeMessage({
512
     wx.requestSubscribeMessage({
506
       tmplIds: [tplId],
513
       tmplIds: [tplId],
507
       success(res) {
514
       success(res) {

+ 14
- 9
src/pages/activity/detail/index.js 파일 보기

81
   loadDetail() {
81
   loadDetail() {
82
     const { id } = this.state
82
     const { id } = this.state
83
     Taro.showLoading()
83
     Taro.showLoading()
84
+    const router = Taro.getStorageSync('router')
85
+    const consultant = this.$router.params.consultant || router.query.consultant
86
+    const consultantId = this.$router.params.consultantId || router.query.consultantId || ""
87
+    const recommender = this.$router.params.recommender || router.query.recommender || ""
84
     queryActivityDetail(id).then(res => {
88
     queryActivityDetail(id).then(res => {
85
       Taro.hideLoading()
89
       Taro.hideLoading()
86
       const { isSaved, isSign } = res
90
       const { isSaved, isSign } = res
107
         propertyName: '活动详情',
111
         propertyName: '活动详情',
108
         buildingId: res.buildingId,
112
         buildingId: res.buildingId,
109
         targetId: res.dynamicId,
113
         targetId: res.dynamicId,
114
+        consultantId: consultantId,
115
+        sharePersonId: recommender,
110
         data: '{}'
116
         data: '{}'
111
       }).then(res1 => {
117
       }).then(res1 => {
112
         this.setState({
118
         this.setState({
115
         console.log('活动详情')
121
         console.log('活动详情')
116
       })
122
       })
117
     })
123
     })
118
-    const router = Taro.getStorageSync('router')
119
-    const consultant = this.$router.params.consultant || router.query.consultant
124
+
120
     if (consultant) {
125
     if (consultant) {
121
       this.reportClientFn()
126
       this.reportClientFn()
122
       getCardDetail(consultant).then(res => {
127
       getCardDetail(consultant).then(res => {
149
     }
154
     }
150
   }
155
   }
151
   onShareAppMessage = () => {
156
   onShareAppMessage = () => {
152
-    const { detail: { shareContents, title, dynamicId, url } } = this.state
157
+    const { detail: { shareContents, title, dynamicId, imgUrl } } = this.state
153
     const { userInfo: { person: { personId, personType, userId } } } = this.props
158
     const { userInfo: { person: { personId, personType, userId } } } = this.props
154
     console.log(dynamicId, "path")
159
     console.log(dynamicId, "path")
155
     console.log(personId, "personId")
160
     console.log(personId, "personId")
170
     })
175
     })
171
     const consultant = personType == ROLE_CODE['CONSULTANT'] ? personId : ""
176
     const consultant = personType == ROLE_CODE['CONSULTANT'] ? personId : ""
172
     return {
177
     return {
173
-      title: shareContents[0].shareContentTitle,
174
-      path: `/pages/activity/detail/index?id=${dynamicId}&from=dynamic_share&recommender=${personId}&consultant=${consultant}`,//分享地址
175
-      imageUrl: shareContents[0].shareContentImg
178
+      title: shareContents[0].shareContentTitle || title,
179
+      path: `/pages/activity/detail/index?id=${dynamicId}&from=dynamic_share&recommender=${personId}&consultant=${consultant}&consultantId=${consultantId}`,//分享地址
180
+      imageUrl: shareContents[0].shareContentImg || imgUrl
176
     }
181
     }
177
-
178
   }
182
   }
179
 
183
 
180
   handleSignup() {
184
   handleSignup() {
246
       }
250
       }
247
 
251
 
248
       const { userInfo: { person, miniApp } } = this.props
252
       const { userInfo: { person, miniApp } } = this.props
249
-      const { avatarurl, nickname, personId, personType, phone, tel } = person
253
+      const { avatarurl, nickname, personId, personType, phone, tel, userId } = person
250
       const { detail: { dynamicId, posters, createDate } } = this.state
254
       const { detail: { dynamicId, posters, createDate } } = this.state
251
       const consultant = personType == ROLE_CODE['CONSULTANT'] ? personId : ""
255
       const consultant = personType == ROLE_CODE['CONSULTANT'] ? personId : ""
256
+      const consultantId = personType == ROLE_CODE['CONSULTANT'] ? userId : ""
252
       const phoneNum = phone || tel
257
       const phoneNum = phone || tel
253
 
258
 
254
       const payload = {
259
       const payload = {
255
-        "scene": `id=${dynamicId}&from=dynamic_share&recommender=${personId}&consultant=${consultant}&phoneNum=${phoneNum}`,
260
+        "scene": `id=${dynamicId}&from=dynamic_share&recommender=${personId}&consultant=${consultant}&phoneNum=${phoneNum}&consultantId=${consultantId}`,
256
         "page": 'pages/activity/detail/index',
261
         "page": 'pages/activity/detail/index',
257
       }
262
       }
258
 
263
 

+ 16
- 10
src/pages/news/detail/index.js 파일 보기

41
     consultShow: false  // 置业顾问悬浮框显示隐藏
41
     consultShow: false  // 置业顾问悬浮框显示隐藏
42
   }
42
   }
43
 
43
 
44
-  componentWillMount() {
45
-    console.log(this.$router,"this.$router")
44
+  componentWillMount(routerProps) {
45
+    console.log(routerProps,"routerProps")
46
+
46
     console.info('ready status3', ready)
47
     console.info('ready status3', ready)
47
     ready.queue(() => {
48
     ready.queue(() => {
48
       const router = Taro.getStorageSync('router')
49
       const router = Taro.getStorageSync('router')
156
     console.log(`/pages/news/detail/index?id=${newsId}&from=news_share&recommender=${personId}&consultant=${consultant}`, "path")
157
     console.log(`/pages/news/detail/index?id=${newsId}&from=news_share&recommender=${personId}&consultant=${consultant}`, "path")
157
 
158
 
158
     return {
159
     return {
159
-      title: shareContents[0].shareContentTitle,
160
-      path: `/pages/news/detail/index?id=${newsId}&from=news_share&recommender=${personId}&consultant=${consultant}`,//分享地址
161
-      imageUrl: shareContents[0].shareContentImg
160
+      title: shareContents[0].shareContentTitle || newsName,
161
+      path: `/pages/news/detail/index?id=${newsId}&from=news_share&recommender=${personId}&consultant=${consultant}&consultantId=${consultantId}`,//分享地址
162
+      imageUrl: shareContents[0].shareContentImg || newsImg
162
     }
163
     }
163
-
164
   }
164
   }
165
 
165
 
166
   loadDetail() {
166
   loadDetail() {
167
     const { newsId } = this.state
167
     const { newsId } = this.state
168
+    const router = Taro.getStorageSync('router')
169
+    const consultant = this.$router.params.consultant || router.query.consultant
170
+    const consultantId = this.$router.params.consultantId || router.query.consultantId || ""
171
+    const recommender = this.$router.params.recommender || router.query.recommender || ""
168
     Taro.showLoading()
172
     Taro.showLoading()
169
     queryNewsDetail(newsId).then(res => {
173
     queryNewsDetail(newsId).then(res => {
170
       Taro.hideLoading()
174
       Taro.hideLoading()
189
         propertyName: '资讯详情',
193
         propertyName: '资讯详情',
190
         buildingId: res.buildingId,
194
         buildingId: res.buildingId,
191
         targetId: res.newsId,
195
         targetId: res.newsId,
196
+        consultantId: consultantId,
197
+        sharePersonId: recommender,
192
         data: '{}'
198
         data: '{}'
193
       }).then(res => {
199
       }).then(res => {
194
         this.setState({
200
         this.setState({
197
         console.info('资讯详情')
203
         console.info('资讯详情')
198
       })
204
       })
199
     })
205
     })
200
-    const router = Taro.getStorageSync('router')
201
-    const consultant = this.$router.params.consultant || router.query.consultant
206
+
202
     if (consultant) {
207
     if (consultant) {
203
       this.reportClientFn()
208
       this.reportClientFn()
204
       getCardDetail(consultant).then(res => {
209
       getCardDetail(consultant).then(res => {
217
         return
222
         return
218
       }
223
       }
219
       const { userInfo: { person, miniApp } } = this.props
224
       const { userInfo: { person, miniApp } } = this.props
220
-      const { avatarurl, nickname, personId, personType, phone, tel } = person
225
+      const { avatarurl, nickname, personId, personType, phone, tel, userId } = person
221
       const { newsId, detail: { posters, newsName, createDate } } = this.state
226
       const { newsId, detail: { posters, newsName, createDate } } = this.state
222
       const consultant = personType == ROLE_CODE['CONSULTANT'] ? personId : ""
227
       const consultant = personType == ROLE_CODE['CONSULTANT'] ? personId : ""
228
+      const consultantId = personType == ROLE_CODE['CONSULTANT'] ? userId : ""
223
       const phoneNum = phone || tel
229
       const phoneNum = phone || tel
224
       const payload = {
230
       const payload = {
225
-        "scene": `id=${newsId}&from=news_share&recommender=${personId}&consultant=${consultant}&phoneNum=${phoneNum}`,
231
+        "scene": `id=${newsId}&from=news_share&recommender=${personId}&consultant=${consultant}&phoneNum=${phoneNum}&consultantId=${consultantId}`,
226
         "page": 'pages/news/detail/index',
232
         "page": 'pages/news/detail/index',
227
       }
233
       }
228
       const _avatarurl = getDownloadURL(avatarurl, 'avatar');
234
       const _avatarurl = getDownloadURL(avatarurl, 'avatar');

+ 1
- 1
src/pages/person/menus.js 파일 보기

17
   consultant: require('@assets/mine/consultant.png'),
17
   consultant: require('@assets/mine/consultant.png'),
18
   customerAnalysis: require('@assets/mine/customerAnalysis.png'),
18
   customerAnalysis: require('@assets/mine/customerAnalysis.png'),
19
   fenxi: require('@assets/mine/fenxi.png'),
19
   fenxi: require('@assets/mine/fenxi.png'),
20
-  share: require('@assets/mine/accessrecord.png'),
20
+  share: require('@assets/mine/share.png'),
21
 }
21
 }
22
 
22
 
23
 const DRIFT = ROLE_CODE['DRIFT']
23
 const DRIFT = ROLE_CODE['DRIFT']