From ef341b7695a62249399fe63fb77bbb887ab71734 Mon Sep 17 00:00:00 2001
From: jhzh <1628036192@qq.com>
Date: Mon, 04 Aug 2025 13:46:12 +0800
Subject: [PATCH] 1111
---
src/page/home/Record.vue | 18 +++++++++++++++---
1 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/src/page/home/Record.vue b/src/page/home/Record.vue
index c83d716..658d3d6 100644
--- a/src/page/home/Record.vue
+++ b/src/page/home/Record.vue
@@ -33,9 +33,7 @@
<div class="pages_box_after">¥{{item.amount }}</div>
<!-- <div class="pages_box_after">¥{{item.beFore}}</div> -->
<div class="pages_box_after">{{
- $moment(item.createTime).format(
- "DD-MM-YYYY hh:mm:ss A"
- )
+ formatTimestamp(item.createTime)
}}</div>
<div class="pages_box_after">{{item.descs}}</div>
</div>
@@ -75,6 +73,20 @@
this.getpagelist();
},
methods: {
+ formatTimestamp(timestamp) {
+ const date = new Date(timestamp); // 将时间戳转换为 Date 对象
+
+ const day = date.getDate(); // 日期
+ const month = date.getMonth() + 1; // 月份(从 0 开始,所以下标要加 1)
+ const year = date.getFullYear(); // 年份
+ const hours = date.getHours(); // 小时
+ const minutes = date.getMinutes(); // 分钟
+ const seconds = date.getSeconds(); // 秒钟
+
+ // 格式化为 "日月年/时分秒" 格式
+ return `${year}${this.$t('年')}${month}${this.$t('月')}${day}${this.$t('日')}/${hours}:${minutes}:${seconds}`;
+ // return `${month}`;
+ },
rechargeAccountSelect(e) {
this.rechargeAccountData = e;
this.type = e.key
--
Gitblit v1.9.3