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