From d00d7f8ba2dfed17984aa5d41c7694c24d9d198a Mon Sep 17 00:00:00 2001
From: 闫增涛 <1829501689@qq.com>
Date: 星期三, 22 一月 2025 17:23:34 +0800
Subject: [PATCH] 春节公告

---
 packageBookService/pages/bookServices/list/index.js |   99 +++++++++++++++++++++++++++++++------------------
 1 files changed, 63 insertions(+), 36 deletions(-)

diff --git a/packageBookService/pages/bookServices/list/index.js b/packageBookService/pages/bookServices/list/index.js
index f57e643..99c8595 100644
--- a/packageBookService/pages/bookServices/list/index.js
+++ b/packageBookService/pages/bookServices/list/index.js
@@ -131,7 +131,7 @@
     // 鑾峰彇浜岀骇鍒嗙被
     this.getSecondList(`${options.assortCode}\\${options.stairCode}`);
     this.getBookList(`${options.assortCode}\\${options.stairCode}`);
-    // 鑾峰彇閲嶇偣椤圭洰
+    // 鑾峰彇鑾峰鎯呭喌
     this.getProjectList("bookClassification");
     this.getProjectList("newFormsTextbooks");
   },
@@ -200,6 +200,7 @@
    * 鐢ㄦ埛鐐瑰嚮鍙充笂瑙掑垎浜�
    */
   onShareAppMessage() {},
+  onShareTimeline() {},
   goBack() {
     wx.navigateBack();
   },
@@ -245,7 +246,7 @@
     });
   },
   // 鑾峰彇涓�绾у垎绫讳笅浜岀骇鍒嗙被
-  getSecondList(path) {
+  async getSecondList(path) {
     const options = [];
     const query = {
       path,
@@ -260,16 +261,7 @@
         field: "LinkOrder",
       },
     };
-    app.MG.store.getStoreChannelList(query).then((res) => {
-      if (!res.datas.length) {
-        this.setData({
-          disabledSecondList: true,
-        });
-      } else {
-        this.setData({
-          disabledSecondList: false,
-        });
-      }
+    await app.MG.store.getStoreChannelList(query).then((res) => {
       for (let index = 0; index < res.datas.length; index++) {
         const item = res.datas[index];
         options.push({
@@ -281,12 +273,13 @@
         "secondList.options": options,
       });
       const second = [this.data.secondCode];
+      console.log(second);
       this.setData({
         "secondList.value": second,
       });
     });
   },
-  // 鑾峰彇閲嶇偣椤圭洰
+  // 鑾峰彇鑾峰鎯呭喌
   getProjectList(type) {
     this.setData({
       disabledProject: false,
@@ -343,7 +336,7 @@
         this.setData({
           "newTextBook.options": options,
         });
-        console.log("閲嶇偣椤圭洰", this.data.newTextBook);
+        console.log("鑾峰鎯呭喌", this.data.newTextBook);
       }
     });
   },
@@ -419,6 +412,7 @@
         "||author*": this.data.searchValue,
         "||isbn*": this.data.searchValue,
         "||seriesName*": this.data.searchValue,
+        "||projectLeader*": this.data.searchValue
       };
     }
     const query = {
@@ -428,6 +422,9 @@
         field: "state",
       }, ],
       sort,
+      coverSize: {
+        width: 180
+      },
       paging: {
         start: 0,
         size: this.data.pageCount.page * 8,
@@ -441,11 +438,6 @@
       },
     };
     app.MG.store.getProductList(query).then((res) => {
-      if (!res.datas.length && !this.data.pathList.length) {
-        this.setData({
-          disabledSecondList: true
-        })
-      }
       this.setData({
         bookList: res.datas,
         isMore: null,
@@ -460,6 +452,18 @@
           noData: true,
         });
       }
+      // 浜岀骇绂佺敤閫昏緫
+      // 1.涓�绾у垎绫绘湭閫変腑锛屼簩绾у垎绫荤鐢�
+      if (!this.data.stairList.value) {
+        this.setData({
+          disabledSecondList: true
+        })
+      } else if (this.data.stairList.value && !this.data.secondList.options.length) {
+        // 2. 涓�绾у垎绫婚�変腑锛屾棤浜岀骇鍒嗙被
+        this.setData({
+          disabledSecondList: true
+        })
+      }
       if (this.data.triggered) {
         this.setData({
           triggered: false,
@@ -471,7 +475,7 @@
     });
   },
   // 涓�绾у垎绫诲垏鎹�
-  onChangeStair(e) {
+  async onChangeStair(e) {
     const path = e.detail.value.length ?
       `${this.data.assortCheck.code}\\${e.detail.value}` :
       this.data.assortCheck.code;
@@ -482,19 +486,45 @@
       secondCode: "",
       path: path,
       "stairList.value": e.detail.value,
-      disabledSecondList: false
+      // disabledSecondList: false
     });
-    if (e.detail.value == "") {
-      this.setData({
-        disabledSecondList: true,
-      });
-    } else {
-      this.getSecondList(path);
-    }
-    this.getBookList(path);
+    // if (e.detail.value == "") {
+    //   this.setData({
+    //     disabledSecondList: true,
+    //   });
+    // } else {
+    await this.getSecondList(path);
+    // }
+    await this.getBookList(path);
   },
-  // 浜岀骇鍒嗙被鍒囨崲
-  onChangeSecond(e) {
+  // // 浜岀骇鍒嗙被鍒囨崲
+  // onChangeSecond(e) {
+  //   const pathList = [];
+  //   for (let index = 0; index < e.detail.value.length; index++) {
+  //     const element = e.detail.value[index];
+  //     pathList.push({
+  //       Path: element,
+  //       Type: "*",
+  //       StoreRefCode: app.config.goodsStore,
+  //     });
+  //   }
+  //   this.setData({
+  //     backTop: "#assort-title",
+  //     pathList: pathList,
+  //     "secondList.value": e.detail.value,
+  //   });
+  // },
+  // 浜岀骇鍒嗙被閲嶇疆
+  resetSecond() {
+    this.setData({
+      backTop: "#assort-title",
+      pathList: [],
+      "secondList.value": [],
+    });
+    this.getBookList(this.data.path);
+  },
+  // 浜岀骇鍒嗙被纭畾
+  onConfirmSecond(e) {
     const pathList = [];
     for (let index = 0; index < e.detail.value.length; index++) {
       const element = e.detail.value[index];
@@ -509,12 +539,9 @@
       pathList: pathList,
       "secondList.value": e.detail.value,
     });
-  },
-  //
-  onConfirmSecond() {
     this.getBookList(this.data.path);
   },
-  // 閲嶇偣椤圭洰鏀瑰彉
+  // 鑾峰鎯呭喌鏀瑰彉
   changeMajorProject(e) {
     this.setData({
       backTop: "#assort-title",
@@ -522,7 +549,7 @@
     });
     this.getBookList(this.data.path);
   },
-  // 閲嶇偣椤圭洰閲嶇疆
+  // 鑾峰鎯呭喌閲嶇疆
   resetMajorProject() {
     this.setData({
       "majorProjectList.value": [],

--
Gitblit v1.9.1