Browse Source

contactconsultant

xujing 5 years ago
parent
commit
9b6c9a6a73
1 changed files with 4 additions and 3 deletions
  1. 4
    3
      src/onlineSelling/pages/raiseMoney/index.js

+ 4
- 3
src/onlineSelling/pages/raiseMoney/index.js View File

@@ -342,7 +342,7 @@ export default class raiseMoney extends Component {
342 342
   getConsultant = () => {
343 343
     const { house } = this.props
344 344
     const { record } = this.state
345
-    return house.chooseConsultant || (house.consultantList || []).filter(x => x.userId == record.userId)[0]
345
+    return house.chooseConsultant || (house.consultantList || []).filter(x => x.userId == record.userId)[0] || (house.consultantList || []).filter(x => x.mine == true)[0]
346 346
   }
347 347
 
348 348
   renderProfile() {
@@ -679,7 +679,8 @@ export default class raiseMoney extends Component {
679 679
   }
680 680
 
681 681
   handleChatClick() {
682
-    const { userInfo: { miniApp: { tpls }, person: { personId, nickname, name } }, house: { chooseConsultant } } = this.props
682
+    const { userInfo: { miniApp: { tpls }, person: { personId, nickname, name } } } = this.props
683
+    const consultant = this.getConsultant()
683 684
     const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_NOTICE && x.isSubscribe == true)[0] || {}).tplId
684 685
     wx.requestSubscribeMessage({
685 686
       tmplIds: [tplId],
@@ -690,7 +691,7 @@ export default class raiseMoney extends Component {
690 691
       },
691 692
       complete() {
692 693
         Taro.navigateTo({
693
-          url: `/pages/im/index?sendId=${personId}&sendName=${encodeURIComponent(name || nickname)}&receiverId=${chooseConsultant.id}&receiverName=${encodeURIComponent(chooseConsultant.name || chooseConsultant.nickname || chooseConsultant.userName)}`
694
+          url: `/pages/im/index?sendId=${personId}&sendName=${encodeURIComponent(name || nickname)}&receiverId=${consultant.id}&receiverName=${encodeURIComponent(consultant.name || consultant.nickname || consultant.userName)}`
694 695
         })
695 696
       }
696 697
     })