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
c48160b604a30f0d1abdceb83b488188793248d0
1 parent
ee7dc909
wap页头微信中优化
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
63 additions
and
19 deletions
apps/channel/controllers/brand.js
apps/channel/models/brand.js
apps/channel/views/action/brand/search.hbs
public/scss/channel/_brand.css
apps/channel/controllers/brand.js
View file @
c48160b
...
...
@@ -54,6 +54,7 @@ let search = (req, res, next) => {
pageHeader
:
headerData
,
module
:
'channel'
,
page
:
'brand'
,
isWechat
:
req
.
yoho
.
isWechat
,
title
:
req
.
yoho
.
isWechat
?
'品牌一览'
:
'品牌一览 | Yoho!Buy有货 | 潮流购物逛不停'
,
pageFooter
:
true
};
...
...
@@ -84,7 +85,10 @@ let addBrandSearch = (req, res, next) => {
let
records
=
timestamp
+
'_'
+
brandName
;
let
param
=
{
uid
,
records
};
let
param
=
{
uid
,
records
};
indexModel
.
addSearchHistory
(
param
).
then
((
result
)
=>
{
res
.
json
(
result
);
...
...
@@ -119,11 +123,19 @@ let searchAsync = (req, res, next) => {
}
if
(
!
uid
)
{
return
res
.
json
({
code
:
200
,
data
:
{}});
return
res
.
json
({
code
:
200
,
data
:
{}
});
}
return
indexModel
.
branchSearchHistoryAsync
(
uid
).
then
((
result
)
=>
{
return
res
.
json
({
code
:
200
,
data
:
{
history
:
result
}});
return
res
.
json
({
code
:
200
,
data
:
{
history
:
result
}
});
});
};
...
...
apps/channel/models/brand.js
View file @
c48160b
...
...
@@ -49,7 +49,9 @@ const _packageList = (params) => {
method
:
'app.brand.newBrandList'
,
yh_channel
:
params
.
channel
},
{
code
:
200
}).
then
(
result
=>
{
},
{
code
:
200
}).
then
(
result
=>
{
return
result
;
...
...
@@ -177,7 +179,9 @@ const getBrandByChannel = (channel) => {
let
obj
=
{};
obj
=
Object
.
assign
(
obj
,
{
title
:
key
});
obj
=
Object
.
assign
(
obj
,
{
title
:
key
});
let
list
=
[];
...
...
@@ -192,7 +196,9 @@ const getBrandByChannel = (channel) => {
});
obj
=
Object
.
assign
(
obj
,
{
list
});
obj
=
Object
.
assign
(
obj
,
{
list
});
resu
.
channel
.
brandList
.
push
(
obj
);
...
...
@@ -217,7 +223,9 @@ const getBrandByChannel = (channel) => {
img
:
helpers
.
image
(
newList
[
key
].
brand_ico
,
186
,
115
),
});
obj
=
Object
.
assign
(
obj
,
{
list
});
obj
=
Object
.
assign
(
obj
,
{
list
});
resu
.
channel
.
newBrandWall
.
push
(
obj
);
...
...
@@ -242,7 +250,9 @@ const getBrandByChannel = (channel) => {
img
:
helpers
.
image
(
hotList
[
key
].
brand_ico
,
186
,
115
),
});
obj
=
Object
.
assign
(
obj
,
{
list
});
obj
=
Object
.
assign
(
obj
,
{
list
});
resu
.
channel
.
recommandBrandWall
.
push
(
obj
);
...
...
@@ -267,7 +277,9 @@ const getBrandForSearch = (channel) => {
method
:
'app.brand.brandlist'
,
yh_channel
:
channel
||
1
},
{
code
:
200
}).
then
(
result
=>
{
},
{
code
:
200
}).
then
(
result
=>
{
return
result
;
...
...
@@ -287,7 +299,9 @@ const branchSearchHistory = (params) => {
uid
:
params
.
uid
,
records
:
params
.
records
||
''
},
{
code
:
200
}).
then
(
result
=>
{
},
{
code
:
200
}).
then
(
result
=>
{
return
result
;
...
...
@@ -302,7 +316,9 @@ const addSearchHistory = (param) => {
uid
:
param
.
uid
,
records
:
param
.
records
},
{
code
:
200
});
},
{
code
:
200
});
};
/**
...
...
@@ -314,7 +330,9 @@ const branchSearchHot = () => {
return
api
.
get
(
''
,
{
method
:
'app.search.hotBrands'
},
{
code
:
200
}).
then
(
result
=>
{
},
{
code
:
200
}).
then
(
result
=>
{
return
result
;
...
...
@@ -442,7 +460,6 @@ const branchSearch = (params) => {
let
resu
=
{
brandPage
:
true
,
showDownloadApp
:
true
,
pageFooter
:
true
,
hot
:
[],
history
:
[],
...
...
@@ -489,7 +506,9 @@ const branchSearch = (params) => {
let
obj
=
{};
obj
=
Object
.
assign
(
obj
,
{
name
:
hotList
[
key
].
brandName
});
obj
=
Object
.
assign
(
obj
,
{
name
:
hotList
[
key
].
brandName
});
resu
.
hot
.
push
(
obj
);
...
...
@@ -535,7 +554,9 @@ const delBrandSearchHistory = (param) => {
method
:
'app.search.clearHotBrandRecords'
,
uid
:
param
.
uid
},
{
code
:
200
}).
then
(
result
=>
{
},
{
code
:
200
}).
then
(
result
=>
{
return
result
;
...
...
@@ -546,7 +567,9 @@ const delBrandSearchHistory = (param) => {
* [异步获取用户最近搜索词]
*/
const
branchSearchHistoryAsync
=
(
uid
)
=>
{
return
branchSearchHistory
({
uid
}).
then
((
result
)
=>
{
return
branchSearchHistory
({
uid
}).
then
((
result
)
=>
{
let
hisList
=
result
.
data
;
let
obj
=
[];
...
...
apps/channel/views/action/brand/search.hbs
View file @
c48160b
<div
class=
"brand-page brand-search-page yoho-page"
>
<div
class=
"newbrand-search"
>
<div
class=
"newbrand-search
{{#if
isWechat
}}
wechat
{{/if}}
"
>
<form
class=
"search-box clearfix"
>
<input
type=
"text"
class=
"search-input"
id=
"keyword"
placeholder=
"查找品牌"
>
<i
class=
"search-icon iconfont"
>

</i>
...
...
@@ -9,7 +9,7 @@
</div>
</form>
</div>
<div
class=
"search-result"
>
<div
class=
"search-result
{{#if
isWechat
}}
wechat
{{/if}}
"
>
</div>
</div>
...
...
public/scss/channel/_brand.css
View file @
c48160b
...
...
@@ -143,6 +143,10 @@
position
:
fixed
;
z-index
:
2
;
&.wechat
{
top
:
0
;
}
.search-box
{
position
:
relative
;
height
:
60px
;
...
...
@@ -363,6 +367,11 @@
}
.search-result
{
padding-top
:
165px
;
width
:
100%
;
padding-top
:
178px
;
&.wechat
{
padding-top
:
88px
;
}
}
}
...
...
Please
register
or
login
to post a comment