dev #63
@ -16,7 +16,7 @@ import {
 | 
				
			|||||||
import { GlobalConfig } from '../../config/index'
 | 
					import { GlobalConfig } from '../../config/index'
 | 
				
			||||||
import testNapi from '@ohos.hiserialsdk'
 | 
					import testNapi from '@ohos.hiserialsdk'
 | 
				
			||||||
import fs from '@ohos.file.fs';
 | 
					import fs from '@ohos.file.fs';
 | 
				
			||||||
import {deleteAllPicturesFn} from './videoService'
 | 
					
 | 
				
			||||||
let num = 0
 | 
					let num = 0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
async function getliushuiNum(data) {
 | 
					async function getliushuiNum(data) {
 | 
				
			||||||
@ -94,31 +94,7 @@ export async function setVideoParam() {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
let fileFd
 | 
					let fileFd
 | 
				
			||||||
export async function delHilog(day=7) {
 | 
					 | 
				
			||||||
  return new Promise(async (reslove)=>{
 | 
					 | 
				
			||||||
    const fileUtil = new FileUtil(globalThis.context)
 | 
					 | 
				
			||||||
    const data = await fileUtil.readFile(GlobalConfig.comoonfileWriteAddress + '/config/hilogTime.txt');
 | 
					 | 
				
			||||||
    const folderPath = await fileUtil.initFolder(`/config`);
 | 
					 | 
				
			||||||
    console.log('kkkkmmm2', data)
 | 
					 | 
				
			||||||
    if (data === '' || data === undefined) {
 | 
					 | 
				
			||||||
      const date = dateFormat(new Date()).split(' ')[0]
 | 
					 | 
				
			||||||
      console.log('mm'.date)
 | 
					 | 
				
			||||||
      fileUtil.addFile(`${folderPath}/hilogTime.txt`, date)
 | 
					 | 
				
			||||||
    } else {
 | 
					 | 
				
			||||||
      console.log('kkkkmmm2', data)
 | 
					 | 
				
			||||||
      console.log('datadata', data, isSevenDaysAgo(data))
 | 
					 | 
				
			||||||
      if (isSevenDaysAgo(data,day)) {
 | 
					 | 
				
			||||||
        const date = dateFormat(new Date()).split(' ')[0]
 | 
					 | 
				
			||||||
        fileUtil.addFile(`${folderPath}/hilogTime.txt`, date)
 | 
					 | 
				
			||||||
        // deleteAllFileByPiC('pz', 1)
 | 
					 | 
				
			||||||
        await deleteAllPicturesFn()
 | 
					 | 
				
			||||||
        reslove(true)
 | 
					 | 
				
			||||||
        // fileUtil.addFile(`${folderPath}/hilogTime.txt`, JSON.stringify(num))
 | 
					 | 
				
			||||||
      }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
  })
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					 | 
				
			||||||
//配置流水号
 | 
					//配置流水号
 | 
				
			||||||
export async function setliushuiNum() {
 | 
					export async function setliushuiNum() {
 | 
				
			||||||
  const data = AppStorage.get('liushuiNo')
 | 
					  const data = AppStorage.get('liushuiNo')
 | 
				
			||||||
 | 
				
			|||||||
@ -45,14 +45,16 @@ export async function startRecordVideo(param, td, context, dir, path?, index?) {
 | 
				
			|||||||
      console.log(`Rtsprecord startRecordVideo begin,video_uri`, video_uri);
 | 
					      console.log(`Rtsprecord startRecordVideo begin,video_uri`, video_uri);
 | 
				
			||||||
      const num = Math.floor(Math.random() * 10000)
 | 
					      const num = Math.floor(Math.random() * 10000)
 | 
				
			||||||
      let fileName
 | 
					      let fileName
 | 
				
			||||||
 | 
					      const time = await getCurrentTime()
 | 
				
			||||||
 | 
					      const date = time.split(' ')[0]
 | 
				
			||||||
      if (!path) {
 | 
					      if (!path) {
 | 
				
			||||||
        fileName = `movie_record${num}.mp4`
 | 
					        fileName = `${date}_movie_record${num}.mp4`
 | 
				
			||||||
      } else {
 | 
					      } else {
 | 
				
			||||||
        fileName = `${path}_${index || num}.mp4`
 | 
					        fileName = `${date}_${path}_${index || num}.mp4`
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      // @ts-ignore
 | 
					      // @ts-ignore
 | 
				
			||||||
      var recordResult = rtsp_server.startRecordVideo(context, video_uri, fileName, dir);
 | 
					      var recordResult = rtsp_server.startRecordVideo(context, video_uri, fileName, date,dir);
 | 
				
			||||||
      const handleId = recordResult.dataInt;
 | 
					      const handleId = recordResult.dataInt;
 | 
				
			||||||
      reslove(handleId)
 | 
					      reslove(handleId)
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@ -180,7 +182,6 @@ interface takePhotoParam {
 | 
				
			|||||||
const fileHelper = new FileHelper();
 | 
					const fileHelper = new FileHelper();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export async function delPic(day,type) {
 | 
					export async function delPic(day,type) {
 | 
				
			||||||
  return new Promise(async reslove=>{
 | 
					 | 
				
			||||||
    let phAccessHelper = photoAccessHelper.getPhotoAccessHelper(globalThis.context);
 | 
					    let phAccessHelper = photoAccessHelper.getPhotoAccessHelper(globalThis.context);
 | 
				
			||||||
    console.info('albumGetAssetsDemoCallback');
 | 
					    console.info('albumGetAssetsDemoCallback');
 | 
				
			||||||
    let predicates: dataSharePredicates.DataSharePredicates = new dataSharePredicates.DataSharePredicates();
 | 
					    let predicates: dataSharePredicates.DataSharePredicates = new dataSharePredicates.DataSharePredicates();
 | 
				
			||||||
@ -196,14 +197,13 @@ export async function delPic(day,type) {
 | 
				
			|||||||
    let albums = await albumList.getAllObjects();
 | 
					    let albums = await albumList.getAllObjects();
 | 
				
			||||||
    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
 | 
				
			||||||
 | 
					      // isSevenDaysAgo(albumName, day)
 | 
				
			||||||
 | 
					      console.log('albumNamealbumName',albumName)
 | 
				
			||||||
      if (isSevenDaysAgo(albumName, day)&&albumName!='jt'&&albumName!='pz') {
 | 
					      if (isSevenDaysAgo(albumName, day)&&albumName!='jt'&&albumName!='pz') {
 | 
				
			||||||
       await deleteAllFileByPiC(albumName, type)
 | 
					           deleteAllFileByPiC(albumName, type)
 | 
				
			||||||
      }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    reslove(true)
 | 
					 | 
				
			||||||
  })
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  return
 | 
					      }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export async function takePhoto(param, context, dir, flag = 1, callback?) {
 | 
					export async function takePhoto(param, context, dir, flag = 1, callback?) {
 | 
				
			||||||
@ -227,11 +227,8 @@ export async function takePhoto(param, context, dir, flag = 1, callback?) {
 | 
				
			|||||||
    return new Promise<takePhotoParam>(async (resolve, reject) => {
 | 
					    return new Promise<takePhotoParam>(async (resolve, reject) => {
 | 
				
			||||||
      const time = await getCurrentTime()
 | 
					      const time = await getCurrentTime()
 | 
				
			||||||
      const date = time.split(' ')[0]
 | 
					      const date = time.split(' ')[0]
 | 
				
			||||||
      // let dirName=dir?dir:date
 | 
					 | 
				
			||||||
      let dirName=dir?dir:date
 | 
					      let dirName=dir?dir:date
 | 
				
			||||||
      rtsp_server.getVideoSnapshot(context, video_uri, fileName,dirName, true,async (err, snapResult) => {
 | 
					      rtsp_server.getVideoSnapshot(context, video_uri, fileName,dirName, true,async (err, snapResult) => {
 | 
				
			||||||
        console.log('baoyihubaoyihu', video_uri, flag,fileName,dirName, JSON.stringify(snapResult.fileSize))
 | 
					 | 
				
			||||||
        console.log('getPhtot', JSON.stringify(snapResult))
 | 
					 | 
				
			||||||
        if(snapResult.result&&snapResult.errorCode==0){
 | 
					        if(snapResult.result&&snapResult.errorCode==0){
 | 
				
			||||||
          resolve({
 | 
					          resolve({
 | 
				
			||||||
            base64: snapResult.dataString,
 | 
					            base64: snapResult.dataString,
 | 
				
			||||||
@ -253,15 +250,14 @@ export async function takePhoto(param, context, dir, flag = 1, callback?) {
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
export async function deleteAllPicturesFn(){
 | 
					export async function deleteAllPicturesFn(){
 | 
				
			||||||
   await fileHelper.deleteAllPictures();
 | 
					   fileHelper.deleteAllPictures();
 | 
				
			||||||
   await deleteAllVideos(globalThis.context,photoAccessHelper.AlbumType.USER,photoAccessHelper.AlbumSubtype.VIDEO)
 | 
					   deleteAllVideos(globalThis.context,photoAccessHelper.AlbumType.USER,photoAccessHelper.AlbumSubtype.VIDEO)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//type:1 是图片 2是视频
 | 
					//type:1 是图片 2是视频
 | 
				
			||||||
export async function deleteAllFileByPiC(dirName, type = 1) {
 | 
					export async function deleteAllFileByPiC(dirName, type = 1) {
 | 
				
			||||||
  // const fileHelper = new FileHelper();
 | 
					  // const fileHelper = new FileHelper();
 | 
				
			||||||
  console.log('deleteFileOfAlbum',dirName,type)
 | 
					 | 
				
			||||||
  fileHelper.deleteFileOfAlbum(dirName, type);
 | 
					  fileHelper.deleteFileOfAlbum(dirName, type);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -57,8 +57,8 @@ export default class EntryAbility extends UIAbility {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        const windowClass  = await windowStage.getMainWindow();
 | 
					        const windowClass  = await windowStage.getMainWindow();
 | 
				
			||||||
        globalThis.windowClass = windowClass
 | 
					        globalThis.windowClass = windowClass
 | 
				
			||||||
        await windowClass.setWindowLayoutFullScreen(true)
 | 
					        // await windowClass.setWindowLayoutFullScreen(true)
 | 
				
			||||||
        // await windowClass.setWindowSystemBarEnable([]) //全屏
 | 
					        await windowClass.setWindowSystemBarEnable([]) //全屏
 | 
				
			||||||
        // await windowClass.setWindowSystemBarEnable(['navigation'])
 | 
					        // await windowClass.setWindowSystemBarEnable(['navigation'])
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        windowStage.loadContent('pages/Index', (err, data) => {
 | 
					        windowStage.loadContent('pages/Index', (err, data) => {
 | 
				
			||||||
 | 
				
			|||||||
@ -10,7 +10,7 @@ import { getUDP, getUDP2 } from '../common/utils/GlobalUdp';
 | 
				
			|||||||
import { initJudgeUdp } from '../common/utils/UdpJudge';
 | 
					import { initJudgeUdp } from '../common/utils/UdpJudge';
 | 
				
			||||||
import { judgeConfig } from './judgeSDK/utils/judgeConfig';
 | 
					import { judgeConfig } from './judgeSDK/utils/judgeConfig';
 | 
				
			||||||
import { getTCP } from '../common/utils/GlobalTcp';
 | 
					import { getTCP } from '../common/utils/GlobalTcp';
 | 
				
			||||||
import {  setliushuiNum, takePhotoFn, setVideoParam, delHilog } from '../common/service/indexService';
 | 
					import {  setliushuiNum, takePhotoFn, setVideoParam } from '../common/service/indexService';
 | 
				
			||||||
import abilityAccessCtrl, { Permissions } from '@ohos.abilityAccessCtrl';
 | 
					import abilityAccessCtrl, { Permissions } from '@ohos.abilityAccessCtrl';
 | 
				
			||||||
import worker, { MessageEvents } from '@ohos.worker';
 | 
					import worker, { MessageEvents } from '@ohos.worker';
 | 
				
			||||||
import promptAction from '@ohos.promptAction'
 | 
					import promptAction from '@ohos.promptAction'
 | 
				
			||||||
@ -42,11 +42,11 @@ struct Index {
 | 
				
			|||||||
  @State angle: number = 0
 | 
					  @State angle: number = 0
 | 
				
			||||||
  @State dialogRatio: number = 0.8
 | 
					  @State dialogRatio: number = 0.8
 | 
				
			||||||
  @State ratio: number = 1700 / 960
 | 
					  @State ratio: number = 1700 / 960
 | 
				
			||||||
  @State loading: boolean = true
 | 
					  @State delLoading: boolean = false
 | 
				
			||||||
 | 
					  @State loading: boolean = false
 | 
				
			||||||
  @State initParamFlag: boolean = false
 | 
					  @State initParamFlag: boolean = false
 | 
				
			||||||
  @State fd: number = -1;
 | 
					  @State fd: number = -1;
 | 
				
			||||||
  @State num: number = 0;
 | 
					  @State num: number = 0;
 | 
				
			||||||
  @State delLoading: boolean = true;
 | 
					 | 
				
			||||||
  fileHelper = null;
 | 
					  fileHelper = null;
 | 
				
			||||||
  private fileUtil: FileUtil
 | 
					  private fileUtil: FileUtil
 | 
				
			||||||
  private interval = null;
 | 
					  private interval = null;
 | 
				
			||||||
@ -296,7 +296,6 @@ struct Index {
 | 
				
			|||||||
        .height(360 * this.ratio * this.dialogRatio)
 | 
					        .height(360 * this.ratio * this.dialogRatio)
 | 
				
			||||||
        .position({ x: 220 * this.ratio, y: 98 * this.ratio - 265 / 2 * (1 - this.ratio * this.dialogRatio) })
 | 
					        .position({ x: 220 * this.ratio, y: 98 * this.ratio - 265 / 2 * (1 - this.ratio * this.dialogRatio) })
 | 
				
			||||||
        .backgroundColor('#E6E3DF')
 | 
					        .backgroundColor('#E6E3DF')
 | 
				
			||||||
        //
 | 
					 | 
				
			||||||
        .borderRadius(19 * this.ratio * this.dialogRatio)
 | 
					        .borderRadius(19 * this.ratio * this.dialogRatio)
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
      if (this.delLoading) {
 | 
					      if (this.delLoading) {
 | 
				
			||||||
@ -314,18 +313,19 @@ struct Index {
 | 
				
			|||||||
            })
 | 
					            })
 | 
				
			||||||
            .margin({ top: 30 * globalThis.ratio })
 | 
					            .margin({ top: 30 * globalThis.ratio })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
          Text('正在清理本地资源文件,请稍候……')
 | 
					          Text('正在清理本地数据,请稍候……')
 | 
				
			||||||
            .fontSize(24 * globalThis.ratio)
 | 
					            .fontSize(24 * globalThis.ratio)
 | 
				
			||||||
            .margin({ top: 20 * globalThis.ratio })
 | 
					            .margin({ top: 20 * globalThis.ratio })
 | 
				
			||||||
            .fontWeight(400)
 | 
					            .fontWeight(400)
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        .visibility(this.loading ? Visibility.Visible : Visibility.Hidden)
 | 
					        .visibility(this.delLoading ? Visibility.Visible : Visibility.Hidden)
 | 
				
			||||||
        .width(660 * globalThis.ratio)
 | 
					        .width(660 * globalThis.ratio)
 | 
				
			||||||
        .height(360 * globalThis.ratio)
 | 
					        .height(360 * globalThis.ratio)
 | 
				
			||||||
        .position({ x: 150 * globalThis.ratio, y: 98 * globalThis.ratio })
 | 
					        .position({ x: 150 * globalThis.ratio, y: 98 * globalThis.ratio })
 | 
				
			||||||
        .backgroundColor('#E6E3DF')
 | 
					        .backgroundColor('#E6E3DF')
 | 
				
			||||||
        .borderRadius(19 * globalThis.ratio)
 | 
					        .borderRadius(19 * globalThis.ratio)
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      if (this.loading) {
 | 
					      if (this.loading) {
 | 
				
			||||||
        Column() {
 | 
					        Column() {
 | 
				
			||||||
          Image($r('app.media.open_loading'))
 | 
					          Image($r('app.media.open_loading'))
 | 
				
			||||||
@ -368,14 +368,35 @@ struct Index {
 | 
				
			|||||||
  async aboutToAppear() {
 | 
					  async aboutToAppear() {
 | 
				
			||||||
   
 | 
					   
 | 
				
			||||||
    console.log('diyidiy')
 | 
					    console.log('diyidiy')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    this.avPlayer = new VoiceAnnounce();
 | 
					    this.avPlayer = new VoiceAnnounce();
 | 
				
			||||||
    this.initParamFlag=false
 | 
					    this.initParamFlag=false
 | 
				
			||||||
 | 
					    this.delLoading=false
 | 
				
			||||||
    this.dialogVisiable = false
 | 
					    this.dialogVisiable = false
 | 
				
			||||||
    this.angle = 0
 | 
					    this.angle = 0
 | 
				
			||||||
    this.loading = false
 | 
					    this.loading = false
 | 
				
			||||||
    globalThis.lsh = '1111111111111'
 | 
					    globalThis.lsh = '1111111111111'
 | 
				
			||||||
    globalThis.errorDialog = this.errorDialog
 | 
					    globalThis.errorDialog = this.errorDialog
 | 
				
			||||||
    globalThis.udpEvent = new UdpEvent();
 | 
					    globalThis.udpEvent = new UdpEvent();
 | 
				
			||||||
 | 
					    getSyncData('MA_SYSSET').then(async data => {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      console.log('datadata', JSON.stringify(data))
 | 
				
			||||||
 | 
					      // @ts-ignore
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      // @ts-ignore
 | 
				
			||||||
 | 
					      data.forEach(async sys => {
 | 
				
			||||||
 | 
					        //判断是否能点开始考试
 | 
				
			||||||
 | 
					        if(sys.v_no === '305'){
 | 
				
			||||||
 | 
					          console.log('syssyssyssys')
 | 
				
			||||||
 | 
					          // this.delLoading=true
 | 
				
			||||||
 | 
					          // globalThis.param854Str=sys.v_value
 | 
				
			||||||
 | 
					           delPic(Number(sys.v_value),1)
 | 
				
			||||||
 | 
					           delPic(Number(sys.v_value),2)
 | 
				
			||||||
 | 
					          // this.delLoading=false
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					      })
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -411,6 +432,7 @@ struct Index {
 | 
				
			|||||||
      console.log("baoyihu after postMessage :", JSON.stringify(e.data));
 | 
					      console.log("baoyihu after postMessage :", JSON.stringify(e.data));
 | 
				
			||||||
      // @ts-ignore
 | 
					      // @ts-ignore
 | 
				
			||||||
      let workData: WorkData = e.data;
 | 
					      let workData: WorkData = e.data;
 | 
				
			||||||
 | 
					      this.loading = false
 | 
				
			||||||
      if (workData.isComplete) {
 | 
					      if (workData.isComplete) {
 | 
				
			||||||
        if(globalThis.singlePlay){
 | 
					        if(globalThis.singlePlay){
 | 
				
			||||||
          router.pushUrl({
 | 
					          router.pushUrl({
 | 
				
			||||||
@ -418,7 +440,7 @@ struct Index {
 | 
				
			|||||||
          }, router.RouterMode.Single)
 | 
					          }, router.RouterMode.Single)
 | 
				
			||||||
          return
 | 
					          return
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        getSyncData('MA_SYSSET').then(async(data) => {
 | 
					        getSyncData('MA_SYSSET').then(data => {
 | 
				
			||||||
          console.log('datadata', JSON.stringify(data))
 | 
					          console.log('datadata', JSON.stringify(data))
 | 
				
			||||||
          // @ts-ignore
 | 
					          // @ts-ignore
 | 
				
			||||||
          data.forEach(sys => {
 | 
					          data.forEach(sys => {
 | 
				
			||||||
@ -426,10 +448,6 @@ struct Index {
 | 
				
			|||||||
            if(sys.v_no === '854'){
 | 
					            if(sys.v_no === '854'){
 | 
				
			||||||
              globalThis.param854Str=sys.v_value
 | 
					              globalThis.param854Str=sys.v_value
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            if(sys.v_no === '305'){
 | 
					 | 
				
			||||||
              delPic(Number(sys.v_value),1)
 | 
					 | 
				
			||||||
              delPic(Number(sys.v_value),2)
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            if (sys.v_no === '824'&&decodeURIComponent(sys.v_value)=='0') {
 | 
					            if (sys.v_no === '824'&&decodeURIComponent(sys.v_value)=='0') {
 | 
				
			||||||
              // this.Param612Str= decodeURIComponent(sys.v_value)
 | 
					              // this.Param612Str= decodeURIComponent(sys.v_value)
 | 
				
			||||||
              router.pushUrl({
 | 
					              router.pushUrl({
 | 
				
			||||||
@ -444,8 +462,6 @@ struct Index {
 | 
				
			|||||||
              }, router.RouterMode.Single)
 | 
					              }, router.RouterMode.Single)
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
          })
 | 
					          })
 | 
				
			||||||
          this.loading = false
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
@ -479,16 +495,11 @@ struct Index {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  async onPageShow() {
 | 
					  async onPageShow() {
 | 
				
			||||||
 | 
					    console.log('ttttt', 1111)
 | 
				
			||||||
    await this.userAuth();
 | 
					    await this.userAuth();
 | 
				
			||||||
    let resourceManager = this.context.resourceManager;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    // this.vocObj = new voiceService(async (status, val, next) => {
 | 
					 | 
				
			||||||
    // });
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    console.log('globalThis.singlePlay', globalThis.singlePlay)
 | 
					    console.log('globalThis.singlePlay', globalThis.singlePlay)
 | 
				
			||||||
    if (globalThis.singlePlay == undefined || globalThis.singlePlay == null) {
 | 
					    if (globalThis.singlePlay == undefined || globalThis.singlePlay == null) {
 | 
				
			||||||
      // setVideoParam()
 | 
					      // setVideoParam()
 | 
				
			||||||
 | 
					 | 
				
			||||||
      console.log('diyidiy')
 | 
					      console.log('diyidiy')
 | 
				
			||||||
      this.context.resourceManager.getRawFileContent("welcome.wav").then(value => {
 | 
					      this.context.resourceManager.getRawFileContent("welcome.wav").then(value => {
 | 
				
			||||||
        this.avPlayer.playAudio(['welcome.wav'])
 | 
					        this.avPlayer.playAudio(['welcome.wav'])
 | 
				
			||||||
@ -516,6 +527,7 @@ struct Index {
 | 
				
			|||||||
    const time = await getCurrentTime()
 | 
					    const time = await getCurrentTime()
 | 
				
			||||||
    const date = time.split(' ')[0]
 | 
					    const date = time.split(' ')[0]
 | 
				
			||||||
    this.fileHelper.createAlbum('jt')
 | 
					    this.fileHelper.createAlbum('jt')
 | 
				
			||||||
 | 
					    // this.fileHelper.createAlbum('2025-01-02')
 | 
				
			||||||
    this.fileHelper.createAlbum('pz');
 | 
					    this.fileHelper.createAlbum('pz');
 | 
				
			||||||
    this.fileHelper.createAlbum(date);
 | 
					    this.fileHelper.createAlbum(date);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -586,9 +598,7 @@ struct Index {
 | 
				
			|||||||
        this.heartMsg()
 | 
					        this.heartMsg()
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    }, 1000)
 | 
					    }, 1000)
 | 
				
			||||||
    //
 | 
					 | 
				
			||||||
    this.createAlbum()
 | 
					    this.createAlbum()
 | 
				
			||||||
 | 
					 | 
				
			||||||
    //下载模型
 | 
					    //下载模型
 | 
				
			||||||
    // await this.getModel()
 | 
					    // await this.getModel()
 | 
				
			||||||
    // const arr = [0x55, 0xaa, 0x01, 0x00, 0x02, 0x01, 0x03, 0x00]
 | 
					    // const arr = [0x55, 0xaa, 0x01, 0x00, 0x02, 0x01, 0x03, 0x00]
 | 
				
			||||||
 | 
				
			|||||||
@ -134,9 +134,11 @@ struct UserInfo {
 | 
				
			|||||||
    alignment: DialogAlignment.Center,
 | 
					    alignment: DialogAlignment.Center,
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  )
 | 
					  )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  aboutToAppear() {
 | 
					  aboutToAppear() {
 | 
				
			||||||
    this.avPlayer = new VoiceAnnounce();
 | 
					    this.avPlayer = new VoiceAnnounce();
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  async onPageShow() {
 | 
					  async onPageShow() {
 | 
				
			||||||
    this.isExamStart = false
 | 
					    this.isExamStart = false
 | 
				
			||||||
    this.startExam = false
 | 
					    this.startExam = false
 | 
				
			||||||
@ -638,26 +640,50 @@ struct UserInfo {
 | 
				
			|||||||
        dataList = this.list.length > 4 ? this.list.slice(this.pageIndex * 4, this.pageIndex * 4 + 4) : this.list;
 | 
					        dataList = this.list.length > 4 ? this.list.slice(this.pageIndex * 4, this.pageIndex * 4 + 4) : this.list;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        this.dataList = dataList
 | 
					        this.dataList = dataList
 | 
				
			||||||
        const flag=dataList.filter((res)=>{
 | 
					        const user = this.dataList.filter(res => {
 | 
				
			||||||
           return res.sfzmhm==this.currentUser.sfzmhm
 | 
					          res.kssycs = '1'
 | 
				
			||||||
        }).length?true:false
 | 
					        })
 | 
				
			||||||
        if(!this.currentUser.sfzmhm||this.currentUser.kssycs=='0'||!flag){
 | 
					 | 
				
			||||||
        if (this.dataList.length) {
 | 
					        if (this.dataList.length) {
 | 
				
			||||||
 | 
					          if (user.length) {
 | 
				
			||||||
 | 
					            setTimeout(() => {
 | 
				
			||||||
 | 
					              this.currentUser = user[0]
 | 
				
			||||||
 | 
					              this.currentUser.ksy2 = globalThis.kgxm
 | 
				
			||||||
 | 
					              globalThis.lsh = this.currentUser.lsh
 | 
				
			||||||
 | 
					              globalThis.ksyh = this.currentUser.ksy1sfzmhm
 | 
				
			||||||
 | 
					            }, 200)
 | 
				
			||||||
 | 
					          } else {
 | 
				
			||||||
            setTimeout(() => {
 | 
					            setTimeout(() => {
 | 
				
			||||||
              this.currentUser = this.dataList[0]
 | 
					              this.currentUser = this.dataList[0]
 | 
				
			||||||
              this.currentUser.ksy2 = globalThis.kgxm
 | 
					              this.currentUser.ksy2 = globalThis.kgxm
 | 
				
			||||||
 | 
					              globalThis.ksyh = this.currentUser.ksy1sfzmhm
 | 
				
			||||||
              globalThis.lsh = this.currentUser.lsh
 | 
					              globalThis.lsh = this.currentUser.lsh
 | 
				
			||||||
            }, 200)
 | 
					            }, 200)
 | 
				
			||||||
            console.log('this.currentUser1',JSON.stringify(this.currentUser))
 | 
					          }
 | 
				
			||||||
        } else {
 | 
					        } else {
 | 
				
			||||||
          this.currentUser = EmptyCandidateObject
 | 
					          this.currentUser = EmptyCandidateObject
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        this.lsh = this.currentUser.lsh
 | 
					        // const flag=dataList.filter((res)=>{
 | 
				
			||||||
        globalThis.lsh = this.lsh
 | 
					        //    return res.sfzmhm==this.currentUser.sfzmhm
 | 
				
			||||||
        globalThis.ksyh = this.currentUser.ksy1sfzmhm
 | 
					        // }).length?true:false
 | 
				
			||||||
 | 
					        // if(!this.currentUser.sfzmhm||this.currentUser.kssycs=='0'||!flag){
 | 
				
			||||||
 | 
					        //   if (this.dataList.length) {
 | 
				
			||||||
 | 
					        //     setTimeout(()=>{
 | 
				
			||||||
 | 
					        //       this.currentUser = this.dataList[0]
 | 
				
			||||||
 | 
					        //       this.currentUser.ksy2= globalThis.kgxm
 | 
				
			||||||
 | 
					        //       globalThis.lsh=this.currentUser.lsh
 | 
				
			||||||
 | 
					        //     },200)
 | 
				
			||||||
 | 
					        //     console.log('this.currentUser1',JSON.stringify(this.currentUser))
 | 
				
			||||||
 | 
					        //   } else {
 | 
				
			||||||
 | 
					        //     this.currentUser = EmptyCandidateObject
 | 
				
			||||||
 | 
					        //   }
 | 
				
			||||||
 | 
					        // }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        // this.lsh = this.currentUser.lsh
 | 
				
			||||||
 | 
					        // globalThis.lsh = this.lsh
 | 
				
			||||||
 | 
					        // globalThis.ksyh = this.currentUser.ksy1sfzmhm
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        //364	绕车一周评判时机(1-开始考试后判 2-开始考试前判)
 | 
					        //364	绕车一周评判时机(1-开始考试后判 2-开始考试前判)
 | 
				
			||||||
        if (this.systemParam.Param364 == '2') {
 | 
					        if (this.systemParam.Param364 == '2') {
 | 
				
			||||||
@ -968,7 +994,6 @@ struct UserInfo {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					 | 
				
			||||||
  //开始考试准备
 | 
					  //开始考试准备
 | 
				
			||||||
  prePareExam = async () => {
 | 
					  prePareExam = async () => {
 | 
				
			||||||
    if (this.ksksLimit) {
 | 
					    if (this.ksksLimit) {
 | 
				
			||||||
@ -1137,11 +1162,13 @@ struct UserInfo {
 | 
				
			|||||||
        Column() {
 | 
					        Column() {
 | 
				
			||||||
          // Image($r('app.media.yydj_btn'))
 | 
					          // Image($r('app.media.yydj_btn'))
 | 
				
			||||||
          //   .commStyle()
 | 
					          //   .commStyle()
 | 
				
			||||||
          imageBtn({btnWidth:220 * this.ratio,btnHeight:69 * this.ratio,imgSrc:$r('app.media.yydj_btn')}).margin({ bottom: 12 * this.ratio })
 | 
					          imageBtn({ btnWidth: 220 * this.ratio, btnHeight: 69 * this.ratio, imgSrc: $r('app.media.yydj_btn') })
 | 
				
			||||||
 | 
					            .margin({ bottom: 12 * this.ratio })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
          // Image($r('app.media.gx_btn'))
 | 
					          // Image($r('app.media.gx_btn'))
 | 
				
			||||||
          //   .commStyle()
 | 
					          //   .commStyle()
 | 
				
			||||||
          imageBtn({btnWidth:220 * this.ratio,btnHeight:69 * this.ratio,imgSrc:$r('app.media.gx_btn')}).margin({ bottom: 12 * this.ratio })
 | 
					          imageBtn({ btnWidth: 220 * this.ratio, btnHeight: 69 * this.ratio, imgSrc: $r('app.media.gx_btn') })
 | 
				
			||||||
 | 
					            .margin({ bottom: 12 * this.ratio })
 | 
				
			||||||
            .onClick(() => {
 | 
					            .onClick(() => {
 | 
				
			||||||
              // this.avPlayer.playAudio(['button_media.wav'])
 | 
					              // this.avPlayer.playAudio(['button_media.wav'])
 | 
				
			||||||
              if (this.isExamStart && !globalThis.singlePlay) {
 | 
					              if (this.isExamStart && !globalThis.singlePlay) {
 | 
				
			||||||
@ -1153,7 +1180,8 @@ struct UserInfo {
 | 
				
			|||||||
            })
 | 
					            })
 | 
				
			||||||
          // Image($r('app.media.qk_btn'))
 | 
					          // Image($r('app.media.qk_btn'))
 | 
				
			||||||
          //   .commStyle()
 | 
					          //   .commStyle()
 | 
				
			||||||
          imageBtn({btnWidth:220 * this.ratio,btnHeight:69 * this.ratio,imgSrc:$r('app.media.qk_btn')}).margin({ bottom: 12 * this.ratio })
 | 
					          imageBtn({ btnWidth: 220 * this.ratio, btnHeight: 69 * this.ratio, imgSrc: $r('app.media.qk_btn') })
 | 
				
			||||||
 | 
					            .margin({ bottom: 12 * this.ratio })
 | 
				
			||||||
            .onClick(() => {
 | 
					            .onClick(() => {
 | 
				
			||||||
              // this.avPlayer.playAudio(['button_media.wav'])
 | 
					              // this.avPlayer.playAudio(['button_media.wav'])
 | 
				
			||||||
              //  已开始考试不能缺考   已考过一次学员不能缺考                                                 车上不能缺考
 | 
					              //  已开始考试不能缺考   已考过一次学员不能缺考                                                 车上不能缺考
 | 
				
			||||||
@ -1167,7 +1195,8 @@ struct UserInfo {
 | 
				
			|||||||
          if (this.isBoardPrePareSetPopupOpen && (this.isSecondBoardPrePareSetPopupOpen && this.currentUser.kssycs == '2') && !this.isFirstBoardPrePareSetPopupBtnShow) {
 | 
					          if (this.isBoardPrePareSetPopupOpen && (this.isSecondBoardPrePareSetPopupOpen && this.currentUser.kssycs == '2') && !this.isFirstBoardPrePareSetPopupBtnShow) {
 | 
				
			||||||
            //上车准备
 | 
					            //上车准备
 | 
				
			||||||
            // Image($r('app.media.sczb_btn')).commStyle()
 | 
					            // Image($r('app.media.sczb_btn')).commStyle()
 | 
				
			||||||
            imageBtn({btnWidth:220 * this.ratio,btnHeight:69 * this.ratio,imgSrc:$r('app.media.sczb_btn')}).margin({ bottom: 12 * this.ratio })
 | 
					            imageBtn({ btnWidth: 220 * this.ratio, btnHeight: 69 * this.ratio, imgSrc: $r('app.media.sczb_btn') })
 | 
				
			||||||
 | 
					              .margin({ bottom: 12 * this.ratio })
 | 
				
			||||||
              .onClick(async () => {
 | 
					              .onClick(async () => {
 | 
				
			||||||
                if (this.systemParam.Param612Str == '1') {
 | 
					                if (this.systemParam.Param612Str == '1') {
 | 
				
			||||||
                  return
 | 
					                  return
 | 
				
			||||||
@ -1177,7 +1206,8 @@ struct UserInfo {
 | 
				
			|||||||
          } else {
 | 
					          } else {
 | 
				
			||||||
            // Image($r('app.media.ksks_btn'))
 | 
					            // Image($r('app.media.ksks_btn'))
 | 
				
			||||||
            //   .commStyle()
 | 
					            //   .commStyle()
 | 
				
			||||||
            imageBtn({btnWidth:220 * this.ratio,btnHeight:69 * this.ratio,imgSrc:$r('app.media.ksks_btn')}).margin({ bottom: 12 * this.ratio })
 | 
					            imageBtn({ btnWidth: 220 * this.ratio, btnHeight: 69 * this.ratio, imgSrc: $r('app.media.ksks_btn') })
 | 
				
			||||||
 | 
					              .margin({ bottom: 12 * this.ratio })
 | 
				
			||||||
              .onClick(async () => {
 | 
					              .onClick(async () => {
 | 
				
			||||||
                if (this.systemParam.Param612Str == '1') {
 | 
					                if (this.systemParam.Param612Str == '1') {
 | 
				
			||||||
                  return
 | 
					                  return
 | 
				
			||||||
 | 
				
			|||||||
@ -1 +0,0 @@
 | 
				
			|||||||
 {"code":1,"data":{"videoChapterList":[{"chapterId":"8","chapterName":"第一章:驾驶证的基本信息、申领和使用","code":"1001","name":"驾驶证申领与使用机动车登记","subjectType":"1","count":"4","chapterVideoList":[{"videoId":"95","name":"第一课:准驾车型","title":"准驾车型是指什么样的驾驶证能开什么样的车,我国总计有16种驾照,按照ABCD的顺序划分。","photoUrl":"https://duolunstorage.oss-cn-hangzhou.aliyuncs.com/archive/ddjd/202207/1658822259WBGURTDW.png","videoUrl":"https://ddjdvideo.duolunxc.com/d8cca146136b4036a193ec1c72a1ad84/2e2c2ed873d24f239cd5ca1cb9756bd1-81fdf63dd56b4dfce8ee63e8807d291f-ld.m3u8?auth_key=1726196458-4dd8bdf313b945808f2a62032d00d846-0-14b7843e2ba491a1918177784e37d772","viewCount":50766,"questCount":0,"isView":"0"},{"videoId":"61","name":"第二课:驾驶证的申请条件","title":"驾驶证申请条件,分为年龄条件、身体条件和禁止条件。","photoUrl":"https://duolunstorage.oss-cn-hangzhou.aliyuncs.com/archive/ddjd/202207/16588222718TK8QETW.png","videoUrl":"https://ddjdvideo.duolunxc.com/b95873736b3e4f1dbd94159c4f88d3c2/fb0562a3d19b40189f7dc2ce8d2b18f6-b8ca137e222c55292b19abeb9472f7b4-ld.m3u8?auth_key=1726196458-185f9fc53e614fd7bc117f2f16e87066-0-9b40a712d59de2385daf195af77df644","viewCount":55988,"questCount":0,"isView":"0"},{"videoId":"96","name":"第三课:初次申请及增加准驾车型","title":"准驾车型的16种车型中有三种是不可以初次申请的,包括大型客车A1、牵引车A2、中型客车B1。","photoUrl":"https://duolunstorage.oss-cn-hangzhou.aliyuncs.com/archive/ddjd/202207/1658822248BLOG5F77.png","videoUrl":"https://ddjdvideo.duolunxc.com/583e26489a714e0c9713de49e297cd52/f8a0eb3a29924468a2be4278b82e84d1-39adbbdba4e730b4615416e186981d91-ld.m3u8?auth_key=1726196459-f37ddff500984ad9913a457914d4b7d9-0-33fa677f8c8e2f2c384d5a133a5a7511","viewCount":19449,"questCount":0,"isView":"0"},{"videoId":"97","name":"第四课:驾驶考试","title":"驾驶考试的内容及标准。","photoUrl":"https://duolunstorage.oss-cn-hangzhou.aliyuncs.com/archive/ddjd/202207/1658822237ECGG1PQV.png","videoUrl":"https://ddjdvideo.duolunxc.com/84b4a019330b41b48b93818596e1baa2/6a0b423ba95f41f5834ea3c6c4e7e6ab-184dc5731e236cb26fe1a6abf890ae4f-ld.m3u8?auth_key=1726196459-a1daf329320a49b0a19d36c16fbcd398-0-a99a54448590acfde0d26fa0de3dcdd3","viewCount":18434,"questCount":0,"isView":"0"}]},{"chapterId":"10","chapterName":"第一章:文明驾驶","code":"4001","name":"安全文明驾驶常识","subjectType":"4","count":"3","chapterVideoList":[{"videoId":"111","name":"第一课:安全驾驶基础知识","title":"驾驶机动车上道路行驶,驾驶人首先要确保自己处于良好的驾驶状态,避免不文明的驾驶状态和行为会为自己和他人的生命安全埋下隐患。","photoUrl":"https://duolunstorage.oss-cn-hangzhou.aliyuncs.com/archive/ddjd/202207/1658822228B0QUTOS9.png","videoUrl":"https://ddjdvideo.duolunxc.com/a9c572ca6fb24c0b86c4bb822bc9559d/3b9c3452052d48c695d3bc7701b7e0d2-beb7fa718d09f342c0343f248501ec10-ld.m3u8?auth_key=1726196459-c79a4890ea2745ceb312469186afdfa0-0-47b4001a778636678c70c2feb4d42586","viewCount":22494,"questCount":0,"isView":"0"},{"videoId":"112","name":"第二课:常见的不文明驾驶行为","title":"不遵守交通法律法规的行为,既属于违法行为,也是不文明的驾驶行为,驾驶人应该增加文明驾驶意识,自觉遵守交通规则,安全第一。","photoUrl":"https://duolunstorage.oss-cn-hangzhou.aliyuncs.com/archive/ddjd/202207/1658822219GA9GTG2J.png","videoUrl":"https://ddjdvideo.duolunxc.com/1bdea813f93a456e890defd3f6d24a42/178aa73b657444989b543dfcd386b4ab-2045d439a68331e4c7b8b1a511d698e1-ld.m3u8?auth_key=1726196459-6d161bab98394c8f981a5df4b07ff77f-0-9527085c0efc3ca3befcb4025b1db1a5","viewCount":10562,"questCount":0,"isView":"0"},{"videoId":"113","name":"第三课:文明礼让驾驶","title":"文明驾驶是驾驶人良好行为习惯和道德修养的表现,也是保障道路交通安全和谐的基础
 | 
					 | 
				
			||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user