原生小程序代码
在manifest.json 配置微信小程序插件
{
"plugins": {
"gateway-plugin": {
"version": "latest",
"provider": "wxd1c7841825511c94"
},
"captcha-plugin": {
"version": "latest",
"provider": "wx3acdde82f7cf0e6e"
}
}
}
在pages.json
{
"usingComponents": {
"gateway": "plugin://gateway-plugin/gateway-component"
}
}
HTML 页面
<gateway bindcbevent='onGatewayEvent' miniProgramName='短信助手' merchantId='test' />
回调事件
onGatewayEvent(e) {
console.log('gateway result', e.detail);
}
uniapp 代码
在manifest.json 配置微信小程序插件
"plugins" : {
"gateway-plugin" : {
"version" : "latest",
"provider" : "wxd1c7841825511c94"
},
"captcha-plugin" : {
"version" : "latest",
"provider" : "wx3acdde82f7cf0e6e"
}
}
在pages.json
"usingComponents": {
"gateway": "plugin://gateway-plugin/gateway-component"
}
<gateway v-if="isGat" @bindcbevent='onGatewayEvent' miniProgramName='尔思乡+' merchantId='wx4a8e894a806a4994' />
const onGatewayEvent = (e) =>{
console.log('gateway result', e.detail);
}