Commit 99a3b291 by wd

顶部free shipping bar 保存错误修复,字体单位更改,以及不存在时样式的修改

parent 9fc60a99
...@@ -88,24 +88,24 @@ class Save extends \Sparsh\FreeShippingBar\Controller\Adminhtml\Entity implement ...@@ -88,24 +88,24 @@ class Save extends \Sparsh\FreeShippingBar\Controller\Adminhtml\Entity implement
} }
//pc img upload //pc img upload
if ($_FILES['background_img']['name']){ if (isset($_FILES['background_img']['name']) && $_FILES['background_img']['name']){
$this->saveImg('background_img'); $this->saveImg('background_img');
$data['background_img'] = '/'.self::FILE_DIR.'/'.$_FILES['background_img']['name']; $data['background_img'] = '/'.self::FILE_DIR.'/'.$_FILES['background_img']['name'];
} }
//phone img upload //phone img upload
if ($_FILES['background_img_phone']['name']){ if (isset($_FILES['background_img_phone']['name']) && $_FILES['background_img_phone']['name']){
$this->saveImg('background_img_phone'); $this->saveImg('background_img_phone');
$data['background_img_phone'] = '/'.self::FILE_DIR.'/'.$_FILES['background_img_phone']['name']; $data['background_img_phone'] = '/'.self::FILE_DIR.'/'.$_FILES['background_img_phone']['name'];
} }
//not request img info //not request img info
if (is_array($data['background_img'])){ if (isset($data['background_img']) && is_array($data['background_img'])){
//no delete and no upload new img //no delete and no upload new img
unset($data['background_img']); unset($data['background_img']);
} }
if (is_array($data['background_img_phone'])){ if (isset($data['background_img_phone']) && is_array($data['background_img_phone'])){
//no delete and no upload new img //no delete and no upload new img
unset($data['background_img_phone']); unset($data['background_img_phone']);
} }
......
...@@ -78,8 +78,8 @@ class FreeShippingBarActions extends Column ...@@ -78,8 +78,8 @@ class FreeShippingBarActions extends Column
), ),
'label' => __('Delete'), 'label' => __('Delete'),
'confirm' => [ 'confirm' => [
'title' => __('Delete ${ $.$data.name }'), 'title' => __('Delete Free Shipping Bar'),
'message' => __('Are you sure you want to delete a ${ $.$data.name } record?') 'message' => __('Are you sure you want to delete a Free Shipping Bar record?')
] ]
]; ];
} }
......
...@@ -41,7 +41,7 @@ endif; ...@@ -41,7 +41,7 @@ endif;
} }
</style> </style>
<div class="sparsh-free-shipping-bar-goal-message" <div class="sparsh-free-shipping-bar-goal-message"
style=" background-size: 100%; line-height: initial; text-align: center; background-color: <?= /* @noEscape */ $barData['bar_background_color']?>; font-size: <?= /* @noEscape */ $barData['bar_font_size'].'px'?>"> style=" background-size: 100%; line-height: initial; text-align: center; background-color: <?= /* @noEscape */ $barData['bar_background_color']?>; font-size: <?= /* @noEscape */ $barData['bar_font_size'].'em'?>">
<a <?= /* @noEscape */ $barData['is_clickable'] ? 'href='.$barData['bar_link_url'] : null ?> <a <?= /* @noEscape */ $barData['is_clickable'] ? 'href='.$barData['bar_link_url'] : null ?>
<?= /* @noEscape */ $barData['is_clickable'] ? ($barData['is_link_open_in_new_page'] ? 'target=_blank' : 'target=_self') : null ?> <?= /* @noEscape */ $barData['is_clickable'] ? ($barData['is_link_open_in_new_page'] ? 'target=_blank' : 'target=_self') : null ?>
style="color: <?= /* @noEscape */ $barData['bar_text_color']?>"> style="color: <?= /* @noEscape */ $barData['bar_text_color']?>">
......
...@@ -37,7 +37,13 @@ $logoHeight = $logoSizeResolver !== null && $logoSizeResolver->getHeight() ...@@ -37,7 +37,13 @@ $logoHeight = $logoSizeResolver !== null && $logoSizeResolver->getHeight()
if (userAgentInfo.indexOf(Agents[v]) > 0) { flag = false; break; } if (userAgentInfo.indexOf(Agents[v]) > 0) { flag = false; break; }
} }
require(['jquery'],function ($){ require(['jquery'],function ($){
//free shipping bar not existent
if(!flag && !$('.sparsh-free-shipping-bar-goal-message').length){
$('.page-header').css('margin-top','0');
}
//auto logo height
if (flag){ if (flag){
var imgH = $('.logo').height(); var imgH = $('.logo').height();
imgH= Math.ceil(imgH/3); imgH= Math.ceil(imgH/3);
...@@ -47,7 +53,12 @@ $logoHeight = $logoSizeResolver !== null && $logoSizeResolver->getHeight() ...@@ -47,7 +53,12 @@ $logoHeight = $logoSizeResolver !== null && $logoSizeResolver->getHeight()
console.log(headerH); console.log(headerH);
$('.columns').css('margin-top',headerH); $('.columns').css('margin-top',headerH);
} }
}); });
</script> </script>
<span data-action="toggle-nav" class="action nav-toggle"><span><?= $block->escapeHtml(__('Toggle Nav')) ?></span></span> <span data-action="toggle-nav" class="action nav-toggle"><span><?= $block->escapeHtml(__('Toggle Nav')) ?></span></span>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment