feat(GlobalConfig): 添加抖音和美团平台的Logo图片资源在GlobalConfig类中新增了dyLogo和mtLogo两个Image类型的静态常量,用于存储抖音和美团平台的Logo图片资源,并在静态代码块中进行初始化。同时更新了PlatformSelectionView页面中的平台选项图片引用方式,

将原先使用的占位图URL替换为从GlobalConfig加载的实际Logo图片,并相应地修改了createPlatformMtOption与createPlatformDyOption方法签名,
使其接收Image对象而非字符串URL。
This commit is contained in:
wangchunxiang
2025-10-14 16:54:22 +08:00
parent bd45127a8c
commit 9d216cae05
4 changed files with 10 additions and 6 deletions

View File

@@ -57,11 +57,15 @@ public class GlobalConfig {
public static final Image icon16; public static final Image icon16;
public static final Image icon32; public static final Image icon32;
public static final Image dyLogo;
public static final Image mtLogo;
static { static {
try { try {
icon16 = new Image(new FileInputStream(ResourceUtils.getFile("classpath:icon16.png"))); icon16 = new Image(new FileInputStream(ResourceUtils.getFile("classpath:icon16.png")));
icon32 = new Image(new FileInputStream(ResourceUtils.getFile("classpath:icon32.png"))); icon32 = new Image(new FileInputStream(ResourceUtils.getFile("classpath:icon32.png")));
dyLogo = new Image(new FileInputStream(ResourceUtils.getFile("classpath:dylogo.png")));
mtLogo = new Image(new FileInputStream(ResourceUtils.getFile("classpath:mtlogo.png")));
} catch (FileNotFoundException e) { } catch (FileNotFoundException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }

View File

@@ -50,14 +50,14 @@ public class PlatformSelectionView {
// 美团开店宝选项 // 美团开店宝选项
VBox meituanOption = createPlatformMtOption( VBox meituanOption = createPlatformMtOption(
"美团开店宝", "美团开店宝",
"https://placehold.co/64x64?text=MT&bg=FFD700&fg=333", GlobalConfig.mtLogo,
"#FFD700" "#FFD700"
); );
// 抖音来客选项 // 抖音来客选项
VBox douyinOption = createPlatformDyOption( VBox douyinOption = createPlatformDyOption(
"抖音来客", "抖音来客",
"https://placehold.co/64x64?text=DY&bg=4A90E2&fg=FFF", GlobalConfig.dyLogo,
"#4A90E2" "#4A90E2"
); );
@@ -72,14 +72,14 @@ public class PlatformSelectionView {
primaryStage.show(); primaryStage.show();
} }
private VBox createPlatformMtOption(String title, String imageUrl, String buttonColor) { private VBox createPlatformMtOption(String title, Image imageUrl, String buttonColor) {
VBox option = new VBox(); VBox option = new VBox();
option.setAlignment(Pos.CENTER); option.setAlignment(Pos.CENTER);
option.setSpacing(10); option.setSpacing(10);
option.setPadding(new Insets(20)); option.setPadding(new Insets(20));
option.setStyle("-fx-background-color: white; -fx-border-radius: 8px; -fx-padding: 20px;"); option.setStyle("-fx-background-color: white; -fx-border-radius: 8px; -fx-padding: 20px;");
ImageView imageView = new ImageView(new Image(imageUrl)); ImageView imageView = new ImageView(imageUrl);
imageView.setFitWidth(64); imageView.setFitWidth(64);
imageView.setFitHeight(64); imageView.setFitHeight(64);
@@ -102,14 +102,14 @@ public class PlatformSelectionView {
return option; return option;
} }
private VBox createPlatformDyOption(String title, String imageUrl, String buttonColor) { private VBox createPlatformDyOption(String title, Image imageUrl, String buttonColor) {
VBox option = new VBox(); VBox option = new VBox();
option.setAlignment(Pos.CENTER); option.setAlignment(Pos.CENTER);
option.setSpacing(10); option.setSpacing(10);
option.setPadding(new Insets(20)); option.setPadding(new Insets(20));
option.setStyle("-fx-background-color: white; -fx-border-radius: 8px; -fx-padding: 20px;"); option.setStyle("-fx-background-color: white; -fx-border-radius: 8px; -fx-padding: 20px;");
ImageView imageView = new ImageView(new Image(imageUrl)); ImageView imageView = new ImageView(imageUrl);
imageView.setFitWidth(64); imageView.setFitWidth(64);
imageView.setFitHeight(64); imageView.setFitHeight(64);

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB