Compare commits
	
		
			2 Commits
		
	
	
		
			63145aec13
			...
			8dcdb29f61
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 8dcdb29f61 | |||
| c3c5c2063c | 
| @ -258,48 +258,55 @@ export async function takePhotoFn(context) { | ||||
|   }, 3000) | ||||
| } | ||||
| let fd | ||||
| const devPath="/dev/ttyS3" | ||||
| function openChuankouFn() { | ||||
|   fd = testNapi.SerialOpen(devPath); | ||||
| const devPath="/dev/ttyUSB0" | ||||
| async function openChuankouFn():Promise<number> { | ||||
|   console.log('fdfd1111 start') | ||||
|   fd = await testNapi.SerialOpen(devPath); | ||||
|   globalThis.fd=fd | ||||
|   console.log('fdfd1111',globalThis.fd) | ||||
| 
 | ||||
|   let parity = 0x4e; // 'N'
 | ||||
|   let ret = testNapi.SerialSet(globalThis.fd, 115200, 0, 8, 1, parity); | ||||
|   let ret = await testNapi.SerialSet(globalThis.fd, 115200, 0, 8, 1, parity); | ||||
|   console.log('setNum',ret) | ||||
|   return ret | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| } | ||||
| function getChuankouFnMsg() { | ||||
| async function getChuankouFnMsg() { | ||||
|   let timeout = 50000; // 2秒超时
 | ||||
|   let databuff = [0x61, 0xAA, 0x0A, 0X15, 0X00]; // send ABCDE
 | ||||
|   console.log('fdfd',globalThis.fd) | ||||
|   let ret = testNapi.SerialSend(globalThis.fd, databuff); | ||||
|   console.log('mmmm',ret) | ||||
|   let revTestInfo = testNapi?.SerialRecv(globalThis.fd, timeout); | ||||
| 
 | ||||
|   console.log('revTestInfo',revTestInfo.recevedBuf.length) | ||||
| 
 | ||||
|   const message = revTestInfo?.recevedBuf?.toString() | ||||
|   console.log('chuankou',message) | ||||
|   if (message == '') { | ||||
|     return | ||||
|   } | ||||
|   const msg = message?.split(',') | ||||
|   if(!msg?.length){ | ||||
|     return | ||||
|   } | ||||
|   if (msg[0] != '98' || msg[1] != '85' || msg.length < 9) { | ||||
|     return | ||||
|   } | ||||
|   globalThis.chuankoMsg=msg[9] | ||||
| 
 | ||||
|   let uint8Arr = new Uint8Array(databuff); | ||||
|   testNapi.SerialSend(globalThis.fd, uint8Arr).then((ret) => { | ||||
|     console.log('mmmm',ret) | ||||
|     testNapi?.SerialRecv(globalThis.fd, timeout,12).then((revTestInfo) => { | ||||
|       console.log('revTestInfo',revTestInfo.recevedBuf.length) | ||||
| 
 | ||||
|       const message = revTestInfo?.recevedBuf?.toString() | ||||
|       console.log('chuankou',message) | ||||
|       if (message == '') { | ||||
|         return | ||||
|       } | ||||
|       const msg = message?.split(',') | ||||
|       if(!msg?.length){ | ||||
|         return | ||||
|       } | ||||
|       if (msg[0] != '98' || msg[1] != '85' || msg.length < 9) { | ||||
|         return | ||||
|       } | ||||
|       globalThis.chuankoMsg=msg[9] | ||||
|     }) | ||||
|   }); | ||||
| } | ||||
| 
 | ||||
| export async function getChuankouFn(){ | ||||
|   if(globalThis.fd){ | ||||
|     return | ||||
|   } | ||||
|   openChuankouFn() | ||||
|   setInterval(()=>{ | ||||
|     getChuankouFnMsg() | ||||
|   },1000) | ||||
| 
 | ||||
|   openChuankouFn().then((fd) => { | ||||
|     setInterval(()=>{ | ||||
|       getChuankouFnMsg() | ||||
|     },1000) | ||||
|   }) | ||||
| } | ||||
| @ -6,8 +6,8 @@ import fs from '@ohos.file.fs' | ||||
| import photoAccessHelper from '@ohos.file.photoAccessHelper' | ||||
| import dataSharePredicates from '@ohos.data.dataSharePredicates' | ||||
| import { getCurrentTime } from '../utils/tools' | ||||
| // import rtsp_server from '@ohos.rtsprecord';
 | ||||
| import record from '@ohos.rtsprecord'; | ||||
| import rtsp_server from '@ohos.rtsprecord'; | ||||
| // import record from '@ohos.rtsprecord';
 | ||||
| import { FileHelper } from './FileHelper'; | ||||
| 
 | ||||
| // const rtsp_server = record.createServer();
 | ||||
| @ -28,7 +28,7 @@ photoAccessHelper.PhotoKeys.TITLE, | ||||
| photoAccessHelper.PhotoKeys.POSITION, | ||||
| photoAccessHelper.PhotoKeys.DATE_TRASHED, | ||||
| photoAccessHelper.PhotoKeys.HIDDEN]; | ||||
| const rtsp_server = record.createServer(); | ||||
| // const rtsp_server = record.createServer();
 | ||||
| 
 | ||||
| export async function startRecordVideo(param, td, context, dir) { | ||||
|   return new Promise((reslove, reject) => { | ||||
| @ -104,6 +104,7 @@ export async function takePhoto(param, context,dir,flag=1,callback?) { | ||||
|     // @ts-ignore
 | ||||
|     // var snapResult = rtsp_server.getVideoSnapshot(context, video_uri, '', dir);
 | ||||
|   if(flag==0){ | ||||
|     // @ts-ignore
 | ||||
|     rtsp_server.detectVideoSnapshotSize(video_uri,fileName,(err,snapResult)=>{ | ||||
|       console.log("baohaowen_detectLoop round end size1:"+snapResult.fileSize); | ||||
|       callback({fileSize:snapResult.fileSize }) | ||||
| @ -120,6 +121,7 @@ export async function takePhoto(param, context,dir,flag=1,callback?) { | ||||
|   } | ||||
|   else{ | ||||
|     return new Promise<takePhotoParam>((resolve,reject)=>{ | ||||
|       // @ts-ignore
 | ||||
|       rtsp_server.getVideoSnapshot(context, video_uri, fileName,dir,true,(err,snapResult)=>{ | ||||
|         console.log('getPhtot') | ||||
|         resolve({base64: snapResult.dataString,name:snapResult.fileName,fileSize:snapResult.fileSize }) | ||||
| @ -183,37 +185,3 @@ export async function deleteAllVideos(context,type: photoAccessHelper.AlbumType, | ||||
|     } | ||||
|   } | ||||
| } | ||||
| // export async function takePhoto(param, context, type = 0, dir) {
 | ||||
| //   return new Promise((reslove, reject) => {
 | ||||
| //     console.log('mmmmmmmttt,04', type)
 | ||||
| //
 | ||||
| //     // const rtsp_server = record.createServer();
 | ||||
| //     var video_uri = `rtsp://${param.userName}:${param.pwd}@${param.ip}:${param.port}/h264/ch${param.pztd}/main/av_stream`;
 | ||||
| //     // var snapResult = rtsp_server.getVideoSnapshot(context, video_uri, dir);
 | ||||
| //     // console.log(`baoyihu Rtsprecord getVideoSnapshot file:` + snapResult.dataString);
 | ||||
| //
 | ||||
| //     console.log(`baoyihu Rtsprecord getVideoSnapshot begin:`);
 | ||||
| //     // const num = Math.floor(Math.random() * 10000)
 | ||||
| //     console.log('mmmmmmmttt,05', video_uri)
 | ||||
| //
 | ||||
| //     const num = Math.floor(Math.random() * 10000)
 | ||||
| //     const fileName = `picture_record${num}.jpg`
 | ||||
| //     console.log(`baoyihu Rtsprecord baohaowen getVideoSnapshot fileName:` + fileName);
 | ||||
| //     // @ts-ignore
 | ||||
| //     var snapResult = rtsp_server.getVideoSnapshot(context, video_uri, fileName, dir, (ret) => {
 | ||||
| //       const str = ret.dataString
 | ||||
| //       if (type == 1) {
 | ||||
| //         console.log('mmmmmmmttt',str.length)
 | ||||
| //         reslove(str)
 | ||||
| //       } else {
 | ||||
| //         reslove('')
 | ||||
| //       }
 | ||||
| //     })
 | ||||
| //     // console.log('mmmmmmmttt,06',snapResult.dataString)
 | ||||
| //
 | ||||
| //     // console.log(`baoyihu Rtsprecord getVideoSnapshot file:` + snapResult.fileName);
 | ||||
| //     // console.log(`baoyihu Rtsprecord getVideoSnapshot dataLen:` + snapResult.dataString.length);
 | ||||
| //     // console.log('datadata1',snapResult.dataString.length)
 | ||||
| //   })
 | ||||
| //
 | ||||
| // }
 | ||||
| @ -1,62 +0,0 @@ | ||||
| import buffer from '@ohos.buffer'; | ||||
| import testNapi from '@ohos.hiserialsdk' | ||||
| 
 | ||||
| const TAG = '[TcpDemo.TcpClient]' | ||||
| import prompt from '@ohos.prompt' | ||||
| /** | ||||
|  * devPath | ||||
|  *j36--ttyS5 | ||||
|  * j37--ttyS7 | ||||
|  * j38--ttyS9 | ||||
|  */ | ||||
| 
 | ||||
| export default class SerialPortClient { | ||||
|   private devPath: string = '' | ||||
|   private len: any = '' | ||||
|   private fd: number = -1 | ||||
|   private speed: number = 115200 //波特率
 | ||||
|   private databits: number = 8 //数据位
 | ||||
|   private flow_ctrl:number=0 //流控制
 | ||||
|   private stopbits:number=1 //停止位
 | ||||
|   private parity:number=0x4e //停止位
 | ||||
| 
 | ||||
|   constructor(devPath?:string) { | ||||
|     this.devPath = devPath || '/dev/ttyS5' | ||||
| 
 | ||||
|   } | ||||
| 
 | ||||
|   openSerial() { | ||||
|     this.fd = testNapi.SerialOpen(this.devPath); | ||||
|   } | ||||
| 
 | ||||
|   SerialSet(param?) { | ||||
|     this.speed = param?.speed || 115200 | ||||
|     this.flow_ctrl=param?.flow_ctrl||0 | ||||
|     this.databits = param?.databits||8 | ||||
|     this.stopbits=param?.stopbits||1 | ||||
|     this.parity=param?.parity || 0x4e | ||||
|     testNapi.SerialSet(this.fd, this.speed , this.flow_ctrl, this.databits, this.stopbits,this.parity); | ||||
|   } | ||||
| 
 | ||||
|   SerialSend(data?) { | ||||
|     const sendArr = data || [0x61, 0xAA, 0x0A, 0X15, 0X00] //档位查询
 | ||||
|     testNapi.SerialSend(this.fd, sendArr); | ||||
|   } | ||||
| 
 | ||||
|   SerialRecv(timeout?: number) { | ||||
|     let revTestInfo = testNapi.SerialRecv(this.fd, timeout); | ||||
| 
 | ||||
|     //let revTestInfo = testNapi.SerialRecv(this.fd, timeout, 6);
 | ||||
|     const message = revTestInfo?.recevedBuf?.toString() | ||||
|     console.log('revTestInfo.recevedBuf.toString()',revTestInfo.recevedBuf) | ||||
|     console.log('revTestInfo.recevedBuf.toString()',revTestInfo.recevedBuf.toString()) | ||||
|     this.len = revTestInfo.recevedLen | ||||
|     return { | ||||
|       msg: message, recevedLen: this.len | ||||
|     } | ||||
|   } | ||||
| 
 | ||||
|   SerialClose(callback) { | ||||
|     testNapi.SerialClose(this.fd); | ||||
|   } | ||||
| } | ||||
| @ -567,44 +567,44 @@ struct Index { | ||||
| 
 | ||||
|   build() { | ||||
|     Column() { | ||||
|       TopLogo({ outFlag: $outFlag }).margin({ bottom: 25.5 * this.ratio }) | ||||
|       TopLogo({ outFlag: $outFlag }).margin({ bottom: 25.5 * globalThis.ratio }) | ||||
|       Flex({ justifyContent: FlexAlign.SpaceBetween }) { | ||||
|         Column() { | ||||
|           Row() { | ||||
| 
 | ||||
|             Image(this.passArray[0] ? (this.warnFlag[0] == '0' ? $r('app.media.cheliangmoxing') : (this.warnFlag[0] == '1' ? $r('app.media.cheliangmoxing_r') : $r('app.media.cheliangmoxing_g'))) : $r('app.media.cheliangmoxing')) | ||||
|               .width(138.5 * this.ratio) | ||||
|               .height(112.5 * this.ratio) | ||||
|               .width(138.5 * globalThis.ratio) | ||||
|               .height(112.5 * globalThis.ratio) | ||||
|             Image(this.passArray[1] ? (this.warnFlag[1] == '0' ? $r('app.media.weixingxinhao') : (this.warnFlag[1] == '1' ? $r('app.media.weixingxinhao_r') : $r('app.media.weixingxinhao_g'))) : $r('app.media.weixingxinhao')) | ||||
|               .width(138.5 * this.ratio) | ||||
|               .height(112.5 * this.ratio) | ||||
|               .width(138.5 * globalThis.ratio) | ||||
|               .height(112.5 * globalThis.ratio) | ||||
|             Image(this.passArray[2] ? (this.warnFlag[2] == '0' ? $r('app.media.shipinjiankong') : (this.warnFlag[2] == '1' ? $r('app.media.shipingjiankong_r') : $r('app.media.shipinjiankong_g'))) : $r('app.media.shipinjiankong')) | ||||
|               .width(138.5 * this.ratio) | ||||
|               .height(112.5 * this.ratio) | ||||
|               .width(138.5 * globalThis.ratio) | ||||
|               .height(112.5 * globalThis.ratio) | ||||
|             Image(this.passArray[3] ? (this.warnFlag[3] == '0' ? $r('app.media.anquandai') : (this.warnFlag[3] == '1' ? $r('app.media.anquandai_r') : $r('app.media.anquandai_g'))) : $r('app.media.anquandai')) | ||||
|               .width(138.5 * this.ratio) | ||||
|               .height(112.5 * this.ratio) | ||||
|               .width(138.5 * globalThis.ratio) | ||||
|               .height(112.5 * globalThis.ratio) | ||||
|             Image(this.passArray[4] ? (this.warnFlag[4] == '0' ? $r('app.media.liheqi') : (this.warnFlag[4] == '1' ? $r('app.media.liheqi_r') : $r('app.media.leheqi_g'))) : $r('app.media.liheqi')) | ||||
|               .width(138.5 * this.ratio) | ||||
|               .height(112.5 * this.ratio) | ||||
|               .width(138.5 * globalThis.ratio) | ||||
|               .height(112.5 * globalThis.ratio) | ||||
|           } | ||||
| 
 | ||||
|           Row() { | ||||
|             Image(this.passArray[5] ? (this.warnFlag[5] == '0' ? $r('app.media.shousha') : (this.warnFlag[5] == '1' ? $r('app.media.shousha_r') : $r('app.media.shousha_g'))) : $r('app.media.shousha')) | ||||
|               .width(138.5 * this.ratio) | ||||
|               .height(112.5 * this.ratio) | ||||
|               .width(138.5 * globalThis.ratio) | ||||
|               .height(112.5 * globalThis.ratio) | ||||
|             Image(this.passArray[6] ? (this.warnFlag[6] == '0' ? $r('app.media.jiaosha') : (this.warnFlag[6] == '1' ? $r('app.media.jiaosha_r') : $r('app.media.jiaosha_g'))) : $r('app.media.jiaosha')) | ||||
|               .width(138.5 * this.ratio) | ||||
|               .height(112.5 * this.ratio) | ||||
|               .width(138.5 * globalThis.ratio) | ||||
|               .height(112.5 * globalThis.ratio) | ||||
|             Image(this.passArray[7] ? (this.warnFlag[7] == '0' ? $r('app.media.chemen') : (this.warnFlag[7] == '1' ? $r('app.media.chemen_r') : $r('app.media.chemeen_g'))) : $r('app.media.chemen')) | ||||
|               .width(138.5 * this.ratio) | ||||
|               .height(112.5 * this.ratio) | ||||
|               .width(138.5 * globalThis.ratio) | ||||
|               .height(112.5 * globalThis.ratio) | ||||
|             Image(this.passArray[8] ? (this.warnFlag[8] == '0' ? $r('app.media.fusha') : (this.warnFlag[8] == '1' ? $r('app.media.fusha_r') : $r('app.media.fusha_g'))) : $r('app.media.fusha')) | ||||
|               .width(138.5 * this.ratio) | ||||
|               .height(112.5 * this.ratio) | ||||
|               .width(138.5 * globalThis.ratio) | ||||
|               .height(112.5 * globalThis.ratio) | ||||
|             Image(this.passArray[9] ? (this.warnFlag[9] == '0' ? $r('app.media.dianhuo') : (this.warnFlag[9] == '1' ? $r('app.media.dianhuo_r') : $r('app.media.dianhuo_g'))) : $r('app.media.dianhuo')) | ||||
|               .width(138.5 * this.ratio) | ||||
|               .height(112.5 * this.ratio) | ||||
|               .width(138.5 * globalThis.ratio) | ||||
|               .height(112.5 * globalThis.ratio) | ||||
| 
 | ||||
|           } | ||||
|         } | ||||
| @ -612,9 +612,9 @@ struct Index { | ||||
|         if (this.breakFlag) { | ||||
|           Column() { | ||||
|             Image($r('app.media.open_loading')) | ||||
|               .width(100 * this.ratio) | ||||
|               .width(100 * globalThis.ratio) | ||||
|               .rotate({ angle: this.angle }) | ||||
|               .height(100 * this.ratio) | ||||
|               .height(100 * globalThis.ratio) | ||||
|               .animation({ | ||||
|                 duration: 5000, // 动画时长 | ||||
|                 curve: Curve.EaseOut, // 动画曲线 | ||||
| @ -622,7 +622,7 @@ struct Index { | ||||
|                 iterations: -1, // 播放次数 | ||||
|                 playMode: PlayMode.Normal, // 动画模式 | ||||
|               }) | ||||
|             Text('等待检测…').fontSize(24 * this.ratio).fontColor('#FFB133').margin({ top: 35 * this.ratio }) | ||||
|             Text('等待检测…').fontSize(24 * globalThis.ratio).fontColor('#FFB133').margin({ top: 35 * globalThis.ratio }) | ||||
|           }.align(Alignment.Center).flexGrow(1) | ||||
|         } | ||||
| 
 | ||||
| @ -634,99 +634,99 @@ struct Index { | ||||
|           Column() { | ||||
|             Row() { | ||||
|               Image(this.warnFlag[10] == '1' ? $r('app.media.zq_r') : this.warnFlag[10] == '2' ? $r('app.media.zq') : '') | ||||
|                 .width(102 * this.ratio) | ||||
|                 .height(118.5 * this.ratio) | ||||
|                 .width(102 * globalThis.ratio) | ||||
|                 .height(118.5 * globalThis.ratio) | ||||
|                 .visibility(this.passArray[10] ? Visibility.Visible : Visibility.Hidden) | ||||
|               Image(this.warnFlag[11] == '1' ? $r('app.media.yq_r') : this.warnFlag[11] == '2' ? $r('app.media.yq') : '') | ||||
|                 .width(102 * this.ratio) | ||||
|                 .height(118.5 * this.ratio) | ||||
|                 .width(102 * globalThis.ratio) | ||||
|                 .height(118.5 * globalThis.ratio) | ||||
|                 .visibility(this.passArray[11] ? Visibility.Visible : Visibility.Hidden) | ||||
|             } | ||||
| 
 | ||||
|             Row() { | ||||
|               Image(this.warnFlag[12] == '1' ? $r('app.media.zh_r') : this.warnFlag[12] == '2' ? $r('app.media.zh') : '') | ||||
|                 .width(103 * this.ratio) | ||||
|                 .height(118.5 * this.ratio) | ||||
|                 .width(103 * globalThis.ratio) | ||||
|                 .height(118.5 * globalThis.ratio) | ||||
|                 .visibility(this.passArray[12] ? Visibility.Visible : Visibility.Hidden) | ||||
|               Image(this.warnFlag[13] == '1' ? $r('app.media.yh_r') : this.warnFlag[13] == '2' ? $r('app.media.yh') : '') | ||||
|                 .width(103 * this.ratio) | ||||
|                 .height(118.5 * this.ratio) | ||||
|                 .width(103 * globalThis.ratio) | ||||
|                 .height(118.5 * globalThis.ratio) | ||||
|                 .visibility(this.passArray[13] ? Visibility.Visible : Visibility.Hidden) | ||||
|             } | ||||
|           } | ||||
|           .backgroundImage($r('app.media.rc')) | ||||
|           .backgroundImageSize({ width: '100%', height: '100%' }) | ||||
|           .width(206 * this.ratio) | ||||
|           .height(235.5 * this.ratio) | ||||
|           .width(206 * globalThis.ratio) | ||||
|           .height(235.5 * globalThis.ratio) | ||||
|           //档位 | ||||
|           Column() { | ||||
|             Image(this.warnFlag[14] == '1' ? $r('app.media.1_r') : this.warnFlag[14] == '2' ? $r('app.media.1') : '') | ||||
|               .width(44.5 * this.ratio) | ||||
|               .height(44.5 * this.ratio) | ||||
|               .position({ x: 25 * this.ratio, y: 57 * this.ratio }) | ||||
|               .width(44.5 * globalThis.ratio) | ||||
|               .height(44.5 * globalThis.ratio) | ||||
|               .position({ x: 25 * globalThis.ratio, y: 57 * globalThis.ratio }) | ||||
|               .visibility(this.passArray[14] ? Visibility.Visible : Visibility.Hidden) | ||||
|             Image(this.warnFlag[16] == '1' ? $r('app.media.3_r') : this.warnFlag[16] == '2' ? $r('app.media.3') : '') | ||||
|               .width(44.5 * this.ratio) | ||||
|               .height(44.5 * this.ratio) | ||||
|               .position({ x: 82.5 * this.ratio, y: 57 * this.ratio }) | ||||
|               .width(44.5 * globalThis.ratio) | ||||
|               .height(44.5 * globalThis.ratio) | ||||
|               .position({ x: 82.5 * globalThis.ratio, y: 57 * globalThis.ratio }) | ||||
|               .visibility(this.passArray[16] ? Visibility.Visible : Visibility.Hidden) | ||||
|             Image(this.warnFlag[18] == '1' ? $r('app.media.5_r') : this.warnFlag[18] == '2' ? $r('app.media.5') : '') | ||||
|               .width(44.5 * this.ratio) | ||||
|               .height(44.5 * this.ratio) | ||||
|               .position({ x: 139.5 * this.ratio, y: 57 * this.ratio }) | ||||
|               .width(44.5 * globalThis.ratio) | ||||
|               .height(44.5 * globalThis.ratio) | ||||
|               .position({ x: 139.5 * globalThis.ratio, y: 57 * globalThis.ratio }) | ||||
|               .visibility(this.passArray[18] ? Visibility.Visible : Visibility.Hidden) | ||||
|             Image(this.warnFlag[15] == '1' ? $r('app.media.2_r') : this.warnFlag[15] == '2' ? $r('app.media.2') : '') | ||||
|               .width(44.5 * this.ratio) | ||||
|               .height(44.5 * this.ratio) | ||||
|               .position({ x: 25 * this.ratio, y: 173.5 * this.ratio }) | ||||
|               .width(44.5 * globalThis.ratio) | ||||
|               .height(44.5 * globalThis.ratio) | ||||
|               .position({ x: 25 * globalThis.ratio, y: 173.5 * globalThis.ratio }) | ||||
|               .visibility(this.passArray[15] ? Visibility.Visible : Visibility.Hidden) | ||||
|             Image(this.warnFlag[17] == '1' ? $r('app.media.4_r') : this.warnFlag[17] == '2' ? $r('app.media.4') : '') | ||||
|               .width(44.5 * this.ratio) | ||||
|               .height(44.5 * this.ratio) | ||||
|               .position({ x: 82.5 * this.ratio, y: 173.5 * this.ratio }) | ||||
|               .width(44.5 * globalThis.ratio) | ||||
|               .height(44.5 * globalThis.ratio) | ||||
|               .position({ x: 82.5 * globalThis.ratio, y: 173.5 * globalThis.ratio }) | ||||
|               .visibility(this.passArray[17] ? Visibility.Visible : Visibility.Hidden) | ||||
|             Image(this.warnFlag[19] == '1' ? $r('app.media.R_r') : this.warnFlag[19] == '2' ? $r('app.media.R') : '') | ||||
|               .width(44.5 * this.ratio) | ||||
|               .height(44.5 * this.ratio) | ||||
|               .position({ x: 139.5 * this.ratio, y: 173.5 * this.ratio }) | ||||
|               .width(44.5 * globalThis.ratio) | ||||
|               .height(44.5 * globalThis.ratio) | ||||
|               .position({ x: 139.5 * globalThis.ratio, y: 173.5 * globalThis.ratio }) | ||||
|               .visibility(this.passArray[19] ? Visibility.Visible : Visibility.Hidden) | ||||
|             Image(this.warnFlag[20] == '1' ? $r('app.media.N_r') : this.warnFlag[20] == '2' ? $r('app.media.N') : '') | ||||
|               .width(44.5 * this.ratio) | ||||
|               .height(44.5 * this.ratio) | ||||
|               .position({ x: 82.5 * this.ratio, y: 115.5 * this.ratio }) | ||||
|               .width(44.5 * globalThis.ratio) | ||||
|               .height(44.5 * globalThis.ratio) | ||||
|               .position({ x: 82.5 * globalThis.ratio, y: 115.5 * globalThis.ratio }) | ||||
|               .visibility(this.passArray[20] ? Visibility.Visible : Visibility.Hidden) | ||||
|           } | ||||
|           .backgroundImage($r('app.media.dw')) | ||||
|           .backgroundImageSize({ width: '100%', height: '100%' }) | ||||
|           .width(206 * this.ratio) | ||||
|           .height(235.5 * this.ratio) | ||||
|           .width(206 * globalThis.ratio) | ||||
|           .height(235.5 * globalThis.ratio) | ||||
| 
 | ||||
|           Column() { | ||||
|             Row() { | ||||
|               Image(this.passArray[21] ? (this.warnFlag[21] == '0' ? $r('app.media.zuo') : (this.warnFlag[21] == '1' ? $r('app.media.zuo_r') : $r('app.media.zuo_g'))) : $r('app.media.zuo')) | ||||
|                 .width(138.5 * this.ratio) | ||||
|                 .height(81.5 * this.ratio) | ||||
|                 .width(138.5 * globalThis.ratio) | ||||
|                 .height(81.5 * globalThis.ratio) | ||||
|               Image(this.passArray[22] ? (this.warnFlag[22] == '0' ? $r('app.media.you') : (this.warnFlag[22] == '1' ? $r('app.media.you_r') : $r('app.media.you_g'))) : $r('app.media.you')) | ||||
|                 .width(138.5 * this.ratio) | ||||
|                 .height(81.5 * this.ratio) | ||||
|                 .width(138.5 * globalThis.ratio) | ||||
|                 .height(81.5 * globalThis.ratio) | ||||
|             } | ||||
| 
 | ||||
|             Row() { | ||||
|               Image(this.passArray[23] ? (this.warnFlag[23] == '0' ? $r('app.media.zuo1') : (this.warnFlag[23] == '1' ? $r('app.media.yuanguangdeng_r') : $r('app.media.yuanguangdeng_g'))) : $r('app.media.zuo1')) | ||||
|                 .width(138.5 * this.ratio) | ||||
|                 .height(81.5 * this.ratio) | ||||
|                 .width(138.5 * globalThis.ratio) | ||||
|                 .height(81.5 * globalThis.ratio) | ||||
|               Image(this.passArray[24] ? (this.warnFlag[24] == '0' ? $r('app.media.jinguangdeng') : (this.warnFlag[24] == '1' ? $r('app.media.jinguangdeng_r') : $r('app.media.jinguangdeng_g'))) : $r('app.media.jinguangdeng')) | ||||
|                 .width(138.5 * this.ratio) | ||||
|                 .height(81.5 * this.ratio) | ||||
|                 .width(138.5 * globalThis.ratio) | ||||
|                 .height(81.5 * globalThis.ratio) | ||||
|             } | ||||
| 
 | ||||
|             Row() { | ||||
|               Image(this.passArray[25] ? (this.warnFlag[25] == '0' ? $r('app.media.guzhang') : (this.warnFlag[25] == '1' ? $r('app.media.guzhang_r') : $r('app.media.guzhang_g'))) : $r('app.media.guzhang')) | ||||
|                 .width(138.5 * this.ratio) | ||||
|                 .height(81.5 * this.ratio) | ||||
|                 .width(138.5 * globalThis.ratio) | ||||
|                 .height(81.5 * globalThis.ratio) | ||||
|               Image(this.passArray[26] ? (this.warnFlag[26] == '0' ? $r('app.media.jinzhi') : (this.warnFlag[26] == '1' ? $r('app.media.jinzhi_r') : $r('app.media.jinzhi_g'))) : $r('app.media.jinzhi')) | ||||
|                 .width(138.5 * this.ratio) | ||||
|                 .height(81.5 * this.ratio) | ||||
|                 .width(138.5 * globalThis.ratio) | ||||
|                 .height(81.5 * globalThis.ratio) | ||||
|             } | ||||
|           } | ||||
|         } | ||||
| @ -736,20 +736,20 @@ struct Index { | ||||
|             Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) { | ||||
| 
 | ||||
|             } | ||||
|             .width(215 * this.ratio) | ||||
|             .height(64 * this.ratio) | ||||
|             .margin({ bottom: 10 * this.ratio }) | ||||
|             .width(215 * globalThis.ratio) | ||||
|             .height(64 * globalThis.ratio) | ||||
|             .margin({ bottom: 10 * globalThis.ratio }) | ||||
|             .onClick(() => { | ||||
|             }) | ||||
|             .zIndex(11) | ||||
|           } else { | ||||
| 
 | ||||
|             Image($r('app.media.xhxs_btn')) | ||||
|               .width(215 * this.ratio) | ||||
|               .height(64 * this.ratio) | ||||
|               .width(215 * globalThis.ratio) | ||||
|               .height(64 * globalThis.ratio) | ||||
|               .backgroundImage($r('app.media.button_nor')) | ||||
|               .backgroundImageSize({ width: '100%', height: '100%' }) | ||||
|               .margin({ bottom: 10 * this.ratio }) | ||||
|               .margin({ bottom: 10 * globalThis.ratio }) | ||||
|               .onClick(() => { | ||||
|                 console.log('xhsx') | ||||
|                 this.xhxs() | ||||
| @ -758,21 +758,21 @@ struct Index { | ||||
|           } | ||||
| 
 | ||||
|           Image($r('app.media.tczj_btn')) | ||||
|             .width(215 * this.ratio) | ||||
|             .height(64 * this.ratio) | ||||
|             .width(215 * globalThis.ratio) | ||||
|             .height(64 * globalThis.ratio) | ||||
|             .backgroundImage($r('app.media.button_nor')) | ||||
|             .backgroundImageSize({ width: '100%', height: '100%' }) | ||||
|             .margin({ bottom: 10 * this.ratio }) | ||||
|             .margin({ bottom: 10 * globalThis.ratio }) | ||||
|             .onClick(() => { | ||||
|               this.stopCheck() | ||||
|             }) | ||||
|             .zIndex(11) | ||||
|           Image($r('app.media.kszj_btn')) | ||||
|             .width(215 * this.ratio) | ||||
|             .height(64 * this.ratio) | ||||
|             .width(215 * globalThis.ratio) | ||||
|             .height(64 * globalThis.ratio) | ||||
|             .backgroundImage($r('app.media.anniu_nor')) | ||||
|             .backgroundImageSize({ width: '100%', height: '100%' }) | ||||
|             .margin({ bottom: 10 * this.ratio }) | ||||
|             .margin({ bottom: 10 * globalThis.ratio }) | ||||
|             .onClick(() => { | ||||
|               this.kszj() | ||||
|               this.getPLCInfo() | ||||
|  | ||||
| @ -19,14 +19,14 @@ struct Index { | ||||
|     Column() { | ||||
|       TopLogo({outFlag:$outFlag}) | ||||
|       Column() { | ||||
|         Text('请考官输入用户名密码').fontColor('#FFAD33').fontSize(36*this.ratio) | ||||
|         Text('请考官输入用户名密码').fontColor('#FFAD33').fontSize(36*globalThis.ratio) | ||||
|         Row() { | ||||
|           ForEach(this.inputPlaceholderArr, (item:any, index:number) => { | ||||
|             Row(){ | ||||
|               TextInput({ placeholder: `${item}`,text: this.inputTextArr[index] }) | ||||
|                 .fontSize(42*this.ratio) | ||||
|                 .fontSize(42*globalThis.ratio) | ||||
|                 .fontColor('white') | ||||
|                 .placeholderFont({ size: 42*this.ratio }) | ||||
|                 .placeholderFont({ size: 42*globalThis.ratio }) | ||||
|                 .placeholderColor('gray') | ||||
|                 .caretColor('white') | ||||
|                 .backgroundColor('transparent') | ||||
| @ -45,7 +45,7 @@ struct Index { | ||||
|           }) | ||||
|         } | ||||
|         .width('90%') | ||||
|         .margin({top: 25*this.ratio}) //20 | ||||
|         .margin({top: 25*globalThis.ratio}) //20 | ||||
|         .justifyContent(FlexAlign.SpaceBetween) | ||||
|         Column() { | ||||
|           Flex({wrap: FlexWrap.Wrap, | ||||
| @ -110,13 +110,13 @@ struct Index { | ||||
|           } | ||||
|           .height('100%') | ||||
|         } | ||||
|         .margin({top: 20*this.ratio}) | ||||
|         .margin({top: 20*globalThis.ratio}) | ||||
|         .width('90%') | ||||
|         .height('62.7%') | ||||
|         .backgroundColor('#E5E3DF') | ||||
|         .borderRadius(20*this.ratio) | ||||
|         .borderRadius(20*globalThis.ratio) | ||||
|       } | ||||
|       .margin({top: -10*this.ratio}) | ||||
|       .margin({top: -10*globalThis.ratio}) | ||||
|       .justifyContent(FlexAlign.SpaceAround) | ||||
|     } | ||||
|     .width('100%') | ||||
|  | ||||
| @ -155,12 +155,12 @@ struct Index { | ||||
|           Column() { | ||||
|             Text('V ' + globalThis.version) | ||||
|               .fontColor('#CCAE7A') | ||||
|               .fontSize(22 * this.ratio) | ||||
|               .fontSize(22 * globalThis.ratio) | ||||
|               .width('30%') | ||||
|               .margin({ bottom: 10 }) | ||||
|             Text('授权信息:' + (this.hasAuth ? '已授权' : '未授权')) | ||||
|               .fontColor('#CCAE7A') | ||||
|               .fontSize(22 * this.ratio) | ||||
|               .fontSize(22 * globalThis.ratio) | ||||
|               .width('30%') | ||||
|           } | ||||
|           .margin({ left: 24 }) | ||||
| @ -176,7 +176,7 @@ struct Index { | ||||
|             ) | ||||
|           ) | ||||
| 
 | ||||
|           Text('考车号:' + globalThis.deviceNo).fontColor('#CCAE7A').fontSize(22 * this.ratio).margin({ right: 24 }) | ||||
|           Text('考车号:' + globalThis.deviceNo).fontColor('#CCAE7A').fontSize(22 * globalThis.ratio).margin({ right: 24 }) | ||||
|         } | ||||
|         .width('100%') | ||||
|         .justifyContent(FlexAlign.SpaceBetween) | ||||
| @ -186,9 +186,9 @@ struct Index { | ||||
|       if (this.loading) { | ||||
|         Column() { | ||||
|           Image($r('app.media.open_loading')) | ||||
|             .width(200 * this.ratio) | ||||
|             .width(200 * globalThis.ratio) | ||||
|             .rotate({ angle: this.angle }) | ||||
|             .height(200 * this.ratio) | ||||
|             .height(200 * globalThis.ratio) | ||||
|             .animation({ | ||||
|               duration: 5000, // 动画时长 | ||||
|               curve: Curve.EaseOut, // 动画曲线 | ||||
| @ -196,18 +196,18 @@ struct Index { | ||||
|               iterations: -1, // 播放次数 | ||||
|               playMode: PlayMode.Normal, // 动画模式 | ||||
|             }) | ||||
|             .margin({ top: 30 * this.ratio }) | ||||
|             .margin({ top: 30 * globalThis.ratio }) | ||||
|           Image($r('app.media.car')) | ||||
|             .width(80 * this.ratio) | ||||
|             .height(80 * this.ratio) | ||||
|             .position({ x: 288 * this.ratio, y: 89 * this.ratio }) | ||||
|           Text('获取考车信息,请稍候……').fontSize(24 * this.ratio).margin({ top: 20 * this.ratio }).fontWeight(400) | ||||
|             .width(80 * globalThis.ratio) | ||||
|             .height(80 * globalThis.ratio) | ||||
|             .position({ x: 288 * globalThis.ratio, y: 89 * globalThis.ratio }) | ||||
|           Text('获取考车信息,请稍候……').fontSize(24 * globalThis.ratio).margin({ top: 20 * globalThis.ratio }).fontWeight(400) | ||||
|         } | ||||
|         .width(660 * this.ratio) | ||||
|         .height(360 * this.ratio) | ||||
|         .position({ x: 150 * this.ratio, y: 98 * this.ratio }) | ||||
|         .width(660 * globalThis.ratio) | ||||
|         .height(360 * globalThis.ratio) | ||||
|         .position({ x: 150 * globalThis.ratio, y: 98 * globalThis.ratio }) | ||||
|         .backgroundColor('#E6E3DF') | ||||
|         .borderRadius(19 * this.ratio) | ||||
|         .borderRadius(19 * globalThis.ratio) | ||||
|       } | ||||
|     } | ||||
|     .width('100%') | ||||
| @ -219,6 +219,7 @@ struct Index { | ||||
|   } | ||||
| 
 | ||||
|   aboutToAppear() { | ||||
|     globalThis.ratio=0.7 | ||||
|     this.angle = 0 | ||||
|     this.loading = false | ||||
|   } | ||||
|  | ||||
| @ -27,6 +27,7 @@ struct Index { | ||||
|   private img: ImageBitmap = new ImageBitmap("/resources/base/media/1.png") | ||||
| 
 | ||||
|   async aboutToAppear() { | ||||
|     globalThis.radio2=0.5 | ||||
|     globalThis.windowClass.setWindowSystemBarEnable(['']) | ||||
|     const time = await getCurrentTime() | ||||
|     const examSubject = globalThis.carInfo.examSubject | ||||
| @ -409,19 +410,19 @@ struct Index { | ||||
|     Column() { | ||||
|       Row() { | ||||
|         Row() { | ||||
|           Image($rawfile('judge/signal_logoS.png')).width(120) | ||||
|           Text(this.time).fontColor('#CCB48F').fontSize(32).padding({ left: 10, right: 5 }) | ||||
|           Image($rawfile('judge/xh_green.png')).width(50) | ||||
|         }.padding({left:20}) | ||||
|           Image($rawfile('judge/signal_logoS.png')).width(120*globalThis.radio2) | ||||
|           Text(this.time).fontColor('#CCB48F').fontSize(32*globalThis.radio2).padding({ left: 10*globalThis.radio2, right: 5*globalThis.radio2 }) | ||||
|           Image($rawfile('judge/xh_green.png')).width(50*globalThis.radio2) | ||||
|         }.padding({left:20*globalThis.radio2}) | ||||
| 
 | ||||
|         Row() { | ||||
|           Text(`当前项目:${this.xmmcStr || '无'} `).fontColor('#E5CCA1').fontSize(32) | ||||
|           Text(`当前项目:${this.xmmcStr || '无'} `).fontColor('#E5CCA1').fontSize(32*globalThis.radio2) | ||||
|         } | ||||
|       } | ||||
|       .width('100%') | ||||
|       .height('96') | ||||
|       .backgroundColor('#001A33') | ||||
|       .padding({ left: 15, right: 15 }) | ||||
|       .padding({ left: 15*globalThis.radio2, right: 15*globalThis.radio2 }) | ||||
|       .justifyContent(FlexAlign.SpaceBetween) | ||||
|       .alignItems(VerticalAlign.Center) | ||||
| 
 | ||||
| @ -433,12 +434,12 @@ struct Index { | ||||
|                 Row() { | ||||
|                   Text('考生姓名:').fontColor('#E5CCA1').fontSize(this.FONTSIZE) | ||||
|                   Text(this.name).fontColor('#FFF').fontSize(this.FONTSIZE) | ||||
|                 }.margin({ bottom: 10 }) | ||||
|                 }.margin({ bottom: 10*globalThis.radio2 }) | ||||
| 
 | ||||
|                 Row() { | ||||
|                   Text('开始时间:').fontColor('#E5CCA1').fontSize(this.FONTSIZE) | ||||
|                   Text(this.startTime).fontColor('#FFF').fontSize(this.FONTSIZE) | ||||
|                 }.margin({ bottom: 10 }) | ||||
|                 }.margin({ bottom: 10*globalThis.radio2 }) | ||||
| 
 | ||||
|                 if(this.examSubject == 3){ | ||||
|                   Row() { | ||||
| @ -453,17 +454,17 @@ struct Index { | ||||
|                 Row() { | ||||
|                   Text('身份证号:').fontColor('#E5CCA1').fontSize(this.FONTSIZE) | ||||
|                   Text(this.idCard).fontColor('#FFF').fontSize(this.FONTSIZE) | ||||
|                 }.margin({ bottom: 10 }) | ||||
|                 }.margin({ bottom: 10*globalThis.radio2 }) | ||||
| 
 | ||||
|                 Row() { | ||||
|                   Text('考试用时:').fontColor('#E5CCA1').fontSize(this.FONTSIZE) | ||||
|                   Text(formatTime(this.examTime)).fontColor('#FFF').fontSize(this.FONTSIZE) | ||||
|                 }.margin({ bottom: 10 }) | ||||
|                 }.margin({ bottom: 10*globalThis.radio2 }) | ||||
| 
 | ||||
|                 if(this.examSubject == 3){ | ||||
|                   Row() { | ||||
|                     if(this.judgeConfigObj['375'] == '0'){ | ||||
|                       Text(`应行驶:${this.examMileage}m`).fontColor('#E5CCA1').fontSize(this.FONTSIZE).padding({right:20}) | ||||
|                       Text(`应行驶:${this.examMileage}m`).fontColor('#E5CCA1').fontSize(this.FONTSIZE).padding({right:20*globalThis.radio2}) | ||||
|                     } | ||||
|                     Text(`已行驶:${this.jl}m`).fontColor('#FFAD33').fontSize(this.FONTSIZE) | ||||
|                   } | ||||
| @ -476,7 +477,7 @@ struct Index { | ||||
|             Column() { | ||||
|               Row(){ | ||||
|                 Text(this.carztStr).fontColor('#FFA500').fontSize(this.FONTSIZE) | ||||
|               }.height(40) | ||||
|               }.height(40*globalThis.radio2) | ||||
|               Row() { | ||||
|                 Flex({ direction: FlexDirection.Column }) { | ||||
|                   List({}) { | ||||
| @ -490,23 +491,23 @@ struct Index { | ||||
|                           .width('100%') | ||||
|                           .backgroundColor('#38260B') | ||||
|                           .justifyContent(FlexAlign.SpaceBetween) | ||||
|                           .padding({ top: 12, bottom: 12, left: 8, right: 5 }) | ||||
|                           .padding({ top: 12*globalThis.radio2, bottom: 12*globalThis.radio2, left: 8*globalThis.radio2, right: 5*globalThis.radio2 }) | ||||
| 
 | ||||
|                           Text(item.desc) | ||||
|                             .fontSize(this.BIGFONTSIZE) | ||||
|                             .fontColor('#E5CBA1') | ||||
|                             .margin({ top: 10, bottom: 8, left: 5, right: 5 }) | ||||
|                         }.margin({ top: 15 }).alignItems(HorizontalAlign.Start) | ||||
|                             .margin({ top: 10*globalThis.radio2, bottom: 8*globalThis.radio2, left: 5*globalThis.radio2, right: 5*globalThis.radio2 }) | ||||
|                         }.margin({ top: 15*globalThis.radio2 }).alignItems(HorizontalAlign.Start) | ||||
| 
 | ||||
|                       }.margin({bottom:25}) | ||||
|                       }.margin({bottom:25*globalThis.radio2}) | ||||
|                     }) | ||||
|                   }.padding({left:15,right:15,top:30,bottom:5}) | ||||
|                   }.padding({left:15*globalThis.radio2,right:15*globalThis.radio2,top:30*globalThis.radio2,bottom:5*globalThis.radio2}) | ||||
|                 } | ||||
|                   .backgroundImage($rawfile('judge/score_bg.png'), ImageRepeat.NoRepeat) | ||||
|                   .backgroundImageSize({ width: '100%', height: '100%' }) | ||||
|                   .width(514) | ||||
|                   .height(618) | ||||
|                   .padding({ top: 18, bottom: 15, left: 13, right: 14 }) | ||||
|                   .width(514*globalThis.radio2) | ||||
|                   .height(618*globalThis.radio2) | ||||
|                   .padding({ top: 18*globalThis.radio2, bottom: 15*globalThis.radio2, left: 13*globalThis.radio2, right: 14*globalThis.radio2 }) | ||||
| 
 | ||||
|                 //科目二 | ||||
|                 if(this.examSubject == 2){ | ||||
| @ -518,19 +519,19 @@ struct Index { | ||||
|                             Row(){ | ||||
|                               //#FF7566 #00FFD5 #E6DECF | ||||
|                               // Text(this.projectsObj[item[0].projectCode]) | ||||
|                               Text(item[0].abbreviation).fontSize(item[0].abbreviation.length > 5?28:32).fontColor(this.getProjectColor(this.projectsObj[item[0].projectCode].type)) | ||||
|                             }.backgroundImage($rawfile('judge/project_item.png'),ImageRepeat.NoRepeat).backgroundImageSize({width:'100%',height:'100%'}).width('48.5%').height(115).margin({bottom:5}).justifyContent(FlexAlign.Center) | ||||
|                               Text(item[0].abbreviation).fontSize(item[0].abbreviation.length > 5?28*globalThis.radio2:32*globalThis.radio2).fontColor(this.getProjectColor(this.projectsObj[item[0].projectCode].type)) | ||||
|                             }.backgroundImage($rawfile('judge/project_item.png'),ImageRepeat.NoRepeat).backgroundImageSize({width:'100%',height:'100%'}).width('48.5%').height(115*globalThis.radio2).margin({bottom:5*globalThis.radio2}).justifyContent(FlexAlign.Center) | ||||
|                             if(item[1]){ | ||||
|                               Row(){ | ||||
|                                 //#FF7566 #00FFD5 #E6DECF | ||||
|                                 Text(item[1].abbreviation).fontSize(item[1].abbreviation.length > 5?28:32).fontColor(this.getProjectColor(this.projectsObj[item[1].projectCode].type)) | ||||
|                               }.backgroundImage($rawfile('judge/project_item.png'),ImageRepeat.NoRepeat).backgroundImageSize({width:'100%',height:'100%'}).width('48.5%').height(115).margin({left:5,bottom:5}).justifyContent(FlexAlign.Center) | ||||
|                                 Text(item[1].abbreviation).fontSize(item[1].abbreviation.length > 5?28*globalThis.radio2:32*globalThis.radio2).fontColor(this.getProjectColor(this.projectsObj[item[1].projectCode].type)) | ||||
|                               }.backgroundImage($rawfile('judge/project_item.png'),ImageRepeat.NoRepeat).backgroundImageSize({width:'100%',height:'100%'}).width('48.5%').height(115*globalThis.radio2).margin({left:5*globalThis.radio2,bottom:5*globalThis.radio2}).justifyContent(FlexAlign.Center) | ||||
|                             } | ||||
|                           } | ||||
|                         } | ||||
|                       }); | ||||
|                     } | ||||
|                   }.backgroundImage($rawfile('judge/project_bg.png'),ImageRepeat.NoRepeat).backgroundImageSize({width:'100%',height:'100%'}).width('57%').height('100%').padding(30).margin({right:10}) | ||||
|                   }.backgroundImage($rawfile('judge/project_bg.png'),ImageRepeat.NoRepeat).backgroundImageSize({width:'100%',height:'100%'}).width('57%').height('100%').padding(30*globalThis.radio2).margin({right:10*globalThis.radio2}) | ||||
|                 } | ||||
| 
 | ||||
|                 //科目三 | ||||
| @ -542,11 +543,11 @@ struct Index { | ||||
|                           ListItem(){ | ||||
|                             Text(project.name){ | ||||
| 
 | ||||
|                             }.fontColor(this.getProjectColor(this.projectsObj[project.projectCode].type)).margin({bottom:5}).fontSize(26) | ||||
|                           }.margin({bottom:8}) | ||||
|                             }.fontColor(this.getProjectColor(this.projectsObj[project.projectCode].type)).margin({bottom:5*globalThis.radio2}).fontSize(26*globalThis.radio2) | ||||
|                           }.margin({bottom:8*globalThis.radio2}) | ||||
|                         }) | ||||
|                       }.lanes(2).margin({left:25}) | ||||
|                     }.width('100%').height('50%').backgroundImage($rawfile('judge/project_km3_bg.png'),ImageRepeat.NoRepeat).backgroundImageSize({width:'100%',height:'100%'}).padding(30).margin({right:5}) | ||||
|                       }.lanes(2).margin({left:25*globalThis.radio2}) | ||||
|                     }.width('100%').height('50%').backgroundImage($rawfile('judge/project_km3_bg.png'),ImageRepeat.NoRepeat).backgroundImageSize({width:'100%',height:'100%'}).padding(30*globalThis.radio2).margin({right:5*globalThis.radio2}) | ||||
| 
 | ||||
|                     Flex({wrap:FlexWrap.Wrap,direction:FlexDirection.Row,justifyContent:FlexAlign.SpaceAround}){ | ||||
|                       List(){ | ||||
| @ -555,7 +556,7 @@ struct Index { | ||||
|                             $rawfile( | ||||
|                               `judge/km3/${this.getIsExitManualProject(index) ? item : (item+'_gray')}.png` | ||||
|                             ),ImageRepeat.NoRepeat) | ||||
|                           .backgroundImageSize({width:'100%',height:'100%'}).width(174).height(118).margin({bottom:15}) | ||||
|                           .backgroundImageSize({width:'100%',height:'100%'}).width(174*globalThis.radio2).height(118*globalThis.radio2).margin({bottom:15*globalThis.radio2}) | ||||
|                           .onClick(()=>{ | ||||
|                             if(this.getIsExitManualProject(index)){ | ||||
|                               // 靠边停车时候可以触发 | ||||
| @ -578,26 +579,26 @@ struct Index { | ||||
|                             } | ||||
|                           }) | ||||
|                         }) | ||||
|                       }.lanes(3).margin({left:5,top:18}) | ||||
|                       }.lanes(3).margin({left:5*globalThis.radio2,top:18*globalThis.radio2}) | ||||
|                     } | ||||
|                   }.backgroundImage($rawfile('judge/project_bg.png'),ImageRepeat.NoRepeat).backgroundImageSize({width:'100%',height:'100%'}).width(660).height(640).padding(44).margin({right:10}) | ||||
|                   }.backgroundImage($rawfile('judge/project_bg.png'),ImageRepeat.NoRepeat).backgroundImageSize({width:'100%',height:'100%'}).width(660*globalThis.radio2).height(640*globalThis.radio2).padding(44*globalThis.radio2).margin({right:10*globalThis.radio2}) | ||||
|                 } | ||||
|               }.margin({ top: 15 }).height('80%').justifyContent(FlexAlign.SpaceBetween) | ||||
|             }.width('100%').height('100%').alignItems(HorizontalAlign.Start).margin({ top: 10 }) | ||||
|               }.margin({ top: 15*globalThis.radio2 }).height('80%').justifyContent(FlexAlign.SpaceBetween) | ||||
|             }.width('100%').height('100%').alignItems(HorizontalAlign.Start).margin({ top: 10*globalThis.radio2 }) | ||||
|           }.height('100%').alignItems(HorizontalAlign.Start) | ||||
|         }.width('75%').height('100%') | ||||
| 
 | ||||
