Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuywap-node
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
郭成尧
8 years ago
Commit
e68efdeba35aed0a2da133a378bab63eb5420885
1 parent
b4adacc9
no-result
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
7 deletions
apps/product/controllers/new-shop.js
apps/product/controllers/search.js
apps/product/views/action/search/goods-list-ajax.hbs
public/js/product/product-list-with-filter.js
public/scss/product/search/_list.css
apps/product/controllers/new-shop.js
View file @
e68efde
...
...
@@ -81,6 +81,9 @@ const shop = {
}).
catch
(
next
);
},
/**
* 一个横向商品列表
*/
shopHotList
(
req
,
res
,
next
)
{
let
skns
=
req
.
query
.
skns
;
let
isApp
=
req
.
query
.
app_version
||
req
.
query
.
appVersion
||
false
;
...
...
apps/product/controllers/search.js
View file @
e68efde
...
...
@@ -352,10 +352,9 @@ const searchBrandGoods = (req, res, next) => {
let
goodsList
=
productProcess
.
processProductList
(
_
.
get
(
goodListApi
,
'data.product_list'
,
[]));
if
(
goodsList
)
{
res
.
render
(
'search/
page
'
,
{
res
.
render
(
'search/
goods-list-ajax
'
,
{
layout
:
false
,
new
:
goodsList
,
total
:
goodsData
.
total
,
goodsList
:
goodsList
,
_noLazy
:
req
.
query
.
noLazy
||
false
});
}
else
{
...
...
apps/product/views/action/search/goods-list-ajax.hbs
0 → 100644
View file @
e68efde
{{#
goodsList
}}
{{>
common
/
goods
}}
{{/
goodsList
}}
\ No newline at end of file
...
...
public/js/product/product-list-with-filter.js
View file @
e68efde
...
...
@@ -14,7 +14,7 @@ const lazyLoad = require('yoho-jquery-lazyload');
class
ProductListWithFilter
{
constructor
(
filterParams
,
searchUrl
)
{
this
.
scrollActived
=
true
;
this
.
scrollActived
=
true
;
// 是否激活滚动加载,默认激活
this
.
filterParams
=
filterParams
;
this
.
searchUrl
=
location
.
protocol
+
'//m.yohobuy.com/'
+
(
searchUrl
||
'product/search/search'
);
this
.
filterUrl
=
location
.
protocol
+
'//m.yohobuy.com/product/search/filter'
;
...
...
@@ -56,6 +56,7 @@ class ProductListWithFilter {
};
this
.
beforeScroll
=
document
.
body
.
scrollTop
;
// 滚动前位置记录
this
.
navType
=
'default'
;
// 目前激活的导航页面
this
.
nav
=
this
.
navInfo
[
this
.
navType
];
this
.
defaultOpt
=
Object
.
assign
({},
this
.
navInfo
.
default
,
this
.
filterParams
);
// 默认参数
this
.
onSearching
=
false
;
// 是否正在搜索
this
.
isScrollLoad
=
false
;
// 是否是滚动加载
...
...
@@ -79,6 +80,7 @@ class ProductListWithFilter {
});
this
.
beforeScroll
=
afterScroll
;
}
else
{
this
.
beforeScroll
=
afterScroll
;
return
false
;
}
},
5
);
...
...
@@ -138,7 +140,9 @@ class ProductListWithFilter {
if
(
$
(
'.no-result-new'
).
length
>
0
)
{
$
(
'.no-result-new'
).
remove
();
}
this
.
view
.
container
.
append
(
'<div class="search-divide">正在加载...</div>'
);
this
.
view
.
container
.
after
(()
=>
{
return
'<div class="search-divide">正在加载...</div>'
;
});
},
success
:
(
result
)
=>
{
// 去掉正在加载
...
...
@@ -146,11 +150,12 @@ class ProductListWithFilter {
let
noResult
=
!
result
||
result
.
length
<
1
||
(
result
.
list
&&
result
.
list
.
length
<
1
);
// 没有结果输出没有结果页面
if
(
noResult
)
{
if
(
this
.
isScrollLoad
)
{
this
.
view
.
container
.
append
(
'<div class="search-divide">没有更多内容了...</div>'
);
this
.
view
.
container
.
after
(()
=>
{
return
'<div class="search-divide">没有更多内容了...</div>'
;
});
}
else
{
this
.
view
.
container
.
html
(
noResultHbs
());
}
...
...
public/scss/product/search/_list.css
View file @
e68efde
...
...
@@ -594,3 +594,9 @@
border-top
:
none
;
}
}
.reds-shop
{
.search-divide
{
margin-bottom
:
100px
;
}
}
...
...
Please
register
or
login
to post a comment