各位大神:
我现在需要嵌入的h5页面发送消息给app,然后app调用自定义的sdk(因为h5无法调用自定义的sdk),返回结果给h5页面。
目前 第一步,h5请求app已经通过,但是无法把数据返给h5页面,请教各位大神指导一下。
app页面:详情可看附件截图谢谢;
<template>
<view style="background-color: #000000;">
<web-view ref="wb" src="http://10.19.4.171:1999/test" @message="reciveMessage"></web-view>
</view>
</template>
<script>
export default {
data() {
return {}
},
onLoad (params) {
},
methods: {
reciveMessage(e) {
console.log('收到子页面数据',e)
this.$refs.web.evalJs('callBackTest(1);');
},
}
}
</script>
<style>
</style>
错误信息:
TypeError: this.$refs['wb'].evalJs is not a function. (In 'this.$refs['wb'].evalJs('callback(1);')', 'this.$refs['wb'].evalJs' is undefined) __ERROR