ZhangLeo пре 2 месеци
родитељ
комит
9900e77e76
2 измењених фајлова са 157 додато и 11 уклоњено
  1. 142 1
      static/db/downloadDemo.json
  2. 15 10
      utils/dataProcessor.uts

+ 142 - 1
static/db/downloadDemo.json

@@ -33,7 +33,7 @@
 					"photoitem": "标准件防松",
 					"descb": "第一层防晃板对接桁条标准件开口销",
 					"partno": "3",
-					"num": 1,
+					"num": 2,
 					"urlspl": null,
 					"imgname": null,
 					"urlpdt": null,
@@ -74,6 +74,147 @@
 							"creator_deptname": null,
 							"ts": null
 							
+						},
+						{
+							"url": null,
+							"fileno": null,
+							"pk_filetype": null,
+							"filetype": null,
+							"secret_level": null,
+							"author_name": null,
+							"author_code": null,
+							"author_deptno": null,
+							"author_deptname": null,
+							"makedate": null,
+							"uploadDate": "Sep 18, 2025 10:05:38 AM",
+							"size": 1727989,
+							"sizeStr": null,
+							"status": null,
+							"metadata": null,
+							"_id": "d3d4dbad-f97c-4c22-b87d-05e3ced38de2",
+							"fid": null,
+							"billid": "9349c04f4eb74a2491b0b9246111a",
+							"filename": "04-17 (278)(公开).JPG",
+							"scope": null,
+							"ftype": 0,
+							"creator_name": null,
+							"creator_code": null,
+							"creator_deptcode": null,
+							"creator_deptname": null,
+							"ts": null
+							
+						},
+						{
+							"url": null,
+							"fileno": null,
+							"pk_filetype": null,
+							"filetype": null,
+							"secret_level": null,
+							"author_name": null,
+							"author_code": null,
+							"author_deptno": null,
+							"author_deptname": null,
+							"makedate": null,
+							"uploadDate": "Sep 18, 2025 10:05:38 AM",
+							"size": 1727989,
+							"sizeStr": null,
+							"status": null,
+							"metadata": null,
+							"_id": "d3d4dbad-f97c-4c22-b87d-05e3ced38de2",
+							"fid": null,
+							"billid": "9349c04f4eb74a2491b0b9246111a",
+							"filename": "04-17 (278)(公开).JPG",
+							"scope": null,
+							"ftype": 0,
+							"creator_name": null,
+							"creator_code": null,
+							"creator_deptcode": null,
+							"creator_deptname": null,
+							"ts": null
+							
+						}
+					],
+					"photoFiles_object": []
+				},
+				{
+					"pk": "d5a3f01e919845bda8f882e46e67e921",
+					"pid": "0228bc10-6d42-4e0c-98a2-486fe9d80d18",
+					"fktempc": "9349c04f4eb74a2491b0b926755465a",
+					"senum": null,
+					"part": "前低-内侧",
+					"photoitem": "标准件防松",
+					"descb": "第一层防晃板对接桁条标准件开口销",
+					"partno": "3",
+					"num": 2,
+					"urlspl": null,
+					"imgname": null,
+					"urlpdt": null,
+					"createtime": "2025-09-18 09:55:46",
+					"createuser": "XXX",
+					"createuserid": "102661fe-ba54-46f1-a09b-958051942796",
+					"updatetime":null,
+					"updateuser": null,
+					"updateuserid": null,
+					"dr": "0",
+					"pk_corp": "800",
+					"photoFiles_example": [
+						{
+							"url": null,
+							"fileno": null,
+							"pk_filetype": null,
+							"filetype": null,
+							"secret_level": null,
+							"author_name": null,
+							"author_code": null,
+							"author_deptno": null,
+							"author_deptname": null,
+							"makedate": null,
+							"uploadDate": "Sep 18, 2025 10:05:38 AM",
+							"size": 1727989,
+							"sizeStr": null,
+							"status": null,
+							"metadata": null,
+							"_id": "d3d4dbad-f97c-4c22-b87d-05e3ced38de3",
+							"fid": null,
+							"billid": "9349c04f4eb74a2491b0b9246755465a",
+							"filename": "04-17 (278)(公开).JPG",
+							"scope": null,
+							"ftype": 0,
+							"creator_name": null,
+							"creator_code": null,
+							"creator_deptcode": null,
+							"creator_deptname": null,
+							"ts": null
+							
+						},
+						{
+							"url": null,
+							"fileno": null,
+							"pk_filetype": null,
+							"filetype": null,
+							"secret_level": null,
+							"author_name": null,
+							"author_code": null,
+							"author_deptno": null,
+							"author_deptname": null,
+							"makedate": null,
+							"uploadDate": "Sep 18, 2025 10:05:38 AM",
+							"size": 1727989,
+							"sizeStr": null,
+							"status": null,
+							"metadata": null,
+							"_id": "d3d4dbad-f97c-4c22-b87d-05e3ced38de2",
+							"fid": null,
+							"billid": "9349c04f4eb74a2491b0b9246111a",
+							"filename": "04-17 (278)(公开).JPG",
+							"scope": null,
+							"ftype": 0,
+							"creator_name": null,
+							"creator_code": null,
+							"creator_deptcode": null,
+							"creator_deptname": null,
+							"ts": null
+							
 						}
 					],
 					"photoFiles_object": []

+ 15 - 10
utils/dataProcessor.uts

@@ -117,14 +117,20 @@ export const downloadDataFromAPI = async (productCode : string, callback ?: () =
 
 		// 继续执行后续代码...
 		const apiToken = await getTokenFromApi();
-		uni.showLoading({ title: '数据下载中...' });
+		// uni.showLoading({ title: '数据下载中...' });
 
-		// 创建进度条
-		const showProgress = (percentage : number) => {
-			uni.showLoading({
-				title: `图片下载中...${percentage}%`,
-				mask: true
-			});
+		// 创建进度条 - 适配Android设备的解决方案
+		const showProgress = (index : number) => {
+			// 在Android设备上,需要给hideLoading和showLoading之间添加延迟
+			// 先隐藏之前的加载提示
+			uni.hideLoading();
+			// 添加50ms的延迟,确保hideLoading完全执行后再显示新的进度
+			setTimeout(() => {
+				uni.showLoading({
+					title: `正在下载第${index}个任务数据`,
+					mask: true
+				});
+			}, 50);
 		};
 
 
@@ -160,9 +166,8 @@ export const downloadDataFromAPI = async (productCode : string, callback ?: () =
 														for (var i = 0; i < recordList.length; i++) {
 															// 更新进度
 															processedRecords++;
-															const progressPercentage = Math.floor((processedRecords / totalRecords) * 100);
-															showProgress(progressPercentage);
-
+															showProgress(processedRecords);
+															
 															const record : MediaRecordData = recordList[i] as MediaRecordData;
 															// 获取各个字段的值
 															const senum = record.senum;