From ea3fb7a2d5841cf03d87c3e52f327fb0bb9553a5 Mon Sep 17 00:00:00 2001
From: QYF-GitLab1 <1940665526@qq.com>
Date: 星期四, 31 七月 2025 15:22:02 +0800
Subject: [PATCH] 去掉首页教师认证、修改样书申请登录申请登录位置

---
 packageDomain/pages/sampleBookList/index.js |   59 ++++++++++++++++++++++-------
 services/home/home.js                       |   12 +++---
 2 files changed, 50 insertions(+), 21 deletions(-)

diff --git a/packageDomain/pages/sampleBookList/index.js b/packageDomain/pages/sampleBookList/index.js
index 2db2783..d2f6dd7 100644
--- a/packageDomain/pages/sampleBookList/index.js
+++ b/packageDomain/pages/sampleBookList/index.js
@@ -167,24 +167,31 @@
    */
   onShow() {
     let that = this;
+    that.getAlreadyPBookList()
+    that.getAlreadyEBookList()
+
     const token = wx.getStorageSync(app.config.tokenKey)
-    if (!token) {
-      loginInfo(app, (data) => {
-        if (data) {
-          that.setData({
-            userInfo: JSON.parse(wx.getStorageSync(app.config.userInfoKey))
-          })
-          that.getAlreadyPBookList()
-          that.getAlreadyEBookList()
-          that.getSelectPaperBookCount()
-          that.getSelectBookCount()
-        } else {
-          wx.switchTab({
-            url: '/pages/home/home',
-          })
-        }
+    if (token) {
+      that.setData({
+        userInfo: JSON.parse(wx.getStorageSync(app.config.userInfoKey))
       })
+      that.getSelectPaperBookCount()
+      that.getSelectBookCount()
     }
+    // if (!token) {
+    //   loginInfo(app, (data) => {
+    //     if (data) {
+    //       that.setData({
+    //         userInfo: JSON.parse(wx.getStorageSync(app.config.userInfoKey))
+    //       })
+
+    //     } else {
+    //       wx.switchTab({
+    //         url: '/pages/home/home',
+    //       })
+    //     }
+    //   })
+    // }
     if (wx.getStorageSync("paperBookList") || wx.getStorageSync("electronicBookList")) {
       if (wx.getStorageSync("paperBookList")) {
         that.setData({
@@ -739,6 +746,17 @@
   onChangePaper(e) {
     const item = e.currentTarget.dataset.book;
     const index = this.data.bookList.findIndex(citem => citem.id == item.id)
+    const token = wx.getStorageSync(app.config.tokenKey)
+    if (!token) {
+      loginInfo(app, (data) => {
+        if (data) {
+          wx.redirectTo({
+            url: '/packageDomain/pages/sampleBookList/index',
+          })
+        }
+      })
+      return false;
+    }
     let role = this.data.userInfo != null ? this.data.userInfo.role : null
     if (role && role == 'Teacher') {
       // 鏄暀甯�
@@ -805,6 +823,17 @@
   async onChangeElectron(e) {
     const item = e.currentTarget.dataset.book;
     const index = this.data.bookList.findIndex(citem => citem.id == item.id)
+    const token = wx.getStorageSync(app.config.tokenKey)
+    if (!token) {
+      loginInfo(app, (data) => {
+        if (data) {
+          wx.redirectTo({
+            url: '/packageDomain/pages/sampleBookList/index',
+          })
+        }
+      })
+      return false;
+    }
     let role = this.data.userInfo != null ? this.data.userInfo.role : null
     if (role && role == 'Teacher') {
       // 鏄暀甯�
diff --git a/services/home/home.js b/services/home/home.js
index bf3c094..ba65ebb 100644
--- a/services/home/home.js
+++ b/services/home/home.js
@@ -49,12 +49,12 @@
           icon: '/static/images/home/shumuxiazai@2x.png',
           url: '/pages/bibliographyList/index',
         },
-        {
-          text: '鏁欏笀璁よ瘉',
-          key: 7,
-          icon: '/static/images/home/jiaoshirenzheng@2x.png',
-          url: '/packageDomain/pages/teacherCertification/index',
-        },
+        // {
+        //   text: '鏁欏笀璁よ瘉',
+        //   key: 7,
+        //   icon: '/static/images/home/jiaoshirenzheng@2x.png',
+        //   url: '/packageDomain/pages/teacherCertification/index',
+        // },
         {
           text: '鏍蜂功鐢宠',
           key: 8,

--
Gitblit v1.9.1