请官方复查
// res.tempImagePath 这个获取到的数据为 null,但是 res 具体获取到的是什么数据还不知道,
// 现在添加了新的日志信息,后续线上环境再触发才会知道这个数据是什么
<!-- camera.wxml -->
<camera device-position="back" flash="off" binderror="error" style="width: 100%; height: 300px;"></camera>
<button type="primary" bindtap="takePhoto">拍照</button>
<view>预览</view>
<image mode="widthFix" src="{{src}}"></image>
// camera.js
Page({
takePhoto() {
const ctx = wx.createCameraContext()
ctx.takePhoto({
quality: 'high',
success: (res) => {
// res.tempImagePath 这个获取到的数据为空,但是 res 具体获取到的是什么数据还不知道,
// 现在添加了新的日志信息,后续线上环境再触发才会知道这个数据是什么
this.setData({
src: res.tempImagePath
})
}
})
},
error(e) {
console.log(e.detail)
}
})
这个是具体的手机信息,目前只发现这个手机机型有问题
{
"systemInfo":{
"screenWidth":384,
"cpuType":"unknown",
"phoneCalendarAuthorized":true,
"windowHeight":619,
"bluetoothEnabled":true,
"language":"zh_CN",
"microphoneAuthorized":true,
"fontSizeScaleFactor":1,
"locationAuthorized":true,
"notificationAuthorized":true,
"model":"PGU110",
"statusBarHeight":36,
"safeArea":{
"width":384,
"right":384,
"top":36,
"left":0,
"bottom":754,
"height":718
},
"brand":"OPPO",
"windowWidth":384,
"locationEnabled":true,
"benchmarkLevel":35,
"screenHeight":754,
"abi":"arm64-v8a",
"version":"8.0.32",
"cameraAuthorized":true,
"deviceAbi":"arm64-v8a",
"system":"Android 13",
"memorySize":15171,
"fontSizeSetting":16,
"pixelRatio":2.8125,
"deviceOrientation":"portrait",
"wifiEnabled":true,
"screenTop":82,
"platform":"android",
"SDKVersion":"2.30.4",
"enableDebug":false,
"devicePixelRatio":2.8125,
"host":{
"env":"WeChat",
"version":671096925
},
"mode":"default"
}
}
由于是线上环境出的问题,我们本身没有这个型号的手机,所以并没有复现过这个问题,只是在日志里定位到这个问题,请官方复查,我会在后续的日志里打印出 res 结果
手机型号是什么
"systemInfo":{
"screenWidth":384,
"cpuType":"unknown",
"phoneCalendarAuthorized":true,
"windowHeight":619,
"bluetoothEnabled":true,
"language":"zh_CN",
"microphoneAuthorized":true,
"fontSizeScaleFactor":1,
"locationAuthorized":true,
"notificationAuthorized":true,
"model":"PGU110",
"statusBarHeight":36,
"safeArea":{
"width":384,
"right":384,
"top":36,
"left":0,
"bottom":754,
"height":718
},
"brand":"OPPO",
"windowWidth":384,
"locationEnabled":true,
"benchmarkLevel":35,
"screenHeight":754,
"abi":"arm64-v8a",
"version":"8.0.32",
"cameraAuthorized":true,
"deviceAbi":"arm64-v8a",
"system":"Android 13",
"memorySize":15171,
"fontSizeSetting":16,
"pixelRatio":2.8125,
"deviceOrientation":"portrait",
"wifiEnabled":true,
"screenTop":82,
"platform":"android",
"SDKVersion":"2.30.4",
"enableDebug":false,
"devicePixelRatio":2.8125,
"host":{
"env":"WeChat",
"version":671096925
},
"mode":"default"
}