update
This commit is contained in:
40
0000_gb_points_temp/src/config/themeRegistry.ts
Normal file
40
0000_gb_points_temp/src/config/themeRegistry.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
import type { Component } from "vue";
|
||||
import Theme1 from "@/components/theme/Theme1.vue";
|
||||
import Theme2 from "@/components/theme/Theme2.vue";
|
||||
import Theme3 from "@/components/theme/Theme3.vue";
|
||||
import Theme4 from "@/components/theme/Theme4.vue";
|
||||
import Theme5 from "@/components/theme/Theme5.vue";
|
||||
import Theme6 from "@/components/theme/Theme6.vue";
|
||||
import PayTheme1 from "@/components/pay/PayTheme1.vue";
|
||||
import PayTheme2 from "@/components/pay/PayTheme2.vue";
|
||||
import PayTheme3 from "@/components/pay/PayTheme3.vue";
|
||||
import PayTheme4 from "@/components/pay/PayTheme4.vue";
|
||||
import PayTheme5 from "@/components/pay/PayTheme5.vue";
|
||||
import PayTheme6 from "@/components/pay/PayTheme6.vue";
|
||||
|
||||
export type ThemeScene = "home" | "pay";
|
||||
|
||||
const homeThemeMap: Record<number, Component> = {
|
||||
1: Theme1,
|
||||
2: Theme2,
|
||||
3: Theme3,
|
||||
4: Theme4,
|
||||
5: Theme5,
|
||||
6: Theme6,
|
||||
};
|
||||
|
||||
const payThemeMap: Record<number, Component> = {
|
||||
1: PayTheme1,
|
||||
2: PayTheme2,
|
||||
3: PayTheme3,
|
||||
4: PayTheme4,
|
||||
5: PayTheme5,
|
||||
6: PayTheme6,
|
||||
};
|
||||
|
||||
export function resolveThemeComponent(scene: ThemeScene, themeId: number): Component {
|
||||
const normalizedThemeId = Number(themeId) || 1;
|
||||
const themeMap = scene === "home" ? homeThemeMap : payThemeMap;
|
||||
|
||||
return themeMap[normalizedThemeId] || themeMap[1];
|
||||
}
|
||||
46
0000_gb_points_temp/src/config/themes.ts
Normal file
46
0000_gb_points_temp/src/config/themes.ts
Normal file
@@ -0,0 +1,46 @@
|
||||
import { globalConfig } from "@/config";
|
||||
|
||||
// 主题颜色配置
|
||||
export interface ThemeColors {
|
||||
primary: string;
|
||||
primaryLight: string;
|
||||
primaryDark: string;
|
||||
gradient: string;
|
||||
shadow: string;
|
||||
}
|
||||
|
||||
export const themeColors: Record<number, ThemeColors> = {
|
||||
1: {
|
||||
primary: globalConfig.primary_color,
|
||||
primaryLight: globalConfig.primary_color,
|
||||
primaryDark: globalConfig.primary_color,
|
||||
gradient: `linear-gradient(135deg, ${globalConfig.primary_color} 0%, ${globalConfig.primary_color} 100%)`,
|
||||
shadow: 'rgba(0, 65, 142, 0.35)',
|
||||
},
|
||||
6: {
|
||||
primary: globalConfig.primary_color,
|
||||
primaryLight: globalConfig.primary_color,
|
||||
primaryDark: globalConfig.primary_color,
|
||||
gradient: `linear-gradient(135deg, ${globalConfig.primary_color} 0%, ${globalConfig.primary_color} 100%)`,
|
||||
shadow: 'rgba(0, 65, 142, 0.35)',
|
||||
},
|
||||
7: {
|
||||
primary: globalConfig.primary_color,
|
||||
primaryLight: globalConfig.primary_color,
|
||||
primaryDark: globalConfig.primary_color,
|
||||
gradient: `linear-gradient(135deg, ${globalConfig.primary_color} 0%, ${globalConfig.primary_color} 100%)`,
|
||||
shadow: 'rgba(0, 65, 142, 0.35)',
|
||||
},
|
||||
8: {
|
||||
primary: globalConfig.primary_color,
|
||||
primaryLight: globalConfig.primary_color,
|
||||
primaryDark: globalConfig.primary_color,
|
||||
gradient: `linear-gradient(135deg, ${globalConfig.primary_color} 0%, #0073e6 100%)`,
|
||||
shadow: 'rgba(0, 65, 142, 0.35)',
|
||||
},
|
||||
};
|
||||
|
||||
// 获取主题颜色
|
||||
export function getThemeColors(themeId: number): ThemeColors {
|
||||
return themeColors[themeId] || themeColors[1];
|
||||
}
|
||||
Reference in New Issue
Block a user