浏览代码

英语题追加音频播放

wangxy 4 月之前
父节点
当前提交
7555ee8d09
共有 3 个文件被更改,包括 6 次插入1 次删除
  1. 4 1
      components/question/yingyu/useAudio.js
  2. 1 0
      pages/unitTest/index.vue
  3. 1 0
      pages/wrong/index.vue

+ 4 - 1
components/question/yingyu/useAudio.js

@@ -50,7 +50,10 @@ export function useAudio() {
 			uni.$emit('destory-stop')	
 			uni.$emit('destory-stop')	
 		}
 		}
 	}
 	}
-
+	// 离开当前页面 停止播放
+	uni.$on('back-outpage',() => {
+		handleStop();
+	})
 
 
 	// 播放过程中点击同一个视频触发终止
 	// 播放过程中点击同一个视频触发终止
 	uni.$on('repeat-play-to-stop',() => {
 	uni.$on('repeat-play-to-stop',() => {

+ 1 - 0
pages/unitTest/index.vue

@@ -134,6 +134,7 @@
 		uni.redirectTo({
 		uni.redirectTo({
 			url: `/pages/study/index`
 			url: `/pages/study/index`
 		})
 		})
+		uni.$emit('back-outpage')
 	}
 	}
 	
 	
 	function onSwiperChange(index) {
 	function onSwiperChange(index) {

+ 1 - 0
pages/wrong/index.vue

@@ -129,6 +129,7 @@
 		uni.redirectTo({
 		uni.redirectTo({
 			url: '/pages/my/index'
 			url: '/pages/my/index'
 		})
 		})
+		uni.$emit('back-outpage')
 	}
 	}
 
 
 	function handleBackFromCuoti() {
 	function handleBackFromCuoti() {