From 9ba507bed7688a1a9eee31255e40add8bf1a8689 Mon Sep 17 00:00:00 2001
From: yiming <m13691596795@163.com>
Date: 星期日, 28 四月 2024 18:54:33 +0800
Subject: [PATCH] 书展bug

---
 pages/bibliographyList/index.wxml                    |   10 --
 pages/bookExhibitionList/index.js                    |  134 +++++++++++++++++++-------------
 packageDomain/pages/resourceDetails/myAudio/index.js |   59 +++++++++++---
 pages/retrievalPage/index.js                         |    5 -
 pages/bibliographyList/index.js                      |   16 +--
 5 files changed, 128 insertions(+), 96 deletions(-)

diff --git a/packageDomain/pages/resourceDetails/myAudio/index.js b/packageDomain/pages/resourceDetails/myAudio/index.js
index 16bbcb0..ca60362 100644
--- a/packageDomain/pages/resourceDetails/myAudio/index.js
+++ b/packageDomain/pages/resourceDetails/myAudio/index.js
@@ -57,16 +57,14 @@
   // },
 
 
-  // 杞寲鏃堕棿
   format(time) {
-
     let minute = Math.floor(time / 60);
     let second = Math.floor(time % 60);
-    minute = minute < 10 ? ("0" + minute) : minute;
-    second = second < 10 ? ("0" + second) : second;
-    let res = minute + ":" + second;
-    return res;
+    let minuteStr = minute < 10 ? "0" + minute : "" + minute;
+    let secondStr = second < 10 ? "0" + second : "" + second;
+    return minuteStr + ":" + secondStr;
   },
+
   audio: null,
   // 鏍煎紡鍖栫瑪璁版椂闂�
   convertTimestamp(timestamp) {
@@ -623,27 +621,55 @@
     });
 
 
+    //鎾斁浜嬩欢
+    myAudio.play();
+
+
+
 
     // 鎾斁瀹屾垚澶勭悊锛屾寜閽彉涓�涓�
     myAudio.onEnded((res) => {
       this.setData({
-        isplay: true
+        speed: 1.0,
       })
-    });
+      myAudio.playbackRate = this.data.speed;
 
+      this.setData({
+        isplay: true,
+        myAudioCurrent: '00:00',
+        myAudioPos: '',
+      })
+
+    });
 
     //杩涘害鏉″彉鍖�   
     myAudio.onTimeUpdate(() => {
+
+
+
       this.setData({
         myAudioPos: myAudio.currentTime / myAudio.duration * 100,
         myAudioCurrent: this.format(myAudio.currentTime),
         myAudioDuration: this.format(myAudio.duration),
       });
+      // debugger
+
+      console.log(this.data.myAudioPos);
     })
 
+    // if (this.data.myAudioDuration !== this.data.myAudioCurrent) {
+    //   this.setData({
+    //     myAudioPos: myAudio.currentTime / myAudio.duration * 100,
+    //     myAudioCurrent: this.format(myAudio.currentTime),
+    //     myAudioDuration: this.format(myAudio.duration),
+    //   });
 
-
-    myAudio.play();
+    // }else{
+    //   myAudio.pause();
+    //   this.setData({
+    //     isplay: true
+    //   });
+    // }
   },
 
 
@@ -743,7 +769,7 @@
 
   // 鎷栧姩杩涘害鏉★紝鍒版寚瀹氫綅缃�
   hanle_slider_change(e) {
-    console.log();
+
     const position = e.detail.value;
     var currentTime = position / 100 * myAudio.duration;
     myAudio.seek(currentTime);
@@ -751,6 +777,9 @@
       myAudioPos: position,
       myAudioCurrent: this.format(currentTime)
     })
+
+
+
   },
 
 
@@ -766,7 +795,7 @@
       showDropdown: !this.data.showDropdown
     })
     setTimeout(() => {
-      // myAudio.startTime = this.data.myAudioDuration  //寮�濮嬫椂闂�  
+      myAudio.startTime = this.data.myAudioDuration //寮�濮嬫椂闂�  
       myAudio.playbackRate = this.data.speed; //  鎾斁閫熺巼
     }, 200);
   },
