Browse Source

静态页面

1002884655 4 years ago
parent
commit
a7b6900c48
2 changed files with 46 additions and 11 deletions
  1. 34
    1
      project.config.json
  2. 12
    10
      src/pages/WuYe/index.jsx

+ 34
- 1
project.config.json View File

41
 	"compileType": "miniprogram",
41
 	"compileType": "miniprogram",
42
 	"simulatorType": "wechat",
42
 	"simulatorType": "wechat",
43
 	"simulatorPluginLibVersion": {},
43
 	"simulatorPluginLibVersion": {},
44
-	"condition": {}
44
+	"condition": {
45
+		"search": {
46
+			"current": -1,
47
+			"list": []
48
+		},
49
+		"conversation": {
50
+			"current": -1,
51
+			"list": []
52
+		},
53
+		"plugin": {
54
+			"current": -1,
55
+			"list": []
56
+		},
57
+		"game": {
58
+			"current": -1,
59
+			"list": []
60
+		},
61
+		"gamePlugin": {
62
+			"current": -1,
63
+			"list": []
64
+		},
65
+		"miniprogram": {
66
+			"current": -1,
67
+			"list": [
68
+				{
69
+					"id": -1,
70
+					"name": "pages/WuYe/index",
71
+					"pathName": "pages/WuYe/index",
72
+					"query": "type=4",
73
+					"scene": null
74
+				}
75
+			]
76
+		}
77
+	}
45
 }
78
 }

+ 12
- 10
src/pages/WuYe/index.jsx View File

22
   const [PageReset, setPageReset] = useState(false)
22
   const [PageReset, setPageReset] = useState(false)
23
 
23
 
24
   useDidShow(() => {
24
   useDidShow(() => {
25
-    if (user.verifyStatus !== 'certified') {
25
+    if (user !== null && user.verifyStatus !== 'certified') {
26
       Taro.login({
26
       Taro.login({
27
         success: res => {
27
         success: res => {
28
           if (res.errMsg === 'login:ok') {
28
           if (res.errMsg === 'login:ok') {
49
   })
49
   })
50
 
50
 
51
   useEffect(() => {
51
   useEffect(() => {
52
-    if (user.verifyStatus === 'certified') {
53
-      if (CurrentNavId === null) {
54
-        if (Taro.getStorageSync('WuYeNavId')) {
55
-          setCurrentNavId(Taro.getStorageSync('WuYeNavId') - 0)
52
+    if (user !== null) {
53
+      if (user.verifyStatus === 'certified') {
54
+        if (CurrentNavId === null) {
55
+          if (Taro.getStorageSync('WuYeNavId')) {
56
+            setCurrentNavId(Taro.getStorageSync('WuYeNavId') - 0)
57
+          } else {
58
+            setCurrentNavId(1)
59
+          }
56
         } else {
60
         } else {
57
-          setCurrentNavId(1)
58
-        }
59
-      } else {
60
-        if (CurrentNavId - 0 === 3) {
61
-          setPageReset(true)
61
+          if (CurrentNavId - 0 === 3) {
62
+            setPageReset(true)
63
+          }
62
         }
64
         }
63
       }
65
       }
64
     }
66
     }