From aa2c08b3be23a01d44205b2c19d21a2bf53f944f Mon Sep 17 00:00:00 2001
From: 闫增涛 <1829501689@qq.com>
Date: 星期一, 01 四月 2024 16:15:38 +0800
Subject: [PATCH] 图书服务列表、详情页bug修改

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

diff --git a/packageBookService/pages/bookServices/list/index.js b/packageBookService/pages/bookServices/list/index.js
index 9409fb6..944f48b 100644
--- a/packageBookService/pages/bookServices/list/index.js
+++ b/packageBookService/pages/bookServices/list/index.js
@@ -39,24 +39,24 @@
       options: [],
     },
     sortList: {
-      value: '',
+      value: 'default',
       options: [{
-          value: '',
-          label: '缁煎悎鎺掑簭',
+          value: 'default',
+          label: '榛樿鎺掑簭',
         }, {
-          value: '1',
+          value: 'name-asc',
           label: '鍚嶇О姝e簭'
         },
         {
-          value: '2',
+          value: 'name-desc',
           label: '鍚嶇О鍊掑彊'
         },
         {
-          value: '3',
+          value: 'time-asc',
           label: '鍑虹増鏃堕棿姝e簭'
         },
         {
-          value: '3',
+          value: 'time-desc',
           label: '鍑虹増鏃堕棿鍊掑彊'
         }
       ],
@@ -359,17 +359,44 @@
         queryType: '*',
       };
     }
-    if (this.data.sort) {
+    if (this.data.sortList.value == 'name-asc') {
       sort = {
-        Name: this.data.sort,
-        BaseType: '',
-      };
-    } else {
+        Name: 'Asc',
+        BaseType: ''
+      }
+    } else if (this.data.sortList.value == 'name-desc') {
       sort = {
-        type: 'Desc',
-        field: 'ViewCount',
-      };
+        Name: 'Desc',
+        BaseType: ''
+      }
+    } else if (this.data.sortList.value == 'time-asc') {
+      sort = {
+        PublicationDate: 'Asc',
+        BaseType: 'DateTime'
+      }
+    } else if (this.data.sortList.value == 'time-desc') {
+      debugger
+      sort = {
+        PublicationDate: 'Desc',
+        BaseType: 'DateTime'
+      }
+    } else if (this.data.sortList.value == 'default') {
+      sort = {
+        field: 'order',
+        type: 'Desc'
+      }
     }
+    // if (this.data.sort) {
+    //   sort = {
+    //     Name: this.data.sort,
+    //     BaseType: '',
+    //   };
+    // } else {
+    //   sort = {
+    //     type: 'Desc',
+    //     field: 'ViewCount',
+    //   };
+    // }
     // 鎼滅储
     let searchObj = {};
     if (this.data.searchValue) {
@@ -497,6 +524,19 @@
     this.setData({
       'sortList.value': e.detail.value
     })
+
+    let path;
+    if (this.data.secondCode) {
+      path = this.data.secondCode;
+    } else if (this.data.stairCode) {
+      path = `${this.data.assortCheck.code}\\${this.data.stairCode}`;
+    } else {
+      path = this.data.assortCheck.code;
+    }
+    this.setData({
+      path: path,
+    });
+    this.getBookList(path);
   },
   changeNewText(e) {
     this.setData({
@@ -511,33 +551,33 @@
     this.getBookList(this.data.path);
   },
   // 鎺掑簭鎸夐挳
-  sortClick() {
-    if (!this.data.sort.length) {
-      this.setData({
-        sort: 'Desc',
-      });
-    } else if (this.data.sort == 'Desc') {
-      this.setData({
-        sort: 'Asc',
-      });
-    } else if (this.data.sort == 'Asc') {
-      this.setData({
-        sort: '',
-      });
-    }
-    let path;
-    if (this.data.secondCode) {
-      path = this.data.secondCode;
-    } else if (this.data.stairCode) {
-      path = `${this.data.assortCheck.code}\\${this.data.stairCode}`;
-    } else {
-      path = this.data.assortCheck.code;
-    }
-    this.setData({
-      path: path,
-    });
-    this.getBookList(path);
-  },
+  // sortClick() {
+  //   if (!this.data.sort.length) {
+  //     this.setData({
+  //       sort: 'Desc',
+  //     });
+  //   } else if (this.data.sort == 'Desc') {
+  //     this.setData({
+  //       sort: 'Asc',
+  //     });
+  //   } else if (this.data.sort == 'Asc') {
+  //     this.setData({
+  //       sort: '',
+  //     });
+  //   }
+  //   let path;
+  //   if (this.data.secondCode) {
+  //     path = this.data.secondCode;
+  //   } else if (this.data.stairCode) {
+  //     path = `${this.data.assortCheck.code}\\${this.data.stairCode}`;
+  //   } else {
+  //     path = this.data.assortCheck.code;
+  //   }
+  //   this.setData({
+  //     path: path,
+  //   });
+  //   this.getBookList(path);
+  // },
   // 鎼滅储鍥句功
   searchBook(e) {
     console.log(e.detail.value);

--
Gitblit v1.9.1