Compare commits

..

No commits in common. "664a4a91c63cb48bd50399a24302d7d37798179f" and "a48ba68e5c697ae63b8c14c6154310b420a658be" have entirely different histories.

4 changed files with 23 additions and 22 deletions

BIN
entry/src/main.zip Normal file

Binary file not shown.

View File

@ -196,7 +196,6 @@ struct Index {
} }
async heartMsg() { async heartMsg() {
//心跳指令编号 //考试状态
const arr = [globalThis.signNum || 0, globalThis.statue || 1] const arr = [globalThis.signNum || 0, globalThis.statue || 1]
let tmpList = []; let tmpList = [];
tmpList.push(string2Bytes(arr[0], 1 * 8)[0]) tmpList.push(string2Bytes(arr[0], 1 * 8)[0])
@ -211,10 +210,10 @@ struct Index {
onPageShow() { onPageShow() {
this.loading = false this.loading = false
this.createAlbum()
this.userAuth(); this.userAuth();
//plc //plc
getUDP() getUDP()
//中心udp
getUDP2() getUDP2()
clearInterval(this.interval) clearInterval(this.interval)
this.interval=setInterval(() => { this.interval=setInterval(() => {
@ -224,8 +223,10 @@ struct Index {
}, 1000) }, 1000)
// 3s拍照 // 3s拍照
takePhotoFn(this.context) takePhotoFn(this.context)
//tcp差分转发如果差分通过udp转发可注释
//
getTCP() 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) { if (globalThis.singlePlay == undefined || globalThis.singlePlay == null) {
globalThis.singlePlay = false globalThis.singlePlay = false
@ -235,10 +236,10 @@ struct Index {
console.info('Index onPageShow'); console.info('Index onPageShow');
} }
//创建截图文件夹
async createAlbum() { async createAlbum() {
this.fileHelper = new FileHelper(); this.fileHelper = new FileHelper();
// this.fileHelper.createAlbum('jt') this.fileHelper.createAlbum('jt')
this.fileHelper.createAlbum('pz'); this.fileHelper.createAlbum('pz');
} }
@ -267,10 +268,7 @@ struct Index {
} }
async initParams() { async initParams() {
this.loading=false this.loading=false
//获取设备信息
this.createAlbum()
await getDeviceInfo() await getDeviceInfo()
//车辆信息
getCarInfo() getCarInfo()
await setCurrentTime(); await setCurrentTime();
this.carNum = globalThis.carInfo.plateNo; this.carNum = globalThis.carInfo.plateNo;

View File

@ -4,8 +4,8 @@ import ethernet from '@ohos.net.ethernet';
import prompt from '@ohos.prompt' import prompt from '@ohos.prompt'
import { upDateTableByArray} from '../common/service/initable' import { upDateTableByArray} from '../common/service/initable'
import { getSyncData} from '../common/service/initable' import { getSyncData} from '../common/service/initable'
// import { getUDP, getUDP2 } from '../common/utils/GlobleUdp'; import { getUDP, getUDP2 } from '../common/utils/GlobleUdp';
// import { getTCP } from '../common/utils/GlobleTcp'; import { getTCP } from '../common/utils/GlobleTcp';
@Entry @Entry
@Component @Component
struct Index { struct Index {
@ -102,7 +102,9 @@ struct Index {
}); });
} }
}); });
getUDP(true)
getUDP2(true)
getTCP(true)
}) })
} }
.backgroundColor('#CCC4B8') .backgroundColor('#CCC4B8')

View File

