uni-app微信小程序关注公众号
方法一(文章识别)
<template>
<web-view :src="url" bindmessage="getMessage"></web-view>
</template>
<script>
export default {
data() {
return {
// 公众号的某一篇文章链接地址
url: 'https://mp.weixin.qq.com/s/uyTXhl3OUFqI7eX0ja8uvw'
}
},
onLoad(options) {
// this.url = options.url;
}
}
</script>
<style>
</style>
方法二(小程序内关注)
<view style="width:100%;">
<official-account @load="bindload" @error="binderror"></official-account>
</view>
bindload:function(detail){
// console.log(detail,"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@")
},
binderror:function(detail){
// console.log(detail,"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@")
},
参考文章
uni-app微信小程序跳转公众号;微信小程序打开公众号;微信小程序识别二维码添加好友;微信小程序通过公众号添加好友;小程序里识别企业微信二维码点击联系人名片无反应?
UNI-APP 关注公众号组件 OFFICIAL-ACCOUNT (事件的触发)
本作品采用《CC 协议》,转载必须注明作者和本文链接