codan
codan
  • 发布:2020-09-02 14:46
  • 更新:2020-09-02 14:46
  • 阅读:1291

使用uni-app开发支付宝获取手机号功能失败

分类:uni-app

uni-app:

<!-- #ifdef MP-ALIPAY -->  
        <button  
            class="login-btn login-btn-ali"  
            open-type="getAuthorize"  
            @onGetAuthorize="onAliUserPhone"  
            @onError="onAuthError"  
            scope="phoneNumber"  
        >  
            <tui-icon name="alipay" :size="17" color="#ffffff"></tui-icon>  
            <text class="login-text">支付宝一键登录</text>  
        </button>  
<!-- #endif -->

支付宝:

<!-- #ifdef MP-ALIPAY -->  
          <button  
            class="login-btn login-btn-ali"  
            open-type="getAuthorize"  
            onGetAuthorize="onAliUserPhone"  
            onError="onAuthError"  
            scope="phoneNumber"  
        >  
            <tui-icon name="alipay" :size="17" color="#ffffff"></tui-icon>  
            <text class="login-text">支付宝一键登录</text>  
        </button>  
<!-- #endif -->

为什么在用支付宝开发工具直接写就能正常唤起授权,用uni-app写的就没有动静呢?

在支付宝的开发工具里面写的代码可以在模拟器以及手机中正常使用并且返回信息,但是在uni-app中写的就一点动静都没有,只是一个普通的没有任何作用的button。

2020-09-02 14:46 负责人:无 分享
已邀请:

该问题目前已经被锁定, 无法添加新回复