张延森 3 lat temu
rodzic
commit
2d16689fb0
1 zmienionych plików z 6 dodań i 3 usunięć
  1. 6
    3
      src/components/Authorize/AuthProfile.jsx

+ 6
- 3
src/components/Authorize/AuthProfile.jsx Wyświetl plik

5
 export default function (props) {
5
 export default function (props) {
6
   const { person, dogs: pets } = useModel('userData')
6
   const { person, dogs: pets } = useModel('userData')
7
 
7
 
8
-  const show = !person || !person.phone || !pets || !pets.length
9
-  const message = !person.phone ? '请先维护个人信息' : '请先维护狗狗信息'
8
+  const noPerson = !person || !person.phone
9
+  const noPet = !pets || !pets.length
10
+
11
+  const show = noPerson || noPet
12
+  const message = noPerson ? '请先维护个人信息' : '请先维护狗狗信息'
10
 
13
 
11
   const handleTap = () => {
14
   const handleTap = () => {
12
     if (!show) return;
15
     if (!show) return;
13
-    const url = !person || !person.phone ? '/pages/setUser/index' : '/pages/setDogInfo/index'
16
+    const url = noPerson ? '/pages/setUser/index' : '/pages/setDogInfo/index'
14
     Taro.navigateTo({ url })
17
     Taro.navigateTo({ url })
15
   }
18
   }
16
 
19