图片删除
This commit is contained in:
		
							parent
							
								
									bf0e77bf1f
								
							
						
					
					
						commit
						71e51f4e7d
					
				| @ -16,7 +16,7 @@ import { | ||||
| import { GlobalConfig } from '../../config/index' | ||||
| import testNapi from '@ohos.hiserialsdk' | ||||
| import fs from '@ohos.file.fs'; | ||||
| 
 | ||||
| import {deleteAllPicturesFn} from './videoService' | ||||
| let num = 0 | ||||
| 
 | ||||
| async function getliushuiNum(data) { | ||||
| @ -94,7 +94,27 @@ export async function setVideoParam() { | ||||
| } | ||||
| 
 | ||||
| let fileFd | ||||
| 
 | ||||
| export async function delHilog(day=7) { | ||||
|   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)
 | ||||
|       deleteAllPicturesFn() | ||||
|       // fileUtil.addFile(`${folderPath}/hilogTime.txt`, JSON.stringify(num))
 | ||||
|     } | ||||
|   } | ||||
| } | ||||
| //配置流水号
 | ||||
| export async function setliushuiNum() { | ||||
|   const data = AppStorage.get('liushuiNo') | ||||
|  | ||||
| @ -10,7 +10,7 @@ import { getUDP, getUDP2 } from '../common/utils/GlobalUdp'; | ||||
| import { initJudgeUdp } from '../common/utils/UdpJudge'; | ||||
| import { judgeConfig } from './judgeSDK/utils/judgeConfig'; | ||||
| import { getTCP } from '../common/utils/GlobalTcp'; | ||||
| import {  setliushuiNum, takePhotoFn, setVideoParam } from '../common/service/indexService'; | ||||
| import {  setliushuiNum, takePhotoFn, setVideoParam, delHilog } from '../common/service/indexService'; | ||||
| import abilityAccessCtrl, { Permissions } from '@ohos.abilityAccessCtrl'; | ||||
| import worker, { MessageEvents } from '@ohos.worker'; | ||||
| import promptAction from '@ohos.promptAction' | ||||
| @ -552,6 +552,22 @@ struct Index { | ||||
|       } | ||||
|     }, 1000) | ||||
|     this.createAlbum() | ||||
|     // | ||||
|     //按日期删除照片视频 | ||||
|     getSyncData('MA_SYSSET').then(data => { | ||||
|       console.log('datadata', JSON.stringify(data)) | ||||
|       if (data?.[0]){ | ||||
|         delHilog(7) | ||||
|         return | ||||
|       } | ||||
|       // @ts-ignore | ||||
|       data.forEach(sys => { | ||||
|         //判断是否能点开始考试 | ||||
|         if(sys.v_no === '305'){ | ||||
|           delHilog(Number(sys.v_value)) | ||||
|         } | ||||
|       }) | ||||
|     }); | ||||
|     //下载模型 | ||||
|     // await this.getModel() | ||||
|     // const arr = [0x55, 0xaa, 0x01, 0x00, 0x02, 0x01, 0x03, 0x00] | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user