美文网首页
微信获取摄像头+拍照回显

微信获取摄像头+拍照回显

作者: 无酒之人 | 来源:发表于2019-08-01 14:55 被阅读0次
  • 获取摄像头:
<camera style="width: 100%; height: 450px;"></camera>
  • 拍照
takePhoto() {
    const ctx = wx.createCameraContext()
      ctx.takePhoto({
        quality: 'high',
        success: (res) => {
          this.src = res.tempImagePath
          console.log(this.src)
        }
      })
    },
  • 回显
<image mode="widthFix" src="{{src}}"></image>

相关文章

网友评论

      本文标题:微信获取摄像头+拍照回显

      本文链接:https://www.haomeiwen.com/subject/qrnqdctx.html