diff --git a/entry/src/main/ets/pages/CarCheck.ets b/entry/src/main/ets/pages/CarCheck.ets index f1651c9..63bed5c 100644 --- a/entry/src/main/ets/pages/CarCheck.ets +++ b/entry/src/main/ets/pages/CarCheck.ets @@ -3,7 +3,7 @@ import { carConfigurationInfo, uploadExamCarCheckResult } from '../api/checkCar' import TopLogo from './compontents/TopLogo'; import testNapi from '@ohos.hiserialsdk'; import { DwMapData, PassData, RealNumData, StackValueData, WarnFlagData, WarnFlagTipData } from '../mock'; -import { BaseInfoType, RouteParamsType } from '../model/Common'; +import { RouteParamsType } from '../model/Common'; import { CarCheckDataType, CarConfigurationParams, CarInfoType } from '../model'; import { BusinessError } from '@ohos.base'; import { voiceService } from '../utils/Voice'; @@ -149,12 +149,12 @@ struct Index { this.checkListCopy = JSON.parse(JSON.stringify(this.checkList)) return } - const baseInfo = AppStorage.get("baseInfo") + const deviceNo = AppStorage.get("deviceNo") //模拟真实数据 const param: CarConfigurationParams = { body: { "carIdString": this.carInfo.carId || "", //考车ID - "deviceNo": baseInfo?.deviceNo || "" + "deviceNo": deviceNo || "" } } diff --git a/entry/src/main/ets/pages/Register.ets b/entry/src/main/ets/pages/Register.ets index 4efe21f..937f053 100644 --- a/entry/src/main/ets/pages/Register.ets +++ b/entry/src/main/ets/pages/Register.ets @@ -126,7 +126,6 @@ struct Index { const folderPath = await fileUtil.initFolder(`/config`); fileUtil.addFile(`${folderPath}/deviceNo.txt`, JSON.stringify(param)) AppStorage.setOrCreate('deviceNo', this.ip) - // upDateTableByArray('DeviceInfoTable', [{ deviceId: this.ip }]) registrationDeviceNo(param).then((res: ApiResponseType) => { if (res.registrationDeviceNoRsp && res.registrationDeviceNoRsp.head && res.registrationDeviceNoRsp.head.resultCode == '0') { diff --git a/entry/src/main/ets/pages/VideoConfig.ets b/entry/src/main/ets/pages/VideoConfig.ets index ae07142..6704db5 100644 --- a/entry/src/main/ets/pages/VideoConfig.ets +++ b/entry/src/main/ets/pages/VideoConfig.ets @@ -1,4 +1,3 @@ - import common from '@ohos.app.ability.common'; import promptAction from '@ohos.promptAction'; import { GlobalConfig } from '../config/index'; @@ -51,6 +50,46 @@ struct Index { ] private inputController: TextInputController = new TextInputController() + aboutToAppear() { + // this.ratio = globalThis.ratio + this.ratio = AppStorage.get('ratio') || 0 + this.openFlag = true + const fileUtil = new FileUtils(this.context) + this.fileUtil = fileUtil + this.getVideoConfig() + } + + async getFileHandleCode(td: number): Promise { + return new Promise(async (resolve, reject) => { + const record_handle = await startRecordVideo(this.param, td, this.context, 'lp') + // this.rocordHandleObj['rocord_handle'+td] = record_handle + Reflect.set(this.rocordHandleObj, 'rocord_handle' + td, record_handle); + resolve() + }) + + } + + outClick() { + this.openFlag = false + } + + async onPageShow() { + } + + async getVideoConfig() { + const data = await this.fileUtil.readFile(GlobalConfig.commonFileWriteAddress + '/config/config3.txt'); + this.oldParam = JSON.parse(data) + this.param = JSON.parse(data) + } + + async writeConfig() { + this.oldParam = JSON.parse(JSON.stringify(this.param)) + this.videoArr = JSON.parse(JSON.stringify(this.videoArr)) + const folderPath = await this.fileUtil.initFolder(`/config`); + this.fileUtil.addFile(`${folderPath}/config3.txt`, JSON.stringify(this.param)) + this.showFlag = false + } + build() { Column() { TopLogo({ outFlag: $outFlag }) @@ -149,7 +188,7 @@ struct Index { .height(64 * this.ratio) .onClick(async () => { const arr = ['1', '2', '3', '4'] - if (!arr.includes(this.param.pztd||"")) { + if (!arr.includes(this.param.pztd || "")) { promptAction.showToast({ message: '请填写正确的拍照通道', duration: 3000 @@ -232,10 +271,10 @@ struct Index { }) Column() { Image($r('app.media.shang')).width(15 * this.ratio).height(15 * this.ratio).onClick(() => { - this.param.videoNum = (parseInt(this.param?.videoNum||"") + 1).toString() + this.param.videoNum = (parseInt(this.param?.videoNum || "") + 1).toString() }) Image($r('app.media.xia')).width(15 * this.ratio).height(15 * this.ratio).onClick(() => { - this.param.videoNum = (parseInt(this.param.videoNum||"") - 1).toString() + this.param.videoNum = (parseInt(this.param.videoNum || "") - 1).toString() }) }.margin({ left: 5 * this.ratio, right: 10 * this.ratio }) @@ -588,44 +627,4 @@ struct Index { }.backgroundColor('#1A1A1A').width('100%').height('100%') } - - aboutToAppear() { - // this.ratio = globalThis.ratio - this.ratio = AppStorage.get('ratio') || 0 - this.openFlag = true - const fileUtil = new FileUtils(this.context) - this.fileUtil = fileUtil - this.getVideoConfig() - } - - async getFileHandleCode(td: number): Promise { - return new Promise(async (resolve, reject) => { - const record_handle = await startRecordVideo(this.param, td, this.context, 'lp') - // this.rocordHandleObj['rocord_handle'+td] = record_handle - Reflect.set(this.rocordHandleObj, 'rocord_handle' + td, record_handle); - resolve() - }) - - } - - outClick() { - this.openFlag = false - } - - async onPageShow() { - } - - async getVideoConfig() { - const data = await this.fileUtil.readFile(GlobalConfig.commonFileWriteAddress + '/config/config3.txt'); - this.oldParam = JSON.parse(data) - this.param = JSON.parse(data) - } - - async writeConfig() { - this.oldParam = JSON.parse(JSON.stringify(this.param)) - this.videoArr = JSON.parse(JSON.stringify(this.videoArr)) - const folderPath = await this.fileUtil.initFolder(`/config`); - this.fileUtil.addFile(`${folderPath}/config3.txt`, JSON.stringify(this.param)) - this.showFlag = false - } } \ No newline at end of file