html52.com
我爱小程序-开发者交流社区

手机号授权出现的问题

问题模块
API和组件

手机号授权出现的问题,求回复

wxml代码

<button wx:else class="layer-btn layer-weixin-btn" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumberBind"><image class="layer-icon" src="/img/icon_vx.png">image>微信登录button>

js代码

//点击微信登录

 getPhoneNumberBind: function (e) {

   this.setData({

     haveTap: true

   });

   console.log(e);

   var _this = this;

   let params = app.globalData;

   params.event = e;

   app.Auth.getPhoneNumber(params).then(function (res) {

     console.log('getPhoneNumber', res);

     if (res.phoneNumber) {

       app.globalData.havePhone = 1;

       app.globalData.phoneNumber = res.phoneNumber;

       _this.setData({

         havePhone: true,

         phoneNumber: res.phoneNumber,

         phoneLayer: false,

         haveTap: false

       }, function () {

         app.Util.wxRequest({

             url: "https://smallprogram.sunlands.com/xueli/api/submitmobile.php?siteid=" +

                 (app.globalData.channelSite || "6032326856") +

                 "&msg.phone=" + res.phoneNumber +

                 "&msg.messageId=&msg.schoolId=&msg.field1=&msg.field2=&msg.field3=&msg.remark=&msg.email=&msg.school_code=&msg.message_type=&msg.name=&msg.project_code=&callback=&msg.legionId="

         }).then(function(res) {

             console.log('tianwang', res)

         })

       })

     } else {

       _this.setData({

         haveTap: false

       });

     }

   });

 },

采用微信自带的微信手机号授权按钮,多次连续点击按钮,在安卓机上会多次出现授权弹框,而在苹果机上则不会

网友回复

万扬[奋斗]:

好的

June:

你好,这是一个已知问题,我们会在后续版本中进行修复。

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

真正的个人免签约支付接口

云免签H5支付