forked from harmony_car/subject-two
		
	Compare commits
	
		
			5 Commits
		
	
	
		
			c5a3d43e20
			...
			3bc3715f19
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 3bc3715f19 | |||
|  | 848282fe04 | ||
|  | 0fe5385625 | ||
| e4206ee3ee | |||
|  | 3fcdefeb4e | 
| @ -162,11 +162,11 @@ export default class Rdb { | ||||
|       callback(ret); | ||||
|     }); | ||||
|   } | ||||
|   sqlOperate(str,name,callback) { | ||||
|   async sqlOperate(str,name,callback) { | ||||
|     this.rdbStore.executeSql(str,(err)=>{ | ||||
|       if (err) { | ||||
|         callback(false) | ||||
|         console.info("ExecuteSql failed, err: "+name + JSON.stringify(err)) | ||||
|         callback(false) | ||||
|         return | ||||
|       } | ||||
|       console.log('ExecuteSqlsuccess') | ||||
|  | ||||
| @ -101,20 +101,16 @@ export async function getDoubleCeneterTable() { | ||||
| //单中心存表
 | ||||
| export async function getSingleCenterTable() { | ||||
|    return new Promise((reslove,reject)=>{ | ||||
|       upDataZhongxinginitialization().then((flag)=>{ | ||||
|           if(flag){ | ||||
|       upDataZhongxinginitialization().then((result)=>{ | ||||
|           if(result){ | ||||
|               router.pushUrl({ | ||||
|                   url: 'pages/ExaminerLogin', | ||||
|               }, router.RouterMode.Single) | ||||
|               reslove(true) | ||||
|           }else{ | ||||
|               // router.pushUrl({
 | ||||
|               //     url: 'pages/ExaminerLogin',
 | ||||
|               // }, router.RouterMode.Single)
 | ||||
|               // reslove(true)
 | ||||
|               promptAction.showToast({ | ||||
|                   message: '联网更新失败,请检查网络后重新更新', | ||||
|                   duration: 1000 | ||||
|                   message: `联网更新失败,请检查网络后重新更新`, | ||||
|                   duration: 500 | ||||
|               }); | ||||
|               reslove(false) | ||||
|           } | ||||
|  | ||||
| @ -73,6 +73,7 @@ const centerToMap={ | ||||
|   't_carparmset':MA_T_CARPARMSET, | ||||
|   // 'ES_CAR_VIDEO_PARAMETER':ES_CAR_VIDE0pO_PARAMETER
 | ||||
| } | ||||
| 
 | ||||
| function sqlInsertCommonFn(tableName,resultArr){ | ||||
|   return new Promise((resolve,reject)=>{ | ||||
|     const accountTable = new AccountTable(() => { | ||||
| @ -138,6 +139,7 @@ function sqlInsertCommonFn(tableName,resultArr){ | ||||
|     }); | ||||
|   }) | ||||
| } | ||||
| 
 | ||||
| export async function getDataBaseTable(params) { | ||||
|   return new Promise((resolve, reject) => { | ||||
|     const accountTable = new AccountTable(() => { | ||||
| @ -199,7 +201,11 @@ export async function getDataBaseTable(params) { | ||||
|     }); | ||||
|   }) | ||||
| } | ||||
| 
 | ||||
| //依据数组和表名更新sql表
 | ||||
| export async function upDateTableByArray(tableName,arr) { | ||||
|   sqlInsertCommonFn(tableName,arr) | ||||
| } | ||||
| //更新双中心表
 | ||||
| export async function upDateTable(params) { | ||||
|   return new Promise((resolve, reject) => { | ||||
|     const date = new Date() | ||||
| @ -237,11 +243,6 @@ export async function upDateTable(params) { | ||||
|   }); | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
| //
 | ||||
| export async function upDateTableConfig(tableName,arr) { | ||||
|   sqlInsertCommonFn(tableName,arr) | ||||
| } | ||||
| //考试平台
 | ||||
| export async function getMySystemSetTable(params) { | ||||
|   return new Promise((resolve, reject) => { | ||||
| @ -276,6 +277,7 @@ export async function getMySystemSetTable(params) { | ||||
| 
 | ||||
| } | ||||
| 
 | ||||
| //依据表名同步获取数据
 | ||||
| export async function getSyncData(tableName) { | ||||
|   return new Promise((resolve, reject) => { | ||||
|     const accountTable = new AccountTable(() => { | ||||
| @ -288,6 +290,7 @@ export async function getSyncData(tableName) { | ||||
|   }) | ||||
| 
 | ||||
| } | ||||
| 
 | ||||
| export async function delSyncTable(tableName){ | ||||
|   return new Promise((resolve,reject)=>{ | ||||
|     const accountTable = new AccountTable(() => { | ||||
|  | ||||
| @ -4,7 +4,7 @@ import { dateFormat} from '../utils/tools' | ||||
| 
 | ||||
| //获取设备信息
 | ||||
| export async function getDeviceInfo() { | ||||
|     globalThis.deviceNo = 'J43405J003101'; //设备mac
 | ||||
|     // globalThis.deviceNo = 'J43405J003101'; //设备mac
 | ||||
|     globalThis.deviceNo = 'FE-FC-FE-7C-5C-77'; //设备mac
 | ||||
|     globalThis.diskId = '1231231231'; //硬盘号
 | ||||
|     globalThis.hasAuth = true; | ||||
|  | ||||
| @ -3,55 +3,43 @@ import onvifclient from '@ohos.onvifclient'; | ||||
| import fs from '@ohos.file.fs' | ||||
| import util from '@ohos.util'; | ||||
| import configAddress from '../../common/utils/FileConfig' | ||||
| import {getCurrentTime} from '../utils/tools' | ||||
| import { getCurrentTime } from '../utils/tools' | ||||
| import record from '@ohos.rtsprecord'; | ||||
| 
 | ||||
| const rtsp_server = record.createServer(); | ||||
| //开始录屏
 | ||||
| export async function startRecordVideo(param,td,context) { | ||||
|   return new Promise<videoPlayRes>(async (reslove,reject)=>{ | ||||
| export async function startRecordVideo(param, td, context, dir) { | ||||
|   return new Promise<videoPlayRes>((reslove, reject) => { | ||||
|     var video_uri = `rtsp://${param.userName}:${param.pwd}@${param.ip}:${param.port}/h264/ch${td}/main/av_stream`; | ||||
|     // var result3 = onvifclient.startRecordVideo(video_uri, "video/" );
 | ||||
|     // const record_handle = result3.dataInt;
 | ||||
|     // console.info( `baoyihu startRecordVideo  result:`+result3.result+ ` VideoFile:`+result3.dataString );
 | ||||
|     // reslove(record_handle)
 | ||||
|     // return
 | ||||
|     var mediaTest = mediaLibrary.getMediaLibrary(context); | ||||
|     let mediaType = mediaLibrary.MediaType.VIDEO; | ||||
|     let DIR_DOCUMENTS = mediaLibrary.DirectoryType.DIR_VIDEO; | ||||
|     const num = Math.floor(Math.random() * 10000) | ||||
|     const name = `movie_record${getCurrentTime(1)}.mp4` | ||||
|     const path = await mediaTest.getPublicDirectory(DIR_DOCUMENTS); | ||||
|     mediaTest.createAsset(mediaType, name, path, (error, asset) => { | ||||
|       const file_asset = asset; // 记录 ,关闭时用到
 | ||||
|       asset.open('rw', (error, fd) => { | ||||
|         if (fd > 0) { | ||||
|           var file_path = configAddress.videoSavePath + name; | ||||
|           var result = onvifclient.startRecordVideo(video_uri, file_path, fd); | ||||
|           var rocord_handle = result.dataInt; // 记录 ,关闭时用到
 | ||||
|           reslove({fd,rocord_handle,file_asset}) | ||||
|         } else { | ||||
|           reslove({fd:0,rocord_handle:0,file_asset:0}) | ||||
|           console.error('baoyihu startRecordVideo File Open failed with error: ' + error); | ||||
|         } | ||||
|       }); | ||||
|     }); | ||||
|     if (rtsp_server != null) { | ||||
|       console.log(`Rtsprecord startRecordVideo begin`); | ||||
|       var recordResult = rtsp_server.startRecordVideo(context, video_uri, dir); | ||||
|       const handleId = recordResult.dataInt; | ||||
|       reslove(handleId) | ||||
|       console.log(`Rtsprecord startRecordVideo record_handle` + recordResult.dataInt); | ||||
|     } | ||||
|     else { | ||||
|       console.log(`Rtsprecord startRecordVideo rtsp_server isnull`); | ||||
|       reslove(0) | ||||
|     } | ||||
|     console.log(`Rtsprecord startRecordVideo end`); | ||||
|   }) | ||||
| 
 | ||||
| } | ||||
| 
 | ||||
| //结束录屏
 | ||||
| export async function endRecordVideo(record_handle) { | ||||
|   if(this.record_handle >0) | ||||
|   { | ||||
|     var result = onvifclient.endRecordVideo(record_handle); | ||||
|     // this.record_handle = -1;
 | ||||
|     console.info( `baoyihu endRecordVideo  result:`+result.result+ ` VideoFile:`+result.dataString ); | ||||
|   if (rtsp_server != null && record_handle > 0) { | ||||
|     console.log(`Rtsprecord endRecordVideo begin`); | ||||
|     var recordResult = rtsp_server.endRecordVideo(record_handle); | ||||
|     console.log(`Rtsprecord startRecordVideo record_handle` + recordResult.dataInt + ` filename:` + recordResult.fileName); | ||||
|   } | ||||
|   else | ||||
|   { | ||||
|     console.info( `baoyihu endRecordVideo  no task error`); | ||||
|   else { | ||||
|     console.log(`Rtsprecord endRecordVideo handleId isnull`); | ||||
|   } | ||||
|   // var result = onvifclient.endRecordVideo(filehandle);
 | ||||
|   // fs.closeSync(filehandle);
 | ||||
|   // file_asset.close(filehandle);
 | ||||
|   // var result = onvifclient.endRecordVideo(record_handle);
 | ||||
|   // fs.closeSync(record_handle);
 | ||||
|   // file_asset.close(record_handle);
 | ||||
| 
 | ||||
| } | ||||
| /** | ||||
| @ -60,65 +48,49 @@ export async function endRecordVideo(record_handle) { | ||||
|  * @param context | ||||
|  * @param type=0不获取base64 | ||||
|  */ | ||||
| export async function takePhoto(param,context,type=0) { | ||||
|   return new Promise(async (reslove,reject)=>{ | ||||
| export async function takePhoto(param, context, type = 0, dir) { | ||||
|   return new Promise((reslove, reject) => { | ||||
|     var video_uri = `rtsp://${param.userName}:${param.pwd}@${param.ip}:${param.port}/h264/ch${param.pztd}/main/av_stream`; | ||||
| 
 | ||||
|     var mediaTest = mediaLibrary.getMediaLibrary(context); | ||||
|     let mediaType = mediaLibrary.MediaType.IMAGE; | ||||
|     let DIR_DOCUMENTS = mediaLibrary.DirectoryType.DIR_IMAGE; | ||||
|     const path = await mediaTest.getPublicDirectory(DIR_DOCUMENTS); | ||||
|     const name="picture_record" + getCurrentTime(1) + ".jpg" | ||||
|     // if(type==1){
 | ||||
|     //   var result = onvifclient.getVideoSnapshot(video_uri,"")
 | ||||
|     //   reslove(result.dataString)
 | ||||
|     // }else{
 | ||||
|     //   var result = onvifclient.getVideoSnapshot(video_uri,"")
 | ||||
|     //   reslove('')
 | ||||
|     // }
 | ||||
|     // return
 | ||||
|     mediaTest.createAsset(mediaType, name, path, (error, asset) => { | ||||
|       asset.open('rw', (error, fd) => { | ||||
|         if (fd > 0) { | ||||
|           var file_path =configAddress.picSavePath + name | ||||
|           // var result3 = onvifclient.getVideoSnapshot(video_uri,"");
 | ||||
|           var result3 = onvifclient.getVideoSnapshot(video_uri, file_path, fd); | ||||
|           fs.closeSync(fd); | ||||
|           asset.close(fd); | ||||
|           if(type==1){ | ||||
|             fs.lstat(file_path).then((stat) => { | ||||
|               let file = fs.openSync(file_path, fs.OpenMode.READ_WRITE); | ||||
|               const size = Number(stat.size) + 100 | ||||
|               let buf = new ArrayBuffer(size); | ||||
|               let num = fs.readSync(file.fd, buf); | ||||
|               var that = new util.Base64(); | ||||
|               var array = new Uint8Array(buf); | ||||
|               var result = that.encodeToStringSync(array); //base64圖片
 | ||||
|               mediaTest.deleteAsset(file_path).then(() => { | ||||
|                 console.log('delSuccess') | ||||
|               }).catch(() => { | ||||
|                 console.log('delError') | ||||
|               }) | ||||
|               this.fileUtil.deleteF(file_path, 3) | ||||
|               reslove(result) | ||||
|             }).catch((err) => { | ||||
|               console.info("get link status failed with error message: " + err.message + ", error code: " + err.code); | ||||
|             }); | ||||
|           }else{ | ||||
|             reslove('') | ||||
|           } | ||||
|         } else { | ||||
|           console.error('baoyihu getVideoSnapshot File Open failed with error: ' + error); | ||||
|         } | ||||
|       }); | ||||
|     }); | ||||
|     var snapResult = rtsp_server.getVideoSnapshot(context, video_uri, dir); | ||||
|     console.log(`baoyihu Rtsprecord getVideoSnapshot file:` + snapResult.dataString); | ||||
|     if (type == 1) { | ||||
|       reslove(snapResult.dataString) | ||||
|     } else { | ||||
|       reslove('') | ||||
|     } | ||||
|   }) | ||||
| 
 | ||||
| } | ||||
| 
 | ||||
| export async function deleteAllFile(dir,context) { | ||||
|   const mediaType = mediaLibrary.MediaType.IMAGE | ||||
|   var mymediaLib = await mediaLibrary.getMediaLibrary(context); | ||||
|   let fetchOp = { selections: `media_type =? `, selectionArgs: [`${mediaType}`] } | ||||
|   console.info(`baoyihu deleteRecordFile  fetchOp:` + fetchOp); | ||||
|   var asset = await mymediaLib.getFileAssets(fetchOp); | ||||
|   if (mediaType == mediaLibrary.MediaType.IMAGE) { | ||||
|     var base_Dir = "/storage/media/100/local/files/Pictures/"; | ||||
|   } | ||||
|   else { | ||||
|     var base_Dir = "/storage/media/100/local/files/Videos/"; | ||||
|   } | ||||
| 
 | ||||
|   var my_dir = dir; | ||||
|   asset.getAllObject((eer, fileArray) => { | ||||
|     for (let onfile of fileArray) { | ||||
|       var delet_dir = base_Dir + my_dir + onfile.uri | ||||
|       console.info(`baoyihu deleteRecordFile  uri:` + delet_dir); | ||||
|       mymediaLib.deleteAsset(delet_dir, (error, asset) => { | ||||
|         console.info(`baoyihu deleteRecordFile  3 error:` + error); | ||||
|       }); | ||||
|     } | ||||
|   }); | ||||
|   console.log(`Rtsprecord getVideoSnapshot end:`); | ||||
| } | ||||
| 
 | ||||
| export interface videoPlayRes { | ||||
|   rocord_handle?: number; | ||||
|   fd?: number; | ||||
|   file_asset?:any | ||||
|   file_asset?: any | ||||
| } | ||||
| 
 | ||||
|  | ||||
| @ -14,12 +14,9 @@ export async function getUDP() { | ||||
|     if(result.length){ | ||||
|       if(globalThis.udpClient&&globalThis.udpClient.closeUdp){ | ||||
|         globalThis.udpClient.closeUdp(()=>{ | ||||
| 
 | ||||
|           // const udpClient: UdpClientByCenter =new UdpClientByCenter(result[0].udplocalIp, '8800','192.168.36.9','11111')//杭州
 | ||||
|           globalThis.udpClient.rebindUdp(result[0].udplocalIp, result[0].udplocalIpPort,result[0].udpOppositeIp,result[0].udpOppositeIpPort) | ||||
| 
 | ||||
|           globalThis.udpClient.sendMsg('111') | ||||
| 
 | ||||
|           // globalThis.udpClient = udpClient
 | ||||
|         }) | ||||
|       }else{ | ||||
| 
 | ||||
| @ -42,48 +39,31 @@ export async function getUDP2() { | ||||
|     if(result.length){ | ||||
|       if(globalThis.udpClient2&&globalThis.udpClient2.closeUdp){ | ||||
|         globalThis.udpClient2.closeUdp(async ()=>{ | ||||
|           // globalThis.udpClient2.rebindUdp(result[0].udplocalIp, '8800','112.80.35.83','11056')
 | ||||
|           // const udpClient: UdpClientByCenter =new UdpClientByCenter(result[0].udplocalIp, '8800','192.168.36.9','11111')//杭州
 | ||||
|           globalThis.udpClient2.rebindUdp(result[0].udplocalIp, '8800',globalThis.carInfo?.udpAddress,globalThis.carInfo?.messagePort) | ||||
|           // globalThis.udpClient2.rebindUdp(result[0].tcplocalIp, result[0].tcplocalIpPort,result[0].tcpOppositeIp,result[0].tcpOppositePort)
 | ||||
|           // globalThis.udpClient2.rebindUdp(result[0].udplocalIp, result[0].udpLocalIpByGPS,result[0].udpOppositeIp,result[0].udpOppositeIpPortByGPS)
 | ||||
|           globalThis.udpClient2.onMessage((val)=>{ | ||||
|             // globalThis.udpClnt2.sendMsg(heartMsg(context))
 | ||||
|           }) | ||||
| 
 | ||||
|         }) | ||||
|       }else{ | ||||
|         // const udpClient: UdpClient =new UdpClient(result[0].udplocalIp, result[0].udpLocalIpByGPS,result[0].udpOppositeIp,result[0].udpOppositeIpPortByGPS)
 | ||||
|         const udpClient: UdpClientByCenter =new UdpClientByCenter(result[0].udplocalIp, '8800',globalThis.carInfo?.udpAddress,globalThis.carInfo?.messagePort) | ||||
|         // const udpClient: UdpClientByCenter =new UdpClientByCenter(result[0].udplocalIp, '8800','112.80.35.83','11056')
 | ||||
|         // const udpClient: UdpClient =new UdpClient(result[0].tcplocalIp, result[0].tcplocalIpPort,result[0].tcpOppositeIp,result[0].tcpOppositePort)
 | ||||
| 
 | ||||
|         globalThis.udpClient2 = udpClient | ||||
|         globalThis.udpClient2.bindUdp() | ||||
| 
 | ||||
|         // globalThis.udpClient2.sendMsg(heartMsg(context))
 | ||||
| 
 | ||||
|         globalThis.udpClient2.onMessage((val)=>{ | ||||
| 
 | ||||
|           if(val.id=='32'){ | ||||
|             globalThis.signNum=val.body[1] | ||||
|           }else if(val.id=='46'){ | ||||
| 
 | ||||
|             let tmpList = [] | ||||
|             console.log('lsh',globalThis.lsh) | ||||
|             const str = globalThis.lsh | ||||
|             for (let i = 0;i < str.length; i++) { | ||||
|               tmpList.push(this.string2Bytes(str.charCodeAt(i), 1 * 8)[0]) | ||||
|             } | ||||
| 
 | ||||
|             const param = { id: 47, list: tmpList, carNo: globalThis.carInfo.carNo, placeId: globalThis.carInfo.examinationRoomId } | ||||
|             globalThis.udpClient2.send(param) | ||||
|           } | ||||
| 
 | ||||
|           // setTimeout(async ()=>{
 | ||||
|           //
 | ||||
|           //   globalThis.udpClient2.sendMsg(heartMsg(context))
 | ||||
|           //
 | ||||
|           // },1000)
 | ||||
|         }) | ||||
|       } | ||||
|     }else{ | ||||
| @ -98,7 +78,6 @@ export async function setTopLineUdp(){ | ||||
|   if(config && config[0] && config[0].udplocalIp){ | ||||
|     const {udplocalIp,udpOppositeIp,udpOppositeIpPort} = config[0]; | ||||
|     const udpClient: UdpClientByCenter = new UdpClientByCenter(udplocalIp, '55509',udpOppositeIp,udpOppositeIpPort) | ||||
|     // const udpClient: UdpClientByCenter = new UdpClientByCenter(udplocalIp, '8800','192.168.36.4','33333')
 | ||||
|     udpClient.bindUdp() | ||||
| 
 | ||||
|     return { | ||||
| @ -114,7 +93,7 @@ export async function setJudgeUdp(){ | ||||
|   const config = await getSyncData('IpConfigTable'); | ||||
|   if(config && config[0] && config[0].udplocalIp){ | ||||
|     const {udplocalIp} = config[0]; | ||||
|     // const udpClient: UdpClientByCenter = new UdpClientByCenter(udplocalIp, '8080','192.168.32.167','33333')
 | ||||
|     // const udpClient: UdpClientByCenter = new UdpClientByCenter(udplocalIp, '8080','192.168.36.9','33333')
 | ||||
|     const udpClient: UdpClientByCenter = new UdpClientByCenter(udplocalIp, '8080',globalThis.carInfo?.gpsAddress,globalThis.carInfo?.hintPort) | ||||
|     // const udpClient: UdpClientByCenter = new UdpClientByCenter(udplocalIp, '8800','192.168.36.4','33333')
 | ||||
|     udpClient.bindUdp() | ||||
|  | ||||
| @ -27,6 +27,7 @@ export default class UdpClient { | ||||
|   private oppositeIpPort: string = '' | ||||
| 
 | ||||
|   private udp: any = null | ||||
|   private stashFn | ||||
| 
 | ||||
|   constructor(udplocalIp: string, udplocalIpPort: string, udpOppositeIp: string, udpOppositeIpPort: string) { | ||||
|     this.localIp = udplocalIp | ||||
| @ -72,7 +73,9 @@ export default class UdpClient { | ||||
|       console.log(`${TAG} udp bind failed:${JSON.stringify(err)}`); | ||||
|     }); | ||||
|   } | ||||
| 
 | ||||
|   setMsgCallBack(callback){ | ||||
|     this.stashFn=callback | ||||
|   } | ||||
|   sendMsg(msg: string) { | ||||
|     let promise = this.udp.send({ | ||||
|       data: msg, | ||||
| @ -114,6 +117,8 @@ export default class UdpClient { | ||||
|         if (strachArr[0] != '#DN_GD') { | ||||
|           return | ||||
|         } | ||||
|         this.stashFn(str) | ||||
|         this.stashFn=()=>{} | ||||
|         callback(str) | ||||
|       } else { | ||||
|         callback('') | ||||
|  | ||||
| @ -161,7 +161,9 @@ export default class UdpClientByCenter { | ||||
|             console.log(`${TAG} udpLine send fail:${JSON.stringify(err)}`); | ||||
|         }); | ||||
|     } | ||||
| 
 | ||||
|     setMsgCallBack(callback){ | ||||
|         this.stashFn=callback | ||||
|     } | ||||
|     sendMsg(param,context?) { | ||||
|         if(context){ | ||||
|             this.context=context | ||||
| @ -177,11 +179,13 @@ export default class UdpClientByCenter { | ||||
|                 port: parseInt(this.oppositeIpPort), | ||||
|             } | ||||
|         }); | ||||
|         this.stashFn=param.callback?param.callback:()=>{} | ||||
|         promise.then(() => { | ||||
|             if(this.sendId=='46'&¶m.callback){ | ||||
|                 param.callback() | ||||
|             if(param.sendCallback){ | ||||
|                 param.sendCallback() | ||||
|             } | ||||
|             // if(this.sendId=='46'&¶m.callback){
 | ||||
|             //     param.callback()
 | ||||
|             // }
 | ||||
|             console.log(`${TAG} udp send success:`); | ||||
|         }).catch(err => { | ||||
|             console.log(`${TAG} udp send fail:${JSON.stringify(err)}`); | ||||
|  | ||||
| @ -2,8 +2,7 @@ import router from '@ohos.router' | ||||
| import TopLogo from './compontents/topLogo' | ||||
| import { examinerLoginService } from '../common/service/ExaminerService' | ||||
| import Md5  from '../common/utils/md5'; | ||||
| import prompt from '@ohos.prompt' | ||||
| import { voiceService } from '../common/service/voiceService' | ||||
| import promptAction from '@ohos.promptAction' | ||||
| 
 | ||||
| @Entry | ||||
| @Component | ||||
| @ -17,127 +16,118 @@ struct Index { | ||||
|   @State @Watch('outClick') outFlag: boolean = false; | ||||
|   private vocObj = null; | ||||
|   build() { | ||||
|     Column() { | ||||
|       TopLogo({outFlag:$outFlag}) | ||||
|       Column() { | ||||
|         TopLogo({outFlag:$outFlag}) | ||||
|         Text('请考官输入用户名密码').fontColor('#FFAD33').fontSize(36*this.ratio) | ||||
|         Row() { | ||||
|           ForEach(this.inputPlaceholderArr, (item:any, index:number) => { | ||||
|             Row(){ | ||||
|               TextInput({ placeholder: `${item}`,text: this.inputTextArr[index] }) | ||||
|                 .fontSize(42*this.ratio) | ||||
|                 .fontColor('white') | ||||
|                 .placeholderFont({ size: 42*this.ratio }) | ||||
|                 .placeholderColor('gray') | ||||
|                 .caretColor('white') | ||||
|                 .backgroundColor('transparent') | ||||
|                 .width('90%') | ||||
|                 .margin({left: '4%'}) | ||||
|                 .type(index === 0 ? InputType.Normal : InputType.Password) | ||||
|                 .focusable(false) | ||||
|                 .onClick(() => { | ||||
|                   this.currentInputIndex = index; | ||||
|                 }) | ||||
|             } | ||||
|             .backgroundImage(this.currentInputIndex == index ?  $r('app.media.kuang_pre') :  $r('app.media.kuang_nor')) | ||||
|             .backgroundImageSize({width:'100%',height:'100%'}) | ||||
|             .width('48%') | ||||
|             .height('14.9%') | ||||
|           }) | ||||
|         } | ||||
|         .width('90%') | ||||
|         .margin({top: 25*this.ratio}) //20 | ||||
|         .justifyContent(FlexAlign.SpaceBetween) | ||||
|         Column() { | ||||
|           Text('请考官输入用户名密码').fontColor('#FFAD33').fontSize(36*this.ratio) | ||||
|           Row() { | ||||
|             ForEach(this.inputPlaceholderArr, (item:any, index:number) => { | ||||
|               Row(){ | ||||
|                 TextInput({ placeholder: `${item}`,text: this.inputTextArr[index] }) | ||||
|                   .fontSize(42*this.ratio) | ||||
|                   .fontColor('white') | ||||
|                   .placeholderFont({ size: 42*this.ratio }) | ||||
|                   .placeholderColor('gray') | ||||
|                   .caretColor('white') | ||||
|                   .backgroundColor('transparent') | ||||
|                   .width('90%') | ||||
|                   .margin({left: '4%'}) | ||||
|                   .type(index === 0 ? InputType.Normal : InputType.Password) | ||||
|                   .focusable(false) | ||||
|                   .onClick(() => { | ||||
|                     this.currentInputIndex = index; | ||||
|                   }) | ||||
|               } | ||||
|               .backgroundImage(this.currentInputIndex == index ?  $r('app.media.kuang_pre') :  $r('app.media.kuang_nor')) | ||||
|               .backgroundImageSize({width:'100%',height:'100%'}) | ||||
|               .width('48%') | ||||
|               .height('14.9%') | ||||
|             }) | ||||
|           } | ||||
|           .width('90%') | ||||
|           .margin({top: 25*this.ratio}) //20 | ||||
|           .justifyContent(FlexAlign.SpaceBetween) | ||||
|           Column() { | ||||
|             Flex({wrap: FlexWrap.Wrap, | ||||
|                   justifyContent:FlexAlign.SpaceAround, | ||||
|                   alignContent: FlexAlign.SpaceAround}) { | ||||
|               ForEach(this.imgArr1, (item:Resource, index:number) => { | ||||
|                 if(index === this.imgArr1.length -1 ) { | ||||
|                   Image(item).width('38%').height('24%').onClick(() => { | ||||
|           Flex({wrap: FlexWrap.Wrap, | ||||
|             justifyContent:FlexAlign.SpaceAround, | ||||
|             alignContent: FlexAlign.SpaceAround}) { | ||||
|             ForEach(this.imgArr1, (item:Resource, index:number) => { | ||||
|               if(index === this.imgArr1.length -1 ) { | ||||
|                 Image(item).width('38%').height('24%').onClick(() => { | ||||
| 
 | ||||
|                     if(this.inputTextArr[0].trim()==''||this.inputTextArr[1].trim()==''){ | ||||
|                       prompt.showToast({ | ||||
|                         message: '请输入用户名和密码', | ||||
|                         duration: 3000 | ||||
|                       }); | ||||
|                       return | ||||
|                     } | ||||
|                   if(this.inputTextArr[0].trim()==''||this.inputTextArr[1].trim()==''){ | ||||
|                     promptAction.showToast({ | ||||
|                       message: '请输入用户名和密码', | ||||
|                       duration: 3000 | ||||
|                     }); | ||||
|                     return | ||||
|                   } | ||||
| 
 | ||||
|                     const param = { | ||||
|                       carId: globalThis.carInfo.carId, | ||||
|                       examinationRoomId: globalThis.carInfo.examinationRoomId, | ||||
|                       username: this.inputTextArr[0], | ||||
|                       password: Md5.Instance.get_md5(this.inputTextArr[1]) | ||||
|                     } | ||||
|                     console.log('paramparam',JSON.stringify(globalThis.carInfo)) | ||||
|                     examinerLoginService(param).then(res => { | ||||
|                       // this.vocObj.playAudio({ | ||||
|                       //   type: 1, | ||||
|                       //   name: 'media_button.wav' | ||||
|                       // }) | ||||
|                       // this.url='pages/userInfo' | ||||
|                       router.pushUrl({ | ||||
|                         url: 'pages/UserInfo', | ||||
|                       },router.RouterMode.Single); | ||||
|                       console.log('res11',JSON.stringify(res)) | ||||
|                       globalThis.username=this.inputTextArr[0] | ||||
|                     }) | ||||
|                   }) | ||||
|                 }else { | ||||
|                   Image(item).width('18%').height('24%').onClick(() => { | ||||
|                   const param = { | ||||
|                     carId: globalThis.carInfo.carId, | ||||
|                     examinationRoomId: globalThis.carInfo.examinationRoomId, | ||||
|                     username: this.inputTextArr[0], | ||||
|                     password: Md5.Instance.get_md5(this.inputTextArr[1]) | ||||
|                   } | ||||
|                   console.log('paramparam',JSON.stringify(globalThis.carInfo)) | ||||
|                   examinerLoginService(param).then(res => { | ||||
|                     // this.vocObj.playAudio({ | ||||
|                     //   type: 1, | ||||
|                     //   name: 'media_button.wav' | ||||
|                     // }) | ||||
|                     this.url='' | ||||
|                     if(index < 9) { | ||||
|                       this.inputTextArr[this.currentInputIndex] +=  (index + 1).toString() | ||||
|                     }else { | ||||
|                       if(index === 9) { | ||||
|                         this.inputTextArr[this.currentInputIndex] +=  (0).toString() | ||||
|                       }  if(index === 10) { | ||||
|                         this.inputTextArr[this.currentInputIndex] +=  'X'; | ||||
|                       } else if(index === 11) { | ||||
|                         this.inputTextArr[this.currentInputIndex] =  ''; | ||||
|                       } if(index === 12) { | ||||
|                         this.inputTextArr[this.currentInputIndex] = this.inputTextArr[this.currentInputIndex].slice(0, -1) | ||||
|                       } | ||||
|                     } | ||||
|                     console.log(this.inputTextArr[this.currentInputIndex]) | ||||
|                     // this.url='pages/userInfo' | ||||
|                     router.pushUrl({ | ||||
|                       url: 'pages/UserInfo', | ||||
|                     },router.RouterMode.Single); | ||||
|                     console.log('res11',JSON.stringify(res)) | ||||
|                     globalThis.username=this.inputTextArr[0] | ||||
|                   }) | ||||
|                 } | ||||
|               }) | ||||
|             } | ||||
|             .height('100%') | ||||
|                 }) | ||||
|               }else { | ||||
|                 Image(item).width('18%').height('24%').onClick(() => { | ||||
|                   // this.vocObj.playAudio({ | ||||
|                   //   type: 1, | ||||
|                   //   name: 'media_button.wav' | ||||
|                   // }) | ||||
|                   this.url='' | ||||
|                   if(index < 9) { | ||||
|                     this.inputTextArr[this.currentInputIndex] +=  (index + 1).toString() | ||||
|                   }else { | ||||
|                     if(index === 9) { | ||||
|                       this.inputTextArr[this.currentInputIndex] +=  (0).toString() | ||||
|                     }  if(index === 10) { | ||||
|                       this.inputTextArr[this.currentInputIndex] +=  'X'; | ||||
|                     } else if(index === 11) { | ||||
|                       this.inputTextArr[this.currentInputIndex] =  ''; | ||||
|                     } if(index === 12) { | ||||
|                       this.inputTextArr[this.currentInputIndex] = this.inputTextArr[this.currentInputIndex].slice(0, -1) | ||||
|                     } | ||||
|                   } | ||||
|                   console.log(this.inputTextArr[this.currentInputIndex]) | ||||
|                 }) | ||||
|               } | ||||
|             }) | ||||
|           } | ||||
|           .margin({top: 20*this.ratio}) | ||||
|           .width('90%') | ||||
|           .height('62.7%') | ||||
|           .backgroundColor('#E5E3DF') | ||||
|           .borderRadius(20*this.ratio) | ||||
|           .height('100%') | ||||
|         } | ||||
|         .margin({top: -10*this.ratio}) | ||||
|         .justifyContent(FlexAlign.SpaceAround) | ||||
|         .margin({top: 20*this.ratio}) | ||||
|         .width('90%') | ||||
|         .height('62.7%') | ||||
|         .backgroundColor('#E5E3DF') | ||||
|         .borderRadius(20*this.ratio) | ||||
|       } | ||||
|       .width('100%') | ||||
|       .height('100%') | ||||
|       .justifyContent(FlexAlign.SpaceBetween) | ||||
|       .backgroundImagePosition({x: 0, y: 0}) | ||||
|       .backgroundImage($r('app.media.index_bg')) | ||||
|       .backgroundImageSize({ width: '100%', height: '100%' }) | ||||
|       .margin({top: -10*this.ratio}) | ||||
|       .justifyContent(FlexAlign.SpaceAround) | ||||
|     } | ||||
|     .width('100%') | ||||
|     .height('100%') | ||||
|     .justifyContent(FlexAlign.SpaceBetween) | ||||
|     .backgroundImagePosition({x: 0, y: 0}) | ||||
|     .backgroundImage($r('app.media.index_bg')) | ||||
|     .backgroundImageSize({ width: '100%', height: '100%' }) | ||||
|   } | ||||
|   aboutToAppear() { | ||||
|     this.url='' | ||||
|     // this.vocObj = new voiceService(async (status,val) => { | ||||
|     //   if (status == 'idle') { | ||||
|     //     if(this.url=='pages/userInfo'){ | ||||
|     //       router.pushUrl({ | ||||
|     //         url: this.url, | ||||
|     //       }); | ||||
|     //     } | ||||
|     //   } | ||||
|     // }); | ||||
|     console.info('ExmainerLogin aboutToAppear'); | ||||
|   } | ||||
|   onPageShow() { | ||||
|  | ||||
| @ -12,7 +12,7 @@ import { getUDP, getUDP2 } from '../common/utils/GlobleUdp' | ||||
| import {initJudgeUdp} from '../common/utils/UdpJudge' | ||||
| import { getTCP } from '../common/utils/GlobleTcp' | ||||
| import TcpClient from '../common/utils/TcpClient'; | ||||
| 
 | ||||
| import testNapi from '@ohos.hiserialsdk' | ||||
| import {setliushuiNum,getSingleCenterTable,getDoubleCeneterTable} from '../common/service/indexService' | ||||
| @Entry | ||||
| @Component | ||||
| @ -175,7 +175,7 @@ struct Index { | ||||
|     this.loading = false | ||||
|   } | ||||
| 
 | ||||
|   async heartMsg(context) { | ||||
|   async heartMsg() { | ||||
|     const arr = [globalThis.signNum||0, globalThis.statue||1] | ||||
|     let tmpList = []; | ||||
|     tmpList.push(string2Bytes(arr[0], 1 * 8)[0]) | ||||
| @ -184,11 +184,9 @@ struct Index { | ||||
|     for (let i = 0;i < str.length; i++) { | ||||
|       tmpList.push(string2Bytes(str.charCodeAt(i), 1 * 8)[0]) | ||||
|     } | ||||
|     const param= {id: 31,list:tmpList,carNo: globalThis.carInfo.carNo,placeId: globalThis.carInfo.examinationRoomId} | ||||
| 
 | ||||
| 
 | ||||
|     const param= {id: 31,list:tmpList,carNo: globalThis.carInfo.carNo,placeId: globalThis.carInfo.examinationRomId} | ||||
|     // globalThis.udpClient2.initHeartSendMsg(param,this.context) | ||||
|     globalThis.udpClient2.sendMsg(param, this.context) | ||||
| 
 | ||||
|   } | ||||
| 
 | ||||
|   onPageShow() { | ||||
| @ -197,11 +195,10 @@ struct Index { | ||||
|     getUDP() | ||||
|     getUDP2() | ||||
|     setInterval(() => { | ||||
|       setliushuiNum(this.context) | ||||
|       this.heartMsg(this.context) | ||||
|       setliushuiNum() | ||||
|       this.heartMsg() | ||||
|     }, 1000) | ||||
|     // getTCP() | ||||
| 
 | ||||
|     // const TcpClient: TcpClient =new TcpClient(result[0].tcplocalIp, result[0].tcplocalIpPort,result[0].tcpOppositeIp,result[0].tcpOppositePort) | ||||
| 
 | ||||
|     if (globalThis.singlePlay == undefined || globalThis.singlePlay == null) { | ||||
| @ -226,6 +223,7 @@ struct Index { | ||||
|     // await this.getModel() | ||||
|     // const arr = [0x55, 0xaa, 0x01, 0x00, 0x02, 0x01, 0x03, 0x00] | ||||
|     // globalThis.udpClientByTopLine.sendMsg(Array2Byte(arr).buffer) | ||||
|     console.info(testNapi) | ||||
|   } | ||||
|   async getModel() { | ||||
|     const context = this.context; | ||||
|  | ||||
| @ -18,13 +18,13 @@ struct Index { | ||||
|       Column() { | ||||
|         Row() { | ||||
|           Image($r('app.media.setting_clzc')).width('30.5%').height('74%').onClick(()=>{ | ||||
|             this.url='pages/register' | ||||
|             this.url='pages/Register' | ||||
|             router.pushUrl({ | ||||
|               url: this.url, | ||||
|             },router.RouterMode.Single); | ||||
|           }) | ||||
|           Image($r('app.media.setting_spjk')).width('30.5%').height('74%').onClick(()=>{ | ||||
|             this.url='pages/videoConfig' | ||||
|             this.url='pages/VideoConfig' | ||||
|             router.pushUrl({ | ||||
|               url: this.url, | ||||
|             },router.RouterMode.Single); | ||||
|  | ||||
							
								
								
									
										191
									
								
								entry/src/main/ets/pages/TeminalInfos.ets
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										191
									
								
								entry/src/main/ets/pages/TeminalInfos.ets
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,191 @@ | ||||
| import router from '@ohos.router' | ||||
| import TopLogo from './compontents/topLogo' | ||||
| import ethernet from '@ohos.net.ethernet'; | ||||
| import prompt from '@ohos.prompt' | ||||
| import { upDateTableByArray} from '../common/service/initable' | ||||
| import { getSyncData} from '../common/service/initable' | ||||
| import { voiceService } from '../common/service/voiceService' | ||||
| 
 | ||||
| @Entry | ||||
| @Component | ||||
| struct Index { | ||||
|   @State textList1: string[] = ['ftp服务器IP:','响应端口','前置机IP','响应端口', '子网掩码','默认网关','用户名:', '密码:','dns','差分服务器IP: ', '响应端口:',] | ||||
|   @State textList2: string[] = ['后置机IP:','响应端口:', '本地端口:'] | ||||
|   @State ratio: number = 850 / 960 | ||||
|   @State inputFontSize:number=12  //12 | ||||
|   // | ||||
|   @State inputTextList1: string[] = ['192.168.36.2','8083','192.168.36.92','20122','255.255.255.0','192.168.36.1','','','114.114.114.114','192.168.36.203','8000',] | ||||
|   @State inputTextList2: string[] = ['192.168.36.91','20022'] | ||||
|   // 112.80.35.83 11052 | ||||
|   // @State inputTextList1: string[] = ['192.168.7.254','8084','192.168.7.170','20122','255.255.255.0','192.168.7.1','','','114.114.114.114','112.80.35.83','11052'] | ||||
|   // @State inputTextList2: string[] = ['192.168.7.124','20022'] | ||||
| 
 | ||||
| 
 | ||||
|   @State @Watch('outClick') outFlag: boolean = false; | ||||
|   private vocObj = null; | ||||
|   scroller: Scroller = new Scroller() | ||||
|   build() { | ||||
|     Column() { | ||||
|       TopLogo({outFlag:$outFlag}) | ||||
|       Column() { | ||||
|         Column() { | ||||
|           Scroll(this.scroller){ | ||||
|             Flex({'wrap':FlexWrap.Wrap}) { | ||||
|               ForEach(this.textList1, (item:string, index:number) => { | ||||
|                 Row() { | ||||
|                   Text(item) | ||||
|                     .width('40%') | ||||
|                     .height('100%') | ||||
|                     .fontColor('#E5CBA1') | ||||
|                     .padding({'left': '35px'}) | ||||
|                     .fontSize(this.inputFontSize*this.ratio) | ||||
|                   TextInput({'text':this.inputTextList1[index]?this.inputTextList1[index]: ''}) | ||||
|                     .width('50%') | ||||
|                     .height('60%') | ||||
|                     .fontColor('#fff') | ||||
|                     .borderColor('#E6E0D8') | ||||
|                     .borderRadius('10px') | ||||
|                     .borderWidth('2px') | ||||
|                     .fontSize(this.inputFontSize*this.ratio) | ||||
|                     .padding({top:0,bottom:0}) | ||||
|                     .linearGradient({ | ||||
|                       angle: 0, | ||||
|                       colors: [[0x403C36, 0.0], [0x4D473D, 0.34], [0x3D3A34, 1.0]] | ||||
|                     }).onChange((value: string) => { | ||||
|                     this.inputTextList1[index]=value | ||||
| 
 | ||||
|                   }) | ||||
|                 } | ||||
|                 .width('50%') | ||||
|                 .height('16.7%') | ||||
|               }) | ||||
|               ForEach(this.textList2, (item:string, index:number) => { | ||||
|                 Row() { | ||||
|                   Text(item) | ||||
|                     .width('40%') | ||||
|                     .height('100%') | ||||
|                     .fontColor('#E5CBA1') | ||||
|                     .fontSize(this.inputFontSize*this.ratio) | ||||
|                     .padding({'left': '35px'}) | ||||
|                   TextInput({'text':this.inputTextList2[index]?this.inputTextList2[index]: ''}) | ||||
|                     .width('60%') | ||||
|                     .height('60%') | ||||
|                     .fontColor('#fff') | ||||
|                     .borderColor('#E6E0D8') | ||||
|                     .borderRadius('10px') | ||||
|                     .borderWidth('2px') | ||||
|                     .padding({top:0,bottom:0}) | ||||
|                     .fontSize(this.inputFontSize*this.ratio) | ||||
|                     .linearGradient({ | ||||
|                       angle: 0, | ||||
|                       colors: [[0x403C36, 0.0], [0x4D473D, 0.34], [0x3D3A34, 1.0]] | ||||
|                     }) | ||||
|                     .onChange((value: string) => { | ||||
|                       this.inputTextList2[index]=value | ||||
| 
 | ||||
|                     }) | ||||
|                 } | ||||
|                 .width('32.5%') | ||||
|                 .height('16.7%') | ||||
|               }) | ||||
|             } | ||||
|           } | ||||
|           .width('95%') | ||||
|           .height('90%') | ||||
|           .margin({'top': '2%'}) | ||||
|           .backgroundColor('#282828') | ||||
|           .borderRadius('15px') | ||||
|         } | ||||
|         .width('100%') | ||||
|         .height('80%') | ||||
|         .borderRadius('25px') | ||||
|         Column() { | ||||
|           Image($r('app.media.terminal_save')).width('20.5%').height('74%').onClick(()=>{ | ||||
|             upDateTableByArray('IpConfigTable',[{udplocalIp:this.inputTextList1[2],udplocalIpPort:this.inputTextList1[3],udpOppositeIp:this.inputTextList2[0],udpOppositeIpPort:this.inputTextList2[1],tcplocalIp:this.inputTextList1[0],tcplocalIpPort:this.inputTextList1[1],tcpOppositeIp:this.inputTextList1[9],tcpOppositePort:this.inputTextList1[10],netMask:this.inputTextList1[4],gateway:this.inputTextList1[5],dnsServers:this.inputTextList1[8]}]) | ||||
|             ethernet.setIfaceConfig("eth0", { | ||||
|               mode: 0, | ||||
|               ipAddr:this.inputTextList1[2], | ||||
|               route: "0.0.0.0", | ||||
|               gateway: this.inputTextList1[5],//value.gateway网关 | ||||
|               netMask: this.inputTextList1[4],//value.netMask网络掩码 | ||||
|               dnsServers: this.inputTextList1[8], | ||||
|               // domain: "" | ||||
|             }, (error) => { | ||||
|               if (error) { | ||||
|                 prompt.showToast({ | ||||
|                   message: '设置失败'+JSON.stringify(error), | ||||
|                   duration: 3000 | ||||
|                 }); | ||||
|               } else { | ||||
|                 prompt.showToast({ | ||||
|                   message: '设置成功', | ||||
|                   duration: 3000 | ||||
|                 }); | ||||
|               } | ||||
|             }); | ||||
|           }) | ||||
|         } | ||||
|         .backgroundColor('#CCC4B8') | ||||
|         .width('100%') | ||||
|         .height('20%') | ||||
|         .borderRadius({'bottomLeft':'25px','bottomRight':'25px'}) | ||||
|         .justifyContent(FlexAlign.SpaceAround) | ||||
|       } | ||||
|       .width('75%') | ||||
|       .height('69.4%') | ||||
|       .backgroundColor('#E6E3DF') | ||||
|       .borderRadius('25px') | ||||
|       .margin({'top':'7%'}) | ||||
|       .justifyContent(FlexAlign.SpaceAround) | ||||
| 
 | ||||
|     } | ||||
|     .width('100%') | ||||
|     .height('100%') | ||||
|     .backgroundImagePosition({x: 0, y: 0}) | ||||
|     .backgroundImage($r('app.media.index_bg')) | ||||
|     .backgroundImageSize({ width: '100%', height: '100%' }) | ||||
|   } | ||||
|   aboutToAppear() { | ||||
|     getSyncData('IpConfigTable').then((result:Array<any>)=>{ | ||||
|       console.log('result222',JSON.stringify(result)) | ||||
|       if(result.length){ | ||||
|         console.log('tagtag',JSON.stringify(result)) | ||||
|         this.inputTextList1[2]=result[0].udplocalIp | ||||
|         this.inputTextList1[3]=result[0].udplocalIpPort | ||||
|         this.inputTextList2[0]=result[0].udpOppositeIp | ||||
|         this.inputTextList2[1]=result[0].udpOppositeIpPort | ||||
| 
 | ||||
|         this.inputTextList1[0]=result[0].tcplocalIp | ||||
|         this.inputTextList1[1]=result[0].tcplocalIpPort | ||||
|         this.inputTextList1[9]=result[0].tcpOppositeIp | ||||
|         this.inputTextList1[10]=result[0].tcpOppositePort | ||||
|         this.inputTextList1[5]=result[0].gateway | ||||
|         this.inputTextList1[4]=result[0].netMask | ||||
|         this.inputTextList1[8]=result[0].dnsServers | ||||
|         this.inputTextList1[11]=result[0].centerIp | ||||
|         this.inputTextList1[12]=result[0].heartPort | ||||
|         this.inputTextList1[13]=result[0].gpsPort | ||||
|       } | ||||
|     }) | ||||
|     ethernet.getIfaceConfig("eth0", (error, value) => { | ||||
|       if (error) { | ||||
|         // that.errorMsg='error' | ||||
|         console.log("boot_up getIp_new  callback error = " + JSON.stringify(error)); | ||||
|       } else { | ||||
|         console.log("boot_up getIp_new callback ipAddr = " + JSON.stringify(value.ipAddr)); // | ||||
|         console.log(" boot_up getIp_new callback mode = " + JSON.stringify(value.mode)); | ||||
|         console.log("boot_up getIp_new callback route = " + JSON.stringify(value.route)); | ||||
|         console.log("boot_up getIp_new callback gateway = " + JSON.stringify(value.gateway)); | ||||
|         console.log("boot_up getIp_new callback netMask = " + JSON.stringify(value.netMask)); | ||||
|         console.log("boot_up getIp_new callback dnsServers = " + JSON.stringify(value.dnsServers)); | ||||
|       } | ||||
|     }) | ||||
| 
 | ||||
|   } | ||||
|   onPageShow() { | ||||
|     console.info('Index onPageShow'); | ||||
|   } | ||||
|   outClick(){ | ||||
| 
 | ||||
|   } | ||||
| } | ||||
| @ -16,6 +16,7 @@ import WebRTCVoice from './webRTC/' | ||||
| import promptAction from '@ohos.promptAction' | ||||
| import { CandidateData, EmptyCandidateObject } from "../mock/CandidateData" | ||||
| import {string2Bytes} from '../common/utils/tools' | ||||
| import { getSyncData } from '../common/service/initable' | ||||
| @Entry | ||||
| @Component | ||||
| struct UserInfo { | ||||
| @ -69,43 +70,30 @@ struct UserInfo { | ||||
|   @State grantDept: string = ''; | ||||
|   @State effectDate: string = ''; | ||||
|   @State interval: any = null; | ||||
|   @State interval2: any = null; | ||||
|   @State interval3: any = null; | ||||
|   @State studentRefreshStatue: string = '0'; | ||||
|   @State photo: string = 'data:image/bmp;base64,'; | ||||
|   @State numCount: number = 0; | ||||
|   @State signNum: number = 0; | ||||
|   @State isCanClick: boolean = true; | ||||
|   @State FaceOpenStatue: string = '0';//是否开启人脸识别 | ||||
|   subscriber; | ||||
|   @State faceCatchImg: string = '' | ||||
| 
 | ||||
|   onPageShow() { | ||||
|   async onPageShow() { | ||||
|     //语音功能 | ||||
| 
 | ||||
|     const systemParms:any = await getSyncData('MA_SYSTEMPARM') | ||||
|     console.log('systemParms',systemParms.length) | ||||
|     new WebRTCVoice(this.context); | ||||
|     //初始化数据 | ||||
|     this.initData() | ||||
|     //身份证读卡器初始化 | ||||
|     this.openDeviceByIDCard() | ||||
|     // this.openDeviceByIDCard() | ||||
|     // 如果是单机模式则模拟假数据 | ||||
|     if (globalThis.singlePlay) { | ||||
|       // TODO 模拟假数据 | ||||
|       this.list = CandidateData | ||||
|       this.pageIndex = 0 | ||||
|       this.dataList = this.list.slice(this.pageIndex * 4, this.pageIndex * 4 + 4) | ||||
|       this.currentUser = this.dataList[0] | ||||
|       this.lsh = this.currentUser.lsh | ||||
|       globalThis.ksyh = this.currentUser.ksy1sfzmhm || this.currentUser.ksy2sfzmhm | ||||
|       globalThis.lsh = this.lsh | ||||
|       return | ||||
|     } else { | ||||
|       //      this.getExaminationStudentInfoFn() | ||||
|     } | ||||
| 
 | ||||
|     this.initSysset() | ||||
|     initJudgeUdp() | ||||
|     this.interval=setInterval(()=>{ | ||||
|       this.heartMsg() | ||||
|     },1000) | ||||
|     this.heartMsg() | ||||
| 
 | ||||
|   } | ||||
|   //身份证读卡器初始化 | ||||
|   openDeviceByIDCard(){ | ||||
| @ -118,6 +106,9 @@ struct UserInfo { | ||||
|       console.error("zzctest Failed to Open Device"); | ||||
|     } | ||||
|   } | ||||
|   stopDeviceById(){ | ||||
|     testNapi&&testNapi.StopReadCard() | ||||
|   } | ||||
|   // 通过身份证获取当前学员 | ||||
|   getCurrentStudent(id) { | ||||
|     let flag = false | ||||
| @ -133,7 +124,7 @@ struct UserInfo { | ||||
|         // this.currentUser.kszp=this.photo+res.kszp | ||||
|         // this.currentUser.ksmjzp=this.photo+this.currentUser.ksmjzp | ||||
|         if (globalThis.singlePlay) { | ||||
|           testNapi.StopReadCard(); | ||||
|           this.stopDeviceById() | ||||
|           // globalThis.statue=4 | ||||
|           router.pushUrl({ | ||||
|             url: 'pages/Judge', | ||||
| @ -219,18 +210,23 @@ struct UserInfo { | ||||
|     this.currentUser = EmptyCandidateObject | ||||
|     globalThis.statue = 2 | ||||
|     this.numCount = 0 | ||||
|     if (globalThis.singlePlay) { | ||||
|       // TODO 模拟假数据 | ||||
|       this.list = CandidateData | ||||
|       this.pageIndex = 0 | ||||
|       this.dataList = this.list.slice(this.pageIndex * 4, this.pageIndex * 4 + 4) | ||||
|       this.currentUser = this.dataList[0] | ||||
|       this.lsh = this.currentUser.lsh | ||||
|       globalThis.ksyh = this.currentUser.ksy1sfzmhm || this.currentUser.ksy2sfzmhm | ||||
|       globalThis.lsh = this.lsh | ||||
|       return | ||||
|     } else { | ||||
|       //      this.getExaminationStudentInfoFn() | ||||
|     } | ||||
|   } | ||||
| 
 | ||||
|   async heartMsg() { | ||||
|     const arr = [globalThis.signNum||0, globalThis.statue||1] | ||||
|     let tmpList = []; | ||||
|     tmpList.push(string2Bytes(arr[0], 1 * 8)[0]) | ||||
|     tmpList.push(string2Bytes(arr[1], 1 * 8)[0]) | ||||
|     const str =globalThis.lsh|| '0000000000000' | ||||
|     for (let i = 0;i < str.length; i++) { | ||||
|       tmpList.push(string2Bytes(str.charCodeAt(i), 1 * 8)[0]) | ||||
|     } | ||||
|     const param= {id: 31,list:tmpList,carNo: globalThis.carInfo.carNo,placeId: globalThis.carInfo.examinationRoomId,callback:(val)=>{ | ||||
|     globalThis.udpClient2.setMsgCallBack((val)=>{ | ||||
|       if(val.id=='32'){ | ||||
|         globalThis.signNum=val.body[1] | ||||
|         if(val.body[0]=='7'){ | ||||
| @ -241,8 +237,7 @@ struct UserInfo { | ||||
|         console.log('qkfnqkfn',val.body[0]) | ||||
|         this.qkFn() | ||||
|       } | ||||
|     }} | ||||
|     globalThis.udpClient2.sendMsg(param, this.context) | ||||
|     }) | ||||
|   } | ||||
|   getqkFn() { | ||||
|     let tmpList = []; | ||||
| @ -275,18 +270,28 @@ struct UserInfo { | ||||
|         that.ksxtbh = ksxtbhArr?.[0]?.v_value || '222' | ||||
|         const studentRefreshParam = syssetParams.filter(sys => sys.v_no === '452') | ||||
|         that.studentRefreshStatue = studentRefreshParam?.[0]?.v_value || '0' | ||||
|         const faceParam = syssetParams.filter(sys => sys.v_no === '2313') | ||||
|         that.FaceOpenStatue =faceParam?.[0]?.v_value=='3'? '1':'0' | ||||
|         that.FaceOpenStatue = '0' | ||||
|         console.log('that.FaceOpenStatue',that.FaceOpenStatue) | ||||
|         // faceParam?.[0]?.v_value || | ||||
|         // 1身份证读卡器 2指纹 3人脸 | ||||
|         if(faceParam?.[0]?.v_value=='1'){ | ||||
|           that.openDeviceByIDCard() | ||||
|         } | ||||
|          console.log('mmmmm',that.FaceOpenStatue) | ||||
|         //0不自动更新 1自动更新(不限次数) 2没有考生更新2次 | ||||
|         if (that.studentRefreshStatue == '2') { | ||||
|           clearInterval(that.interval2) | ||||
|           that.interval2 = setInterval(() => { | ||||
|           clearInterval(that.interval) | ||||
|           that.interval = setInterval(() => { | ||||
|             if (that.dataList.length == 0 && that.numCount < 3) { | ||||
|               that.numCount++ | ||||
|               that.getExaminationStudentInfoFn() | ||||
|             } | ||||
|           }, 5000) | ||||
|         } else if (that.studentRefreshStatue == '1') { | ||||
|           clearInterval(that.interval2) | ||||
|           that.interval2 = setInterval(() => { | ||||
|           clearInterval(that.interval) | ||||
|           that.interval = setInterval(() => { | ||||
|             if (that.dataList.length == 0) { | ||||
|               that.getExaminationStudentInfoFn() | ||||
|             } | ||||
| @ -298,6 +303,7 @@ struct UserInfo { | ||||
|   } | ||||
| 
 | ||||
|   changeFaceCompareSuccess() { | ||||
|     globalThis.statue = 2 | ||||
|     console.log('this.faceCompareSuces', this.faceCompareSucess, JSON.stringify(this.currentUser)) | ||||
|     if (this.faceCompareSucess > 0) { | ||||
|       this.sfbdinterfaceFn() | ||||
| @ -329,12 +335,12 @@ struct UserInfo { | ||||
|       if (!res) { | ||||
|         this.dataList = [] | ||||
|         this.currentUser = EmptyCandidateObject | ||||
|         console.log('currentUser', JSON.stringify(this.currentUser)) | ||||
|         this.errorMsg = decodeURI(res.getExaminationStudentInfoRsp.head.resultMessage) | ||||
|         return | ||||
|       } | ||||
|       let dataList = [] | ||||
|       this.list = [] | ||||
| 
 | ||||
|       for (let key in res.getExaminationStudentInfoRsp.body) { | ||||
|         const a = res.getExaminationStudentInfoRsp.body[key] | ||||
|         if (a instanceof Array) { | ||||
| @ -433,7 +439,7 @@ struct UserInfo { | ||||
|       ksxtbh: this.ksxtbh || '222', | ||||
|       sfzmhm: this.currentUser.sfzmhm || '', | ||||
|       ksysfzmhm: this.currentUser.ksy1sfzmhm || '', | ||||
|       zp: encodeURIComponent(this.faceCatchImg || ''), | ||||
|       zp: encodeURIComponent((this.faceCatchImg||this.currentUser.kszp.substr(22)) || ''), | ||||
|       kssj: dateFormat(date) || '', | ||||
|       kchp: decodeURI(plateNo), | ||||
|       Ksy2sfzmhm: this.currentUser.ksy2sfzmhm || '' | ||||
| @ -450,6 +456,7 @@ struct UserInfo { | ||||
|     globalThis.lsh = this.currentUser.lsh | ||||
|     globalThis.ksyh = this.currentUser.ksy1sfzmhm || this.currentUser.ksy2sfzmhm | ||||
|     this.currentUser.id = '1' | ||||
|     console.log('codecode',code) | ||||
|     if (code) { | ||||
|       this.AccountTable.query('0', (result) => { | ||||
|         if (result.length == 0) { | ||||
| @ -461,7 +468,8 @@ struct UserInfo { | ||||
|                 url: 'pages/Judge', | ||||
|                 params: { examItems: examItems?.getExaminationItemRsp?.body?.ykxx } | ||||
|               }, router.RouterMode.Single); | ||||
|               testNapi.StopReadCard(); | ||||
|               this.stopDeviceById() | ||||
| 
 | ||||
|             }) | ||||
|           }) | ||||
|         } else { | ||||
| @ -473,7 +481,7 @@ struct UserInfo { | ||||
|                 params: { examItems: examItems?.getExaminationItemRsp?.body?.ykxx } | ||||
|               }, router.RouterMode.Single); | ||||
|               globalThis.statue = 4 | ||||
|               testNapi.StopReadCard(); | ||||
|               this.stopDeviceById() | ||||
|             }) | ||||
|           }) | ||||
|         } | ||||
| @ -487,8 +495,8 @@ struct UserInfo { | ||||
|   } | ||||
|   outClick() { | ||||
|     clearInterval(this.interval) | ||||
|     clearInterval(this.interval2) | ||||
|     testNapi.StopReadCard(); | ||||
|     this.stopDeviceById() | ||||
|     globalThis.udpClient2.setMsgCallBack(()=>{}) | ||||
|   } | ||||
|   // 几个按钮公共样式 | ||||
|   @Styles | ||||
| @ -641,7 +649,7 @@ struct UserInfo { | ||||
|                         router.pushUrl({ | ||||
|                           url: 'pages/Judge', | ||||
|                         }, router.RouterMode.Single); | ||||
|                         testNapi.StopReadCard(); | ||||
|                         this.stopDeviceById() | ||||
|                       }) | ||||
|                     }) | ||||
|                   } else { | ||||
| @ -650,14 +658,18 @@ struct UserInfo { | ||||
|                         router.pushUrl({ | ||||
|                           url: 'pages/Judge', | ||||
|                         }, router.RouterMode.Single); | ||||
|                         testNapi.StopReadCard(); | ||||
|                         this.stopDeviceById() | ||||
|                       }) | ||||
|                     }) | ||||
|                   } | ||||
|                 }) | ||||
|                 return | ||||
|               } | ||||
|               this.showFaceCompare = true | ||||
|               if(this.FaceOpenStatue!='0'){ | ||||
|                 this.showFaceCompare = true | ||||
|               }else{ | ||||
|                 this.sfbdinterfaceFn() | ||||
|               } | ||||
|             }) | ||||
|         } | ||||
|       } | ||||
| @ -669,8 +681,8 @@ struct UserInfo { | ||||
|           faceCompareSucess: $faceCompareSucess, | ||||
|           getqkFlag: $getqkFlag, | ||||
|           faceCatchImg: $faceCatchImg, | ||||
|           lsh: globalThis.lsh, | ||||
|           showFaceCompare: $showFaceCompare, | ||||
|           lsh: globalThis.lsh, | ||||
|         }) | ||||
|       } | ||||
|       if (this.qkFlag) { | ||||
|  | ||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @ -1,32 +1,19 @@ | ||||
| //@ts-ignore | ||||
| import camera from '@ohos.multimedia.camera'; | ||||
| import image from '@ohos.multimedia.image' | ||||
| 
 | ||||
| import util from '@ohos.util'; | ||||
| import { writeFile } from '../../common/service/fileService' | ||||
| import TopLogo from '../compontents/topLogo' | ||||
| import { cameraService } from '../../common/service/cameraService' | ||||
| 
 | ||||
| import { voiceService } from '../../common/service/voiceService' | ||||
| import { faceCompare } from '../../api/userInfo' | ||||
| import prompt from '@ohos.prompt' | ||||
| import grantPermission from '../../common/utils/PermissionUtils'; | ||||
| import CameraModel from '../../common/service/CameraModel'; | ||||
| import FileUtil from '../../common/utils/File' | ||||
| import { VideoConfig } from '../interfaces' | ||||
| import common from '@ohos.app.ability.common'; | ||||
| import fs from '@ohos.file.fs' | ||||
| import onvifclient from '@ohos.onvifclient'; | ||||
| import buffer from '@ohos.buffer'; | ||||
| import mediaLibrary from '@ohos.multimedia.mediaLibrary' | ||||
| 
 | ||||
| // import MediaModel from '../../common/utils/MediaModel'; | ||||
| let previewWidth; | ||||
| let previewHeight; | ||||
| 
 | ||||
| const PERMISSIONS: Array<string> = [ | ||||
|   'ohos.permission.CAMERA'] | ||||
| import { string2Bytes } from '../../common/utils/tools' | ||||
| import { takePhoto } from '../../common/service/videoService' | ||||
| import configAddress from '../../common/utils/FileConfig' | ||||
| 
 | ||||
| @Component | ||||
| export default struct FaceCompare { | ||||
| struct FaceCompare { | ||||
|   constructor() { | ||||
|     super() | ||||
|   } | ||||
| @ -35,21 +22,16 @@ export default struct FaceCompare { | ||||
|   @Prop sfzh: string; | ||||
|   @Prop lsh: string; | ||||
|   @Prop firstImage: string; | ||||
|   @Link showFaceCompare: boolean; | ||||
|   @Link faceCompareSucess: number; | ||||
|   @Link showFaceCompare: boolean; | ||||
|   @Link getqkFlag: boolean; | ||||
|   @Link faceCatchImg: string; | ||||
|   @State imageThumbnail: string = ''; | ||||
|   private timer = null; //人脸比对执行任务定时器 | ||||
|   private stopClose = false; // 阻止用户关闭此组件 | ||||
|   private times = 1; //人脸比对失败次数, 超过3次将不会自动比对,需要点击重新打开重新触发 | ||||
|   private vocObj = null; | ||||
|   @State callBackFlag:boolean=false; | ||||
|   @State @Watch('changeFaceCompareSuccess') showFaceCompare2: Boolean = false; | ||||
| 
 | ||||
|   private surfaceId: string = ''; | ||||
|   @State callBackFlag: boolean = false; | ||||
|   @State @Watch('clearIntervalFn') showFaceCompareFlag: Boolean = false; | ||||
|   @State video_url: string = 'rtsp://admin:12345qwe@192.168.5.41:8000/h264/ch2/main/av_stream' | ||||
|   private fileAsset: mediaLibrary.FileAsset = undefined; | ||||
|   @State previewUri: Resource = $r('app.media.2_nor') | ||||
|   @State curRate: PlaybackSpeed = PlaybackSpeed.Speed_Forward_1_00_X | ||||
|   @State showControls: boolean = false | ||||
| @ -58,10 +40,9 @@ export default struct FaceCompare { | ||||
|   @State signNum: number = 0; | ||||
|   private fileUtil: FileUtil | ||||
|   private interval: any | ||||
|   private mediaTest: mediaLibrary.MediaLibrary = mediaLibrary.getMediaLibrary(globalThis.abilityContext) | ||||
|   private fd: number = -1; | ||||
|   @State param: VideoConfig = { | ||||
|     spls: '', | ||||
|     videoNum: '1', | ||||
|     faceFlag: false, | ||||
|     pztd: '1', | ||||
|     ljlx: '', | ||||
| @ -93,7 +74,7 @@ export default struct FaceCompare { | ||||
|         Row() { | ||||
|           Row() { | ||||
|             Video({ | ||||
|               src: `rtsp://${this.param.userName}:${this.param.pwd}@${this.param.ip}:${this.param.port}/h264/ch${this.param.rlls}/main/av_stream`, | ||||
|               src: this.showFaceCompare ? `rtsp://${this.param.userName}:${this.param.pwd}@${this.param.ip}:${this.param.port}/h264/ch${this.param.rlls}/main/av_stream` : '', | ||||
|               previewUri: this.previewUri, | ||||
|               currentProgressRate: PlaybackSpeed.Speed_Forward_1_00_X, | ||||
|               controller: this.controller, | ||||
| @ -107,6 +88,7 @@ export default struct FaceCompare { | ||||
|           .width('48%') | ||||
|           .height('100%') | ||||
| 
 | ||||
| 
 | ||||
|           Row() { | ||||
|             Image(this.firstImage) | ||||
|               .width('100%') | ||||
| @ -146,9 +128,7 @@ export default struct FaceCompare { | ||||
|             .backgroundImageSize({ width: '100%', height: '100%' }) | ||||
|             .onClick(async () => { | ||||
|               this.times = 1; | ||||
|               // this.takePhoto('face_check.mp3'); | ||||
|               // this.readyToTakePhoto(this.surfaceId); | ||||
|               // await this.cameraObj.releaseSource() | ||||
| 
 | ||||
|             }) | ||||
|           } | ||||
|           .width('88.9%') | ||||
| @ -174,29 +154,11 @@ export default struct FaceCompare { | ||||
|       .backgroundImage($r('app.media.close')) | ||||
|       .backgroundImageSize({ width: '100%', height: '100%' }) | ||||
|       .onClick(() => { | ||||
|         // prompt.showToast({ | ||||
|         //   message: '人脸比对程序正在执行,请等待程序执行完毕。', | ||||
|         //   duration: 3000 | ||||
|         // }); | ||||
|         this.controller.stop() | ||||
|         this.vocObj&&this.vocObj.releasePlayer() | ||||
|         this.showFaceCompare = false | ||||
|         this.showFaceCompare2 = false | ||||
|         this.vocObj && this.vocObj.releasePlayer() | ||||
|         this.showFaceCompare = !this.showFaceCompare | ||||
|         this.showFaceCompareFlag=!this.showFaceCompareFlag | ||||
|         this.faceCompareSucess = -1 | ||||
|         return | ||||
|         console.log('jiangsong close the faceCompare componet'); | ||||
|         if (!this.stopClose) { | ||||
|           this.showFaceCompare = false | ||||
|           this.showFaceCompare2 = false | ||||
| 
 | ||||
| 
 | ||||
|         } else { | ||||
|           prompt.showToast({ | ||||
|             message: '人脸比对程序正在执行,请等待程序执行完毕。', | ||||
|             duration: 3000 | ||||
|           }); | ||||
|           this.showFaceCompare = false | ||||
|         } | ||||
|       }) | ||||
|     } | ||||
|     .width('100%') | ||||
| @ -206,351 +168,175 @@ export default struct FaceCompare { | ||||
|   } | ||||
| 
 | ||||
|   onPageShow() { | ||||
|     // this.cameraModel.initCamera(this.surfaceId); | ||||
| 
 | ||||
|   } | ||||
|   changeFaceCompareSuccess(){ | ||||
|     this.callBackFlag=false | ||||
|     clearInterval(this.interval) | ||||
|     this.vocObj&&this.vocObj.releasePlayer() | ||||
|   } | ||||
| 
 | ||||
|   async aboutToAppear() { | ||||
|     this.callBackFlag=false | ||||
|     clearInterval(this.interval) | ||||
|     // this.mediaModel = MediaModel.getMediaInstance(); | ||||
|     const fileUtil = new FileUtil(this.context) | ||||
|     this.fileUtil = fileUtil | ||||
|     this.getVideoConfig() | ||||
| 
 | ||||
| 
 | ||||
|     // this.cameraModel.setTakePictureHandleCallback(this.takePictureHandle.bind(this)); | ||||
|   } | ||||
|   getqkFn(){ | ||||
|     let tmpList = []; | ||||
|     // const str =globalThis.signNum | ||||
|     // for (let i = 0;i < str.length; i++) { | ||||
|     //   tmpList.push(this.string2Bytes(str.charCodeAt(i), 1 * 8)[0]) | ||||
|     // } | ||||
|     // const arr = [globalThis.signNum||0, globalThis.statue||1] | ||||
|     // let tmpList = []; | ||||
|     tmpList.push(this.string2Bytes(globalThis.signNum, 1 * 8)[0]) | ||||
|     const param= {id: 41,list:tmpList,carNo: globalThis.carInfo.carNo,placeId: globalThis.carInfo.examinationRoomId} | ||||
| 
 | ||||
|   clearIntervalFn() { | ||||
|     this.callBackFlag = false | ||||
|     clearInterval(this.interval) | ||||
|     this.vocObj && this.vocObj.releasePlayer() | ||||
|   } | ||||
| 
 | ||||
|   getqkFn() { | ||||
|     let tmpList = []; | ||||
|     tmpList.push(string2Bytes(globalThis.signNum, 1 * 8)[0]) | ||||
|     const param = { | ||||
|       id: 41, | ||||
|       list: tmpList, | ||||
|       carNo: globalThis.carInfo.carNo, | ||||
|       placeId: globalThis.carInfo.examinationRoomId | ||||
|     } | ||||
|     globalThis.udpClient2.sendMsg(param, this.context) | ||||
|   } | ||||
| 
 | ||||
|   async faceComparFn() { | ||||
|     var loginInfo1 = { | ||||
|       host: `http://${this.param.ip}:80`, user: "administrator", pass: this.param.pwd } | ||||
|     // var file_dir = "/data/service/el1/public/netmanager/ethernet/"; | ||||
|     // var result3 = onvifclient.getVideoSnapshot(loginInfo1, video_uri, file_dir); | ||||
|     // console.info(`baoyihu endRecordVideo  result:` + result3.result + `  pictureFile:` + result3.dataString); | ||||
|     var mediaTest = mediaLibrary.getMediaLibrary(this.context); | ||||
|     let mediaType = mediaLibrary.MediaType.IMAGE; | ||||
|     let DIR_DOCUMENTS = mediaLibrary.DirectoryType.DIR_IMAGE; | ||||
|     const path = await mediaTest.getPublicDirectory(DIR_DOCUMENTS); | ||||
|     console.log('mmmmm0',1) | ||||
| 
 | ||||
|     const fileName = 'FaceCompar' + Math.floor(Math.random() * 1000) + '.jpg' | ||||
|     mediaTest.createAsset(mediaType, fileName, path, (error, asset) => { | ||||
|       asset.open('rw', (error, fd) => { | ||||
|         if (fd > 0) { | ||||
|           var file_path = "/mnt/hmdfs/100/account/device_view/local/files/Pictures/" + fileName | ||||
|           var result3 = onvifclient.getVideoSnapshot(`rtsp://${this.param.userName}:${this.param.pwd}@${this.param.ip}:${this.param.port}/h264/ch${this.param.rlls}/main/av_stream`, file_path, fd); | ||||
|           fs.closeSync(fd); | ||||
|           asset.close(fd); | ||||
|           // let filePath = pathDir + "/test.txt"; | ||||
|           fs.lstat(file_path).then((stat) => { | ||||
|             console.info("get link status succeed, the size of file is" + stat.size); | ||||
|             let file = fs.openSync(file_path, fs.OpenMode.READ_WRITE); | ||||
|             const size = Number(stat.size) + 100 | ||||
|             let buf = new ArrayBuffer(size); | ||||
|             let num = fs.readSync(file.fd, buf); | ||||
|             var that = new util.Base64(); | ||||
|             var array = new Uint8Array(buf); | ||||
|             var result = that.encodeToStringSync(array); //base64圖片 | ||||
|             // | ||||
|             mediaTest.deleteAsset(file_path).then(() => { | ||||
|               console.log('delSuccess') | ||||
|             }).catch(() => { | ||||
|               console.log('delError') | ||||
|             }) | ||||
|             this.fileUtil.deleteF(file_path, 3) | ||||
|             if(this.firstImage){ | ||||
|               this.faceCatchImg = result | ||||
|             }else{ | ||||
|               this.faceCatchImg = '' | ||||
|     const result = await takePhoto(this.param, this.context, 1,'jt/') | ||||
|     console.log('mmmmm8',9) | ||||
| 
 | ||||
|             } | ||||
|     faceCompare({ | ||||
|       sfzh: this.sfzh, | ||||
|       firstImage: this.firstImage.substr(22), | ||||
|       secondImage: result, | ||||
|       type: 2, | ||||
|       verifyType: 1 | ||||
|     }).then(res => { | ||||
|       console.log('mmmmm8',res) | ||||
| 
 | ||||
|       if (res) { | ||||
|         this.controller.stop() | ||||
|         this.showFaceCompare = !this.showFaceCompare | ||||
|         this.showFaceCompareFlag=!this.showFaceCompareFlag | ||||
|         this.faceCompareSucess = 1; | ||||
|         // this.faceCatchImg = result | ||||
|         this.vocObj.playAudio({ | ||||
|           type: 1, | ||||
|           name: 'yzcg.wav' | ||||
|         }) | ||||
|       } else { | ||||
|         this.times++; | ||||
|         //3s后开始语音提示 | ||||
|         this.vocObj.playAudio({ | ||||
|           type: 1, | ||||
|           name: 'face_fail.mp3' | ||||
|         }) | ||||
| 
 | ||||
|       } | ||||
|     }) | ||||
| 
 | ||||
|             faceCompare({ | ||||
|               sfzh: this.sfzh, | ||||
|               firstImage:this.firstImage.substr(22), | ||||
|               // sfzh: '321281198605076819', | ||||
|               // firstImage: this.firstImage, | ||||
|               secondImage: result, | ||||
|               type: 2, | ||||
|               verifyType: 1 | ||||
|             }).then(res => { | ||||
|               if (res) { | ||||
|                 this.controller.stop() | ||||
|                 console.log('jiangsong face compare success' + JSON.stringify(res)) | ||||
|                 this.showFaceCompare = false | ||||
|                 this.showFaceCompare2 = false | ||||
|                 this.faceCompareSucess = 1; | ||||
|                 // this.faceCatchImg = result | ||||
|                 this.vocObj.playAudio({ | ||||
|                   type: 1, | ||||
|                   name: 'yzcg.wav' | ||||
|                 }) | ||||
|               } else { | ||||
|                 console.log('jiangsong face compare faild') | ||||
|                 // this.showFaceCompare = false | ||||
|                 // this.faceCompareSucess = false; | ||||
|                 this.times++; | ||||
|                 //3s后开始语音提示 | ||||
|                 this.vocObj.playAudio({ | ||||
|                   type: 1, | ||||
|                   name: 'face_fail.mp3' | ||||
|                 }) | ||||
|                 // this.timer = setTimeout(() => { | ||||
|                 //   this.takePhoto('face_fail.mp3'); | ||||
|                 // }, 3000) | ||||
|               } | ||||
|             }) | ||||
|             // console.log(result) | ||||
|             //result base64 | ||||
|             // this.fileUtil.deleteF(file_path,3) | ||||
|           }).catch((err) => { | ||||
|             console.info("get link status failed with error message: " + err.message + ", error code: " + err.code); | ||||
|           }); | ||||
|         } else { | ||||
|           console.error('baoyihu getVideoSnapshot File Open failed with error: ' + error); | ||||
|         } | ||||
|       }); | ||||
|     }); | ||||
| 
 | ||||
|   } | ||||
| 
 | ||||
|   async heartMsg(context) { | ||||
|     let tmpList=[] | ||||
|     const str =this.lsh | ||||
|     let tmpList = [] | ||||
|     const str = this.lsh | ||||
|     for (let i = 0;i < str.length; i++) { | ||||
|       tmpList.push(this.string2Bytes(str.charCodeAt(i), 1 * 8)[0]) | ||||
|       tmpList.push(string2Bytes(str.charCodeAt(i), 1 * 8)[0]) | ||||
|     } | ||||
|     const param = { id: 46, list: tmpList, carNo: globalThis.carInfo.carNo, placeId: globalThis.carInfo.examinationRoomId,callback:()=>{ | ||||
|       console.log('46send') | ||||
|       this.callBackFlag=true | ||||
|     }} | ||||
|     this.interval=setInterval(()=>{ | ||||
|       console.log('klklklk',this.callBackFlag) | ||||
|       if(this.callBackFlag){ | ||||
|         console.log('klklklk') | ||||
|         const param2 = { id: 47, list: tmpList, carNo: globalThis.carInfo.carNo, placeId: globalThis.carInfo.examinationRoomId } | ||||
|         globalThis.udpClient2&&globalThis.udpClient2.sendMsg(param2,this.context) | ||||
|     const param = { | ||||
|       id: 46, | ||||
|       list: tmpList, | ||||
|       carNo: globalThis.carInfo.carNo, | ||||
|       placeId: globalThis.carInfo.examinationRoomId, | ||||
|       sendCallback: () => { | ||||
|         this.callBackFlag = true | ||||
|       } | ||||
|     },1000) | ||||
|     // const param = { id: 31, list: tmpList, carNo: 489, placeId: 62 } | ||||
|     globalThis.udpClient2&&globalThis.udpClient2.sendMsg(param, this.context) | ||||
| 
 | ||||
| 
 | ||||
|     // return {id: 31,list:tmpList,carNo:489,placeId:62} | ||||
|   } | ||||
|   async getVideoConfig() { | ||||
|     const data = await this.fileUtil.readFile('/mnt/hmdfs/100/account/device_view/localfiles/files/config/config3.txt'); | ||||
|     console.log('data,data',data) | ||||
|     if(!data){ | ||||
|       this.vocObj = new voiceService(async (status, val, next) => { | ||||
|         if (status == 'idle') { | ||||
|           if (val == 'face_check.mp3' || val == 'face_fail.mp3') { | ||||
|             console.log('this.time',this.times) | ||||
|             if (this.times >=3) { | ||||
|               this.vocObj&&this.vocObj.playAudio({ | ||||
|                 type: 1, | ||||
|                 name: 'face_checking.wav' | ||||
|               }) | ||||
|               // this.showFaceCompare = false | ||||
|               globalThis.statue=3 | ||||
|               this.faceCompareSucess = -1; | ||||
|               this.heartMsg(this.context) | ||||
|             }else{ | ||||
|               setTimeout(()=>{ | ||||
|                 this.faceComparFn() | ||||
|               },2000) | ||||
|             } | ||||
|           } else if (val == 'yzcg.wav') { | ||||
|             // this.sfbdinterfaceFn() | ||||
|             this.showFaceCompare = false | ||||
|             this.showFaceCompare2 = false | ||||
|             this.vocObj&&this.vocObj.releasePlayer() | ||||
|             globalThis.statue=4 | ||||
|             this.faceCompareSucess = 1; | ||||
|           }else if(val=='face_checking.wav'){ | ||||
|             // globalThis.statue=3 | ||||
|             this.faceCompareSucess = -1; | ||||
|             this.callBackFlag=false | ||||
|             this.vocObj&&this.vocObj.releasePlayer() | ||||
|           }else if(val=='face_chekc_fail.wav'){ | ||||
|             this.vocObj&&this.vocObj.releasePlayer() | ||||
|             this.faceCompareSucess=-1 | ||||
|             this.showFaceCompare = false | ||||
|             this.showFaceCompare2 = false | ||||
|             this.callBackFlag=false | ||||
|           } | ||||
|         } | ||||
|       }); | ||||
|       return | ||||
|     } | ||||
|     this.param = JSON.parse(data) | ||||
|     // this.param.userName = JSON.parse(data).userName | ||||
|     // this.param.ip = JSON.parse(data).ip | ||||
|     // this.param.pwd = JSON.parse(data).pwd | ||||
|     // this.param.port = JSON.parse(data).port | ||||
|     // this.param.rlls = JSON.parse(data).rlls | ||||
|     console.log('this.parm', this.param.userName, this.param.pwd, this.param.ip, this.param.port, this.param.rlls) | ||||
|     this.controller.start() | ||||
|     // this.video_url = `rtsp://${this.param.userName}:${this.param.pwd}@${this.param.ip}:${this.param.port}/h264/ch${this.param.rlls}/main/av_stream`; | ||||
|     this.vocObj = new voiceService(async (status, val, next) => { | ||||
|       if (status == 'idle') { | ||||
|         if (val == 'face_check.mp3' || val == 'face_fail.mp3') { | ||||
|           if (this.times >= 3) { | ||||
|             // this.showFaceCompare = false | ||||
|             globalThis.statue=3 | ||||
|             this.faceCompareSucess = -1; | ||||
|             this.vocObj&&this.vocObj.playAudio({ | ||||
|               type: 1, | ||||
|               name: 'face_checking.wav' | ||||
|             }) | ||||
|             this.heartMsg(this.context) | ||||
|           }else{ | ||||
|             setTimeout(()=>{ | ||||
|               this.faceComparFn() | ||||
|             },2000) | ||||
|           } | ||||
|         } else if (val == 'yzcg.wav') { | ||||
|           // this.sfbdinterfaceFn() | ||||
|           this.showFaceCompare = false | ||||
|           this.showFaceCompare2 = false | ||||
|           globalThis.statue=4 | ||||
|           this.faceCompareSucess = 1; | ||||
|           this.vocObj&&this.vocObj.releasePlayer() | ||||
| 
 | ||||
|         } else if(val=='face_chekc_fail.wav'){ | ||||
|           this.vocObj&&this.vocObj.releasePlayer() | ||||
|           this.faceCompareSucess=-1 | ||||
|           this.showFaceCompare = false | ||||
|           this.showFaceCompare2 = false | ||||
|           this.callBackFlag=false | ||||
|     globalThis.udpClient2 && globalThis.udpClient2.sendMsg(param, this.context) | ||||
|     this.interval = setInterval(() => { | ||||
|       if (this.callBackFlag) { | ||||
|         const param2 = { | ||||
|           id: 47, | ||||
|           list: tmpList, | ||||
|           carNo: globalThis.carInfo.carNo, | ||||
|           placeId: globalThis.carInfo.examinationRoomId, | ||||
|         } | ||||
|         // else if(val=='face_checking.wav'){ | ||||
|         //   // console.log('kkkk') | ||||
|         //   this.vocObj&&this.vocObj.releasePlayer() | ||||
|         //   // globalThis.statue=3 | ||||
|         //   // this.faceCompareSucess = -1; | ||||
|         // } | ||||
|         globalThis.udpClient2 && globalThis.udpClient2.sendMsg(param2, this.context) | ||||
|       } | ||||
|     }); | ||||
|     setTimeout(() => { | ||||
|       this.vocObj&&this.vocObj.playAudio({ | ||||
|         type: 1, | ||||
|         name: 'face_check.mp3' | ||||
|       }) | ||||
|     }, 1000) | ||||
|     this.setUdp() | ||||
|     // this.cameraModel.initCamera(this.surfaceId); | ||||
| 
 | ||||
|   } | ||||
|   setUdp(){ | ||||
|     const that=this | ||||
|     globalThis.udpClient2&&globalThis.udpClient2.onMessage((val)=>{ | ||||
|       console.log('qkqkqk',val.id,val.body) | ||||
|       if(val.id=='32'){ | ||||
|         globalThis.signNum=val.body[1] | ||||
|         if(val.body[0]=='7'){ | ||||
|           this.getqkFn() | ||||
|           this.signNum=val.body[1] | ||||
|         } | ||||
|       }else if(val.id=='48'){ | ||||
|         if(val.body[13]=='1'){ | ||||
|           that.showFaceCompare = false | ||||
|           that.showFaceCompare2 = false | ||||
|           that.vocObj&&that.vocObj.releasePlayer() | ||||
|           that.faceCompareSucess=1 | ||||
|           this.callBackFlag=false | ||||
|           clearInterval(that.interval) | ||||
|         }else if(val.body[13]=='0'&&this.callBackFlag){ | ||||
|           this.callBackFlag=false | ||||
|           globalThis.statue=2 | ||||
|           console.log('callBackFlag',this.callBackFlag) | ||||
|           that.vocObj&&that.vocObj.playAudio({ | ||||
|     globalThis.udpClient2.setMsgCallBack((val) => { | ||||
|       if (val.id == '48') { | ||||
|         if (val.body[13] == '1') { | ||||
|           this.showFaceCompareFlag=!this.showFaceCompareFlag | ||||
|           this.showFaceCompare = !this.showFaceCompare | ||||
|           this.vocObj && this.vocObj.releasePlayer() | ||||
|           this.faceCompareSucess = 1 | ||||
|           clearInterval(this.interval) | ||||
|         } else if (val.body[13] == '0' && this.callBackFlag) { | ||||
|           globalThis.statue = 2 | ||||
|           this.vocObj && this.vocObj.playAudio({ | ||||
|             type: 1, | ||||
|             name: 'face_chekc_fail.wav' | ||||
|           }) | ||||
|         } | ||||
|       }else if(val.id=='42'){ | ||||
|         console.log('qkqkqk') | ||||
|         this.getqkFlag=!this.getqkFlag | ||||
|       } | ||||
|     }) | ||||
|   } | ||||
|   fillZero(str, len) { | ||||
|     str = str + ''; | ||||
|     if (str.length > len || !len) { | ||||
|       return str | ||||
|     } | ||||
| 
 | ||||
|     let num = len - str.length; | ||||
|     let zeroStr = ''; | ||||
|     for (var i = 0; i < num; i++) { | ||||
|       zeroStr = zeroStr + '0' | ||||
|     } | ||||
| 
 | ||||
|     return zeroStr + str; | ||||
|   } | ||||
| 
 | ||||
|   // takePictureHandle = (thumbnail: string) => { | ||||
|   //   this.imageThumbnail = thumbnail; | ||||
|   // }; | ||||
|   string2Bytes(number, len) { | ||||
|     // console.log('string2Bytes == ', number) | ||||
|     let  str = (+number).toString(2); | ||||
|     if(str.length > len) { | ||||
|       console.log('数据长度不对~~'); | ||||
|       return | ||||
|     } | ||||
|     var byteString = this.fillZero(str, len); | ||||
|   async getVideoConfig() { | ||||
|     console.log('faceEnterIn') | ||||
|     this.vocObj = new voiceService(async (status, val, next) => { | ||||
|       if (status == 'idle') { | ||||
|         if (val == 'face_check.mp3' || val == 'face_fail.mp3') { | ||||
|           if (this.times >= 3) { | ||||
|             globalThis.statue = 3 | ||||
|             this.faceCompareSucess = -1; | ||||
|             this.vocObj && this.vocObj.playAudio({ | ||||
|               type: 1, | ||||
|               name: 'face_checking.wav' | ||||
|             }) | ||||
|             this.heartMsg(this.context) | ||||
|           } else { | ||||
|             setTimeout(() => { | ||||
|               this.faceComparFn() | ||||
|             }, 2000) | ||||
|           } | ||||
|         } else if (val == 'yzcg.wav') { | ||||
|           this.showFaceCompare = !this.showFaceCompare | ||||
|           this.showFaceCompareFlag=!this.showFaceCompareFlag | ||||
|           globalThis.statue = 4 | ||||
|           this.faceCompareSucess = 1; | ||||
|           this.vocObj && this.vocObj.releasePlayer() | ||||
| 
 | ||||
|     var arrBytes = new Array(); | ||||
|     for (var i = byteString.length; i > 0;) { | ||||
|       let j = i - 8; | ||||
|       if (j < 0) { | ||||
|         j = 0 | ||||
|         } else if (val == 'face_chekc_fail.wav') { | ||||
|           this.vocObj && this.vocObj.releasePlayer() | ||||
|           this.faceCompareSucess = -1 | ||||
|           this.showFaceCompare = !this.showFaceCompare | ||||
|           this.showFaceCompareFlag=!this.showFaceCompareFlag | ||||
|         } | ||||
|       } | ||||
|       var s = byteString.slice(j, i); | ||||
|       var v = parseInt(s, 2); | ||||
|       arrBytes.push(v); | ||||
|       i = i - 8 | ||||
|     }); | ||||
| 
 | ||||
|     } | ||||
|     return arrBytes; | ||||
|     const data = await this.fileUtil.readFile(configAddress.comoonfileWriteAddress + '/config/config3.txt'); | ||||
|     console.log('faceEnterIn,data',data) | ||||
| 
 | ||||
|     setTimeout(() => { | ||||
|       this.vocObj && this.vocObj.playAudio({ | ||||
|         type: 1, | ||||
|         name: 'face_check.mp3' | ||||
|       }) | ||||
|     }, 1000) | ||||
|     this.param = JSON.parse(data) | ||||
|     this.param.userName = JSON.parse(data).userName | ||||
|     this.param.ip = this.param.ip | ||||
|     this.param.pwd = this.param.pwd | ||||
|     this.param.port = this.param.port | ||||
|     this.param.rlls = this.param.rlls | ||||
|     this.controller.start() | ||||
|   } | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
|   async aboutToDisappear() { | ||||
|     // this.mediaModel = MediaModel.getMediaInstance(); | ||||
| 
 | ||||
|   } | ||||
| 
 | ||||
|   takePhoto(name) { | ||||
|     this.stopClose = true; | ||||
|     if (this.times > 3) { | ||||
|       this.stopClose = false; | ||||
|       return; | ||||
|     } | ||||
|     this.times++; | ||||
| 
 | ||||
|     // this.vocObj.playAudio({ | ||||
|     //   type: 1, | ||||
|     //   name: name | ||||
|     // }) | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| export default FaceCompare | ||||
| @ -1,6 +1,8 @@ | ||||
| // @ts-nocheck | ||||
| import hilog from '@ohos.hilog'; | ||||
| import apiJudgeSdk from 'libJudgeSdk.so'; | ||||
| // import apiJudgeSdk from '@ohos.judgesdk'; | ||||
| 
 | ||||
| import Judge from '../../judgeSDK/utils/judge-real' | ||||
| import {Project,ProjectObj,MarkRule} from '../../judgeSDK/api/judgeSDK.d' | ||||
| import common from '@ohos.app.ability.common'; | ||||
| @ -37,6 +39,7 @@ struct RealTime { | ||||
|             id: 'duolun_plugin_id_draw', //显示轨迹窗口id名称,注意这个ID要和C++侧一致,不能变 | ||||
|             type: 'surface', | ||||
|             libraryname: 'JudgeSdk' | ||||
|             // libraryname: 'judgesdk' | ||||
|           }) | ||||
|             .width(this.width) | ||||
|             .height(this.height) | ||||
|  | ||||
| @ -1,4 +1,5 @@ | ||||
| import libJudgeSdk from 'libJudgeSdk.so' | ||||
| // import libJudgeSdk from '@ohos.judgesdk'
 | ||||
| 
 | ||||
| /** | ||||
|  * 苏仁君 | ||||
|  | ||||
| @ -530,6 +530,7 @@ export const  testRealExam = { | ||||
|     }, | ||||
|     "extend": {} | ||||
| } | ||||
| 
 | ||||
| export const testAllitems = [ | ||||
|     {name:'倒车入库',abbreviation:'倒车入库',projectCode:'0',projectCodeCenter:'20100',type:'1'}, | ||||
|     {name:'倒车入库',abbreviation:'倒车入库',projectCode:'0',projectCodeCenter:'20100',type:'2'}, | ||||
|  | ||||
| @ -109,6 +109,7 @@ export default class Judge{ | ||||
|     if(isTrajectoryOpen){ | ||||
|       beginExamInfo = JSON.parse(strArr[1]) | ||||
|     }else{ | ||||
|       //获取开始考试数据
 | ||||
|       beginExamInfo = await getJudgeBeginData() | ||||
|     } | ||||
|     await fileLog.setExamJudgeData(beginExamInfo) | ||||
| @ -153,6 +154,7 @@ export default class Judge{ | ||||
|       const udpIndex = globalThis.udpIndex; | ||||
|       if(udpIndex % 5 === 0){ | ||||
|         const judgeUdp = globalThis.judgeUdp | ||||
|         //平台实时轨迹心跳
 | ||||
|         const bytes= await this.getMessageHeartbeat(); | ||||
|         judgeUdp.send(bytes) | ||||
|       } | ||||
| @ -295,14 +297,14 @@ export default class Judge{ | ||||
| 
 | ||||
|   //处理考试结束
 | ||||
|   public handEndExam = async ()=>{ | ||||
|     const {isExam,judgeUI,endExam,avPlayer} = this; | ||||
| 
 | ||||
|     const {endExam,avPlayer} = this; | ||||
|     avPlayer.playAudio(['km2/exam_waiting.mp3'],true) | ||||
|     this.isEnd = true | ||||
|     // 获取最后一次心跳
 | ||||
|     const bytes = await this.getMessageHeartbeat(true); | ||||
|     const singlePlay = globalThis.singlePlay | ||||
|     singlePlay || globalThis.judgeUdp.send(bytes) | ||||
|     //结束评判函数
 | ||||
|     // c++调用考试结束
 | ||||
|     await examJudgeEndExam(); | ||||
|     globalThis.isJudge = false | ||||
|     await endExam() | ||||
| @ -333,10 +335,14 @@ export default class Judge{ | ||||
|     const markRuleListObj = this.judgeUI.markRuleListObj; | ||||
|     const thisMark =  markRuleListObj[code] | ||||
|     return { | ||||
|       //扣分描述
 | ||||
|       desc: thisMark.markshow, | ||||
|       //扣分分数
 | ||||
|       score: thisMark.markreal, | ||||
|       markcatalog: thisMark.markcatalog, | ||||
|       // 扣分编码
 | ||||
|       markserial:thisMark.markserial, | ||||
|       // 扣分序号
 | ||||
|       kfxh:thisMark.kfxh | ||||
|     } | ||||
|   } | ||||
| @ -412,7 +418,7 @@ export default class Judge{ | ||||
|       xtlb:'17',jkxlh:serialNumber,jkid:'17C53', | ||||
|       drvexam:{ | ||||
|         lsh,kskm:examSubject, | ||||
|         // 通用评判科二10000,科三30000
 | ||||
|         //TODO 通用评判科二10000,科三30000
 | ||||
|         ksxm:project?project.projectCodeCenter:10000, | ||||
|         kfxm:kf.markcatalog, | ||||
|         kfxmmx:`${ksxm},${kf.markserial}`, | ||||
| @ -486,6 +492,7 @@ export default class Judge{ | ||||
|     if(!isManual){ | ||||
|       if(totalScore < 80){ | ||||
|         judgeUI.loadingPopupVisible = true | ||||
|         //考试次数为1次
 | ||||
|         if(kssycs == 1){ | ||||
|           avPlayer.playAudio(['km2/unqualified_one.wav'],true) | ||||
|         }else{ | ||||
| @ -648,7 +655,6 @@ export default class Judge{ | ||||
| 
 | ||||
|     let tempArr = []; | ||||
|     arr.forEach(itemArr =>{ tempArr = tempArr.concat(itemArr)}) | ||||
| 
 | ||||
|     this.serialIndex += 1; | ||||
|     return Array2Byte(tempArr) | ||||
|   } | ||||
| @ -733,6 +739,7 @@ export default class Judge{ | ||||
|     return sbxh | ||||
|   } | ||||
| 
 | ||||
|   //获取场地设备编码
 | ||||
|   getSbbm = (ksxm,xmxh) => { | ||||
|     const {judgeUI} = this; | ||||
|     const {cdsbInfoObj,projectsObj} = judgeUI; | ||||
| @ -783,7 +790,6 @@ export default class Judge{ | ||||
|     return modelData | ||||
|   } | ||||
| 
 | ||||
| 
 | ||||
|   private judgeUI | ||||
|   private fileLog | ||||
|   private totalScore:number | ||||
|  | ||||
| @ -1,18 +1,10 @@ | ||||
| import { | ||||
|   examJudgeSetLogCallback, | ||||
|   examJudgeBeginExam, | ||||
|   examJudgeInit, | ||||
|   examJudgeRealExam, | ||||
|   examJudgeSetRealExamCallback, | ||||
|   examJudgeMapSetParam, | ||||
|   examJudgeMapSetDrawing, | ||||
|   examJudgeMapSetScaling | ||||
| } from '../api/index' | ||||
| import systemTime from '@ohos.systemDateTime'; | ||||
| 
 | ||||
| import FileUtil from '../../../common/utils/File' | ||||
| import FileModel from './../utils/file-model' | ||||
| import {testRealExam} from '../dataTest/index' | ||||
| 
 | ||||
| const judgeTag = 'SURENJUN_JUDGE' | ||||
| 
 | ||||
|  | ||||
| @ -3,7 +3,7 @@ import {  getDeviceInfo} from '../common/service/terminalService' | ||||
| import { registrationDeviceNo } from '../api/checkCar' | ||||
| import { dateFormat} from '../common/utils/tools' | ||||
| import deviceManager from '@ohos.distributedHardware.deviceManager' | ||||
| import { upDateTableConfig } from '../common/service/initable' | ||||
| import { upDateTableByArray } from '../common/service/initable' | ||||
| import { voiceService } from '../common/service/voiceService' | ||||
| import promptAction from '@ohos.promptAction' | ||||
| @Entry | ||||
| @ -107,7 +107,7 @@ struct Index { | ||||
|       type:'1' | ||||
|     } | ||||
|     globalThis.deviceNo=this.ip | ||||
|     upDateTableConfig('DeviceInfoTable',[{deviceId:this.ip}]) | ||||
|     upDateTableByArray('DeviceInfoTable',[{deviceId:this.ip}]) | ||||
|     registrationDeviceNo(param).then(res=>{ | ||||
|       if(res.registrationDeviceNoRsp.head.resultCode=='0'){ | ||||
|         promptAction.showToast({ | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user