From b07cdd51ed7a0c545391da354660dc8ffb0d5fbd Mon Sep 17 00:00:00 2001
From: jhzh <1628036192@qq.com>
Date: Mon, 21 Oct 2024 23:21:15 +0800
Subject: [PATCH] 1

---
 src/page/deliveryContract/position.vue |   30 ++++++++++++++++++++++++++++--
 1 files changed, 28 insertions(+), 2 deletions(-)

diff --git a/src/page/deliveryContract/position.vue b/src/page/deliveryContract/position.vue
index 842581d..1f1d531 100644
--- a/src/page/deliveryContract/position.vue
+++ b/src/page/deliveryContract/position.vue
@@ -55,7 +55,7 @@
       </div>
       <div class="position-div1">
         <span class="position-text1">{{ $t("到期时间") }}</span>
-        <span class="position-text2 textColor">{{ item.close_time }}</span>
+        <span class="position-text2 textColor">{{ getnewtime(item.close_time) }}</span>
       </div>
       <div class="position-div1">
         <span class="position-text1">{{ $t("操作") }}</span>
@@ -112,10 +112,36 @@
   },
   methods: {
     onDetail(item) {
-      // 详细界面
+      // 详细界面 
       this.show = true;
       this.detailData = item;
     },
+	getnewtime(e){
+// 给定的时间字符串 (中国时间)
+const inputDateStr = e;
+
+// 创建一个 Date 对象,注意这里输入的时间是 CST,实际上是 UTC+8
+const inputDate = new Date(inputDateStr + ' UTC+0800');
+
+// 转换为韩国时间 (KST),KST = UTC + 9 小时
+const kstDate = new Date(inputDate.getTime() + 1 * 60 * 60 * 1000); // 8小时 + 1小时 = 9小时
+
+// 获取年、月、日、小时、分钟和秒
+const year = inputDate.getFullYear();
+const month = inputDate.getMonth() + 1; // getMonth() 返回 0 到 11,需要加 1
+const day = inputDate.getDate();
+const hours = inputDate.getHours(); // 小时部分
+const minutes = inputDate.getMinutes(); // 分钟部分
+const seconds = inputDate.getSeconds(); // 秒部分
+
+// 格式化时间为“年-月-日 小时:分钟:秒”格式
+const formattedDate = `${year}-${month.toString().padStart(2, '0')}-${day.toString().padStart(2, '0')}`;
+const formattedTime = `${hours}:${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`;
+			  return formattedDate +' '+ formattedTime
+	}
+  },
+  mounted(){
+	  
   },
 };
 </script>

--
Gitblit v1.9.3