@ -62,16 +62,19 @@ struct UserInfo {
@State faceCatchImg: string = '' @State faceCatchImg: string = ''
async onPageShow() { async onPageShow() {
//语音功能 //语音功能
const systemParms:any = await getSyncData('MA_SYSTEMPARM')
console.log('systemParms',systemParms.length)
new WebRTCVoice(this.context); new WebRTCVoice(this.context);
//初始化数据 //初始化数据
this.initData() this.initData()
//身份证读卡器初始化 //身份证读卡器初始化
// this.openDeviceByIDCard() // this.openDeviceByIDCard()
// 如果是单机模式则模拟假数据 // 如果是单机模式则模拟假数据
//获取sysset表数据
this.initSysset() this.initSysset()
//心跳处理 // initJudgeUdp()
this.heartMsg() this.heartMsg()
} }
@ -182,7 +185,6 @@ struct UserInfo {
changeQkfn() { changeQkfn() {
this.qkFn() this.qkFn()
} }
//初始化数据
initData(){ initData(){
this.stepFlag = false this.stepFlag = false
this.faceCompareSucess = 0 this.faceCompareSucess = 0
@ -212,18 +214,15 @@ struct UserInfo {
if(val.id=='32'){ if(val.id=='32'){
globalThis.signNum=val.body[1] globalThis.signNum=val.body[1]
if(val.body[0]=='7'){ if(val.body[0]=='7'){
//缺考处理
this.getqkFn() this.getqkFn()
this.signNum=val.body[1] this.signNum=val.body[1]
} }
}else if(val.id=='42'){ }else if(val.id=='42'){
//收到中心缺考确认消息
console.log('qkfnqkfn',val.body[0]) console.log('qkfnqkfn',val.body[0])
this.qkFn() this.qkFn()
} }
}) })
} }
//考点端查询缺考指令内容消息请求
getqkFn() { getqkFn() {
let tmpList = []; let tmpList = [];
tmpList.push(string2Bytes(globalThis.signNum, 1 * 8)[0]) tmpList.push(string2Bytes(globalThis.signNum, 1 * 8)[0])
@ -237,6 +236,11 @@ struct UserInfo {
globalThis.udpClient2.sendMsg(param, this.context) globalThis.udpClient2.sendMsg(param, this.context)
} }
facePass() {
if (!this.stepFlag) {
this.sfbdinterfaceFn()
}
}
async initSysset() { async initSysset() {
const that = this; const that = this;
@ -283,11 +287,10 @@ struct UserInfo {
}) })
}) })
} }
//人脸比对窗口关闭
changeFaceCompareSuccess() { changeFaceCompareSuccess() {
console.log('this.faceCompareSuces', this.faceCompareSucess, JSON.stringify(this.currentUser)) console.log('this.faceCompareSuces', this.faceCompareSucess, JSON.stringify(this.currentUser))
if (this.faceCompareSucess > 0) { if (this.faceCompareSucess > 0) {
//人脸比对通过
this.sfbdinterfaceFn() this.sfbdinterfaceFn()
} }
} }
@ -307,7 +310,7 @@ struct UserInfo {
this.pageIndex--; this.pageIndex--;
this.dataList = this.list.slice(this.pageIndex * 4, this.pageIndex * 4 + 4) this.dataList = this.list.slice(this.pageIndex * 4, this.pageIndex * 4 + 4)
} }
//获取下载考生
getExaminationStudentInfoFn() { getExaminationStudentInfoFn() {
if (globalThis.singlePlay) { if (globalThis.singlePlay) {
return return
@ -360,7 +363,6 @@ struct UserInfo {
console.log('error12error' + error) console.log('error12error' + error)
}) })
} }
//缺考
qkFn() { qkFn() {
this.faceCompareSucess = 0 this.faceCompareSucess = 0
if (globalThis.singlePlay) { if (globalThis.singlePlay) {
@ -397,7 +399,6 @@ struct UserInfo {
}) })
} }
// 获取考试项目
async getExaminationItemFn(){ async getExaminationItemFn(){
console.info('surenjun', this.currentUser.lsh) console.info('surenjun', this.currentUser.lsh)
if(!this.currentUser.lsh||globalThis.singlePlay){ if(!this.currentUser.lsh||globalThis.singlePlay){