APPID:wx41ad20987ed5159c


getPhoneNumber


<button class='btn' open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">登录</button>


if (e.detail.errMsg === 'getPhoneNumber:ok') {

     wx.request({    

        url: app.globalData.globalUrl + "users/register_bind",

        data: {

            p: 'wx',

            openid: openid,

            encrypt: e.detail.encryptedData,

            iv: e.detail.iv,

        },

        method: 'POST',

        header: {

            'Accept': 'application/json' // 默认值

        },

        success: function (res) {

            console.log(res.data) 

        }

    })

} else if (e.detail.errMsg === 'getPhoneNumber:fail user deny') {

    wx.showModal({

        title: '提示',

        content: '您拒绝了授权,将无法正常体验。',

        showCancel: false,

        confirmText: '重新授权',

        success: function (res) {

            if (res.confirm) {

            console.log('用户点击确定')

            }

        }

    })

} else if (e.detail.errMsg === 'getPhoneNu

展开全部
收起
2回答
提交回答
  • 至过去的我

    2044人对此回答表示赞同

    我是未来的你,你现在是不是在年找寻小程序答案。你不要感觉诧异,给你来信原因,就是让你不在后悔。今天去学习如何推广小程序,相信......点击查看更多>
    发布于
  • fjbiubiubiu

    15人对此回答表示赞同

    我在华为机上测试正常,麻烦提供如下信息,谢谢:

    展开
    15
    2回复
    发布于 6年前

    评论(2)

    收起评论

    • shutmeup 2019-01-14 23:37


      回复
    • 孤独彼岸 2019-01-16 16:14

      我在开发者工具上用基础库1.1.1以下试的时候是无反应的,也没有任何提示。

      回复
  • Thomas

    8人对此回答表示赞同

    这个列表是在那儿呀我看文档里没有些最低支持的版本

    展开
    8
    1回复
    发布于 6年前

    评论(1)

    收起评论

    • Ezekiel 2019-01-12 10:10

      https://developers.weixin.qq.com/miniprogram/dev/component/button.html

      回复
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
咨询热线

13312967497

扫码添加业务即可随时咨询 还可领取小程序推广攻略

业务咨询: 13312967497
扫码咨询

扫码咨询套餐

回到顶部