We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
微信小程序
小程序基础库: 2.20.1 使用框架: React
(async ()=>{ await Taro.requestPayment({ ...props,fail: () => {}}) console.log('await/async not working!') })()
期待代码可以停止等待支付完成
调起了支付,但是代码会继续往后执行
Taro v3.3.12 Taro CLI 3.3.12 environment info: System: OS: macOS 10.14.6 Shell: 5.3 - /bin/zsh Binaries: Node: 12.18.3 - /usr/local/bin/node npm: 6.14.6 - /usr/local/bin/npm npmPackages: @tarojs/cli: 3.3.12 => 3.3.12 @tarojs/components: 3.3.12 => 3.3.12 @tarojs/mini-runner: 3.3.12 => 3.3.12 @tarojs/react: 3.3.12 => 3.3.12 @tarojs/runtime: 3.3.12 => 3.3.12 @tarojs/taro: ^3.3.12 => 3.3.12 @tarojs/webpack-runner: 3.3.12 => 3.3.12 babel-preset-taro: 3.3.12 => 3.3.12 eslint-config-taro: 3.3.12 => 3.3.12 react: ^17.0.2 => 17.0.2 taro-ui: ^3.0.0-alpha.10 => 3.0.0-alpha.10 npmGlobalPackages: typescript: 4.4.0-dev.20210702
The text was updated successfully, but these errors were encountered:
@hyisfine 这个 API 在微信文档里标注了支持 Promise 调用的,对于此类 API,Taro 不会做额外操作,都是直接调用小程序底层 API。
因此,你测试到的结果是微信小程序的标准表现。也就是说,当传入了回调函数,此 API 就不支持 Promise 调用了。如果你要用 Promise 形式,就不要传回调函数,而是使用 try catch 捕捉错误。
Sorry, something went wrong.
No branches or pull requests
相关平台
微信小程序
小程序基础库: 2.20.1
使用框架: React
复现步骤
(async ()=>{
await Taro.requestPayment({ ...props,fail: () => {}})
console.log('await/async not working!')
})()
期望结果
期待代码可以停止等待支付完成
实际结果
调起了支付,但是代码会继续往后执行
环境信息
The text was updated successfully, but these errors were encountered: