1002884655 il y a 4 ans
Parent
révision
ed45650c49

+ 11
- 3
src/components/RenZhengScreen/index.jsx Voir le fichier

1
 import React, { useState } from 'react'
1
 import React, { useState } from 'react'
2
 import NavHeader from '@/components/NavHeader/index'
2
 import NavHeader from '@/components/NavHeader/index'
3
 import Taro from '@tarojs/taro'
3
 import Taro from '@tarojs/taro'
4
+import { useModel } from '@/store'
4
 import '@/assets/css/reset.less'
5
 import '@/assets/css/reset.less'
5
 import '@/assets/css/iconfont.less'
6
 import '@/assets/css/iconfont.less'
6
 import './index.less'
7
 import './index.less'
8
 export default function RenZhengScreen (props) {
9
 export default function RenZhengScreen (props) {
9
 
10
 
10
   const { Show = false } = props
11
   const { Show = false } = props
12
+  const { user } = useModel('user')
11
 
13
 
12
   return (
14
   return (
13
-    <view className='RenZhengScreen' style={{display: Show ? 'block' : 'none'}}>
15
+    <view className='RenZhengScreen' style={{ display: Show ? 'block' : 'none' }}>
14
       <NavHeader Title='业主认证' Color='#000'></NavHeader>
16
       <NavHeader Title='业主认证' Color='#000'></NavHeader>
15
       <view className='centerLabel'>
17
       <view className='centerLabel'>
16
-        <text>请进行业主信息认证</text>
18
+        {
19
+          user !== null &&
20
+          <text className='Tips'>{user.verifyStatus === 'not_certified' ? '请进行业主信息认证' : user.verifyStatus === 'certification_in_progress' ? '业主认证中' : '业主验证未通过,请重新验证'}</text>
21
+        }
17
         <view>
22
         <view>
18
-          <text onClick={() => { Taro.navigateTo({ url: `/pages/WoDe/YeZhuRenZheng/index?from=popup` }) }}>去认证</text>
23
+          {
24
+            user !== null && user.verifyStatus !== 'certification_in_progress' &&
25
+            <text onClick={() => { Taro.navigateTo({ url: `/pages/WoDe/YeZhuRenZheng/index?from=popup` }) }}>去认证</text>
26
+          }
19
         </view>
27
         </view>
20
       </view>
28
       </view>
21
     </view>
29
     </view>

+ 1
- 1
src/components/RenZhengScreen/index.less Voir le fichier

10
   >view.centerLabel {
10
   >view.centerLabel {
11
     width: 100%;
11
     width: 100%;
12
 
12
 
13
-    >text {
13
+    text.Tips {
14
       display: block;
14
       display: block;
15
       font-size: 24px;
15
       font-size: 24px;
16
       color: #666;
16
       color: #666;

+ 10
- 2
src/pages/WoDe/YeZhuRenZheng/index.jsx Voir le fichier

65
       clearTimeout(CodeTimer)
65
       clearTimeout(CodeTimer)
66
       setCodeTimerNum(60)
66
       setCodeTimerNum(60)
67
     }
67
     }
68
+    return () => {
69
+      if (CodeTimer) {
70
+        clearTimeout(CodeTimer)
71
+      }
72
+    }
68
   }, [CodeTimerNum])
73
   }, [CodeTimerNum])
69
 
74
 
70
   const CheckPhone = () => { // 校验手机号
75
   const CheckPhone = () => { // 校验手机号
157
         }).then((res) => {
162
         }).then((res) => {
158
           Taro.showToast({ title: '添加认证成功', icon: 'none' })
163
           Taro.showToast({ title: '添加认证成功', icon: 'none' })
159
           if (PageFrom === 'popup') {
164
           if (PageFrom === 'popup') {
160
-            setUser({ ...user, verifyStatus: 'certification_in_progress' })
161
-            Taro.navigateBack({ delta: 1 })
165
+            // 获取审核详情
166
+            request({ ...apis.getRenZhengDetail, args: { id: res.id } }).then((cRes) => {
167
+              setUser({ ...user, verifyStatus: cRes.verifyStatus === 0 ? 'certification_in_progress' : cRes.verifyStatus === 1 ? 'certified' : 'certification_failed' })
168
+              Taro.navigateBack({ delta: 1 })
169
+            })
162
           } else {
170
           } else {
163
             Taro.navigateTo({ url: `/pages/WoDe/YeZhuShenHe/index?id=${res.id}` })
171
             Taro.navigateTo({ url: `/pages/WoDe/YeZhuShenHe/index?id=${res.id}` })
164
           }
172
           }