i***@126.com
i***@126.com
  • 发布:2025-08-08 17:07
  • 更新:2025-08-08 17:20
  • 阅读:36

chooseImage 在h5页面 没有拍照功能只能选择相册

分类:uni-app

chooseImage 在h5页面 没有拍照功能只能选择相册 ,浏览器为 chrome 版本 92.0.4515.105

 chooseImage() {  
      uni.chooseImage({  
        count: 1,  
        sourceType: [ 'camera'],  
        success(res) {  

          }  
        }  
      })  
    }
2025-08-08 17:07 负责人:无 分享
已邀请:
DCloud_UNI_JBB

DCloud_UNI_JBB

下面的代码我在安卓手机的浏览器上面即可以拍照又能相册选择,你试试

<template>  
    <view>  
        <button @click="handleClick">click me</button>  
    </view>  
</template>  

<script setup>  
    function handleClick() {  
        uni.chooseImage({  
            count: 1,  
            sourceType: ['camera'],  
            success(res) {  
                console.log(res, 'res')  
            }  
        })  
    }  
</script>  

<style>  
    .red {  
        color: red;  
    }  
</style>
  • i***@126.com (作者)

    您好 感谢解答,在大部分手机上是可以实现拍照功能的,现在问题是有的部分手机(systemInfo 中浏览器版本为 chrome 版本 92.0.4515.105)会出现没有拍照选项,只能从相册选择的现象

    2025-08-13 15:09

要回复问题请先登录注册