Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onGetPhoneNumber 不生效 #14715

Closed
liaoshengrong opened this issue Oct 29, 2023 · 1 comment
Closed

onGetPhoneNumber 不生效 #14715

liaoshengrong opened this issue Oct 29, 2023 · 1 comment
Labels
F-react Framework - React question Further information is requested T-weapp Target - 编译到微信小程序 V-3 Version - 3.x

Comments

@liaoshengrong
Copy link

相关平台

微信小程序

复现仓库

https://gitee.com/promisez/create-a-world.git
小程序基础库: 2.25.3
使用框架: React

复现步骤

  <AtButton
    type="primary"
    openType="getPhoneNumber"
    onGetPhoneNumber={(res) => {
      console.log(res, "opensertin");
    }}
  >
    登录
  </AtButton>

onGetPhoneNumber 不执行,点击按钮没反应

期望结果

onGetPhoneNumber 会执行

实际结果

onGetPhoneNumber 不执行,点击按钮没反应

环境信息

node: 16.0.0
windows环境
安卓真机调试

👽 Taro v3.6.18


  Taro CLI 3.6.18 environment info:
    System:
      OS: Windows 10 10.0.19045
    Binaries:
      Node: 20.5.1 - C:\Program Files\nodejs\node.EXE  
      Yarn: 1.22.19 - C:\Program Files\nodejs\yarn.CMD 
      npm: 9.8.0 - C:\Program Files\nodejs\npm.CMD     
    npmPackages:
      @tarojs/cli: 3.6.17 => 3.6.17 
      @tarojs/components: 3.6.17 => 3.6.17 
      @tarojs/helper: 3.6.17 => 3.6.17 
      @tarojs/plugin-framework-react: 3.6.17 => 3.6.17 
      @tarojs/plugin-html: ^3.6.17 => 3.6.18 
      @tarojs/plugin-platform-alipay: 3.6.17 => 3.6.17 
      @tarojs/plugin-platform-h5: 3.6.17 => 3.6.17     
      @tarojs/plugin-platform-jd: 3.6.17 => 3.6.17     
      @tarojs/plugin-platform-qq: 3.6.17 => 3.6.17     
      @tarojs/plugin-platform-swan: 3.6.17 => 3.6.17   
      @tarojs/plugin-platform-tt: 3.6.17 => 3.6.17     
      @tarojs/plugin-platform-weapp: 3.6.17 => 3.6.17  
      @tarojs/react: 3.6.17 => 3.6.17 
      @tarojs/runtime: 3.6.17 => 3.6.17 
      @tarojs/shared: 3.6.17 => 3.6.17 
      @tarojs/taro: 3.6.17 => 3.6.17 
      @tarojs/taro-loader: 3.6.17 => 3.6.17 
      @tarojs/webpack5-runner: 3.6.17 => 3.6.17        
      babel-preset-taro: 3.6.17 => 3.6.17 
      eslint-config-taro: 3.6.17 => 3.6.17 
      react: ^18.0.0 => 18.2.0
      taro-ui: ^3.1.1 => 3.1.1

补充信息

需要调起微信授权,获取用户的电话号码、头像、这些事件都不生效

@ZakaryCode ZakaryCode added V-3 Version - 3.x F-react Framework - React T-weapp Target - 编译到微信小程序 labels Nov 1, 2023
@Chen-jj
Copy link
Contributor

Chen-jj commented Nov 7, 2023

@liaoshengrong 复现仓库中找不到 onGetPhoneNumber 相关代码。而且你的 onGetPhoneNumber 写在 AtButton 上了?这是 UI 库的按钮组件吧,改为 Button 试试

@Chen-jj Chen-jj added the question Further information is requested label Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-react Framework - React question Further information is requested T-weapp Target - 编译到微信小程序 V-3 Version - 3.x
Projects
Archived in project
Development

No branches or pull requests

4 participants