Commit 6a697550 by 王东红

Merge branch 'master' of http://47.99.244.21:9999/root/joshine

parents 292f02e7 252f1991
...@@ -155,7 +155,7 @@ ...@@ -155,7 +155,7 @@
.joshine-desction .desction-left{ .joshine-desction .desction-left{
width: 90%; width: 90%;
flot: left; flot: left;
font-weight: bolder; font-weight: inherit;
color: #000; color: #000;
} }
.joshine-desction .desction-right{ .joshine-desction .desction-right{
...@@ -170,7 +170,7 @@ ...@@ -170,7 +170,7 @@
font-size: small; font-size: small;
} }
.joshine-desction #description{ .joshine-desction #description{
max-height: 540px; max-height: 300px;
overflow: auto; overflow: auto;
} }
</style> </style>
...@@ -180,6 +180,11 @@ $short_description = $this->helper(Magento\Catalog\Helper\Output::class)->produc ...@@ -180,6 +180,11 @@ $short_description = $this->helper(Magento\Catalog\Helper\Output::class)->produc
$block->getProduct()->getShortDescription(), $block->getProduct()->getShortDescription(),
'short_description' 'short_description'
); );
$description = $this->helper(Magento\Catalog\Helper\Output::class)->productAttribute(
$block->getShortDescription(),
$block->getProduct()->getDescription(),
'description'
);
if ($short_description) : if ($short_description) :
?> ?>
<div class="joshine-desction"> <div class="joshine-desction">
...@@ -191,9 +196,9 @@ if ($short_description) : ...@@ -191,9 +196,9 @@ if ($short_description) :
"multipleCollapsible": true "multipleCollapsible": true
}}'> }}'>
<div data-role="collapsible"> <div data-role="collapsible">
<div data-role="trigger"> <div data-role="trigger" class="short_description-button">
<a class="desction-left info-desc" href="#">Description</a> <a class="desction-left short_description info-desc" href="#">short_description</a>
<a class="desction-right info-desc" href="#">+</a> <a class="desction-right short_description info-desc" href="#">+</a>
</div> </div>
</div> </div>
<div data-role="content" id="description"> <div data-role="content" id="description">
...@@ -203,17 +208,52 @@ if ($short_description) : ...@@ -203,17 +208,52 @@ if ($short_description) :
</div> </div>
</div> </div>
</div> </div>
<?php endif; ?> <?php endif;
if ($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" class="description-button">
<a class="desction-left description info-desc" href="#">description</a>
<a class="desction-right description info-desc" href="#">+</a>
</div>
</div>
<div data-role="content" id="description">
<div class="desction-info">
<?php echo $description;?>
</div>
</div>
</div>
</div>
<?php endif;
?>
<script> <script>
require([ require([
'jquery' 'jquery'
], function ($) { ], function ($) {
$(".info-desc").click(function () { $(".short_description-button > a").click(function () {
var number = $(".desction-right").html(); var number = $(".desction-right.short_description.info-desc").html();
if (number == "+"){
$(".desction-right.short_description.info-desc").html("-");
}else{
$(".desction-right.short_description.info-desc").html("+");
}
})
$(".description-button > a").click(function () {
var number = $(".desction-right.description.info-desc").html();
if (number == "+"){ if (number == "+"){
$(".desction-right").html("-"); $(".desction-right.description.info-desc").html("-");
}else{ }else{
$(".desction-right").html("+"); $(".desction-right.description.info-desc").html("+");
} }
}) })
setTimeout(function(){ setTimeout(function(){
......
...@@ -62,11 +62,11 @@ ...@@ -62,11 +62,11 @@
], function ($) { ], function ($) {
$("#wishlist").html($(".product-addto-links > div:first").html()); $("#wishlist").html($(".product-addto-links > div:first").html());
setTimeout(function(){ setTimeout(function(){
if ($("div").hasClass("swatch-attribute size")){ // if ($("div").hasClass("swatch-attribute size")){
var size = '<div id="product-intro__freeshipping-more-3" data-trigger="trigger">\n' + // var size = '<div id="product-intro__freeshipping-more-3" data-trigger="trigger">\n' +
' <a href="javascript:void(0);">Size Guide</a></span></div>'; // ' <a href="javascript:void(0);">Size Guide</a></span></div>';
$(".swatch-attribute.size > span:last").after(size); // $(".swatch-attribute.size > span:last").after(size);
} // }
},3000); },3000);
}); });
</script> </script>
...@@ -79,17 +79,18 @@ ...@@ -79,17 +79,18 @@
'responsive': true, 'responsive': true,
'buttons' : [] 'buttons' : []
}}"> }}">
<div class="content" id="product-intro-size-chart"><?php echo $block->getLayout()->createBlock('Magento\Cms\Block\Block')->setBlockId('product-intro-size-chart')->toHtml();?></div> <div class="content" id="product-intro-size-chart" style="display:none;">
<?php echo $block->getLayout()->createBlock('Magento\Cms\Block\Block')->setBlockId('product-intro-size-chart')->toHtml();?>
</div>
</div> </div>
<style> <style>
#product-intro__freeshipping-more-3{ #product-intro__freeshipping-more-3{
display: inline-block; display: inline-block;
color: #000; color: #2d68a;
font-size: 12px; font-size: 12px;
line-height: 1; line-height: 1;
margin-top: -10px; margin-top: -15px;
font-weight: 700;
margin-left: 60%; margin-left: 60%;
width: 50%; width: 50%;
float: right; float: right;
...@@ -136,5 +137,8 @@ ...@@ -136,5 +137,8 @@
}, 10000); }, 10000);
event.stopPropagation(); event.stopPropagation();
}); });
setTimeout(function() {
$("#product-intro-size-chart").show();
}, 3000);
}); });
</script> </script>
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