|         Column() { | ||||
|           Column() { | ||||
|             Row() { | ||||
|               Text(this.totalScore + '').fontColor('#FFEECC').fontSize(55) | ||||
|               Text('分').fontColor('#FFEECC').fontSize(30).padding({ top: 5 }) | ||||
|               Text(this.totalScore + '').fontColor('#FFEECC').fontSize(55*globalThis.radio2) | ||||
|               Text('分').fontColor('#FFEECC').fontSize(30*globalThis.radio2).padding({ top: 5*globalThis.radio2 }) | ||||
|             } | ||||
|             .width(334) | ||||
|             .height(120) | ||||
|             .width(334*globalThis.radio2) | ||||
|             .height(120*globalThis.radio2) | ||||
|             .justifyContent(FlexAlign.Center) | ||||
|             .alignItems(VerticalAlign.Center) | ||||
|             .border({ width: 5, color: '#4D4136', radius: 30 }) | ||||
|             .border({ width: 5*globalThis.radio2, color: '#4D4136', radius: 30 }) | ||||
|             .onClick(() => { | ||||
|               this.signDisplayComVisible = true | ||||
|             }) | ||||
| @ -605,24 +606,24 @@ struct Index { | ||||
|             Row() { | ||||
|               Image(this.kszp).width('85%').height('85%') | ||||
|             } | ||||
|             .width(226) | ||||
|             .height(312) | ||||
|             .width(226*globalThis.radio2) | ||||
|             .height(312*globalThis.radio2) | ||||
|             .backgroundImage($rawfile('judge/photo_bg.png'), ImageRepeat.NoRepeat) | ||||
|             .backgroundImageSize({ width: '100%', height: '100%' }) | ||||
|             .justifyContent(FlexAlign.Center) | ||||
|             .alignItems(VerticalAlign.Center) | ||||
|             .margin({ top: 30 ,bottom:15}) | ||||
|             .margin({ top: 30*globalThis.radio2,bottom:15*globalThis.radio2}) | ||||
|           } | ||||
| 
 | ||||
|           Column(){ | ||||
|             if(this.examSubject == 3){ | ||||
|               Row(){ | ||||
|                 Row(){}.width(60).height(60).backgroundImage($rawfile('judge/manual_judge.png'), ImageRepeat.NoRepeat).backgroundImageSize({ width: '100%', height: '100%' }) | ||||
|                 Text('人工评判').fontColor('#FFF').fontSize(32).padding({right:12}) | ||||
|               }.width(334).height(110).justifyContent(FlexAlign.Center).alignItems(VerticalAlign.Center) | ||||
|                 Row(){}.width(60*globalThis.radio2).height(60*globalThis.radio2).backgroundImage($rawfile('judge/manual_judge.png'), ImageRepeat.NoRepeat).backgroundImageSize({ width: '100%', height: '100%' }) | ||||
|                 Text('人工评判').fontColor('#FFF').fontSize(32*globalThis.radio2).padding({right:12*globalThis.radio2}) | ||||
|               }.width(334*globalThis.radio2).height(110*globalThis.radio2).justifyContent(FlexAlign.Center).alignItems(VerticalAlign.Center) | ||||
|                .backgroundImage($rawfile('judge/button_nor.png'), ImageRepeat.NoRepeat) | ||||
|                .backgroundImageSize({ width: '100%', height: '100%' }) | ||||
|                .margin({bottom:10}) | ||||
|                .margin({bottom:10*globalThis.radio2}) | ||||
|                .onClick(()=>{ | ||||
|                 if(this.judgeConfigObj['342'] == 0){ | ||||
|                   this.isDeductedPopShow = true | ||||
| @ -637,16 +638,16 @@ struct Index { | ||||
| 
 | ||||
| 
 | ||||
|             Row(){ | ||||
|               Row(){}.width(60).height(60).backgroundImage($rawfile('judge/phone.png'), ImageRepeat.NoRepeat).backgroundImageSize({ width: '100%', height: '100%' }) | ||||
|               Text('呼叫请求').fontColor('#FFF').fontSize(32).padding({right:12}) | ||||
|             }.width(334).height(110).justifyContent(FlexAlign.Center).alignItems(VerticalAlign.Center) | ||||
|               Row(){}.width(60*globalThis.radio2).height(60*globalThis.radio2).backgroundImage($rawfile('judge/phone.png'), ImageRepeat.NoRepeat).backgroundImageSize({ width: '100%', height: '100%' }) | ||||
|               Text('呼叫请求').fontColor('#FFF').fontSize(32*globalThis.radio2).padding({right:12*globalThis.radio2}) | ||||
|             }.width(334*globalThis.radio2).height(110*globalThis.radio2).justifyContent(FlexAlign.Center).alignItems(VerticalAlign.Center) | ||||
|             .backgroundImage($rawfile('judge/button_nor.png'), ImageRepeat.NoRepeat) | ||||
|             .backgroundImageSize({ width: '100%', height: '100%' }) | ||||
|             .margin({bottom:10}) | ||||
|             .margin({bottom:10*globalThis.radio2}) | ||||
| 
 | ||||
|             Row() {} | ||||
|             .width(334) | ||||
|             .height(100) | ||||
|             .width(334*globalThis.radio2) | ||||
|             .height(100*globalThis.radio2) | ||||
|             .backgroundImage($rawfile('judge/anniu_nor.png'), ImageRepeat.NoRepeat) | ||||
|             .backgroundImageSize({ width: '100%', height: '100%' }) | ||||
|             .onClick(() => { | ||||
| @ -659,15 +660,15 @@ struct Index { | ||||
|                 }); | ||||
|               } | ||||
|             }) | ||||
|           }.margin({bottom:30}) | ||||
|           }.margin({bottom:30*globalThis.radio2}) | ||||
| 
 | ||||
|         } | ||||
|         .width('25%') | ||||
|         .height('100%') | ||||
|         .justifyContent(FlexAlign.SpaceBetween) | ||||
|         .alignItems(HorizontalAlign.Center) | ||||
|         .margin({ bottom: 20 }) | ||||
|       }.height('90%').justifyContent(FlexAlign.Start).padding({ top: 37, left: 60, bottom: 35, right: 60 }) | ||||
|         .margin({ bottom: 20*globalThis.radio2 }) | ||||
|       }.height('90%').justifyContent(FlexAlign.Start).padding({ top: 37*globalThis.radio2, left: 60*globalThis.radio2, bottom: 35*globalThis.radio2, right: 60*globalThis.radio2 }) | ||||
| 
 | ||||
