xcx 4 年 前
コミット
8ac2b5d0ed
共有4 個のファイルを変更した67 個の追加9 個の削除を含む
  1. 38
    0
      src/components/RenZhengScreen/index.css
  2. 18
    3
      src/components/RenZhengScreen/index.jsx
  3. 5
    1
      src/components/RenZhengScreen/index.less
  4. 6
    5
      src/layouts/index.jsx

+ 38
- 0
src/components/RenZhengScreen/index.css ファイルの表示

@@ -0,0 +1,38 @@
1
+.RenZhengScreen {
2
+  width: 100%;
3
+  position: fixed !important;
4
+  left: 0;
5
+  top: 0;
6
+  bottom: 0;
7
+  z-index: 300000;
8
+  background: #fff;
9
+}
10
+.RenZhengScreen > view.centerLabel {
11
+  width: 100%;
12
+}
13
+.RenZhengScreen > view.centerLabel text.Tips {
14
+  display: block;
15
+  font-size: 32px;
16
+  color: #666;
17
+  line-height: 60px;
18
+  text-align: center;
19
+}
20
+.RenZhengScreen > view.centerLabel > view {
21
+  padding: 0 30px;
22
+  position: relative;
23
+  overflow: hidden;
24
+  margin-top: 40px;
25
+}
26
+.RenZhengScreen > view.centerLabel > view > text {
27
+  display: block;
28
+  font-size: 28px;
29
+  color: #fff;
30
+  background: #ccc;
31
+  line-height: 80px;
32
+  text-align: center;
33
+  border-radius: 10px;
34
+  margin-bottom: 40px;
35
+}
36
+.RenZhengScreen > view.centerLabel > view > text.active {
37
+  background: #f35844;
38
+}

+ 18
- 3
src/components/RenZhengScreen/index.jsx ファイルの表示

@@ -2,6 +2,7 @@ import React, { useState } from 'react'
2 2
 import NavHeader from '@/components/NavHeader/index'
3 3
 import Taro from '@tarojs/taro'
4 4
 import { useModel } from '@/store'
5
+import request, { apis } from '@/utils/request'
5 6
 import '@/assets/css/reset.less'
6 7
 import '@/assets/css/iconfont.less'
7 8
 import './index.less'
@@ -9,7 +10,20 @@ import './index.less'
9 10
 export default function RenZhengScreen (props) {
10 11
 
11 12
   const { Show = false } = props
12
-  const { user } = useModel('user')
13
+  const { user, setUser } = useModel('user')
14
+  const [DataLock, setDataLock] = useState(false)
15
+
16
+  const RefreshUserInfo = () => {
17
+    if (DataLock) return
18
+    setDataLock(true)
19
+    request({ ...apis.getUserInfo }).then((res) => {
20
+      setUser({ ...user, ...res })
21
+      setDataLock(false)
22
+    }).catch((res) => {
23
+      setDataLock(false)
24
+      Taro.showToast({ title: res, icon: 'none' })
25
+    })
26
+  }
13 27
 
14 28
   return (
15 29
     <view className='RenZhengScreen' style={{ display: Show ? 'block' : 'none' }}>
@@ -17,13 +31,14 @@ export default function RenZhengScreen (props) {
17 31
       <view className='centerLabel'>
18 32
         {
19 33
           user !== null &&
20
-          <text className='Tips'>{user.verifyStatus === 'not_certified' ? '请进行业主信息认证' : user.verifyStatus === 'certification_in_progress' ? '业主认证中,请等待物业审核' : user.verifyStatus === 'certified' ? '未授权手机号' : '业主验证未通过,请重新验证'}</text>
34
+          <text className='Tips'>{user.verifyStatus === 'not_certified' ? '请进行业主信息认证' : user.verifyStatus === 'certification_in_progress' ? '业主认证中,请等待物业审核' : '业主验证未通过,请重新验证'}</text>
21 35
         }
22 36
         <view>
23 37
           {
24 38
             user !== null && user.verifyStatus !== 'certification_in_progress' && user.verifyStatus !== 'certified' &&
25
-            <text onClick={() => { Taro.navigateTo({ url: `/pages/WoDe/YeZhuRenZheng/index?from=popup` }) }}>去认证</text>
39
+            <text onClick={() => { Taro.navigateTo({ url: `/pages/WoDe/YeZhuRenZheng/index?from=popup` }) }} className='active'>去认证</text>
26 40
           }
41
+          {/* <text onClick={RefreshUserInfo} className={DataLock ? '' : 'active'}>{DataLock ? '正在刷新...' : '刷新人员信息'}</text> */}
27 42
         </view>
28 43
       </view>
29 44
     </view>

+ 5
- 1
src/components/RenZhengScreen/index.less ファイルの表示

@@ -28,10 +28,14 @@
28 28
         display: block;
29 29
         font-size: 28px;
30 30
         color: #fff;
31
-        background: #f35844;
31
+        background: #ccc;
32 32
         line-height: 80px;
33 33
         text-align: center;
34 34
         border-radius: 10px;
35
+        margin-bottom: 40px;
36
+        &.active {
37
+          background: #f35844;
38
+        }
35 39
       }
36 40
     }
37 41
   }

+ 6
- 5
src/layouts/index.jsx ファイルの表示

@@ -48,6 +48,7 @@ export default function (props) {
48 48
     setIsAuthedBasic(user && user.avatarurl && user.nickname)
49 49
     setIsAuthedPhone(user && user.phone)
50 50
     setIsAuthedYeZhu(user && user.verifyStatus === 'certified')
51
+    setShowAuthYeZhu(user && (user.verifyStatus === 'not_certified' || user.verifyStatus === 'certification_in_progress' || user.verifyStatus === 'certification_failed'))
51 52
   }, [user])
52 53
 
53 54
   useEffect(() => {
@@ -75,11 +76,11 @@ export default function (props) {
75 76
       return
76 77
     }
77 78
 
78
-    if (isAuthedPhone && !isAuthedYeZhu && needAuthYeZhu) {
79
-      setShowAuthYeZhu(true)
80
-    } else {
81
-      setShowAuthYeZhu(false)
82
-    }
79
+    // if (isAuthedPhone && !isAuthedYeZhu && needAuthYeZhu) {
80
+    //   setShowAuthYeZhu(true)
81
+    // } else {
82
+    //   setShowAuthYeZhu(false)
83
+    // }
83 84
   }, [needAuthYeZhu, isAuthedPhone, page])
84 85
 
85 86
   // 授权头像