uni-app 添加微信小程序插件 真机测试白屏 Reflect.apply requires the first argument be a function
uni-app 添加微信小程序插件 真机测试白屏 Reflect.apply requires the first argument be a function
产品分类:
uniapp/小程序/微信
PC开发环境操作系统:
Mac
PC开发环境操作系统版本号:
最新版本
HBuilderX类型:
正式
HBuilderX版本号:
4.24
第三方开发者工具版本号:
1.06
基础库版本号:
3.4.6
项目创建方式:
HBuilderX
示例代码:
{
"plugins": {
"WechatSI": {
"version": "0.3.5",
"provider": "wx069ba97219f66d99"
}
}
}
const innerAudioContext = uni.createInnerAudioContext();
var plugin = requirePlugin("WechatSI")
var isPlay = false;
innerAudioContext.autoplay = true;
innerAudioContext.onError((res) => {
console.log(res.errMsg);
console.log(res.errCode);
});
innerAudioContext.onEnded((res) => {
isPlay = false
if (audioList.length > 0) {
playAudio()
}
});
innerAudioContext.onPlay(() => {
isPlay = true
console.log('开始播放');
});
var audioList = []
var audioIndex = 0
const textToSpeech = (text) => {
plugin.textToSpeech({
lang: "zh_CN",
tts: true,
content: text,
success: function (res) {
audioList.push(res.filename)
playAudio()
},
fail: function (res) {
console.log("fail tts", res)
}
})
}
const playAudio = () => {
console.log(isPlay, audioList.length)
if (!isPlay && audioList.length > 0) {
innerAudioContext.src = audioList[0];
innerAudioContext.play()
isPlay = true
audioList.shift()
console.log(isPlay, audioList.length)
}
}
onUnload(() => {
console.log('删除 intervalId')
clearInterval(intervalId);
})
textToSpeech('已开启收款语音播报')
操作步骤:
真机调试
预期结果:
真机调试
实际结果:
真机调试
bug描述:
添加插件
{
"plugins": {
"WechatSI": {
"version": "0.3.5",
"provider": "wx069ba97219f66d99"
}
}
}
开发者工具都正常,就真机时白屏
Reflect.apply requires the first argument be a function
更多关于uni-app 添加微信小程序插件 真机测试白屏 Reflect.apply requires the first argument be a function的实战教程也可以访问 https://www.itying.com/category-93-b0.html
1 回复
更多关于uni-app 添加微信小程序插件 真机测试白屏 Reflect.apply requires the first argument be a function的实战教程也可以访问 https://www.itying.com/category-93-b0.html
你好,提供一下可复现的demo工程