From cb15c57d0ff984f5a100cf25d560fb0a69c00984 Mon Sep 17 00:00:00 2001
From: yiming <m13691596795@163.com>
Date: 星期二, 16 四月 2024 18:21:05 +0800
Subject: [PATCH] 音频bug4

---
 pages/bookServices/assort/index.js |  150 +++++++++++++++++++++++++++----------------------
 1 files changed, 82 insertions(+), 68 deletions(-)

diff --git a/pages/bookServices/assort/index.js b/pages/bookServices/assort/index.js
index fa4c9de..888e96e 100644
--- a/pages/bookServices/assort/index.js
+++ b/pages/bookServices/assort/index.js
@@ -1,22 +1,26 @@
 // pages/bookServices/assort/index.js
-import { getPublicImage } from '../../../assets/js/middleGround/tool'
+import {
+  getPublicImage
+} from "../../../assets/js/middleGround/tool";
 const app = getApp();
 Page({
   /**
    * 椤甸潰鐨勫垵濮嬫暟鎹�
    */
   data: {
-    placeholderstyle: 'font-size:28rpx',
+    barHeight: "",
+    navBarHeight: "",
+    placeholderstyle: "font-size:28rpx",
     assortList: [],
     assortCheck: {
-      name: '',
-      code: '',
+      name: "",
+      code: "",
     },
     startList: [],
 
     startCheck: {
-      id: '',
-      code: ''
+      id: "",
+      code: "",
     },
     bookList: [],
     loading: false,
@@ -27,75 +31,86 @@
    * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇
    */
   onLoad(options) {
+    const systInfo = wx.getSystemInfoSync();
+    const menu = wx.getMenuButtonBoundingClientRect(); // 鑳跺泭淇℃伅
+    const navBarHeight =
+      (menu.top - systInfo.statusBarHeight) * 2 + menu.height; // 瀵艰埅鏍忛珮搴�
+    this.setData({
+      barHeight: systInfo.statusBarHeight,
+      navBarHeight: navBarHeight,
+    });
     this.getAssortList();
   },
 
   /**
    * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍒濇娓叉煋瀹屾垚
    */
-  onReady() { },
+  onReady() {},
 
   /**
    * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鏄剧ず
    */
   onShow() {
-    if (typeof this.getTabBar === 'function' && this.getTabBar()) {
+    if (typeof this.getTabBar === "function" && this.getTabBar()) {
       this.getTabBar().setData({
-        active: 1
-      })
+        active: 1,
+      });
     }
   },
 
   /**
    * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰闅愯棌
    */
-  onHide() { },
+  onHide() {},
 
   /**
    * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍗歌浇
    */
-  onUnload() { },
+  onUnload() {},
 
   /**
    * 椤甸潰鐩稿叧浜嬩欢澶勭悊鍑芥暟--鐩戝惉鐢ㄦ埛涓嬫媺鍔ㄤ綔
    */
-  onPullDownRefresh() { },
+  onPullDownRefresh() {},
 
   /**
    * 椤甸潰涓婃媺瑙﹀簳浜嬩欢鐨勫鐞嗗嚱鏁�
    */
-  onReachBottom() { },
+  onReachBottom() {},
 
   /**
    * 鐢ㄦ埛鐐瑰嚮鍙充笂瑙掑垎浜�
    */
-  onShareAppMessage() { },
+  onShareAppMessage() {},
 
   // 鑾峰彇渚ц竟鏍忓垪琛�
   getAssortList() {
     this.setData({
-      loading: true
-    })
+      loading: true,
+    });
     const query = {
-      path: '*',
-      filterList: [
-        {
-          value: 'Normal',
-          field: 'state',
-        },
-      ],
-      queryType: '\\',
+      path: "*",
+      filterList: [{
+        value: "Normal",
+        field: "state",
+      }, ],
+      queryType: "\\",
       searchList: [],
-      size: '30',
-      start: '0',
+      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) => {
-      const list = res.datas.filter((item) => item.refCode != 'jsek_homepageBookService');
+      const list = res.datas.filter(
+        (item) => item.refCode != "jsek_homepageBookService"
+      );
       this.setData({
         assortList: list,
-        loading: false
+        loading: false,
       });
       this.setData({
         assortCheck: {
@@ -123,33 +138,35 @@
     });
     const query = {
       path,
-      filterList: [
-        {
-          value: 'Normal',
-          field: 'state'
-        }
-      ],
-      queryType: '\\',
+      filterList: [{
+        value: "Normal",
+        field: "state",
+      }, ],
+      queryType: "\\",
       searchList: [],
-      size: '30',
-      start: '0',
+      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) => {
       // 鑾峰彇浜岀骇鍒嗙被
       for (let index = 0; index < res.datas.length; index++) {
         const item = res.datas[index];
-        item.icon ? item.icon = getPublicImage(item.icon, 500) : item.icon = item.icon
+        item.icon ?
+          (item.icon = getPublicImage(item.icon, 500)) :
+          (item.icon = item.icon);
         item.children = await this.getSecondList(item);
       }
-      console.log(res.datas);
       // 涓�绾у垎绫昏祴鍊�
       this.setData({
         startList: res.datas,
         listLoding: false,
-        'startCheck.id': res.datas[0].id,
-        'startCheck..code': ''
+        "startCheck.id": res.datas[0].id,
+        "startCheck..code": "",
       });
     });
   },
@@ -160,28 +177,27 @@
     let datas;
     const query = {
       path,
-      filterList: [
-        {
-          value: 'Normal',
-          field: 'state'
-        }
-      ],
+      filterList: [{
+        value: "Normal",
+        field: "state",
+      }, ],
       coverSize: {
-        width: 500
+        width: 500,
       },
-      queryType: '\\',
+      queryType: "\\",
       searchList: [],
-      size: '30',
-      start: '0',
+      size: "30",
+      start: "0",
       storeRefCode: app.config.goodsStore,
-      sort: { type: 'Asc', field: 'LinkOrder' },
+      sort: {
+        type: "Asc",
+        field: "LinkOrder"
+      },
     };
     await app.MG.store.getStoreChannelList(query).then((res) => {
       for (let index = 0; index < res.datas.length; index++) {
         const element = res.datas[index];
-        if (element.icon)
-          element.icon = getPublicImage(element.icon, 500)
-
+        if (element.icon) element.icon = getPublicImage(element.icon, 500);
       }
       datas = res.datas;
     });
@@ -190,19 +206,18 @@
   tabClick(e) {
     const data = e.currentTarget.dataset.tabdata;
     this.setData({
-      'startCheck.id': data.id,
-      'startCheck.code': data.refCode,
+      "startCheck.id": data.id,
+      "startCheck.code": data.refCode,
     });
-    console.log(data);
   },
   // 璺宠浆鍒楄〃椤�
   goPageList(e) {
-    const tab = e.currentTarget.dataset.tabdata
-    const stair = e.currentTarget.dataset.stair
+    const tab = e.currentTarget.dataset.tabdata;
+    const stair = e.currentTarget.dataset.stair;
     this.setData({
-      'startCheck.id': tab.id,
-      'startCheck.code': tab.refCode
-    })
+      "startCheck.id": tab.id,
+      "startCheck.code": tab.refCode,
+    });
     if (stair) {
       const secondCode = `${stair.pathLinks[0].linkPath}\\${stair.id}`;
       wx.navigateTo({
@@ -213,11 +228,10 @@
         url: `/packageBookService/pages/bookServices/list/index?assorName=${this.data.assortCheck.name}&assortCode=${this.data.assortCheck.code}`,
       });
     }
-
   },
   navToSearchPage(e) {
     wx.navigateTo({
       url: `/packageBookService/pages/bookServices/list/index?assorName=${this.data.assortCheck.name}&assortCode=${this.data.assortCheck.code}&stairCode=${this.data.startCheck.code}&searchValue=${e.detail.value}`,
     });
   },
-});
+});
\ No newline at end of file

--
Gitblit v1.9.1