From ebfc641a1a1bc6c40b8010f31f7a836f09308b6e Mon Sep 17 00:00:00 2001
From: litian <C21AF165>
Date: 星期三, 27 三月 2024 11:04:19 +0800
Subject: [PATCH] 样式修改

---
 packageDomain/pages/sampleBookList/index.js |   66 ++++++++++++++++++++++++---------
 1 files changed, 48 insertions(+), 18 deletions(-)

diff --git a/packageDomain/pages/sampleBookList/index.js b/packageDomain/pages/sampleBookList/index.js
index ab27b30..4634442 100644
--- a/packageDomain/pages/sampleBookList/index.js
+++ b/packageDomain/pages/sampleBookList/index.js
@@ -132,6 +132,20 @@
         userInfo: JSON.parse(wx.getStorageSync(app.config.userInfoKey))
       })
     }
+
+  },
+
+  /**
+   * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍒濇娓叉煋瀹屾垚
+   */
+  onReady() {
+
+  },
+
+  /**
+   * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鏄剧ず
+   */
+  onShow() {
     if (wx.getStorageSync("paperBookList")) {
       this.setData({
         paperBookList: wx.getStorageSync("paperBookList"),
@@ -146,20 +160,6 @@
       num: this.data.paperBookList.length + this.data.electronicBookList.length
     })
     this.getBookList(false);
-  },
-
-  /**
-   * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍒濇娓叉煋瀹屾垚
-   */
-  onReady() {
-
-  },
-
-  /**
-   * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鏄剧ず
-   */
-  onShow() {
-
   },
   goBack() {
     wx.navigateBack();
@@ -621,7 +621,6 @@
         this.setData({
           alreadyElectronicBookList: list,
         });
-        this.getBookList(false);
       }
     })
   },
@@ -885,7 +884,14 @@
       if (this.data.ebookCount > 0) {
         const eBookData = this.data.electronicBookList
         if (eBookData.length == 2) {
-          item.electronChecked = false
+          if (this.data.bookList.length > 0) {
+            this.data.bookList.forEach(i => {
+              if (i.id == item.id) {
+                i.electronChecked = false;
+              }
+            })
+          }
+          item.electronChecked = false;
           wx.showToast({
             title: "姣忔鏈�澶氬彧鍙敵璇�2鏈牱涔�",
             icon: 'none',
@@ -907,9 +913,11 @@
             })
             this.setData({
               electronicBookList: [...this.data.electronicBookList, ...[itemAttr]],
-              num: this.data.electronicBookList.length + this.data.paperBookList.length
             })
             wx.setStorageSync("electronicBookList", this.data.electronicBookList);
+            this.setData({
+              num: this.data.electronicBookList.length + this.data.paperBookList.length
+            })
           } else {
             let list = this.data.electronicBookList;
             list.forEach((obj, index) => {
@@ -953,6 +961,13 @@
       if (this.data.paperBookCount > 0) {
         const pBookData = this.data.paperBookList
         if (pBookData.length == 2) {
+          if (this.data.bookList.length > 0) {
+            this.data.bookList.forEach(i => {
+              if (i.id == item.id) {
+                i.paperChecked = false;
+              }
+            })
+          }
           item.paperChecked = false
           wx.showToast({
             title: "姣忔鏈�澶氬彧鍙敵璇�2鏈牱涔�",
@@ -976,9 +991,11 @@
             })
             this.setData({
               paperBookList: [...this.data.paperBookList, ...[itemAttr]],
-              num: this.data.paperBookList.lenght + this.data.electronicBookList.length
             })
             wx.setStorageSync("paperBookList", this.data.paperBookList);
+            this.setData({
+              num: this.data.paperBookList.length + this.data.electronicBookList.length
+            })
           } else {
             let list = this.data.paperBookList;
             list.forEach((obj, index) => {
@@ -1027,6 +1044,19 @@
       url: "/packageDomain/pages/sampleBookList/applicationForm/index",
     });
   },
+
+  // 鐩戝惉婊氬姩璺濈
+  onPageScroll(e) {
+    if (e && e.scrollTop >= 1000) {
+      this.setData({
+        isBackTop: true
+      })
+    } else {
+      this.setData({
+        isBackTop: false
+      })
+    }
+  },
   /**
    * 鐢ㄦ埛鐐瑰嚮鍙充笂瑙掑垎浜�
    */

--
Gitblit v1.9.1