From 7ac5363a676588078fdce082a45a28300479e158 Mon Sep 17 00:00:00 2001
From: 马宇豪 <978517621@qq.com>
Date: Mon, 22 Jul 2024 14:09:22 +0800
Subject: [PATCH] 提交
---
pages/tabBar/current/current.vue | 18 +++++++++++++++---
1 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/pages/tabBar/current/current.vue b/pages/tabBar/current/current.vue
index f7fe952..aedda17 100644
--- a/pages/tabBar/current/current.vue
+++ b/pages/tabBar/current/current.vue
@@ -28,7 +28,7 @@
<span style="color: #999;font-size: 12px;display: flex;align-items: center"><u-icon name="account" color="#999" size="18" style="margin-bottom: 0;margin-right: 2px"></u-icon>{{item.createName +'('+ item.createTime +')'}}</span>
</view>
<view class="card-i-r-b">
- <u-tag icon="clock" :text="item.course.period + '分钟'" type="success" size="mini" shape="circle" plain plainFill></u-tag>
+ <u-tag icon="clock" :text="secondsToHms(item.course.period)" type="success" size="mini" shape="circle" plain plainFill></u-tag>
<u-button class="study-button" type="primary" text="开始学习" shape="circle" size="small" @click="toStudy(item.id)"></u-button>
</view>
</view>
@@ -110,6 +110,18 @@
url: `/pages/tabBar/current/detail?phase_id=` + encodeURIComponent(JSON.stringify(id))
})
},
+
+ secondsToHms(seconds) {
+ seconds = Number(seconds);
+ const h = Math.floor(seconds / 3600);
+ const m = Math.floor(seconds % 3600 / 60);
+ const s = Math.floor(seconds % 3600 % 60);
+
+ const hDisplay = h > 0 ? String(h).padStart(2, '0') : '00';
+ const mDisplay = m > 0 ? String(m).padStart(2, '0') : '00';
+ const sDisplay = s > 0 ? String(s).padStart(2, '0') : '00';
+ return `${hDisplay}:${mDisplay}:${sDisplay}`;
+ },
upper(e) {
// console.log(e)
@@ -206,7 +218,7 @@
.card-i{
width: calc(100% - 30px);
background: #fff;
- border-radius: 16px;
+ border-radius: 20px;
padding: 15px;
margin: 0 auto 15px;
position: relative;
@@ -222,7 +234,7 @@
position: absolute;
width: 250rpx;
height: 30px;
- border-radius: 16px;
+ border-radius: 20px;
line-height: 30px;
color: #fff;
padding: 0 10rpx;
--
Gitblit v1.9.2