@@ -776,7 +805,7 @@
       showDropdown: !this.data.showDropdown
     })
     setTimeout(() => {
-      // myAudio.startTime = this.data.myAudioDuration  //寮�濮嬫椂闂�  
+      myAudio.startTime = this.data.myAudioDuration //寮�濮嬫椂闂�  
       myAudio.playbackRate = this.data.speed; //  鎾斁閫熺巼
     }, 200);
   },
@@ -786,7 +815,7 @@
       showDropdown: !this.data.showDropdown
     })
     setTimeout(() => {
-      // myAudio.startTime = this.data.myAudioDuration  //寮�濮嬫椂闂�  
+      myAudio.startTime = this.data.myAudioDuration //寮�濮嬫椂闂�  
       myAudio.playbackRate = this.data.speed; //  鎾斁閫熺巼
     }, 200);
   },
@@ -796,7 +825,7 @@
       showDropdown: !this.data.showDropdown
     })
     setTimeout(() => {
-      // myAudio.startTime = this.data.myAudioDuration  //寮�濮嬫椂闂�  
+      myAudio.startTime = this.data.myAudioDuration //寮�濮嬫椂闂�  
       myAudio.playbackRate = this.data.speed; //  鎾斁閫熺巼
     }, 200);
   },
diff --git a/pages/bibliographyList/index.js b/pages/bibliographyList/index.js
index ee3e3b0..a4e6b10 100644
--- a/pages/bibliographyList/index.js
+++ b/pages/bibliographyList/index.js
@@ -54,19 +54,12 @@
         navBarHeight: navBarHeight,
         barHeight: systInfo.statusBarHeight,
       })
-
       let event = {
         detail: {
           value: "0"
         }
       }
-
       this.onTabsChange(event)
-
-
-
-
-
     },
 
     /**
@@ -80,7 +73,8 @@
      * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鏄剧ず
      */
     onShow() {
-      console.log(this.data.value);
+      // console.log(this.data.value);
+
     },
 
     /**
@@ -145,7 +139,7 @@
 
     //楂樼瓑鏁欒偛
     higherGet(keyword) {
-      console.log(keyword, 'keyword');
+      // console.log(keyword, 'keyword');
       let searchObj = {
         'Name*': keyword,
         '||author*': keyword,
@@ -178,12 +172,12 @@
         res.datas.forEach(item => {
           item.determine = true
         })
-        console.log(res, 789111);
+        // console.log(res, 789111);
         this.setData({
           higherList: res.datas,
           higherTotal: res.total
         })
-        console.log(this.data.higherList, '5555');
+        // console.log(this.data.higherList, '5555');
         this.setData({
           loading: false, //寮�鍚鏋跺睆鍔犺浇
           hidden: false, //鏄惁灞曠ず鍐呭
diff --git a/pages/bibliographyList/index.wxml b/pages/bibliographyList/index.wxml
index 19be58d..35060f5 100644
--- a/pages/bibliographyList/index.wxml
+++ b/pages/bibliographyList/index.wxml
@@ -10,7 +10,6 @@
       <!--pages/bibliographyList/index.wxml-->
       <view wx:if="{{downloadLoadin}}" class="loadinBox">
         <t-loading class="colors" theme="circular" size="70rpx" class="wrapper" />
-
       </view>
       <view class="bibliographyListBox"></view>
       <view class="titleBox">
@@ -19,32 +18,23 @@
           <view>
             <t-icon name="chevron-left" size="30" data-name="{{item}}" bind:click="goBack" />
           </view>
-
           <view class="example-search">
             <t-search model:value="{{value}}" placeholder="璇疯緭鍏ヤ功鐩悕绉�" bind:submit="onSearchSubmit">
             </t-search>
             <!-- <t-icon slot="left-icon" prefix="wr" name="search" size="40rpx" color="#bbb" /> -->
           </view>
-
         </view>
       </view>
-
     </view>
-
-
-
     <t-tabs class="contentBox" defaultValue="{{0}}" bind:change="onTabsChange" bind:click="onTabsClick" t-class="custom-tabs" t-class-content="custom-panel">
       <t-tab-panel label="楂樼瓑鏁欒偛({{higherTotal}})" value="0">
-
         <view wx:if="{{higherList.length <= 0}}" class="noDataBox">
           <t-empty icon="folder-open" description="鏆傛棤鏁版嵁" />
         </view>
-
         <view wx:else class="outsideHigherBox">
           <view class="higherBox" wx:for="{{higherList}}" wx:key="index" wx:for-item="item" wx:for-index="index">
             <view class="outsideHigherImageBox">
               <view class="higherImageBox">
-
                 <image wx:if="{{item.icon}}" data-item="{{item}}" bind:tap="downloadData" src="{{item.icon}}" mode="aspectFill" />
                 <image wx:if="{{!item.icon}}" src="/static/images/default-book-img.png" mode="aspectFill" data-item="{{item}}" bind:tap="downloadData" />
                 <view class="downloadIcon" data-item="{{item}}" data-key="showWithInput" bind:tap="mailbox">
diff --git a/pages/bookExhibitionList/index.js b/pages/bookExhibitionList/index.js
index 7064469..2731d08 100644
--- a/pages/bookExhibitionList/index.js
+++ b/pages/bookExhibitionList/index.js
@@ -78,6 +78,7 @@
         },
       ],
     },
+    newValue: ''
   },
 
 
@@ -86,7 +87,7 @@
    * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇
    */
   onLoad(options) {
-
+    console.log(this.data.multipleSelect.options.length, '44444');
     // this.setData({
     //   'product.value': '*',
     // });
@@ -99,11 +100,11 @@
     })
 
 
