1.要求相机是圆形的,因为小程序调用原生相机,永远在屏幕最顶层,只能在camera标签里使用cover-view和cover-image标签,用一张图片盖在相机上,效果如下图:
<!-- 调用摄像头的组件-->
<view class='cameraBox' >
<camera class='camera' device-position="front" flash="off" binderror="error">
<cover-view class='cameraGai'>
<!-- <cover-image src='../images/shape/bg.png' class='cover-animate'></cover-image> -->
<cover-image src='../images/vip.png' class='cover-image'></cover-image>
</cover-view>
</camera>
</view>
因为要求调用前置摄像头,所以device-position="front"
详细可参考https://blog.csdn.net/u010606780/article/details/80887589