Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
joshine
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
joshine
Commits
93876689
Commit
93876689
authored
Sep 28, 2022
by
lmf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化详情页描述位置
parent
d7c5bd08
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
92 additions
and
79 deletions
+92
-79
app/design/frontend/Joshine/breeze/Magento_Catalog/requirejs-config.js
+7
-4
app/design/frontend/Joshine/breeze/Magento_Catalog/templates/product/view/addto.phtml
+69
-0
app/design/frontend/Joshine/breeze/Magento_Catalog/templates/product/view/attribute.phtml
+3
-66
app/design/frontend/Joshine/breeze/Magento_Catalog/templates/product/view/gallery.phtml
+9
-5
app/design/frontend/Joshine/breeze/Magento_Catalog/web/js/smartphoto.js
+0
-0
app/design/frontend/Joshine/breeze/Magento_Cms/templates/default/home.phtml
+4
-4
No files found.
app/design/frontend/Joshine/breeze/Magento_Catalog/requirejs-config.js
View file @
93876689
var
config
=
{
map
:
{
'*'
:
{
smartphoto
:
'Magento_Catalog/js/smartphoto.min'
paths
:
{
'smartphoto'
:
'Magento_Catalog/js/smartphoto.min'
},
shim
:
{
'smartphoto'
:
{
deps
:
[
'jquery'
]
}
}
}
};
app/design/frontend/Joshine/breeze/Magento_Catalog/templates/product/view/addto.phtml
View file @
93876689
...
...
@@ -173,3 +173,72 @@
}
</style>
</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>
app/design/frontend/Joshine/breeze/Magento_Catalog/templates/product/view/attribute.phtml
View file @
93876689
...
...
@@ -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
//print_r($_attributeAddAttribute);
?>
<
div
class
="
product
attribute
<?=
$block
->
escapeHtmlAttr
(
$_className
)
?>
">
<?php
if
(
$renderLabel
)
:?>
<
strong
class
="
type
"><?=
$block->escapeHtml
(
$_attributeLabel
) ?></strong>
<?php endif; ?>
<div class="
value
" <?= /* @noEscape */
$_attributeAddAttribute
?>>
<!--商品描述部分-->
<?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:?>
<?php if(
$_attributeAddAttribute
!= 'itemprop="
description
"'): ?>
<?= /* @noEscape */
$_attributeValue
?>
<?php endif; ?>
</div>
</div>
<?php endif; ?>
<script>
require([
'jquery'
], function ($) {
$("
.
info
-
desc
").click(function () {
$("
.
desction
-
right
").html("
-
");
})
});
</script>
...
...
app/design/frontend/Joshine/breeze/Magento_Catalog/templates/product/view/gallery.phtml
View file @
93876689
...
...
@@ -34,9 +34,6 @@ $thumbSizes = $responsiveImageHelper->getSizes('product_page_image_small');
}
}
@media
(
max-width
:
768px
){
.breeze-gallery
.thumbnails
,
.breeze-gallery
.prev
,
.breeze-gallery
.next
{
display
:
none
;
}
.main-image-wrapper
>
img
{
display
:
none
;
}
...
...
@@ -52,6 +49,12 @@ $thumbSizes = $responsiveImageHelper->getSizes('product_page_image_small');
margin-left
:
2px
;
height
:
auto
;
}
.main-image-wrapper
.mobile-pic
>
a
>
img
{
max-width
:
80%
;
}
.breeze-gallery
.thumbnails
,
.breeze-gallery
.prev
,
.breeze-gallery
.next
{
display
:
none
;
}
}
</style>
...
...
@@ -190,7 +193,7 @@ $thumbSizes = $responsiveImageHelper->getSizes('product_page_image_small');
</style>
<script>
require
([
'jquery'
,
'
smartphoto
'
'jquery'
,
'
Magento_Catalog/js/smartphoto.min
'
],
function
(
$
)
{
$
(
".thumbnails > a"
).
mouseover
(
function
(
s
)
{
var
main_img
=
$
(
this
).
attr
(
"name"
);
...
...
@@ -226,7 +229,8 @@ $thumbSizes = $responsiveImageHelper->getSizes('product_page_image_small');
}
$
(
".main-image"
).
attr
(
"src"
,
sd
);
});
$
(
".js-smartPhoto"
).
SmartPhoto
();
});
</script>
app/design/frontend/Joshine/breeze/Magento_Catalog/web/js/smartphoto.
min.
js
→
app/design/frontend/Joshine/breeze/Magento_Catalog/web/js/smartphoto.js
View file @
93876689
File moved
app/design/frontend/Joshine/breeze/Magento_Cms/templates/default/home.phtml
View file @
93876689
...
...
@@ -70,8 +70,8 @@ $image = 'new_products_content_widget_grid';
<ol
class=
"product-items
<?=
/* @noEscape */
$type
?>
"
>
<?php
$templateType
=
\Magento\Catalog\Block\Product\ReviewRendererInterface
::
SHORT_VIEW
;
$news_ids
=
explode
(
','
,
"1315,1178,1125,1002"
);
//
$news_ids = explode(',',"1,2");
//
$news_ids = explode(',',"1315,1178,1125,1002");
$news_ids
=
explode
(
','
,
"1,2"
);
$objectManager
=
\Magento\Framework\App\ObjectManager
::
getInstance
();
$pr
=
$objectManager
->
create
(
'Magento\Catalog\Model\ProductRepository'
);
...
...
@@ -213,8 +213,8 @@ $image = 'new_products_content_widget_grid';
<div
class=
"flash-sale-inner"
>
<?php
$templateType
=
\Magento\Catalog\Block\Product\ReviewRendererInterface
::
SHORT_VIEW
;
$ids
=
explode
(
','
,
"896,726,611,507,167,172"
);
//
$ids = explode(',',"1,2");
//
$ids = explode(',',"896,726,611,507,167,172");
$ids
=
explode
(
','
,
"1,2"
);
$objectManager
=
\Magento\Framework\App\ObjectManager
::
getInstance
();
$pr
=
$objectManager
->
create
(
'Magento\Catalog\Model\ProductRepository'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment