From e060ad2b2da9884e00b36796548eacc6a2b9a5d3 Mon Sep 17 00:00:00 2001
From: 闫增涛 <1829501689@qq.com>
Date: 星期五, 29 三月 2024 09:44:30 +0800
Subject: [PATCH] 图书详情,列表页bug修改

---
 packageBookService/pages/bookServices/list/index.js |  110 ++++++++++++++++++++++++++++++++++---------------------
 1 files changed, 68 insertions(+), 42 deletions(-)

diff --git a/packageBookService/pages/bookServices/list/index.js b/packageBookService/pages/bookServices/list/index.js
index 656c94b..5cd1be5 100644
--- a/packageBookService/pages/bookServices/list/index.js
+++ b/packageBookService/pages/bookServices/list/index.js
@@ -1,4 +1,7 @@
 const app = getApp();
+import {
+  loginInfo
+} from '../../../../assets/js/login';
 Page({
   /**
    * 椤甸潰鐨勫垵濮嬫暟鎹�
@@ -21,17 +24,17 @@
     bookList: [],
     stairList: {
       value: '',
-      options: [
-        {
-          value: '',
-          label: '涓�绾�',
-        },
-      ],
+      options: [{
+        value: '',
+        label: '涓�绾�',
+      }, ],
     },
     secondList: {
       value: [],
       options: [],
+      disabled: false,
     },
+    disabledSecondList: false,
     majorProjectList: {
       value: [],
       options: [],
@@ -48,7 +51,8 @@
       size: '50rpx'
     },
     loading: false,
-    noData: false
+    noData: false,
+    showDropdown: false,
   },
   /**
    * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇
@@ -95,8 +99,7 @@
           Path: options.secondCode,
           Type: '*',
           StoreRefCode: app.config.goodsStore,
-        }
-        ],
+        }],
       })
     }
     // 鑾峰彇浜岀骇鍒嗙被
@@ -110,24 +113,22 @@
   /**
    * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍒濇娓叉煋瀹屾垚
    */
-  onReady() {
-  },
+  onReady() {},
 
   /**
    * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鏄剧ず
    */
-  onShow() {
-  },
+  onShow() {},
 
   /**
    * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰闅愯棌
    */
-  onHide() { },
+  onHide() {},
 
   /**
    * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍗歌浇
    */
-  onUnload() { },
+  onUnload() {},
 
   /**
    * 椤甸潰鐩稿叧浜嬩欢澶勭悊鍑芥暟--鐩戝惉鐢ㄦ埛涓嬫媺鍔ㄤ綔
@@ -163,7 +164,7 @@
   /**
    * 鐢ㄦ埛鐐瑰嚮鍙充笂瑙掑垎浜�
    */
-  onShareAppMessage() { },
+  onShareAppMessage() {},
   goBack() {
     wx.navigateBack();
   },
@@ -177,15 +178,16 @@
       size: '30',
       start: '0',
       storeRefCode: app.config.goodsStore,
-      sort: { type: 'Asc', field: 'LinkOrder' },
+      sort: {
+        type: 'Asc',
+        field: 'LinkOrder'
+      },
     };
     app.MG.store.getStoreChannelList(query).then(async (res) => {
-      const options = [
-        {
-          value: '',
-          label: '涓�绾�',
-        },
-      ];
+      const options = [{
+        value: '',
+        label: '涓�绾�',
+      }, ];
       for (let index = 0; index < res.datas.length; index++) {
         const item = res.datas[index];
         options.push({
@@ -210,7 +212,10 @@
       size: '30',
       start: '0',
       storeRefCode: app.config.goodsStore,
-      sort: { type: 'Asc', field: 'LinkOrder' },
+      sort: {
+        type: 'Asc',
+        field: 'LinkOrder'
+      },
     };
     app.MG.store.getStoreChannelList(query).then((res) => {
       for (let index = 0; index < res.datas.length; index++) {
@@ -287,7 +292,7 @@
         subAccess: this.data.pathList,
       };
     } else {
-      pathObj = { 
+      pathObj = {
         path,
         queryType: '*',
       };
@@ -315,16 +320,11 @@
     }
     const query = {
       ...pathObj,
-      filterList: [
-        {
-          value: 'Normal',
-          field: 'state',
-        },
-      ],
+      filterList: [{
+        value: 'Normal',
+        field: 'state',
+      }, ],
       sort,
-      coverSize: {
-        height: 145,
-      },
       paging: {
         start: 0,
         size: this.data.pageCount.page * 8,
@@ -344,19 +344,19 @@
         "pageCount.total": res.total,
         loading: false
       });
-      console.log('鍥句功鍒楄〃', res.datas);
       if (!res.datas.length) {
         this.setData({
-          noData: true
+          noData: true,
         })
       }
     });
   },
   // 涓�绾у垎绫诲垏鎹�
   onChangeStair(e) {
-    const path = e.detail.value.length
-      ? `${this.data.assortCheck.code}\\${e.detail.value}`
-      : this.data.assortCheck.code;
+    const path = e.detail.value.length ?
+      `${this.data.assortCheck.code}\\${e.detail.value}` :
+      this.data.assortCheck.code;
+    console.log(this.data.path);
     this.setData({
       pathList: [],
       stairCode: e.detail.value,
@@ -366,6 +366,16 @@
     });
     this.getBookList(path);
     this.getSecondList(path);
+    if (e.detail.value == '') {
+      this.setData({
+        disabledSecondList: true
+      })
+    } else {
+      this.setData({
+        disabledSecondList: false
+      })
+    }
+    console.log(this.data.disabledSecondList);
   },
   // 浜岀骇鍒嗙被鍒囨崲
   onChangeSecond(e) {
@@ -451,13 +461,29 @@
   },
   // 璺宠浆鍥句功璇︽儏
   goDetail(e) {
-    const { book } = e.currentTarget.dataset;
+    const {
+      book
+    } = e.currentTarget.dataset;
     wx.navigateTo({
       url: `/packageBookService/pages/bookServices/detail/index?id=${book.id}&name=${book.name}`,
     });
   },
   onRefresh() {
-    this.setData({ enable: true });
+    this.setData({
+      enable: true
+    });
     this.getBookList(this.data.path)
   },
-});
+  openDropdown() {
+    console.log('灞曞紑鍝�', );
+    this.setData({
+      showDropdown: true
+    })
+  },
+  closeDropdown() {
+    console.log('鍏抽棴');
+    this.setData({
+      showDropdown: false
+    })
+  }
+});
\ No newline at end of file

--
Gitblit v1.9.1