Ver código fonte

英语题追加音频播放

wangxy 4 meses atrás
pai
commit
7555ee8d09

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

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

+ 1 - 0
pages/unitTest/index.vue

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

+ 1 - 0
pages/wrong/index.vue

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