Authored by 沈志敏

Merge branch 'develop' of git.yoho.cn:fe/yohoblk-wap into develop

... ... @@ -8,7 +8,7 @@ Name | Path | Note
全部分类 | /cate-all |
商品列表 | /product/list?sort=1 |
品牌店铺 | /product/shop/{domain} |
品牌店铺分享页面 | /brand/share/{domain} |
品牌店铺分享页面 | /product/shop/{domain}/share |
商品详情 | /product/{productId} |
新品抢先看 | /product/new |
搜索页 | /product/search?query=xxx |
... ...
... ... @@ -16,7 +16,7 @@ module.exports = {
res.render('shop/index', {
module: 'product',
page: 'shop',
domain: req.params[0]
domain: req.params.domain
});
},
... ... @@ -77,7 +77,7 @@ module.exports = {
res.render('shop/share', {
module: 'product',
page: 'shop-share',
domain: req.params[0]
domain: req.params.domain
});
}
};
... ...
... ... @@ -112,7 +112,7 @@ const getBrandShopGoodsData = params => {
prettyFilter(subResult.data.filter);
finalResult = {
data: {
productList: processProductList(subResult.data.product_list),
productList: processProductList(subResult.data.product_list, {gender: params.gender}),
filter: subResult.data.filter,
page: subResult.data.page,
pageTotal: subResult.data.page_total
... ...
... ... @@ -33,11 +33,11 @@ router.get('/product/list.json', productList.fetchProducts);
const shop = require(`${cRoot}/shop`);
router.get('/brand', shop.index); // 品牌 集合页
router.get(/\/brand\/share\/(.*)/, shop.shopShare); // 品牌店铺分享页面
router.get('/product/shop/info.json', shop.getShopInfo); // 店铺介绍
router.get('/product/shop/goods.json', shop.getBrandShopGoods); // 店铺商品列表
router.post('/product/shop/collect.json', shop.collectShop); // 收藏品牌店铺
router.get('/product/shop/(.*)/', shop.index); // 品牌店铺页
router.get('/product/shop/:domain/', shop.index); // 品牌店铺页
router.get('/product/shop/:domain/share', shop.shopShare); // 品牌店铺页
// 商品详情controller
const detail = require(`${cRoot}/detail`);
... ... @@ -51,6 +51,7 @@ router.get(/\/product\/cart-count.json/, detail.getCartCount);
router.get(/\/product\/search_product\.json/, detail.search);
// alias: TODO: 测试完成 删除一下router,并更新资源位
router.get(/\/brand\/share\/(.*)/, shop.shopShare); // 品牌店铺分享页面
router.get(/\/item\/([\d]+)(.*)\.html/, detail.index); // 商品详情routers
router.get(/\/brand\/(.*)/, shop.index); // 店铺首页
... ...
... ... @@ -274,7 +274,8 @@ const intercept = (url) => {
// 首页
if (/\/$/.test(path)) {
return yoho.goTab({
index: 0
index: 0,
url: /^(https?:)?\/\//i.test(url) ? url : origin + url
});
}
... ...
... ... @@ -50,7 +50,7 @@ Vue.filter('clothingGenderIdentity', (value) => {
* @param value brand domain
*/
Vue.filter('brandUrl', (value) => {
return `/brand/${value}`;
return `/product/shop/${value}`;
});
/**
... ...
... ... @@ -182,6 +182,8 @@
border-bottom: 1px solid #e6e6e6;
padding-left: 20px;
user-select: none;
white-space: nowrap;
overflow-y: auto;
&.highlight {
background: #eee;
... ...
... ... @@ -7,10 +7,14 @@
</div>
<div class="filter-params">
<ul class="filter-cates">
<li class="filter-cate" v-for="classify in config" v-if="showCate($key, classify)" @click="entrySub($key)">
<li class="filter-cate"
v-for="classify in itemArr"
v-if="config[classify] && showCate(classify, config[classify])"
@click="entrySub(classify)"
>
<i class="icon icon-right right"></i>
<span class="filter-cate-label">{{$key | filter-en-cn }}</span>
<span class="filter-cate-val">{{showLabel($key)}}</span>
<span class="filter-cate-label">{{classify | filter-en-cn }}</span>
<span class="filter-cate-val">{{showLabel(classify)}}</span>
</li>
</ul>
</div>
... ... @@ -39,11 +43,9 @@
},
data: function() {
return {
// 选择的值
params: {},
// 确定的值
selected: {},
itemArr: ['gender', 'ageLevel', 'brand', 'groupSort', 'color', 'size', 'priceRange', 'discount','style'],
params: {}, // 选择的值
selected: {}, // 确定的值
subType: ''
};
... ...
... ... @@ -16,31 +16,31 @@
</div>
</div>
<div class="show-box no-padding" v-if="recommendProducts">
<div class="show-box no-padding" v-if="recommendProducts && recommendProducts.length">
<h2>相关推荐</h2>
<product-list :data="recommendProducts"></product-list>
</div>
<div class="brand-list show-box" v-if="brands">
<div class="brand-list show-box" v-if="brands && brands.length">
<h2>相关品牌</h2>
<ul>
<li v-for="item in brands">
<a :href="item.url"><img :src="item.thumb"></a>
<a :href="item.brandDomain | brandUrl"><img :src="item.thumb"></a>
</li>
</ul>
</div>
<div class="show-box" v-if="other && other.length > 0">
<div class="show-box" v-if="other && other.length">
<h2>相关文章</h2>
<div class="other-box" v-for="item in other">
<div>
<div class="image-box">
<a :href="item.url">
<a :href="`/editorial/${item.id}.html`">
<img :src="item.thumb | resize 213 134"/>
</a>
</div>
<h3><a :href="item.url">{{item.title}}</a></h3>
<h3><a :href="`/editorial/${item.id}.html`">{{item.title}}</a></h3>
<div class="sub-time">
<span class="icon icon-timeshare"></span><span class="label">{{article.publishTime | formatUnixTime 'MM.DD HH:mm'}}</span>
</div>
... ... @@ -98,7 +98,6 @@
.text-block {
padding: 30px;
}
}
.other-box {
... ...
... ... @@ -2,16 +2,16 @@
<div class="top-nav">
<navbar>
<template slot="right">
<a class="right-button" href="javascript:void(0);" @click="like()">
<a class="right-button no-intercept" href="javascript:void(0);" @click="like()">
<span class="icon icon-like" :class=""></span>
{{likeCount}}
</a>
<a class="right-button" href="javascript:void(0);" @click="favorite()">
<a class="right-button no-intercept" href="javascript:void(0);" @click="favorite()">
<span class="icon" :class="{ 'icon-love': !isFavorite, 'icon-love-solid': isFavorite}"></span>
</a>
<a class="right-button" href="javascript:void(0);" @click="share()">
<a class="right-button no-intercept" href="javascript:void(0);" @click="share()">
<span class="icon icon-share"></span>
</a>
</template>
... ... @@ -75,12 +75,13 @@
}, (results)=> {
const result = results[0], misc = results[1];
if (result && result.code === 200) {
// TODO:
} if (result && result.code === 403) {
// if (result && result.code === 200) {
// // TODO:
// }
if (result && result.code === 403) {
// 未登录
yoho.goLogin('', function() {
this.toggleFavorite();
yoho.goLogin('', () => {
this.favorite();
}, function() {
tip('登录失败');
});
... ...
... ... @@ -86,7 +86,7 @@
this.shareData = {
title: result.shopName,
des: shareSubTitle,
url: location.origin + '/brand/share/' + $shop.data('domain'),
url: location.origin + '/product/shop/' + $shop.data('domain')+'/share',
img: result.shopBg,
isBlkShop: result.isBlkShop,
domain: locationQuery.domain,
... ...
... ... @@ -35,6 +35,10 @@ const _procProductImg = (product, genderVal) => {
module.exports = (list, options) => {
const pruductList = [];
if (!options.gender) {
options.gender = '';
}
options = Object.assign({
showTags: true,
showNew: true,
... ...