|
|
@@ -14,18 +14,36 @@ Vue.mixin(globalMixins);
|
|
|
import store from "./store";
|
|
|
Vue.prototype.$store = store;
|
|
|
|
|
|
-//点击声效
|
|
|
-var innerAudioContext = uni.createInnerAudioContext();
|
|
|
-innerAudioContext.autoplay = false;
|
|
|
-innerAudioContext.src = constants.imgUrl+'/hit.mp3';
|
|
|
-innerAudioContext.onPlay(() => {
|
|
|
- //console.log('开始播放')
|
|
|
-});
|
|
|
-innerAudioContext.onError((res) => {
|
|
|
- //console.log(res.errMsg)
|
|
|
- //console.log(res.errCode)
|
|
|
-})
|
|
|
-Vue.prototype.$innerAudioContext = innerAudioContext;
|
|
|
+
|
|
|
+let lowVersionAndroid = false
|
|
|
+// #ifdef APP-PLUS
|
|
|
+var Build = plus.android.importClass("android.os.Build");
|
|
|
+if(Build.VERSION.SDK_INT <29){
|
|
|
+ lowVersionAndroid = true
|
|
|
+}
|
|
|
+// #endif
|
|
|
+if(lowVersionAndroid){
|
|
|
+ //低于安卓10的播放有问题写个假方法先调用
|
|
|
+ class voiceFn {
|
|
|
+ play() {
|
|
|
+ console.log('在播放...')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ Vue.prototype.$innerAudioContext = new voiceFn()
|
|
|
+}else{
|
|
|
+ //点击声效
|
|
|
+ var innerAudioContext = uni.createInnerAudioContext();
|
|
|
+ innerAudioContext.autoplay = false;
|
|
|
+ innerAudioContext.src = constants.imgUrl+'/hit.mp3';
|
|
|
+ innerAudioContext.onPlay(() => {
|
|
|
+ console.log('开始播放')
|
|
|
+ });
|
|
|
+ innerAudioContext.onError((res) => {
|
|
|
+ console.log(res.errMsg)
|
|
|
+ console.log(res.errCode)
|
|
|
+ })
|
|
|
+ Vue.prototype.$innerAudioContext = innerAudioContext;
|
|
|
+}
|
|
|
|
|
|
|
|
|
// 阻止启动生产消息,常用作指令
|