getUserProfile 无法在setTimeout调用吗?是我的方法写错了么?

小程序 文章 2022-03-17 10:40 418 0 全屏看文

AI助手支持GPT4.0

getUserProfile 无法在setTimeout调用吗?是我的方法写错了么?Can't getUserProfile be called at setTimeout? Is my method wrong?

getUserProfile 无法在setTimeout调用吗?是我的方法写错了么?

onLoad() {

    setTimeout(() => {

    console.log("-------setTimeout-----")

    wx.getUserProfile({

        desc: '展示用户信息', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写

        success: res => {

          console.log("--------getUserProfile------",res)

        }

      })

    }, 3000);

  }

}

Onload() {setTimeout (() = > {console.log ("-------- setTimeout ----") wx.getuserprofile ({desc: 'display user information', / / declare the purpose of obtaining the user's personal information, which will be displayed in the pop-up window later. Please fill in success: res = > {console.log ("-------- getuserprofile ----", RES)})}, 3000);}}

回答:

社区技术运营专员-Jahozheng:

Mr.Zhao:

得用点击事件触发,你写错了

-EOF-

AI助手支持GPT4.0


国内超级便宜服务器

摸鱼人热门新闻聚合

钻级赞助商 我要加入

开发者在线工具

第三方支付技术请加QQ群

相关文章
navgateTominiprogram跳转到其他小程序的指定页面失败?
内网穿透让小程序连接本地mysql, 是否可行?
怎么用云服务器测试微信小程序体验版?
哪位大佬灌水技术这么强?
如何让图片显示需要的大小?
随便看看
企业微信通讯录账号被管理员误/恶意删除,怎么办? 9568
问题? 9048
如何快速搭建抽奖助手小程序(无需代码知识) 6177
许涛 大哥在吗, 要解冻小程序的时候提示信息主体不一致, 能帮忙看下吗? 7472
小程序搜一搜全称搜索不显示 麻烦解决一下!谢谢 6793
我的小程序广告收款主体是个体工商户,每个月邮寄两次发票很是麻烦,我年底的时候打包邮寄一次可以么? 6128
如何解决渲染层网络错误Failed to load media? 17394
小程序找号找回 释放昵称? 3253
我的小程序广告主收入5301,实际进账4406,是怎么回事呀? 3108
删除部分微信用户个人数据的通知,怎么删除? 6381