222
schangxiang@126.com
2024-12-14 f3a78b9ef7ec02b255dc52bf2b85f52c1cefa777
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 
    export default {
        methods:{
            //语音播报
               playSound() {
                let _this = this
                const innerAudioContext = uni.createInnerAudioContext();
                innerAudioContext.autoplay = true;
                innerAudioContext.src = '../../static/13716.wav';
                innerAudioContext.onError((res) => {
                 //如果音频没有正常播放
                 console.log(res.errCode);
                })
                innerAudioContext.onStop((res) => {
                 _this.playing = false
            
                 _this.$forceUpdate()
                })
                //震动
                uni.vibrateLong({
                    success: function () {
                        console.log('success');
                    },
                    complete:function(){
                        
                    }
                });
               },
        }
    }