Authored by 沈志敏

wap页头微信中优化

... ... @@ -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
}
});
});
};
... ...
... ... @@ -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 = [];
... ...
<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">&#xe60f;</i>
... ... @@ -9,7 +9,7 @@
</div>
</form>
</div>
<div class="search-result">
<div class="search-result {{#if isWechat}} wechat {{/if}}">
</div>
</div>
... ...
... ... @@ -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;
}
}
}
... ...