chore: 永久专业版特殊颜色

v2-dev-buy
xiaojunnuo 2025-08-10 02:07:48 +08:00
parent 54365528a8
commit 74c331eaf7
2 changed files with 21 additions and 5 deletions

View File

@ -1,5 +1,5 @@
<template>
<div v-if="!settingStore.isComm || userStore.isAdmin" class="layout-vip isPlus" @click="openUpgrade">
<div v-if="!settingStore.isComm || userStore.isAdmin" class="layout-vip isPlus" :class="{ isForever: settingStore.isForever }" @click="openUpgrade">
<contextHolder />
<fs-icon icon="mingcute:vip-1-line" :title="text.title" />
@ -106,7 +106,7 @@ const text = computed<Text>(() => {
const expireTime = computed(() => {
if (settingStore.isPlus) {
return dayjs(settingStore.plusInfo.expireTime).format("YYYY-MM-DD");
return settingStore.expiresText;
}
return "";
});
@ -368,7 +368,7 @@ function openUpgrade() {
</div>
<div class="mt-10">
<h3 class="block-header">{isPlus ? t("vip.renew") : t("vip.activate_immediately")}</h3>
<div>{isPlus ? `${t("vip.current")} ${vipLabel} ${t("vip.activated_expire_time")}` + dayjs(settingStore.plusInfo.expireTime).format("YYYY-MM-DD") : ""}</div>
<div>{isPlus ? `${t("vip.current")} ${vipLabel} ${t("vip.activated_expire_time")}` + settingStore.expiresText : ""}</div>
<div class="mt-10">
<div class="flex-o w-100">
<span>{t("vip.site_id")}</span>
@ -410,6 +410,10 @@ onMounted(() => {
&.isPlus {
color: #c5913f;
&.isForever {
color: #ff2e83;
}
}
.text {

View File

@ -125,10 +125,10 @@ export const useSettingStore = defineStore({
return this.installInfo;
},
isPlus(): boolean {
return this.plusInfo?.isPlus && this.plusInfo?.expireTime > new Date().getTime();
return this.plusInfo?.isPlus && (this.plusInfo?.expireTime === -1 || this.plusInfo?.expireTime > new Date().getTime());
},
isComm(): boolean {
return this.plusInfo?.isComm && this.plusInfo?.expireTime > new Date().getTime();
return this.plusInfo?.isComm && (this.plusInfo?.expireTime === -1 || this.plusInfo?.expireTime > new Date().getTime());
},
isAgent(): boolean {
return this.siteEnv?.agent?.enabled === true;
@ -136,6 +136,18 @@ export const useSettingStore = defineStore({
isCommOrAgent() {
return this.isComm || this.isAgent;
},
expiresText() {
if (this.plusInfo?.expireTime == null) {
return "";
}
if (this.plusInfo?.expireTime === -1) {
return "永久";
}
return utils.time.formatDate(this.plusInfo?.expireTime, "yyyy-MM-dd");
},
isForever() {
return this.isPlus && this.plusInfo?.expireTime === -1;
},
vipLabel(): string {
const { t } = useI18n();
const vipLabelMap: any = {