Compare commits
5 Commits
a9cdc3c552
...
d461cca1c4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d461cca1c4 | ||
|
|
a8bf95df5f | ||
|
|
0f564b746a | ||
|
|
dee00b45cf | ||
|
|
5a8b3d314f |
@ -2,6 +2,11 @@
|
|||||||
"apiType": 'stageMode',
|
"apiType": 'stageMode',
|
||||||
"buildOption": {
|
"buildOption": {
|
||||||
"externalNativeOptions": {
|
"externalNativeOptions": {
|
||||||
|
"abiFilters": [
|
||||||
|
"arm64-v8a",
|
||||||
|
"armeabi-v7a",
|
||||||
|
"x86_64"
|
||||||
|
],
|
||||||
"path": "./src/main/cpp/CMakeLists.txt",
|
"path": "./src/main/cpp/CMakeLists.txt",
|
||||||
"arguments": "",
|
"arguments": "",
|
||||||
"cppFlags": "",
|
"cppFlags": "",
|
||||||
@ -16,5 +21,5 @@
|
|||||||
{
|
{
|
||||||
"name": "ohosTest",
|
"name": "ohosTest",
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
}
|
}
|
||||||
@ -1,6 +1,12 @@
|
|||||||
import request from '../utils/Request'
|
import request from '../utils/Request'
|
||||||
import http from '@ohos.net.http'
|
import http from '@ohos.net.http'
|
||||||
import { FaceCompareResp, GetExaminationItemRsp, GetExaminationStudentInfoResponse } from '../model'
|
import {
|
||||||
|
ApiResponseType,
|
||||||
|
ExaminationStuAbsentParams,
|
||||||
|
FaceCompareResp,
|
||||||
|
GetExaminationItemRsp,
|
||||||
|
GetExaminationStudentInfoResponse
|
||||||
|
} from '../model'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 照片比对
|
* 照片比对
|
||||||
@ -49,10 +55,19 @@ export async function getExaminationStudentInfo(params: ESObject) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//缺考
|
//缺考
|
||||||
export async function examinationStuAbsent(params: object) {
|
export async function examinationStuAbsent(params: ExaminationStuAbsentParams) {
|
||||||
return request({
|
return request<ApiResponseType>({
|
||||||
url: '/der2/services/exam/examinationStuAbsent.ws',
|
url: '/der2/services/exam/examinationStuAbsent.ws',
|
||||||
data: params,
|
data: `<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<examinationStuAbsentReq>
|
||||||
|
<body>
|
||||||
|
<carId>${params.carId}</carId>
|
||||||
|
<cardNo>${params.sfzmhm}</cardNo>
|
||||||
|
<examinationRoomId>${params.examinationRoomId}</examinationRoomId>
|
||||||
|
<examinerName>${params.username}</examinerName>
|
||||||
|
<lsh>${params.lsh}</lsh>
|
||||||
|
</body>
|
||||||
|
</examinationStuAbsentReq>`,
|
||||||
method: http.RequestMethod.POST,
|
method: http.RequestMethod.POST,
|
||||||
xml: true
|
xml: true
|
||||||
})
|
})
|
||||||
|
|||||||
@ -3,4 +3,7 @@ export const DbTag = '[DBTag]';
|
|||||||
export const SerialPortTag = '[SerialPortTag]';
|
export const SerialPortTag = '[SerialPortTag]';
|
||||||
|
|
||||||
// usb tag
|
// usb tag
|
||||||
export const UsbTag = '[UsbTag]';
|
export const UsbTag = '[UsbTag]';
|
||||||
|
|
||||||
|
//voice tag
|
||||||
|
export const VoiceTag = '[VoiceTag]';
|
||||||
@ -94,38 +94,70 @@ export const StackValueData = {
|
|||||||
29: "",
|
29: "",
|
||||||
}
|
}
|
||||||
|
|
||||||
export const WarnFlagTipData = {
|
// export const WarnFlagTipData = {
|
||||||
0: [],
|
// 0: [],
|
||||||
1: [],
|
// 1: [],
|
||||||
2: [],
|
// 2: [],
|
||||||
3: ['check1.wav', 'check2.wav'],
|
// 3: ['check1.wav', 'check2.wav'],
|
||||||
4: ['check3.wav', 'check4.wav'],
|
// 4: ['check3.wav', 'check4.wav'],
|
||||||
5: ['check5.wav', 'check6.wav'],
|
// 5: ['check5.wav', 'check6.wav'],
|
||||||
6: ['check7.wav', 'check8.wav'],
|
// 6: ['check7.wav', 'check8.wav'],
|
||||||
7: ['check9.wav', 'check10.wav'],
|
// 7: ['check9.wav', 'check10.wav'],
|
||||||
8: ['check26.wav', 'check27.wav'],
|
// 8: ['check26.wav', 'check27.wav'],
|
||||||
9: ['dianhuoVideo.wav', 'xihuoVideo.wav'],
|
// 9: ['dianhuoVideo.wav', 'xihuoVideo.wav'],
|
||||||
10: ['check31.wav'],
|
// 10: ['check31.wav'],
|
||||||
11: ['check30.wav'],
|
// 11: ['check30.wav'],
|
||||||
12: ['check28.wav'],
|
// 12: ['check28.wav'],
|
||||||
13: ['check29.wav'],
|
// 13: ['check29.wav'],
|
||||||
14: ['check11.wav'],
|
// 14: ['check11.wav'],
|
||||||
15: ['check12.wav'],
|
// 15: ['check12.wav'],
|
||||||
16: ['check13.wav'],
|
// 16: ['check13.wav'],
|
||||||
17: ['check14.wav'],
|
// 17: ['check14.wav'],
|
||||||
18: ['check15.wav'],
|
// 18: ['check15.wav'],
|
||||||
19: ['check16.wav'],
|
// 19: ['check16.wav'],
|
||||||
20: ['check17.wav'],
|
// 20: ['check17.wav'],
|
||||||
21: ['check18.wav'],
|
// 21: ['check18.wav'],
|
||||||
22: ['check19.wav'],
|
// 22: ['check19.wav'],
|
||||||
23: ['check22.wav'],
|
// 23: ['check22.wav'],
|
||||||
24: ['check23.wav'],
|
// 24: ['check23.wav'],
|
||||||
25: ['check20.wav', 'check21.wav'],
|
// 25: ['check20.wav', 'check21.wav'],
|
||||||
26: ['check24.wav'],
|
// 26: ['check24.wav'],
|
||||||
// 27:[],
|
// // 27:[],
|
||||||
// 28:[],
|
// // 28:[],
|
||||||
// 29:[],
|
// // 29:[],
|
||||||
}
|
// }
|
||||||
|
export const WarnFlagTipData = new Map<number, string[]>([
|
||||||
|
[0, []],
|
||||||
|
[1, []],
|
||||||
|
[2, []],
|
||||||
|
[3, ['check1.wav', 'check2.wav']],
|
||||||
|
[4, ['check3.wav', 'check4.wav']],
|
||||||
|
[5, ['check5.wav', 'check6.wav']],
|
||||||
|
[6, ['check7.wav', 'check8.wav']],
|
||||||
|
[7, ['check9.wav', 'check10.wav']],
|
||||||
|
[8, ['check26.wav', 'check27.wav']],
|
||||||
|
[9, ['dianhuoVideo.wav', 'xihuoVideo.wav']],
|
||||||
|
[10, ['check31.wav']],
|
||||||
|
[11, ['check30.wav']],
|
||||||
|
[12, ['check28.wav']],
|
||||||
|
[13, ['check29.wav']],
|
||||||
|
[14, ['check11.wav']],
|
||||||
|
[15, ['check12.wav']],
|
||||||
|
[16, ['check13.wav']],
|
||||||
|
[17, ['check14.wav']],
|
||||||
|
[18, ['check15.wav']],
|
||||||
|
[19, ['check16.wav']],
|
||||||
|
[20, ['check17.wav']],
|
||||||
|
[21, ['check18.wav']],
|
||||||
|
[22, ['check19.wav']],
|
||||||
|
[23, ['check22.wav']],
|
||||||
|
[24, ['check23.wav']],
|
||||||
|
[25, ['check20.wav', 'check21.wav']],
|
||||||
|
[26, ['check24.wav']],
|
||||||
|
// 27:[],
|
||||||
|
// 28:[],
|
||||||
|
// 29:[],
|
||||||
|
]);
|
||||||
|
|
||||||
export const RealNumData = {
|
export const RealNumData = {
|
||||||
3: 19,
|
3: 19,
|
||||||
@ -154,7 +186,7 @@ export const RealNumData = {
|
|||||||
26: ''
|
26: ''
|
||||||
}
|
}
|
||||||
|
|
||||||
export const DwMapData={
|
export const DwMapData = {
|
||||||
14: '1',
|
14: '1',
|
||||||
15: '2',
|
15: '2',
|
||||||
16: '3',
|
16: '3',
|
||||||
|
|||||||
@ -98,6 +98,7 @@ export interface RouteParamsType {
|
|||||||
wayno?: string;
|
wayno?: string;
|
||||||
kString?: string;
|
kString?: string;
|
||||||
examItems?: string;
|
examItems?: string;
|
||||||
|
fromIndex?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 车辆信息
|
// 车辆信息
|
||||||
|
|||||||
@ -11,6 +11,13 @@ export interface ApiResponseType {
|
|||||||
|
|
||||||
// 时间同步 /der2/services/exam/timeSynchronization.ws
|
// 时间同步 /der2/services/exam/timeSynchronization.ws
|
||||||
timeSynchronizationRsp?: TimeSynchronizationRsp;
|
timeSynchronizationRsp?: TimeSynchronizationRsp;
|
||||||
|
|
||||||
|
// 缺考
|
||||||
|
examinationStuAbsentRsp?: ExaminationStuAbsentRsp
|
||||||
|
}
|
||||||
|
|
||||||
|
interface ExaminationStuAbsentRsp {
|
||||||
|
head: Head
|
||||||
}
|
}
|
||||||
|
|
||||||
interface TimeSynchronizationRsp {
|
interface TimeSynchronizationRsp {
|
||||||
@ -163,7 +170,6 @@ export interface BeginExamRequest {
|
|||||||
code?: number
|
code?: number
|
||||||
}
|
}
|
||||||
|
|
||||||
// { getExaminationItemRsp: { body: { ykxx: '' } } }
|
|
||||||
export interface GetExaminationItemRsp {
|
export interface GetExaminationItemRsp {
|
||||||
getExaminationItemRsp: GetExaminationItemRspDetails
|
getExaminationItemRsp: GetExaminationItemRspDetails
|
||||||
}
|
}
|
||||||
@ -175,6 +181,14 @@ interface GetExaminationItemRspDetails {
|
|||||||
|
|
||||||
interface GetExaminationItemRspBody {
|
interface GetExaminationItemRspBody {
|
||||||
ykxx: string;
|
ykxx: string;
|
||||||
|
kssycs?: string | number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface ExaminationStuAbsentParams {
|
||||||
|
carId: string;
|
||||||
|
sfzmhm: string;
|
||||||
|
examinationRoomId: string;
|
||||||
|
username: string;
|
||||||
|
lsh: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,14 +1,14 @@
|
|||||||
import { voiceService } from '../service/voiceService';
|
|
||||||
import router from '@ohos.router';
|
import router from '@ohos.router';
|
||||||
import { carConfigurationInfo, uploadExamCarCheckResult } from '../api/checkCar';
|
import { carConfigurationInfo, uploadExamCarCheckResult } from '../api/checkCar';
|
||||||
import TopLogo from './compontents/TopLogo';
|
import TopLogo from './compontents/TopLogo';
|
||||||
import testNapi from '@ohos.hiserialsdk';
|
import testNapi from '@ohos.hiserialsdk';
|
||||||
import { dateFormat } from '../common/utils/tools';
|
import { dateFormat } from '../common/utils/tools';
|
||||||
import { DwMapData, PassData, RealNumData, StackValueData, WarnFlagData, WarnFlagTipData } from '../mock';
|
import { DwMapData, PassData, RealNumData, StackValueData, WarnFlagData, WarnFlagTipData } from '../mock';
|
||||||
import { BaseInfoType } from '../model/Common';
|
import { BaseInfoType, RouteParamsType } from '../model/Common';
|
||||||
import { CarCheckDataType, CarConfigurationParams, CarInfoType } from '../model';
|
import { CarCheckDataType, CarConfigurationParams, CarInfoType } from '../model';
|
||||||
import { BusinessError } from '@ohos.base';
|
import { BusinessError } from '@ohos.base';
|
||||||
import { SpzdType } from '../model';
|
import { SpzdType } from '../model';
|
||||||
|
import { voiceService } from '../utils/Voice';
|
||||||
|
|
||||||
@Entry
|
@Entry
|
||||||
@Component
|
@Component
|
||||||
@ -33,7 +33,7 @@ struct Index {
|
|||||||
@State @Watch('outClick') outFlag: boolean = false;
|
@State @Watch('outClick') outFlag: boolean = false;
|
||||||
@State passArray: object = PassData
|
@State passArray: object = PassData
|
||||||
@State stachValue: object = StackValueData
|
@State stachValue: object = StackValueData
|
||||||
@State warnFlagTip: object = WarnFlagTipData
|
@State warnFlagTip: Map<number, string[]> = WarnFlagTipData
|
||||||
@State realNum: object = RealNumData
|
@State realNum: object = RealNumData
|
||||||
@State dwMap: object = DwMapData
|
@State dwMap: object = DwMapData
|
||||||
@State fd: number = -1;
|
@State fd: number = -1;
|
||||||
@ -41,7 +41,7 @@ struct Index {
|
|||||||
@State stopFlag: boolean = false
|
@State stopFlag: boolean = false
|
||||||
@State fromIndex: boolean = false
|
@State fromIndex: boolean = false
|
||||||
@State carInfo: CarInfoType = {}
|
@State carInfo: CarInfoType = {}
|
||||||
private vocObj: ESObject;
|
private vocObj: voiceService;
|
||||||
|
|
||||||
// private AccountTable = new AccountTable(()=>{},CommonConstants);
|
// private AccountTable = new AccountTable(()=>{},CommonConstants);
|
||||||
aboutToAppear() {
|
aboutToAppear() {
|
||||||
@ -62,7 +62,7 @@ struct Index {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
let routParam: ESObject = router.getParams();
|
let routParam: RouteParamsType = router.getParams() as RouteParamsType;
|
||||||
this.fromIndex = routParam?.fromIndex || false
|
this.fromIndex = routParam?.fromIndex || false
|
||||||
this.carConfigurationInfoFn()
|
this.carConfigurationInfoFn()
|
||||||
|
|
||||||
@ -345,21 +345,23 @@ struct Index {
|
|||||||
this.passArray[this.index] = true
|
this.passArray[this.index] = true
|
||||||
this.passArray = JSON.parse(JSON.stringify(this.passArray))
|
this.passArray = JSON.parse(JSON.stringify(this.passArray))
|
||||||
this.subFlag = true
|
this.subFlag = true
|
||||||
|
let name: string = this.warnFlagTip[this.index][0]
|
||||||
if (this.warnFlagTip[this.index].length == 1) {
|
if (this.warnFlagTip[this.index].length == 1) {
|
||||||
this.vocObj.playAudio({
|
this.vocObj.playAudio({
|
||||||
type: 1,
|
type: 1,
|
||||||
name: this.warnFlagTip[this.index][0],
|
name,
|
||||||
})
|
})
|
||||||
} else if (this.warnFlagTip[this.index].length == 2) {
|
} else if (this.warnFlagTip[this.index].length == 2) {
|
||||||
if (this.signArr[this.realNum[this.index]] && this.signArr[this.realNum[this.index]] != '0') {
|
if (this.signArr[this.realNum[this.index]] && this.signArr[this.realNum[this.index]] != '0') {
|
||||||
|
name = this.warnFlagTip[this.index][1]
|
||||||
this.vocObj.playAudio({
|
this.vocObj.playAudio({
|
||||||
type: 1,
|
type: 1,
|
||||||
name: this.warnFlagTip[this.index][1],
|
name,
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
this.vocObj.playAudio({
|
this.vocObj.playAudio({
|
||||||
type: 1,
|
type: 1,
|
||||||
name: this.warnFlagTip[this.index][0],
|
name,
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,7 +12,6 @@ import { setliushuiNum, takePhotoFn } from '../common/service/indexService';
|
|||||||
import promptAction from '@ohos.promptAction';
|
import promptAction from '@ohos.promptAction';
|
||||||
import errorMsgDialog from './compontents/errorMsgDialog';
|
import errorMsgDialog from './compontents/errorMsgDialog';
|
||||||
import GetDistance from '../common/utils/GetDistance';
|
import GetDistance from '../common/utils/GetDistance';
|
||||||
import { delPic } from '../service/videoService';
|
|
||||||
import imageBtn from './compontents/imageBtn';
|
import imageBtn from './compontents/imageBtn';
|
||||||
import VoiceAnnounce from './judgeSDK/utils/voiceAnnouncements';
|
import VoiceAnnounce from './judgeSDK/utils/voiceAnnouncements';
|
||||||
import { BaseInfoType } from '../model/Common';
|
import { BaseInfoType } from '../model/Common';
|
||||||
@ -21,6 +20,7 @@ import { InitializeTheCentralTableType, MASYSSETTableType, TimeInfo } from '../m
|
|||||||
import { GetCarInfo, GetDeviceInfo, SetCurrentTime, UseAuth } from './Index/utils';
|
import { GetCarInfo, GetDeviceInfo, SetCurrentTime, UseAuth } from './Index/utils';
|
||||||
import { GetSyncData, InitializeTheCentralTable } from '../utils/table/Operation';
|
import { GetSyncData, InitializeTheCentralTable } from '../utils/table/Operation';
|
||||||
import { BusinessError } from '@ohos.base';
|
import { BusinessError } from '@ohos.base';
|
||||||
|
import { delPic } from '../utils/Video';
|
||||||
|
|
||||||
|
|
||||||
@Entry
|
@Entry
|
||||||
@ -465,7 +465,7 @@ struct Index {
|
|||||||
// setVideoParam()
|
// setVideoParam()
|
||||||
console.log('diyidiy')
|
console.log('diyidiy')
|
||||||
this.context.resourceManager.getRawFileContent("welcome.wav")
|
this.context.resourceManager.getRawFileContent("welcome.wav")
|
||||||
.then(value => {
|
.then(() => {
|
||||||
this.avPlayer.playAudio(['welcome.wav'])
|
this.avPlayer.playAudio(['welcome.wav'])
|
||||||
|
|
||||||
// this.vocObj.playAudio({
|
// this.vocObj.playAudio({
|
||||||
|
|||||||
@ -24,7 +24,7 @@ import {
|
|||||||
SYSTEMPARMARR
|
SYSTEMPARMARR
|
||||||
} from './judgeSDK/api/judgeSDK.d';
|
} from './judgeSDK/api/judgeSDK.d';
|
||||||
|
|
||||||
import { chunkArr, formatTime, getCurrentHourTime, getCurrentTime } from '../common/utils/tools';
|
import { chunkArr, getCurrentTime } from '../common/utils/tools';
|
||||||
import { getSyncData } from '../common/service/initable';
|
import { getSyncData } from '../common/service/initable';
|
||||||
import { judgeConfig } from './judgeSDK/utils/judgeConfig';
|
import { judgeConfig } from './judgeSDK/utils/judgeConfig';
|
||||||
import FileUtil from '../common/utils/File';
|
import FileUtil from '../common/utils/File';
|
||||||
@ -222,8 +222,8 @@ struct Index {
|
|||||||
IPADDR: '',
|
IPADDR: '',
|
||||||
CARCLASS: decodeURI(carInfo.carclass),
|
CARCLASS: decodeURI(carInfo.carclass),
|
||||||
KSCX: carInfo.kscx,
|
KSCX: carInfo.kscx,
|
||||||
// TODO 确定一下是否有这个字段,表定义中没有
|
// CARNAME: decodeURI(carInfo.carname),
|
||||||
CARNAME: decodeURI(carInfo.carname),
|
CARNAME: "",
|
||||||
FLAG: carInfo.flag,
|
FLAG: carInfo.flag,
|
||||||
BK1: carInfo.bk1,
|
BK1: carInfo.bk1,
|
||||||
BK2: carInfo.bk2,
|
BK2: carInfo.bk2,
|
||||||
@ -238,7 +238,7 @@ struct Index {
|
|||||||
// const { xm, sfzmhm, lsh, kszp, ksdd, kssycs, kslx, ksxl, xldm } = stuInfo;
|
// const { xm, sfzmhm, lsh, kszp, ksdd, kssycs, kslx, ksxl, xldm } = stuInfo;
|
||||||
this.name = stuInfo.xm || '测试考生';
|
this.name = stuInfo.xm || '测试考生';
|
||||||
this.idCard = stuInfo.sfzmhm || '01234567891010';
|
this.idCard = stuInfo.sfzmhm || '01234567891010';
|
||||||
this.lsh = this.singlePlay ? '0000000000000' : lsh;
|
this.lsh = this.singlePlay ? '0000000000000' : stuInfo.lsh;
|
||||||
this.kszp = stuInfo.kszp;
|
this.kszp = stuInfo.kszp;
|
||||||
this.ksdd = stuInfo.ksdd;
|
this.ksdd = stuInfo.ksdd;
|
||||||
this.kssycs = stuInfo.kssycs;
|
this.kssycs = stuInfo.kssycs;
|
||||||
@ -250,7 +250,7 @@ struct Index {
|
|||||||
|
|
||||||
// 获取扣分代码信息
|
// 获取扣分代码信息
|
||||||
async initMarkRules(markRules ?: MarkRule[]) {
|
async initMarkRules(markRules ?: MarkRule[]) {
|
||||||
const markRuleParams = markRules || (await GetSyncData<MA_MARKRULEType>('MA_MARKRULE')
|
const markRuleParams = markRules || (await GetSyncData<MA_MARKRULEType>('MA_MARKRULE'))
|
||||||
|
|
||||||
markRuleParams.forEach(mark => {
|
markRuleParams.forEach(mark => {
|
||||||
const tempObj = {
|
const tempObj = {
|
||||||
@ -692,7 +692,7 @@ struct Index {
|
|||||||
Text(this.startTime).fontColor('#FFF').fontSize(this.FONTSIZE)
|
Text(this.startTime).fontColor('#FFF').fontSize(this.FONTSIZE)
|
||||||
}.margin({ bottom: 10 })
|
}.margin({ bottom: 10 })
|
||||||
|
|
||||||
if (this.examSubject == 3) {
|
if (this.examSubject == "3") {
|
||||||
Row() {
|
Row() {
|
||||||
Text('考试路线:').fontColor('#E5CCA1').fontSize(this.FONTSIZE)
|
Text('考试路线:').fontColor('#E5CCA1').fontSize(this.FONTSIZE)
|
||||||
Text(`线路${this.wayno || 3}`).fontColor('#FFAD33').fontSize(this.FONTSIZE)
|
Text(`线路${this.wayno || 3}`).fontColor('#FFAD33').fontSize(this.FONTSIZE)
|
||||||
|
|||||||
@ -61,7 +61,6 @@ struct Index {
|
|||||||
.linearGradient({
|
.linearGradient({
|
||||||
angle: 0,
|
angle: 0,
|
||||||
colors: [[0x403C36, 0.0], [0x4D473D, 0.34], [0x3D3A34, 1.0]]
|
colors: [[0x403C36, 0.0], [0x4D473D, 0.34], [0x3D3A34, 1.0]]
|
||||||
|
|
||||||
})
|
})
|
||||||
.onChange((value: string) => {
|
.onChange((value: string) => {
|
||||||
this.inputTextList1[index] = value
|
this.inputTextList1[index] = value
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import { examinationStuAbsent, getExaminationItem, getExaminationStudentInfo } f
|
|||||||
import router from '@ohos.router';
|
import router from '@ohos.router';
|
||||||
import TopLogo from './compontents/TopLogo';
|
import TopLogo from './compontents/TopLogo';
|
||||||
import Md5 from '../common/utils/md5';
|
import Md5 from '../common/utils/md5';
|
||||||
import { dateFormat, getCurrentHourTime, getCurrentTime, string2Bytes } from '../common/utils/tools';
|
import { dateFormat, getCurrentTime, string2Bytes } from '../common/utils/tools';
|
||||||
import FaceCompare from './compontents/FaceCompare';
|
import FaceCompare from './compontents/FaceCompare';
|
||||||
import { writeObjectOut } from '../api/judge';
|
import { writeObjectOut } from '../api/judge';
|
||||||
import testNapi from '@ohos.idcard';
|
import testNapi from '@ohos.idcard';
|
||||||
@ -25,6 +25,7 @@ import {
|
|||||||
BeginExamRequest,
|
BeginExamRequest,
|
||||||
CarInfoType,
|
CarInfoType,
|
||||||
DrvexamType,
|
DrvexamType,
|
||||||
|
ExaminationStuAbsentParams,
|
||||||
ExaminerLoginInfo,
|
ExaminerLoginInfo,
|
||||||
GetExaminationItemRsp,
|
GetExaminationItemRsp,
|
||||||
IdCard,
|
IdCard,
|
||||||
@ -35,6 +36,7 @@ import {
|
|||||||
RouteParamsType,
|
RouteParamsType,
|
||||||
SckType,
|
SckType,
|
||||||
SystemParamType,
|
SystemParamType,
|
||||||
|
UDPParamType,
|
||||||
User
|
User
|
||||||
} from '../model';
|
} from '../model';
|
||||||
import { BusinessError } from '@ohos.base';
|
import { BusinessError } from '@ohos.base';
|
||||||
@ -190,7 +192,7 @@ struct UserInfo {
|
|||||||
if (this.singlePlay) {
|
if (this.singlePlay) {
|
||||||
return ''
|
return ''
|
||||||
} else {
|
} else {
|
||||||
const photoBase64 = await this.filePhoto.getPhoto();
|
const photoBase64: string = await this.filePhoto.getPhoto();
|
||||||
return photoBase64
|
return photoBase64
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -788,17 +790,22 @@ struct UserInfo {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
console.log('JsonJson', JSON.stringify(this.currentUser))
|
console.log('JsonJson', JSON.stringify(this.currentUser))
|
||||||
const param =
|
const param: ExaminationStuAbsentParams = {
|
||||||
`<?xml version="1.0" encoding="UTF-8" ?><examinationStuAbsentReq><body><carId>${this.carInfo.carId}</carId><cardNo>${this.currentUser.sfzmhm}</cardNo><examinationRoomId>${this.carInfo.examinationRoomId}</examinationRoomId><examinerName>${this.examinerLoginInfo.username}</examinerName><lsh>${this.lsh}</lsh></body></examinationStuAbsentReq>`
|
carId: this.carInfo.carId,
|
||||||
|
sfzmhm: this.currentUser.sfzmhm,
|
||||||
|
examinationRoomId: this.carInfo.examinationRoomId,
|
||||||
|
username: this.examinerLoginInfo.username,
|
||||||
|
lsh: this.lsh
|
||||||
|
}
|
||||||
console.log('carNo1111', param)
|
console.log('carNo1111', param)
|
||||||
|
|
||||||
examinationStuAbsent(param).then(res => {
|
examinationStuAbsent(param).then(res => {
|
||||||
const arr = [this.signNum || 0, 1]
|
const arr = [this.signNum || 0, 1]
|
||||||
let tmpList = [];
|
let tmpList: number[] = [];
|
||||||
tmpList.push(string2Bytes(arr[0], 1 * 8)[0])
|
tmpList.push(string2Bytes(arr[0], 1 * 8)[0])
|
||||||
tmpList.push(string2Bytes(arr[1], 1 * 8)[0])
|
tmpList.push(string2Bytes(arr[1], 1 * 8)[0])
|
||||||
|
|
||||||
const param = {
|
const param: UDPParamType = {
|
||||||
id: 43,
|
id: 43,
|
||||||
list: tmpList,
|
list: tmpList,
|
||||||
carNo: this.carInfo.carNo,
|
carNo: this.carInfo.carNo,
|
||||||
@ -843,7 +850,12 @@ struct UserInfo {
|
|||||||
async sfbdinterfaceFn() {
|
async sfbdinterfaceFn() {
|
||||||
AppStorage.setOrCreate('statue', 4)
|
AppStorage.setOrCreate('statue', 4)
|
||||||
this.stepFlag = true
|
this.stepFlag = true
|
||||||
let examItems: GetExaminationItemRsp = { getExaminationItemRsp: { body: { ykxx: '' } } };
|
let examItems: GetExaminationItemRsp = {
|
||||||
|
getExaminationItemRsp:
|
||||||
|
{
|
||||||
|
body: { ykxx: '' }
|
||||||
|
}
|
||||||
|
};
|
||||||
if (!this.singlePlay) {
|
if (!this.singlePlay) {
|
||||||
//获取已考项目
|
//获取已考项目
|
||||||
examItems = await getExaminationItem({
|
examItems = await getExaminationItem({
|
||||||
|
|||||||
@ -2,10 +2,10 @@ import TopLogo from './compontents/topLogo';
|
|||||||
import FileUtil from '../common/utils/File';
|
import FileUtil from '../common/utils/File';
|
||||||
import common from '@ohos.app.ability.common';
|
import common from '@ohos.app.ability.common';
|
||||||
import promptAction from '@ohos.promptAction';
|
import promptAction from '@ohos.promptAction';
|
||||||
import { endRecordVideo, startRecordVideo, takePhoto } from '../service/videoService';
|
|
||||||
import { GlobalConfig } from '../config/index';
|
import { GlobalConfig } from '../config/index';
|
||||||
import { VideoConfigData } from '../mock';
|
import { VideoConfigData } from '../mock';
|
||||||
import { CommonType, RecordHandleType, VideoConfig, VideoItemType } from '../model';
|
import { CommonType, RecordHandleType, VideoConfig, VideoItemType } from '../model';
|
||||||
|
import { endRecordVideo, startRecordVideo, takePhoto } from '../utils/Video';
|
||||||
|
|
||||||
@Entry
|
@Entry
|
||||||
@Component
|
@Component
|
||||||
@ -583,7 +583,7 @@ struct Index {
|
|||||||
}
|
}
|
||||||
|
|
||||||
aboutToAppear() {
|
aboutToAppear() {
|
||||||
const radio=AppStorage.get('ratio') as number
|
const radio = AppStorage.get('ratio') as number
|
||||||
this.ratio = radio
|
this.ratio = radio
|
||||||
this.openFlag = true
|
this.openFlag = true
|
||||||
const fileUtil = new FileUtil(this.context)
|
const fileUtil = new FileUtil(this.context)
|
||||||
@ -709,7 +709,6 @@ struct Index {
|
|||||||
async writeConfig() {
|
async writeConfig() {
|
||||||
this.oldParam = JSON.parse(JSON.stringify(this.param))
|
this.oldParam = JSON.parse(JSON.stringify(this.param))
|
||||||
this.videoArr = JSON.parse(JSON.stringify(this.videoArr))
|
this.videoArr = JSON.parse(JSON.stringify(this.videoArr))
|
||||||
console.log('kkkk', JSON.stringify(this.param))
|
|
||||||
const folderPath = await this.fileUtil.initFolder(`/config`);
|
const folderPath = await this.fileUtil.initFolder(`/config`);
|
||||||
this.fileUtil.addFile(`${folderPath}/config3.txt`, JSON.stringify(this.param), 'overWrite')
|
this.fileUtil.addFile(`${folderPath}/config3.txt`, JSON.stringify(this.param), 'overWrite')
|
||||||
this.showFlag = false
|
this.showFlag = false
|
||||||
|
|||||||
@ -64,21 +64,20 @@ export default struct DeductedPopup {
|
|||||||
fontColor: '#FFF',
|
fontColor: '#FFF',
|
||||||
bgColor: '#B36E00'
|
bgColor: '#B36E00'
|
||||||
}
|
}
|
||||||
|
private context = getContext(this) as common.UIAbilityContext;
|
||||||
|
private judgeTask: JudgeTask
|
||||||
|
private filePhoto: FilePhoto
|
||||||
// 过程照片拍照
|
// 过程照片拍照
|
||||||
getPhoto = async (empty?: boolean) => {
|
getPhoto = async (empty?: boolean) => {
|
||||||
//单机模式返回空照片
|
//单机模式返回空照片
|
||||||
if (this.singlePlay) {
|
if (this.singlePlay) {
|
||||||
return ''
|
return ''
|
||||||
} else {
|
} else {
|
||||||
const { filePhoto } = this;
|
const photoBase64: string = await this.filePhoto.getPhoto();
|
||||||
const photoBase64 = await filePhoto.getPhoto();
|
|
||||||
return photoBase64
|
return photoBase64
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private context = getContext(this) as common.UIAbilityContext;
|
private avPlayer: VoiceAnnounce
|
||||||
private judgeTask: JudgeTask
|
|
||||||
private filePhoto: FilePhoto
|
|
||||||
private avPlayer
|
|
||||||
|
|
||||||
async aboutToAppear() {
|
async aboutToAppear() {
|
||||||
this.carInfo = AppStorage.get('carInfo')
|
this.carInfo = AppStorage.get('carInfo')
|
||||||
@ -89,8 +88,8 @@ export default struct DeductedPopup {
|
|||||||
this.filePhoto = mediaTest
|
this.filePhoto = mediaTest
|
||||||
//上车准备
|
//上车准备
|
||||||
// this.universalMarkRules = this.markRules.filter(item => this.currentItems.includes(item.itemno+''))
|
// this.universalMarkRules = this.markRules.filter(item => this.currentItems.includes(item.itemno+''))
|
||||||
const { isTrajectoryOpen } = judgeConfig;
|
// const { isTrajectoryOpen } = judgeConfig;
|
||||||
if (isTrajectoryOpen) {
|
if (judgeConfig.isTrajectoryOpen) {
|
||||||
await this.initDb()
|
await this.initDb()
|
||||||
} else {
|
} else {
|
||||||
await this.initSysset()
|
await this.initSysset()
|
||||||
@ -109,16 +108,19 @@ export default struct DeductedPopup {
|
|||||||
|
|
||||||
//本地数据初始化
|
//本地数据初始化
|
||||||
async initDb() {
|
async initDb() {
|
||||||
const { isTrajectoryOpen, trajectoryPath } = judgeConfig
|
// const { isTrajectoryOpen, trajectoryPath } = judgeConfig
|
||||||
const examSubject = this.carInfo.examSubject;
|
const examSubject = this.carInfo.examSubject;
|
||||||
//轨迹回放读取 systemparam表、markrule表
|
//轨迹回放读取 systemparam表、markrule表
|
||||||
const fileUtil = new FileUtil(this.context);
|
const fileUtil = new FileUtil(this.context);
|
||||||
const folderPath = await fileUtil.initFolder(trajectoryPath);
|
const folderPath = await fileUtil.initFolder(judgeConfig.trajectoryPath);
|
||||||
const str = await fileUtil.readFile(folderPath);
|
const str = await fileUtil.readFile(folderPath);
|
||||||
const strArr = str.split('\n');
|
const strArr = str.split('\n');
|
||||||
const [initData, beginData] = [strArr[0], strArr[1]];
|
// const [initData, beginData] = [strArr[0], strArr[1]];
|
||||||
const initDataObj = JSON.parse(initData);
|
const initData = strArr[0];
|
||||||
this.examSubject = isTrajectoryOpen ? (initDataObj.kskm * 1) : examSubject;
|
const beginData = strArr[1];
|
||||||
|
// TODO 补全类型
|
||||||
|
const initDataObj: ESObject = JSON.parse(initData);
|
||||||
|
this.examSubject = Number(judgeConfig.isTrajectoryOpen ? (initDataObj.kskm * 1) : examSubject);
|
||||||
await this.initMarkRules(initDataObj.mark);
|
await this.initMarkRules(initDataObj.mark);
|
||||||
await this.initSysset(initDataObj.sysset);
|
await this.initSysset(initDataObj.sysset);
|
||||||
await this.initStudent()
|
await this.initStudent()
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
import media from '@ohos.multimedia.media';
|
import media from '@ohos.multimedia.media';
|
||||||
import { BusinessError } from '@ohos.base';
|
import { BusinessError } from '@ohos.base';
|
||||||
|
import common from '@ohos.app.ability.common';
|
||||||
|
import { VoiceTag } from '../config';
|
||||||
|
|
||||||
type AVPlayerCallback = (status: string, val?: string) => void;
|
type AVPlayerCallback = (status: string, val?: string) => void;
|
||||||
|
|
||||||
@ -10,7 +12,8 @@ export class voiceService {
|
|||||||
private playerName: string = '';
|
private playerName: string = '';
|
||||||
private type: number = 1;
|
private type: number = 1;
|
||||||
private endFlag: Boolean = false;
|
private endFlag: Boolean = false;
|
||||||
private mediaArray: Array<any> = [];
|
private mediaArray: Array<string> = [];
|
||||||
|
private callBack: AVPlayerCallback = null;
|
||||||
|
|
||||||
constructor(callBack: AVPlayerCallback) {
|
constructor(callBack: AVPlayerCallback) {
|
||||||
// 创建avPlayer实例对象
|
// 创建avPlayer实例对象
|
||||||
@ -24,11 +27,11 @@ export class voiceService {
|
|||||||
|
|
||||||
// 注册avplayer回调函数
|
// 注册avplayer回调函数
|
||||||
setAVPlayerCallback(callBack: AVPlayerCallback) {
|
setAVPlayerCallback(callBack: AVPlayerCallback) {
|
||||||
console.log('jiangsong avPlayerFdSrc setAVPlayerCallback begin')
|
console.log(VoiceTag, ' avPlayerFdSrc setAVPlayerCallback begin')
|
||||||
|
|
||||||
// error回调监听函数,当avPlayer在操作过程中出现错误时调用reset接口触发重置流程
|
// error回调监听函数,当avPlayer在操作过程中出现错误时调用reset接口触发重置流程
|
||||||
this.avPlayer.on('error', (err: BusinessError) => {
|
this.avPlayer.on('error', (err: BusinessError) => {
|
||||||
console.error(`Invoke avPlayer failed, code is ${err.code}, message is ${err.message}`);
|
console.error(VoiceTag, `Invoke avPlayer failed, code is ${err.code}, message is ${err.message}`);
|
||||||
this.avPlayer.reset(); // 调用reset重置资源,触发idle状态
|
this.avPlayer.reset(); // 调用reset重置资源,触发idle状态
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -38,7 +41,7 @@ export class voiceService {
|
|||||||
switch (state) {
|
switch (state) {
|
||||||
case 'idle': // 成功调用reset接口后触发该状态机上报
|
case 'idle': // 成功调用reset接口后触发该状态机上报
|
||||||
// callBack('idle');
|
// callBack('idle');
|
||||||
console.log('jiangsong AVPlayer idle')
|
console.log(VoiceTag, ' AVPlayer idle')
|
||||||
if (this.type == 3) {
|
if (this.type == 3) {
|
||||||
if (this.mediaArray.length && !this.endFlag) {
|
if (this.mediaArray.length && !this.endFlag) {
|
||||||
this.mediaArray.splice(0, 1)
|
this.mediaArray.splice(0, 1)
|
||||||
@ -51,11 +54,11 @@ export class voiceService {
|
|||||||
callBack('idle', this.playerName);
|
callBack('idle', this.playerName);
|
||||||
break;
|
break;
|
||||||
case 'initialized': // avplayer 设置播放源后触发该状态上报
|
case 'initialized': // avplayer 设置播放源后触发该状态上报
|
||||||
console.info('jiangsong AVPlayerstate initialized called.');
|
console.info(VoiceTag, ' AVPlayerstate initialized called.');
|
||||||
this.avPlayer.prepare().then(() => {
|
this.avPlayer.prepare().then(() => {
|
||||||
console.info('jiangsong AVPlayer prepare succeeded.');
|
console.info(VoiceTag, ' AVPlayer prepare succeeded.');
|
||||||
}, (err: BusinessError) => {
|
}, (err: BusinessError) => {
|
||||||
console.error(`jiangsong Invoke prepare failed, code is ${err.code}, message is ${err.message}`);
|
console.error(VoiceTag, ` Invoke prepare failed, code is ${err.code}, message is ${err.message}`);
|
||||||
});
|
});
|
||||||
callBack('initialized');
|
callBack('initialized');
|
||||||
break;
|
break;
|
||||||
@ -70,21 +73,21 @@ export class voiceService {
|
|||||||
callBack('paused');
|
callBack('paused');
|
||||||
break;
|
break;
|
||||||
case 'completed': // 播放结束后触发该状态机上报
|
case 'completed': // 播放结束后触发该状态机上报
|
||||||
console.info('jiangsong AVPlayer state completed called.');
|
console.info(VoiceTag, ' AVPlayer state completed called.');
|
||||||
this.avPlayer.stop(); //调用播放结束接口
|
this.avPlayer.stop(); //调用播放结束接口
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 'stopped': // stop接口成功调用后触发该状态机上报
|
case 'stopped': // stop接口成功调用后触发该状态机上报
|
||||||
console.info('jiangsong AVPlayer state stopped called.');
|
console.info(VoiceTag, ' AVPlayer state stopped called.');
|
||||||
this.avPlayer.reset(); // 调用reset接口初始化avplayer状态
|
this.avPlayer.reset(); // 调用reset接口初始化avplayer状态
|
||||||
// callBack('stopped');
|
// callBack('stopped');
|
||||||
break;
|
break;
|
||||||
case 'released':
|
case 'released':
|
||||||
console.info('jiangsong AVPlayer state released called.');
|
console.info(VoiceTag, ' AVPlayer state released called.');
|
||||||
callBack('released');
|
callBack('released');
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
console.info('jiangsong AVPlayer state unknown called.');
|
console.info(VoiceTag, ' AVPlayer state unknown called.');
|
||||||
callBack('unknown');
|
callBack('unknown');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -92,13 +95,13 @@ export class voiceService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 以下为使用资源管理接口获取打包在HAP内的媒体资源文件并通过fdSrc属性进行播放示例
|
// 以下为使用资源管理接口获取打包在HAP内的媒体资源文件并通过fdSrc属性进行播放示例
|
||||||
avPlayerFdSrc(name) {
|
avPlayerFdSrc(name: string) {
|
||||||
const context = AppStorage.get('context')
|
const context: common.UIAbilityContext = AppStorage.get('context')
|
||||||
context.resourceManager.getRawFd(name, async (error, value) => {
|
context.resourceManager.getRawFd(name, async (error, value) => {
|
||||||
if (error != null) {
|
if (error != null) {
|
||||||
console.log(`jiangsong callback getRawFd failed error code: ${error.code}, message: ${error.message}.`);
|
console.log(VoiceTag, ` callback getRawFd failed error code: ${error.code}, message: ${error.message}.`);
|
||||||
} else {
|
} else {
|
||||||
console.log('jiangsongjiangsong', this.avPlayer)
|
console.log(VoiceTag, this.avPlayer)
|
||||||
if (this.avPlayer) {
|
if (this.avPlayer) {
|
||||||
await this.avPlayer.reset()
|
await this.avPlayer.reset()
|
||||||
this.avPlayer.fdSrc = value;
|
this.avPlayer.fdSrc = value;
|
||||||
@ -106,13 +109,13 @@ export class voiceService {
|
|||||||
|
|
||||||
// 为fdSrc赋值触发initialized状态机上报
|
// 为fdSrc赋值触发initialized状态机上报
|
||||||
// this.avPlayer.play()
|
// this.avPlayer.play()
|
||||||
console.info("jiangsong click me after success value.fd " + JSON.stringify(value));
|
console.info(VoiceTag, " click me after success value.fd " + JSON.stringify(value));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 以下为通过url设置网络地址来实现播放直播码流的
|
// 以下为通过url设置网络地址来实现播放直播码流的
|
||||||
avPlayerLive(url) {
|
avPlayerLive(url: string) {
|
||||||
this.avPlayer.url = url
|
this.avPlayer.url = url
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -121,18 +124,17 @@ export class voiceService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
avPlayerStop() {
|
avPlayerStop() {
|
||||||
this.avPlayer && this.avPlayer.stop((err) => {
|
this.avPlayer && this.avPlayer.stop((err: BusinessError) => {
|
||||||
if (err == null) {
|
if (err == null) {
|
||||||
this.endFlag = true
|
this.endFlag = true
|
||||||
console.info('stop success');
|
console.info(VoiceTag, 'stop success');
|
||||||
} else {
|
} else {
|
||||||
console.error('stop filed,error message is :' + err.message)
|
console.error(VoiceTag, 'stop filed,error message is :' + err.message)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
playAudio(param) {
|
playAudio(param: playParams) {
|
||||||
console.log('jiangsong')
|
|
||||||
this.endFlag = false
|
this.endFlag = false
|
||||||
this.mediaArray = []
|
this.mediaArray = []
|
||||||
this.type = param.type
|
this.type = param.type
|
||||||
@ -150,6 +152,13 @@ export class voiceService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private callBack = function (value) {
|
// private callBack = function (value) {
|
||||||
}
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
interface playParams {
|
||||||
|
type?: number,
|
||||||
|
name?: string,
|
||||||
|
url?: string,
|
||||||
|
value?: string[]
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user