chore: product info

This commit is contained in:
xiaojunnuo
2025-04-27 22:51:47 +08:00
parent 605440812f
commit 8087524bef
136 changed files with 124 additions and 7122 deletions

View File

@@ -9,7 +9,7 @@ import { env } from "/@/utils/util.env";
import { updatePreferences } from "/@/vben/preferences";
import { useTitle } from "@vueuse/core";
import { utils } from "/@/utils";
import { cloneDeep } from "lodash-es";
import { cloneDeep, merge } from "lodash-es";
export interface SettingState {
sysPublic?: SysPublicSetting;
@@ -32,6 +32,21 @@ export interface SettingState {
time?: number;
deltaTime?: number;
};
productInfo: {
notice?: string;
plus: {
name: string;
price: number;
price3: number;
tooltip?: string;
};
comm: {
name: string;
price: number;
price3: number;
tooltip?: string;
};
};
}
const defaultSiteInfo: SiteInfo = {
@@ -80,6 +95,19 @@ export const useSettingStore = defineStore({
time: 0,
deltaTime: 0,
},
productInfo: {
notice: "",
plus: {
name: "专业版",
price: 29.9,
price3: 89.9,
},
comm: {
name: "商业版",
price: 399,
price3: 899,
},
},
}),
getters: {
getSysPublic(): SysPublicSetting {
@@ -227,6 +255,14 @@ export const useSettingStore = defineStore({
}
}
},
async loadProductInfo() {
try {
const productInfo = await basicApi.getProductInfo();
merge(this.productInfo, productInfo);
} catch (e) {
console.error(e);
}
},
async init() {
await this.loadSysSettings();
},
@@ -235,6 +271,7 @@ export const useSettingStore = defineStore({
return;
}
await this.init();
this.loadProductInfo();
this.inited = true;
},
},