From c99f9976a5ef9d8974105feb8fc0580a10adf98c Mon Sep 17 00:00:00 2001
From: QYF-GitLab1 <1940665526@qq.com>
Date: 星期一, 23 十二月 2024 14:58:49 +0800
Subject: [PATCH] 111

---
 packageBookService/pages/bookServices/examination/questionList/index.js |   62 +++++++++++++++++++++++++++---
 1 files changed, 55 insertions(+), 7 deletions(-)

diff --git a/packageBookService/pages/bookServices/examination/questionList/index.js b/packageBookService/pages/bookServices/examination/questionList/index.js
index 49a40ba..1669dde 100644
--- a/packageBookService/pages/bookServices/examination/questionList/index.js
+++ b/packageBookService/pages/bookServices/examination/questionList/index.js
@@ -1,4 +1,7 @@
 // pages/bookServices/examination/questionList/index.js
+const innerAudioContext = wx.createInnerAudioContext({
+  useWebAudioImplement: false
+})
 Component({
   /**
    * 缁勪欢鐨勫睘鎬у垪琛�
@@ -15,43 +18,79 @@
     currentIndex: {
       type: Number,
       value: 1
+    },
+    isNight: {
+      type: Boolean,
+      value: false
+    },
+    answerType: {
+      type: String,
+      value: ''
+    },
+    sliderValue: {
+      type: Number,
+    },
+    noData: {
+      type: Boolean,
     }
   },
-  created() {
-    // console.log('缁勪欢浼犲弬', this.properties);
+  observers: {},
+  detached() {
+    if (innerAudioContext) {
+      try {
+        innerAudioContext.stop();
+        innerAudioContext.destroy();
+      } catch (error) {}
+    }
+
   },
   /**
    * 缁勪欢鐨勫垵濮嬫暟鎹�
    */
   data: {
     inputstyle: 'border: 2rpx solid rgba(220,220,220,1);border-radius: 12rpx;',
+    shortAnswer: 'font-size: 28rpx',
     placeholderstyle: "font-size:28rpx",
     current: 2,
     autoplay: true,
     duration: 500,
     interval: 5000,
     paginationPosition: 'bottom-right',
-    navigation: { type: 'fraction' },
+    navigation: {
+      type: 'fraction'
+    },
     showIndex: 0,
+    isPlay: false
   },
 
   /**
    * 缁勪欢鐨勬柟娉曞垪琛�
    */
   methods: {
+    audioPlay(e) {
+      const src = e.currentTarget.dataset.src
+      innerAudioContext.src = src
+      if (!this.data.isPlay) {
+        innerAudioContext.play()
+      } else {
+        innerAudioContext.pause()
+      }
+      this.setData({
+        isPlay: !this.data.isPlay
+      })
+    },
     // 鍒囨崲棰樼洰
     changeSwiper(e) {
-      console.log(e);
       this.setData({
         showIndex: e.detail.current
       })
       var myEventDetail = {
         index: e.detail.current
-      } // detail瀵硅薄锛屾彁渚涚粰浜嬩欢鐩戝惉鍑芥暟
+      }
       var myEventOption = {
         bubbles: true,
         composed: true,
-      } // 瑙﹀彂浜嬩欢鐨勯�夐」
+      }
       this.triggerEvent('changeSwiper', myEventDetail, myEventOption)
     },
     // 鍗曢��  瀵屾枃鏈杈撳叆  瑙﹀彂
@@ -87,5 +126,14 @@
       } // 瑙﹀彂浜嬩欢鐨勯�夐」
       this.triggerEvent('onChangeInput', myEventDetail, myEventOption)
     },
+    // 鎴戠殑閿欓锛屾敹钘忔煡鐪嬭В鏋愭寜閽�
+    viewParsing() {
+      var myEventDetail = {}
+      var myEventOption = {
+        bubbles: true,
+        composed: true,
+      }
+      this.triggerEvent('viewParsing', myEventDetail, myEventOption)
+    }
   }
-})
+})
\ No newline at end of file

--
Gitblit v1.9.1