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