xujing 5 years ago
parent
commit
4ae2190bc0

+ 28
- 14
src/onlineSelling/pages/raiseMoney/Certification.js View File

15
   }
15
   }
16
   state = {
16
   state = {
17
     signDetail: {},
17
     signDetail: {},
18
+    autoErr: null,
18
   }
19
   }
19
 
20
 
20
   componentWillMount() {
21
   componentWillMount() {
21
     ready.queue(() => {
22
     ready.queue(() => {
22
-      const { id: raiseRecordId } = this.$router.params
23
+      const { id: raiseRecordId, consultantInfo = {} } = this.$router.params
23
       contractUser({ raiseRecordId, }).then(res => {
24
       contractUser({ raiseRecordId, }).then(res => {
24
         this.setState({
25
         this.setState({
25
           signDetail: res || {}
26
           signDetail: res || {}
26
         }, () => {
27
         }, () => {
27
           const { signDetail } = this.state
28
           const { signDetail } = this.state
28
           if (signDetail.status == 2 && signDetail.authStatus == 'autoSign') {
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
   }
44
   }
38
 
45
 
39
   handleChatClick() {
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
     const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_NOTICE && x.isSubscribe == true)[0] || {}).tplId
50
     const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_NOTICE && x.isSubscribe == true)[0] || {}).tplId
42
     wx.requestSubscribeMessage({
51
     wx.requestSubscribeMessage({
43
       tmplIds: [tplId],
52
       tmplIds: [tplId],
48
       },
57
       },
49
       complete() {
58
       complete() {
50
         Taro.navigateTo({
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
 
78
 
70
 
79
 
71
   render() {
80
   render() {
72
-    const { signDetail } = this.state
81
+    const { signDetail, autoErr } = this.state
73
     const status = signDetail ? signDetail.status : ''
82
     const status = signDetail ? signDetail.status : ''
74
     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')
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
             <Image className="result-img" src={showIcon}></Image>
93
             <Image className="result-img" src={showIcon}></Image>
85
             <View className="status" >实名认证<Text style={status == 3 ? 'color:#2CD7AA' : status == 2 ? 'color:#118EE9' : 'color:#F4333B'}>{showTitle}</Text></View>
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
             <Image style="width:18px;height:18px;margin-left:8rpx" src={require('../../assets/refresh.png')} />
112
             <Image style="width:18px;height:18px;margin-left:8rpx" src={require('../../assets/refresh.png')} />
95
             </View>}
113
             </View>}
96
 
114
 
99
             {status == 3 && <View class="certification-btn" onClick={() => this.handleBtnClick()}>更新我的实名认证信息</View>}
117
             {status == 3 && <View class="certification-btn" onClick={() => this.handleBtnClick()}>更新我的实名认证信息</View>}
100
           </Block>
118
           </Block>
101
         }
119
         }
102
-        {/* 
103
-            <ContactConsultant contactClick={() => this.handleChatClick()} text="请联系专属置业顾问" style=" position: absolute;bottom: 9vh;" />
104
-      */}
105
-
106
       </View>
120
       </View>
107
     )
121
     )
108
   }
122
   }

+ 46
- 7
src/onlineSelling/pages/raiseMoney/index.js View File

11
 import NextStep from './NextStep'
11
 import NextStep from './NextStep'
12
 import { fetch, apis } from '@/utils/request'
12
 import { fetch, apis } from '@/utils/request'
13
 import Captcha from './Captcha'
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
 import { getCodeMessage, checkCaptcha } from '@/services/getCode'
15
 import { getCodeMessage, checkCaptcha } from '@/services/getCode'
16
 import { checkRaise } from '@/services/house'
16
 import { checkRaise } from '@/services/house'
17
 import { checkIDCard, isEmpty, transferImage } from '@/utils/tools'
17
 import { checkIDCard, isEmpty, transferImage } from '@/utils/tools'
62
       { label: '线上缴费', value: 'onLine' },
62
       { label: '线上缴费', value: 'onLine' },
63
       { label: '线下缴费', value: 'offLine' },
63
       { label: '线下缴费', value: 'offLine' },
64
     ],
64
     ],
65
+    signDetail: {},
65
   }
66
   }
66
 
67
 
67
   captchaLock = false
68
   captchaLock = false
105
         payType = payTypeSettings[0]
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
       if (res.status != 1) {
124
       if (res.status != 1) {
707
       url: `/onlineSelling/pages/houseList/index?id=${id}`
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
   renderBtn() {
745
   renderBtn() {
711
-    const { raiseProfile = {}, record = {} } = this.state
746
+    const { raiseProfile = {}, record = {}, signDetail } = this.state
712
     return (
747
     return (
713
       <View className="bottombar">
748
       <View className="bottombar">
714
         <View className="bt-nav__left">
749
         <View className="bt-nav__left">
724
             <Image src={transferImage(require('../../assets/consult.png'))} style="width:36rpx;height:40rpx"></Image>
759
             <Image src={transferImage(require('../../assets/consult.png'))} style="width:36rpx;height:40rpx"></Image>
725
             <Text className="text">置业顾问</Text>
760
             <Text className="text">置业顾问</Text>
726
           </Button>
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
         </View>
770
         </View>
732
         <Button className="btn" onClick={() => this.toRaiseProfile(record.raiseRecordId)}>
771
         <Button className="btn" onClick={() => this.toRaiseProfile(record.raiseRecordId)}>
733
           认筹单
772
           认筹单

+ 1
- 0
src/onlineSelling/pages/raiseMoney/signResult.js View File

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

+ 8
- 7
src/onlineSelling/pages/raiseProfile/index.js View File

210
     })
210
     })
211
   }
211
   }
212
   toSign = () => {
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
       if (signDetail.certifiedAddress) {
216
       if (signDetail.certifiedAddress) {
216
         Taro.navigateTo({
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
       } else {
220
       } else {
220
         Taro.showToast({
221
         Taro.showToast({
225
     } else {
226
     } else {
226
       const { id: raiseRecordId } = this.$router.params
227
       const { id: raiseRecordId } = this.$router.params
227
       Taro.navigateTo({
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
   render() {
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
             <View className="agreement" onClick={this.toAgreement}>查看合同<Text className="right-icon"></Text></View>
287
             <View className="agreement" onClick={this.toAgreement}>查看合同<Text className="right-icon"></Text></View>
287
           </View>
288
           </View>
288
           {
289
           {
289
-            raiseDeatil.showContract == 0 &&
290
+            raiseDeatil.showContract == 0 && signDetail &&
290
             <View className="sign" onClick={this.toSign}>
291
             <View className="sign" onClick={this.toSign}>
291
               为保障您的权益,请签署认筹合同<Text className="right-icon" style="opacity:0.3"></Text><Text className="right-icon" style="opacity:0.6"></Text><Text className="right-icon"></Text>
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
             </View>
293
             </View>
296
             {raiseDeatil.consultantInfo && <ConsultantItem
297
             {raiseDeatil.consultantInfo && <ConsultantItem
297
               data={raiseDeatil.consultantInfo}
298
               data={raiseDeatil.consultantInfo}
298
               type="raiseProfile"
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
               contactClick={() => this.handleChatClick(raiseDeatil.consultantInfo)}
301
               contactClick={() => this.handleChatClick(raiseDeatil.consultantInfo)}
301
             />}
302
             />}
302
             <View className="hr" />
303
             <View className="hr" />

+ 17
- 2
src/pages/project/panorama/index.js View File

1
 import Taro, { Component } from '@tarojs/taro'
1
 import Taro, { Component } from '@tarojs/taro'
2
 import { WebView } from '@tarojs/components'
2
 import { WebView } from '@tarojs/components'
3
+import { contractUser } from '@/services/project'
3
 
4
 
4
 export default class Panorama extends Component {
5
 export default class Panorama extends Component {
5
   state = {}
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
     const url = decodeURIComponent(this.$router.params.url)
25
     const url = decodeURIComponent(this.$router.params.url)
11
 
26
 
12
     return (
27
     return (