xujing 5 年前
父节点
当前提交
4ae2190bc0

+ 28
- 14
src/onlineSelling/pages/raiseMoney/Certification.js 查看文件

@@ -15,19 +15,26 @@ export default class Certification extends Component {
15 15
   }
16 16
   state = {
17 17
     signDetail: {},
18
+    autoErr: null,
18 19
   }
19 20
 
20 21
   componentWillMount() {
21 22
     ready.queue(() => {
22
-      const { id: raiseRecordId } = this.$router.params
23
+      const { id: raiseRecordId, consultantInfo = {} } = this.$router.params
23 24
       contractUser({ raiseRecordId, }).then(res => {
24 25
         this.setState({
25 26
           signDetail: res || {}
26 27
         }, () => {
27 28
           const { signDetail } = this.state
28 29
           if (signDetail.status == 2 && signDetail.authStatus == 'autoSign') {
29
-            contractAuto().then(res => {
30
-              console.log(res, "自动签署合同自动签署合同自动签署合同自动签署合同自动签署合同自动签署合同")
30
+            contractAuto({ raiseRecordId, }).then(res => {
31
+              Taro.navigateTo({
32
+                url: `//onlineSelling/pages/raiseMoney/signResult?id=${raiseRecordId}&consultantInfo=${consultantInfo}`
33
+              })
34
+            }).catch(err => {
35
+              this.setState({
36
+                autoErr: err.message || ''
37
+              })
31 38
             })
32 39
           }
33 40
         })
@@ -37,7 +44,9 @@ export default class Certification extends Component {
37 44
   }
38 45
 
39 46
   handleChatClick() {
40
-    const { userInfo: { miniApp: { tpls }, person: { personId, nickname, name } } } = this.props
47
+
48
+    const { consultantInfo = {} } = this.$router.params
49
+    const { user: { userInfo: { miniApp: { tpls }, person: { personId, nickname, name } } } } = this.props
41 50
     const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_NOTICE && x.isSubscribe == true)[0] || {}).tplId
42 51
     wx.requestSubscribeMessage({
43 52
       tmplIds: [tplId],
@@ -48,7 +57,7 @@ export default class Certification extends Component {
48 57
       },
49 58
       complete() {
50 59
         Taro.navigateTo({
51
-          url: `/pages/im/index?sendId=${personId}&sendName=${encodeURIComponent(name || nickname)}&receiverId=${consultant.id}&receiverName=${encodeURIComponent(consultant.name || consultant.nickname || consultant.userName)}`
60
+          url: `/pages/im/index?sendId=${personId}&sendName=${encodeURIComponent(name || nickname)}&receiverId=${consultantInfo.consultantPersonId}&receiverName=${encodeURIComponent(consultantInfo.name || consultantInfo.nickname || consultantInfo.userName)}`
52 61
         })
53 62
       }
54 63
     })
@@ -69,7 +78,7 @@ export default class Certification extends Component {
69 78
 
70 79
 
71 80
   render() {
72
-    const { signDetail } = this.state
81
+    const { signDetail, autoErr } = this.state
73 82
     const status = signDetail ? signDetail.status : ''
74 83
     const showIcon = status == 2 ? require('../../assets/success2.png') : (status == 0 || status == 1) ? require('../../assets/fail2.png') : status == 2 ? require('../../assets/fail2.png') : require('../../assets/going.png')
75 84
 
@@ -84,13 +93,22 @@ export default class Certification extends Component {
84 93
             <Image className="result-img" src={showIcon}></Image>
85 94
             <View className="status" >实名认证<Text style={status == 3 ? 'color:#2CD7AA' : status == 2 ? 'color:#118EE9' : 'color:#F4333B'}>{showTitle}</Text></View>
86 95
 
87
-            {status == 4 && <View className="tip" style="margin-top:10rpx">不通过原因:XXXXXX</View>}
96
+            {status == 4 && <View className="tip" style="margin-top:14rpx">不通过原因:XXXXXX</View>}
88 97
 
89
-            {status == 2 && <View className="tip" style="margin-top:10rpx">正在准备合同,请不要退出···</View>}
98
+            {status == 2 && <Block>
99
+              {!autoErr && <View className="tip" style="margin-top:14rpx">正在准备合同,请不要退出···</View>}
100
+              {autoErr && <Block>
101
+                <View className="tip" style="margin-top:14rpx;color:#F4333B">自动签署失败</View>
102
+                <View className="tip" style="margin-top:14rpx;color:#333">原因:{autoErr}</View>
103
+                <View className="tip" style="margin-top:24rpx">请联系专属置业顾问解决</View>
104
+                <ContactConsultant contactClick={() => this.handleChatClick()} text="请联系专属置业顾问" style=" position: absolute;bottom: 9vh;" />
105
+              </Block>}
106
+            </Block>
107
+            }
90 108
 
91
-            {(status == 0 || status == 1 || status == 4) && <View className="tip" style="margin-top:10rpx">请返回重新发起认证</View>}
109
+            {(status == 0 || status == 1 || status == 4) && <View className="tip" style="margin-top:14rpx">请返回重新发起认证</View>}
92 110
 
93
-            {status == 3 && <View className="tip" style="margin-top:10rpx; display: flex;align-items: center;" onClick={() => this.handleBtnClick()}>实名信息需要法大大审核,请刷新状态
111
+            {status == 3 && <View className="tip" style="margin-top:14rpx; display: flex;align-items: center;" onClick={() => this.handleBtnClick()}>实名信息需要法大大审核,请刷新状态
94 112
             <Image style="width:18px;height:18px;margin-left:8rpx" src={require('../../assets/refresh.png')} />
95 113
             </View>}
96 114
 
@@ -99,10 +117,6 @@ export default class Certification extends Component {
99 117
             {status == 3 && <View class="certification-btn" onClick={() => this.handleBtnClick()}>更新我的实名认证信息</View>}
100 118
           </Block>
101 119
         }
102
-        {/* 
103
-            <ContactConsultant contactClick={() => this.handleChatClick()} text="请联系专属置业顾问" style=" position: absolute;bottom: 9vh;" />
104
-      */}
105
-
106 120
       </View>
107 121
     )
108 122
   }

+ 46
- 7
src/onlineSelling/pages/raiseMoney/index.js 查看文件

@@ -11,7 +11,7 @@ import * as houseActions from '@/actions/house'
11 11
 import NextStep from './NextStep'
12 12
 import { fetch, apis } from '@/utils/request'
13 13
 import Captcha from './Captcha'
14
-import { raiseOrder, cancelOrder, queryPreselectionRecord, raiseOffline } from '@/services/project'
14
+import { raiseOrder, cancelOrder, queryPreselectionRecord, raiseOffline, contractUser } from '@/services/project'
15 15
 import { getCodeMessage, checkCaptcha } from '@/services/getCode'
16 16
 import { checkRaise } from '@/services/house'
17 17
 import { checkIDCard, isEmpty, transferImage } from '@/utils/tools'
@@ -62,6 +62,7 @@ export default class raiseMoney extends Component {
62 62
       { label: '线上缴费', value: 'onLine' },
63 63
       { label: '线下缴费', value: 'offLine' },
64 64
     ],
65
+    signDetail: {},
65 66
   }
66 67
 
67 68
   captchaLock = false
@@ -105,7 +106,19 @@ export default class raiseMoney extends Component {
105 106
         payType = payTypeSettings[0]
106 107
       }
107 108
 
108
-      this.setState({ raiseProfile: res, payType, record: res.record || defaultRecord })
109
+      this.setState({
110
+        raiseProfile: res, payType,
111
+        record: res.record || defaultRecord
112
+      }, () => {
113
+        const { record: { showContract } } = this.state
114
+        if (showContract == 1) {
115
+          contractUser({ raiseRecordId, }).then(res => {
116
+            this.setState({
117
+              signDetail: res || {}
118
+            })
119
+          })
120
+        }
121
+      })
109 122
 
110 123
       // 销售批次已被取消发布
111 124
       if (res.status != 1) {
@@ -707,8 +720,30 @@ export default class raiseMoney extends Component {
707 720
       url: `/onlineSelling/pages/houseList/index?id=${id}`
708 721
     })
709 722
   }
723
+  toSign = () => {
724
+    const { signDetail } = this.state
725
+    const status = signDetail ? signDetail.status : ''
726
+    const consultant = this.getConsultant()
727
+    if (status == 0 || status == 1) {
728
+      if (signDetail.certifiedAddress) {
729
+        Taro.navigateTo({
730
+          url: `/pages/project/panorama/index?url=${encodeURIComponent(signDetail.certifiedAddress)}&from=raiseProfile&consultantInfo=${consultant}`
731
+        })
732
+      } else {
733
+        Taro.showToast({
734
+          title: '无可跳转的认证地址',
735
+          icon: 'none'
736
+        })
737
+      }
738
+    } else {
739
+      const { id: raiseRecordId } = this.$router.params
740
+      Taro.navigateTo({
741
+        url: `/onlineSelling/pages/raiseMoney/Certification?id=${raiseRecordId}&consultantInfo=${consultant}`
742
+      })
743
+    }
744
+  }
710 745
   renderBtn() {
711
-    const { raiseProfile = {}, record = {} } = this.state
746
+    const { raiseProfile = {}, record = {}, signDetail } = this.state
712 747
     return (
713 748
       <View className="bottombar">
714 749
         <View className="bt-nav__left">
@@ -724,10 +759,14 @@ export default class raiseMoney extends Component {
724 759
             <Image src={transferImage(require('../../assets/consult.png'))} style="width:36rpx;height:40rpx"></Image>
725 760
             <Text className="text">置业顾问</Text>
726 761
           </Button>
727
-          <Button className='bt-nav__item' >
728
-            <Image src={transferImage(require('../../assets/sign.png'))} style="width:42rpx;height:40rpx"></Image>
729
-            <Text className="text" style="color:#E4A938">签署合同</Text>
730
-          </Button>
762
+          {
763
+            record.showContract == 1 && signDetail &&
764
+            <Button className='bt-nav__item' >
765
+              <Image src={transferImage(require('../../assets/sign.png'))} style="width:42rpx;height:40rpx"></Image>
766
+              <Text className="text" style="color:#E4A938" onClick={this.toSign}>签署合同</Text>
767
+            </Button>
768
+          }
769
+
731 770
         </View>
732 771
         <Button className="btn" onClick={() => this.toRaiseProfile(record.raiseRecordId)}>
733 772
           认筹单

+ 1
- 0
src/onlineSelling/pages/raiseMoney/signResult.js 查看文件

@@ -6,6 +6,7 @@ import { connect, getStore } from '@tarojs/redux'
6 6
 import * as houseActions from '@/actions/house'
7 7
 import * as noticeType from '@/constants/common.js'
8 8
 import BackHomeBtn from '@/components/BackHomeBtn'
9
+import { contractManual } from '@/services/project'
9 10
 import { transferImage } from '@/utils/tools'
10 11
 
11 12
 @connect(({ user, house }) => ({ ...user, house }), { ...houseActions })

+ 8
- 7
src/onlineSelling/pages/raiseProfile/index.js 查看文件

@@ -210,11 +210,12 @@ export default class Raise extends Component {
210 210
     })
211 211
   }
212 212
   toSign = () => {
213
-    const { signDetail } = this.state
214
-    if (signDetail.status == 0 || signDetail.status == 1) {
213
+    const { signDetail, raiseDeatil: { consultantInfo } } = this.state
214
+    const status = signDetail ? signDetail.status : ''
215
+    if (status == 0 || status == 1) {
215 216
       if (signDetail.certifiedAddress) {
216 217
         Taro.navigateTo({
217
-          url: `/pages/project/panorama/index?url=${encodeURIComponent(res.certifiedAddress)}`
218
+          url: `/pages/project/panorama/index?url=${encodeURIComponent(signDetail.certifiedAddress)}&from=raiseProfile&consultantInfo=${consultantInfo}`
218 219
         })
219 220
       } else {
220 221
         Taro.showToast({
@@ -225,13 +226,13 @@ export default class Raise extends Component {
225 226
     } else {
226 227
       const { id: raiseRecordId } = this.$router.params
227 228
       Taro.navigateTo({
228
-        url: `/onlineSelling/pages/raiseMoney/Certification?id=${raiseRecordId}`
229
+        url: `/onlineSelling/pages/raiseMoney/Certification?id=${raiseRecordId}&consultantInfo=${consultantInfo}`
229 230
       })
230 231
     }
231 232
   }
232 233
 
233 234
   render() {
234
-    const { buildingId, raiseDeatil, orderDetail, refundOrder, raiseOrder } = this.state;
235
+    const { buildingId, raiseDeatil, orderDetail, refundOrder, raiseOrder, signDetail } = this.state;
235 236
 
236 237
 
237 238
     // 认筹信息
@@ -286,7 +287,7 @@ export default class Raise extends Component {
286 287
             <View className="agreement" onClick={this.toAgreement}>查看合同<Text className="right-icon"></Text></View>
287 288
           </View>
288 289
           {
289
-            raiseDeatil.showContract == 0 &&
290
+            raiseDeatil.showContract == 0 && signDetail &&
290 291
             <View className="sign" onClick={this.toSign}>
291 292
               为保障您的权益,请签署认筹合同<Text className="right-icon" style="opacity:0.3"></Text><Text className="right-icon" style="opacity:0.6"></Text><Text className="right-icon"></Text>
292 293
             </View>
@@ -296,7 +297,7 @@ export default class Raise extends Component {
296 297
             {raiseDeatil.consultantInfo && <ConsultantItem
297 298
               data={raiseDeatil.consultantInfo}
298 299
               type="raiseProfile"
299
-              style="height:140rpx;margin-bottom:0rpx;width:690rpx;padding:0"
300
+              style="height:140rpx;margin-bottom:0rpx;width:690rpx;padding:1px 0"
300 301
               contactClick={() => this.handleChatClick(raiseDeatil.consultantInfo)}
301 302
             />}
302 303
             <View className="hr" />

+ 17
- 2
src/pages/project/panorama/index.js 查看文件

@@ -1,12 +1,27 @@
1 1
 import Taro, { Component } from '@tarojs/taro'
2 2
 import { WebView } from '@tarojs/components'
3
+import { contractUser } from '@/services/project'
3 4
 
4 5
 export default class Panorama extends Component {
5 6
   state = {}
6 7
 
7
-  componentWillMount() {}
8
+  componentWillMount() {
9
+    const { from = '', consultantInfo = {} } = this.$router.params
10
+    if (from == raiseProfile) {
11
+      const tk = setInterval(() => {
12
+        contractUser().then(res => {
13
+          if (res.status != 0 || res.status != 1) {
14
+            clearInterval(tk)
15
+            Taro.navigateTo({
16
+              url: `/onlineSelling/pages/raiseMoney/Certification?id=${res.raiseRecordId}&consultantInfo=${consultantInfo}`
17
+            })
18
+          }
19
+        })
20
+      }, 30000)
21
+    }
22
+  }
8 23
 
9
-  render () {
24
+  render() {
10 25
     const url = decodeURIComponent(this.$router.params.url)
11 26
 
12 27
     return (