这段代码在小程序原生是支持的,在web-view内套壳我看是有对应方法,但是调用报没有权限的错误,所以为了用户更好的体验,想知道怎么能在h5内调通wx.openBusinessView 这个方法。
wx.openBusinessView({
businessType: 'shopConsumeVoucher',
extraData: {
encrypted_codes: ['xxx'],
consume_request_no: 'xxx'
},
success(res) {
console.log('res', res)
},
fail(err) {
console.log('err', err)
},
complete() {
// wx.showToast({
// title: 'complete',
// })
}
});
参考文档,未列出的API是不支持的。
https://developers.weixin.qq.com/miniprogram/dev/component/web-view.html
这是小程序的接口,需在小程序内调用,不要在webview里调用。
h5内调用是报这个错误信息