From c96612e8a63ecef9590be0f8b5199277ec94e5b9 Mon Sep 17 00:00:00 2001
From: 闫增涛 <1829501689@qq.com>
Date: 星期三, 18 九月 2024 18:43:12 +0800
Subject: [PATCH] 云学习购买目录,修改bug

---
 packageDomain/pages/sampleBookList/index.js |   43 +++++++++++++++++++++++++++++--------------
 1 files changed, 29 insertions(+), 14 deletions(-)

diff --git a/packageDomain/pages/sampleBookList/index.js b/packageDomain/pages/sampleBookList/index.js
index 73a2f74..86387b0 100644
--- a/packageDomain/pages/sampleBookList/index.js
+++ b/packageDomain/pages/sampleBookList/index.js
@@ -84,6 +84,7 @@
     num: 0,
     x: 280,
     y: 300,
+    scrollTop: 0
   },
 
   /**
@@ -152,14 +153,17 @@
           // 鑾峰彇鐢宠娆℃暟
           that.getSelectPaperBookCount()
           that.getSelectBookCount()
-
         }
       })
     } else {
       that.setData({
         userInfo: JSON.parse(wx.getStorageSync(app.config.userInfoKey))
       })
-
+      const paperBookList = wx.getStorageSync('paperBookList') ? JSON.parse(wx.getStorageSync('paperBookList')).length : 0
+      const electronicBookList = wx.getStorageSync('electronicBookList') ? JSON.parse(wx.getStorageSync('electronicBookList')).length : 0
+      this.setData({
+        num: paperBookList + electronicBookList
+      })
     }
   },
 
@@ -201,6 +205,17 @@
       })
     }
     that.getBookList(false);
+  },
+  onHide() {
+    const query = wx.createSelectorQuery()
+    query.select('#scrollView').scrollOffset(res => {
+      console.log(1, res);
+      this.setData({
+        scrollTop: res.scrollTop
+      })
+      console.log('闅愯棌', this.data.scrollTop);
+    }).exec()
+
   },
   goBack() {
     wx.navigateBack();
@@ -348,9 +363,6 @@
   // 鑾峰彇鍥句功鍒楄〃
   getBookList(isReachBottom) {
     let that = this;
-    this.setData({
-      skeletonLoding: true
-    })
     let sort;
     let pathObj = {};
     if (that.data.pathList.length) {
@@ -512,11 +524,14 @@
   //楂樼骇鍒嗙被閫夋嫨
   onChangeIcon(e) {
     this.setData({
+      skeletonLoding: true,
+      bookList: [],
       'assortCheck.code': e.detail.value,
       stairCode: '',
       secondCode: '',
       path: `${e.detail.value}`,
       'iconList.value': e.detail.value,
+
     });
     this.getBookList(false);
     this.getStairList(this.data.assortCheck.code);
@@ -528,6 +543,8 @@
       `${this.data.assortCheck.code}\\${e.detail.value}` :
       this.data.assortCheck.code;
     this.setData({
+      skeletonLoding: true,
+      bookList: [],
       pathList: [],
       stairCode: e.detail.value,
       secondCode: '',
@@ -538,8 +555,8 @@
     this.getBookList(false);
     this.getSecondList(path);
   },
-  // 浜岀骇鍒嗙被鍒囨崲
-  onChangeSecond(e) {
+  // 浜岀骇鍒嗙被鍒囨崲 
+  onConfirmSecond(e) {
     const pathList = [];
     for (let index = 0; index < e.detail.value.length; index++) {
       const element = e.detail.value[index];
@@ -550,17 +567,16 @@
       });
     }
     this.setData({
+      skeletonLoding: true,
       pathList: pathList,
       'secondList.value': e.detail.value,
     });
-
-  },
-  // 
-  onConfirmSecond() {
     this.getBookList(false);
   },
   onResetSecond() {
     this.setData({
+      skeletonLoding: true,
+      pathList: [],
       'secondList.value': [],
     });
     this.getBookList(false);
@@ -949,7 +965,6 @@
   /**
    * 鐢ㄦ埛鐐瑰嚮鍙充笂瑙掑垎浜�
    */
-  onShareAppMessage() {
-
-  }
+  onShareAppMessage() {},
+  onShareTimeline() {},
 })
\ No newline at end of file

--
Gitblit v1.9.1