收藏
回答

wx.chooseMedia里的camera: 'back'不能限制只用后置摄像头,现在前后都可用?

wx.chooseMedia({
      count1,
      mediaType: ['image'],
      sourceType: ['album''camera'],
      sizeType: ['compressed'],
      camera'back',
      success: function (res) {
        console.log(res.tempFiles[0])
        //console.log(res.tempFiles[0].size)
        if (res.tempFiles[0].size<30000){
          wx.showToast({
            title'照片太小',
            duration50000
            })
            console.log('照片太小')
        }else{
        _this.setData({
          imageSrc: res.tempFiles[0].tempFilePath,
        })
        _this.loadImage();
        }
      },
    })
回答关注问题邀请回答
收藏

1 个回答

登录 后发表内容