xujing 5 年之前
父節點
當前提交
9622714ddc

+ 1
- 1
src/onlineSelling/components/ContactConsultant/index.js 查看文件

@@ -11,6 +11,6 @@ export default function ContactConsultant(props) {
11 11
   }
12 12
 
13 13
   return (
14
-    <View className="contact" style={props.style} onClick={handleChat}>{props.text || '联系置业顾问'}</View>
14
+    <View className="contact" style={props.style} onClick={props.contactClick ? props.contactClick : handleChat}>{props.text || '联系置业顾问'}</View>
15 15
   )
16 16
 }

+ 32
- 6
src/onlineSelling/pages/raiseMoney/index.js 查看文件

@@ -6,7 +6,7 @@ import Statement from '../../components/Statement'
6 6
 import ConsultantItem from '../../components/ConsultantItem/index'
7 7
 import ready from '@/utils/ready'
8 8
 import dayjs from 'dayjs'
9
-import { connect } from '@tarojs/redux'
9
+import { connect, getStore } from '@tarojs/redux'
10 10
 import * as houseActions from '@/actions/house'
11 11
 import NextStep from './NextStep'
12 12
 import { fetch, apis } from '@/utils/request'
@@ -18,6 +18,7 @@ import { checkIDCard, isEmpty } from '@/utils/tools'
18 18
 import ContactConsultant from '../../components/ContactConsultant'
19 19
 import RadioList from './RadioList'
20 20
 import * as noticeType from '@/constants/common.js'
21
+import { UPDATE_USER_INFO } from '@/constants/user'
21 22
 
22 23
 const getRaiseProfile = ({ salesBatchId, raiseRecordId }) => {
23 24
   const queryString = [
@@ -257,7 +258,7 @@ export default class raiseMoney extends Component {
257 258
     return (
258 259
       <ScrollView scrollY className="container3">
259 260
         <View className="agent-box">
260
-          <View className="center-title">线上选房协议</View>
261
+          <View className="center-title">线上选房协议</View>
261 262
           <View className="rich-text">
262 263
             <RichText nodes={raiseProfile.payProtocol || ''} />
263 264
           </View>
@@ -433,7 +434,7 @@ export default class raiseMoney extends Component {
433 434
     const payTypeSettings = (raiseProfile.payType || '').split(',')
434 435
     const showTypes = payTypeList.filter(x => (payTypeSettings.indexOf(x.value) > -1))
435 436
     const showProtocal = payType === 'onLine' ? raiseProfile.payDescriptionOnline : raiseProfile.payDescriptionOffline
436
-    const payTip = payType === 'onLine' ? '线上缴费说明' : '线下缴费说明'
437
+    const payTip = payType === 'onLine' ? '线上缴费说明' : '线下缴费说明'
437 438
 
438 439
     return (
439 440
       <ScrollView scrollY className="container2" style="padding:0 30rpx">
@@ -571,6 +572,9 @@ export default class raiseMoney extends Component {
571 572
       // 最后, 校验验证码      
572 573
       checkCaptcha(record.tel, record.captcha).then(() => {
573 574
         this.setState({ disableCaptcha: true })
575
+        const {
576
+          dispatch
577
+        } = getStore()
574 578
 
575 579
         saveRaiseRecord({
576 580
           ...record,
@@ -579,6 +583,12 @@ export default class raiseMoney extends Component {
579 583
           userName: consultant.name,
580 584
         }, raiseProfile).then((res) => {
581 585
           this.setState({ record: res, disableCaptcha: false })
586
+          dispatch({
587
+            type: UPDATE_USER_INFO,
588
+            payload: {
589
+              name: record.name
590
+            }
591
+          })
582 592
           resolve(res)
583 593
         }).catch((err) => {
584 594
           this.setState({ disableCaptcha: false, current: 4, failInfo: { title: '认筹失败', desc: err.message || err } })
@@ -666,7 +676,24 @@ export default class raiseMoney extends Component {
666 676
         })
667 677
       }
668 678
     })
679
+  }
680
+
681
+  handleChatClick() {
682
+    const { userInfo: { miniApp: { tpls }, person: { personId, nickname, name } }, house: { chooseConsultant } } = this.props
683
+    const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_NOTICE && x.isSubscribe == true)[0] || {}).tplId
684
+    wx.requestSubscribeMessage({
685
+      tmplIds: [tplId],
686
+      success(res) {
687
+      },
688
+      fail(res) {
669 689
 
690
+      },
691
+      complete() {
692
+        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
+        })
695
+      }
696
+    })
670 697
   }
671 698
   renderResult() {
672 699
     const { raiseProfile = {}, record = {}, failInfo, payType } = this.state
@@ -684,9 +711,8 @@ export default class raiseMoney extends Component {
684 711
           isOk &&
685 712
           (
686 713
             <Block>
687
-
714
+              <View className="tip" style="margin-bottom:10rpx">详情请查看认筹单</View>
688 715
               {payType === 'onLine' && <Block>
689
-                <View className="tip" style="margin-bottom:10rpx">详情请查看认筹单</View>
690 716
                 <View className="tip">支付结果请留意微信支付通知</View>
691 717
               </Block>}
692 718
               {payType === 'offLine' && <Block>
@@ -701,7 +727,7 @@ export default class raiseMoney extends Component {
701 727
           !isOk && (<View className="tip">{(failInfo || {}).desc}</View>)
702 728
         }
703 729
 
704
-        <ContactConsultant buildingId={raiseProfile.buildingId} text="联系专属置业顾问" style=" position: absolute;bottom: 11vh;" />
730
+        <ContactConsultant buildingId={raiseProfile.buildingId} contactClick={() => this.handleChatClick()} text="联系专属置业顾问" style=" position: absolute;bottom: 11vh;" />
705 731
         {
706 732
           record.raiseRecordId &&
707 733
           (<View className="look-btn" onClick={() => this.toRaiseProfile(record.raiseRecordId)}>查看认筹单</View>)

+ 5
- 4
src/onlineSelling/pages/raiseMoney/index.scss 查看文件

@@ -77,10 +77,11 @@
77 77
     padding: 30px;
78 78
   }
79 79
   .center-title{
80
-    font-size: 24px;
81
-    color: #333;
80
+    font-size: 28px;
81
+    color: #FF3C3C;
82 82
     text-align: center;
83
-    line-height: 2;
83
+    font-weight: 600;
84
+    margin: 30px 0 40px 0;
84 85
   }
85 86
   .profile-box{
86 87
     padding: 0 30px;
@@ -179,7 +180,7 @@
179 180
       line-height: 1.8;
180 181
     }
181 182
     .tip{
182
-      font-size: 32px;
183
+      font-size: 30px;
183 184
       color: #999;
184 185
       padding: 0 100px;
185 186
     }