7***@qq.com
7***@qq.com
  • 发布:2022-10-09 11:16
  • 更新:2022-10-10 22:55
  • 阅读:249

uniapp开发qq小程序如何添加qq好友

分类:uni-app

uniapp中没有bindaddfriend方法,使用条件编译,在真机上还是报错,请问应该如何解决这个问题呢? 急急急

<!-- #ifdef MP-QQ -->  
        <button   
            type="primary"   
            open-type="addFriend"   
            open-id=""  
            bindaddfriend="bindaddfriend"  
        >添加好友</button>  
        <!-- #endif -->  

methods: {  
            // #ifdef MP-QQ  
            bindaddfriend(e){  
                qq.getSetting({  
                    success(res) {  
                        if(!res.authSetting['setting.addFriend']){  
                                qq.authorize({  
                                    scope: 'setting.addFriend',  
                                    success() {  

                                    }  
                                })  
                        }  
                    }  
                })  
            },  
            // #endif  
}

真机报错信息: Component "pages/index/index" does not have a method "bindaddfriend" to handle event "addfriend".

2022-10-09 11:16 负责人:无 分享
已邀请:
DCloud_UNI_WZF

DCloud_UNI_WZF

用vue语法绑定事件 @addfriend

要回复问题请先登录注册