Compare commits
	
		
			No commits in common. "dbd2a495390c826bd6703555b85389e8d831017f" and "ac408a3281be6831e96b482f36fb9b0826aef379" have entirely different histories.
		
	
	
		
			dbd2a49539
			...
			ac408a3281
		
	
		
@ -96,10 +96,6 @@ export async function initTable() {
 | 
			
		||||
export function sqlInsertCommonFn(tableName, resultArr, delFlag = true) {
 | 
			
		||||
  return new Promise((resolve, reject) => {
 | 
			
		||||
    DB.clearTable(tableName).then((res) => {
 | 
			
		||||
      if (!resultArr || resultArr.length == 0) {
 | 
			
		||||
        resolve(true)
 | 
			
		||||
        return
 | 
			
		||||
      }
 | 
			
		||||
      let INSERT_SQL = "INSERT INTO " + tableName
 | 
			
		||||
        + " (" + map[tableName].ACCOUNT_TABLE.columns.toString() + ") VALUES "
 | 
			
		||||
 | 
			
		||||
@ -194,11 +190,9 @@ export async function getDataBaseTable(params, reqParam) {
 | 
			
		||||
      });
 | 
			
		||||
      return
 | 
			
		||||
    }
 | 
			
		||||
    const str = {
 | 
			
		||||
      "head": { "time": dateFormat(date) },
 | 
			
		||||
    const str = { "head": { "time": dateFormat(date) },
 | 
			
		||||
      "body":
 | 
			
		||||
      {
 | 
			
		||||
        "tableName": params.tableName, // 表名
 | 
			
		||||
      { "tableName": params.tableName, // 表名
 | 
			
		||||
        "paraKdid": reqParam.paraKdid, //参数平台kdid
 | 
			
		||||
        "examinationRoomId": reqParam.examinationRoomId, //考试平台kdid
 | 
			
		||||
        "typeRsp": "0" // 赋默认值0,无需改变
 | 
			
		||||
@ -239,11 +233,9 @@ export async function upDateTable(params, reqParam) {
 | 
			
		||||
      return
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    const str = {
 | 
			
		||||
      "head": { "time": dateFormat(date) },
 | 
			
		||||
    const str = { "head": { "time": dateFormat(date) },
 | 
			
		||||
      "body":
 | 
			
		||||
      {
 | 
			
		||||
        "tableName": params.tableName, // 表名
 | 
			
		||||
      { "tableName": params.tableName, // 表名
 | 
			
		||||
        "paraKdid": reqParam.paraKdid, //参数平台kdid
 | 
			
		||||
        "examinationRoomId": reqParam.kdid, //考试平台kdid
 | 
			
		||||
        "typeRsp": "0" // 赋默认值0,无需改变
 | 
			
		||||
@ -277,11 +269,9 @@ export async function getMySystemSetTable(params, reqParam) {
 | 
			
		||||
      });
 | 
			
		||||
      return
 | 
			
		||||
    }
 | 
			
		||||
    const str = {
 | 
			
		||||
      "head": { "time": dateFormat(date) },
 | 
			
		||||
    const str = { "head": { "time": dateFormat(date) },
 | 
			
		||||
      "body":
 | 
			
		||||
      {
 | 
			
		||||
        "tableName": params.tableName, // 表名
 | 
			
		||||
      { "tableName": params.tableName, // 表名
 | 
			
		||||
        "paraKdid": reqParam?.paraKdid, //参数平台kdid
 | 
			
		||||
        "examinationRoomId": reqParam?.kdid, //考试平台kdid
 | 
			
		||||
        "typeRsp": "0" // 赋默认值0,无需改变
 | 
			
		||||
@ -357,8 +347,7 @@ export async function getEsCarModel(context) {
 | 
			
		||||
    });
 | 
			
		||||
    return
 | 
			
		||||
  }
 | 
			
		||||
  const carStr = {
 | 
			
		||||
    "head": { "time": dateFormat(date) },
 | 
			
		||||
  const carStr = { "head": { "time": dateFormat(date) },
 | 
			
		||||
    "body":
 | 
			
		||||
    {
 | 
			
		||||
      "rtkType": "1", //1:车模 2:场地模型
 | 
			
		||||
@ -369,8 +358,7 @@ export async function getEsCarModel(context) {
 | 
			
		||||
      "carMac": globalThis.deviceNo
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  const venueStr = {
 | 
			
		||||
    "head": { "time": dateFormat(date) },
 | 
			
		||||
  const venueStr = { "head": { "time": dateFormat(date) },
 | 
			
		||||
    "body":
 | 
			
		||||
    {
 | 
			
		||||
      "rtkType": "2", //1:车模 2:场地模型
 | 
			
		||||
@ -408,12 +396,9 @@ export async function upDataZhongxinginitialization(param) {
 | 
			
		||||
    if (param.singlePlay) {
 | 
			
		||||
      console.log('teststet0', JSON.stringify(param))
 | 
			
		||||
      const fileUtil = new FileUtil(param.context)
 | 
			
		||||
      const tableList =
 | 
			
		||||
        ['MA_SYSSET', 'MA_SYSTEMPARM', 'MA_MARKRULE', 'MA_MARKRULESET', 'ES_CARINFO', 'MA_MAP_ROAD', 'MA_MAP_ROAD_LANE',
 | 
			
		||||
          'MAP_SUBITEM', 'MA_T_CARPARMSET', 'MA_MAP_ITEMCLASS', 'MA_MAP_POINT', 'MA_MAP_POINT_ITEM'];
 | 
			
		||||
      const tableList = ['MA_SYSSET', 'MA_SYSTEMPARM', 'MA_MARKRULE', 'MA_MARKRULESET', 'ES_CARINFO', 'MA_MAP_ROAD', 'MA_MAP_ROAD_LANE', 'MAP_SUBITEM', 'MA_T_CARPARMSET', 'MA_MAP_ITEMCLASS', 'MA_MAP_POINT', 'MA_MAP_POINT_ITEM'];
 | 
			
		||||
      for (let i = 0; i <= tableList.length - 1; i++) {
 | 
			
		||||
        const data =
 | 
			
		||||
          await fileUtil.readFile(GlobalConfig.comoonfileWriteAddress + `/config/tableList/${tableList[i]}.txt`);
 | 
			
		||||
        const data = await fileUtil.readFile(GlobalConfig.comoonfileWriteAddress + `/config/tableList/${tableList[i]}.txt`);
 | 
			
		||||
        const result = await sqlInsertCommonFn(tableList[i], JSON.parse(data) || [], param.context)
 | 
			
		||||
 | 
			
		||||
        result ? (flag = true) : (flag = false)
 | 
			
		||||
 | 
			
		||||
@ -57,7 +57,8 @@ export async function startRecordVideo(param, td, context, dir, path?, index?) {
 | 
			
		||||
      var recordResult = rtsp_server.startRecordVideo(context, video_uri, fileName, date, dir);
 | 
			
		||||
      const handleId = recordResult.dataInt;
 | 
			
		||||
      reslove(handleId)
 | 
			
		||||
    } else {
 | 
			
		||||
    }
 | 
			
		||||
    else {
 | 
			
		||||
      console.log(`Rtsprecord startRecordVideo rtsp_server isnull`);
 | 
			
		||||
      reslove(0)
 | 
			
		||||
    }
 | 
			
		||||
@ -73,10 +74,10 @@ export async function endRecordVideo(record_handleObj) {
 | 
			
		||||
      console.log(`Rtsprecord endRecordVideo begin`);
 | 
			
		||||
      // @ts-ignore
 | 
			
		||||
      var recordResult = rtsp_server.endRecordVideo(record_handleObj[key]);
 | 
			
		||||
      console.log(`Rtsprecord endRecordVideo record_handle` + record_handleObj[key].dataInt + ` filename:` +
 | 
			
		||||
      record_handleObj[key].fileName);
 | 
			
		||||
      console.log(`Rtsprecord endRecordVideo record_handle` + record_handleObj[key].dataInt + ` filename:` + record_handleObj[key].fileName);
 | 
			
		||||
 | 
			
		||||
    } else {
 | 
			
		||||
    }
 | 
			
		||||
    else {
 | 
			
		||||
      console.log(`Rtsprecord endRecordVideo handleId isnull`);
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
@ -122,8 +123,7 @@ async function getfilehandleCode(td, param, dir, path, index) {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
export async function getUserAlbumItemByDisplayName(displayName: string, day?,
 | 
			
		||||
  type?): Promise<photoAccessHelper.Album> {
 | 
			
		||||
export async function getUserAlbumItemByDisplayName(displayName: string, day?, type?): Promise<photoAccessHelper.Album> {
 | 
			
		||||
  let fetchResult = null
 | 
			
		||||
  let album: photoAccessHelper.Album = null
 | 
			
		||||
  try {
 | 
			
		||||
@ -136,9 +136,7 @@ export async function getUserAlbumItemByDisplayName(displayName: string, day?,
 | 
			
		||||
    };
 | 
			
		||||
    const userFileMgr = photoAccessHelper.getPhotoAccessHelper(globalThis.context);
 | 
			
		||||
 | 
			
		||||
    fetchResult =
 | 
			
		||||
      await userFileMgr.getAlbums(photoAccessHelper.AlbumType.USER, photoAccessHelper.AlbumSubtype.USER_GENERIC,
 | 
			
		||||
        fetchOptions);
 | 
			
		||||
    fetchResult = await userFileMgr.getAlbums(photoAccessHelper.AlbumType.USER, photoAccessHelper.AlbumSubtype.USER_GENERIC, fetchOptions);
 | 
			
		||||
    console.log('get getUserAlbumItemByDisplayName, count: ' + JSON.stringify(fetchResult));
 | 
			
		||||
    if (fetchResult.getCount() > 0) {
 | 
			
		||||
      const albums = await fetchResult.getLastObject();
 | 
			
		||||
@ -196,9 +194,7 @@ export async function delPic(day, type) {
 | 
			
		||||
    fetchColumns: [],
 | 
			
		||||
    predicates: predicates
 | 
			
		||||
  };
 | 
			
		||||
  let albumList: photoAccessHelper.FetchResult<photoAccessHelper.Album> =
 | 
			
		||||
    await phAccessHelper.getAlbums(photoAccessHelper.AlbumType.USER, photoAccessHelper.AlbumSubtype.USER_GENERIC,
 | 
			
		||||
      albumFetchOptions);
 | 
			
		||||
  let albumList: photoAccessHelper.FetchResult<photoAccessHelper.Album> = await phAccessHelper.getAlbums(photoAccessHelper.AlbumType.USER, photoAccessHelper.AlbumSubtype.USER_GENERIC, albumFetchOptions);
 | 
			
		||||
  let albums = await albumList.getAllObjects();
 | 
			
		||||
  for (let i = 0; i <= albums.length; i++) {
 | 
			
		||||
    let albumName = albums[i].albumName
 | 
			
		||||
@ -227,7 +223,8 @@ export async function takePhoto(param, context, dir, flag = 1, callback?) {
 | 
			
		||||
      console.log("baohaowen_detectLoop round end size1:" + snapResult.fileSize);
 | 
			
		||||
      callback({ fileSize: snapResult.fileSize, errorCode: snapResult.errorCode })
 | 
			
		||||
    });
 | 
			
		||||
  } else {
 | 
			
		||||
  }
 | 
			
		||||
  else {
 | 
			
		||||
    return new Promise<takePhotoParam>(async (resolve, reject) => {
 | 
			
		||||
      const time = await getCurrentTime()
 | 
			
		||||
      const date = time.split(' ')[0]
 | 
			
		||||
@ -267,8 +264,7 @@ export async function deleteAllFileByPiC(dirName, type = 1) {
 | 
			
		||||
  fileHelper.deleteFileOfAlbum(dirName, type);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export async function deleteAllVideos(context, type: photoAccessHelper.AlbumType,
 | 
			
		||||
  subType: photoAccessHelper.AlbumSubtype): Promise<void> {
 | 
			
		||||
export async function deleteAllVideos(context, type: photoAccessHelper.AlbumType, subType: photoAccessHelper.AlbumSubtype): Promise<void> {
 | 
			
		||||
  let fetchResult: photoAccessHelper.FetchResult<photoAccessHelper.Album> = null;
 | 
			
		||||
  try {
 | 
			
		||||
    const userFileMgr = photoAccessHelper.getPhotoAccessHelper(context);
 | 
			
		||||
 | 
			
		||||
@ -98,7 +98,7 @@ struct UserInfo {
 | 
			
		||||
    if (singlePlay) {
 | 
			
		||||
      return ''
 | 
			
		||||
    } else {
 | 
			
		||||
      const { filePhoto } = this;
 | 
			
		||||
      const {filePhoto} = this;
 | 
			
		||||
      const photoBase64 = await filePhoto.getPhoto();
 | 
			
		||||
      return photoBase64
 | 
			
		||||
    }
 | 
			
		||||
@ -119,7 +119,7 @@ struct UserInfo {
 | 
			
		||||
      this.ksksLimit = true
 | 
			
		||||
 | 
			
		||||
      if (globalThis.singlePlay) {
 | 
			
		||||
        const { examSubject } = globalThis.carInfo;
 | 
			
		||||
        const {examSubject} = globalThis.carInfo;
 | 
			
		||||
        this.currentUser.id = '0'
 | 
			
		||||
        await upDateTableByArray('USER', [this.currentUser])
 | 
			
		||||
        router.pushUrl({
 | 
			
		||||
@ -312,7 +312,7 @@ struct UserInfo {
 | 
			
		||||
 | 
			
		||||
        globalThis.lsh = res.lsh
 | 
			
		||||
        globalThis.ksyh = res.ksy1sfzmhm
 | 
			
		||||
        const { examSubject } = globalThis.carInfo;
 | 
			
		||||
        const {examSubject} = globalThis.carInfo;
 | 
			
		||||
        // this.currentUser.kszp=this.photo+res.kszp
 | 
			
		||||
        // this.currentUser.ksmjzp=this.photo+this.currentUser.ksmjzp
 | 
			
		||||
        if (globalThis.singlePlay) {
 | 
			
		||||
@ -637,24 +637,19 @@ struct UserInfo {
 | 
			
		||||
    this.ksksLimit = false
 | 
			
		||||
    // this.isBoardPrePareSetPopupOpen=true
 | 
			
		||||
    this.isFirstBoardPrePareSetPopupBtnShow = false
 | 
			
		||||
    console.log('isFirstBoardPrePareSetPopupBtnShow', this.isFirstBoardPrePareSetPopupBtnShow,
 | 
			
		||||
      this.isBoardPrePareSetPopupOpen)
 | 
			
		||||
    console.log('isFirstBoardPrePareSetPopupBtnShow', this.isFirstBoardPrePareSetPopupBtnShow, this.isBoardPrePareSetPopupOpen)
 | 
			
		||||
    this.startExam = false
 | 
			
		||||
    // await upDateTableByArray('USER', [])
 | 
			
		||||
    // await upDateTableByArray('USERLIST', [])
 | 
			
		||||
    // await DB.clearTable('USER')
 | 
			
		||||
    // await DB.clearTable('USERLIST')
 | 
			
		||||
    await DB.clearTable('USER')
 | 
			
		||||
    await DB.clearTable('USERLIST')
 | 
			
		||||
    this.type = '2'
 | 
			
		||||
    this.errorDialog.open()
 | 
			
		||||
    this.updateTimeLimit = true
 | 
			
		||||
    const param = `<getExaminationStudentInfoReq><head><checkCode>${Md5.Instance.get_md5(globalThis.carInfo.carId +
 | 
			
		||||
    globalThis.carInfo.examinationRoomId +
 | 
			
		||||
    globalThis.username)}</checkCode></head><body><carId>${globalThis.carInfo.carId}</carId><examinationRoomId>${globalThis.carInfo.examinationRoomId}</examinationRoomId><examinerName>${globalThis.username}</examinerName><sfzmhm></sfzmhm></body></getExaminationStudentInfoReq>`
 | 
			
		||||
    const param = `<getExaminationStudentInfoReq><head><checkCode>${Md5.Instance.get_md5(globalThis.carInfo.carId + globalThis.carInfo.examinationRoomId + globalThis.username)}</checkCode></head><body><carId>${globalThis.carInfo.carId}</carId><examinationRoomId>${globalThis.carInfo.examinationRoomId}</examinationRoomId><examinerName>${globalThis.username}</examinerName><sfzmhm></sfzmhm></body></getExaminationStudentInfoReq>`
 | 
			
		||||
    try {
 | 
			
		||||
      getExaminationStudentInfo(param).then(async (res) => {
 | 
			
		||||
        console.log("temp log ", JSON.stringify(res))
 | 
			
		||||
        await DB.clearTable('USER')
 | 
			
		||||
        await DB.clearTable('USERLIST')
 | 
			
		||||
        this.errorDialog.close()
 | 
			
		||||
        setTimeout(() => {
 | 
			
		||||
          this.updateTimeLimit = false
 | 
			
		||||
@ -800,8 +795,7 @@ struct UserInfo {
 | 
			
		||||
      return
 | 
			
		||||
    }
 | 
			
		||||
    console.log('JsonJson', JSON.stringify(this.currentUser))
 | 
			
		||||
    const param =
 | 
			
		||||
      `<?xml version="1.0" encoding="UTF-8" ?><examinationStuAbsentReq><body><carId>${globalThis.carInfo.carId}</carId><cardNo>${this.currentUser.sfzmhm}</cardNo><examinationRoomId>${globalThis.carInfo.examinationRoomId}</examinationRoomId><examinerName>${globalThis.username}</examinerName><lsh>${this.lsh}</lsh></body></examinationStuAbsentReq>`
 | 
			
		||||
    const param = `<?xml version="1.0" encoding="UTF-8" ?><examinationStuAbsentReq><body><carId>${globalThis.carInfo.carId}</carId><cardNo>${this.currentUser.sfzmhm}</cardNo><examinationRoomId>${globalThis.carInfo.examinationRoomId}</examinationRoomId><examinerName>${globalThis.username}</examinerName><lsh>${this.lsh}</lsh></body></examinationStuAbsentReq>`
 | 
			
		||||
    console.log('carNo1111', param)
 | 
			
		||||
 | 
			
		||||
    examinationStuAbsent(param).then(res => {
 | 
			
		||||
@ -837,7 +831,7 @@ struct UserInfo {
 | 
			
		||||
      return
 | 
			
		||||
    }
 | 
			
		||||
    const carInfo = globalThis.carInfo;
 | 
			
		||||
    const { carId, examinationRoomId } = carInfo;
 | 
			
		||||
    const {carId,examinationRoomId} = carInfo;
 | 
			
		||||
    const examItems = await getExaminationItem({
 | 
			
		||||
      time: getCurrentTime(),
 | 
			
		||||
      carId,
 | 
			
		||||
@ -859,7 +853,7 @@ struct UserInfo {
 | 
			
		||||
    globalThis.statue = 4
 | 
			
		||||
    this.stepFlag = true
 | 
			
		||||
    const carInfo = globalThis.carInfo;
 | 
			
		||||
    const { carId, examinationRoomId } = carInfo;
 | 
			
		||||
    const {carId,examinationRoomId} = carInfo;
 | 
			
		||||
    let examItems = { getExaminationItemRsp: { body: { ykxx: '' } } };
 | 
			
		||||
    if (!globalThis.singlePlay) {
 | 
			
		||||
      //获取已考项目
 | 
			
		||||
@ -877,7 +871,7 @@ struct UserInfo {
 | 
			
		||||
 | 
			
		||||
    avPlayer.playAudio([`voice/监管通信中.mp3`], false, async () => {
 | 
			
		||||
      console.info('surenjun', '播放结束开始考试接口调用')
 | 
			
		||||
      const { code, keystr, message } = await this.beginExam() || {};
 | 
			
		||||
      const {code,keystr,message} = await this.beginExam() || {};
 | 
			
		||||
      console.info('surenjun', '开始考试接口调用结束')
 | 
			
		||||
      // console.info('surenjun',code +'')
 | 
			
		||||
      //@ts-ignore TODO code转换
 | 
			
		||||
@ -914,8 +908,8 @@ struct UserInfo {
 | 
			
		||||
 | 
			
		||||
  // 检测车门、熄火信号
 | 
			
		||||
  async checkSignal(): Promise<boolean> {
 | 
			
		||||
    const { isCheckFireOpen } = judgeConfig
 | 
			
		||||
    const { systemParam, isBoardPrePareSetPopupOpen } = this;
 | 
			
		||||
    const {isCheckFireOpen} = judgeConfig
 | 
			
		||||
    const {systemParam,isBoardPrePareSetPopupOpen} = this;
 | 
			
		||||
    const Param803Str = systemParam.Param803Str
 | 
			
		||||
    if (Param803Str === '') {
 | 
			
		||||
      return true
 | 
			
		||||
@ -1020,8 +1014,8 @@ struct UserInfo {
 | 
			
		||||
  // 开始考试
 | 
			
		||||
  async beginExam() {
 | 
			
		||||
    const carInfo = globalThis.carInfo;
 | 
			
		||||
    const { carId, examinationRoomId } = carInfo;
 | 
			
		||||
    const { examSubject, plateNo } = carInfo;
 | 
			
		||||
    const {carId,examinationRoomId} = carInfo;
 | 
			
		||||
    const { examSubject,plateNo } = carInfo;
 | 
			
		||||
    const date = new Date()
 | 
			
		||||
    globalThis.startHourTime = await getCurrentHourTime()
 | 
			
		||||
    const photoBase64 = await this.getPhoto();
 | 
			
		||||
@ -1125,13 +1119,11 @@ struct UserInfo {
 | 
			
		||||
            }
 | 
			
		||||
            .width(165 * this.ratio)
 | 
			
		||||
            .height(85 * this.ratio)
 | 
			
		||||
            .backgroundImage(item.sfzmhm != this.currentUser.sfzmhm ? $r('app.media.userbox2') :
 | 
			
		||||
            $r('app.media.userboxbg'))
 | 
			
		||||
            .backgroundImage(item.sfzmhm != this.currentUser.sfzmhm ? $r('app.media.userbox2') : $r('app.media.userboxbg'))
 | 
			
		||||
            .backgroundImageSize({ width: '100%', height: '100%' })
 | 
			
		||||
            .onClick(() => {
 | 
			
		||||
              console.log('this.startExam', this.startExam, this.systemParam.Param364, this.isExamStart)
 | 
			
		||||
              if ((this.isExamStart && !globalThis.singlePlay && this.systemParam.Param341) ||
 | 
			
		||||
                (this.startExam && this.systemParam.Param364 == '2')) {
 | 
			
		||||
              if ((this.isExamStart && !globalThis.singlePlay && this.systemParam.Param341) || (this.startExam && this.systemParam.Param364 == '2')) {
 | 
			
		||||
                return
 | 
			
		||||
              }
 | 
			
		||||
              this.currentUser = EmptyCandidateObject
 | 
			
		||||
@ -1226,17 +1218,14 @@ struct UserInfo {
 | 
			
		||||
            .onClick(() => {
 | 
			
		||||
              // this.avPlayer.playAudio(['button_media.wav'])
 | 
			
		||||
              //  已开始考试不能缺考   已考过一次学员不能缺考                                                 车上不能缺考
 | 
			
		||||
              if (this.ksksLimit || (this.systemParam.Param352Str == '1' && this.currentUser.kssycs == '1') ||
 | 
			
		||||
                this.systemParam.Param770Str == '1') {
 | 
			
		||||
              if (this.ksksLimit || (this.systemParam.Param352Str == '1' && this.currentUser.kssycs == '1') || this.systemParam.Param770Str == '1') {
 | 
			
		||||
                return
 | 
			
		||||
              }
 | 
			
		||||
              this.ksksLimit = true
 | 
			
		||||
              this.qkFlag = true
 | 
			
		||||
            })
 | 
			
		||||
 | 
			
		||||
          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()
 | 
			
		||||
            imageBtn({ btnWidth: 220 * this.ratio, btnHeight: 69 * this.ratio, imgSrc: $r('app.media.sczb_btn') })
 | 
			
		||||
 | 
			
		||||
@ -13,39 +13,18 @@ interface Params {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export default class FilePhoto {
 | 
			
		||||
  public mediaTest
 | 
			
		||||
  private params: Params
 | 
			
		||||
  private context: any
 | 
			
		||||
  public getPhoto = async () => {
 | 
			
		||||
    const { params } = this;
 | 
			
		||||
    if (!judgeConfig.isPhotoOpen) {
 | 
			
		||||
      return ''
 | 
			
		||||
    } else {
 | 
			
		||||
      try {
 | 
			
		||||
        console.info('surenjun', '拍照开始')
 | 
			
		||||
        const res = await takePhoto(params, this.context, 'pz/', 0);
 | 
			
		||||
        console.info('surenjun', '拍照结束' + JSON.stringify(res))
 | 
			
		||||
        return res.base64
 | 
			
		||||
      } catch (e) {
 | 
			
		||||
        console.error('surenjun =>拍照异常' + JSON.stringify(e))
 | 
			
		||||
        promptAction.showToast({
 | 
			
		||||
          message: '拍照异常,请联系工程人员!',
 | 
			
		||||
          duration: 2000
 | 
			
		||||
        });
 | 
			
		||||
        return ''
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  private fileUtil: FileUtil
 | 
			
		||||
  public mediaTest
 | 
			
		||||
 | 
			
		||||
  constructor(context) {
 | 
			
		||||
    (async () => {
 | 
			
		||||
      //TODO 309参数 获取拍照摄像头拍照通道
 | 
			
		||||
      const fileUtil = new FileUtil(context)
 | 
			
		||||
      const strConfig =
 | 
			
		||||
        await fileUtil.readFile('/mnt/hmdfs/100/account/device_view/local/files/duolun/config/config3.txt');
 | 
			
		||||
      const strConfig = await fileUtil.readFile('/mnt/hmdfs/100/account/device_view/local/files/duolun/config/config3.txt');
 | 
			
		||||
      const config = JSON.parse(strConfig)
 | 
			
		||||
      const { userName, ip, pwd, port, rlls, pztd } = config
 | 
			
		||||
      const {userName,ip,pwd,port,rlls,pztd} = config
 | 
			
		||||
      this.params = {
 | 
			
		||||
        userName,
 | 
			
		||||
        pwd,
 | 
			
		||||
@ -58,4 +37,25 @@ export default class FilePhoto {
 | 
			
		||||
      this.fileUtil = fileUtil
 | 
			
		||||
    })()
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  public getPhoto = async () => {
 | 
			
		||||
    const {params} = this;
 | 
			
		||||
    if (!judgeConfig.isPhotoOpen) {
 | 
			
		||||
      return ''
 | 
			
		||||
    } else {
 | 
			
		||||
      try {
 | 
			
		||||
        console.info('surenjun', '拍照开始')
 | 
			
		||||
        const res = await takePhoto(params, this.context, 'pz/', 2);
 | 
			
		||||
        console.info('surenjun', '拍照结束' + JSON.stringify(res))
 | 
			
		||||
        return res.base64
 | 
			
		||||
      } catch (e) {
 | 
			
		||||
        console.error('surenjun =>拍照异常' + JSON.stringify(e))
 | 
			
		||||
        promptAction.showToast({
 | 
			
		||||
          message: '拍照异常,请联系工程人员!',
 | 
			
		||||
          duration: 2000
 | 
			
		||||
        });
 | 
			
		||||
        return ''
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user