修复首页模块图片
This commit is contained in:
parent
0a3f26c7c7
commit
960ec9de66
|
|
@ -225,7 +225,7 @@ function current_language_id(): int
|
|||
/**
|
||||
* 当前语言code
|
||||
*
|
||||
* @return int
|
||||
* @return string
|
||||
*/
|
||||
function current_language_code(): string
|
||||
{
|
||||
|
|
|
|||
|
|
@ -35,6 +35,9 @@ class DesignService
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function handleModuleContent($moduleCode, $content)
|
||||
{
|
||||
if ($moduleCode == 'slideshow') {
|
||||
|
|
@ -54,7 +57,8 @@ class DesignService
|
|||
private static function handleSlideShow($content): array
|
||||
{
|
||||
foreach ($content['images'] as $index => $image) {
|
||||
$content['images'][$index]['image'] = image_resize($image[current_language_code()] ?? '');
|
||||
$imagePath = 'catalog' . ($image['image'][current_language_code()] ?? '');
|
||||
$content['images'][$index]['image'] = image_origin($imagePath);
|
||||
|
||||
$link = $image['link'];
|
||||
if (empty($link)) {
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ class HomeController extends Controller
|
|||
* 通过page builder 显示首页
|
||||
*
|
||||
* @return View
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function index(): View
|
||||
{
|
||||
|
|
|
|||
|
|
@ -17,12 +17,11 @@
|
|||
<div class="module-info">
|
||||
<div class="swiper module-swiper-{{ $module_id }} module-slideshow">
|
||||
<div class="swiper-wrapper">
|
||||
<div class="swiper-slide">
|
||||
<a href=""><img src="{{ asset('image/default/banner.png') }}" class="img-fluid"></a>
|
||||
</div>
|
||||
<div class="swiper-slide">
|
||||
<a href=""><img src="{{ asset('image/default/banner.png') }}" class="img-fluid"></a>
|
||||
</div>
|
||||
@foreach($content['images'] as $image)
|
||||
<div class="swiper-slide">
|
||||
<a href="{{ $image['link']['link'] }}"><img src="{{ $image['image'] }}" class="img-fluid"></a>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
<div class="swiper-pagination"></div>
|
||||
<div class="swiper-button-prev"></div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue