From 38cd76c5f05fd55855038e2d393074e27909c63d Mon Sep 17 00:00:00 2001
From: 闫增涛 <1829501689@qq.com>
Date: 星期五, 28 三月 2025 15:28:01 +0800
Subject: [PATCH] 剩余页面登录迁移

---
 pages/retrievalPage/index.js |  221 ++++++++++++++++++------------------------------------
 1 files changed, 75 insertions(+), 146 deletions(-)

diff --git a/pages/retrievalPage/index.js b/pages/retrievalPage/index.js
index 29f5b3d..fc8fd6c 100644
--- a/pages/retrievalPage/index.js
+++ b/pages/retrievalPage/index.js
@@ -1,6 +1,8 @@
 // pages/retrievalPage/index.js
 import request from '../../assets/request/index'
-
+import {
+  loginInfo
+} from '../../assets/js/login';
 import {
   handleQueryResourceListData
 } from '../../assets/js/middleGround/tool'
@@ -97,16 +99,16 @@
     }
     this.onTabsChange(e)
     // 妫�鏌ョ櫥褰曠姸鎬�
-    const token = wx.getStorageSync(app.config.tokenKey)
-    if (!token) {
-      loginInfo(app, (data) => {
-        if (data) {
-          this.getUserInfo()
-        }
-      })
-    } else {
-      this.getUserInfo()
-    }
+    // const token = wx.getStorageSync(app.config.tokenKey)
+    // if (!token) {
+    //   loginInfo(app, (data) => {
+    //     if (data) {
+    //       this.getUserInfo()
+    //     }
+    //   })
+    // } else {
+    //   this.getUserInfo()
+    // }
     var that = this;
     // 鍔ㄦ�佽幏鍙栧睆骞曢珮搴�
     wx.getSystemInfo({
@@ -178,13 +180,6 @@
   },
 
   /**
-   * 椤甸潰涓婃媺瑙﹀簳浜嬩欢鐨勫鐞嗗嚱鏁�
-   */
-  onReachBottom() {
-
-  },
-
-  /**
    * 鐢ㄦ埛鐐瑰嚮鍙充笂瑙掑垎浜�
    */
   onShareAppMessage() {},
@@ -240,7 +235,7 @@
       }
 
     }
