1.补传错误码toast去除
2.界面错误数据修复
This commit is contained in:
		
							parent
							
								
									14ef2d650e
								
							
						
					
					
						commit
						c1633e80a7
					
				| @ -1,8 +1,15 @@ | |||||||
| import http from '@ohos.net.http'; | import http from '@ohos.net.http'; | ||||||
| import convertxml from '@ohos.convertxml'; | import convertxml from '@ohos.convertxml'; | ||||||
| import prompt from '@ohos.prompt'; |  | ||||||
| import Prompt from '@system.prompt'; | import Prompt from '@system.prompt'; | ||||||
| 
 | 
 | ||||||
|  | function ifNeedRetry(code: number | string): boolean { | ||||||
|  |   let arr = ["B210010", "B210023", "B210024", "B210031", "B210033", "B210034", "B210041"] | ||||||
|  |   if (!arr.includes(code + "") && code != 1) { | ||||||
|  |     return true | ||||||
|  |   } | ||||||
|  |   return false | ||||||
|  | } | ||||||
|  | 
 | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * @author: Renjun Su |  * @author: Renjun Su | ||||||
| @ -82,6 +89,7 @@ export default async function tempRequest<T>(req: any): Promise<T> { | |||||||
|             resolve(res) |             resolve(res) | ||||||
|             return |             return | ||||||
|           } else { |           } else { | ||||||
|  | 
 | ||||||
|             Prompt.showToast({ |             Prompt.showToast({ | ||||||
|               message: decodeURIComponent(resObj.resultMessage), |               message: decodeURIComponent(resObj.resultMessage), | ||||||
|               duration: 3000 |               duration: 3000 | ||||||
| @ -91,10 +99,6 @@ export default async function tempRequest<T>(req: any): Promise<T> { | |||||||
|           } |           } | ||||||
|         }).catch(Error => { |         }).catch(Error => { | ||||||
|         console.info('test-error0' + url + ' error:resp: ' + JSON.stringify(Error.message)) |         console.info('test-error0' + url + ' error:resp: ' + JSON.stringify(Error.message)) | ||||||
|         // Prompt.showToast({
 |  | ||||||
|         //   message: Error?.message == 'Failure when receiving data from the peer' ? '网络异常,请重试' : Error?.message,
 |  | ||||||
|         //   duration: 5000
 |  | ||||||
|         // });
 |  | ||||||
|         reject(Error) |         reject(Error) | ||||||
|       }) |       }) | ||||||
| 
 | 
 | ||||||
| @ -106,10 +110,6 @@ export default async function tempRequest<T>(req: any): Promise<T> { | |||||||
|           code: -1 |           code: -1 | ||||||
|         }) |         }) | ||||||
|       } |       } | ||||||
|       // Prompt.showToast({
 |  | ||||||
|       //   message: e?.message=='Failure when receiving data from the peer'?'网络异常,请重试':e?.message,
 |  | ||||||
|       //   duration: 5000
 |  | ||||||
|       // });
 |  | ||||||