|       //结束考试弹窗 | ||||
|       if (this.endPopupVisible) { | ||||
| @ -706,9 +707,9 @@ struct Index { | ||||
|           }).margin({ top: 100 }) | ||||
| 
 | ||||
|           Row() {} | ||||
|           .width(240) | ||||
|           .height(240) | ||||
|           .position({ x: '81%', y: 80 }) | ||||
|           .width(240*globalThis.radio2) | ||||
|           .height(240*globalThis.radio2) | ||||
|           .position({ x: '81%', y: 80*globalThis.radio2 }) | ||||
|           .backgroundImage($rawfile('judge/close.png'), ImageRepeat.NoRepeat) | ||||
|           .backgroundImageSize({ width: '33.33%', height: '33.33%' }) | ||||
|           .onClick(() => { | ||||
|  | ||||
| @ -1,5 +1,6 @@ | ||||
| import hilog from '@ohos.hilog'; | ||||
| import apiJudgeSdk from 'libJudgeSdk.so'; | ||||
| // @ts-ignore | ||||
| import apiJudgeSdk from '@ohos.judgesdk'; | ||||
| import Judge from './judgeSDK/utils/judge-real' | ||||
| import {Project,ProjectObj,MarkRule} from './judgeSDK/api/judgeSDK.d' | ||||
| import AccountTable from '../common/database/tables/AccountTable'; | ||||
|  | ||||
| @ -42,15 +42,15 @@ struct Index { | ||||
|       Column() { | ||||
|         Row() { | ||||
|           Column() { | ||||
|             Text('V ' + this.version).fontColor('#CCAE7A').fontSize(22*this.ratio).width('30%').margin({bottom:10*this.ratio}) | ||||
|             Text('授权信息:' + (this.hasAuth?'已授权':'未授权')).fontColor('#CCAE7A').fontSize(22*this.ratio).width('30%') | ||||
|             Text('V ' + this.version).fontColor('#CCAE7A').fontSize(22*globalThis.ratio).width('30%').margin({bottom:10*globalThis.ratio}) | ||||
|             Text('授权信息:' + (this.hasAuth?'已授权':'未授权')).fontColor('#CCAE7A').fontSize(22*globalThis.ratio).width('30%') | ||||
|           } | ||||
|           .margin({left: 24*this.ratio}) | ||||
|           Text('考车号:' +  globalThis.deviceNo).fontColor('#CCAE7A').fontSize(22*this.ratio).margin({right: 24*this.ratio}) | ||||
|           .margin({left: 24*globalThis.ratio}) | ||||
|           Text('考车号:' +  globalThis.deviceNo).fontColor('#CCAE7A').fontSize(22*globalThis.ratio).margin({right: 24*globalThis.ratio}) | ||||
|         } | ||||
|         .width('100%') | ||||
|         .justifyContent(FlexAlign.SpaceBetween) | ||||
|         .margin({bottom: 10*this.ratio}) | ||||
|         .margin({bottom: 10*globalThis.ratio}) | ||||
|       } | ||||
|     } | ||||
|     .width('100%') | ||||
|  | ||||
| @ -45,7 +45,7 @@ struct Index { | ||||
|                     .height('100%') | ||||
|                     .fontColor('#E5CBA1') | ||||
|                     .padding({'left': '35px'}) | ||||
|                     .fontSize(this.inputFontSize*this.ratio) | ||||
|                     .fontSize(this.inputFontSize*globalThis.ratio) | ||||
|                   TextInput({'text':this.inputTextList1[index]?this.inputTextList1[index]: ''}) | ||||
|                     .width('50%') | ||||
|                     .height('60%') | ||||
| @ -53,7 +53,7 @@ struct Index { | ||||
|                     .borderColor('#E6E0D8') | ||||
|                     .borderRadius('10px') | ||||
|                     .borderWidth('2px') | ||||
|                     .fontSize(this.inputFontSize*this.ratio) | ||||
|                     .fontSize(this.inputFontSize*globalThis.ratio) | ||||
|                     .padding({top:0,bottom:0}) | ||||
|                     .linearGradient({ | ||||
|                       angle: 0, | ||||
|  | ||||
| @ -529,11 +529,11 @@ struct UserInfo { | ||||
|   // 几个按钮公共样式 | ||||
|   @Styles | ||||
|   commStyle(){ | ||||
|     .width(220 * this.ratio) | ||||
|     .height(69 * this.ratio) | ||||
|     .width(220 * globalThis.ratio) | ||||
|     .height(69 * globalThis.ratio) | ||||
|     .backgroundImage($r('app.media.button_nor')) | ||||
|     .backgroundImageSize({ width: '100%', height: '100%' }) | ||||
|     .margin({ bottom: 12 * this.ratio }) | ||||
|     .margin({ bottom: 12 * globalThis.ratio }) | ||||
|   } | ||||
| 
 | ||||
|   private labelBlocks = [ | ||||
| @ -554,38 +554,38 @@ struct UserInfo { | ||||
|             Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) { | ||||
|               Column() { | ||||
|                 CommText({ | ||||
|                   ratio: this.ratio, | ||||
|                   ratio: globalThis.ratio, | ||||
|                   color: item.sfzmhm != this.currentUser.sfzmhm ? '#FFFFFF' : '#000000', | ||||
|                   text: item.lsh | ||||
|                 }) | ||||
|                 CommText({ | ||||
|                   ratio: this.ratio, | ||||
|                   ratio: globalThis.ratio, | ||||
|                   color: item.sfzmhm != this.currentUser.sfzmhm ? '#FFFFFF' : '#000000', | ||||
|                   text: decodeURIComponent(item.xm) | ||||
|                 }) | ||||
|               } | ||||
|             } | ||||
|             .width(165 * this.ratio) | ||||
|             .height(85 * this.ratio) | ||||
|             .width(165 * globalThis.ratio) | ||||
|             .height(85 * globalThis.ratio) | ||||
|             .backgroundImage(item.sfzmhm != this.currentUser.sfzmhm ? $r('app.media.userbox2') : $r('app.media.userboxbg')) | ||||
|             .backgroundImageSize({ width: '100%', height: '100%' }) | ||||
|             .onClick(() => { | ||||
|               this.currentUser = item | ||||
|             }) | ||||
|           }) | ||||
|         }.width(640 * this.ratio).margin({ left: 30 * this.ratio }) | ||||
|         }.width(640 * globalThis.ratio).margin({ left: 30 * globalThis.ratio }) | ||||
| 
 | ||||
|         Image($r('app.media.dk_prev')) | ||||
|           .width(90 * this.ratio) | ||||
|           .height(70 * this.ratio) | ||||
|           .margin({ left: 65 * this.ratio, right: 10 * this.ratio }) | ||||
|           .width(90 * globalThis.ratio) | ||||
|           .height(70 * globalThis.ratio) | ||||
|           .margin({ left: 65 * globalThis.ratio, right: 10 * globalThis.ratio }) | ||||
|           .onClick(() => { | ||||
|             this.prevClick() | ||||
|           }) | ||||
|         Image($r('app.media.dk_next')).width(90 * this.ratio).height(70 * this.ratio).onClick(() => { | ||||
|         Image($r('app.media.dk_next')).width(90 * globalThis.ratio).height(70 * globalThis.ratio).onClick(() => { | ||||
|           this.nextClick() | ||||
|         }) | ||||
|       }.margin({ top: 40 * this.ratio, bottom: 10 * this.ratio }) | ||||
|       }.margin({ top: 40 * globalThis.ratio, bottom: 10 * globalThis.ratio }) | ||||
| 
 | ||||
|       Flex({ justifyContent: FlexAlign.SpaceBetween }) { | ||||
|         Row() { | ||||
| @ -593,24 +593,24 @@ struct UserInfo { | ||||
|             if (this.currentUser['kszp']) { | ||||
| 
 | ||||
|               Avatar({ | ||||
|                 ratio: this.ratio, | ||||
|                 ratio: globalThis.ratio, | ||||
|                 url: this.currentUser['kszp'] ? this.currentUser['kszp'] : '' | ||||
|               }) | ||||
|             } else { | ||||
|               Avatar({ | ||||
|                 ratio: this.ratio, | ||||
|                 ratio: globalThis.ratio, | ||||
|                 url: "" | ||||
|               }) | ||||
|             } | ||||
|             if (this.currentUser['ksmjzp']) { | ||||
|               Avatar({ | ||||
|                 ratio: this.ratio, | ||||
|                 ratio: globalThis.ratio, | ||||
|                 url: this.currentUser['ksmjzp'] ? this.currentUser['ksmjzp'] : '' | ||||
|               }) | ||||
|             } else { | ||||
| 
 | ||||
|               Avatar({ | ||||
|                 ratio: this.ratio, | ||||
|                 ratio: globalThis.ratio, | ||||
|                 url: "" | ||||
|               }) | ||||
|             } | ||||
| @ -618,15 +618,15 @@ struct UserInfo { | ||||
| 
 | ||||
|           Column() { | ||||
|             ForEach(this.labelBlocks, (item) => { | ||||
|               LabelBlock({ label: item.label, ratio: this.ratio, value: this.currentUser[item.key] }) | ||||
|               LabelBlock({ label: item.label, ratio: globalThis.ratio, value: this.currentUser[item.key] }) | ||||
|             }) | ||||
|           } | ||||
|         } | ||||
|         .width(664 * this.ratio) | ||||
|         .height(339 * this.ratio) | ||||
|         .width(664 * globalThis.ratio) | ||||
|         .height(339 * globalThis.ratio) | ||||
|         .backgroundImage($r('app.media.dkbg')) | ||||
|         .backgroundImageSize({ width: '100%', height: '100%' }) | ||||
|         .margin({ left: 53 * this.ratio }) | ||||
|         .margin({ left: 53 * globalThis.ratio }) | ||||
| 
 | ||||
|         Column() { | ||||
|           Image($r('app.media.yydj_btn')) | ||||
| @ -706,11 +706,11 @@ struct UserInfo { | ||||
|       if (this.qkFlag) { | ||||
|         Column() { | ||||
|           Text('确认考生:' + this.currentUser.xm + '是否缺考') | ||||
|             .fontSize(28 * this.ratio) | ||||
|             .position({ x: 160 * this.ratio, y: 122 * this.ratio }) | ||||
|             .fontSize(28 * globalThis.ratio) | ||||
|             .position({ x: 160 * globalThis.ratio, y: 122 * globalThis.ratio }) | ||||
|           Row() { | ||||
|             Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) { | ||||
|               Text('  取   消  ').fontSize(24 * this.ratio).fontColor('#fff').width(100 * this.ratio) | ||||
|               Text('  取   消  ').fontSize(24 * globalThis.ratio).fontColor('#fff').width(100 * globalThis.ratio) | ||||
|             } | ||||
|             .commStyle() | ||||
|             .onClick(() => { | ||||
| @ -718,20 +718,20 @@ struct UserInfo { | ||||
|             }) | ||||
| 
 | ||||
|             Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) { | ||||
|               Text('  确   定  ').fontSize(24 * this.ratio).fontColor('#fff').width(100 * this.ratio) | ||||
|               Text('  确   定  ').fontSize(24 * globalThis.ratio).fontColor('#fff').width(100 * globalThis.ratio) | ||||
|             } | ||||
|             .commStyle() | ||||
|             .onClick(() => { | ||||
|               this.qkFn() | ||||
|             }) | ||||
|           }.position({ y: 265 * this.ratio, x: 115 * this.ratio }) | ||||
|           }.position({ y: 265 * globalThis.ratio, x: 115 * globalThis.ratio }) | ||||
| 
 | ||||
|         } | ||||
|         .width(660 * this.ratio) | ||||
|         .height(360 * this.ratio) | ||||
|         .position({ x: 150 * this.ratio, y: 98 * this.ratio }) | ||||
|         .width(660 * globalThis.ratio) | ||||
|         .height(360 * globalThis.ratio) | ||||
|         .position({ x: 150 * globalThis.ratio, y: 98 * globalThis.ratio }) | ||||
|         .backgroundColor('#E6E3DF') | ||||
|         .borderRadius(19 * this.ratio) | ||||
|         .borderRadius(19 * globalThis.ratio) | ||||
|       } | ||||
|     } | ||||
|     .height('100%') | ||||
| @ -750,9 +750,9 @@ struct Avatar { | ||||
|   build() { | ||||
|     Row() { | ||||
|       Image(this.url) | ||||
|         .width(93 * this.ratio) | ||||
|         .height(130.5 * this.ratio) | ||||
|         .margin({ bottom: 10 * this.ratio, right: 58 * this.ratio, left: 55 * this.ratio }) | ||||
|         .width(93 * globalThis.ratio) | ||||
|         .height(130.5 * globalThis.ratio) | ||||
|         .margin({ bottom: 10 * globalThis.ratio, right: 58 * globalThis.ratio, left: 55 * globalThis.ratio }) | ||||
|         .backgroundColor('orange') | ||||
|         .border({ color: '#fff', width: 1, style: BorderStyle.Solid }) | ||||
|     } | ||||
| @ -768,8 +768,8 @@ struct CommText { | ||||
| 
 | ||||
|   build() { | ||||
|     Text(this.text) | ||||
|       .fontSize(16 * this.ratio) | ||||
|       .lineHeight(30 * this.ratio) | ||||
|       .fontSize(16 * globalThis.ratio) | ||||
|       .lineHeight(30 * globalThis.ratio) | ||||
|       .fontWeight(500) | ||||
|       .fontColor(this.color) | ||||
|   } | ||||
| @ -784,21 +784,21 @@ struct LabelBlock { | ||||
| 
 | ||||
|   @Styles | ||||
|   commLabelStyle(){ | ||||
|     .width(280 * this.ratio) | ||||
|     .height(35 * this.ratio) | ||||
|     .width(280 * globalThis.ratio) | ||||
|     .height(35 * globalThis.ratio) | ||||
|     .backgroundImageSize({ width: '100%', height: '100%' }) | ||||
|     .backgroundImage($r('app.media.userbox')) | ||||
|     .margin({ left: 8 * this.ratio }) | ||||
|     .margin({ left: 8 * globalThis.ratio }) | ||||
|     .align(Alignment.Center) | ||||
|   } | ||||
| 
 | ||||
|   build() { | ||||
|     Row() { | ||||
|       Text(this.label).fontSize(16 * this.ratio).fontColor('#99948A') | ||||
|       Text(this.label).fontSize(16 * globalThis.ratio).fontColor('#99948A') | ||||
|       Row() { | ||||
|         Text(this.value).fontColor('#fff').textAlign(TextAlign.Center).width('100%') | ||||
|       } | ||||
|       .commLabelStyle() | ||||
|     }.margin({ bottom: 10 * this.ratio }) | ||||
|     }.margin({ bottom: 10 * globalThis.ratio }) | ||||
|   } | ||||
| } | ||||
| @ -121,27 +121,27 @@ struct Index { | ||||
|               currentProgressRate: this.curRate, | ||||
|               controller: item.controller | ||||
|             }) | ||||
|               .width(200 * this.ratio) | ||||
|               .width(200 * globalThis.ratio) | ||||
|               .muted(true) | ||||
|               .height(180 * this.ratio) | ||||
|               .height(180 * globalThis.ratio) | ||||
|               .autoPlay(this.isAutoPlay) | ||||
|               .controls(this.showControls) | ||||
|               .margin(10 * this.ratio) | ||||
|               .margin(10 * globalThis.ratio) | ||||
|           }) | ||||
|         }.margin({ top: 37 * this.ratio, left: 30 * this.ratio }).width(600*this.ratio).height(600*this.ratio) | ||||
|         }.margin({ top: 37 * globalThis.ratio, left: 30 * globalThis.ratio }).width(600*globalThis.ratio).height(600*globalThis.ratio) | ||||
| 
 | ||||
|         Column() { | ||||
|           Image($r('app.media.shezhi')) | ||||
|             .width(215 * this.ratio) | ||||
|             .height(64 * this.ratio) | ||||
|             .margin({ bottom: 10 * this.ratio }) | ||||
|             .width(215 * globalThis.ratio) | ||||
|             .height(64 * globalThis.ratio) | ||||
|             .margin({ bottom: 10 * globalThis.ratio }) | ||||
|             .onClick(() => { | ||||
|               this.showFlag = true | ||||
|             }) | ||||
|           Image($r('app.media.luxiang')) | ||||
|             .width(215 * this.ratio) | ||||
|             .height(64 * this.ratio) | ||||
|             .margin({ bottom: 10 * this.ratio }) | ||||
|             .width(215 * globalThis.ratio) | ||||
|             .height(64 * globalThis.ratio) | ||||
|             .margin({ bottom: 10 * globalThis.ratio }) | ||||
|             .onClick(async () => { | ||||
|               if (!this.param.videoRecord4 && !this.param.videoRecord3 && !this.param.videoRecord2 && !this.param.videoRecord1) { | ||||
|                 promptAction.showToast({ | ||||
| @ -164,10 +164,10 @@ struct Index { | ||||
|               }) | ||||
|             }) | ||||
|           Image($r('app.media.tingzhi')) | ||||
|             .width(215 * this.ratio) | ||||
|             .height(64 * this.ratio) | ||||
|             .width(215 * globalThis.ratio) | ||||
|             .height(64 * globalThis.ratio) | ||||
| 
 | ||||
|             .margin({ bottom: 10 * this.ratio }) | ||||
|             .margin({ bottom: 10 * globalThis.ratio }) | ||||
|             .onClick(() => { | ||||
|               for (let i = 1; i <= 4; i++) { | ||||
|                 console.log('rocord_handle',i,JSON.stringify(this.rocordHandleObj)) | ||||
| @ -183,8 +183,8 @@ struct Index { | ||||
|               }) | ||||
|             }) | ||||
|           Image($r('app.media.zhuatu')) | ||||
|             .width(215 * this.ratio) | ||||
|             .height(64 * this.ratio) | ||||
|             .width(215 * globalThis.ratio) | ||||
|             .height(64 * globalThis.ratio) | ||||
|             .onClick(async () => { | ||||
|               const arr=['1','2','3','4'] | ||||
|               if(!arr.includes(this.param.pztd)){ | ||||
| @ -209,18 +209,18 @@ struct Index { | ||||
|               } | ||||
| 
 | ||||
|             }) | ||||
|             .margin({ bottom: 10 * this.ratio }) | ||||
|         }.margin({ right: 38 * this.ratio, top: 110 * this.ratio }) | ||||
|             .margin({ bottom: 10 * globalThis.ratio }) | ||||
|         }.margin({ right: 38 * globalThis.ratio, top: 110 * globalThis.ratio }) | ||||
|       }.backgroundColor('#1A1A1A') | ||||
| 
 | ||||
|       // Column() { | ||||
|       //   Text('提示信息:') | ||||
|       //     .fontSize(18 * this.ratio) | ||||
|       //     .fontSize(18 * globalThis.ratio) | ||||
|       //     .fontColor('#fff') | ||||
|       //     .margin({ left: 29 * this.ratio, top: 13 * this.ratio }) | ||||
|       //     .margin({ left: 29 * globalThis.ratio, top: 13 * globalThis.ratio }) | ||||
|       //     .align(Alignment.Start) | ||||
|       //     .width('100%') | ||||
|       // }.width('100%').height(70 * this.ratio).backgroundColor('#333230').position({ x: 0, y: 470 * this.ratio }) | ||||
|       // }.width('100%').height(70 * globalThis.ratio).backgroundColor('#333230').position({ x: 0, y: 470 * globalThis.ratio }) | ||||
| 
 | ||||
|       if (this.showFlag) { | ||||
|         Column() { | ||||
| @ -228,197 +228,197 @@ struct Index { | ||||
|             Text('视频参数设置') | ||||
|               .width('100%') | ||||
|               .align(Alignment.Start) | ||||
|               .fontSize(24 * this.ratio) | ||||
|               .fontSize(24 * globalThis.ratio) | ||||
|               .fontColor('#333333') | ||||
|               .margin({ left: 20 * this.ratio, top: 22 * this.ratio }) | ||||
|               .margin({ left: 20 * globalThis.ratio, top: 22 * globalThis.ratio }) | ||||
|             Row() { | ||||
|               Image($r('app.media.fh')).width(117 * this.ratio).height(50 * this.ratio).onClick(() => { | ||||
|               Image($r('app.media.fh')).width(117 * globalThis.ratio).height(50 * globalThis.ratio).onClick(() => { | ||||
|                 // this.oldParam = JSON.parse(JSON.stringify(this.param)) | ||||
|                 this.param = JSON.parse(JSON.stringify(this.oldParam)) | ||||
|                 this.showFlag = false | ||||
|               }) | ||||
|               Image($r('app.media.bc')) | ||||
|                 .width(117 * this.ratio) | ||||
|                 .height(50 * this.ratio) | ||||
|                 .margin({ left: 15 * this.ratio }) | ||||
|                 .width(117 * globalThis.ratio) | ||||
|                 .height(50 * globalThis.ratio) | ||||
|                 .margin({ left: 15 * globalThis.ratio }) | ||||
|                 .onClick(() => { | ||||
|                   console.log('111111') | ||||
|                   this.writeConfig() | ||||
| 
 | ||||
|                 }) | ||||
|             }.margin({ right: 135 * this.ratio, top: 10 * this.ratio }) | ||||
|             }.margin({ right: 135 * globalThis.ratio, top: 10 * globalThis.ratio }) | ||||
|           } | ||||
| 
 | ||||
|           Column() { | ||||
|             Row() { | ||||
|               Text('视频路数').fontColor('#333333').fontSize(16 * this.ratio).margin({ left: 13 * this.ratio }) | ||||
|               Text('视频路数').fontColor('#333333').fontSize(16 * globalThis.ratio).margin({ left: 13 * globalThis.ratio }) | ||||
|               TextInput({ text: this.param.videoNum, controller: this.inputController }) | ||||
|                 .type(InputType.Normal) | ||||
|                 .borderRadius(0) | ||||
|                 .width(34 * this.ratio) | ||||
|                 .height(26 * this.ratio) | ||||
|                 .width(34 * globalThis.ratio) | ||||
|                 .height(26 * globalThis.ratio) | ||||
|                 .padding({ top: 0, bottom: 0 }) | ||||
|                 .margin({ left: 10 * this.ratio }) | ||||
|                 .fontSize(this.inputFontSize * this.ratio) | ||||
|                 .margin({ left: 10 * globalThis.ratio }) | ||||
|                 .fontSize(this.inputFontSize * globalThis.ratio) | ||||
|                 .onChange((value) => { | ||||
|                   this.param.spls = value | ||||
|                 }) | ||||
|               Column() { | ||||
|                 Image($r('app.media.shang')).width(15 * this.ratio).height(15 * this.ratio).onClick(() => { | ||||
|                 Image($r('app.media.shang')).width(15 * globalThis.ratio).height(15 * globalThis.ratio).onClick(() => { | ||||
|                   this.param.videoNum = (parseInt(this.param.videoNum) + 1).toString() | ||||
|                 }) | ||||
|                 Image($r('app.media.xia')).width(15 * this.ratio).height(15 * this.ratio).onClick(() => { | ||||
|                 Image($r('app.media.xia')).width(15 * globalThis.ratio).height(15 * globalThis.ratio).onClick(() => { | ||||
|                   this.param.videoNum = (parseInt(this.param.videoNum) - 1).toString() | ||||
|                 }) | ||||
|               }.margin({ left: 5 * this.ratio, right: 10 * this.ratio }) | ||||
|               }.margin({ left: 5 * globalThis.ratio, right: 10 * globalThis.ratio }) | ||||
| 
 | ||||
|               Checkbox({ name: 'checkbox1', group: 'checkboxGroup' }) | ||||
|                 .select(this.param.faceFlag) | ||||
|                 .width(22 * this.ratio) | ||||
|                 .height(22 * this.ratio) | ||||
|                 .width(22 * globalThis.ratio) | ||||
|                 .height(22 * globalThis.ratio) | ||||
|                 .onChange((value: boolean) => { | ||||
|                   this.param.faceFlag = value | ||||
|                   console.info('Checkbox1 change is' + value) | ||||
|                 }) | ||||
|               Text('启用过程人脸比对').fontColor('#333333').fontSize(16 * this.ratio) | ||||
|               Text('启用过程人脸比对').fontColor('#333333').fontSize(16 * globalThis.ratio) | ||||
|               TextInput({ text: this.param.rlls, controller: this.inputController }) | ||||
|                 .type(InputType.Normal) | ||||
|                 .borderRadius(0) | ||||
|                 .width(34 * this.ratio) | ||||
|                 .fontSize(this.inputFontSize * this.ratio) | ||||
|                 .height(26 * this.ratio) | ||||
|                 .width(34 * globalThis.ratio) | ||||
|                 .fontSize(this.inputFontSize * globalThis.ratio) | ||||
|                 .height(26 * globalThis.ratio) | ||||
|                 .padding({ top: 0, bottom: 0 }) | ||||
|                 .margin({ left: 10 * this.ratio, right: 15 * this.ratio }) | ||||
|                 .margin({ left: 10 * globalThis.ratio, right: 15 * globalThis.ratio }) | ||||
|                 .onChange((value) => { | ||||
|                   this.param.rlls = value | ||||
|                 }) | ||||
|               Text('拍照通道').fontColor('#333333').fontSize(16 * this.ratio) | ||||
|               Text('拍照通道').fontColor('#333333').fontSize(16 * globalThis.ratio) | ||||
|               TextInput({ text: this.param.pztd, controller: this.inputController }) | ||||
|                 .type(InputType.Normal) | ||||
|                 .borderRadius(0) | ||||
|                 .padding({ top: 0, bottom: 0 }) | ||||
|                 .width(34 * this.ratio) | ||||
|                 .height(26 * this.ratio) | ||||
|                 .fontSize(this.inputFontSize * this.ratio) | ||||
|                 .margin({ left: 10 * this.ratio, right: 15 * this.ratio }) | ||||
|                 .width(34 * globalThis.ratio) | ||||
|                 .height(26 * globalThis.ratio) | ||||
|                 .fontSize(this.inputFontSize * globalThis.ratio) | ||||
|                 .margin({ left: 10 * globalThis.ratio, right: 15 * globalThis.ratio }) | ||||
|                 .onChange((value: string) => { | ||||
|                   this.param.pztd = value | ||||
|                 }) | ||||
|               Text('设备类型').fontColor('#333333').fontSize(16 * this.ratio) | ||||
|               Text('设备类型').fontColor('#333333').fontSize(16 * globalThis.ratio) | ||||
|               TextInput({ text: '海康', controller: this.inputController }) | ||||
|                 .borderRadius(0) | ||||
|                 .padding({ bottom: 0, top: 0 }) | ||||
|                 .width(67 * this.ratio) | ||||
|                 .height(26 * this.ratio) | ||||
|                 .fontSize(this.inputFontSize * this.ratio) | ||||
|                 .margin({ left: 10 * this.ratio, right: 15 * this.ratio }) | ||||
|               Text('视频遮挡报警阀值:').fontColor('#333333').fontSize(16 * this.ratio) | ||||
|                 .width(67 * globalThis.ratio) | ||||
|                 .height(26 * globalThis.ratio) | ||||
|                 .fontSize(this.inputFontSize * globalThis.ratio) | ||||
|                 .margin({ left: 10 * globalThis.ratio, right: 15 * globalThis.ratio }) | ||||
|               Text('视频遮挡报警阀值:').fontColor('#333333').fontSize(16 * globalThis.ratio) | ||||
|               TextInput({ text: this.param.zdyz, controller: this.inputController }) | ||||
|                 .type(InputType.Normal) | ||||
|                 .borderRadius(0) | ||||
|                 .padding({ top: 0, bottom: 0 }) | ||||
|                 .width(34 * this.ratio) | ||||
|                 .height(26 * this.ratio) | ||||
|                 .fontSize(this.inputFontSize * this.ratio) | ||||
|                 .margin({ left: 10 * this.ratio, right: 15 * this.ratio }).onChange((value: string) => { | ||||
|                 .width(34 * globalThis.ratio) | ||||
|                 .height(26 * globalThis.ratio) | ||||
|                 .fontSize(this.inputFontSize * globalThis.ratio) | ||||
|                 .margin({ left: 10 * globalThis.ratio, right: 15 * globalThis.ratio }).onChange((value: string) => { | ||||
|                 this.param.zdyz = value | ||||
|               }) | ||||
|               // Text('k').fontColor('#333333').fontSize(16 * this.ratio) | ||||
|               // Text('链接类型').fontColor('#333333').fontSize(16 * this.ratio) | ||||
|               // Text('k').fontColor('#333333').fontSize(16 * globalThis.ratio) | ||||
|               // Text('链接类型').fontColor('#333333').fontSize(16 * globalThis.ratio) | ||||
|               // TextInput({ text: this.param.ljlx, controller: this.inputController }) | ||||
|               //   .type(InputType.Normal) | ||||
|               //   .borderRadius(0) | ||||
|               //   .padding({ top: 0, bottom: 0 }) | ||||
|               //   .width(34 * this.ratio) | ||||
|               //   .height(26 * this.ratio) | ||||
|               //   .fontSize(this.inputFontSize * this.ratio) | ||||
|               //   .margin({ left: 10 * this.ratio, right: 5 * this.ratio }) | ||||
|               //   .width(34 * globalThis.ratio) | ||||
|               //   .height(26 * globalThis.ratio) | ||||
|               //   .fontSize(this.inputFontSize * globalThis.ratio) | ||||
|               //   .margin({ left: 10 * globalThis.ratio, right: 5 * globalThis.ratio }) | ||||
|             }.width('100%').align(Alignment.Start).backgroundColor('#E5E3DF') | ||||
| 
 | ||||
|             Row() { | ||||
|               Column() { | ||||
|                 Row() { | ||||
|                   Row() { | ||||
|                   }.width(70 * this.ratio) | ||||
|                   }.width(70 * globalThis.ratio) | ||||
|                   Text('IP地址') | ||||
|                     .width(158 * this.ratio) | ||||
|                     .fontSize(16 * this.ratio) | ||||
|                     .width(158 * globalThis.ratio) | ||||
|                     .fontSize(16 * globalThis.ratio) | ||||
|                     .fontColor('#666666') | ||||
|                     .margin({ right: 10 * this.ratio }) | ||||
|                     .margin({ right: 10 * globalThis.ratio }) | ||||
|                     .textAlign(TextAlign.Center) | ||||
|                   Text('通道号') | ||||
|                     .width(96 * this.ratio) | ||||
|                     .fontSize(16 * this.ratio) | ||||
|                     .width(96 * globalThis.ratio) | ||||
|                     .fontSize(16 * globalThis.ratio) | ||||
|                     .fontColor('#666666') | ||||
|                     .margin({ right: 10 * this.ratio }) | ||||
|                     .margin({ right: 10 * globalThis.ratio }) | ||||
|                     .textAlign(TextAlign.Center) | ||||
|                   Text('用户名') | ||||
|                     .width(120 * this.ratio) | ||||
|                     .fontSize(16 * this.ratio) | ||||
|                     .width(120 * globalThis.ratio) | ||||
|                     .fontSize(16 * globalThis.ratio) | ||||
|                     .fontColor('#666666') | ||||
|                     .margin({ right: 10 * this.ratio }) | ||||
|                     .margin({ right: 10 * globalThis.ratio }) | ||||
|                     .textAlign(TextAlign.Center) | ||||
|                   Text('密码') | ||||
|                     .width(120 * this.ratio) | ||||
|                     .fontSize(16 * this.ratio) | ||||
|                     .width(120 * globalThis.ratio) | ||||
|                     .fontSize(16 * globalThis.ratio) | ||||
|                     .fontColor('#666666') | ||||
|                     .margin({ right: 10 * this.ratio }) | ||||
|                     .margin({ right: 10 * globalThis.ratio }) | ||||
|                     .textAlign(TextAlign.Center) | ||||
|                   Text('端口号') | ||||
|                     .width(60 * this.ratio) | ||||
|                     .fontSize(16 * this.ratio) | ||||
|                     .width(60 * globalThis.ratio) | ||||
|                     .fontSize(16 * globalThis.ratio) | ||||
|                     .fontColor('#666666') | ||||
|                     .margin({ right: 10 * this.ratio }) | ||||
|                     .margin({ right: 10 * globalThis.ratio }) | ||||
|                     .textAlign(TextAlign.Center) | ||||
|                 } | ||||
| 
 | ||||
|                 ForEach(this.lsArr,(item,index)=>{ | ||||
|                   Row() { | ||||
|                     Text(item.key) | ||||
|                       .width(70 * this.ratio) | ||||
|                       .width(70 * globalThis.ratio) | ||||
|                       .fontColor('#333333') | ||||
|                       .fontSize(16 * this.ratio) | ||||
|                       .fontSize(16 * globalThis.ratio) | ||||
|                       .textAlign(TextAlign.Center) | ||||
|                     TextInput({ text: this.param.ip, controller: this.inputController }) | ||||
|                       .type(InputType.Normal) | ||||
|                       .borderRadius(2) | ||||
|                       .width(158 * this.ratio) | ||||
|                       .height(26 * this.ratio) | ||||
|                       .fontSize(this.inputFontSize * this.ratio) | ||||
|                       .width(158 * globalThis.ratio) | ||||
|                       .height(26 * globalThis.ratio) | ||||
|                       .fontSize(this.inputFontSize * globalThis.ratio) | ||||
|                       .padding({ top: 0, bottom: 0 }) | ||||
|                       .margin({ right: 10 * this.ratio }) | ||||
|                       .margin({ right: 10 * globalThis.ratio }) | ||||
|                       .onChange((value: string) => { | ||||
|                         this.param.ip = value | ||||
|                       }) | ||||
|                     TextInput({ text: this.param['td'+(Number(index)+1)], controller: this.inputController }) | ||||
|                       .type(InputType.Normal) | ||||
|                       .borderRadius(2) | ||||
|                       .width(96 * this.ratio) | ||||
|                       .height(26 * this.ratio) | ||||
|                       .width(96 * globalThis.ratio) | ||||
|                       .height(26 * globalThis.ratio) | ||||
|                       .padding({ top: 0, bottom: 0 }) | ||||
|                       .margin({ right: 10 * this.ratio }) | ||||
|                       .fontSize(this.inputFontSize * this.ratio) | ||||
|                       .margin({ right: 10 * globalThis.ratio }) | ||||
|                       .fontSize(this.inputFontSize * globalThis.ratio) | ||||
|                       .onChange((value: string) => { | ||||
|                         this.param['td'+(Number(index)+1)] = value | ||||
|                       }) | ||||
|                     TextInput({ text: this.param.userName, controller: this.inputController }) | ||||
|                       .type(InputType.Normal) | ||||
|                       .borderRadius(2) | ||||
|                       .width(120 * this.ratio) | ||||
|                       .height(26 * this.ratio) | ||||
|                       .margin({ right: 10 * this.ratio }) | ||||
|                       .width(120 * globalThis.ratio) | ||||
|                       .height(26 * globalThis.ratio) | ||||
|                       .margin({ right: 10 * globalThis.ratio }) | ||||
|                       .padding({ top: 0, bottom: 0 }) | ||||
|                       .fontSize(this.inputFontSize * this.ratio) | ||||
|                       .fontSize(this.inputFontSize * globalThis.ratio) | ||||
|                       .onChange((value: string) => { | ||||
|                         this.param.userName = value | ||||
|                       }) | ||||
|                     TextInput({ text: this.param.pwd, controller: this.inputController }) | ||||
|                       .type(InputType.Normal) | ||||
|                       .borderRadius(2) | ||||
|                       .width(120 * this.ratio) | ||||
|                       .height(26 * this.ratio) | ||||
|                       .fontSize(this.inputFontSize * this.ratio) | ||||
|                       .margin({ right: 10 * this.ratio }) | ||||
|                       .width(120 * globalThis.ratio) | ||||
|                       .height(26 * globalThis.ratio) | ||||
|                       .fontSize(this.inputFontSize * globalThis.ratio) | ||||
|                       .margin({ right: 10 * globalThis.ratio }) | ||||
|                       .padding({ top: 0, bottom: 0 }) | ||||
|                       .onChange((value: string) => { | ||||
|                         this.param.pwd = value | ||||
| @ -426,190 +426,190 @@ struct Index { | ||||
|                     TextInput({ text: this.param.port, controller: this.inputController }) | ||||
|                       .type(InputType.Normal) | ||||
|                       .borderRadius(2) | ||||
|                       .width(60 * this.ratio) | ||||
|                       .height(26 * this.ratio) | ||||
|                       .width(60 * globalThis.ratio) | ||||
|                       .height(26 * globalThis.ratio) | ||||
|                       .padding({ top: 0, bottom: 0 }) | ||||
|                       .margin({ right: 10 * this.ratio }) | ||||
|                       .fontSize(this.inputFontSize * this.ratio) | ||||
|                       .margin({ right: 10 * globalThis.ratio }) | ||||
|                       .fontSize(this.inputFontSize * globalThis.ratio) | ||||
|                       .onChange((value: string) => { | ||||
|                         this.param.port = value | ||||
|                       }) | ||||
|                   }.margin({ top: 10 * this.ratio }) | ||||
|                   }.margin({ top: 10 * globalThis.ratio }) | ||||
|                 }) | ||||
| 
 | ||||
|               }.width(672 * this.ratio).height(174 * this.ratio).backgroundColor('#EDEBE8') | ||||
|               }.width(672 * globalThis.ratio).height(174 * globalThis.ratio).backgroundColor('#EDEBE8') | ||||
| 
 | ||||
|               Column() { | ||||
|                 Row() { | ||||
|                   Text('录像范围').fontSize(16 * this.ratio).fontColor('#333333').margin({ top: 10 * this.ratio }) | ||||
|                   Text('录像范围').fontSize(16 * globalThis.ratio).fontColor('#333333').margin({ top: 10 * globalThis.ratio }) | ||||
|                   Row() { | ||||
|                     Column() { | ||||
|                       Row() { | ||||
|                         Checkbox({ name: 'checkbox1', group: 'checkboxGroup' }) | ||||
|                           .select(this.param.videoRecord1) | ||||
|                           .width(22 * this.ratio) | ||||
|                           .height(22 * this.ratio) | ||||
|                           .width(22 * globalThis.ratio) | ||||
|                           .height(22 * globalThis.ratio) | ||||
|                           .onChange((value: boolean) => { | ||||
|                             this.param.videoRecord1 = value | ||||
|                             console.info('Checkbox1 change is' + value) | ||||
|                           }) | ||||
|                         Text('一路').fontSize(16 * this.ratio).fontColor('#333333') | ||||
|                         Text('一路').fontSize(16 * globalThis.ratio).fontColor('#333333') | ||||
|                         Checkbox({ name: 'checkbox2', group: 'checkboxGroup' }) | ||||
|                           .select(this.param.videoRecord2) | ||||
|                           .width(22 * this.ratio) | ||||
|                           .height(22 * this.ratio) | ||||
|                           .width(22 * globalThis.ratio) | ||||
|                           .height(22 * globalThis.ratio) | ||||
|                           .onChange((value: boolean) => { | ||||
|                             this.param.videoRecord2 = value | ||||
|                             console.info('Checkbox1 change is' + value) | ||||
|                           }) | ||||
|                         Text('二路').fontSize(16 * this.ratio).fontColor('#333333') | ||||
|                         Text('二路').fontSize(16 * globalThis.ratio).fontColor('#333333') | ||||
|                       } | ||||
| 
 | ||||
|                       Row() { | ||||
|                         Checkbox({ name: 'checkbox3', group: 'checkboxGroup' }) | ||||
|                           .select(this.param.videoRecord3) | ||||
|                           .width(22 * this.ratio) | ||||
|                           .height(22 * this.ratio) | ||||
|                           .width(22 * globalThis.ratio) | ||||
|                           .height(22 * globalThis.ratio) | ||||
|                           .onChange((value: boolean) => { | ||||
|                             this.param.videoRecord3 = value | ||||
|                             console.info('Checkbox1 change is' + value) | ||||
|                           }) | ||||
|                         Text('三路').fontSize(16 * this.ratio).fontColor('#333333') | ||||
|                         Text('三路').fontSize(16 * globalThis.ratio).fontColor('#333333') | ||||
|                         Checkbox({ name: 'checkbox4', group: 'checkboxGroup' }) | ||||
|                           .select(this.param.videoRecord4) | ||||
|                           .width(22 * this.ratio) | ||||
|                           .height(22 * this.ratio) | ||||
|                           .width(22 * globalThis.ratio) | ||||
|                           .height(22 * globalThis.ratio) | ||||
|                           .onChange((value: boolean) => { | ||||
|                             this.param.videoRecord4 = value | ||||
|                             console.info('Checkbox1 change is' + value) | ||||
|                           }) | ||||
|                         Text('四路').fontSize(16 * this.ratio).fontColor('#333333') | ||||
|                         Text('四路').fontSize(16 * globalThis.ratio).fontColor('#333333') | ||||
|                       } | ||||
|                     } | ||||
|                   } | ||||
|                 }.alignItems(VerticalAlign.Top).justifyContent(FlexAlign.Start) | ||||
| 
 | ||||
|                 Row() { | ||||
|                   Text('视频遮挡').fontSize(16 * this.ratio).fontColor('#333333').margin({ top: 10 * this.ratio }) | ||||
|                   Text('视频遮挡').fontSize(16 * globalThis.ratio).fontColor('#333333').margin({ top: 10 * globalThis.ratio }) | ||||
|                   Row() { | ||||
|                     Column() { | ||||
|                       Row() { | ||||
|                         Checkbox({ name: 'checkbox1', group: 'checkboxGroup' }) | ||||
|                           .select(this.param.spzd1) | ||||
|                           .width(22 * this.ratio) | ||||
|                           .height(22 * this.ratio) | ||||
|                           .width(22 * globalThis.ratio) | ||||
|                           .height(22 * globalThis.ratio) | ||||
|                           .onChange((value: boolean) => { | ||||
|                             this.param.spzd1=value | ||||
|                           }) | ||||
|                         Text('一路').fontSize(16 * this.ratio).fontColor('#333333') | ||||
|                         Text('一路').fontSize(16 * globalThis.ratio).fontColor('#333333') | ||||
|                         Checkbox({ name: 'checkbox1', group: 'checkboxGroup' }) | ||||
|                           .select(this.param.spzd2) | ||||
|                           .width(22 * this.ratio) | ||||
|                           .height(22 * this.ratio) | ||||
|                           .width(22 * globalThis.ratio) | ||||
|                           .height(22 * globalThis.ratio) | ||||
|                           .onChange((value: boolean) => { | ||||
|                             this.param.spzd2=value | ||||
|                           }) | ||||
|                         Text('二路').fontSize(16 * this.ratio).fontColor('#333333') | ||||
|                         Text('二路').fontSize(16 * globalThis.ratio).fontColor('#333333') | ||||
|                       } | ||||
| 
 | ||||
|                       Row() { | ||||
|                         Checkbox({ name: 'checkbox1', group: 'checkboxGroup' }) | ||||
|                           .select(this.param.spzd3) | ||||
|                           .width(22 * this.ratio) | ||||
|                           .height(22 * this.ratio) | ||||
|                           .width(22 * globalThis.ratio) | ||||
|                           .height(22 * globalThis.ratio) | ||||
|                           .onChange((value: boolean) => { | ||||
|                             this.param.spzd3=value | ||||
|                           }) | ||||
|                         Text('三路').fontSize(16 * this.ratio).fontColor('#333333') | ||||
|                         Text('三路').fontSize(16 * globalThis.ratio).fontColor('#333333') | ||||
|                         Checkbox({ name: 'checkbox1', group: 'checkboxGroup' }) | ||||
|                           .select(this.param.spzd4) | ||||
|                           .width(22 * this.ratio) | ||||
|                           .height(22 * this.ratio) | ||||
|                           .width(22 * globalThis.ratio) | ||||
|                           .height(22 * globalThis.ratio) | ||||
|                           .onChange((value: boolean) => { | ||||
|                             this.param.spzd4=value | ||||
|                           }) | ||||
|                         Text('四路').fontSize(16 * this.ratio).fontColor('#333333') | ||||
|                         Text('四路').fontSize(16 * globalThis.ratio).fontColor('#333333') | ||||
|                       } | ||||
|                     } | ||||
|                   } | ||||
|                 }.alignItems(VerticalAlign.Top).justifyContent(FlexAlign.Start) | ||||
|               }.width(267 * this.ratio).height(174 * this.ratio).margin({ left: 7 * this.ratio, top: 10 * this.ratio }) | ||||
|               }.width(267 * globalThis.ratio).height(174 * globalThis.ratio).margin({ left: 7 * globalThis.ratio, top: 10 * globalThis.ratio }) | ||||
| 
 | ||||
|             }.width('100%') | ||||
| 
 | ||||
|             Row() { | ||||
|               Checkbox({ name: 'checkbox1', group: 'checkboxGroup' }) | ||||
|                 .select(this.param.shuiying) | ||||
|                 .width(22 * this.ratio) | ||||
|                 .height(22 * this.ratio) | ||||
|                 .width(22 * globalThis.ratio) | ||||
|                 .height(22 * globalThis.ratio) | ||||
|                 .onChange((value: boolean) => { | ||||
|                   console.info('Checkbox1 change is' + value) | ||||
|                 }) | ||||
|               Text('照片叠加文字').fontColor('#333333').fontSize(16 * this.ratio) | ||||
|               Text('位置').fontColor('#333333').fontSize(16 * this.ratio).margin({ left: 24 * this.ratio }) | ||||
|               Text('照片叠加文字').fontColor('#333333').fontSize(16 * globalThis.ratio) | ||||
|               Text('位置').fontColor('#333333').fontSize(16 * globalThis.ratio).margin({ left: 24 * globalThis.ratio }) | ||||
|               TextInput({ text: this.param.wz, controller: this.inputController }) | ||||
|                 .type(InputType.Normal) | ||||
|                 .borderRadius(0) | ||||
|                 .width(79 * this.ratio) | ||||
|                 .height(26 * this.ratio) | ||||
|                 .width(79 * globalThis.ratio) | ||||
|                 .height(26 * globalThis.ratio) | ||||
|                 .padding({ top: 0, bottom: 0 }) | ||||
|                 .fontSize(this.inputFontSize * this.ratio) | ||||
|                 .margin({ left: 10 * this.ratio }) | ||||
|               Text('叠加内容').fontColor('#333333').fontSize(16 * this.ratio).margin({ left: 24 * this.ratio }) | ||||
|                 .fontSize(this.inputFontSize * globalThis.ratio) | ||||
|                 .margin({ left: 10 * globalThis.ratio }) | ||||
|               Text('叠加内容').fontColor('#333333').fontSize(16 * globalThis.ratio).margin({ left: 24 * globalThis.ratio }) | ||||
|               TextInput({ text: this.param.text1, controller: this.inputController }) | ||||
|                 .type(InputType.Normal) | ||||
|                 .borderRadius(0) | ||||
|                 .width(79 * this.ratio) | ||||
|                 .height(26 * this.ratio) | ||||
|                 .width(79 * globalThis.ratio) | ||||
|                 .height(26 * globalThis.ratio) | ||||
|                 .padding({ top: 0, bottom: 0 }) | ||||
|                 .margin({ left: 10 * this.ratio }) | ||||
|                 .fontSize(this.inputFontSize * this.ratio) | ||||
|               Text('+').fontColor('#333333').fontSize(16 * this.ratio).margin({ left: 5 * this.ratio }) | ||||
|                 .margin({ left: 10 * globalThis.ratio }) | ||||
|                 .fontSize(this.inputFontSize * globalThis.ratio) | ||||
|               Text('+').fontColor('#333333').fontSize(16 * globalThis.ratio).margin({ left: 5 * globalThis.ratio }) | ||||
|               TextInput({ text: this.param.text2, controller: this.inputController }) | ||||
|                 .type(InputType.Normal) | ||||
|                 .borderRadius(0) | ||||
|                 .width(79 * this.ratio) | ||||
|                 .height(26 * this.ratio) | ||||
|                 .width(79 * globalThis.ratio) | ||||
|                 .height(26 * globalThis.ratio) | ||||
|                 .padding({ top: 0, bottom: 0 }) | ||||
|                 .margin({ left: 10 * this.ratio }) | ||||
|                 .fontSize(this.inputFontSize * this.ratio) | ||||
|               Text('+').fontColor('#333333').fontSize(16 * this.ratio).margin({ left: 5 * this.ratio }) | ||||
|                 .margin({ left: 10 * globalThis.ratio }) | ||||
|                 .fontSize(this.inputFontSize * globalThis.ratio) | ||||
|               Text('+').fontColor('#333333').fontSize(16 * globalThis.ratio).margin({ left: 5 * globalThis.ratio }) | ||||
|               TextInput({ text: this.param.text3, controller: this.inputController }) | ||||
|                 .type(InputType.Normal) | ||||
|                 .borderRadius(0) | ||||
|                 .width(79 * this.ratio) | ||||
|                 .width(79 * globalThis.ratio) | ||||
|                 .padding({ top: 0, bottom: 0 }) | ||||
|                 .height(26 * this.ratio) | ||||
|                 .margin({ left: 10 * this.ratio }) | ||||
|                 .fontSize(this.inputFontSize * this.ratio) | ||||
|               Text('分隔符').fontColor('#333333').fontSize(16 * this.ratio).margin({ left: 24 * this.ratio }) | ||||
|                 .height(26 * globalThis.ratio) | ||||
|                 .margin({ left: 10 * globalThis.ratio }) | ||||
|                 .fontSize(this.inputFontSize * globalThis.ratio) | ||||
|               Text('分隔符').fontColor('#333333').fontSize(16 * globalThis.ratio).margin({ left: 24 * globalThis.ratio }) | ||||
|               TextInput({ text: this.param.dolt, controller: this.inputController }) | ||||
|                 .type(InputType.Normal) | ||||
|                 .borderRadius(0) | ||||
|                 .width(67 * this.ratio) | ||||
|                 .height(26 * this.ratio) | ||||
|                 .margin({ left: 10 * this.ratio }) | ||||
|                 .width(67 * globalThis.ratio) | ||||
|                 .height(26 * globalThis.ratio) | ||||
|                 .margin({ left: 10 * globalThis.ratio }) | ||||
|                 .padding({ top: 0, bottom: 0 }) | ||||
|                 .fontSize(this.inputFontSize * this.ratio) | ||||
|               Text('文字大小').fontColor('#333333').fontSize(16 * this.ratio).margin({ left: 24 * this.ratio }) | ||||
|                 .fontSize(this.inputFontSize * globalThis.ratio) | ||||
|               Text('文字大小').fontColor('#333333').fontSize(16 * globalThis.ratio).margin({ left: 24 * globalThis.ratio }) | ||||
|               TextInput({ text: this.param.fontSize, controller: this.inputController }) | ||||
|                 .type(InputType.Normal) | ||||
|                 .borderRadius(0) | ||||
|                 .width(34 * this.ratio) | ||||
|                 .height(26 * this.ratio) | ||||
|                 .margin({ left: 10 * this.ratio }) | ||||
|                 .fontSize(this.inputFontSize * this.ratio) | ||||
|                 .width(34 * globalThis.ratio) | ||||
|                 .height(26 * globalThis.ratio) | ||||
|                 .margin({ left: 10 * globalThis.ratio }) | ||||
|                 .fontSize(this.inputFontSize * globalThis.ratio) | ||||
|                 .padding({ top: 0, bottom: 0 }) | ||||
|             }.width('100%').align(Alignment.Start).backgroundColor('#E5E3DF') | ||||
| 
 | ||||
|           }.width(946 * this.ratio).height(336 * this.ratio).backgroundColor('#E5E3DF').margin({ top: 13 * this.ratio }) | ||||
|           }.width(946 * globalThis.ratio).height(336 * globalThis.ratio).backgroundColor('#E5E3DF').margin({ top: 13 * globalThis.ratio }) | ||||
| 
 | ||||
|         } | ||||
|         .width('100%') | ||||
|         .height(395 * this.ratio) | ||||
|         .height(395 * globalThis.ratio) | ||||
|         .backgroundColor('#CCC4B8') | ||||
|         .position({ x: 0, y: 146 * this.ratio }) | ||||
|         .border({ radius: { topLeft: 24 * this.ratio, topRight: 24 * this.ratio } }) | ||||
|         .position({ x: 0, y: 146 * globalThis.ratio }) | ||||
|         .border({ radius: { topLeft: 24 * globalThis.ratio, topRight: 24 * globalThis.ratio } }) | ||||
|       } | ||||
| 
 | ||||
|     }.backgroundColor('#1A1A1A').width('100%').height('100%') | ||||
|  | ||||
| @ -1,7 +1,7 @@ | ||||
| // @ts-nocheck | ||||
| import hilog from '@ohos.hilog'; | ||||
| import apiJudgeSdk from 'libJudgeSdk.so'; | ||||
| // import apiJudgeSdk from '@ohos.judgesdk'; | ||||
| // import apiJudgeSdk from 'libJudgeSdk.so'; | ||||
| import apiJudgeSdk from '@ohos.judgesdk'; | ||||
| 
 | ||||
| import Judge from '../../judgeSDK/utils/judge-real' | ||||
| // import Judge from '../../judgeSDK/judge-track-playback' | ||||
| @ -43,8 +43,8 @@ struct RealTime { | ||||
|           XComponent({ | ||||
|             id: 'duolun_plugin_id_draw', //显示轨迹窗口id名称,注意这个ID要和C++侧一致,不能变 | ||||
|             type: 'surface', | ||||
|             libraryname: 'JudgeSdk' | ||||
|             // libraryname: 'judgesdk' | ||||
|             // libraryname: 'JudgeSdk' | ||||
|             libraryname: 'judgesdk' | ||||
|           }) | ||||
|             .width(this.width) | ||||
|             .height(this.height) | ||||
|  | ||||
| @ -3,7 +3,6 @@ import UdpClient from '../../common/utils/UdpClient'; | ||||
| import FileLog from '../judgeSDK/utils/file-log' | ||||
| import { voiceService } from '../../common/service/voiceService' | ||||
| import prompt from '@ohos.prompt' | ||||
| import SerialPortClient from '../../common/utils/SerialPortClient' | ||||
| import RealTime from '../compontents/judge/real-time' | ||||
| @Component | ||||
| struct SignDisplayCom { | ||||
| @ -397,20 +396,7 @@ struct SignDisplayCom { | ||||
|     const that = this | ||||
|     const {showBack,getSignal} = this | ||||
| 
 | ||||
|     const serialPortClient = new SerialPortClient() | ||||
|     serialPortClient.openSerial() | ||||
|     serialPortClient.SerialSet() | ||||
|     this.interval=setInterval(() => { | ||||
|       serialPortClient.SerialSend() | ||||
|       const data = serialPortClient.SerialRecv() | ||||
|       // if (data?.recevedLen) { | ||||
|       //   const msg = data.msg.split(',') | ||||
|       //   if (msg[0] != '98' || msg[1] != '85' || msg.length < 9) { | ||||
|       //     return | ||||
|       //   } | ||||
|       //   this.sjxhColum[18].value = msg[9] | ||||
|       // } | ||||
|     }, 1000) | ||||
| 
 | ||||
|     if(showBack){ | ||||
|       globalThis.udpClient.onMessage((msg) => { | ||||
|         console.log('msgmsg',msg) | ||||
| @ -441,21 +427,8 @@ struct SignDisplayCom { | ||||
|     //     } | ||||
|     //   } | ||||
|     // }); | ||||
|     const serialPortClient = new SerialPortClient() | ||||
|     serialPortClient.openSerial() | ||||
|     serialPortClient.SerialSet() | ||||
| 
 | ||||
|     const getSignal = this.getSignal; | ||||
|     this.interval=setInterval(() => { | ||||
|       serialPortClient.SerialSend() | ||||
|       const data = serialPortClient.SerialRecv() | ||||
|       // if (data.recevedLen) { | ||||
|       //   const msg = data.msg.split(',') | ||||
|       //   if (msg[0] != '98' || msg[1] != '85' || msg.length < 9) { | ||||
|       //     return | ||||
|       //   } | ||||
|       //   this.sjxhColum[18].value = msg[9] | ||||
|       // } | ||||
|     }, 1000) | ||||
|     const that = this | ||||
|     const showBack = this.showBack; | ||||
|     if(showBack){ | ||||
|  | ||||
| @ -1,6 +1,6 @@ | ||||
| import libJudgeSdk from 'libJudgeSdk.so' | ||||
| // import libJudgeSdk from 'libJudgeSdk.so'
 | ||||
| //@ts-ignore
 | ||||
| // import libJudgeSdk from '@ohos.judgesdk'
 | ||||
| import libJudgeSdk from '@ohos.judgesdk' | ||||
| /** | ||||
|  * 苏仁君 | ||||
|  * @date 2023/04/10 | ||||
|  | ||||
| @ -47,7 +47,7 @@ struct Index { | ||||
|               this.ip='MAC-'+this.deviceNo | ||||
|               globalThis.deviceNo=this.ip | ||||
|             }) | ||||
|             Text('网卡').fontSize(34 * this.ratio).fontColor('#FFE0B2').margin({ right: 98.5 * this.ratio }) | ||||
|             Text('网卡').fontSize(34 * globalThis.ratio).fontColor('#FFE0B2').margin({ right: 98.5 * globalThis.ratio }) | ||||
|           } | ||||
| 
 | ||||
|           Row() { | ||||
| @ -60,35 +60,35 @@ struct Index { | ||||
|               globalThis.deviceNo=this.ip | ||||
|                 // this.ip = ip | ||||
|             }) | ||||
|             Text('硬盘').fontSize(34 * this.ratio).fontColor('#FFE0B2').margin({ right: 83 * this.ratio }) | ||||
|             Text('硬盘').fontSize(34 * globalThis.ratio).fontColor('#FFE0B2').margin({ right: 83 * globalThis.ratio }) | ||||
|           } | ||||
|         }.margin({ top: 35 * this.ratio }) | ||||
|         }.margin({ top: 35 * globalThis.ratio }) | ||||
| 
 | ||||
|         Row() { | ||||
|           Column(){ | ||||
|             Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) { | ||||
|               Text(this.ip).fontColor('#fff') | ||||
|                 .fontSize(33.6 * this.ratio) | ||||
|                 .fontSize(33.6 * globalThis.ratio) | ||||
|             } | ||||
|             .width('100%') | ||||
|             .height('100%') | ||||
|             .padding({ left: 30 * this.ratio, right: 30 * this.ratio }) | ||||
|             .padding({ left: 30 * globalThis.ratio, right: 30 * globalThis.ratio }) | ||||
|           } | ||||
|           .backgroundImage($r('app.media.xk')) | ||||
|           .backgroundImageSize({ width: '100%', height: '100%' }) | ||||
|           .width(610 * this.ratio) | ||||
|           .height(108 * this.ratio) | ||||
|           .margin({ left: 22 * this.ratio }) | ||||
|           .width(610 * globalThis.ratio) | ||||
|           .height(108 * globalThis.ratio) | ||||
|           .margin({ left: 22 * globalThis.ratio }) | ||||
| 
 | ||||
|         }.margin({ top: 30 * this.ratio }) | ||||
|         }.margin({ top: 30 * globalThis.ratio }) | ||||
|       } | ||||
|       .width(720 * this.ratio) | ||||
|       .height(310 * this.ratio) | ||||
|       .width(720 * globalThis.ratio) | ||||
|       .height(310 * globalThis.ratio) | ||||
|       .backgroundColor('#333230') | ||||
|       .margin({ top: 37 * this.ratio }) | ||||
|       .borderRadius(19 * this.ratio) | ||||
|       .margin({ top: 37 * globalThis.ratio }) | ||||
|       .borderRadius(19 * globalThis.ratio) | ||||
| 
 | ||||
|       Image($r('app.media.zhuce_nor')).width(320 * this.ratio).height(92 * this.ratio).margin({ top: 30 * this.ratio }).onClick(()=>{ | ||||
|       Image($r('app.media.zhuce_nor')).width(320 * globalThis.ratio).height(92 * globalThis.ratio).margin({ top: 30 * globalThis.ratio }).onClick(()=>{ | ||||
|         this.registrationDeviceNoFn() | ||||
|       }) | ||||
|     } | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user