Compare commits

...

3 Commits

Author SHA1 Message Date
d743f22889 Merge branch 'main' into lv_chengmai 2024-08-14 09:19:52 +08:00
f974da9303 外殼修改 2024-08-14 09:18:33 +08:00
f720674c7b Merge pull request 'lv_chengmai' (#56) from lv_chengmai into main
Reviewed-on: #56
2024-08-13 11:48:30 +08:00
9 changed files with 23 additions and 24 deletions

View File

@ -3,16 +3,12 @@ import { obtainCarExamInfo } from '../../api/index'
import { dateFormat } from '../utils/tools' import { dateFormat } from '../utils/tools'
import router from '@ohos.router' import router from '@ohos.router'
import promptAction from '@ohos.promptAction' import promptAction from '@ohos.promptAction'
import { getSyncData } from '../../common/service/initable'
import { GlobalConfig } from '../../config/index' import { GlobalConfig } from '../../config/index'
import FileUtil from '../../common/utils/File' import FileUtil from '../../common/utils/File'
//获取设备信息 //获取设备信息
export async function getDeviceInfo(context) { export async function getDeviceInfo(context) {
// globalThis.deviceNo = '153216400880'; //科目三设备
// globalThis.deviceNo = '150667400235'; //科目三设备
// globalThis.deviceNo = '1649018001275'; //洛阳科目三设备
// globalThis.deviceNo = 'MAC-36E6575F'; //杭州科目二设备 489
// globalThis.deviceNo = 'MAC-C57C8966'; //杭州科目二设备
return new Promise(async (resolve, reject) => { return new Promise(async (resolve, reject) => {
const fileUtil = new FileUtil(context) const fileUtil = new FileUtil(context)
const data = await fileUtil.readFile(GlobalConfig.comoonfileWriteAddress + '/config/deviceNo.txt'); const data = await fileUtil.readFile(GlobalConfig.comoonfileWriteAddress + '/config/deviceNo.txt');
@ -21,12 +17,9 @@ export async function getDeviceInfo(context) {
message: `请先进行设备注册`, message: `请先进行设备注册`,
duration: 3000 duration: 3000
}); });
router.pushUrl({
url: 'pages/Register',
}, router.RouterMode.Single);
resolve('') resolve('')
} else { } else {
const fileData = JSON.parse(data) const fileData=JSON.parse(data)
globalThis.deviceNo = fileData.deviceName globalThis.deviceNo = fileData.deviceName
getCarInfo() getCarInfo()
resolve(fileData.deviceName) resolve(fileData.deviceName)

View File

@ -181,6 +181,7 @@ export default class TcpClient {
let promise = this.tcp.close(); let promise = this.tcp.close();
promise.then(() => { promise.then(() => {
globalThis.getCloseTcp = true globalThis.getCloseTcp = true
console.log(TAG, 'tcpCloseSuccess') console.log(TAG, 'tcpCloseSuccess')
callback() callback()
reslove(true) reslove(true)

View File

@ -16,7 +16,7 @@
import socket from '@ohos.net.socket'; import socket from '@ohos.net.socket';
import { Array2Byte } from '../utils/tools' import { Array2Byte } from '../utils/tools'
import {getChuankouFn} from '../../common/service/indexService' import {getChuankouFn} from '../../common/service/indexService'
import {getUDP} from './GlobalUdp'
const TAG = 'socketTag[PLC.UdpClient]' const TAG = 'socketTag[PLC.UdpClient]'
import prompt from '@ohos.prompt' import prompt from '@ohos.prompt'
@ -29,7 +29,7 @@ export default class UdpClient {
private oppositeIpPort: string = '' private oppositeIpPort: string = ''
private udp: any = null private udp: any = null
// private stashFn:StashFuncotion // private stashFn:StashFuncotionon
constructor(udplocalIp: string, udplocalIpPort: string, udpOppositeIp: string, udpOppositeIpPort: string) { constructor(udplocalIp: string, udplocalIpPort: string, udpOppositeIp: string, udpOppositeIpPort: string) {
this.localIp = udplocalIp this.localIp = udplocalIp
@ -179,9 +179,10 @@ export default class UdpClient {
num++ num++
console.log(TAG,'plc udp信号丢失') console.log(TAG,'plc udp信号丢失')
if(num==3){ if(num==3){
await this.bindUdp() getUDP(globalThis.context,true)
await this.sendMsg('111') // await this.bindUdp()
await this.onMessage(callback) // await this.sendMsg('111')
// await this.onMessage(callback)
num=0 num=0
} }
prompt.showToast({ prompt.showToast({

View File

@ -30,6 +30,8 @@ export default class EntryAbility extends UIAbility {
globalThis.hasAuth = false globalThis.hasAuth = false
globalThis.version = '2022.08.13.01' globalThis.version = '2022.08.13.01'
globalThis.judgeVersion = '2022.12.05.1' globalThis.judgeVersion = '2022.12.05.1'
// globalThis.version = '2024.11.22.14'
// globalThis.judgeVersion = '2024.11.22.14'
globalThis.videoVersion= '1.0' globalThis.videoVersion= '1.0'
// globalThis.version = '2023.12.13.01' // globalThis.version = '2023.12.13.01'
// globalThis.judgeVersion = '2023.09.30.1' // globalThis.judgeVersion = '2023.09.30.1'

View File

@ -311,6 +311,7 @@ struct Index {
carNo: globalThis.carInfo.carNo, carNo: globalThis.carInfo.carNo,
placeId: globalThis.carInfo.examinationRoomId placeId: globalThis.carInfo.examinationRoomId
} }
console.log('paramparam',JSON.stringify(param))
// globalThis.udpClient2.initHeartSendMsg(param,this.context) // globalThis.udpClient2.initHeartSendMsg(param,this.context)
if (globalThis.udpClient2.getStatus()) { if (globalThis.udpClient2.getStatus()) {
globalThis.udpClient2.sendMsgExt(param, this.context) globalThis.udpClient2.sendMsgExt(param, this.context)
@ -333,8 +334,7 @@ struct Index {
this.loading = false this.loading = false
this.userAuth(); this.userAuth();
this.createAlbum() this.createAlbum()
await getUDP(this.context,false)
await getUDP2(this.context,false)
this.num=0 this.num=0
clearInterval(this.interval) clearInterval(this.interval)
this.interval = setInterval(() => { this.interval = setInterval(() => {
@ -347,7 +347,6 @@ struct Index {
}, 1000) }, 1000)
// //
getTCP()
// const TcpClient: TcpClient =new TcpClient(result[0].tcplocalIp, result[0].tcplocalIpPort,result[0].tcpOppositeIp,result[0].tcpOppositePort) // const TcpClient: TcpClient =new TcpClient(result[0].tcplocalIp, result[0].tcplocalIpPort,result[0].tcpOppositeIp,result[0].tcpOppositePort)
console.info('Index onPageShow'); console.info('Index onPageShow');
@ -388,8 +387,12 @@ struct Index {
async initParams() { async initParams() {
this.loading = false this.loading = false
takePhotoFn(this.context) takePhotoFn(this.context)
this.deviceId=await getDeviceInfo(this.context) || '' await getDeviceInfo(this.context)
await getCarInfo() await getCarInfo()
await getUDP(this.context,false)
await getUDP2(this.context,false)
getTCP()
this.deviceId= globalThis.carInfo.carNo
await setCurrentTime(); await setCurrentTime();
this.carNum = globalThis.carInfo.plateNo; this.carNum = globalThis.carInfo.plateNo;
this.version = globalThis.version; this.version = globalThis.version;

View File

@ -55,7 +55,7 @@ export default struct Index {
} }
.margin({ left: 24 * this.ratio }) .margin({ left: 24 * this.ratio })
Text('考车号:' + globalThis.deviceNo) Text('考车号:' + globalThis.carInfo.carNo)
.fontColor('#CCAE7A') .fontColor('#CCAE7A')
.fontSize(22 * this.ratio) .fontSize(22 * this.ratio)
.margin({ right: 24 * this.ratio }) .margin({ right: 24 * this.ratio })

View File

@ -316,7 +316,6 @@ struct UserInfo {
const faceParam = syssetParams.filter(sys => sys.v_no == '2413') const faceParam = syssetParams.filter(sys => sys.v_no == '2413')
// that.FaceOpenStatue = '0'
// faceParam?.[0]?.v_value || // faceParam?.[0]?.v_value ||
// 1身份证读卡器 2指纹 3人脸 // 1身份证读卡器 2指纹 3人脸
if(openCheckFlag=='1'){ if(openCheckFlag=='1'){
@ -326,6 +325,7 @@ struct UserInfo {
that.openDeviceByIDCard() that.openDeviceByIDCard()
} }
} }
// that.FaceOpenStatue = '0'
//0不自动更新 1自动更新不限次数 2没有考生更新2次 //0不自动更新 1自动更新不限次数 2没有考生更新2次
if (that.studentRefreshStatue == '2') { if (that.studentRefreshStatue == '2') {

View File

@ -217,7 +217,7 @@ struct Index {
this.param.faceFlag = value this.param.faceFlag = value
console.info('Checkbox1 change is' + value) console.info('Checkbox1 change is' + value)
}) })
Text('启用过程人脸比对').fontColor('#333333').fontSize(16 * this.ratio) Text('启用人脸比对').fontColor('#333333').fontSize(16 * this.ratio)
TextInput({ text: this.param.rlls, controller: this.inputController }) TextInput({ text: this.param.rlls, controller: this.inputController })
.type(InputType.Normal) .type(InputType.Normal)
.borderRadius(0) .borderRadius(0)
@ -229,7 +229,7 @@ struct Index {
.onChange((value) => { .onChange((value) => {
this.param.rlls = value this.param.rlls = value
}) })
Text('拍照通道').fontColor('#333333').fontSize(16 * this.ratio) Text('过程拍照通道').fontColor('#333333').fontSize(16 * this.ratio)
TextInput({ text: this.param.pztd, controller: this.inputController }) TextInput({ text: this.param.pztd, controller: this.inputController })
.type(InputType.Normal) .type(InputType.Normal)
.borderRadius(0) .borderRadius(0)

View File

@ -178,7 +178,7 @@ export default struct FaceCompare {
async faceComparFn() { async faceComparFn() {
console.log('mmmmm0', 2) console.log('mmmmm0', 2)
this.param.pztd=this.param.rlls
const data=await takePhoto(this.param, this.context, 'jt/', 1,) const data=await takePhoto(this.param, this.context, 'jt/', 1,)
this.base64=this.imageBase64 + data.base64 this.base64=this.imageBase64 + data.base64
console.log('mmmmt',this.base64) console.log('mmmmt',this.base64)
@ -191,7 +191,6 @@ export default struct FaceCompare {
}) })
.then(res => { .then(res => {
console.log('mmmmm8', res) console.log('mmmmm8', res)
if (res) { if (res) {
this.controller.stop() this.controller.stop()
this.showFaceCompare = !this.showFaceCompare this.showFaceCompare = !this.showFaceCompare