7***@qq.com
7***@qq.com
  • 发布:2021-12-08 16:17
  • 更新:2022-12-21 14:38
  • 阅读:761

【报Bug】uniapp使用IPhone X上传照片时无反应

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: win10

HBuilderX类型: 正式

HBuilderX版本号: 3.2.9

手机系统: iOS

手机系统版本号: iOS 11.4

手机厂商: 苹果

手机机型: MQA82CH/A

页面类型: vue

vue版本: vue2

打包方式: 云端

项目创建方式: HBuilderX

示例代码:

uni.uploadFile({
url: uni.getStorageSync('serviceUrl') + 'fixedPlacePatrol/add',
name: 'files',
fileType: "image",
files: [...this.userInfo.map((item, index) => ({
name: "" + index,
uri: item
})), ...this.checkInfo.map(item => item.imgList.map((img, index) => ({
name: item.id + "-" + index,
uri: img
}))).flat(2)],
formData: {
userId: uni.getStorageSync("USERBEAN").id,
placeId: this.id,
...(this.taskId ? {
taskId: this.taskId
} : {}),
placeName: this.name,
placeType: this.placeType,
checkUser: uni.getStorageSync("USERBEAN").name,
checkResult: JSON.stringify(this.checkInfo.map(item => ({
id: item.id,
inspection: item.inspection,
result: item.result
}))),
suggestion: this.remark,
startCheckTime: this.strtime,
inspection: this.slectCheckDirection
},
header: {
"Authorization": uni.getStorageSync('user_token'),
"content-type": "multipart/form-data"
},
method: 'POST',
success: (uploadFileRes) => {
uni.resInterceptor(uploadFileRes);
uni.hideLoading();
if (uploadFileRes.statusCode == 200) {
var res = JSON.parse(uploadFileRes.data);
if (res.code == 200) {
uni.showToast({
title: '成功',
duration: 2000,
complete:()=> {
setTimeout(() => {
uni.navigateBack({
delta: this.taskId ? 2 : 1
})
}, 1000)
}
})
_this.dateProceed(4)
} else {
uni.showToast({
title: res.msg,
icon: 'none'
})
this.isEnd = false;
}
} else {
uni.showToast({
title: uploadFileRes.errMsg,
icon: 'none'
})
this.isEnd = false;
}
},
fail: (err) => {
uni.hideLoading();
uni.showToast({
title: '网络异常,请稍候再试',
icon: 'none'
})
this.isEnd = false;
},
complete: () => {
setTimeout(() => {
uni.hideLoading()
}, 1000)
}

            })

操作步骤:

拍照完成,点击上传

预期结果:

有成功或者失败的返回值

实际结果:

没有任何反应

bug描述:

IPhone X手机拍照后提交上传无反应,没有返回值可追溯,别的安卓手机和别的版本的苹果手机正常

2021-12-08 16:17 负责人:DCloud_iOS_XHY 分享
已邀请:
7***@qq.com

7***@qq.com (作者)

问题定位到最新位置,是因为IPHONE X手机拍照后加了水印后上传提交无反应

DCloud_iOS_XHY

DCloud_iOS_XHY

使用新版本测试i一下,问题是否解决?

明月洁无暇

明月洁无暇

兄弟,问题解决了嘛

要回复问题请先登录注册