-    let url = '/store/api/ApiQueryProductByAppUser'
+    let url = '/store/api/ApiQueryProduct'
     //鍥句功
     let queryBook = {
       AccessControl: {
@@ -355,8 +350,6 @@
       ...digitalTextbooksObj,
       ...fields
     }
-
-
     let seminarObj = {}
     if (this.data.searchVal) {
       seminarObj = {
@@ -523,6 +516,7 @@
       this.setData({
         loading: false,
         hidden: false,
+        isMore: false
       })
     })
     wx.stopPullDownRefresh()
@@ -640,7 +634,6 @@
   },
   onBookExhibitionDetails(e) {
     const item = e.currentTarget.dataset.item
-
     wx.navigateTo({
       url: '/pages/bookExhibitionDetails/index?id=' + item.id + '&bookName=' + item.name // 鍋囪璺宠浆鍒拌鎯呴〉闈紝骞朵紶閫掍簡id鍙傛暟
     });
@@ -650,152 +643,88 @@
   onPullDownRefresh() {
     console.log("涓嬫媺鍒锋柊...");
   },
-  /**
-   * 椤甸潰涓婃媺瑙﹀簳浜嬩欢鐨勫鐞嗗嚱鏁�
-   */
-  onReachBottom(e) {
-    if (this.data.tabValue == 0) {
-      if (this.data.bookData.length < this.data.bookTotal) {
-        this.setData({
-          isMore: true,
-          "pageCount.page": this.data.pageCount.page + 1
-        })
-        this.retrievalPageGet()
-      } else {
-        this.setData({
-          isMore: true,
-        })
-        setTimeout(() => {
-          this.setData({
-            isMore: false
-          })
-        }, 100)
-
-      }
-
-    } else if (this.data.tabValue == 1) {
-
-      if (this.data.courseData.length < this.data.courseTotal) {
-        this.setData({
-          isMore: true,
-          "pageCount.page": this.data.pageCount.page + 1
-        })
-        this.retrievalPageGet()
-      } else {
-        this.setData({
-          isMore: true,
-        })
-        setTimeout(() => {
-          this.setData({
-            isMore: false
-          })
-        }, 100)
-
-      }
-    } else if (this.data.tabValue == 2) {
-
-      if (this.data.digitalTextbooksData.length < this.data.digitalTextbooksTotal && this.data.digitalTextbooksData.length > 9) {
-        this.setData({
-          isMore: true,
-          "pageCount.page": this.data.pageCount.page + 1
-        })
-        this.retrievalPageGet()
-      } else {
-        this.setData({
-          isMore: true,
-        })
-        setTimeout(() => {
-          this.setData({
-            isMore: false
-          })
-        }, 100)
-
-      }
-    } else if (this.data.tabValue == 3) {
-      if (this.data.seminarData.length < this.data.seminarTotal) {
-        this.setData({
-          isMore: true,
-          "pageCount.page": this.data.pageCount.page + 1
-        })
-        this.retrievalPageGet()
-      } else {
-        this.setData({
-          isMore: true,
-        })
-        setTimeout(() => {
-          this.setData({
-            isMore: false
-          })
-        }, 100)
-      }
-    } else if (this.data.tabValue == 4) {
-      if (this.data.bookFairData.length < this.data.bookFairTotal) {
-        this.setData({
-          isMore: true,
-          "pageCount.page": this.data.pageCount.page + 1
-        })
-        this.bibliographyGet()
-      } else {
-        this.setData({
-          isMore: true,
-        })
-        setTimeout(() => {
-          this.setData({
-            isMore: false
-          })
-        }, 100)
-      }
-    } else if (this.data.tabValue == 5) {
-      if (this.data.biblioClassificationData.length < this.data.biblioClassificationTotal) {
-        this.setData({
-          isMore: true,
-          "pageCount.page": this.data.pageCount.page + 1
-        })
-        this.retrievalPageGet()
-      } else {
-        this.setData({
-          isMore: true,
-        })
-        setTimeout(() => {
-          this.setData({
-            isMore: false
-          })
-        }, 100)
-      }
-    }
-  },
 
   // 涓嬫媺鍑芥暟
   onPullDownRefresh() {
     if (this.data.tabValue == 4) {
       this.setData({
+        bookFairData: [],
         "pageCount.page": 1
       })
       this.bibliographyGet()
     } else {
       this.setData({
+        bookData: [],
+        courseData: [],
+        digitalTextbooksData: [],
+        seminarData: [],
+        biblioClassificationData: [],
         "pageCount.page": 1
       })
       this.retrievalPageGet()
     }
   },
 
-  underConstruction() {
-    wx.showToast({
-      title: "寤鸿涓�",
-      icon: 'none',
-      duration: 1000
+  underConstruction(e) {
+    const {
+      book
+    } = e.currentTarget.dataset;
+    console.log(book);
+    wx.navigateTo({
+      url: '/pages/digitalCourses/digitalCoursesDetails/index?id=' + book.id + '&path=' + book.idPath,
+    });
+  },
+  goTextBookDetail(e) {
+    const {
+      item
+    } = e.currentTarget.dataset;
+    wx.navigateTo({
+      url: '/pages/digitalTextbooks/digitalTextbooksDetails/index?id=' + item.id,
+    });
+  },
+  goSubjectDetail(e) {
+    // return wx.showToast({
+    //   title: "寤鸿涓�",
+    //   icon: 'none',
+    //   duration: 1000
+    // })
+    const item = e.currentTarget.dataset.item
+    // 缃戦〉绫诲瀷璺宠浆鍒扮綉鍧�澶嶅埗椤碉紝鍥犱负url浼犲弬涓嶈兘浼� 甯﹀弬鏁扮殑缃戠粶鍦板潃锛屾墍浠ユ澶勮鎶婄綉缁滃湴鍧�閲岀殑浼犲弬鎽樺嚭鏉ワ紝鏀惧埌url閲�
+    let urlData = ''
+    const flags = item.jsek_link.indexOf("?")
+    if (flags > -1) {
+      urlData = item.jsek_link.slice(flags + 1, item.jsek_link.length)
+    }
+    let url = '/packageBookService/pages/bookServices/linkPage/index'
+    wx.navigateTo({
+      url: urlData ? url + `?path=${item.jsek_link.slice(0,flags)}` + '&' + urlData : url + `?path=${item.jsek_link}`
     })
+
   },
   // 閭鐐瑰嚮
   mailbox(e) {
     const key = e.currentTarget.dataset.key;
     const item = e.currentTarget.dataset.item;
-    this.setData({
-      [key]: true,
-      dialogKey: key,
-      Md5: item.datas.freeFile.FileList[0].Md5
-    });
+    const token = wx.getStorageSync(app.config.tokenKey)
+    if (!token) {
+      loginInfo(app, (data) => {
+        if (data) {
+          this.getUserInfo()
+          this.setData({
+            [key]: true,
+            dialogKey: key,
+            Md5: item.datas.freeFile.FileList[0].Md5
+          });
+        }
+      })
+    } else {
+      this.getUserInfo()
+      this.setData({
+        [key]: true,
+        dialogKey: key,
+        Md5: item.datas.freeFile.FileList[0].Md5
+      });
+    }
   },
   //閭鐨勬牎楠�
   onEmailInput(e) {

--
Gitblit v1.9.1