交流专区
服务市场
微信学堂
文档
小程序
  • 常用主页

    小程序

    小游戏

    企业微信

    微信支付

  • 服务市场
    微信学堂
    文档
登录
切换主页

暂无个人介绍

关注私信

正在关注

0

关注者

0

获得过 0 次赞
回答过的问题获得 0 次赞
分享过的文章/案例获得 0 次赞
评论与回复获得 0 次赞
文章 回答 1提问 收藏 关注问题
  • [图片]

    Cannot read property 'nickName' of 错误

    查看运维中心的错误列表, 发现这个错误, 看起来应该是 调用wx.createUserInfoButton接口之后的onTap回调中 res.userInfo中的nickName是undefined, 请问一下 什么情况下会导致nickName为空呢?  我这里已经先先判断了userInfo为空的情况的. Cannot read property 'nickName' of undefined;at tap callback function 贴代码   var button = wx.createUserInfoButton({ type: "text",    text: "微信登陆",    image: "",    style: { left: x,        top: y,        width: 150,        height: 48,        lineHeight: 48,        backgroundColor: "#09bb07",        color: "#ffffff",        textAlign: "center",        fontSize: 22,        borderRadius: 24    } }); button.onTap((res) => { console.log("用户授权:", res);    if(res.userInfo) { WindowManage.showMiniLoding();        UserInfo.GetInstance().init(res.userInfo);        button.destroy();        callBack() } }); init (userInfo) { this.nickName = userInfo.nickName    this.avatarUrl = userInfo.avatarUrl    this.gender = userInfo.gender //性别 0:未知、1:男、2:女     // ....... }

    2023-04-20
关闭

选择需要上架的开放服务

  • 模板开发

    针对行业、场景的小程序代开发服务,帮助企业快速搭建小程序

    上架
  • 插件

    提供可被小程序直接使用、丰富小程序能力的功能模块

    上架
  • 小商店服务

    为小商店商家提供更多的能力,帮助商家经营好小商店

    上架
关闭

案例类型

  • 小程序
  • 插件
  • 关于腾讯
  • 运营规范
  • 文档中心
  • 辟谣中心
  • 客服中心
  • Copyright © 2012-2025 Tencent. All Rights Reserved.