uniapp微信小程序_拍照从相册选择

	userImg() {
				let that = this
				uni.chooseMedia({
					count: 1,
					mediaType: ['image', 'video'],
					sourceType: ['album', 'camera'],
					maxDuration: 30,
					camera: 'back',
					success(res) {
						console.log(res.tempFiles[0].tempFilePath)
						that.imagUrl = res.tempFiles[0].tempFilePath
					}
				})
			},

直接调用api即可,注意的是要把值赋给你需要的,this指向需要注意一下

相关推荐

  1. 程序相关

    2024-03-15 08:28:03       32 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-03-15 08:28:03       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-03-15 08:28:03       100 阅读
  3. 在Django里面运行非项目文件

    2024-03-15 08:28:03       82 阅读
  4. Python语言-面向对象

    2024-03-15 08:28:03       91 阅读

热门阅读

  1. Error: ENOENT: no such file or directory, uv_cwd

    2024-03-15 08:28:03       32 阅读
  2. 微信小程序uniapp onshow函数介绍

    2024-03-15 08:28:03       38 阅读
  3. YOLOv8 服务器与本地tensorboard映射

    2024-03-15 08:28:03       44 阅读
  4. SpringBoot自动配置工作流程中变更自动配置

    2024-03-15 08:28:03       38 阅读
  5. fpga相关知识

    2024-03-15 08:28:03       44 阅读
  6. Elastic Stack--10--QueryBuilders UpdateQuery

    2024-03-15 08:28:03       31 阅读
  7. #android中的框架层

    2024-03-15 08:28:03       42 阅读
  8. VSCode 写Markdown数学公式,随时补充

    2024-03-15 08:28:03       40 阅读
  9. #android不同版本废弃api,新api。

    2024-03-15 08:28:03       40 阅读
  10. npm-软件包管理器

    2024-03-15 08:28:03       39 阅读
  11. PS IDEA VSCode MySQL Linux快捷键 整理

    2024-03-15 08:28:03       36 阅读