我们也遇到了,望尽快解答
华为p30 pro,mate20x ,红米10pro微信小程序拍照功能失效昨天开始,收到部分用户投诉说华为p30 pro,mate20x ,红米10pro微信小程序拍照功能失效,导致我们小程序拍照打卡功能失效。 [图片][图片] 客户拍摄效果: [图片] 微信版本:8.0.3 ;基础库为2.16.1 相关测试代码已经粘贴: const app = getApp() Page({ data: { imagUrl:"" }, onLoad() { }, toUpload(){ let that = this; wx.chooseImage({ count: 1, sizeType: ['original'], sourceType: ['camera'], success (res) { const tempFilePaths = res.tempFilePaths; console.log('得到图片路径',tempFilePaths); that.setData({ imagUrl:tempFilePaths[0] }) that.beginUpload(tempFilePaths[0]) } }) }, beginUpload(path){ wx.uploadFile({ url: 'http://118.122.115.51:5380/upload/uploadController/uploadOssWatermark', filePath: path, name: 'file', header: { loginUserToken:'4bb64872a7554057b5552e4b22b44c6f' }, formData:{ name:'测试人员', address:"测试地址", }, success: res => { console.log('上传成功',res.data) wx.hideLoading() if(res.statusCode == 200){ let data = JSON.parse(res.data) if(data.success){ console.log('上传图片路径为',data) }else{ wx.showToast({ title: data.message, mask:true, icon:'none' }) } }else{ wx.showToast({ title: '上传图片服务器异常!', mask:true, icon:'none' }) } }, fail: () => { wx.hideLoading() wx.showToast({ title: '上传图片服务器异常!', mask:true, icon:'none' }) } }) } }) <view class="intro"> <image src="{{imagUrl}}" style="width:200rpx;height:200rpx;margin-bottom:20rpx"></image> <view class="upload-img" bindtap="toUpload">点击拍照</view> </view> .intro { margin: 30px; text-align: center; display: flex; align-items: center; flex-flow: column; justify-content: center; } .upload-img{ width: 150rpx; height: 80rpx; border:2rpx solid #ccc; display: flex; align-items: center; justify-content: center; font-size: 24rpx; color: #333; border-radius: 8rpx; } 希望官方予以解决回复,谢谢
2021-04-27