data() {
return {
getHeight: '200', // camera 组件高度
device: 'back', //前置或后置摄像头,值为front, back
frame: 'large', //指定期望的相机帧数据尺寸
flash: 'on', // 闪光灯,值为auto, on, off
nowTime: '', //日期
nowTime2: '', //时间
name: '',
liftName: '',
address: '', //当前地址信息
sgdUrl: '../../static/sgd.png', // 闪光灯图片地址
xzUrl: '../../static/xz.png',
leftUrl:'../../static/left.png',
top: 40,
}
},
// 点击拍照
takePhoto() {
var that = this;
const ctx = uni.createCameraContext();
// 创建并返回 camera 组件的上下文 cameraContext 对象
// 拍照
ctx.takePhoto({
quality: 'high', // 图片质量高
success: (res) => {
var tempImagePath = res.tempImagePath; // 临时图片路径
}
});
},
1 个回复
YUANRJ
请向微信小程社区反馈