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

takePhoto 支付宝小程序无反应 #14705

Closed
zzyzjc opened this issue Oct 26, 2023 · 1 comment · Fixed by #14711 or #14811
Closed

takePhoto 支付宝小程序无反应 #14705

zzyzjc opened this issue Oct 26, 2023 · 1 comment · Fixed by #14711 or #14811
Labels
F-react Framework - React T-alipay Target - 编译到支付宝小程序 V-3 Version - 3.x

Comments

@zzyzjc
Copy link

zzyzjc commented Oct 26, 2023

相关平台

支付宝小程序

复现仓库

git@github.com:zzyzjc/taro-react-test.git
小程序基础库: 2.8.15
使用框架: React

复现步骤

支付宝小程序开发者工具真机调试后,点击屏幕“拍照”按钮。

期望结果

执行takenPhoto函数,完成拍照操作。

实际结果

takePhoto未执行

环境信息

👽 Taro v3.6.11


  Taro CLI 3.6.11 environment info:
    System:
      OS: macOS 12.3
      Shell: 5.8 - /bin/zsh
    Binaries:
      Node: 16.14.0 - /usr/local/bin/node
      Yarn: 1.22.19 - /usr/local/bin/yarn
      npm: 8.3.1 - /usr/local/bin/npm
    npmPackages:
      @tarojs/cli: 3.6.11 => 3.6.11 
      @tarojs/components: 3.6.11 => 3.6.11 
      @tarojs/helper: 3.6.11 => 3.6.11 
      @tarojs/plugin-framework-react: 3.6.11 => 3.6.11 
      @tarojs/plugin-platform-alipay: 3.6.11 => 3.6.11 
      @tarojs/plugin-platform-h5: 3.6.11 => 3.6.11 
      @tarojs/plugin-platform-jd: 3.6.11 => 3.6.11 
      @tarojs/plugin-platform-qq: 3.6.11 => 3.6.11 
      @tarojs/plugin-platform-swan: 3.6.11 => 3.6.11 
      @tarojs/plugin-platform-tt: 3.6.11 => 3.6.11 
      @tarojs/plugin-platform-weapp: 3.6.11 => 3.6.11 
      @tarojs/react: 3.6.11 => 3.6.11 
      @tarojs/runtime: 3.6.11 => 3.6.11 
      @tarojs/shared: 3.6.11 => 3.6.11 
      @tarojs/taro: 3.6.11 => 3.6.11 
      @tarojs/taro-loader: 3.6.11 => 3.6.11 
      @tarojs/webpack5-runner: 3.6.11 => 3.6.11 
      babel-preset-taro: 3.6.11 => 3.6.11 
      eslint-config-taro: 3.6.11 => 3.6.11 
      react: ^18.0.0 => 18.2.0 

@taro-bot2 taro-bot2 bot added F-react Framework - React T-alipay Target - 编译到支付宝小程序 V-3 Version - 3.x labels Oct 26, 2023
@liuchuzhang
Copy link
Contributor

liuchuzhang commented Oct 28, 2023

@zzyzjc 这个我也踩了个坑,支付宝小程序的 createCameraContext 必须得传 camera 的 id

const context = Taro.createCameraContext('camera')
context.takePhoto({ })
<Camera id="camera" />

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-react Framework - React T-alipay Target - 编译到支付宝小程序 V-3 Version - 3.x
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants