<!--wxml-->
< camera device-position = "front" flash = "auto" binderror = "error" class = "camera">
< camera device-position = "front" flash = "auto" binderror = "error" class = "camera">
<
cover-view
>
<
cover-view
class
=
"btnTakePhoto">
<
cover-image
class
=
"btnImg"
src
=
"../../images/btnTakePhoto.png"
bindtap
=
"clickTokePhoto"
/
>
</
cover-view
>
</
cover-view
>
</
camera
>
<!--wcss-->
<!--js-->
<!--wcss-->
.btnTakePhoto
{
flex:
1
;
height:
100%
;
text-align:
center
;
line-height:
50px
;
}
.btnImg
{
width:
100
rpx
;
height:
100
rpx
;
margin-top:
430px
;
margin-left:
310
rpx
;
}
.camera
{
width:
100%
;
height:
550px
;
}
clickTokePhoto:
function
() {
var
that =
this
const
ctx = wx.createCameraContext()
ctx.takePhoto({
quality:
'high'
,
success: (res) => {
console.log(res.tempImagePath)
}
})
}