mirror of
https://github.com/fankes/komari-theme-purcarte.git
synced 2025-10-18 19:39:22 +08:00
feat: 添加固定颜色标识以增强到期时间可读性
This commit is contained in:
@@ -42,11 +42,15 @@ export const useNodeCommons = (node: NodeWithStatus) => {
|
|||||||
let daysLeftTag = null;
|
let daysLeftTag = null;
|
||||||
if (daysLeft !== null) {
|
if (daysLeft !== null) {
|
||||||
if (daysLeft < 0) {
|
if (daysLeft < 0) {
|
||||||
daysLeftTag = "已过期";
|
daysLeftTag = "已过期<red>";
|
||||||
|
} else if (daysLeft <= 7) {
|
||||||
|
daysLeftTag = `余 ${daysLeft} 天<red>`;
|
||||||
|
} else if (daysLeft <= 15) {
|
||||||
|
daysLeftTag = `余 ${daysLeft} 天<orange>`;
|
||||||
} else if (daysLeft < 36500) {
|
} else if (daysLeft < 36500) {
|
||||||
daysLeftTag = `余 ${daysLeft} 天`;
|
daysLeftTag = `余 ${daysLeft} 天<green>`;
|
||||||
} else {
|
} else {
|
||||||
daysLeftTag = "长期";
|
daysLeftTag = "长期<green>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -59,7 +63,7 @@ export const useNodeCommons = (node: NodeWithStatus) => {
|
|||||||
|
|
||||||
const tagList = [
|
const tagList = [
|
||||||
...(price ? [price] : []),
|
...(price ? [price] : []),
|
||||||
...(daysLeftTag && price ? [daysLeftTag] : []),
|
...(daysLeftTag ? [daysLeftTag] : []),
|
||||||
...(typeof node.tags === "string"
|
...(typeof node.tags === "string"
|
||||||
? node.tags
|
? node.tags
|
||||||
.split(";")
|
.split(";")
|
||||||
|
Reference in New Issue
Block a user