Commit 93876689 by lmf

优化详情页描述位置

parent d7c5bd08
var config = { var config = {
map: { paths : {
'*': { 'smartphoto': 'Magento_Catalog/js/smartphoto.min'
smartphoto: 'Magento_Catalog/js/smartphoto.min' },
shim : {
'smartphoto' : {
deps: ['jquery']
}
} }
}
}; };
...@@ -173,3 +173,72 @@ ...@@ -173,3 +173,72 @@
} }
</style> </style>
</div> </div>
<style>
.joshine-desction{
width:100%;
}
.joshine-desction .desction-left{
width: 90%;
flot: left;
font-size: small;
font-weight: bolder;
color: #000;
}
.joshine-desction .desction-right{
width: 10%;
float: right;
text-align: end;
font-size: larger;
color: #000;
font-weight: 600;
}
.joshine-desction .desction-info{
padding: 10px;
margin: 10px;
font-size: small;
}
</style>
<?php
$short_description = $this->helper(Magento\Catalog\Helper\Output::class)->productAttribute(
$block->getShortDescription(),
$block->getProduct()->getShortDescription(),
'short_description'
);
$description = $this->helper(Magento\Catalog\Helper\Output::class)->productAttribute(
$block->getProduct(),
$block->getProduct()->getDescription(),
'description'
);
?>
<div class="joshine-desction">
<div id="accordion" data-mage-init='{
"accordion":{
"active": [1, 2],
"collapsible": true,
"openedState": "active",
"multipleCollapsible": true
}}'>
<div data-role="collapsible">
<div data-role="trigger">
<a class="desction-left info-desc" href="#">Description</a>
<a class="desction-right info-desc" href="#">+</a>
</div>
</div>
<div data-role="content">
<div class="desction-info">
<?php echo $short_description."<br />".$description;?>
</div>
</div>
</div>
</div>
<script>
require([
'jquery'
], function ($) {
$(".info-desc").click(function () {
$(".desction-right").html("-");
})
});
</script>
...@@ -45,84 +45,21 @@ if ($_attributeType && $_attributeType == 'text') { ...@@ -45,84 +45,21 @@ if ($_attributeType && $_attributeType == 'text') {
} }
?> ?>
<style>
.joshine-desction{
width:100%;
}
.joshine-desction .desction-left{
width: 90%;
flot: left;
font-size: small;
font-weight: bolder;
color: #000;
}
.joshine-desction .desction-right{
width: 10%;
float: right;
text-align: end;
font-size: larger;
color: #000;
font-weight: 600;
}
.joshine-desction .desction-info{
padding: 10px;
margin: 10px;
font-size: small;
}
</style>
<?php if ($_attributeValue) :?> <?php if ($_attributeValue) :?>
<?php
//print_r($_attributeAddAttribute);
?>
<div class="product attribute <?= $block->escapeHtmlAttr($_className) ?>"> <div class="product attribute <?= $block->escapeHtmlAttr($_className) ?>">
<?php if ($renderLabel) :?> <?php if ($renderLabel) :?>
<strong class="type"><?= $block->escapeHtml($_attributeLabel) ?></strong> <strong class="type"><?= $block->escapeHtml($_attributeLabel) ?></strong>
<?php endif; ?> <?php endif; ?>
<div class="value" <?= /* @noEscape */ $_attributeAddAttribute ?>> <div class="value" <?= /* @noEscape */ $_attributeAddAttribute ?>>
<!--商品描述部分--> <?php if($_attributeAddAttribute != 'itemprop="description"'): ?>
<?php if($_attributeAddAttribute == 'itemprop="description"'): ?>
<div class="joshine-desction">
<div id="accordion" data-mage-init='{
"accordion":{
"active": [1, 2],
"collapsible": true,
"openedState": "active",
"multipleCollapsible": true
}}'>
<div data-role="collapsible">
<div data-role="trigger">
<a class="desction-left info-desc" href="#">Description</a>
<a class="desction-right info-desc" href="#">+</a>
</div>
</div>
<div data-role="content">
<div class="desction-info">
<?= /* @noEscape */ $_attributeValue ?>
<?= /* @noEscape */ $this->helper(Magento\Catalog\Helper\Output::class)->productAttribute(
$block->getProduct(),
$block->getProduct()->getDescription(),
'description'
) ?>
</div>
</div>
</div>
</div>
<?php else:?>
<?= /* @noEscape */ $_attributeValue ?> <?= /* @noEscape */ $_attributeValue ?>
<?php endif; ?> <?php endif; ?>
</div> </div>
</div> </div>
<?php endif; ?> <?php endif; ?>
<script>
require([
'jquery'
], function ($) {
$(".info-desc").click(function () {
$(".desction-right").html("-");
})
});
</script>
......
...@@ -34,9 +34,6 @@ $thumbSizes = $responsiveImageHelper->getSizes('product_page_image_small'); ...@@ -34,9 +34,6 @@ $thumbSizes = $responsiveImageHelper->getSizes('product_page_image_small');
} }
} }
@media (max-width: 768px){ @media (max-width: 768px){
.breeze-gallery .thumbnails,.breeze-gallery .prev, .breeze-gallery .next {
display:none;
}
.main-image-wrapper > img{ .main-image-wrapper > img{
display:none; display:none;
} }
...@@ -52,6 +49,12 @@ $thumbSizes = $responsiveImageHelper->getSizes('product_page_image_small'); ...@@ -52,6 +49,12 @@ $thumbSizes = $responsiveImageHelper->getSizes('product_page_image_small');
margin-left:2px; margin-left:2px;
height: auto; height: auto;
} }
.main-image-wrapper .mobile-pic > a > img{
max-width: 80%;
}
.breeze-gallery .thumbnails,.breeze-gallery .prev, .breeze-gallery .next{
display:none;
}
} }
</style> </style>
...@@ -190,7 +193,7 @@ $thumbSizes = $responsiveImageHelper->getSizes('product_page_image_small'); ...@@ -190,7 +193,7 @@ $thumbSizes = $responsiveImageHelper->getSizes('product_page_image_small');
</style> </style>
<script> <script>
require([ require([
'jquery','smartphoto' 'jquery','Magento_Catalog/js/smartphoto.min'
], function ($) { ], function ($) {
$(".thumbnails > a").mouseover(function (s) { $(".thumbnails > a").mouseover(function (s) {
var main_img = $(this).attr("name"); var main_img = $(this).attr("name");
...@@ -226,7 +229,8 @@ $thumbSizes = $responsiveImageHelper->getSizes('product_page_image_small'); ...@@ -226,7 +229,8 @@ $thumbSizes = $responsiveImageHelper->getSizes('product_page_image_small');
} }
$(".main-image").attr("src",sd); $(".main-image").attr("src",sd);
}); });
$(".js-smartPhoto").SmartPhoto();
}); });
</script> </script>
...@@ -70,8 +70,8 @@ $image = 'new_products_content_widget_grid'; ...@@ -70,8 +70,8 @@ $image = 'new_products_content_widget_grid';
<ol class="product-items <?= /* @noEscape */ $type ?>"> <ol class="product-items <?= /* @noEscape */ $type ?>">
<?php <?php
$templateType = \Magento\Catalog\Block\Product\ReviewRendererInterface::SHORT_VIEW; $templateType = \Magento\Catalog\Block\Product\ReviewRendererInterface::SHORT_VIEW;
$news_ids = explode(',',"1315,1178,1125,1002"); //$news_ids = explode(',',"1315,1178,1125,1002");
//$news_ids = explode(',',"1,2"); $news_ids = explode(',',"1,2");
$objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$pr = $objectManager->create('Magento\Catalog\Model\ProductRepository'); $pr = $objectManager->create('Magento\Catalog\Model\ProductRepository');
...@@ -213,8 +213,8 @@ $image = 'new_products_content_widget_grid'; ...@@ -213,8 +213,8 @@ $image = 'new_products_content_widget_grid';
<div class="flash-sale-inner"> <div class="flash-sale-inner">
<?php <?php
$templateType = \Magento\Catalog\Block\Product\ReviewRendererInterface::SHORT_VIEW; $templateType = \Magento\Catalog\Block\Product\ReviewRendererInterface::SHORT_VIEW;
$ids = explode(',',"896,726,611,507,167,172"); //$ids = explode(',',"896,726,611,507,167,172");
//$ids = explode(',',"1,2"); $ids = explode(',',"1,2");
$objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$pr = $objectManager->create('Magento\Catalog\Model\ProductRepository'); $pr = $objectManager->create('Magento\Catalog\Model\ProductRepository');
......
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