微信web开发者工具 如何模拟调用摄像头的情况
发布于 7 年前 作者 weibogu 2476 次浏览 来自 问答

目前在尝试开发微信小程序,需要调用手机摄像头,但是在开发者工具中无法模拟这一情况。请问大家是如何解决的?谢谢! 使用的功能如下:

chooseimage: function () { var that = this; wx.showActionSheet({ itemList: [‘从相册中选择’, ‘拍照’], itemColor: “#CED63A”, success: function (res) { if (!res.cancel) { if (res.tapIndex == 0) { that.chooseWxImage(‘album’) } else if (res.tapIndex == 1) { that.chooseWxImage(‘camera’) } } } }) },//chooseimage; chooseWxImage: function (type) { var that = this; wx.chooseImage({ sizeType: [‘original’, ‘compressed’], sourceType: [type], success: function (res) { console.log(res); that.setData({ tempFilePaths: res.tempFilePaths[0], }) } }) },//choooseWxImage;

回到顶部