-    watch.setWatcher(this);
-    let that = this;
-    setTimeout(function () {
-      that.data.name = "娴嬭瘯watch鍙樺寲浜�"
-    }, 5000)
+    // watch.setWatcher(this);
+    // let that = this;
+    // setTimeout(function () {
+    //   that.data.name = "娴嬭瘯watch鍙樺寲浜�"
+    // }, 5000)
     // 
   },
   watch: {
@@ -129,7 +130,7 @@
     // debugger
     this.bookExhibitionGet()
 
-    // this.keyProjectsGet(this.data.newPrice)
+    this.keyProjectsGet(this.data.newPrice)
 
 
   },
@@ -187,7 +188,6 @@
   onReachBottom() {
 
     if (this.data.page.size >= this.data.total) {
-
       Toast({
         context: this,
         selector: '#t-toast',
@@ -197,10 +197,6 @@
         preventScrollThrough: true,
         icon: 'poweroff',
       });
-
-
-
-
     } else {
       // const currentPage = this.data.page.start + 1; // 鑾峰彇褰撳墠椤垫暟骞跺姞1
       const newSize = this.data.page.size + 10; // 鍘熸潵鐨勫熀纭�涓婂姞10
@@ -209,9 +205,6 @@
         'page.size': newSize
       });
       // this.bookExhibitionGet(); // 璋冪敤鏂规硶鍔犺浇鏇村鏁版嵁
-
-
-
     }
   },
 
