网虫会飞
网虫会飞
  • 发布:2024-08-12 10:52
  • 更新:2024-08-13 12:02
  • 阅读:205

【报Bug】添加微信小程序插件 真机测试白屏 Reflect.apply requires the first argument be a function

分类:uni-app

产品分类: 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

2024-08-12 10:52 负责人:无 分享
已邀请:
BFC

BFC

你好,提供一下可复现的demo工程

要回复问题请先登录注册