!--wxml--camera device-position="front" flash="auto" binderror="error" class="camera"  cover-view    cover-view class="viewTakePhoto"      cover-image class="btnImg" src="../../images/btnTakePhoto.png" bindtap="clickTakePhoto"/    /cover-view  /cover-view/camera/**wxss.wxss**/wxss.viewTakePhoto{  flex: 1;  height: 100%;  text-align: center;  line-height: 50px;}.btnImg {  width: 100rpx;  height: 100rpx;  margin-top: 430px;  margin-left:310rpx;}.camera{  width: 100%;  height:550px;} //js  clickTakePhoto: function () {    const ctx = wx.createCameraContext()    ctx.takePhoto({      quality: 'high',      success: (res) = {        console.log(res.tempImagePath)      }    })  },  error(e) {    console.log(e.detail)  }注:微信开发者工具版本低,照片会有蓝色滤镜,微信开发者工具要更新到最新版本

TAG标签: 微信小程序camera

http://www.xiaochengxub.com/read-105904.html