Authored by yyq

店铺搜索跳转

... ... @@ -128,6 +128,9 @@ exports.shopList = (req, res, next) => {
page: 'shop',
shopId: shopId
});
if (req.query.query) {
result.shopKey = req.query.query;
}
res.render('list/shop-list', result);
}).catch(next);
};
... ...
... ... @@ -12,7 +12,6 @@ const helpers = global.yoho.helpers;
const newProductsName = '新品上架 NEW';
const hotProductsName = '人气单品 HOT';
const shopRecommentName = '经典推荐';
const shopListUrl = '/product/shoplist';
/**
... ... @@ -109,6 +108,7 @@ const shopTopBanner = (data) => {
return {
shopTopBanner: {
bannerHeight: 200,
banner: `${src}${str}imageView2/1/w/{width}/h/{height}`,
detailSrc: data[0].detailSrc || '',
isShowShopName: data[0].isShowShopName === 'Y'
... ... @@ -202,7 +202,7 @@ const recommend = (data) => {
return {
recommend: {
title: dest[0].title || shopRecommentName,
title: dest[0].title,
list: dest
}
};
... ... @@ -225,6 +225,7 @@ const brandBrowse = (data, params) => {
url: helpers.urlFormat(shopListUrl, {
shopId: _.get(params, 'shopId', ''),
brand: value.id,
title: value.title,
navBar: 1
}),
brandName: value.brandName,
... ... @@ -233,7 +234,7 @@ const brandBrowse = (data, params) => {
});
resData.brandBrowse = {
title: '品牌集合',
title: list[0].title,
list: list
};
}
... ... @@ -262,7 +263,7 @@ const hotRecommend = (data) => {
});
resData.hotRecommend = {
title: title || '热销推荐',
title: title,
list: list
};
}
... ...
{{# shopTopBanner}}
<div class="shop-banner">
<div class="banner-img" style="height: {{bannerHeight}}px;background: url({{image banner 1150 150}})">
<div class="banner-img" style="height: {{bannerHeight}}px;background: url({{image banner 1150 bannerHeight}})">
<div class="banner-mark"></div>
</div>
{{#if isShowShopName}}
... ...
<div class="shop-search">
<form action="//search.yohobuy.com" method="get" id="shop-search-form">
<form action="/product/shoplist" method="get" id="shop-search-form">
<span>
<input type="hidden" name="shop" value="{{shopId}}">
<input id="shop-query-key" type="text" name="query" class="shop-query-key" autocomplete="off" x-webkit-speech="" lang="zh-CN" placeholder="关键词搜索">
<input type="hidden" name="shopId" value="{{shopId}}">
<input id="shop-query-key" type="text" name="query" class="shop-query-key" autocomplete="off" x-webkit-speech="" lang="zh-CN" placeholder="关键词搜索"{{# shopKey}} value="{{.}}"{{/ shopKey}}>
</span>
<span class="iconfont shop-query-submit">&#xe60f;</span>
</form>
... ...
{{#brandBrowse}}
<div class="brand-collect left-modular">
<h2 class="title">{{title}}</h2>
{{# title}}<h2 class="title">{{.}}</h2>{{/ title}}
<ul class="left-list">
{{#each list}}
<li class="{{#if cur}} on {{/if}}"><a href="{{url}}">{{brandName}}</a></li>
... ... @@ -11,7 +11,7 @@
{{#recommend}}
<div class="classic-recommend left-modular">
<h2 class="title">{{title}}</h2>
{{# title}}<h2 class="title">{{.}}</h2>{{/ title}}
<ul class="left-list">
{{#each list}}
<li>
... ... @@ -34,7 +34,7 @@
{{#hotRecommend}}
<div class="sell-recommend left-modular">
<h2 class="title">{{title}}</h2>
{{# title}}<h2 class="title">{{.}}</h2>{{/ title}}
<ul class="left-list">
{{#each list}}
<li>
... ...

426 Bytes | W: | H:

275 Bytes | W: | H:

  • 2-up
  • Swipe
  • Onion skin
... ... @@ -11,7 +11,7 @@ var product = require('./index/product');
var $shopIntro = $('.shop-intro'),
$shopCollect = $('.shop-collect'),
$searchForm = $('#shop-search-form'),
$sliderLeft = $('.slider-left'),
$allGoods = $('.all-goods'),
$fixedArea = $allGoods.find('.fixed-area'),
... ... @@ -46,6 +46,10 @@ $('.close-btn, .mask').on('click', function() {
$('.mask').hide();
});
$('.shop-query-submit').on('click', function() {
$searchForm.submit();
});
// 收藏店铺
function colloectAction() {
... ...
... ... @@ -528,6 +528,14 @@
box-sizing: border-box;
margin-top: 5px;
padding-left: 14px;
display: block;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
&:first-child {
margin-top: 0;
}
a {
color: #000;
... ...