修复:保险支持5张图片

This commit is contained in:
2025-06-14 17:12:45 +08:00
parent de0f6c43b1
commit 47b6a3d8de
17 changed files with 746 additions and 184 deletions

39
src/utils/time.ts Normal file
View File

@@ -0,0 +1,39 @@
/**
* 获取当前时间
*/
export function formatCurrentDate() {
// 创建一个Date对象表示当前日期和时间
const now = new Date();
// 获取年、月、日,并进行必要的格式化
const day = String(now.getDate()).padStart(2, '0'); // 获取日,并确保是两位数
const month = String(now.getMonth() + 1).padStart(2, '0'); // 获取月并确保是两位数月份是从0开始的所以要加1
const year = String(now.getFullYear()).slice(-2); // 获取年份的最后两位数字
return `${day}${month}${year}`;
}
/**
* 获取当前时分秒
*/
export function formatHhmmss(){
// 创建一个Date对象表示当前日期和时间
const now = new Date();
// 获取当前的小时
const hour = String(now.getHours()).padStart(2, '0');
// 获取当前的分钟
const minute = String(now.getMinutes()).padStart(2, '0');
// 获取当前的秒数
const second = String(now.getSeconds()).padStart(2, '0');
return `${String(Number(hour) - 8).padStart(2, '0')}${minute}${second}`;
}
/**
* 获取当前小时
*/
export function getCurrentHour() {
const now = new Date();
// 获取当前的小时
const hour = String(now.getHours()).padStart(2, '0');
return `${String(Number(hour) - 8).padStart(2, '0')}`;
}