Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenDocCN
yii2_fecshop
提交
722aaab5
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,发现更多精彩内容 >>
提交
722aaab5
编写于
5月 24, 2017
作者:
T
Terry
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
apphtml5 search page and lazyload image
上级
4d605b58
变更
19
隐藏空白更改
内联
并排
Showing
19 changed file
with
221 addition
and
208 deletion
+221
-208
app/apphtml5/config/modules/Catalogsearch.php
app/apphtml5/config/modules/Catalogsearch.php
+2
-0
app/apphtml5/modules/Catalogsearch/block/index/Index.php
app/apphtml5/modules/Catalogsearch/block/index/Index.php
+20
-1
app/apphtml5/modules/Catalogsearch/controllers/IndexController.php
...ml5/modules/Catalogsearch/controllers/IndexController.php
+3
-1
app/apphtml5/theme/base/html5/assets/js/jquery.lazyload.min.js
...pphtml5/theme/base/html5/assets/js/jquery.lazyload.min.js
+0
-1
app/apphtml5/theme/base/html5/catalog/category/index.php
app/apphtml5/theme/base/html5/catalog/category/index.php
+8
-2
app/apphtml5/theme/base/html5/catalog/product/index.php
app/apphtml5/theme/base/html5/catalog/product/index.php
+5
-63
app/apphtml5/theme/base/html5/catalog/product/index/custom_option.php
.../theme/base/html5/catalog/product/index/custom_option.php
+1
-1
app/apphtml5/theme/base/html5/catalog/product/index/image.php
...apphtml5/theme/base/html5/catalog/product/index/image.php
+1
-1
app/apphtml5/theme/base/html5/catalog/product/index/options.php
...phtml5/theme/base/html5/catalog/product/index/options.php
+1
-1
app/apphtml5/theme/base/html5/catalogsearch/index/index.php
app/apphtml5/theme/base/html5/catalogsearch/index/index.php
+161
-111
app/apphtml5/theme/base/html5/cms/home/index.php
app/apphtml5/theme/base/html5/cms/home/index.php
+6
-4
app/apphtml5/theme/base/html5/cms/home/index/product.php
app/apphtml5/theme/base/html5/cms/home/index/product.php
+1
-1
app/apphtml5/theme/base/html5/layouts/category_view.php
app/apphtml5/theme/base/html5/layouts/category_view.php
+1
-2
app/apphtml5/theme/base/html5/layouts/home.php
app/apphtml5/theme/base/html5/layouts/home.php
+1
-2
app/apphtml5/theme/base/html5/layouts/main.php
app/apphtml5/theme/base/html5/layouts/main.php
+1
-2
app/apphtml5/theme/base/html5/layouts/one_step_checkout.php
app/apphtml5/theme/base/html5/layouts/one_step_checkout.php
+1
-1
app/apphtml5/theme/base/html5/layouts/product_view.php
app/apphtml5/theme/base/html5/layouts/product_view.php
+1
-2
app/apphtml5/theme/base/html5/widgets/header.php
app/apphtml5/theme/base/html5/widgets/header.php
+1
-1
app/apphtml5/theme/base/html5/widgets/menu.php
app/apphtml5/theme/base/html5/widgets/menu.php
+6
-11
未找到文件。
app/apphtml5/config/modules/Catalogsearch.php
浏览文件 @
722aaab5
...
...
@@ -9,6 +9,7 @@
return
[
'catalogsearch'
=>
[
'class'
=>
'\fecshop\app\apphtml5\modules\Catalogsearch\Module'
,
/*
'params'=> [
//'categorysearch_filter_attr' =>[
// 'color','size',
...
...
@@ -45,5 +46,6 @@ return [
],
],
],
*/
],
];
app/apphtml5/modules/Catalogsearch/block/index/Index.php
浏览文件 @
722aaab5
...
...
@@ -33,6 +33,7 @@ class Index
protected
$_productCount
;
protected
$_filter_attr
;
protected
$_numPerPageVal
;
protected
$_page_count
;
public
function
getLastData
()
{
...
...
@@ -45,6 +46,9 @@ class Index
$productCollInfo
=
$this
->
getSearchProductColl
();
$products
=
$productCollInfo
[
'coll'
];
$this
->
_productCount
=
$productCollInfo
[
'count'
];
if
(
Yii
::
$app
->
request
->
isAjax
)
{
$this
->
getAjaxProductHtml
(
$products
);
}
//echo $this->_productCount;
return
[
'searchText'
=>
$this
->
_searchText
,
...
...
@@ -58,12 +62,27 @@ class Index
'refine_by_info'
=>
$this
->
getRefineByInfo
(),
'filter_info'
=>
$this
->
getFilterInfo
(),
'filter_price'
=>
$this
->
getFilterPrice
(),
'page_count'
=>
$this
->
_page_count
,
//'filter_category'=> $this->getFilterCategoryHtml(),
//'content' => Yii::$service->store->getStoreAttrVal($this->_category['content'],'content'),
//'created_at' => $this->_category['created_at'],
];
}
protected
function
getAjaxProductHtml
(
$products
)
{
$parentThis
[
'products'
]
=
$products
;
$config
=
[
'view'
=>
'cms/home/index/product.php'
,
];
$html
=
Yii
::
$service
->
page
->
widget
->
renderContent
(
'category_product_price'
,
$config
,
$parentThis
);
echo
json_encode
([
'html'
=>
$html
,
]);
exit
;
}
/**
* 得到子分类,如果子分类不存在,则返回同级分类。
*/
...
...
@@ -108,7 +127,7 @@ class Index
$productNumPerPage
=
$this
->
getNumPerPage
();
$productCount
=
$this
->
_productCount
;
$pageNum
=
$this
->
getPageNum
();
//echo $productCount
;
$this
->
_page_count
=
ceil
(
$productCount
/
$productNumPerPage
)
;
$config
=
[
'class'
=>
'fecshop\app\apphtml5\widgets\Page'
,
'view'
=>
'widgets/page.php'
,
...
...
app/apphtml5/modules/Catalogsearch/controllers/IndexController.php
浏览文件 @
722aaab5
...
...
@@ -9,6 +9,7 @@
namespace
fecshop\app\apphtml5\modules\Catalogsearch\controllers
;
use
Yii
;
use
fecshop\app\apphtml5\modules\AppfrontController
;
/**
...
...
@@ -17,9 +18,10 @@ use fecshop\app\apphtml5\modules\AppfrontController;
*/
class
IndexController
extends
AppfrontController
{
public
function
init
()
public
function
init
()
{
parent
::
init
();
Yii
::
$service
->
page
->
theme
->
layoutFile
=
'category_view.php'
;
}
//
...
...
app/apphtml5/theme/base/html5/assets/js/jquery.lazyload.min.js
浏览文件 @
722aaab5
!
function
(
t
,
e
){
"
use strict
"
;
function
r
(
r
,
a
,
i
,
l
,
u
){
function
f
(){
L
=
t
.
devicePixelRatio
>
1
,
c
(
i
),
a
.
delay
>=
0
&&
setTimeout
(
function
(){
s
(
!
0
)},
a
.
delay
),(
a
.
delay
<
0
||
a
.
combined
)
&&
(
l
.
e
=
v
(
a
.
throttle
,
function
(
t
){
"
resize
"
===
t
.
type
&&
(
w
=
B
=-
1
),
s
(
t
.
all
)}),
l
.
a
=
function
(
t
){
c
(
t
),
i
.
push
.
apply
(
i
,
t
)},
l
.
g
=
function
(){
return
i
=
n
(
i
).
filter
(
function
(){
return
!
n
(
this
).
data
(
a
.
loadedName
)})},
l
.
f
=
function
(
t
){
for
(
var
e
=
0
;
e
<
t
.
length
;
e
++
){
var
r
=
i
.
filter
(
function
(){
return
this
===
t
[
e
]});
r
.
length
&&
s
(
!
1
,
r
)}},
s
(),
n
(
a
.
appendScroll
).
on
(
"
scroll.
"
+
u
+
"
resize.
"
+
u
,
l
.
e
))}
function
c
(
t
){
var
i
=
a
.
defaultImage
,
o
=
a
.
placeholder
,
l
=
a
.
imageBase
,
u
=
a
.
srcsetAttribute
,
f
=
a
.
loaderAttribute
,
c
=
a
.
_f
||
{};
t
=
n
(
t
).
filter
(
function
(){
var
t
=
n
(
this
),
r
=
m
(
this
);
return
!
t
.
data
(
a
.
handledName
)
&&
(
t
.
attr
(
a
.
attribute
)
||
t
.
attr
(
u
)
||
t
.
attr
(
f
)
||
c
[
r
]
!==
e
)}).
data
(
"
plugin_
"
+
a
.
name
,
r
);
for
(
var
s
=
0
,
d
=
t
.
length
;
s
<
d
;
s
++
){
var
A
=
n
(
t
[
s
]),
g
=
m
(
t
[
s
]),
h
=
A
.
attr
(
a
.
imageBaseAttribute
)
||
l
;
g
===
N
&&
h
&&
A
.
attr
(
u
)
&&
A
.
attr
(
u
,
b
(
A
.
attr
(
u
),
h
)),
c
[
g
]
===
e
||
A
.
attr
(
f
)
||
A
.
attr
(
f
,
c
[
g
]),
g
===
N
&&
i
&&!
A
.
attr
(
E
)?
A
.
attr
(
E
,
i
):
g
===
N
||!
o
||
A
.
css
(
O
)
&&
"
none
"
!==
A
.
css
(
O
)
||
A
.
css
(
O
,
"
url('
"
+
o
+
"
')
"
)}}
function
s
(
t
,
e
){
if
(
!
i
.
length
)
return
void
(
a
.
autoDestroy
&&
r
.
destroy
());
for
(
var
o
=
e
||
i
,
l
=!
1
,
u
=
a
.
imageBase
||
""
,
f
=
a
.
srcsetAttribute
,
c
=
a
.
handledName
,
s
=
0
;
s
<
o
.
length
;
s
++
)
if
(
t
||
e
||
A
(
o
[
s
])){
var
g
=
n
(
o
[
s
]),
h
=
m
(
o
[
s
]),
b
=
g
.
attr
(
a
.
attribute
),
v
=
g
.
attr
(
a
.
imageBaseAttribute
)
||
u
,
p
=
g
.
attr
(
a
.
loaderAttribute
);
g
.
data
(
c
)
||
a
.
visibleOnly
&&!
g
.
is
(
"
:visible
"
)
||!
((
b
||
g
.
attr
(
f
))
&&
(
h
===
N
&&
(
v
+
b
!==
g
.
attr
(
E
)
||
g
.
attr
(
f
)
!==
g
.
attr
(
F
))
||
h
!==
N
&&
v
+
b
!==
g
.
css
(
O
))
||
p
)
||
(
l
=!
0
,
g
.
data
(
c
,
!
0
),
d
(
g
,
h
,
v
,
p
))}
l
&&
(
i
=
n
(
i
).
filter
(
function
(){
return
!
n
(
this
).
data
(
c
)}))}
function
d
(
t
,
e
,
r
,
i
){
++
z
;
var
o
=
function
(){
y
(
"
onError
"
,
t
),
p
(),
o
=
n
.
noop
};
y
(
"
beforeLoad
"
,
t
);
var
l
=
a
.
attribute
,
u
=
a
.
srcsetAttribute
,
f
=
a
.
sizesAttribute
,
c
=
a
.
retinaAttribute
,
s
=
a
.
removeAttribute
,
d
=
a
.
loadedName
,
A
=
t
.
attr
(
c
);
if
(
i
){
var
g
=
function
(){
s
&&
t
.
removeAttr
(
a
.
loaderAttribute
),
t
.
data
(
d
,
!
0
),
y
(
T
,
t
),
setTimeout
(
p
,
1
),
g
=
n
.
noop
};
t
.
off
(
I
).
one
(
I
,
o
).
one
(
D
,
g
),
y
(
i
,
t
,
function
(
e
){
e
?(
t
.
off
(
D
),
g
()):(
t
.
off
(
I
),
o
())})
||
t
.
trigger
(
I
)}
else
{
var
h
=
n
(
new
Image
);
h
.
one
(
I
,
o
).
one
(
D
,
function
(){
t
.
hide
(),
e
===
N
?
t
.
attr
(
C
,
h
.
attr
(
C
)).
attr
(
F
,
h
.
attr
(
F
)).
attr
(
E
,
h
.
attr
(
E
)):
t
.
css
(
O
,
"
url('
"
+
h
.
attr
(
E
)
+
"
')
"
),
t
[
a
.
effect
](
a
.
effectTime
),
s
&&
(
t
.
removeAttr
(
l
+
"
"
+
u
+
"
"
+
c
+
"
"
+
a
.
imageBaseAttribute
),
f
!==
C
&&
t
.
removeAttr
(
f
)),
t
.
data
(
d
,
!
0
),
y
(
T
,
t
),
h
.
remove
(),
p
()});
var
m
=
(
L
&&
A
?
A
:
t
.
attr
(
l
))
||
""
;
h
.
attr
(
C
,
t
.
attr
(
f
)).
attr
(
F
,
t
.
attr
(
u
)).
attr
(
E
,
m
?
r
+
m
:
null
),
h
.
complete
&&
h
.
trigger
(
D
)}}
function
A
(
t
){
var
e
=
t
.
getBoundingClientRect
(),
r
=
a
.
scrollDirection
,
n
=
a
.
threshold
,
i
=
h
()
+
n
>
e
.
top
&&-
n
<
e
.
bottom
,
o
=
g
()
+
n
>
e
.
left
&&-
n
<
e
.
right
;
return
"
vertical
"
===
r
?
i
:
"
horizontal
"
===
r
?
o
:
i
&&
o
}
function
g
(){
return
w
>=
0
?
w
:
w
=
n
(
t
).
width
()}
function
h
(){
return
B
>=
0
?
B
:
B
=
n
(
t
).
height
()}
function
m
(
t
){
return
t
.
tagName
.
toLowerCase
()}
function
b
(
t
,
e
){
if
(
e
){
var
r
=
t
.
split
(
"
,
"
);
t
=
""
;
for
(
var
a
=
0
,
n
=
r
.
length
;
a
<
n
;
a
++
)
t
+=
e
+
r
[
a
].
trim
()
+
(
a
!==
n
-
1
?
"
,
"
:
""
)}
return
t
}
function
v
(
t
,
e
){
var
n
,
i
=
0
;
return
function
(
o
,
l
){
function
u
(){
i
=+
new
Date
,
e
.
call
(
r
,
o
)}
var
f
=+
new
Date
-
i
;
n
&&
clearTimeout
(
n
),
f
>
t
||!
a
.
enableThrottle
||
l
?
u
():
n
=
setTimeout
(
u
,
t
-
f
)}}
function
p
(){
--
z
,
i
.
length
||
z
||
y
(
"
onFinishedAll
"
)}
function
y
(
t
,
e
,
n
){
return
!!
(
t
=
a
[
t
])
&&
(
t
.
apply
(
r
,[].
slice
.
call
(
arguments
,
1
)),
!
0
)}
var
z
=
0
,
w
=-
1
,
B
=-
1
,
L
=!
1
,
T
=
"
afterLoad
"
,
D
=
"
load
"
,
I
=
"
error
"
,
N
=
"
img
"
,
E
=
"
src
"
,
F
=
"
srcset
"
,
C
=
"
sizes
"
,
O
=
"
background-image
"
;
"
event
"
===
a
.
bind
||
o
?
f
():
n
(
t
).
on
(
D
+
"
.
"
+
u
,
f
)}
function
a
(
a
,
o
){
var
l
=
this
,
u
=
n
.
extend
({},
l
.
config
,
o
),
f
=
{},
c
=
u
.
name
+
"
-
"
+
++
i
;
return
l
.
config
=
function
(
t
,
r
){
return
r
===
e
?
u
[
t
]:(
u
[
t
]
=
r
,
l
)},
l
.
addItems
=
function
(
t
){
return
f
.
a
&&
f
.
a
(
"
string
"
===
n
.
type
(
t
)?
n
(
t
):
t
),
l
},
l
.
getItems
=
function
(){
return
f
.
g
?
f
.
g
():{}},
l
.
update
=
function
(
t
){
return
f
.
e
&&
f
.
e
({},
!
t
),
l
},
l
.
force
=
function
(
t
){
return
f
.
f
&&
f
.
f
(
"
string
"
===
n
.
type
(
t
)?
n
(
t
):
t
),
l
},
l
.
loadAll
=
function
(){
return
f
.
e
&&
f
.
e
({
all
:
!
0
},
!
0
),
l
},
l
.
destroy
=
function
(){
return
n
(
u
.
appendScroll
).
off
(
"
.
"
+
c
,
f
.
e
),
n
(
t
).
off
(
"
.
"
+
c
),
f
=
{},
e
},
r
(
l
,
u
,
a
,
f
,
c
),
u
.
chainable
?
a
:
l
}
var
n
=
t
.
jQuery
||
t
.
Zepto
,
i
=
0
,
o
=!
1
;
n
.
fn
.
Lazy
=
n
.
fn
.
lazy
=
function
(
t
){
return
new
a
(
this
,
t
)},
n
.
Lazy
=
n
.
lazy
=
function
(
t
,
r
,
i
){
if
(
n
.
isFunction
(
r
)
&&
(
i
=
r
,
r
=
[]),
n
.
isFunction
(
i
)){
t
=
n
.
isArray
(
t
)?
t
:[
t
],
r
=
n
.
isArray
(
r
)?
r
:[
r
];
for
(
var
o
=
a
.
prototype
.
config
,
l
=
o
.
_f
||
(
o
.
_f
=
{}),
u
=
0
,
f
=
t
.
length
;
u
<
f
;
u
++
)(
o
[
t
[
u
]]
===
e
||
n
.
isFunction
(
o
[
t
[
u
]]))
&&
(
o
[
t
[
u
]]
=
i
);
for
(
var
c
=
0
,
s
=
r
.
length
;
c
<
s
;
c
++
)
l
[
r
[
c
]]
=
t
[
0
]}},
a
.
prototype
.
config
=
{
name
:
"
lazy
"
,
chainable
:
!
0
,
autoDestroy
:
!
0
,
bind
:
"
load
"
,
threshold
:
500
,
visibleOnly
:
!
1
,
appendScroll
:
t
,
scrollDirection
:
"
both
"
,
imageBase
:
null
,
defaultImage
:
"
data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==
"
,
placeholder
:
null
,
delay
:
-
1
,
combined
:
!
1
,
attribute
:
"
data-src
"
,
srcsetAttribute
:
"
data-srcset
"
,
sizesAttribute
:
"
data-sizes
"
,
retinaAttribute
:
"
data-retina
"
,
loaderAttribute
:
"
data-loader
"
,
imageBaseAttribute
:
"
data-imagebase
"
,
removeAttribute
:
!
0
,
handledName
:
"
handled
"
,
loadedName
:
"
loaded
"
,
effect
:
"
show
"
,
effectTime
:
0
,
enableThrottle
:
!
0
,
throttle
:
250
,
beforeLoad
:
e
,
afterLoad
:
e
,
onError
:
e
,
onFinishedAll
:
e
},
n
(
t
).
on
(
"
load
"
,
function
(){
o
=!
0
})}(
window
);
\ No newline at end of file
app/apphtml5/theme/base/html5/catalog/category/index.php
浏览文件 @
722aaab5
...
...
@@ -142,7 +142,10 @@ $(document).ready(function(){
$
(
this
).
addClass
(
"
checked
"
);
}
});
$
(
"
img.lazy
"
).
Lazy
();
$
(
"
img.lazy
"
).
each
(
function
(){
src
=
$
(
this
).
attr
(
"
data-src
"
);
$
(
this
).
attr
(
"
src
"
,
src
);
});
});
$
(
document
).
on
(
'
click
'
,
'
.open-filter
'
,
function
()
{
...
...
@@ -181,7 +184,10 @@ $(document).on("pageInit", "#page-infinite-scroll-bottom", function(e, id, page)
html
=
data
.
html
;
//alert(html);
$
(
'
.infinite-scroll .list-container
'
).
append
(
html
);
$
(
"
img.lazy
"
).
each
(
function
(){
src
=
$
(
this
).
attr
(
"
data-src
"
);
$
(
this
).
attr
(
"
src
"
,
src
);
});
},
error
:
function
(
XMLHttpRequest
,
textStatus
,
errorThrown
){}
});
...
...
app/apphtml5/theme/base/html5/catalog/product/index.php
浏览文件 @
722aaab5
...
...
@@ -352,73 +352,15 @@
});
}
});
$
(
"
img.lazy
"
).
each
(
function
(){
src
=
$
(
this
).
attr
(
"
data-src
"
);
$
(
this
).
attr
(
"
src
"
,
src
);
});
});
$
.
init
();
<?php
$this
->
endBlock
();
?>
<?php
$this
->
registerJs
(
$this
->
blocks
[
'add_to_cart'
],
\
yii\web\View
::
POS_END
);
//将编写的js代码注册到页面底部 ?>
//tab 切换js
<?
php
$this
->
beginBlock
(
'product_info_tab'
)
?>
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
);
};
}
$
.
init
();
<?php
$this
->
endBlock
();
?>
<?php
$this
->
registerJs
(
$this
->
blocks
[
'product_info_tab'
],
\
yii\web\View
::
POS_END
);
//将编写的js代码注册到页面底部 ?>
</
script
>
\ No newline at end of file
app/apphtml5/theme/base/html5/catalog/product/index/custom_option.php
浏览文件 @
722aaab5
...
...
@@ -16,7 +16,7 @@
<?php
if
(
$image
){
?>
<li
id=
"gal1"
>
<a
data-image=
"
<?=
Yii
::
$service
->
product
->
image
->
getResize
(
$image
,
$middle_img_width
,
false
)
?>
"
data-zoom-image=
"
<?=
Yii
::
$service
->
product
->
image
->
getUrl
(
$image
);
?>
"
attr=
"
<?=
$attr
?>
"
class=
"imgshow active_v"
value=
"
<?=
$key
?>
"
>
<img
src=
"
<?=
Yii
::
$service
->
product
->
image
->
getResize
(
$image
,[
40
,
45
],
false
)
?>
"
/></a>
<img
class=
"lazy"
data-
src=
"
<?=
Yii
::
$service
->
product
->
image
->
getResize
(
$image
,[
40
,
45
],
false
)
?>
"
/></a>
<b></b>
</li>
<?php
}
else
{
?>
...
...
app/apphtml5/theme/base/html5/catalog/product/index/image.php
浏览文件 @
722aaab5
...
...
@@ -23,7 +23,7 @@ $middle_img_width = isset($media_size['middle_img_width']) ? $media_size['middle
<?php
if
(
is_array
(
$gallerys
)
&&
!
empty
(
$gallerys
)){
?>
<?php
foreach
(
$gallerys
as
$gallery
){
?>
<?php
$image
=
$gallery
[
'image'
];
?>
<div
class=
"swiper-slide"
><img
src=
"
<?=
Yii
::
$service
->
product
->
image
->
getResize
(
$image
,
$middle_img_width
,
false
)
?>
"
alt=
""
style=
'width: 100%'
></div>
<div
class=
"swiper-slide"
><img
class=
"lazy"
data-src=
"
<?=
Yii
::
$service
->
product
->
image
->
getResize
(
$image
,
$middle_img_width
,
false
)
?>
"
src=
"
<?=
Yii
::
$service
->
image
->
getImgUrl
(
'images/lazyload.gif'
);
?>
"
alt=
""
style=
'width: 100%'
></div>
<?php
}
?>
<?php
}
?>
</div>
...
...
app/apphtml5/theme/base/html5/catalog/product/index/options.php
浏览文件 @
722aaab5
...
...
@@ -19,7 +19,7 @@
<?php
$active
=
'class="current"'
;
?>
<?php
}
?>
<li
<?=
$active
?>
>
<a
title=
"
<?=
$attr1Val
?>
"
<?=
$active
?>
href=
"javascript:void(0)"
rel=
"
<?=
$url
?>
"
><img
src=
"
<?=
Yii
::
$service
->
product
->
image
->
getResize
(
$main_img
,[
40
,
45
],
false
)
?>
"
/></a>
<a
title=
"
<?=
$attr1Val
?>
"
<?=
$active
?>
href=
"javascript:void(0)"
rel=
"
<?=
$url
?>
"
><img
class=
"lazy"
data-
src=
"
<?=
Yii
::
$service
->
product
->
image
->
getResize
(
$main_img
,[
40
,
45
],
false
)
?>
"
/></a>
<b></b>
</li>
<?php
}
?>
...
...
app/apphtml5/theme/base/html5/catalogsearch/index/index.php
浏览文件 @
722aaab5
...
...
@@ -7,131 +7,112 @@
* @license http://www.fecshop.com/license/
*/
?>
<div
class=
"main container two-columns-left"
>
<?php
// echo count($products); ?>
<?
php
$count
=
4
;
$end
=
$count
-
1
;
?>
<div
class=
"col-main"
>
<div
class=
"content"
>
<div
class=
"content-block"
>
<?=
Yii
::
$service
->
page
->
widget
->
render
(
'breadcrumbs'
,
$this
);
?>
<div
class=
"menu_category"
>
<?php
if
(
is_array
(
$products
)
&&
!
empty
(
$products
)){
?>
<div
class=
"panelBar"
>
<?php
$parentThis
=
[
'query_item'
=>
$query_item
,
'product_page'
=>
$product_page
,
];
$config
=
[
'view'
=>
'catalogsearch/index/index/toolbar.php'
,
];
$toolbar
=
Yii
::
$service
->
page
->
widget
->
renderContent
(
'category_toolbar'
,
$config
,
$parentThis
);
echo
$toolbar
;
?>
</div>
<div
class=
"category_product"
>
<?php
$i
=
0
;
foreach
(
$products
as
$product
){
?>
<?php
if
(
$i
%
$count
==
0
){
?>
<ul>
<?php
}
?>
<li>
<div
class=
"c_img"
>
<a
href=
"
<?=
$product
[
'url'
]
?>
"
>
<img
class=
"js_lazy"
src=
"
<?=
Yii
::
$service
->
image
->
getImgUrl
(
'images/lazyload.gif'
);
?>
"
data-original=
"
<?=
Yii
::
$service
->
product
->
image
->
getResize
(
$product
[
'image'
],[
230
,
230
],
false
)
?>
"
/>
</a>
</div>
<div
class=
"c_name"
>
<a
href=
"
<?=
$product
[
'url'
]
?>
"
>
<?=
$product
[
'name'
]
?>
</a>
</div>
<?php
$config
=
[
'class'
=>
'fecshop\app\apphtml5\modules\Catalog\block\category\Price'
,
'view'
=>
'catalog/category/price.php'
,
'price'
=>
$product
[
'price'
],
'special_price'
=>
$product
[
'special_price'
],
];
echo
Yii
::
$service
->
page
->
widget
->
renderContent
(
'category_product_price'
,
$config
);
?>
</li>
<?php
if
(
$i
%
$count
==
$end
){
?>
</ul>
<?php
}
?>
<?php
$i
++
;
?>
<?php
}
?>
<?php
if
(
$i
%
$count
!=
$end
){
?>
</ul>
<?php
}
?>
</div>
<div
class=
"category_page"
>
<div
class=
"category_img"
>
<a
href=
"#"
>
<?=
$image
?
'<img style="width:100%;" src="'
.
$image
.
'"/>'
:
''
;
?>
<a>
</div>
<div
class=
"category_description"
>
<h1>
<?=
$name
?>
</h1>
<?=
$description
?>
</div>
<div
class=
"sort_filter"
>
<a
href=
"#"
class=
"category-open open-filter"
>
Filter
<span
class=
"icon icon-caret"
></span></a>
<div
class=
"clear"
></div>
<div
class=
"panelBar"
>
<?php
echo
$toolbar
;
?>
</div>
<div
>
<!-- 添加 class infinite-scroll 和 data-distance 向下无限滚动可不加infinite-scroll-bottom类,这里加上是为了和下面的向上无限滚动区分-->
<div
class=
" infinite-scroll infinite-scroll-bottom"
data-distance=
"10"
>
<div
class=
"list-block"
>
<div
class=
"list-container"
>
<?php
if
(
is_array
(
$products
)
&&
!
empty
(
$products
)){
?>
<?php
$parentThis
[
'products'
]
=
$products
;
$config
=
[
'view'
=>
'cms/home/index/product.php'
,
];
echo
Yii
::
$service
->
page
->
widget
->
renderContent
(
'category_product_price'
,
$config
,
$parentThis
);
?>
<?php
}
else
{
?>
<?=
Yii
::
$service
->
page
->
translate
->
__
(
'Search results for \'{searchText}\' returns no results'
,[
'searchText'
=>
$searchText
]);
?>
<?php
}
?>
</div>
<!-- 加载提示符 -->
<div
class=
"infinite-scroll-preloader"
>
<div
class=
"preloader"
></div>
</div>
</div>
</div>
<?php
}
else
{
?>
<?=
Yii
::
$service
->
page
->
translate
->
__
(
'Search results for \'{searchText}\' returns no results'
,[
'searchText'
=>
$searchText
]);
?>
<?php
}
?>
</div>
</div>
</div>
<div
class=
"col-left "
>
<?php
# Refind By
$parentThis
=
[
'refine_by_info'
=>
$refine_by_info
,
];
$config
=
[
'view'
=>
'catalog/category/index/filter/refineby.php'
,
];
echo
Yii
::
$service
->
page
->
widget
->
renderContent
(
'category_product_filter_refine_by'
,
$config
,
$parentThis
);
?>
<?php
# Category Left Filter subCategory
$parentThis
=
[
'filter_category'
=>
$filter_category
,
'current_category'
=>
$name
,
];
$config
=
[
'view'
=>
'catalog/category/index/filter/subcategory.php'
,
];
echo
Yii
::
$service
->
page
->
widget
->
renderContent
(
'category_product_filter_sub_category'
,
$config
,
$parentThis
);
?>
<?php
# Category Left Filter Product Attributes
$parentThis
=
[
'filters'
=>
$filter_info
,
];
$config
=
[
'view'
=>
'catalog/category/index/filter/attr.php'
,
];
echo
Yii
::
$service
->
page
->
widget
->
renderContent
(
'category_product_filter_attr'
,
$config
,
$parentThis
);
?>
<?php
# Category Left Filter Product Price
$parentThis
=
[
'filter_price'
=>
$filter_price
,
];
$config
=
[
'view'
=>
'catalog/category/index/filter/price.php'
,
];
echo
Yii
::
$service
->
page
->
widget
->
renderContent
(
'category_product_filter_price'
,
$config
,
$parentThis
);
?>
</div>
<div
class=
"popup popup-filter"
>
<div
class=
"content-block"
>
<div
class=
"close_popup"
>
<a
href=
"#"
class=
"close-popup"
>
×
</a></p>
</div>
<?php
# Refind By
$parentThis
=
[
'refine_by_info'
=>
$refine_by_info
,
];
$config
=
[
'view'
=>
'catalog/category/index/filter/refineby.php'
,
];
echo
Yii
::
$service
->
page
->
widget
->
renderContent
(
'category_product_filter_refine_by'
,
$config
,
$parentThis
);
?>
<?php
# Category Left Filter subCategory
$parentThis
=
[
'filter_category'
=>
$filter_category
,
'current_category'
=>
$name
,
];
$config
=
[
'view'
=>
'catalog/category/index/filter/subcategory.php'
,
];
echo
Yii
::
$service
->
page
->
widget
->
renderContent
(
'category_product_filter_sub_category'
,
$config
,
$parentThis
);
?>
<?php
# Category Left Filter Product Attributes
$parentThis
=
[
'filters'
=>
$filter_info
,
];
$config
=
[
'view'
=>
'catalog/category/index/filter/attr.php'
,
];
echo
Yii
::
$service
->
page
->
widget
->
renderContent
(
'category_product_filter_attr'
,
$config
,
$parentThis
);
?>
<?php
# Category Left Filter Product Price
$parentThis
=
[
'filter_price'
=>
$filter_price
,
];
$config
=
[
'view'
=>
'catalog/category/index/filter/price.php'
,
];
echo
Yii
::
$service
->
page
->
widget
->
renderContent
(
'category_product_filter_price'
,
$config
,
$parentThis
);
?>
</div>
<div
class=
"clear"
></div>
</div>
<script>
<?php
$this
->
beginBlock
(
'category_product_filter'
)
?>
$
(
document
).
ready
(
function
(){
$
(
"
.product_sort
"
).
change
(
function
(){
url
=
$
(
this
).
find
(
"
option:selected
"
).
attr
(
'
url
'
);
url
=
$
(
this
).
find
(
'
option
'
).
not
(
function
()
{
return
!
this
.
selected
}
).
attr
(
'
url
'
);
window
.
location
.
href
=
url
;
});
$
(
"
.product_num_per_page
"
).
change
(
function
(){
url
=
$
(
this
).
find
(
"
option:selected
"
).
attr
(
'
url
'
);
//url = $(this).find("option:selected").attr('url');
url
=
$
(
this
).
find
(
'
option
'
).
not
(
function
()
{
return
!
this
.
selected
}).
attr
(
'
url
'
);
window
.
location
.
href
=
url
;
});
...
...
@@ -143,7 +124,76 @@ $(document).ready(function(){
$
(
this
).
addClass
(
"
checked
"
);
}
});
$
(
"
img.lazy
"
).
each
(
function
(){
src
=
$
(
this
).
attr
(
"
data-src
"
);
$
(
this
).
attr
(
"
src
"
,
src
);
});
});
$
(
document
).
on
(
'
click
'
,
'
.open-filter
'
,
function
()
{
$
.
popup
(
'
.popup-filter
'
);
});
$
(
document
).
on
(
'
click
'
,
'
.open-sort
'
,
function
()
{
$
.
popup
(
'
.popup-sort
'
);
});
$
(
document
).
on
(
"
pageInit
"
,
"
#page-infinite-scroll-bottom
"
,
function
(
e
,
id
,
page
)
{
var
loading
=
false
;
var
pageNum
=
1
;
var
maxPage
=
<?=
$page_count
?
$page_count
:
1
?>
;
if
(
maxPage
<=
pageNum
){
$
(
'
.infinite-scroll-preloader
'
).
remove
();
}
function
addItems
()
{
//alert(pageNum);
pageNum
++
;
var
html
=
''
;
url
=
window
.
location
.
href
;
$
.
ajax
({
async
:
true
,
timeout
:
60000
,
dataType
:
'
json
'
,
type
:
'
get
'
,
data
:
{
'
p
'
:
pageNum
},
url
:
url
,
success
:
function
(
data
,
textStatus
){
//alert(data);
html
=
data
.
html
;
//alert(html);
$
(
'
.infinite-scroll .list-container
'
).
append
(
html
);
$
(
"
img.lazy
"
).
each
(
function
(){
src
=
$
(
this
).
attr
(
"
data-src
"
);
$
(
this
).
attr
(
"
src
"
,
src
);
});
},
error
:
function
(
XMLHttpRequest
,
textStatus
,
errorThrown
){}
});
}
$
(
page
).
on
(
'
infinite
'
,
function
()
{
//alert(222);
if
(
loading
)
return
;
loading
=
true
;
if
(
pageNum
>=
maxPage
)
{
$
.
detachInfiniteScroll
(
$
(
'
.infinite-scroll
'
));
$
(
'
.infinite-scroll-preloader
'
).
remove
();
return
;
}
addItems
();
//alert(pageNum);
loading
=
false
;
$
.
refreshScroller
();
});
});
$
.
init
();
<?php
$this
->
endBlock
();
?>
</script>
<?php
$this
->
registerJs
(
$this
->
blocks
[
'category_product_filter'
],
\
yii\web\View
::
POS_END
);
//将编写的js代码注册到页面底部 ?>
app/apphtml5/theme/base/html5/cms/home/index.php
浏览文件 @
722aaab5
...
...
@@ -84,12 +84,10 @@
</div>
<div
class=
"footer-bottom"
>
<?=
Yii
::
$service
->
cms
->
staticblock
->
getStoreContentByIdentify
(
'copy_right'
,
'appfront'
)
?>
<?=
Yii
::
$service
->
cms
->
staticblock
->
getStoreContentByIdentify
(
'copy_right
_apphtml5
'
,
'appfront'
)
?>
</div>
<script>
<?php
$this
->
beginBlock
(
'owl_fecshop_slider'
)
?>
$
.
init
();
...
...
@@ -108,7 +106,11 @@ $(document).ready(function(){
//alert(htmlobj.responseText);
location
.
reload
()
;
});
$
(
"
img.lazy
"
).
Lazy
();
// $("img.lazy").Lazy();
$
(
"
img.lazy
"
).
each
(
function
(){
src
=
$
(
this
).
attr
(
"
data-src
"
);
$
(
this
).
attr
(
"
src
"
,
src
);
});
});
<?php
$this
->
endBlock
();
?>
</script>
...
...
app/apphtml5/theme/base/html5/cms/home/index/product.php
浏览文件 @
722aaab5
...
...
@@ -8,7 +8,7 @@
<?php
}
?>
<div
class=
"col-50 product_list"
>
<a
href=
"
<?=
$product
[
'url'
]
?>
"
external
>
<img
width=
"100%"
class=
"lazy"
data-src=
"
<?=
Yii
::
$service
->
product
->
image
->
getResize
(
$product
[
'image'
],
296
,
false
)
?>
"
/>
<img
width=
"100%"
src=
"
<?=
Yii
::
$service
->
image
->
getImgUrl
(
'images/lazyload.gif'
);
?>
"
class=
"lazy"
data-src=
"
<?=
Yii
::
$service
->
product
->
image
->
getResize
(
$product
[
'image'
],
296
,
false
)
?>
"
/>
</a>
<p
class=
"product_name"
style=
""
>
<a
href=
"
<?=
$product
[
'url'
]
?>
"
external
>
...
...
app/apphtml5/theme/base/html5/layouts/category_view.php
浏览文件 @
722aaab5
...
...
@@ -19,8 +19,7 @@ $jsOptions = [
'js/zepto.min.js'
,
'js/sm.min.js'
,
'js/sm-extend.min.js'
,
'js/jquery.lazyload.min.js'
,
'js/js.js'
,
],
],
];
...
...
app/apphtml5/theme/base/html5/layouts/home.php
浏览文件 @
722aaab5
...
...
@@ -19,8 +19,7 @@ $jsOptions = [
'js/zepto.min.js'
,
'js/sm.min.js'
,
'js/sm-extend.min.js'
,
'js/jquery.lazyload.min.js'
,
'js/js.js'
,
],
],
];
...
...
app/apphtml5/theme/base/html5/layouts/main.php
浏览文件 @
722aaab5
...
...
@@ -19,8 +19,7 @@ $jsOptions = [
'js/zepto.min.js'
,
'js/sm.min.js'
,
'js/sm-extend.min.js'
,
'js/jquery.lazyload.min.js'
,
'js/js.js'
,
],
],
];
...
...
app/apphtml5/theme/base/html5/layouts/one_step_checkout.php
浏览文件 @
722aaab5
...
...
@@ -19,7 +19,7 @@ $jsOptions = [
'js/zepto.min.js'
,
'js/sm.min.js'
,
'js/sm-extend.min.js'
,
'js/js.js'
,
],
],
];
...
...
app/apphtml5/theme/base/html5/layouts/product_view.php
浏览文件 @
722aaab5
...
...
@@ -19,8 +19,7 @@ $jsOptions = [
'js/zepto.min.js'
,
'js/sm.min.js'
,
'js/sm-extend.min.js'
,
'js/js.js'
,
'js/jquery.lazyload.min.js'
,
],
],
];
...
...
app/apphtml5/theme/base/html5/widgets/header.php
浏览文件 @
722aaab5
...
...
@@ -11,7 +11,7 @@
<a
class=
"icon icon-menu pull-left open-panel"
data-panel=
"#panel-left-menu"
></a>
<a
href=
"
<?=
Yii
::
$service
->
url
->
homeUrl
();
?>
"
external
>
<h1
class=
'title header_logo'
>
<img
src=
"
<?=
Yii
::
$service
->
image
->
getImgUrl
(
'/custom/logo.png'
,
'appfront'
)
?>
"
/>
<img
class=
"lazy"
data-
src=
"
<?=
Yii
::
$service
->
image
->
getImgUrl
(
'/custom/logo.png'
,
'appfront'
)
?>
"
/>
</h1>
</a>
<div
class=
"pull-right"
>
...
...
app/apphtml5/theme/base/html5/widgets/menu.php
浏览文件 @
722aaab5
...
...
@@ -11,23 +11,18 @@
?>
<div
class=
"panel-overlay"
>
</div>
<!-- Left Panel with Reveal effect -->
<div
class=
"panel panel-left panel-reveal theme-dark"
id=
'panel-left-menu'
>
<div
class=
"content-block"
>
<div
class=
"searchbar row"
>
<div
class=
"search-input"
>
<label
class=
"icon icon-search"
for=
"search"
></label>
<input
type=
"search"
id=
'search'
placeholder=
'输入关键字...'
/>
</div>
<form
method=
"get"
name=
"searchFrom"
class=
"js_topSeachForm"
action=
"
<?=
Yii
::
$service
->
url
->
getUrl
(
'catalogsearch/index'
);
?>
"
>
<div
class=
"search-input"
>
<label
class=
"icon icon-search"
for=
"search"
></label>
<input
name=
"q"
type=
"search"
id=
"search"
placeholder=
"
<?=
Yii
::
$service
->
page
->
translate
->
__
(
'Products keyword'
);
?>
"
value=
"
<?=
\
Yii
::
$service
->
helper
->
htmlEncode
(
Yii
::
$app
->
request
->
get
(
'q'
));
?>
"
/>
</div>
</form>
</div>
<div
class=
"category_menu"
>
<?php
if
(
is_array
(
$categoryArr
)
&&
!
empty
(
$categoryArr
)){
?>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录