|       reject({ |       reject({ | ||||||
|         code: e.code |         code: e.code | ||||||
|       }) |       }) | ||||||
| @ -159,7 +159,7 @@ function handleCenterCode(msgXml, isNewCenter) { | |||||||
|     const result = msg?.data[0]?.result; |     const result = msg?.data[0]?.result; | ||||||
|     if (result) { |     if (result) { | ||||||
|       const { code, message, retval } = result |       const { code, message, retval } = result | ||||||
|       if (code != '1') { |       if (!ifNeedRetry(code)) { | ||||||
|         const rMessage = decodeURIComponent(message as string) |         const rMessage = decodeURIComponent(message as string) | ||||||
|         Prompt.showToast({ |         Prompt.showToast({ | ||||||
|           message: rMessage, |           message: rMessage, | ||||||
| @ -178,14 +178,11 @@ function handleCenterCode(msgXml, isNewCenter) { | |||||||
|     return patternArr && patternArr[1] |     return patternArr && patternArr[1] | ||||||
|   }); |   }); | ||||||
| 
 | 
 | ||||||
|   if (code != '1') { |   if (!ifNeedRetry(code)) { | ||||||
|     prompt.showToast({ |     Prompt.showToast({ | ||||||
|       message: decodeURIComponent(message as string), |       message: decodeURIComponent(message as string), | ||||||
|       duration: 3000 |       duration: 3000 | ||||||
|     }); |     }); | ||||||
|     // globalThis.type='1'
 |  | ||||||
|     // globalThis.title=decodeURIComponent(message as string)
 |  | ||||||
|     // globalThis.errorDialog.open()
 |  | ||||||
|     return { code, message: decodeURIComponent(message) } |     return { code, message: decodeURIComponent(message) } | ||||||
|   } else { |   } else { | ||||||
|     return { code, keystr, message } |     return { code, keystr, message } | ||||||
|  | |||||||
| @ -54,15 +54,15 @@ export const GPSData = [ | |||||||
|   { key: '海拔高', value: '0' }, |   { key: '海拔高', value: '0' }, | ||||||
|   { key: '高度差', value: '0' }, |   { key: '高度差', value: '0' }, | ||||||
|   { key: '龄期', value: '0' }, |   { key: '龄期', value: '0' }, | ||||||
|   { key: '维度因子', value: '0' }, |   { key: '纬度因子', value: '0' }, | ||||||
|   { key: '经度因子', value: '0' }, |   { key: '经度因子', value: '0' }, | ||||||
|   { key: '航向角', value: '0' }, |   { key: '航向角', value: '0' }, | ||||||
|   { key: '俯仰角', value: '0' }, |   { key: '俯仰角', value: '0' }, | ||||||
|   { key: '航向角状态-收星数', value: '0' }, |   { key: '航向角状态-收星数', value: '0' }, | ||||||
|   { key: '年月日', value: '0' }, |   { key: '年月日', value: '0' }, | ||||||
|   { key: '时分秒', value: '0' }, |   { key: '时分秒', value: '0' }, | ||||||
|   { key: '经度', value: '0' }, |  | ||||||
|   { key: '纬度', value: '0' }, |   { key: '纬度', value: '0' }, | ||||||
|  |   { key: '经度', value: '0' }, | ||||||
|   { key: '速度', value: '0' }, |   { key: '速度', value: '0' }, | ||||||
| ] | ] | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -54,7 +54,7 @@ export const GPSData = [ | |||||||
|   { key: '海拔高', value: '0' }, |   { key: '海拔高', value: '0' }, | ||||||
|   { key: '高度差', value: '0' }, |   { key: '高度差', value: '0' }, | ||||||
|   { key: '龄期', value: '0' }, |   { key: '龄期', value: '0' }, | ||||||
|   { key: '维度因子', value: '0' }, |   { key: '纬度因子', value: '0' }, | ||||||
|   { key: '经度因子', value: '0' }, |   { key: '经度因子', value: '0' }, | ||||||
|   { key: '航向角', value: '0' }, |   { key: '航向角', value: '0' }, | ||||||
|   { key: '俯仰角', value: '0' }, |   { key: '俯仰角', value: '0' }, | ||||||
|  | |||||||
| @ -2,6 +2,8 @@ import router from '@ohos.router'; | |||||||
| import RealTime from '../compontents/judge/RealTime'; | import RealTime from '../compontents/judge/RealTime'; | ||||||
| import { GPSData, SignalData } from '../../mock'; | import { GPSData, SignalData } from '../../mock'; | ||||||
| import { SignalDataType } from '../../model'; | import { SignalDataType } from '../../model'; | ||||||
|  | import { convertGpsCoord2 } from '../../common/utils/tools'; | ||||||
|  | 
 | ||||||
| @Component | @Component | ||||||
| export default struct SignDisplayCom { | export default struct SignDisplayCom { | ||||||
|   @State showBack: boolean = false |   @State showBack: boolean = false | ||||||
| @ -196,7 +198,7 @@ export default struct SignDisplayCom { | |||||||
|               Text('海拔高:' + this.signArr[85]).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio) |               Text('海拔高:' + this.signArr[85]).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio) | ||||||
|               Text('高度差:' + this.signArr[86]).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio) |               Text('高度差:' + this.signArr[86]).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio) | ||||||
|               Text('龄期:' + this.signArr[87]).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio) |               Text('龄期:' + this.signArr[87]).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio) | ||||||
|               Text('维度因子:' + this.signArr[88]) |               Text('纬度因子:' + this.signArr[88]) | ||||||
|                 .fontColor('#FFB433') |                 .fontColor('#FFB433') | ||||||
|                 .fontSize(14 * this.ratio) |                 .fontSize(14 * this.ratio) | ||||||
|                 .height(18 * this.ratio) |                 .height(18 * this.ratio) | ||||||
| @ -212,9 +214,18 @@ export default struct SignDisplayCom { | |||||||
|                 .height(18 * this.ratio) |                 .height(18 * this.ratio) | ||||||
|               Text('年月日:' + this.signArr[93]).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio) |               Text('年月日:' + this.signArr[93]).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio) | ||||||
|               Text('时分秒:' + this.signArr[94]).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio) |               Text('时分秒:' + this.signArr[94]).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio) | ||||||
|               Text('经度:' + this.signArr[95]).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio) |               Text('经度:' + Number(convertGpsCoord2(Number(this.signArr[96])).toFixed(6))) | ||||||
|               Text('纬度:' + this.signArr[96]).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio) |                 .fontColor('#FFB433') | ||||||
|               Text('速度:' +((Number((this.signArr[97]||0))*1.852).toFixed(2)).toString()).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio) |                 .fontSize(14 * this.ratio) | ||||||
|  |                 .height(18 * this.ratio) | ||||||
|  |               Text('纬度:' + Number(convertGpsCoord2(Number(this.signArr[95])).toFixed(6))) | ||||||
|  |                 .fontColor('#FFB433') | ||||||
|  |                 .fontSize(14 * this.ratio) | ||||||
|  |                 .height(18 * this.ratio) | ||||||
|  |               Text('速度:' + ((Number((this.signArr[97] || 0)) * 1.852).toFixed(2)).toString()) | ||||||
|  |                 .fontColor('#FFB433') | ||||||
|  |                 .fontSize(14 * this.ratio) | ||||||
|  |                 .height(18 * this.ratio) | ||||||
|             } |             } | ||||||
|             .backgroundColor('#1A1A1A') |             .backgroundColor('#1A1A1A') | ||||||
|             .width(170 * this.ratio) |             .width(170 * this.ratio) | ||||||
| @ -229,6 +240,7 @@ export default struct SignDisplayCom { | |||||||
|         .backgroundImage($r('app.media.km_open')) |         .backgroundImage($r('app.media.km_open')) | ||||||
|         .backgroundImageSize({ width: '100%', height: '100%' }) |         .backgroundImageSize({ width: '100%', height: '100%' }) | ||||||
|         .visibility(this.active == 0 ? Visibility.Visible : Visibility.None) |         .visibility(this.active == 0 ? Visibility.Visible : Visibility.None) | ||||||
|  | 
 | ||||||
|         Column() { |         Column() { | ||||||
|           Column() { |           Column() { | ||||||
|             Text(this.msg || '0') |             Text(this.msg || '0') | ||||||
| @ -251,6 +263,7 @@ export default struct SignDisplayCom { | |||||||
|         .backgroundImage($r('app.media.km_open')) |         .backgroundImage($r('app.media.km_open')) | ||||||
|         .backgroundImageSize({ width: '100%', height: '100%' }) |         .backgroundImageSize({ width: '100%', height: '100%' }) | ||||||
|         .visibility(this.active == 2 ? Visibility.Visible : Visibility.None) |         .visibility(this.active == 2 ? Visibility.Visible : Visibility.None) | ||||||
|  | 
 | ||||||
|         Row() { |         Row() { | ||||||
|           Flex({ direction: FlexDirection.Column }) { |           Flex({ direction: FlexDirection.Column }) { | ||||||
|             Row() { |             Row() { | ||||||
| @ -403,9 +416,15 @@ export default struct SignDisplayCom { | |||||||
|     for (let i = 34; i <= 46; i++) { |     for (let i = 34; i <= 46; i++) { | ||||||
|       this.sjxhColum[i].value = this.signArr[i+2] |       this.sjxhColum[i].value = this.signArr[i+2] | ||||||
|     } |     } | ||||||
|  |     const hours = Number(this.signArr[94].substr(0, 2)) + 8 | ||||||
|  |     this.signArr[94] = (hours > 9 ? hours : '0' + hours) + this.signArr[94].substr(2, this.signArr[94].length - 2) | ||||||
|     let t = 0 |     let t = 0 | ||||||
|     for (let i = 83; i <= 97; i++) { |     for (let i = 83; i <= 97; i++) { | ||||||
|  |       if ([95, 96].includes(i)) { | ||||||
|  |         this.GPSColum[t].value = Number(convertGpsCoord2(Number(this.signArr[i])).toFixed(6)) + ""; | ||||||
|  |       } else { | ||||||
|         this.GPSColum[t].value = this.signArr[i] |         this.GPSColum[t].value = this.signArr[i] | ||||||
|  |       } | ||||||
|       t++ |       t++ | ||||||
|     } |     } | ||||||
|     this.GPSColum[14].value = ((Number((this.signArr[97] || 0)) * 1.852).toFixed(2)).toString() |     this.GPSColum[14].value = ((Number((this.signArr[97] || 0)) * 1.852).toFixed(2)).toString() | ||||||
| @ -414,8 +433,6 @@ export default struct SignDisplayCom { | |||||||
|     const str2 = this.signArr[93].substr(4.2) |     const str2 = this.signArr[93].substr(4.2) | ||||||
|     this.signArr[93] = str2 + str1 + str0 |     this.signArr[93] = str2 + str1 + str0 | ||||||
|     this.GPSColum[10].value = this.signArr[93] |     this.GPSColum[10].value = this.signArr[93] | ||||||
|     const hours=Number(this.signArr[94].substr(0,2))+8 |  | ||||||
|     this.signArr[94]=(hours>9?hours:'0'+hours)+this.signArr[94].substr(2,this.signArr[94].length-2) |  | ||||||
|     // this.signArr[53]=192.168.7.170' |     // this.signArr[53]=192.168.7.170' | ||||||
|     this.sjxhColum = JSON.parse(JSON.stringify((this.sjxhColum))) |     this.sjxhColum = JSON.parse(JSON.stringify((this.sjxhColum))) | ||||||
|     that.signArr = JSON.parse(JSON.stringify((this.signArr))) |     that.signArr = JSON.parse(JSON.stringify((this.signArr))) | ||||||
|  | |||||||
| @ -196,7 +196,7 @@ export default struct SignDisplayCom { | |||||||
|               Text('收星数:' + this.signArr[84]).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio) |               Text('收星数:' + this.signArr[84]).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio) | ||||||
|               Text('海拔高:' + this.signArr[85]).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio) |               Text('海拔高:' + this.signArr[85]).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio) | ||||||
|               Text('高度差:' + this.signArr[86]).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio) |               Text('高度差:' + this.signArr[86]).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio) | ||||||
|               Text('龄期:' + this.signArr[87]).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio) |               Text('纬期:' + this.signArr[87]).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio) | ||||||
|               Text('维度因子:' + this.signArr[88]) |               Text('维度因子:' + this.signArr[88]) | ||||||
|                 .fontColor('#FFB433') |                 .fontColor('#FFB433') | ||||||
|                 .fontSize(14 * this.ratio) |                 .fontSize(14 * this.ratio) | ||||||
|  | |||||||
| @ -1,7 +1,7 @@ | |||||||
| //考试回放开关
 | //考试回放开关
 | ||||||
| export const judgeConfig = { | export const judgeConfig = { | ||||||
|   // 外壳版本号
 |   // 外壳版本号
 | ||||||
|   version: "2025.05.20.01", |   version: "2025.05.21.01", | ||||||
|   //本地目录开关
 |   //本地目录开关
 | ||||||
|   isTrajectoryOpen: false, |   isTrajectoryOpen: false, | ||||||
|   //是否开启拍照
 |   //是否开启拍照
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user