Compare commits
	
		
			No commits in common. "b1264c19e825c68f6793ad5f0aa681149c192fed" and "4e679d1645d0ed34abed550264b75eed75bf3190" have entirely different histories.
		
	
	
		
			b1264c19e8
			...
			4e679d1645
		
	
		
@ -94,7 +94,7 @@ struct Index {
 | 
				
			|||||||
                    if (this.limit) {
 | 
					                    if (this.limit) {
 | 
				
			||||||
                      return
 | 
					                      return
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                    const carInfo: CarInfoType = AppStorage.get<CarInfoType>('carInfo')!
 | 
					                    const carInfo: CarInfoType = AppStorage.get<CarInfoType>('carInfo')
 | 
				
			||||||
                    let password: string = CryptoJS.MD5(this.inputTextArr[1]).toString();
 | 
					                    let password: string = CryptoJS.MD5(this.inputTextArr[1]).toString();
 | 
				
			||||||
                    const param: UserLoginType = {
 | 
					                    const param: UserLoginType = {
 | 
				
			||||||
                      carId: carInfo.carId as string,
 | 
					                      carId: carInfo.carId as string,
 | 
				
			||||||
 | 
				
			|||||||
@ -44,6 +44,7 @@ struct Index {
 | 
				
			|||||||
  @State fd: number = -1;
 | 
					  @State fd: number = -1;
 | 
				
			||||||
  @State carInfo: CarInfoType = {};
 | 
					  @State carInfo: CarInfoType = {};
 | 
				
			||||||
  @State num: number = 0;
 | 
					  @State num: number = 0;
 | 
				
			||||||
 | 
					  fileHelper: FileHelper = null;
 | 
				
			||||||
  errorDialog: CustomDialogController = new CustomDialogController({
 | 
					  errorDialog: CustomDialogController = new CustomDialogController({
 | 
				
			||||||
    builder: errorMsgDialog({
 | 
					    builder: errorMsgDialog({
 | 
				
			||||||
      title: AppStorage.get('title'),
 | 
					      title: AppStorage.get('title'),
 | 
				
			||||||
@ -57,15 +58,14 @@ struct Index {
 | 
				
			|||||||
    alignment: DialogAlignment.Center,
 | 
					    alignment: DialogAlignment.Center,
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  )
 | 
					  )
 | 
				
			||||||
  private fileHelper!: FileHelper
 | 
					 | 
				
			||||||
  private interval = -1;
 | 
					  private interval = -1;
 | 
				
			||||||
  private avPlayer!: VoiceAnnounce
 | 
					  private avPlayer: VoiceAnnounce
 | 
				
			||||||
  private timeInfo: TimeSynchronizationRspBody
 | 
					  private timeInfo: TimeSynchronizationRspBody
 | 
				
			||||||
  private context = getContext(this) as common.UIAbilityContext;
 | 
					  private context = getContext(this) as common.UIAbilityContext;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  async aboutToAppear() {
 | 
					  async aboutToAppear() {
 | 
				
			||||||
    this.avPlayer = new VoiceAnnounce(this.context);
 | 
					    this.avPlayer = new VoiceAnnounce(this.context);
 | 
				
			||||||
    this.ratio = AppStorage.get<number>('ratio') || 0
 | 
					    this.ratio = AppStorage.get<number>('ratio')
 | 
				
			||||||
    this.initParamFlag = false
 | 
					    this.initParamFlag = false
 | 
				
			||||||
    this.delLoading = false
 | 
					    this.delLoading = false
 | 
				
			||||||
    this.dialogVisible = false
 | 
					    this.dialogVisible = false
 | 
				
			||||||
@ -88,8 +88,8 @@ struct Index {
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  async onPageShow(): Promise<void> {
 | 
					  async onPageShow(): Promise<void> {
 | 
				
			||||||
    this.singlePlay = AppStorage.get<boolean>('singlePlay') || false
 | 
					    this.singlePlay = AppStorage.get<boolean>('singlePlay')
 | 
				
			||||||
    this.baseInfo = AppStorage.get<BaseInfoType>('baseInfo')!
 | 
					    this.baseInfo = AppStorage.get<BaseInfoType>('baseInfo')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    UseAuth(this.context).then(() => {
 | 
					    UseAuth(this.context).then(() => {
 | 
				
			||||||
      this.initParams()
 | 
					      this.initParams()
 | 
				
			||||||
@ -153,7 +153,7 @@ struct Index {
 | 
				
			|||||||
            if (sys.v_no === '854') {
 | 
					            if (sys.v_no === '854') {
 | 
				
			||||||
              AppStorage.setOrCreate('param854Str', sys.v_value)
 | 
					              AppStorage.setOrCreate('param854Str', sys.v_value)
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            if (sys.v_no === '824' && decodeURIComponent(sys.v_value || '') == '0') {
 | 
					            if (sys.v_no === '824' && decodeURIComponent(sys.v_value) == '0') {
 | 
				
			||||||
              router.pushUrl({
 | 
					              router.pushUrl({
 | 
				
			||||||
                url: 'pages/CarCheck',
 | 
					                url: 'pages/CarCheck',
 | 
				
			||||||
                params: {
 | 
					                params: {
 | 
				
			||||||
@ -199,7 +199,7 @@ struct Index {
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  async createAlbum() {
 | 
					  async createAlbum() {
 | 
				
			||||||
    this.fileHelper = new FileHelper(this.context);
 | 
					    this.fileHelper = new FileHelper();
 | 
				
			||||||
    const time = GetCurrentTime()
 | 
					    const time = GetCurrentTime()
 | 
				
			||||||
    const date = time.split(' ')[0]
 | 
					    const date = time.split(' ')[0]
 | 
				
			||||||
    this.fileHelper.createAlbum('jt')
 | 
					    this.fileHelper.createAlbum('jt')
 | 
				
			||||||
@ -223,10 +223,10 @@ struct Index {
 | 
				
			|||||||
    await GetDeviceInfo(this.context)
 | 
					    await GetDeviceInfo(this.context)
 | 
				
			||||||
    await GetCarInfo()
 | 
					    await GetCarInfo()
 | 
				
			||||||
    // getTCP()
 | 
					    // getTCP()
 | 
				
			||||||
    this.carInfo = AppStorage.get<CarInfoType>('carInfo')!
 | 
					    this.carInfo = AppStorage.get<CarInfoType>('carInfo')
 | 
				
			||||||
    this.deviceId = this.carInfo.carNo || ""
 | 
					    this.deviceId = this.carInfo.carNo
 | 
				
			||||||
    await SetCurrentTime()
 | 
					    await SetCurrentTime()
 | 
				
			||||||
    this.timeInfo = AppStorage.get<TimeSynchronizationRspBody>('timeInfo')!
 | 
					    this.timeInfo = AppStorage.get<TimeSynchronizationRspBody>('timeInfo')
 | 
				
			||||||
    DrivingDataStorage.init(this.context)
 | 
					    DrivingDataStorage.init(this.context)
 | 
				
			||||||
    DrivingDataStorage.initializeTheDrivingDataFolder()
 | 
					    DrivingDataStorage.initializeTheDrivingDataFolder()
 | 
				
			||||||
    setTimeout(() => {
 | 
					    setTimeout(() => {
 | 
				
			||||||
 | 
				
			|||||||
@ -44,11 +44,11 @@ export async function GetCarInfo() {
 | 
				
			|||||||
  let date = new Date();
 | 
					  let date = new Date();
 | 
				
			||||||
  let params: ObtainCarExamInfoParams = {
 | 
					  let params: ObtainCarExamInfoParams = {
 | 
				
			||||||
    time: dayTs(date).format("YYYY-MM-DD HH:mm:ss"),
 | 
					    time: dayTs(date).format("YYYY-MM-DD HH:mm:ss"),
 | 
				
			||||||
    deviceNo: AppStorage.get<string>('deviceNo') || ""
 | 
					    deviceNo: AppStorage.get<string>('deviceNo')
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
  let res: ApiResponseType = await obtainCarExamInfo(params)
 | 
					  let res: ApiResponseType = await obtainCarExamInfo(params)
 | 
				
			||||||
  if (res.obtainCarExamInfoRsp && res.obtainCarExamInfoRsp.body) {
 | 
					  if (res.obtainCarExamInfoRsp.body) {
 | 
				
			||||||
    const carInfo: ObtainCarExamInfoRspBody = res?.obtainCarExamInfoRsp?.body!
 | 
					    const carInfo: ObtainCarExamInfoRspBody = res?.obtainCarExamInfoRsp?.body
 | 
				
			||||||
    carInfo.plateNo = decodeURIComponent(carInfo.plateNo)
 | 
					    carInfo.plateNo = decodeURIComponent(carInfo.plateNo)
 | 
				
			||||||
    AppStorage.setOrCreate('carInfo', carInfo)
 | 
					    AppStorage.setOrCreate('carInfo', carInfo)
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
@ -82,25 +82,18 @@ export async function UseAuth(context: common.UIAbilityContext): Promise<boolean
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
//获取时间同步
 | 
					//获取时间同步
 | 
				
			||||||
export async function SetCurrentTime(): Promise<void> {
 | 
					export async function SetCurrentTime(): Promise<void> {
 | 
				
			||||||
  let deviceNo: string = AppStorage.get<string>('deviceNo')!;
 | 
					  let deviceNo: string = AppStorage.get<string>('deviceNo');
 | 
				
			||||||
  let baseInfo: BaseInfoType = AppStorage.get<BaseInfoType>('baseInfo')!
 | 
					  let baseInfo: BaseInfoType = AppStorage.get<BaseInfoType>('baseInfo')
 | 
				
			||||||
  let params: TimeSynchronizationParams = {
 | 
					  let params: TimeSynchronizationParams = {
 | 
				
			||||||
    time: dayTs(new Date()).format("YYYY-MM-DD HH:mm:ss"),
 | 
					    time: dayTs(new Date()).format("YYYY-MM-DD HH:mm:ss"),
 | 
				
			||||||
    deviceNo,
 | 
					    deviceNo,
 | 
				
			||||||
    version: baseInfo.version!,
 | 
					    version: baseInfo.version,
 | 
				
			||||||
    judgeVersion: baseInfo.judgeVersion!
 | 
					    judgeVersion: baseInfo.judgeVersion
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  let res: ApiResponseType = await timeSynchronization(params);
 | 
					  let res: ApiResponseType = await timeSynchronization(params);
 | 
				
			||||||
  if (res.timeSynchronizationRsp?.body) {
 | 
					  AppStorage.setOrCreate<TimeSynchronizationRspBody>('timeInfo', res.timeSynchronizationRsp.body)
 | 
				
			||||||
    AppStorage.setOrCreate<TimeSynchronizationRspBody>('timeInfo', res.timeSynchronizationRsp.body);
 | 
					  let currentTime = res.timeSynchronizationRsp.head.time;
 | 
				
			||||||
  }
 | 
					  let times = new Date(currentTime).getTime();
 | 
				
			||||||
  let currentTime = res.timeSynchronizationRsp?.head?.time;
 | 
					 | 
				
			||||||
  let times = 0
 | 
					 | 
				
			||||||
  if (currentTime) {
 | 
					 | 
				
			||||||
    times = new Date(currentTime).getTime();
 | 
					 | 
				
			||||||
  } else {
 | 
					 | 
				
			||||||
    console.error("currentTime is undefined");
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
  try {
 | 
					  try {
 | 
				
			||||||
    await systemTime.setTime(times)
 | 
					    await systemTime.setTime(times)
 | 
				
			||||||
  } catch (error) {
 | 
					  } catch (error) {
 | 
				
			||||||
@ -136,7 +129,7 @@ async function obtainSerialNumber(data: string) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
//设置流水号
 | 
					//设置流水号
 | 
				
			||||||
export async function SetSerialNumber() {
 | 
					export async function SetSerialNumber() {
 | 
				
			||||||
  const data = AppStorage.get<string>("liushuiNo") || "";
 | 
					  const data = AppStorage.get<string>("liushuiNo");
 | 
				
			||||||
  const serialNumberTime = AppStorage.get<string>("liushuiDate");
 | 
					  const serialNumberTime = AppStorage.get<string>("liushuiDate");
 | 
				
			||||||
  obtainSerialNumber(data);
 | 
					  obtainSerialNumber(data);
 | 
				
			||||||
  const date = dayTs().format('YYYY-MM-DD HH:mm:ss');
 | 
					  const date = dayTs().format('YYYY-MM-DD HH:mm:ss');
 | 
				
			||||||
 | 
				
			|||||||
@ -1,4 +1,5 @@
 | 
				
			|||||||
import router from '@ohos.router'
 | 
					import router from '@ohos.router'
 | 
				
			||||||
 | 
					import { CarCheckDataType } from '../model/CarCheck'
 | 
				
			||||||
import { BaseInfoType, CarInfoType } from '../model/Common'
 | 
					import { BaseInfoType, CarInfoType } from '../model/Common'
 | 
				
			||||||
import TopLogo from './compontents/TopLogo'
 | 
					import TopLogo from './compontents/TopLogo'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -87,8 +88,8 @@ struct Index {
 | 
				
			|||||||
  aboutToAppear() {
 | 
					  aboutToAppear() {
 | 
				
			||||||
    // this.vocObj = new voiceService(async (status, val, next) => {
 | 
					    // this.vocObj = new voiceService(async (status, val, next) => {
 | 
				
			||||||
    // });
 | 
					    // });
 | 
				
			||||||
    this.carInfo = AppStorage.get<CarInfoType>('carInfo')!
 | 
					    this.carInfo = AppStorage.get<CarInfoType>('carInfo')
 | 
				
			||||||
    this.baseInfo = AppStorage.get<BaseInfoType>('baseInfo')!
 | 
					    this.baseInfo = AppStorage.get<BaseInfoType>('baseInfo')
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  outClick() {
 | 
					  outClick() {
 | 
				
			||||||
 | 
				
			|||||||
@ -22,7 +22,7 @@ struct Index {
 | 
				
			|||||||
      '192.168.7.124', '20022', '192.168.7.170', '20122']
 | 
					      '192.168.7.124', '20022', '192.168.7.170', '20122']
 | 
				
			||||||
  @State @Watch('outClick') outFlag: boolean = false;
 | 
					  @State @Watch('outClick') outFlag: boolean = false;
 | 
				
			||||||
  scroller: Scroller = new Scroller()
 | 
					  scroller: Scroller = new Scroller()
 | 
				
			||||||
  private fileUtil!: FileUtils
 | 
					  private fileUtil: FileUtils
 | 
				
			||||||
  private context = getContext(this) as common.UIAbilityContext;
 | 
					  private context = getContext(this) as common.UIAbilityContext;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  build() {
 | 
					  build() {
 | 
				
			||||||
@ -145,17 +145,17 @@ struct Index {
 | 
				
			|||||||
    } else {
 | 
					    } else {
 | 
				
			||||||
      const result: EnvironmentConfigurationType = JSON.parse(data)
 | 
					      const result: EnvironmentConfigurationType = JSON.parse(data)
 | 
				
			||||||
      AppStorage.setOrCreate<EnvironmentConfigurationType>("EnvironmentConfiguration", result)
 | 
					      AppStorage.setOrCreate<EnvironmentConfigurationType>("EnvironmentConfiguration", result)
 | 
				
			||||||
      this.inputTextList1[9] = result.udplocalIp ?? ''
 | 
					      this.inputTextList1[9] = result.udplocalIp
 | 
				
			||||||
      this.inputTextList1[10] = result.udplocalIpPort ?? ''
 | 
					      this.inputTextList1[10] = result.udplocalIpPort
 | 
				
			||||||
      this.inputTextList1[7] = result.udpOppositeIp ?? ''
 | 
					      this.inputTextList1[7] = result.udpOppositeIp
 | 
				
			||||||
      this.inputTextList1[8] = result.udpOppositeIpPort ?? ''
 | 
					      this.inputTextList1[8] = result.udpOppositeIpPort
 | 
				
			||||||
      this.inputTextList1[0] = result.tcpOppositeIp ?? ''
 | 
					      this.inputTextList1[0] = result.tcpOppositeIp
 | 
				
			||||||
      this.inputTextList1[1] = result.tcpOppositePort ?? ''
 | 
					      this.inputTextList1[1] = result.tcpOppositePort
 | 
				
			||||||
      this.inputTextList1[5] = result.gateway ?? ''
 | 
					      this.inputTextList1[5] = result.gateway
 | 
				
			||||||
      this.inputTextList1[4] = result.netMask ?? ''
 | 
					      this.inputTextList1[4] = result.netMask
 | 
				
			||||||
      this.inputTextList1[6] = result.dnsServers ?? ''
 | 
					      this.inputTextList1[6] = result.dnsServers
 | 
				
			||||||
      this.inputTextList1[2] = result.centerIp ?? ''
 | 
					      this.inputTextList1[2] = result.centerIp
 | 
				
			||||||
      this.inputTextList1[3] = result.centerPort ?? ''
 | 
					      this.inputTextList1[3] = result.centerPort
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ethernet.getIfaceConfig("eth0").then(value => {
 | 
					    ethernet.getIfaceConfig("eth0").then(value => {
 | 
				
			||||||
 | 
				
			|||||||
@ -799,7 +799,7 @@ struct UserInfo {
 | 
				
			|||||||
      const arr = [this.signNum || 0, 1]
 | 
					      const arr = [this.signNum || 0, 1]
 | 
				
			||||||
      let tmpList: number[] = [];
 | 
					      let tmpList: number[] = [];
 | 
				
			||||||
      tmpList.push(NumberToByteArray(arr[0], 1 * 8)[0])
 | 
					      tmpList.push(NumberToByteArray(arr[0], 1 * 8)[0])
 | 
				
			||||||
      tmpList.push(NumberToByteArray(arr[1] ?? 0, 1 * 8)[0])
 | 
					      tmpList.push(NumberToByteArray(arr[1], 1 * 8)[0])
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      const param: UDPParamType = {
 | 
					      const param: UDPParamType = {
 | 
				
			||||||
        id: 43,
 | 
					        id: 43,
 | 
				
			||||||
@ -809,8 +809,7 @@ struct UserInfo {
 | 
				
			|||||||
      }
 | 
					      }
 | 
				
			||||||
      CenterUDPClientInstance.sendData(param)
 | 
					      CenterUDPClientInstance.sendData(param)
 | 
				
			||||||
      // globalThis.udpClient2.sendMsgExt(param, this.context)
 | 
					      // globalThis.udpClient2.sendMsgExt(param, this.context)
 | 
				
			||||||
      if (res.examinationStuAbsentRsp && res.examinationStuAbsentRsp.head &&
 | 
					      if (res.examinationStuAbsentRsp.head.resultCode == '0') {
 | 
				
			||||||
        res.examinationStuAbsentRsp.head.resultCode == '0') {
 | 
					 | 
				
			||||||
        this.pageIndex = 0
 | 
					        this.pageIndex = 0
 | 
				
			||||||
        this.qkFlag = false
 | 
					        this.qkFlag = false
 | 
				
			||||||
        this.currentUser = EmptyCandidateObject
 | 
					        this.currentUser = EmptyCandidateObject
 | 
				
			||||||
@ -830,9 +829,9 @@ struct UserInfo {
 | 
				
			|||||||
    // const { carId, examinationRoomId } = this.carInfo;
 | 
					    // const { carId, examinationRoomId } = this.carInfo;
 | 
				
			||||||
    const examItems = await getExaminationItem({
 | 
					    const examItems = await getExaminationItem({
 | 
				
			||||||
      time: GetCurrentTime() || "",
 | 
					      time: GetCurrentTime() || "",
 | 
				
			||||||
      carId: this.carInfo.carId || "",
 | 
					      carId: this.carInfo.carId,
 | 
				
			||||||
      lsh: this.currentUser.lsh || '',
 | 
					      lsh: this.currentUser.lsh || '',
 | 
				
			||||||
      examinationRoomId: this.carInfo.examinationRoomId || ""
 | 
					      examinationRoomId: this.carInfo.examinationRoomId
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (examItems?.getExaminationItemRsp?.body?.kssycs != 0) {
 | 
					    if (examItems?.getExaminationItemRsp?.body?.kssycs != 0) {
 | 
				
			||||||
@ -857,9 +856,9 @@ struct UserInfo {
 | 
				
			|||||||
      //获取已考项目
 | 
					      //获取已考项目
 | 
				
			||||||
      examItems = await getExaminationItem({
 | 
					      examItems = await getExaminationItem({
 | 
				
			||||||
        time: GetCurrentTime(),
 | 
					        time: GetCurrentTime(),
 | 
				
			||||||
        carId: this.carInfo.carId || "",
 | 
					        carId: this.carInfo.carId,
 | 
				
			||||||
        lsh: this.currentUser.lsh || '',
 | 
					        lsh: this.currentUser.lsh || '',
 | 
				
			||||||
        examinationRoomId: this.carInfo.examinationRoomId || ""
 | 
					        examinationRoomId: this.carInfo.examinationRoomId
 | 
				
			||||||
      });
 | 
					      });
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    this.currentUser.id = '1'
 | 
					    this.currentUser.id = '1'
 | 
				
			||||||
@ -1033,7 +1032,7 @@ struct UserInfo {
 | 
				
			|||||||
      ksxl: this.currentUser.xldm,
 | 
					      ksxl: this.currentUser.xldm,
 | 
				
			||||||
      zp: photoBase64,
 | 
					      zp: photoBase64,
 | 
				
			||||||
      kssj: dayTs(date).format("YYYY-MM-DD HH:mm:ss") || '',
 | 
					      kssj: dayTs(date).format("YYYY-MM-DD HH:mm:ss") || '',
 | 
				
			||||||
      kchp: decodeURI(this.carInfo.plateNo || ""),
 | 
					      kchp: decodeURI(this.carInfo.plateNo),
 | 
				
			||||||
      Ksy2sfzmhm: this.currentUser.ksy2sfzmhm || ''
 | 
					      Ksy2sfzmhm: this.currentUser.ksy2sfzmhm || ''
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    const param: RegulatoryInterfaceParams = {
 | 
					    const param: RegulatoryInterfaceParams = {
 | 
				
			||||||
@ -1131,7 +1130,7 @@ struct UserInfo {
 | 
				
			|||||||
              AppStorage.setOrCreate('lsh', item.lsh)
 | 
					              AppStorage.setOrCreate('lsh', item.lsh)
 | 
				
			||||||
              setTimeout(() => {
 | 
					              setTimeout(() => {
 | 
				
			||||||
                this.currentUser = item
 | 
					                this.currentUser = item
 | 
				
			||||||
                this.currentUser.ksy2 = this.examinerLoginInfo.kgxm || ""
 | 
					                this.currentUser.ksy2 = this.examinerLoginInfo.kgxm
 | 
				
			||||||
 | 
					
 | 
				
			||||||
              }, 200)
 | 
					              }, 200)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -37,7 +37,7 @@ struct Index {
 | 
				
			|||||||
    { key: '第三路' },
 | 
					    { key: '第三路' },
 | 
				
			||||||
    { key: '第四路' },
 | 
					    { key: '第四路' },
 | 
				
			||||||
  ]
 | 
					  ]
 | 
				
			||||||
  private fileUtil!: FileUtils
 | 
					  private fileUtil: FileUtils
 | 
				
			||||||
  private context = getContext(this) as common.UIAbilityContext;
 | 
					  private context = getContext(this) as common.UIAbilityContext;
 | 
				
			||||||
  private controller1: VideoController = new VideoController()
 | 
					  private controller1: VideoController = new VideoController()
 | 
				
			||||||
  private controller2: VideoController = new VideoController()
 | 
					  private controller2: VideoController = new VideoController()
 | 
				
			||||||
@ -240,7 +240,7 @@ struct Index {
 | 
				
			|||||||
              }.margin({ left: 5 * this.ratio, right: 10 * this.ratio })
 | 
					              }.margin({ left: 5 * this.ratio, right: 10 * this.ratio })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
              Checkbox({ name: 'checkbox1', group: 'checkboxGroup' })
 | 
					              Checkbox({ name: 'checkbox1', group: 'checkboxGroup' })
 | 
				
			||||||
                .select(this.param.faceFlag || false)
 | 
					                .select(this.param.faceFlag)
 | 
				
			||||||
                .width(22 * this.ratio)
 | 
					                .width(22 * this.ratio)
 | 
				
			||||||
                .height(22 * this.ratio)
 | 
					                .height(22 * this.ratio)
 | 
				
			||||||
                .onChange((value: boolean) => {
 | 
					                .onChange((value: boolean) => {
 | 
				
			||||||
@ -420,7 +420,7 @@ struct Index {
 | 
				
			|||||||
                    Column() {
 | 
					                    Column() {
 | 
				
			||||||
                      Row() {
 | 
					                      Row() {
 | 
				
			||||||
                        Checkbox({ name: 'checkbox1', group: 'checkboxGroup' })
 | 
					                        Checkbox({ name: 'checkbox1', group: 'checkboxGroup' })
 | 
				
			||||||
                          .select(this.param.videoRecord1 || false)
 | 
					                          .select(this.param.videoRecord1)
 | 
				
			||||||
                          .width(22 * this.ratio)
 | 
					                          .width(22 * this.ratio)
 | 
				
			||||||
                          .height(22 * this.ratio)
 | 
					                          .height(22 * this.ratio)
 | 
				
			||||||
                          .onChange((value: boolean) => {
 | 
					                          .onChange((value: boolean) => {
 | 
				
			||||||
@ -429,7 +429,7 @@ struct Index {
 | 
				
			|||||||
                          })
 | 
					                          })
 | 
				
			||||||
                        Text('一路').fontSize(16 * this.ratio).fontColor('#333333')
 | 
					                        Text('一路').fontSize(16 * this.ratio).fontColor('#333333')
 | 
				
			||||||
                        Checkbox({ name: 'checkbox2', group: 'checkboxGroup' })
 | 
					                        Checkbox({ name: 'checkbox2', group: 'checkboxGroup' })
 | 
				
			||||||
                          .select(this.param.videoRecord2 || false)
 | 
					                          .select(this.param.videoRecord2)
 | 
				
			||||||
                          .width(22 * this.ratio)
 | 
					                          .width(22 * this.ratio)
 | 
				
			||||||
                          .height(22 * this.ratio)
 | 
					                          .height(22 * this.ratio)
 | 
				
			||||||
                          .onChange((value: boolean) => {
 | 
					                          .onChange((value: boolean) => {
 | 
				
			||||||
@ -441,7 +441,7 @@ struct Index {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
                      Row() {
 | 
					                      Row() {
 | 
				
			||||||
                        Checkbox({ name: 'checkbox3', group: 'checkboxGroup' })
 | 
					                        Checkbox({ name: 'checkbox3', group: 'checkboxGroup' })
 | 
				
			||||||
                          .select(this.param.videoRecord3 || false)
 | 
					                          .select(this.param.videoRecord3)
 | 
				
			||||||
                          .width(22 * this.ratio)
 | 
					                          .width(22 * this.ratio)
 | 
				
			||||||
                          .height(22 * this.ratio)
 | 
					                          .height(22 * this.ratio)
 | 
				
			||||||
                          .onChange((value: boolean) => {
 | 
					                          .onChange((value: boolean) => {
 | 
				
			||||||
@ -450,7 +450,7 @@ struct Index {
 | 
				
			|||||||
                          })
 | 
					                          })
 | 
				
			||||||
                        Text('三路').fontSize(16 * this.ratio).fontColor('#333333')
 | 
					                        Text('三路').fontSize(16 * this.ratio).fontColor('#333333')
 | 
				
			||||||
                        Checkbox({ name: 'checkbox4', group: 'checkboxGroup' })
 | 
					                        Checkbox({ name: 'checkbox4', group: 'checkboxGroup' })
 | 
				
			||||||
                          .select(this.param.videoRecord4 || false)
 | 
					                          .select(this.param.videoRecord4)
 | 
				
			||||||
                          .width(22 * this.ratio)
 | 
					                          .width(22 * this.ratio)
 | 
				
			||||||
                          .height(22 * this.ratio)
 | 
					                          .height(22 * this.ratio)
 | 
				
			||||||
                          .onChange((value: boolean) => {
 | 
					                          .onChange((value: boolean) => {
 | 
				
			||||||
@ -469,7 +469,7 @@ struct Index {
 | 
				
			|||||||
                    Column() {
 | 
					                    Column() {
 | 
				
			||||||
                      Row() {
 | 
					                      Row() {
 | 
				
			||||||
                        Checkbox({ name: 'checkbox1', group: 'checkboxGroup' })
 | 
					                        Checkbox({ name: 'checkbox1', group: 'checkboxGroup' })
 | 
				
			||||||
                          .select(this.param.spzd1 || false)
 | 
					                          .select(this.param.spzd1)
 | 
				
			||||||
                          .width(22 * this.ratio)
 | 
					                          .width(22 * this.ratio)
 | 
				
			||||||
                          .height(22 * this.ratio)
 | 
					                          .height(22 * this.ratio)
 | 
				
			||||||
                          .onChange((value: boolean) => {
 | 
					                          .onChange((value: boolean) => {
 | 
				
			||||||
@ -477,7 +477,7 @@ struct Index {
 | 
				
			|||||||
                          })
 | 
					                          })
 | 
				
			||||||
                        Text('一路').fontSize(16 * this.ratio).fontColor('#333333')
 | 
					                        Text('一路').fontSize(16 * this.ratio).fontColor('#333333')
 | 
				
			||||||
                        Checkbox({ name: 'checkbox1', group: 'checkboxGroup' })
 | 
					                        Checkbox({ name: 'checkbox1', group: 'checkboxGroup' })
 | 
				
			||||||
                          .select(this.param.spzd2 || false)
 | 
					                          .select(this.param.spzd2)
 | 
				
			||||||
                          .width(22 * this.ratio)
 | 
					                          .width(22 * this.ratio)
 | 
				
			||||||
                          .height(22 * this.ratio)
 | 
					                          .height(22 * this.ratio)
 | 
				
			||||||
                          .onChange((value: boolean) => {
 | 
					                          .onChange((value: boolean) => {
 | 
				
			||||||
@ -488,7 +488,7 @@ struct Index {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
                      Row() {
 | 
					                      Row() {
 | 
				
			||||||
                        Checkbox({ name: 'checkbox1', group: 'checkboxGroup' })
 | 
					                        Checkbox({ name: 'checkbox1', group: 'checkboxGroup' })
 | 
				
			||||||
                          .select(this.param.spzd3 || false)
 | 
					                          .select(this.param.spzd3)
 | 
				
			||||||
                          .width(22 * this.ratio)
 | 
					                          .width(22 * this.ratio)
 | 
				
			||||||
                          .height(22 * this.ratio)
 | 
					                          .height(22 * this.ratio)
 | 
				
			||||||
                          .onChange((value: boolean) => {
 | 
					                          .onChange((value: boolean) => {
 | 
				
			||||||
@ -496,7 +496,7 @@ struct Index {
 | 
				
			|||||||
                          })
 | 
					                          })
 | 
				
			||||||
                        Text('三路').fontSize(16 * this.ratio).fontColor('#333333')
 | 
					                        Text('三路').fontSize(16 * this.ratio).fontColor('#333333')
 | 
				
			||||||
                        Checkbox({ name: 'checkbox1', group: 'checkboxGroup' })
 | 
					                        Checkbox({ name: 'checkbox1', group: 'checkboxGroup' })
 | 
				
			||||||
                          .select(this.param.spzd4 || false)
 | 
					                          .select(this.param.spzd4)
 | 
				
			||||||
                          .width(22 * this.ratio)
 | 
					                          .width(22 * this.ratio)
 | 
				
			||||||
                          .height(22 * this.ratio)
 | 
					                          .height(22 * this.ratio)
 | 
				
			||||||
                          .onChange((value: boolean) => {
 | 
					                          .onChange((value: boolean) => {
 | 
				
			||||||
@ -513,7 +513,7 @@ struct Index {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
            Row() {
 | 
					            Row() {
 | 
				
			||||||
              Checkbox({ name: 'checkbox1', group: 'checkboxGroup' })
 | 
					              Checkbox({ name: 'checkbox1', group: 'checkboxGroup' })
 | 
				
			||||||
                .select(this.param.shuiying || false)
 | 
					                .select(this.param.shuiying)
 | 
				
			||||||
                .width(22 * this.ratio)
 | 
					                .width(22 * this.ratio)
 | 
				
			||||||
                .height(22 * this.ratio)
 | 
					                .height(22 * this.ratio)
 | 
				
			||||||
                .onChange((value: boolean) => {
 | 
					                .onChange((value: boolean) => {
 | 
				
			||||||
@ -591,7 +591,7 @@ struct Index {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  aboutToAppear() {
 | 
					  aboutToAppear() {
 | 
				
			||||||
    // this.ratio = globalThis.ratio
 | 
					    // this.ratio = globalThis.ratio
 | 
				
			||||||
    this.ratio = AppStorage.get<number>('ratio') || 0
 | 
					    this.ratio = AppStorage.get<number>('ratio')
 | 
				
			||||||
    this.openFlag = true
 | 
					    this.openFlag = true
 | 
				
			||||||
    const fileUtil = new FileUtils(this.context)
 | 
					    const fileUtil = new FileUtils(this.context)
 | 
				
			||||||
    this.fileUtil = fileUtil
 | 
					    this.fileUtil = fileUtil
 | 
				
			||||||
 | 
				
			|||||||
@ -41,9 +41,9 @@ export default struct FaceCompare {
 | 
				
			|||||||
  @State carInfo: CarInfoType = {};
 | 
					  @State carInfo: CarInfoType = {};
 | 
				
			||||||
  @State param: VideoConfig = VideoConfigData
 | 
					  @State param: VideoConfig = VideoConfigData
 | 
				
			||||||
  private times = 1; //人脸比对失败次数, 超过3次将不会自动比对,需要点击重新打开重新触发
 | 
					  private times = 1; //人脸比对失败次数, 超过3次将不会自动比对,需要点击重新打开重新触发
 | 
				
			||||||
  private vocObj!: voiceService;
 | 
					  private vocObj: voiceService = null;
 | 
				
			||||||
  private controller: VideoController = new VideoController()
 | 
					  private controller: VideoController = new VideoController()
 | 
				
			||||||
  private fileUtil!: FileUtils
 | 
					  private fileUtil: FileUtils
 | 
				
			||||||
  private interval: number = -1
 | 
					  private interval: number = -1
 | 
				
			||||||
  private context = getContext(this) as common.UIAbilityContext;
 | 
					  private context = getContext(this) as common.UIAbilityContext;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -175,7 +175,7 @@ export default struct FaceCompare {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  async aboutToAppear() {
 | 
					  async aboutToAppear() {
 | 
				
			||||||
    const fileUtil = new FileUtils(this.context)
 | 
					    const fileUtil = new FileUtils(this.context)
 | 
				
			||||||
    this.carInfo = AppStorage.get<CarInfoType>('carInfo')!
 | 
					    this.carInfo = AppStorage.get<CarInfoType>('carInfo')
 | 
				
			||||||
    this.fileUtil = fileUtil
 | 
					    this.fileUtil = fileUtil
 | 
				
			||||||
    this.getVideoConfig()
 | 
					    this.getVideoConfig()
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
@ -195,13 +195,13 @@ export default struct FaceCompare {
 | 
				
			|||||||
    faceCompare({
 | 
					    faceCompare({
 | 
				
			||||||
      sfzh: this.sfzh,
 | 
					      sfzh: this.sfzh,
 | 
				
			||||||
      firstImage: this.firstImage.substr(22),
 | 
					      firstImage: this.firstImage.substr(22),
 | 
				
			||||||
      secondImage: data.base64 || "",
 | 
					      secondImage: data.base64,
 | 
				
			||||||
      type: "2",
 | 
					      type: "2",
 | 
				
			||||||
      verifyType: "1"
 | 
					      verifyType: "1"
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
      .then(res => {
 | 
					      .then(res => {
 | 
				
			||||||
        console.log('mmmmm8', JSON.stringify(res))
 | 
					        console.log('mmmmm8', JSON.stringify(res))
 | 
				
			||||||
        if (res.imageCompareRsp?.head?.resultCode == '0') {
 | 
					        if (res.imageCompareRsp.head.resultCode == '0') {
 | 
				
			||||||
          this.controller.stop()
 | 
					          this.controller.stop()
 | 
				
			||||||
          this.showFaceCompare = !this.showFaceCompare
 | 
					          this.showFaceCompare = !this.showFaceCompare
 | 
				
			||||||
          this.showFaceCompareFlag = !this.showFaceCompareFlag
 | 
					          this.showFaceCompareFlag = !this.showFaceCompareFlag
 | 
				
			||||||
@ -231,9 +231,7 @@ export default struct FaceCompare {
 | 
				
			|||||||
    const str = this.lsh
 | 
					    const str = this.lsh
 | 
				
			||||||
    console.log('this.lshbitbit', this.lsh, this.carInfo.carNo, this.carInfo.examinationRoomId)
 | 
					    console.log('this.lshbitbit', this.lsh, this.carInfo.carNo, this.carInfo.examinationRoomId)
 | 
				
			||||||
    for (let i = 0; i < str.length; i++) {
 | 
					    for (let i = 0; i < str.length; i++) {
 | 
				
			||||||
      if (str && str.charCodeAt(i) !== undefined) {
 | 
					      tmpList.push(NumberToByteArray(str.charCodeAt(i), 1 * 8)[0])
 | 
				
			||||||
        tmpList.push(NumberToByteArray(str.charCodeAt(i), 1 * 8)[0]);
 | 
					 | 
				
			||||||
      }
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    const param: UDPParamType = {
 | 
					    const param: UDPParamType = {
 | 
				
			||||||
      id: 46,
 | 
					      id: 46,
 | 
				
			||||||
@ -284,33 +282,34 @@ export default struct FaceCompare {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  async getVideoConfig() {
 | 
					  async getVideoConfig() {
 | 
				
			||||||
    console.log('faceEnterIn')
 | 
					    console.log('faceEnterIn')
 | 
				
			||||||
    this.vocObj = new voiceService(async (status: string, val?: string) => {
 | 
					    this.vocObj = new voiceService(async (status: string, val: string) => {
 | 
				
			||||||
      if (status == 'idle') {
 | 
					      if (status == 'idle') {
 | 
				
			||||||
        if (val === 'face_check.mp3' || val === 'face_fail.mp3') {
 | 
					        if (val == 'face_check.mp3' || val == 'face_fail.mp3') {
 | 
				
			||||||
          if (this.times >= 3) {
 | 
					          if (this.times >= 3) {
 | 
				
			||||||
            AppStorage.setOrCreate('statue', 3);
 | 
					            AppStorage.setOrCreate('statue', 3)
 | 
				
			||||||
            this.faceCompareSucess = -1;
 | 
					            this.faceCompareSucess = -1;
 | 
				
			||||||
            this.vocObj && this.vocObj.playAudio({
 | 
					            this.vocObj && this.vocObj.playAudio({
 | 
				
			||||||
              type: 1,
 | 
					              type: 1,
 | 
				
			||||||
              name: 'face_checking.wav',
 | 
					              name: 'face_checking.wav'
 | 
				
			||||||
            });
 | 
					            })
 | 
				
			||||||
            this.heartMsg();
 | 
					            this.heartMsg()
 | 
				
			||||||
          } else {
 | 
					          } else {
 | 
				
			||||||
            setTimeout(() => {
 | 
					            setTimeout(() => {
 | 
				
			||||||
              this.faceComparFn();
 | 
					              this.faceComparFn()
 | 
				
			||||||
            }, 2000);
 | 
					            }, 2000)
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
        } else if (val === 'yzcg.wav') {
 | 
					        } else if (val == 'yzcg.wav') {
 | 
				
			||||||
          this.showFaceCompare = !this.showFaceCompare;
 | 
					          this.showFaceCompare = !this.showFaceCompare
 | 
				
			||||||
          this.showFaceCompareFlag = !this.showFaceCompareFlag;
 | 
					          this.showFaceCompareFlag = !this.showFaceCompareFlag
 | 
				
			||||||
          AppStorage.setOrCreate('statue', 4);
 | 
					          AppStorage.setOrCreate('statue', 4)
 | 
				
			||||||
          this.faceCompareSucess = 1;
 | 
					          this.faceCompareSucess = 1;
 | 
				
			||||||
          this.vocObj && this.vocObj.releasePlayer();
 | 
					          this.vocObj && this.vocObj.releasePlayer()
 | 
				
			||||||
        } else if (val === 'face_chekc_fail.wav') {
 | 
					
 | 
				
			||||||
          this.vocObj && this.vocObj.releasePlayer();
 | 
					        } else if (val == 'face_chekc_fail.wav') {
 | 
				
			||||||
          this.faceCompareSucess = -1;
 | 
					          this.vocObj && this.vocObj.releasePlayer()
 | 
				
			||||||
          this.showFaceCompare = !this.showFaceCompare;
 | 
					          this.faceCompareSucess = -1
 | 
				
			||||||
          this.showFaceCompareFlag = !this.showFaceCompareFlag;
 | 
					          this.showFaceCompare = !this.showFaceCompare
 | 
				
			||||||
 | 
					          this.showFaceCompareFlag = !this.showFaceCompareFlag
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    }, this.context);
 | 
					    }, this.context);
 | 
				
			||||||
 | 
				
			|||||||
@ -4,7 +4,7 @@
 | 
				
			|||||||
export default struct errorMsgDialog {
 | 
					export default struct errorMsgDialog {
 | 
				
			||||||
  dialogRatio: number = 0.8
 | 
					  dialogRatio: number = 0.8
 | 
				
			||||||
  title?: string
 | 
					  title?: string
 | 
				
			||||||
  type?: string
 | 
					  type: string //1 tip 2loading 3Dialog
 | 
				
			||||||
  @State angle: number = 0
 | 
					  @State angle: number = 0
 | 
				
			||||||
  private controller?: CustomDialogController
 | 
					  private controller?: CustomDialogController
 | 
				
			||||||
  cancel: () => void = () => {
 | 
					  cancel: () => void = () => {
 | 
				
			||||||
 | 
				
			|||||||
@ -1,204 +1,198 @@
 | 
				
			|||||||
// import apiJudgeSdk from 'libJudgeSdk.so';
 | 
					import apiJudgeSdk from 'libJudgeSdk.so';
 | 
				
			||||||
// import Judge from '../../judgeSDK/utils/judgeReal';
 | 
					import Judge from '../../judgeSDK/utils/judgeReal';
 | 
				
			||||||
// import { MarkRule, Project, ProjectObj } from '../../judgeSDK/api/judgeSDK.d';
 | 
					import { MarkRule, Project, ProjectObj } from '../../judgeSDK/api/judgeSDK.d';
 | 
				
			||||||
// import common from '@ohos.app.ability.common';
 | 
					import common from '@ohos.app.ability.common';
 | 
				
			||||||
// import {
 | 
					import {
 | 
				
			||||||
//   examJudgeMapSetScaling
 | 
					  examJudgeMapSetScaling
 | 
				
			||||||
// } from '../../judgeSDK/api'
 | 
					} from '../../judgeSDK/api'
 | 
				
			||||||
//
 | 
					
 | 
				
			||||||
// interface RoadDataType {
 | 
					interface RoadDataType {
 | 
				
			||||||
//   name: string,
 | 
					  name: string,
 | 
				
			||||||
//   key: string | string[]
 | 
					  key: string | string[]
 | 
				
			||||||
// }
 | 
					}
 | 
				
			||||||
@Component
 | 
					
 | 
				
			||||||
export default struct RealTime {
 | 
					@Component
 | 
				
			||||||
  build() {
 | 
					export default struct RealTime {
 | 
				
			||||||
  }
 | 
					  @State message: string = '开始绘制'
 | 
				
			||||||
 | 
					  // 控制XComponent组件的创建和销毁
 | 
				
			||||||
 | 
					  @State draw: boolean = false
 | 
				
			||||||
 | 
					  //监管接口序列号
 | 
				
			||||||
 | 
					  @State serialNumber: number = 0
 | 
				
			||||||
 | 
					  //模拟考试项目
 | 
				
			||||||
 | 
					  @State projects: Project[] = []
 | 
				
			||||||
 | 
					  @State projectsObj: ProjectObj = {}
 | 
				
			||||||
 | 
					  @State markRuleListObj: MarkRule = {}
 | 
				
			||||||
 | 
					  @State scaleNum: number = 100
 | 
				
			||||||
 | 
					  @State gpsActive: number = 1
 | 
				
			||||||
 | 
					  private widthNumber: string | number | Resource = 0
 | 
				
			||||||
 | 
					  private heightNumber: string | number | Resource = 0
 | 
				
			||||||
 | 
					  private context = getContext(this) as common.UIAbilityContext;
 | 
				
			||||||
 | 
					  @State ratio: number = 1
 | 
				
			||||||
 | 
					  @State lane: Object = {}
 | 
				
			||||||
 | 
					  @State timer:number = 0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  constructor() {
 | 
				
			||||||
 | 
					    super()
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // xcomponentController: XComponentController = new XComponentController()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  build() {
 | 
				
			||||||
 | 
					    Row() {
 | 
				
			||||||
 | 
					      Column() {
 | 
				
			||||||
 | 
					        Row() {
 | 
				
			||||||
 | 
					          Text('车道信息').fontColor(this.gpsActive == 0 ? '#2D3C5A' : '#fff').fontSize(20)
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        .width('100%')
 | 
				
			||||||
 | 
					        .height(37)
 | 
				
			||||||
 | 
					        .backgroundColor(this.gpsActive == 0 ? '#fff' : '#1A1A1A')
 | 
				
			||||||
 | 
					        .margin({ top: 10 * this.ratio, right: 10 })
 | 
				
			||||||
 | 
					        .justifyContent(FlexAlign.Center)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        Flex({ direction: FlexDirection.Column, justifyContent: FlexAlign.Start }) {
 | 
				
			||||||
 | 
					          ForEach(this.RoadData, (item) => {
 | 
				
			||||||
 | 
					            Column() {
 | 
				
			||||||
 | 
					              Text(`${item.name}:${this.getValues(item)}`)
 | 
				
			||||||
 | 
					                .fontSize(20)
 | 
				
			||||||
 | 
					                .lineHeight(30)
 | 
				
			||||||
 | 
					                .fontColor('#fff')
 | 
				
			||||||
 | 
					            }.height(30).justifyContent(FlexAlign.Start).width('100%')
 | 
				
			||||||
 | 
					          })
 | 
				
			||||||
 | 
					        }.margin({top:5})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      }.width(168 * 1.5)
 | 
				
			||||||
 | 
					      .height(this.heightNumber)
 | 
				
			||||||
 | 
					      .backgroundColor('#282828')
 | 
				
			||||||
 | 
					      .margin({ top: 6 * this.ratio, })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      Column() {
 | 
				
			||||||
 | 
					        if (this.draw) {
 | 
				
			||||||
 | 
					          XComponent({
 | 
				
			||||||
 | 
					            id: 'duolun_plugin_id_draw', //显示轨迹窗口id名称,注意这个ID要和C++侧一致,不能变
 | 
				
			||||||
 | 
					            type: 'surface',
 | 
				
			||||||
 | 
					            libraryname: 'JudgeSdk'
 | 
				
			||||||
 | 
					            // libraryname: 'judgesdk'
 | 
				
			||||||
 | 
					          })
 | 
				
			||||||
 | 
					            .width(this.widthNumber)
 | 
				
			||||||
 | 
					            .height(this.heightNumber)
 | 
				
			||||||
 | 
					            .onLoad(() => {
 | 
				
			||||||
 | 
					              apiJudgeSdk.examJudgeMapSetDrawing(true); //停止绘制地图轨迹,false:表示结束绘制
 | 
				
			||||||
 | 
					            })
 | 
				
			||||||
 | 
					            .onDestroy(() => {
 | 
				
			||||||
 | 
					              apiJudgeSdk.examJudgeMapSetDrawing(false); //停止绘制地图轨迹,false:表示结束绘制
 | 
				
			||||||
 | 
					              this.draw = false;
 | 
				
			||||||
 | 
					            })
 | 
				
			||||||
 | 
					        } else {
 | 
				
			||||||
 | 
					          Column() {
 | 
				
			||||||
 | 
					          }
 | 
				
			||||||
 | 
					          .width(this.widthNumber)
 | 
				
			||||||
 | 
					          .height(this.heightNumber)
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					      .width('100%')
 | 
				
			||||||
 | 
					      .backgroundColor('#fff')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      Row(){
 | 
				
			||||||
 | 
					        Image($rawfile('judge/big.png')).width(60).onClick(()=>{
 | 
				
			||||||
 | 
					          this.scaleFn( -this.getScaleNum() )
 | 
				
			||||||
 | 
					        })
 | 
				
			||||||
 | 
					        Image($rawfile('judge/small.png')).width(60).onClick(()=>{
 | 
				
			||||||
 | 
					          this.scaleFn( this.getScaleNum() )
 | 
				
			||||||
 | 
					        }).margin({left:20})
 | 
				
			||||||
 | 
					      }.position({x:'32%',y:60})
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    .height('100%')
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  async aboutToDisappear() {
 | 
				
			||||||
 | 
					    clearInterval(this.timer)
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					  async aboutToAppear() {
 | 
				
			||||||
 | 
					    const judge = new Judge(this)
 | 
				
			||||||
 | 
					    let timer = setInterval(()=>{
 | 
				
			||||||
 | 
					      this.lane = AppStorage.get('laneData');
 | 
				
			||||||
 | 
					    },1000)
 | 
				
			||||||
 | 
					    this.timer = timer
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  getScaleNum = ()=>{
 | 
				
			||||||
 | 
					    const scaleNum = this.scaleNum;
 | 
				
			||||||
 | 
					    if(scaleNum < 200){
 | 
				
			||||||
 | 
					      return 10
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    if(scaleNum >= 200 && scaleNum < 400){
 | 
				
			||||||
 | 
					      return 30
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if(scaleNum >= 400 && scaleNum < 600){
 | 
				
			||||||
 | 
					      return 50
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if(scaleNum >= 600 && scaleNum < 800){
 | 
				
			||||||
 | 
					      return 70
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if(scaleNum >= 800 && scaleNum < 1000){
 | 
				
			||||||
 | 
					      return 100
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if(scaleNum >= 1000 && scaleNum < 2000){
 | 
				
			||||||
 | 
					      return 500
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    if(scaleNum >= 2000 && scaleNum <= 5000){
 | 
				
			||||||
 | 
					      return 1000
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return 1000
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  getValues(roadColumn) {
 | 
				
			||||||
 | 
					    const lane = this.lane || {};
 | 
				
			||||||
 | 
					    let key = roadColumn.key;
 | 
				
			||||||
 | 
					    let str = ''
 | 
				
			||||||
 | 
					    if (Array.isArray(key)) {
 | 
				
			||||||
 | 
					      key.forEach((k, index) => {
 | 
				
			||||||
 | 
					        str += (lane[k] === undefined ? '' : lane[k]) + (index == key.length - 1 ? '' : '/')
 | 
				
			||||||
 | 
					      })
 | 
				
			||||||
 | 
					    } else {
 | 
				
			||||||
 | 
					      str = lane[key] === undefined ? '' : lane[key]
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    return str
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  private RoadData: Array<RoadDataType> = [
 | 
				
			||||||
 | 
					    { name: '路段组号', key: 'MapRoad_Code_No' },
 | 
				
			||||||
 | 
					    { name: '路段编码', key: 'MapRoad_Name' },
 | 
				
			||||||
 | 
					    { name: '车轮压线', key: ['TouchLineType', 'TouchDir'] },
 | 
				
			||||||
 | 
					    { name: '车身碰线', key: ['TouchLineTypeCS', 'TouchLineDirCS'] },
 | 
				
			||||||
 | 
					    { name: '基准车道', key: ['BasePointInLaneNo', 'BaseLaneCount'] },
 | 
				
			||||||
 | 
					    { name: '前点车道', key: ['FrontPointLaneNo', 'FrontPointLaneCount'] },
 | 
				
			||||||
 | 
					    { name: '后车点道', key: ['BackPointLaneNo','BackPointLaneCount'] },
 | 
				
			||||||
 | 
					    { name: '左前/后车身距离', key: ['Body_LF_ToLeftEdge', 'Body_LB_ToLeftEdge'] },
 | 
				
			||||||
 | 
					    { name: '右前/后车身距离', key: ['Body_RF_ToRightEdge', 'Body_RB_ToRightEdge'] },
 | 
				
			||||||
 | 
					    { name: '右前/后车身边线', key: ['Body_RF_ToBaseLine','Body_RB_ToBaseLine'] },
 | 
				
			||||||
 | 
					    { name: '右前/后轮距离', key: ['Wheel_RF_ToRightEdge', 'Wheel_RB_ToRightEdge'] },
 | 
				
			||||||
 | 
					    { name: '右前/后轮边线', key: ['Wheel_RF_ToBaseLine', 'Wheel_RB_ToBaseLine'] },
 | 
				
			||||||
 | 
					    { name: '左前/后轮距离', key: ['Wheel_LF_ToRightEdge', 'Wheel_LB_ToRightEdge'] },
 | 
				
			||||||
 | 
					    { name: '左前/后轮边线', key: ['Wheel_LF_ToBaseLine', 'Wheel_LB_ToBaseLine'] },
 | 
				
			||||||
 | 
					    { name: '车道属性', key: ['BasePointInLaneDir', 'CrossLineAttr','DirInverse'] },
 | 
				
			||||||
 | 
					    { name: '形状', key: ['InShapeAttr', 'ShapeNo','ShapeNoWheel'] },
 | 
				
			||||||
 | 
					    { name: '路段点', key: ['CrossPointNo'] },
 | 
				
			||||||
 | 
					  ]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  scaleFn = async (num)=>{
 | 
				
			||||||
 | 
					    const scaleNum = this.scaleNum
 | 
				
			||||||
 | 
					    if(scaleNum >0 && scaleNum < 5000){
 | 
				
			||||||
 | 
					      this.scaleNum += num;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    if(scaleNum === 0 && num > 0){
 | 
				
			||||||
 | 
					      this.scaleNum += num;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    if(scaleNum > 5000 && num < 0){
 | 
				
			||||||
 | 
					      this.scaleNum += num;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    await examJudgeMapSetScaling(this.scaleNum);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//
 | 
					 | 
				
			||||||
// @Component
 | 
					 | 
				
			||||||
// export default struct RealTime {
 | 
					 | 
				
			||||||
//   @State message: string = '开始绘制'
 | 
					 | 
				
			||||||
//   // 控制XComponent组件的创建和销毁
 | 
					 | 
				
			||||||
//   @State draw: boolean = false
 | 
					 | 
				
			||||||
//   //监管接口序列号
 | 
					 | 
				
			||||||
//   @State serialNumber: number = 0
 | 
					 | 
				
			||||||
//   //模拟考试项目
 | 
					 | 
				
			||||||
//   @State projects: Project[] = []
 | 
					 | 
				
			||||||
//   @State projectsObj: ProjectObj = {}
 | 
					 | 
				
			||||||
//   @State markRuleListObj: MarkRule = {}
 | 
					 | 
				
			||||||
//   @State scaleNum: number = 100
 | 
					 | 
				
			||||||
//   @State gpsActive: number = 1
 | 
					 | 
				
			||||||
//   private widthNumber: string | number | Resource = 0
 | 
					 | 
				
			||||||
//   private heightNumber: string | number | Resource = 0
 | 
					 | 
				
			||||||
//   private context = getContext(this) as common.UIAbilityContext;
 | 
					 | 
				
			||||||
//   @State ratio: number = 1
 | 
					 | 
				
			||||||
//   @State lane: Object = {}
 | 
					 | 
				
			||||||
//   @State timer:number = 0
 | 
					 | 
				
			||||||
//
 | 
					 | 
				
			||||||
//   constructor() {
 | 
					 | 
				
			||||||
//     super()
 | 
					 | 
				
			||||||
//   }
 | 
					 | 
				
			||||||
//
 | 
					 | 
				
			||||||
//   // xcomponentController: XComponentController = new XComponentController()
 | 
					 | 
				
			||||||
//
 | 
					 | 
				
			||||||
//   build() {
 | 
					 | 
				
			||||||
//     Row() {
 | 
					 | 
				
			||||||
//       Column() {
 | 
					 | 
				
			||||||
//         Row() {
 | 
					 | 
				
			||||||
//           Text('车道信息').fontColor(this.gpsActive == 0 ? '#2D3C5A' : '#fff').fontSize(20)
 | 
					 | 
				
			||||||
//         }
 | 
					 | 
				
			||||||
//         .width('100%')
 | 
					 | 
				
			||||||
//         .height(37)
 | 
					 | 
				
			||||||
//         .backgroundColor(this.gpsActive == 0 ? '#fff' : '#1A1A1A')
 | 
					 | 
				
			||||||
//         .margin({ top: 10 * this.ratio, right: 10 })
 | 
					 | 
				
			||||||
//         .justifyContent(FlexAlign.Center)
 | 
					 | 
				
			||||||
//
 | 
					 | 
				
			||||||
//         Flex({ direction: FlexDirection.Column, justifyContent: FlexAlign.Start }) {
 | 
					 | 
				
			||||||
//           ForEach(this.RoadData, (item) => {
 | 
					 | 
				
			||||||
//             Column() {
 | 
					 | 
				
			||||||
//               Text(`${item.name}:${this.getValues(item)}`)
 | 
					 | 
				
			||||||
//                 .fontSize(20)
 | 
					 | 
				
			||||||
//                 .lineHeight(30)
 | 
					 | 
				
			||||||
//                 .fontColor('#fff')
 | 
					 | 
				
			||||||
//             }.height(30).justifyContent(FlexAlign.Start).width('100%')
 | 
					 | 
				
			||||||
//           })
 | 
					 | 
				
			||||||
//         }.margin({top:5})
 | 
					 | 
				
			||||||
//
 | 
					 | 
				
			||||||
//       }.width(168 * 1.5)
 | 
					 | 
				
			||||||
//       .height(this.heightNumber)
 | 
					 | 
				
			||||||
//       .backgroundColor('#282828')
 | 
					 | 
				
			||||||
//       .margin({ top: 6 * this.ratio, })
 | 
					 | 
				
			||||||
//
 | 
					 | 
				
			||||||
//       Column() {
 | 
					 | 
				
			||||||
//         if (this.draw) {
 | 
					 | 
				
			||||||
//           XComponent({
 | 
					 | 
				
			||||||
//             id: 'duolun_plugin_id_draw', //显示轨迹窗口id名称,注意这个ID要和C++侧一致,不能变
 | 
					 | 
				
			||||||
//             type: 'surface',
 | 
					 | 
				
			||||||
//             libraryname: 'JudgeSdk'
 | 
					 | 
				
			||||||
//             // libraryname: 'judgesdk'
 | 
					 | 
				
			||||||
//           })
 | 
					 | 
				
			||||||
//             .width(this.widthNumber)
 | 
					 | 
				
			||||||
//             .height(this.heightNumber)
 | 
					 | 
				
			||||||
//             .onLoad(() => {
 | 
					 | 
				
			||||||
//               apiJudgeSdk.examJudgeMapSetDrawing(true); //停止绘制地图轨迹,false:表示结束绘制
 | 
					 | 
				
			||||||
//             })
 | 
					 | 
				
			||||||
//             .onDestroy(() => {
 | 
					 | 
				
			||||||
//               apiJudgeSdk.examJudgeMapSetDrawing(false); //停止绘制地图轨迹,false:表示结束绘制
 | 
					 | 
				
			||||||
//               this.draw = false;
 | 
					 | 
				
			||||||
//             })
 | 
					 | 
				
			||||||
//         } else {
 | 
					 | 
				
			||||||
//           Column() {
 | 
					 | 
				
			||||||
//           }
 | 
					 | 
				
			||||||
//           .width(this.widthNumber)
 | 
					 | 
				
			||||||
//           .height(this.heightNumber)
 | 
					 | 
				
			||||||
//         }
 | 
					 | 
				
			||||||
//       }
 | 
					 | 
				
			||||||
//       .width('100%')
 | 
					 | 
				
			||||||
//       .backgroundColor('#fff')
 | 
					 | 
				
			||||||
//
 | 
					 | 
				
			||||||
//       Row(){
 | 
					 | 
				
			||||||
//         Image($rawfile('judge/big.png')).width(60).onClick(()=>{
 | 
					 | 
				
			||||||
//           this.scaleFn( -this.getScaleNum() )
 | 
					 | 
				
			||||||
//         })
 | 
					 | 
				
			||||||
//         Image($rawfile('judge/small.png')).width(60).onClick(()=>{
 | 
					 | 
				
			||||||
//           this.scaleFn( this.getScaleNum() )
 | 
					 | 
				
			||||||
//         }).margin({left:20})
 | 
					 | 
				
			||||||
//       }.position({x:'32%',y:60})
 | 
					 | 
				
			||||||
//     }
 | 
					 | 
				
			||||||
//     .height('100%')
 | 
					 | 
				
			||||||
//   }
 | 
					 | 
				
			||||||
//
 | 
					 | 
				
			||||||
//   async aboutToDisappear() {
 | 
					 | 
				
			||||||
//     clearInterval(this.timer)
 | 
					 | 
				
			||||||
//   }
 | 
					 | 
				
			||||||
//   async aboutToAppear() {
 | 
					 | 
				
			||||||
//     const judge = new Judge(this)
 | 
					 | 
				
			||||||
//     let timer = setInterval(()=>{
 | 
					 | 
				
			||||||
//       this.lane = AppStorage.get('laneData');
 | 
					 | 
				
			||||||
//     },1000)
 | 
					 | 
				
			||||||
//     this.timer = timer
 | 
					 | 
				
			||||||
//   }
 | 
					 | 
				
			||||||
//
 | 
					 | 
				
			||||||
//   getScaleNum = ()=>{
 | 
					 | 
				
			||||||
//     const scaleNum = this.scaleNum;
 | 
					 | 
				
			||||||
//     if(scaleNum < 200){
 | 
					 | 
				
			||||||
//       return 10
 | 
					 | 
				
			||||||
//     }
 | 
					 | 
				
			||||||
//     if(scaleNum >= 200 && scaleNum < 400){
 | 
					 | 
				
			||||||
//       return 30
 | 
					 | 
				
			||||||
//     }
 | 
					 | 
				
			||||||
//
 | 
					 | 
				
			||||||
//     if(scaleNum >= 400 && scaleNum < 600){
 | 
					 | 
				
			||||||
//       return 50
 | 
					 | 
				
			||||||
//     }
 | 
					 | 
				
			||||||
//
 | 
					 | 
				
			||||||
//     if(scaleNum >= 600 && scaleNum < 800){
 | 
					 | 
				
			||||||
//       return 70
 | 
					 | 
				
			||||||
//     }
 | 
					 | 
				
			||||||
//
 | 
					 | 
				
			||||||
//     if(scaleNum >= 800 && scaleNum < 1000){
 | 
					 | 
				
			||||||
//       return 100
 | 
					 | 
				
			||||||
//     }
 | 
					 | 
				
			||||||
//
 | 
					 | 
				
			||||||
//     if(scaleNum >= 1000 && scaleNum < 2000){
 | 
					 | 
				
			||||||
//       return 500
 | 
					 | 
				
			||||||
//     }
 | 
					 | 
				
			||||||
//     if(scaleNum >= 2000 && scaleNum <= 5000){
 | 
					 | 
				
			||||||
//       return 1000
 | 
					 | 
				
			||||||
//     }
 | 
					 | 
				
			||||||
//
 | 
					 | 
				
			||||||
//     return 1000
 | 
					 | 
				
			||||||
//   }
 | 
					 | 
				
			||||||
//
 | 
					 | 
				
			||||||
//   getValues(roadColumn) {
 | 
					 | 
				
			||||||
//     const lane = this.lane || {};
 | 
					 | 
				
			||||||
//     let key = roadColumn.key;
 | 
					 | 
				
			||||||
//     let str = ''
 | 
					 | 
				
			||||||
//     if (Array.isArray(key)) {
 | 
					 | 
				
			||||||
//       key.forEach((k, index) => {
 | 
					 | 
				
			||||||
//         str += (lane[k] === undefined ? '' : lane[k]) + (index == key.length - 1 ? '' : '/')
 | 
					 | 
				
			||||||
//       })
 | 
					 | 
				
			||||||
//     } else {
 | 
					 | 
				
			||||||
//       str = lane[key] === undefined ? '' : lane[key]
 | 
					 | 
				
			||||||
//     }
 | 
					 | 
				
			||||||
//     return str
 | 
					 | 
				
			||||||
//   }
 | 
					 | 
				
			||||||
//
 | 
					 | 
				
			||||||
//   private RoadData: Array<RoadDataType> = [
 | 
					 | 
				
			||||||
//     { name: '路段组号', key: 'MapRoad_Code_No' },
 | 
					 | 
				
			||||||
//     { name: '路段编码', key: 'MapRoad_Name' },
 | 
					 | 
				
			||||||
//     { name: '车轮压线', key: ['TouchLineType', 'TouchDir'] },
 | 
					 | 
				
			||||||
//     { name: '车身碰线', key: ['TouchLineTypeCS', 'TouchLineDirCS'] },
 | 
					 | 
				
			||||||
//     { name: '基准车道', key: ['BasePointInLaneNo', 'BaseLaneCount'] },
 | 
					 | 
				
			||||||
//     { name: '前点车道', key: ['FrontPointLaneNo', 'FrontPointLaneCount'] },
 | 
					 | 
				
			||||||
//     { name: '后车点道', key: ['BackPointLaneNo','BackPointLaneCount'] },
 | 
					 | 
				
			||||||
//     { name: '左前/后车身距离', key: ['Body_LF_ToLeftEdge', 'Body_LB_ToLeftEdge'] },
 | 
					 | 
				
			||||||
//     { name: '右前/后车身距离', key: ['Body_RF_ToRightEdge', 'Body_RB_ToRightEdge'] },
 | 
					 | 
				
			||||||
//     { name: '右前/后车身边线', key: ['Body_RF_ToBaseLine','Body_RB_ToBaseLine'] },
 | 
					 | 
				
			||||||
//     { name: '右前/后轮距离', key: ['Wheel_RF_ToRightEdge', 'Wheel_RB_ToRightEdge'] },
 | 
					 | 
				
			||||||
//     { name: '右前/后轮边线', key: ['Wheel_RF_ToBaseLine', 'Wheel_RB_ToBaseLine'] },
 | 
					 | 
				
			||||||
//     { name: '左前/后轮距离', key: ['Wheel_LF_ToRightEdge', 'Wheel_LB_ToRightEdge'] },
 | 
					 | 
				
			||||||
//     { name: '左前/后轮边线', key: ['Wheel_LF_ToBaseLine', 'Wheel_LB_ToBaseLine'] },
 | 
					 | 
				
			||||||
//     { name: '车道属性', key: ['BasePointInLaneDir', 'CrossLineAttr','DirInverse'] },
 | 
					 | 
				
			||||||
//     { name: '形状', key: ['InShapeAttr', 'ShapeNo','ShapeNoWheel'] },
 | 
					 | 
				
			||||||
//     { name: '路段点', key: ['CrossPointNo'] },
 | 
					 | 
				
			||||||
//   ]
 | 
					 | 
				
			||||||
//
 | 
					 | 
				
			||||||
//   scaleFn = async (num)=>{
 | 
					 | 
				
			||||||
//     const scaleNum = this.scaleNum
 | 
					 | 
				
			||||||
//     if(scaleNum >0 && scaleNum < 5000){
 | 
					 | 
				
			||||||
//       this.scaleNum += num;
 | 
					 | 
				
			||||||
//     }
 | 
					 | 
				
			||||||
//     if(scaleNum === 0 && num > 0){
 | 
					 | 
				
			||||||
//       this.scaleNum += num;
 | 
					 | 
				
			||||||
//     }
 | 
					 | 
				
			||||||
//     if(scaleNum > 5000 && num < 0){
 | 
					 | 
				
			||||||
//       this.scaleNum += num;
 | 
					 | 
				
			||||||
//     }
 | 
					 | 
				
			||||||
//     await examJudgeMapSetScaling(this.scaleNum);
 | 
					 | 
				
			||||||
//   }
 | 
					 | 
				
			||||||
//
 | 
					 | 
				
			||||||
// }
 | 
					 | 
				
			||||||
//
 | 
					 | 
				
			||||||
 | 
				
			|||||||
@ -132,9 +132,7 @@ class AVPlayer {
 | 
				
			|||||||
          resolve(true)
 | 
					          resolve(true)
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
        try {
 | 
					        try {
 | 
				
			||||||
          if (this.avPlayer) {
 | 
					          this.avPlayer.fdSrc = await this.context.resourceManager.getRawFd(name);
 | 
				
			||||||
            this.avPlayer.fdSrc = await this.context.resourceManager.getRawFd(name);
 | 
					 | 
				
			||||||
          }
 | 
					 | 
				
			||||||
        } catch (e) {
 | 
					        } catch (e) {
 | 
				
			||||||
          Prompt.showToast({
 | 
					          Prompt.showToast({
 | 
				
			||||||
            message: `${name}语音文件不存在`,
 | 
					            message: `${name}语音文件不存在`,
 | 
				
			||||||
@ -166,7 +164,7 @@ class AVPlayer {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  //音频播放队列
 | 
					  //音频播放队列
 | 
				
			||||||
  public releasePlayer() {
 | 
					  public releasePlayer() {
 | 
				
			||||||
    this.avPlayer!.release();
 | 
					    this.avPlayer.release();
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  avPlayerStop = () => {
 | 
					  avPlayerStop = () => {
 | 
				
			||||||
@ -177,7 +175,7 @@ class AVPlayer {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  // 注册avplayer回调函数
 | 
					  // 注册avplayer回调函数
 | 
				
			||||||
  setAVPlayerCallback(callBack: Function) {
 | 
					  setAVPlayerCallback(callBack: Function) {
 | 
				
			||||||
    this.avPlayer!.on('error', (err: BusinessError) => {
 | 
					    this.avPlayer.on('error', (err: BusinessError) => {
 | 
				
			||||||
      console.log(TAG, '播放器错误', JSON.stringify(err))
 | 
					      console.log(TAG, '播放器错误', JSON.stringify(err))
 | 
				
			||||||
      this.avPlayer && this.avPlayer.stop()
 | 
					      this.avPlayer && this.avPlayer.stop()
 | 
				
			||||||
      this.avPlayer && this.avPlayer.reset()
 | 
					      this.avPlayer && this.avPlayer.reset()
 | 
				
			||||||
@ -186,17 +184,17 @@ class AVPlayer {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    let num = 0;
 | 
					    let num = 0;
 | 
				
			||||||
    // 状态机变化回调函数
 | 
					    // 状态机变化回调函数
 | 
				
			||||||
    this.avPlayer!.on('stateChange', async (state, reason) => {
 | 
					    this.avPlayer.on('stateChange', async (state, reason) => {
 | 
				
			||||||
      const endCallback = this.endCallback;
 | 
					      const endCallback = this.endCallback;
 | 
				
			||||||
      switch (state) {
 | 
					      switch (state) {
 | 
				
			||||||
        case 'idle': // 成功调用reset接口后触发该状态机上报
 | 
					        case 'idle': // 成功调用reset接口后触发该状态机上报
 | 
				
			||||||
          break;
 | 
					          break;
 | 
				
			||||||
        case 'initialized': // avplayer 设置播放源后触发该状态上报
 | 
					        case 'initialized': // avplayer 设置播放源后触发该状态上报
 | 
				
			||||||
          this.avPlayer!.prepare()
 | 
					          this.avPlayer.prepare()
 | 
				
			||||||
          break;
 | 
					          break;
 | 
				
			||||||
        case 'prepared': // prepare调用成功后上报该状态机
 | 
					        case 'prepared': // prepare调用成功后上报该状态机
 | 
				
			||||||
          console.info(TAG, '播放资源播放')
 | 
					          console.info(TAG, '播放资源播放')
 | 
				
			||||||
          this.avPlayer!.play();
 | 
					          this.avPlayer.play();
 | 
				
			||||||
          // this.voiceStatus = 'playing'
 | 
					          // this.voiceStatus = 'playing'
 | 
				
			||||||
          break;
 | 
					          break;
 | 
				
			||||||
        case 'playing': // play成功调用后触发该状态机上报
 | 
					        case 'playing': // play成功调用后触发该状态机上报
 | 
				
			||||||
@ -205,10 +203,10 @@ class AVPlayer {
 | 
				
			|||||||
          break;
 | 
					          break;
 | 
				
			||||||
        case 'completed': // 播放结束后触发该状态机上报
 | 
					        case 'completed': // 播放结束后触发该状态机上报
 | 
				
			||||||
          // this.voiceStatus = 'completed'
 | 
					          // this.voiceStatus = 'completed'
 | 
				
			||||||
          this.avPlayer!.stop(); //调用播放结束接口
 | 
					          this.avPlayer.stop(); //调用播放结束接口
 | 
				
			||||||
          break;
 | 
					          break;
 | 
				
			||||||
        case 'stopped': // stop接口成功调用后触发该状态机上报
 | 
					        case 'stopped': // stop接口成功调用后触发该状态机上报
 | 
				
			||||||
          this.avPlayer!.reset(); // 调用reset接口初始化avplayer状态
 | 
					          this.avPlayer.reset(); // 调用reset接口初始化avplayer状态
 | 
				
			||||||
          console.info(TAG, '播放资源释放')
 | 
					          console.info(TAG, '播放资源释放')
 | 
				
			||||||
          if (endCallback) {
 | 
					          if (endCallback) {
 | 
				
			||||||
            endCallback()
 | 
					            endCallback()
 | 
				
			||||||
 | 
				
			|||||||
@ -23,9 +23,10 @@ export class FileHelper {
 | 
				
			|||||||
    photoAccessHelper.PhotoKeys.DATE_TRASHED,
 | 
					    photoAccessHelper.PhotoKeys.DATE_TRASHED,
 | 
				
			||||||
    photoAccessHelper.PhotoKeys.HIDDEN
 | 
					    photoAccessHelper.PhotoKeys.HIDDEN
 | 
				
			||||||
  ];
 | 
					  ];
 | 
				
			||||||
  private userFileMgr!: photoAccessHelper.PhotoAccessHelper
 | 
					  private userFileMgr: photoAccessHelper.PhotoAccessHelper = undefined;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  constructor(context: common.UIAbilityContext) {
 | 
					  constructor() {
 | 
				
			||||||
 | 
					    const context: common.UIAbilityContext = AppStorage.get('context')
 | 
				
			||||||
    this.userFileMgr = photoAccessHelper.getPhotoAccessHelper(context);
 | 
					    this.userFileMgr = photoAccessHelper.getPhotoAccessHelper(context);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -81,7 +81,7 @@ export async function endRecordVideo(record_handleObj: RecordHandleType) {
 | 
				
			|||||||
export async function saveStartRecordVideo(path: string, context?: common.UIAbilityContext): Promise<RecordHandleType> {
 | 
					export async function saveStartRecordVideo(path: string, context?: common.UIAbilityContext): Promise<RecordHandleType> {
 | 
				
			||||||
  return new Promise(async (resolve, reject) => {
 | 
					  return new Promise(async (resolve, reject) => {
 | 
				
			||||||
    const fileUtil = new FileUtils(context)
 | 
					    const fileUtil = new FileUtils(context)
 | 
				
			||||||
    const fileHelper = new FileHelper(context);
 | 
					    const fileHelper = new FileHelper();
 | 
				
			||||||
    // const date = dateFormat(new Date).split(' ')[0]
 | 
					    // const date = dateFormat(new Date).split(' ')[0]
 | 
				
			||||||
    const date = dayTs().format('YYYY-MM-DD HH:mm:ss').split(' ')[0]
 | 
					    const date = dayTs().format('YYYY-MM-DD HH:mm:ss').split(' ')[0]
 | 
				
			||||||
    fileHelper.createAlbum(date);
 | 
					    fileHelper.createAlbum(date);
 | 
				
			||||||
@ -97,7 +97,7 @@ export async function saveStartRecordVideo(path: string, context?: common.UIAbil
 | 
				
			|||||||
    for (let i = 1; i <= 4; i++) {
 | 
					    for (let i = 1; i <= 4; i++) {
 | 
				
			||||||
      if (Reflect.get(param, 'videoRecord' + i)) {
 | 
					      if (Reflect.get(param, 'videoRecord' + i)) {
 | 
				
			||||||
        // Reflect.set(record_handle, i, await getFileHandleCode(i, param, date, path, i));
 | 
					        // Reflect.set(record_handle, i, await getFileHandleCode(i, param, date, path, i));
 | 
				
			||||||
        const data = await startRecordVideo(param, i, context!, date, path, i);
 | 
					        const data = await startRecordVideo(param, i, context, date, path, i);
 | 
				
			||||||
        Reflect.set(record_handle, i, data);
 | 
					        Reflect.set(record_handle, i, data);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
@ -129,6 +129,7 @@ interface takePhotoParam {
 | 
				
			|||||||
 * @param callback
 | 
					 * @param callback
 | 
				
			||||||
 * @returns
 | 
					 * @returns
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					const fileHelper = new FileHelper();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export async function delPic(day: number, type: number, context?: common.UIAbilityContext) {
 | 
					export async function delPic(day: number, type: number, context?: common.UIAbilityContext) {
 | 
				
			||||||
  let phAccessHelper = photoAccessHelper.getPhotoAccessHelper(context);
 | 
					  let phAccessHelper = photoAccessHelper.getPhotoAccessHelper(context);
 | 
				
			||||||
@ -149,7 +150,7 @@ export async function delPic(day: number, type: number, context?: common.UIAbili
 | 
				
			|||||||
  for (let i = 0; i <= albums.length; i++) {
 | 
					  for (let i = 0; i <= albums.length; i++) {
 | 
				
			||||||
    let albumName = albums[i].albumName
 | 
					    let albumName = albums[i].albumName
 | 
				
			||||||
    if (IsDaysAgo(albumName, day) && albumName != 'jt' && albumName != 'pz') {
 | 
					    if (IsDaysAgo(albumName, day) && albumName != 'jt' && albumName != 'pz') {
 | 
				
			||||||
      deleteAllFileByPiC(albumName, type, context)
 | 
					      deleteAllFileByPiC(albumName, type)
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@ -195,8 +196,8 @@ export async function takePhoto(param: VideoConfig, context: common.UIAbilityCon
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//type:1 是图片 2是视频
 | 
					//type:1 是图片 2是视频
 | 
				
			||||||
export async function deleteAllFileByPiC(dirName: string, type = 1, context: common.UIAbilityContext) {
 | 
					export async function deleteAllFileByPiC(dirName: string, type = 1) {
 | 
				
			||||||
  const fileHelper = new FileHelper(context);
 | 
					  // const fileHelper = new FileHelper();
 | 
				
			||||||
  fileHelper.deleteFileOfAlbum(dirName, type);
 | 
					  fileHelper.deleteFileOfAlbum(dirName, type);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user