Pārlūkot izejas kodu

更新 首页提示

wzh 3 gadi atpakaļ
vecāks
revīzija
7682f7556f
1 mainītis faili ar 16 papildinājumiem un 3 dzēšanām
  1. 16 3
      miniprogram/pages/index/index.js

+ 16 - 3
miniprogram/pages/index/index.js

@@ -13,9 +13,22 @@ Page({
     let res = await postApi('/index', {
       loginAccountId: wx.getStorageSync('loginAccountId'),
     })
-    this.setData({
-      indexInfo: res.data.result
-    })
+    if (res.data.status == 0) {
+      this.setData({
+        indexInfo: res.data.result
+      })
+    } else if (res.data.status == 1) {
+      wx.showToast({
+        title: '暂无数据',
+        icon: "error"
+      })
+    } else if (res.data.status == 2) {
+      wx.showToast({
+        title: '尚未登录',
+        icon: "error"
+      })
+    }
+
   },
   forbidTouchMove() {