css代码
<camera device-position="back" flash="off" binderror="error" style="width: 100%; height: 300px;" hidden=""></camera>
<button type="front" bindtap="takePhoto">拍照</button>
<image src="{ {img}}"></image>
<button bindtap="photo">上传照片</button>
js代码:
data: {
second: "",
img: "",
hidden: true
},
photo: function () {
var that = this
wx.showModal({
title: '照片选择',
content: '请选择',
cancelText: "拍照",
confirmText: "选择图片",