|
@@ -94,8 +94,17 @@ class HomePageDisplayClass
|
|
|
}
|
|
}
|
|
|
$icon = $item['icon'] ?? '';
|
|
$icon = $item['icon'] ?? '';
|
|
|
$iconUrl = $icon;
|
|
$iconUrl = $icon;
|
|
|
- // 上传图标转完整 URL;预设图标前端用本地映射,原样返回
|
|
|
|
|
- if (intval($item['iconType'] ?? 1) === 2 && $icon !== '' && strpos($icon, 'http') !== 0) {
|
|
|
|
|
|
|
+ $iconType = intval($item['iconType'] ?? 1);
|
|
|
|
|
+ // 默认图标库 preset:N → OSS 静态图完整 URL(与前端默认图库一致)
|
|
|
|
|
+ if (preg_match('/^preset:(\d+)$/', $icon, $m)) {
|
|
|
|
|
+ $n = intval($m[1]);
|
|
|
|
|
+ if ($n >= 1 && $n <= 12) {
|
|
|
|
|
+ $path = 'hhb/images/navGrid-default/navGrid-default' . $n . '.png';
|
|
|
|
|
+ $formatted = business::formatUploadImg($path);
|
|
|
|
|
+ $iconUrl = $formatted['url'] ?? $path;
|
|
|
|
|
+ }
|
|
|
|
|
+ } elseif ($iconType === 2 && $icon !== '' && strpos($icon, 'http') !== 0) {
|
|
|
|
|
+ // 商家上传图标转完整 URL
|
|
|
$formatted = business::formatUploadImg($icon);
|
|
$formatted = business::formatUploadImg($icon);
|
|
|
$iconUrl = $formatted['url'] ?? $icon;
|
|
$iconUrl = $formatted['url'] ?? $icon;
|
|
|
}
|
|
}
|
|
@@ -104,7 +113,7 @@ class HomePageDisplayClass
|
|
|
'name' => $item['name'],
|
|
'name' => $item['name'],
|
|
|
'icon' => $icon,
|
|
'icon' => $icon,
|
|
|
'iconUrl' => $iconUrl,
|
|
'iconUrl' => $iconUrl,
|
|
|
- 'iconType' => intval($item['iconType'] ?? 1),
|
|
|
|
|
|
|
+ 'iconType' => $iconType,
|
|
|
'type' => intval($item['type'] ?? 3),
|
|
'type' => intval($item['type'] ?? 3),
|
|
|
'value' => strval($item['value'] ?? ''),
|
|
'value' => strval($item['value'] ?? ''),
|
|
|
];
|
|
];
|