@@ -259,7 +252,7 @@
 
     app.MG.store.getProductList({
       storeInfo: 'jsek_bookFair',
-      path: newValue,
+      path: this.data.newValue,
       queryType: '*',
       fields: {
         jsek_link: [],
@@ -316,50 +309,95 @@
 
   },
   //閲嶇偣椤圭洰鎺ュ彛
-  keyProjectsGet(newPrice) {
+  keyProjectsGet() {
+    // debugger
+    if (this.data.multipleSelect.options.length !== 0) {
+      console.log('寮犱竴楦�');
+      this.setData({
+        'multipleSelect.options': [],
+      });
+    }
+    //楠ㄦ灦灞�
     this.setData({
       loading: true,
       hidden: true,
     })
+
+    // 鍙傛暟
     let parms = {
       refCodes: ['bookClassification']
     }
+    //璇锋眰鏁版嵁
     app.MG.store.getProductTypeField(parms).then(res => {
 
+      // 鏍煎紡鍖栨暟鎹�
       const checkData = JSON.parse(res[0].config)
       console.log(checkData);
+
+      // 寰幆鐒跺悗鍒ゆ柇鐩稿尮閰嶇殑鏁版嵁璧嬪�肩粰filteredItems
       checkData.option.forEach(item => {
-        if (newPrice == item.value) {
+        if (this.data.newPrice == item.value) {
+
+          if (this.data.filteredItems.length !== 0) {
+            this.setData({
+              filteredItems: [] // 濡傛灉瀛樺湪瀛愰」鍒欒祴鍊硷紝鍚﹀垯璧嬪�间负绌烘暟缁�
+            });
+          }
+
+
           this.setData({
             filteredItems: item.child || [] // 濡傛灉瀛樺湪瀛愰」鍒欒祴鍊硷紝鍚﹀垯璧嬪�间负绌烘暟缁�
           });
         }
       })
+
+      this.setData({
+        'multipleSelect.options': [],
+      });
+
+      const singleSelectOptions = []
+      console.log(this.data.multipleSelect.options, 'multipleSelect.options');
+      console.log(singleSelectOptions, 'singleSelectOptions');
       // 鍗曞垪閫夋嫨鍣ㄩ�夐」
-      const singleSelectOptions = this.data.filteredItems.map(item => ({
-        label: item.name,
-        value: item.value,
-      }))
+      // 鍗曞垪閫夋嫨鍣ㄩ�夐」
+      this.data.filteredItems.forEach(item => {
+        singleSelectOptions.push({
+          label: item.name,
+          value: item.value,
+        });
+      });
+
+
+
+      if (singleSelectOptions.length === 0) {
+        singleSelectOptions.push({
+          label: '鏆傛棤鏁版嵁',
+
+        });
+
+      }
+
       // 鏇存柊鏁版嵁
       this.setData({
         'multipleSelect.options': singleSelectOptions,
       });
 
+      // 鍙栨秷楠ㄦ灦灞�
       this.setData({
         loading: false,
         hidden: false,
       })
     })
-    if (newPrice) {
-      this.setData({
-        keynoteDisabled: false
-      })
-    }
-    if (!newPrice) {
-      this.setData({
-        keynoteDisabled: true
-      })
-    }
+    // if (newPrice) {
+    //   this.setData({
+    //     keynoteDisabled: false
+    //   })
+    // }
+    // if (!newPrice) {
+    //   this.setData({
+    //     keynoteDisabled: true
+    //   })
+    // }
   },
 
 
@@ -369,25 +407,19 @@
   // 鎬诲垎绫�
   onChange(e) {
 
-
-
-    // this.data.page.size = 16 //鏇存敼鏄剧ず鐨勫��
+    this.setData({
+      'multipleSelect.options': [],
+    });
+    console.log(this.data.multipleSelect.options);
     const newValue = e.detail.value;
-
+    console.log(newValue);
     this.setData({
       'product.value': newValue,
-
+      newValue: newValue
     });
 
-
-    // debugger
     // let newPrice = ''
-
-
-
-
     if (newValue == 'jsek_bFHigherEducation') {
-
       this.setData({
         newPrice: 'jsek_higherEducation'
       })
@@ -400,22 +432,15 @@
         newPrice: 'jsek_teacherEducation'
       })
     }
-    this.bookExhibitionGet(newValue);
+
     this.keyProjectsGet(this.data.newPrice)
-
-
-
-
+    this.bookExhibitionGet(newValue);
     if (this.data.keynoteValue) {
       //濡傛灉鏈夋暟鎹氨娓呯┖骞跺埛鏂伴〉闈�
       this.data.keynoteValue = []
       this.bookExhibitionGet(newValue)
-
     }
-
-
-
-
+    this.onLoad()
   },
 
   // 閲嶇偣椤圭洰
@@ -437,7 +462,6 @@
 
 
   handleReset(e) {
-
     // 閲嶇疆鎿嶄綔鐨勫鐞嗛�昏緫
     this.data.keynoteValue = []
     this.bookExhibitionGet()
diff --git a/pages/retrievalPage/index.js b/pages/retrievalPage/index.js
index 5a4a503..2a8f69c 100644
--- a/pages/retrievalPage/index.js
+++ b/pages/retrievalPage/index.js
@@ -46,7 +46,6 @@
    * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇
    */
   onLoad(options) {
-
     console.log(app.config.appId);
     const systInfo = wx.getSystemInfoSync();
     const menu = wx.getMenuButtonBoundingClientRect(); // 鑳跺泭淇℃伅
@@ -56,8 +55,6 @@
       barHeight: systInfo.statusBarHeight,
       searchVal: options.searchVal
     })
-
-
     this.retrievalPageGet()
     this.bibliographyGet()
     let event = {
@@ -66,8 +63,6 @@
       }
     }
     this.onTabsChange(event)
-
-
   },
 
   /**

--
Gitblit v1.9.1