Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenDocCN
yii2_fecshop
提交
3e821ca4
Y
yii2_fecshop
项目概览
OpenDocCN
/
yii2_fecshop
通知
18
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Y
yii2_fecshop
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
3e821ca4
编写于
10月 24, 2016
作者:
R
root
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
product descrition,reviews,questions tab scroll
上级
cb209b2f
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
165 addition
and
4 deletion
+165
-4
app/appfront/modules/Catalog/block/product/Index.php
app/appfront/modules/Catalog/block/product/Index.php
+2
-0
app/appfront/theme/base/front/assets/css/style.css
app/appfront/theme/base/front/assets/css/style.css
+49
-0
app/appfront/theme/base/front/assets/js/js.js
app/appfront/theme/base/front/assets/js/js.js
+10
-0
app/appfront/theme/base/front/catalog/product/index.php
app/appfront/theme/base/front/catalog/product/index.php
+103
-3
app/appfront/theme/base/front/widgets/scroll.php
app/appfront/theme/base/front/widgets/scroll.php
+1
-1
未找到文件。
app/appfront/modules/Catalog/block/product/Index.php
浏览文件 @
3e821ca4
...
...
@@ -41,6 +41,8 @@ class Index {
'productImgMagnifier'
=>
$productImgMagnifier
,
'options'
=>
$this
->
getSameSpuInfo
(),
'custom_option'
=>
$this
->
_product
[
'custom_option'
],
'description'
=>
Yii
::
$service
->
store
->
getStoreAttrVal
(
$this
->
_product
[
'description'
],
'description'
),
];
}
...
...
app/appfront/theme/base/front/assets/css/style.css
浏览文件 @
3e821ca4
...
...
@@ -1977,6 +1977,55 @@ a.next_images {
.product_info
{
list-style
:
none
;
margin
:
0
;
padding
:
0
;
text-decoration
:
none
;
font-family
:
'Microsoft YaHei'
;
}
.product_info
li
{
border-right
:
2px
solid
#eee
;
cursor
:
pointer
;
float
:
left
;
font-size
:
13px
;
height
:
50px
;
line-height
:
50px
;
padding
:
0
15px
;
text-align
:
center
;
width
:
auto
;
}
.product_info
ul
{
width
:
1200px
;
margin
:
0
auto
;
}
.product_info
.nav
{
height
:
52px
;
width
:
100%
;
background
:
#f5f5f5
;
}
.product_info
.nav
.cur
{
background
:
#fff
;
border-top
:
2px
solid
#1a92cf
;
color
:
#1a92cf
;
}
.product_info
.fixed
{
position
:
fixed
;
top
:
0
;
left
:
0
;
}
.product_info
a
{
color
:
#505050
;
}
...
...
app/appfront/theme/base/front/assets/js/js.js
浏览文件 @
3e821ca4
...
...
@@ -45,5 +45,15 @@ $(document).ready(function(){
error
:
function
(
XMLHttpRequest
,
textStatus
,
errorThrown
){}
});
$
(
"
#goTop
"
).
click
(
function
(){
$
(
"
html,body
"
).
animate
({
scrollTop
:
0
},
"
slow
"
);
});
$
(
"
#goBottom
"
).
click
(
function
(){
var
screenb
=
$
(
document
).
height
();
$
(
"
html,body
"
).
animate
({
scrollTop
:
screenb
},
"
slow
"
);
});
});
app/appfront/theme/base/front/catalog/product/index.php
浏览文件 @
3e821ca4
...
...
@@ -104,19 +104,119 @@
</div>
<div
class=
"clear"
></div>
</div>
<div
class=
"product_info"
>
<div
class=
"nav"
id=
"nav-container"
>
<ul
id=
"nav-box"
>
<li
class=
"nav_tab cur"
rel=
"description"
>
DESCRIPTION
</li>
<li
class=
"nav_tab"
rel=
"reviews"
>
REVIEWS
</li>
<li
class=
"nav_tab"
rel=
"questions"
>
QUESTIONS
</li>
<li
class=
"nav_tab"
rel=
"wholesale"
>
WHOLESALE
</li>
</ul>
</div>
<div
id=
"text"
>
<div
class=
"text-description"
style=
"width:100%;height:500px;background:green;text-align:center;"
>
text1
</div>
<div
class=
"text-reviews"
style=
"width:100%;height:500px;background:yellow;text-align:center;"
>
text2
</div>
<div
class=
"text-questions"
style=
"width:100%;height:500px;background:blue;text-align:center;"
>
text3
</div>
<div
class=
"text-wholesale"
style=
"width:100%;height:500px;background:yellow;text-align:center;"
>
text2
</div>
</div>
</div>
<div
class=
"proList"
>
</div>
</div>
</div>
<script>
<?php
$this
->
beginBlock
(
'add_to_cart'
)
?>
<?php
$this
->
beginBlock
(
'add_to_cart'
)
?>
// add to cart js
$
(
document
).
ready
(
function
(){
$
(
"
#js_registBtn
"
).
click
(
function
(){
$
(
this
).
addClass
(
"
dataUp
"
);
});
});
<?php
$this
->
endBlock
();
?>
<?php
$this
->
registerJs
(
$this
->
blocks
[
'add_to_cart'
],
\
yii\web\View
::
POS_END
);
//将编写的js代码注册到页面底部 ?>
<?
php
$this
->
beginBlock
(
'product_info_tab'
)
?>
//tab 切换js
var
navContainer
=
document
.
getElementById
(
"
nav-container
"
);
var
navBox
=
document
.
getElementById
(
"
nav-box
"
);
var
text
=
document
.
getElementById
(
"
text
"
);
var
navBoxChild
=
navBox
.
children
;
var
textChild
=
text
.
children
;
var
num
=
navContainer
.
offsetTop
;
var
a
=
navContainer
.
offsetHeight
;
window
.
onscroll
=
function
(){
var
scrollTop
=
document
.
documentElement
.
scrollTop
||
window
.
pageYOffset
||
document
.
body
.
scrollTop
;
if
(
scrollTop
>=
num
){
navContainer
.
className
=
"
nav fixed
"
;
text
.
style
.
paddingTop
=
a
+
"
px
"
;
}
else
{
navContainer
.
className
=
"
nav
"
;
text
.
style
.
paddingTop
=
""
;
}
//当导航与相应文档接触的时候自动切换
//method1
for
(
var
i
=
0
;
i
<
navBoxChild
.
length
;
i
++
){
if
(
scrollTop
+
a
>=
textChild
[
i
].
offsetTop
){
for
(
var
j
=
0
;
j
<
navBoxChild
.
length
;
j
++
){
navBoxChild
[
j
].
className
=
""
;
}
navBoxChild
[
i
].
className
=
"
cur
"
;
}
}
};
for
(
var
i
=
0
;
i
<
navBoxChild
.
length
;
i
++
){
var
interval
;
navBoxChild
[
i
].
index
=
i
;
navBoxChild
[
i
].
onclick
=
function
(){
var
self
=
this
;
clearInterval
(
interval
);
if
(
document
.
body
.
scrollTop
){
scroll
=
document
.
body
;
}
else
if
(
document
.
documentElement
.
scrollTop
){
scroll
=
document
.
documentElement
;
}
interval
=
setInterval
(
function
(){
if
(
scroll
.
scrollTop
+
a
<=
textChild
[
self
.
index
].
offsetTop
){
scroll
.
scrollTop
+=
40
;
if
(
scroll
.
scrollTop
+
a
>=
textChild
[
self
.
index
].
offsetTop
){
scroll
.
scrollTop
=
textChild
[
self
.
index
].
offsetTop
-
a
;
clearInterval
(
interval
);
}
}
else
{
scroll
.
scrollTop
/=
1.1
;
if
(
scroll
.
scrollTop
+
a
<=
textChild
[
self
.
index
].
offsetTop
){
scroll
.
scrollTop
=
textChild
[
self
.
index
].
offsetTop
-
a
;
clearInterval
(
interval
);
}
}
},
40
);
};
}
<?php
$this
->
endBlock
();
?>
</script>
<?php
$this
->
registerJs
(
$this
->
blocks
[
'add_to_cart'
],
\
yii\web\View
::
POS_END
);
//将编写的js代码注册到页面底部 ?>
<?php
$this
->
registerJs
(
$this
->
blocks
[
'product_info_tab'
],
\
yii\web\View
::
POS_END
);
//将编写的js代码注册到页面底部 ?>
</
script
>
\ No newline at end of file
app/appfront/theme/base/front/widgets/scroll.php
浏览文件 @
3e821ca4
...
...
@@ -10,5 +10,5 @@
<div
class=
"footer_fixed"
>
<a
id=
"goTop"
class=
"go_top"
href=
"#gotop"
style=
"display: block;"
>
go to top
</a>
<a
class=
"cus_survey"
href=
"http://www.intosmile.com/contacts"
title=
"customer survey"
target=
"_blank"
>
customer survey
</a>
<div
class=
"ph"
><a
id=
"goBottom"
class=
"go_bottom"
href=
"#gobottom"
style=
"display: none;"
>
go to bottom
</a></div>
<div
class=
"ph"
><a
id=
"goBottom"
class=
"go_bottom"
href=
"#gobottom"
>
go to bottom
</a></div>
</div>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录