onLoad(options) {
if (options.amount && options.shopId) {
this.amount = options.amount;
this.shopId = options.shopId;
const audio = wx.createInnerAudioContext();
audio.src = 'https://xxx/pay.mp3';
audio.onPause((res) => {
console.log("audio paused by others");
})
audio.play();
this.pay()
} else {
wx.navigateBack({
delta: -1,
})
}
},
pay() {
wx.scanCode({
onlyFromCamera: true,
scanType: ['qrCode'],
})
}
你好,麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)
请问你解决问题了吗?我遇到了类似的问题,wx.scanCode(success: res => {})的成功回调中,无法播放音频,请问如何解决?谢谢!