Authored by 陈轩

Merge branch 'master' into release/5.1

Showing 61 changed files with 260 additions and 152 deletions
... ... @@ -83,6 +83,7 @@ app.use((req, res, next) => {
try {
const user = require('./doraemon/middleware/user');
const subDomain = require('./doraemon/middleware/sub-domain');
const itemNameHandler = require('./doraemon/middleware/item-name-handler');
const setYohoData = require('./doraemon/middleware/set-yoho-data');
const errorHanlder = require('./doraemon/middleware/error-handler');
const setPageInfo = require('./doraemon/middleware/set-pageinfo');
... ... @@ -91,6 +92,7 @@ try {
// YOHO 前置中间件
app.use(subDomain());
app.use(itemNameHandler);
app.use(setYohoData());
app.use(user());
app.use(seo());
... ...
... ... @@ -7,9 +7,7 @@ const _ = require('lodash');
const helpers = global.yoho.helpers;
const crypto = global.yoho.crypto;
const SUB_DOMAIN = '.dev.yohobuy.com',
OLD_MAIN = '//m.yohobuy.com',
SITE_MAIN = '//m.dev.yohobuy.com';
const SITE_MAIN = '//m.yohobuy.com';
/**
* 仿php的strrpos
... ... @@ -60,7 +58,8 @@ const getShare = (code, shareTitle, shareDesc, shareImg) => {
* 过滤app的url
*/
const _getFilterUrl = url => {
url = url.replace('.m.yohobuy.com', SUB_DOMAIN).replace(OLD_MAIN, SITE_MAIN).replace('www.yohobuy.com', SITE_MAIN);
url = url.replace('www.yohobuy.com', SITE_MAIN);
if (strrpos(url, 'm.yohobuy.com') && !strrpos(url, 'sale.m.yohobuy.com') && !strrpos(url, 'cuxiao.m.yohobuy.com') &&
!strrpos(url, 'activity.m.yohobuy.com') && !strrpos(url, 'huodong.m.yohobuy.com') &&
strrpos(url, 'cdn.yoho.cn/myohobuy') && !strrpos(url, '/home/orders/pay')) {
... ... @@ -353,4 +352,4 @@ exports.receiveCoupon = (receiveData, uid) => {
}
return returnData;
});
};
};
\ No newline at end of file
... ...
... ... @@ -40,25 +40,28 @@ const getUserStatus = (param) => {
var dest = {};
dest.code = param.code;
dest.returnCode = param.data.returnCode;
dest.mobile = param.data.mobile;
if (param.data.returnCode === 0) {
dest.geted = true;
} else if (param.data.returnCode === 1) {
dest.wrongNumb = true;
} else if (param.data.returnCode === 2) {
dest.newUser = true;
} else if (param.data.returnCode === 8) {
dest.oldUserAskCouponOnceMore = true;
} else if (param.data.returnCode === 5) {
dest.vertifyWrong = true;
} else {
dest.ended = true;
}
if (param.data.newUser === 1) {
dest.newUser = true;
dest.returnCode = param && param.data && param.data.returnCode;
dest.mobile = param && param.data && param.data.mobile;
if (param && param.data) {
if (param.data.returnCode === 0) {
dest.geted = true;
} else if (param.data.returnCode === 1) {
dest.wrongNumb = true;
} else if (param.data.returnCode === 2) {
dest.newUser = true;
} else if (param.data.returnCode === 8) {
dest.oldUserAskCouponOnceMore = true;
} else if (param.data.returnCode === 5) {
dest.vertifyWrong = true;
} else {
dest.ended = true;
}
if (param.data.newUser === 1) {
dest.newUser = true;
}
dest.message = param.data.returnMsg;
}
dest.message = param.data.returnMsg;
// 清空变量,释放内存
param = {};
... ...
... ... @@ -6,7 +6,7 @@
<strong class="fz18">现金券</strong>
<p class="fz9 bold">CPOUPON</p>
<div class="pirbox absolute">
<em class="absolute"></em>0
<em class="absolute">&yen;</em>0
</div>
</div>-->
<div class="coupon-box chit0"></div>
... ...
... ... @@ -6,7 +6,7 @@
<strong class="fz18">现金券</strong>
<p class="fz9 bold">CPOUPON</p>
<div class="pirbox absolute">
<em class="absolute"></em>{{amount}}
<em class="absolute">&yen;</em>{{amount}}
</div>
<div class="count-not fz11 absolute"><hr class="fn-left"><hr class="fn-right">已送达您的账户</div>
</div>
... ...
... ... @@ -165,16 +165,15 @@ const tag = (req, res, next) => {
pageHeader: headerData,
module: 'guang',
page: 'index-editor',
title: tagTitle + ' | Yoho!Buy有货 | 潮流购物逛不停',
pageFooter: true
title: tagTitle + ' | Yoho!Buy有货 | 潮流购物逛不停'
};
let param = {
tag: req.query.query,
isApp: req.query.app_version || req.query.appVersion || false,
gender: req.query.gender || req.cookies._Channel && channels[req.cookies._Channel] || '1,3',
uid: req.user.uid,
udid: req.user.udid,
gender: req.query.gender || '1,3',
uid: req.user.uid || 0,
udid: req.sessionID,
type: req.query.type || 0
};
... ...
... ... @@ -288,7 +288,11 @@ const index = (req, res, next) => {
};
// guang双头部的问题 20160601
data.guang.author.url = helpers.https(`${detail.getAuthor.url}&openby:yohobuy={"action":"go.h5","params":{"param":{"id":"${detail.getAuthor.author_id}"},"share":"","id":${detail.getAuthor.author_id},"type":0,"islogin":"N","url":"${helpers.urlFormat('/author/index', {}, 'guang')}"}}`);
// 正确的URL
data.guang.author.url = helpers.https(`${detail.getAuthor.url}&openby:yohobuy={"action":"go.h5","params":{"param":{},"share":"","id":${detail.getAuthor.author_id},"type":0,"islogin":"N","url":"${detail.getAuthor.url}"}}`);
// 错误的URL
// data.guang.author.url = helpers.https(`${detail.getAuthor.url}&openby:yohobuy={"action":"go.h5","params":{"param":{"id":"${detail.getAuthor.author_id}"},"share":"","id":${detail.getAuthor.author_id},"type":0,"islogin":"N","url":"${helpers.urlFormat('/author/index', {}, 'guang')}"}}`);
}
let guang = data.guang;
... ...
... ... @@ -16,29 +16,59 @@ let channels = {
lifestyle: '4'
};
let yhChannel = {
boys: 1,
girl: 2
};
const getListData = (req, res, next) => {
let gender = req.query.gender || req.cookies._Channel && channels[req.cookies._Channel] || '1,3';
let recom = '4';
let all = '1';
let type = req.query.type;
let channel = req.cookies._Channel && yhChannel[req.cookies._Channel] || 1;
let isRecommend = '0';
let starBrand = '2';
let originalBrand = '3';
plustarModel.getListData(gender, recom, all).then((result) => {
if (type === '2') {
plustarModel.getBrandsData(gender, starBrand, originalBrand, channel, isRecommend).then((result) => {
res.render('plustar/list', {
module: 'guang',
page: 'plustar-list',
title: '明星原创',
pageHeader: headerModel.setNav({
navTitle: '明星原创'
}),
pageFooter: true,
ps: {
sName: '明星潮品',
pName: '原创潮牌',
star: result.star,
plus: result.plus
}
});
}).catch(next);
} else {
plustarModel.getListData(gender, recom, all).then((result) => {
res.render('plustar/list', {
module: 'guang',
page: 'plustar-list',
title: '国际优选',
pageHeader: headerModel.setNav({
navTitle: '国际优选'
}),
pageFooter: true,
ps: {
sName: '设计师',
pName: '经典潮牌',
star: result.star,
plus: result.plus
}
});
}).catch(next);
res.render('plustar/list', {
module: 'guang',
page: 'plustar-list',
title: '国际优选',
pageHeader: headerModel.setNav({
navTitle: '国际优选'
}),
pageFooter: true,
ps: {
sName: '设计师',
pName: '经典潮牌',
star: result.star,
plus: result.plus
}
});
}).catch(next);
}
};
const getDetailData = (req, res, next) => {
... ...
... ... @@ -142,10 +142,10 @@ const _article = (param) => {
page: param.page || 1,
uid: param.uid,
udid: param.udid,
sort_id: param.type === '0' ? param.type : '1',
sort_id: 0,
tag: param.tag ? param.tag : null,
author_id: param.authorId ? param.authorId : null,
limit: param.limit ? param.limit : null
//author_id: param.authorId ? param.authorId : null,
//limit: param.limit ? param.limit : null
}, {
cache: true,
code: 200
... ... @@ -279,13 +279,14 @@ const getTagEditor = (param) => {
}
};
if (result && result[0] && result[0].data && result[0].data.list) {
if (result && result[0] && result[0].data && result[0].data.list && result[0].data.list.artList) {
let inf = [];
let infoList = result[0].data.list.artList;
infoList.forEach(val => {
val.url = helpers.https(`${val.url}&openby:yohobuy={"action":"go.h5","params":{"param":{},"share":"","id":"","type":0,"islogin":"N","url":"${val.url}"}}`);
inf.push(guangProcess.formatArticle(val, true, false, true));
});
... ...
... ... @@ -39,7 +39,7 @@ const packageData = (id, isApp) => {
cache: true
}).then(data => {
// 接口要判断一下返回状态是否成功
if (data.code !== 200) {
if (data === '' && data.code !== 200) {
result.code = 400;
return result;
}
... ... @@ -109,28 +109,43 @@ const packageData = (id, isApp) => {
}
return Promise.all(promises).then(datas => {
let getArticleContent = datas[1].data;
if (datas) {
if (datas[1]) {
if (isApp && datas[4].data) {
let getArticleContent = datas[1].data;
let preCount = 0;
let i;
result.getArticleContent = getArticleContent;
for (i = 0; i < getArticleContent.length; i++) {
if (getArticleContent[i].singleImage || getArticleContent[i].text || getArticleContent[i].smallPic) {
preCount++;
}
if (isApp && datas[4] && datas[4].data) {
let preCount = 0;
let i;
for (i = 0; i < getArticleContent.length; i++) {
if (getArticleContent[i].singleImage || getArticleContent[i].text || getArticleContent[i].smallPic) {
preCount++;
}
}
getArticleContent.splice(preCount, 0, {weixinPublic: datas[4].data});
}
if (datas[0]) {
result.getAuthor = datas[0].data;
}
getArticleContent.splice(preCount, 0, {weixinPublic: datas[4].data});
}
result.getAuthor = datas[0].data;
result.getArticleContent = getArticleContent;
result.getBrand = datas[2].data;
if (datas.length === 5 && isApp || datas.length === 4 && !isApp) {
result.getOtherArticle = datas[3].data;
if (datas[2]) {
result.getBrand = datas[2].data;
}
if (datas.length === 5 && isApp || datas.length === 4 && !isApp) {
if (datas[3]) {
result.getOtherArticle = datas[3].data;
}
}
}
return result;
});
});
... ...
... ... @@ -9,11 +9,9 @@ const helpers = global.yoho.helpers;
const formaData = (data, gender) => {
let build = [];
// console.log(data)
_.forEach(data, function(val) {
// 多张图
if (val.data[1]) {
let imgs = [];
_.forEach(val.data, function(list) {
... ... @@ -34,7 +32,7 @@ const formaData = (data, gender) => {
}
// 单张图
if (val.data[0]) {
if (val.data[0] && !val.data[1]) {
_.forEach(val.data, function(list) {
build.push({
url: '/guang/plustar/brandinfo?id=' + val.id + '&gender=' + gender,
... ... @@ -48,15 +46,19 @@ const formaData = (data, gender) => {
return build;
};
const getContentData = (gender, type, channel, isRecommend) => {
let param = {
gender: gender,
brand_type: type,
yh_channel: channel
};
const getContentData = (gender, type) => {
if (isRecommend) {
param.is_recommend = isRecommend;
}
return serviceAPI.get('guang/api/v3/plustar/getlist', {
gender: gender,
brand_type: type
}).then((result) => {
return serviceAPI.get('guang/api/v3/plustar/getlist', param).then((result) => {
if (result && result.code === 200) {
// console.log(result)
return formaData(result.data.data.list[0].data, gender);
} else {
logger.error('列表 list data return code is not 200');
... ... @@ -74,6 +76,15 @@ const getListData = (gender, recom, all) => {
});
};
const getBrandsData = (gender, starBrand, originalBrand, channel, isRecommend) => {
return Promise.all([getContentData(gender, starBrand, isRecommend, channel), getContentData(gender, originalBrand, isRecommend, channel)]).then((result) => {
return {
star: result[0],
plus: result[1]
};
});
};
// 新品到着
const getNewProduct = (brandId, gender, url) => {
... ... @@ -97,7 +108,6 @@ const getNewProduct = (brandId, gender, url) => {
let obj = {};
let price;
// console.log(list)
if (index <= 5) {
let tag = [];
... ... @@ -270,5 +280,6 @@ const getDetailData = (id, uid, udid, gender, isApp, clientType) => {
module.exports = {
getListData,
getContentData,
getDetailData
getDetailData,
getBrandsData
};
... ...
... ... @@ -22,7 +22,7 @@
<div class="loading status hide">
正在加载...
</div>
<span class="no-more status">没有更多啦</span>
<span class="no-more status hide">没有更多啦</span>
</div>
{{#if tag}}
... ...
... ... @@ -13,7 +13,6 @@
<div class="swiper-pagination"></div>
</div>
{{/if}}
{{# infos}}
{{> index/info}}
{{/ infos}}
\ No newline at end of file
... ...
... ... @@ -90,9 +90,9 @@
<span class="reco-name">{{name}}</span>
</p>
<p class="price">
<span class="sale-price {{^price}}no-price{{/price}}">{{salePrice}}</span>
<span class="sale-price {{^price}}no-price{{/price}}">&yen;{{salePrice}}</span>
{{#price}}
<span class="market-price">{{.}}</span>
<span class="market-price">&yen;{{.}}</span>
{{/price}}
<a class="check-detail" href={{url}}>
查看详情
... ...
... ... @@ -49,7 +49,8 @@ exports.addressAct = (req, res, next) => {
module: 'home',
page: 'address-act',
pageHeader: headerModel.setNav({
navTitle: result.navTitle
navTitle: result && result.navTitle,
navBtn: false
}),
title: result.navTitle
};
... ... @@ -161,7 +162,8 @@ exports.addressModify = (req, res, next) => {
module: 'home',
page: 'address-modify',
pageHeader: headerModel.setNav({
navTitle: '选择地址'
navTitle: '选择地址',
navBtn: false
}),
title: '选择地址',
};
... ...
... ... @@ -9,11 +9,12 @@ exports.index = (req, res, next) => {
module: 'home',
page: 'help',
pageHeader: headerModel.setNav({
navTitle: '帮助中心'
navTitle: '帮助中心',
navBtn: false
}),
title: '帮助中心',
pageFooter: true,
iHelp: result,
iHelp: result
});
}).catch(next);
};
... ... @@ -24,7 +25,8 @@ exports.helpDetail = (req, res, next) => {
module: 'home',
page: 'help-detail',
pageHeader: headerModel.setNav({
navTitle: req.query.name
navTitle: req.query.name,
navBtn: false
}),
title: req.query.name,
pageFooter: true,
... ...
... ... @@ -65,7 +65,7 @@ let ajaxCurrencyDetail = (req, res, next) => {
res.render('ajax-currency-detail', {
layout: false,
coinlist: result.coinlist
coinlist: _.get(result, 'coinlist', [])
});
}).catch(next);
};
... ...
... ... @@ -109,7 +109,7 @@ const favProduct = (uid, page, limit) => {
return resu;
} else {
logger.error('收藏商品 cood 不是 200');
logger.error('fav goods code no 200');
return {
total: 0,
};
... ... @@ -192,7 +192,7 @@ const favfavBrand = (uid, page, limit) => {
return resu;
} else {
logger.error('收藏品牌 cood 不是 200');
logger.error('fav brand code no 200');
return {
total: 0,
};
... ...
... ... @@ -15,7 +15,7 @@ const yohoCoin = (uid) => {
if (result && result.code === 200) {
return camelCase(result.data);
} else {
logger.error('youhocoin cood 不是 200');
logger.error('youhocoin code no 200');
}
});
};
... ... @@ -59,6 +59,12 @@ const currencyDetail = (uid, page, limit) => {
if (result && result.code === 200) {
let total = parseInt(result.data.page_total, 10) + 1;
_.forEach(_.get(result, 'data.coinlist', []), perCoin => {
if (perCoin.num > 0) {
perCoin.num = '+' + perCoin.num;
}
});
if (page && page <= total) {
return yohoCoin(uid).then(list => {
... ... @@ -79,7 +85,7 @@ const currencyDetail = (uid, page, limit) => {
}
} else {
logger.error('youholist cood 不是 200');
logger.error('youholist code no 200');
}
});
... ...
... ... @@ -290,7 +290,7 @@ const orderDetailData = (uid, orderCode) => {
// return orderDetail;
} else {
logger.error('详情信息 返回不是200');
logger.error('detail info return no 200');
return {};
}
... ...
... ... @@ -7,12 +7,9 @@
'use strict';
const logger = global.yoho.logger;
const api = global.yoho.API;
const serviceAPI = global.yoho.ServiceAPI;
const camelCase = global.yoho.camelCase;
const _ = require('lodash');
const config = global.yoho.config;
const helpers = global.yoho.helpers;
const suggestData = (udid, page, limit) => {
... ... @@ -22,10 +19,10 @@ const suggestData = (udid, page, limit) => {
limit: limit
}).then((result) => {
if (result && result.code === 200) {
if (result && result.code === 200 && result.data) {
_.forEach(result.data.list, function(data) {
data = _.assign(data, {
Object.assign(data, {
good: data.is_reliable === 1,
bad: data.is_reliable === 2,
none: data.is_reliable === 0
... ... @@ -33,7 +30,7 @@ const suggestData = (udid, page, limit) => {
});
return camelCase(result.data.list);
} else {
logger.error('收藏商品 cood 不是 200');
logger.error('fav goods code no 200');
}
});
};
... ...
... ... @@ -52,6 +52,7 @@ router.get('/locationList', auth, addressController.locationList); // 异步获å
router.get('/orders', auth, orderController.order); // 订单列表
router.get('/getOrders', auth, orderController.getOrders); // 获取订单列表数据
router.get('/orderDetail', auth, orderDetailController.orderDetailData); // 订单详情页
router.get('/orders/detail', auth, orderDetailController.orderDetailData); // 订单详情页兼容老的
router.get('/delOrder', auth, orderDetailController.delOrder); // 删除订单
router.get('/readd', auth, orderDetailController.readdData); // 再次购买
router.get('/cancelOrder', auth, orderDetailController.cancelOrder); // 取消订单
... ...
... ... @@ -4,7 +4,7 @@
<p class="title">{{message}}</p>
<p class="time">{{date}}</p>
<div class="count">
+{{num}}
{{num}}
</div>
</div>
</li>
... ...
... ... @@ -21,7 +21,7 @@
{{# banner}}
{{# data}}
<a href="{{url}}">
<img src="{{image src 640 200 2}}" alt="img">
<img src="{{image src 640 200}}" alt="img">
</a>
{{/ data}}
{{/ banner}}
... ...
... ... @@ -23,7 +23,7 @@
{{# productList}}
<li class="swiper-slide">
<a href="{{link}}">
<img class="swiper-lazy" data-src="{{image imgUrl 97 150}}" alt=""/>
<img class="swiper-lazy" data-src="{{image imgUrl 235 314}}" alt=""/>
</a>
<div class="brand-product">
<div class="{{# discount}}price-discount{{/ discount}}">
... ...
<div class="iHelp">
<div class="i-help">
<ul>
{{#iHelp}}
<li><a href="//m.yohobuy.com/home/helpDetail?code={{code}}&name={{name}}"><span>{{name}}</span><i class="iconfont num">&#xe604;</i></a></li>
... ...
... ... @@ -7,11 +7,11 @@
<ul class="cost block">
<li>
年度累计金额:
<span>{{costOfThisYear}}</span>
<span>&yen;{{costOfThisYear}}</span>
</li>
<li>
历史消费总金额:
<span>{{sumCost}}</span>
<span>&yen;{{sumCost}}</span>
</li>
</ul>
... ...
... ... @@ -7,7 +7,7 @@
您已升级至最高的等级啦!
</p>
<p class="sum-cost">
年度累计金额<span> {{costOfThisYear}}</span>
年度累计金额<span> &yen;{{costOfThisYear}}</span>
</p>
<div class="progresser">
<div class="outer"></div>
... ... @@ -24,11 +24,11 @@
<span class="vip-icon vip-2"></span>
</p>
<p class="grade-desc">
还差<span class="cost-gap">{{costGap}}</span>就可以升级为白金会员!
还差<span class="cost-gap">&yen;{{costGap}}</span>就可以升级为白金会员!
<span class="sub-desc">(VIP金额累计需订单成功签收满15天并无退换货)</span>
</p>
<p class="sum-cost">
年度累计金额<span> {{costOfThisYear}}</span>
年度累计金额<span> &yen;{{costOfThisYear}}</span>
</p>
<div class="progresser">
<div class="outer"></div>
... ... @@ -37,7 +37,7 @@
金卡会员
</span>
<span class="beacon beacon-max">白金卡会员</span>
<span class="cost-limit">5000.00</span>
<span class="cost-limit">&yen;5000.00</span>
</div>
{{/if}}
... ... @@ -47,11 +47,11 @@
<span class="vip-icon vip-1"></span>
</p>
<p class="grade-desc">
还差<span class="cost-gap">{{costGap}}</span>就可以升级为金卡会员!
还差<span class="cost-gap">&yen;{{costGap}}</span>就可以升级为金卡会员!
<span class="sub-desc">(VIP金额累计需订单成功签收满15天并无退换货)</span>
</p>
<p class="sum-cost">
年度累计金额<span> {{costOfThisYear}}</span>
年度累计金额<span> &yen;{{costOfThisYear}}</span>
</p>
<div class="progresser">
<div class="outer"></div>
... ... @@ -60,7 +60,7 @@
银卡会员
</span>
<span class="beacon beacon-max">金卡会员</span>
<span class="cost-limit">2000.00</span>
<span class="cost-limit">&yen;2000.00</span>
</div>
{{/if}}
... ... @@ -70,11 +70,11 @@
<span>普通会员</span>
</p>
<p class="grade-desc">
还差<span class="cost-gap">{{costGap}}</span>就可以升级为银卡会员!
还差<span class="cost-gap">&yen;{{costGap}}</span>就可以升级为银卡会员!
<span class="sub-desc">(VIP金额累计需订单成功签收满15天并无退换货)</span>
</p>
<p class="sum-cost">
年度累计金额<span> {{costOfThisYear}}</span>
年度累计金额<span> &yen;{{costOfThisYear}}</span>
</p>
<div class="progresser">
<div class="outer"></div>
... ... @@ -83,6 +83,6 @@
普通
</span>
<span class="beacon beacon-max">银卡会员</span>
<span class="cost-limit">600.00</span>
<span class="cost-limit">&yen;600.00</span>
</div>
{{/if}}
... ...
... ... @@ -34,7 +34,7 @@ const getAreaDataAsync = () => {
return result;
} else {
logger.error('获取地区数据返回 code 不是 200');
logger.error('获取地区数据返回 code no 200');
return [];
}
});
... ...
... ... @@ -35,7 +35,8 @@ const newGoods = (req, res, next) => {
dayLimit: 1,
discount: '',
cartUrl: helpers.urlFormat('/cart/index/index', null),
pageFooter: true
pageFooter: true,
showDownloadApp: true
});
}).catch(next);
};
... ...
... ... @@ -178,7 +178,7 @@ let consults = (params) => {
data.consults = result[1].list;
}
data.showReadMore = result[1].list.length > 2;
data.showReadMore = _.get(result[1], 'list.length', 0) > 2;
return data;
});
... ...
... ... @@ -929,7 +929,7 @@ let _getShopsInfo = (brandId) => {
}, {
cache: true
}).then(shops => {
if (shops.code === 200) {
if (shops && shops.code === 200) {
return _processShopsInfo(shops.data);
}
... ...
... ... @@ -596,8 +596,7 @@ const getBrandIntro = (brandId, uid) => {
method: 'app.brand.getBrandIntro',
brand_id: brandId
}, param), {
code: 200,
cache: true
code: 200
}).then(result => {
if (result && result.data) {
let list = result.data;
... ...
... ... @@ -71,7 +71,7 @@ const getNewFocus = (channel) => {
const getSearchData = (params) => {
return _searchGoods(params).then((result) => {
if (result && result.code === 200) {
return productProcess.processProductList(result.data.product_list || []);
return productProcess.processProductList(result.data.product_list || [], {showTags: false});
} else {
logger.error('get product search api return code is not 200');
return [];
... ...
... ... @@ -72,7 +72,7 @@ const mayLike = (uid, page, limit, gender, udid, recPos, channel) => {
}
} else {
logger.error('mayLike cood 不是 200');
logger.error('mayLike code no 200');
}
});
};
... ... @@ -97,7 +97,7 @@ const mayLikeKids = (page, limit, channel) => {
}
} else {
logger.error('mayLikeKids cood 不是 200');
logger.error('mayLikeKids code no 200');
}
});
};
... ...
... ... @@ -91,6 +91,10 @@ const _searchGoods = (params) => {
delete params.filter_poolId;
}
if (params.brand) {
method = 'app.search.brand';
}
// 排除基本筛选项默认值为0的对象
for (let str in params) {
if (str !== 'order' && params[str] === '0' || params[str] === null) {
... ...
... ... @@ -104,6 +104,7 @@ router.get('/search/search', search.search);
// 品类
router.get('/index/index', list.category);
router.get('/list/index', list.category); // 兼容 PC 的链接
// 品牌 | 店铺
router.get('/index/brand', list.brand);
... ... @@ -122,6 +123,7 @@ router.get('/opt/favoriteBrand', list.favoriteBrand);
// 新品到着
router.get('/new', news.newGoods);
router.get('/list/new', news.newGoods); // 兼容 PC 的链接
router.get('/new/selectNewSale', news.selectNewSale);
router.get('/new/filter', news.filter);
... ...
... ... @@ -9,7 +9,7 @@
</div>
<div class="price">
<span class="sale-price {{^price}}no-price{{/price}}">¥{{salePrice}}</span>
{{#price}}<span class="old-price">{{.}}</span>{{/price}}
{{#price}}<span class="old-price">&yen;{{.}}</span>{{/price}}
</div>
<div class="swiper-lazy-preloader"></div>
</a>
... ...
... ... @@ -41,3 +41,5 @@
{{> common/suspend-cart}}
</div>
{{download-app}}
... ...
... ... @@ -16,12 +16,12 @@ module.exports = {
siteUrl: '//m.yohobuy.com',
assetUrl: '//localhost:5001',
domains: {
api: 'http://api.yoho.cn/',
// api: 'http://api.yoho.cn/',
api: 'http://api-test3.yohops.com:9999/',
service: 'http://service.yoho.cn/',
liveApi: 'http://api.live.yoho.cn/',
singleApi: 'http://single.yoho.cn/'
// api: 'http://api-test1.yohops.com:9999/',
// service: 'http://service-test1.yohops.com:9999/',
// liveApi: 'http://testapi.live.yohops.com:9999/',
// singleApi: 'http://api-test1.yohops.com:9999/'
... ...
... ... @@ -59,6 +59,6 @@ exports.serverError = () => {
isErr: true
});
}
next();
next(err);
};
};
... ...
/**
* 商品详情页部分商品名称重置,防止express内部decodeURIComponent不能解析url出错
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2016/8/23
*/
module.exports = function(req, res, next) {
if (/^\/product\/pro_/.test(req.url)) {
req.url = req.url.replace(/\/pro_([\d]+)_([\d]+)\/(.*)/, '/pro_$1_$2/yoho-replace.html');
}
next();
};
... ...
... ... @@ -5,6 +5,7 @@
*/
'use strict';
const helpers = global.yoho.helpers;
module.exports = () => {
return (req, res, next) => {
... ... @@ -31,6 +32,8 @@ module.exports = () => {
res.set('Access-Control-Allow-Origin', '*');
}
res.locals.cartUrl = helpers.urlFormat('/cart/index/index');
next();
};
};
... ...
<div id="suspend-cart" class="suspend-cart">
<a href={{cartUrl}}>
<a href="{{@root.cartUrl}}">
<span class="iconfont">&#xe62c;</span>
</a>
<span class="cart-count hide">0</span>
</div>
\ No newline at end of file
</div>
... ...
... ... @@ -14,13 +14,13 @@
<a href="{{url}}" class="nav-sub-right">{{text}}</a>
{{/shopPage}}
{{#currencyPage}}
<a href="/home/helpDetail?code=20151230-102233&caption=有货币介绍" class="iconfont nav-home">&#xe639;</a>
<a href="/home/helpDetail?code=20151230-102233&caption=有货币介绍&name=有货币介绍" class="iconfont nav-home">&#xe639;</a>
{{/currencyPage}}
{{#currencyDetailPage}}
<a href="/home/helpDetail?code=20111130-152530&caption=如何使用有货币支付" class="iconfont nav-home">&#xe639;</a>
<a href="/home/helpDetail?code=20111130-152530&caption=如何使用有货币支付&name=如何使用有货币支付" class="iconfont nav-home">&#xe639;</a>
{{/currencyDetailPage}}
{{#installmentPage}}
<a href="/home/helpDetail?code=20151230-102233&caption=有货分期" class="iconfont nav-home">&#xe639;</a>
<a href="/home/helpDetail?code=20151230-102233&caption=有货分期&name=有货分期" class="iconfont nav-home">&#xe639;</a>
{{/installmentPage}}
{{#navPhone}}
<a href="{{.}}" class="iconfont nav-home">&#xe641;</a>
... ...
{
"name": "m-yohobuy-node",
"version": "5.0.6",
"version": "5.0.9",
"private": true,
"description": "A New Yohobuy Project With Express",
"repository": {
... ...
... ... @@ -78,6 +78,10 @@ $categoryContainer.on('touchend', function(e) {
$subLevel.not('.hide').addClass('hide');
$subLevel.eq(index).removeClass('hide');
}
if ($this.find('a').attr('href')) {
location.href = $this.find('a').attr('href');
}
});
$categoryContainer.find('.primary-level').on('touchstart touchend touchcancel', 'li', function() {
... ...
... ... @@ -128,11 +128,9 @@ module.exports = function(specificGender) {
var PRDID = [];
if (data === ' ' || data === '') {
searching = false;
searching = true;
loading.hideLoadingMask();
$('.maybe-like').hide();
// 有货币页面不加载底部
if (gender && !specificGender) {
gender = gender.substr(0, 3);
... ...
... ... @@ -122,7 +122,7 @@ function rePosFooter() {
winH = Math.min($(window).height(), window.screen.availHeight);
if ($('body').height() <= winH - parseInt($footer.css('height'), 0)) {
if ($('body').height() <= winH) {
$footer.addClass('bottom');
} else {
$footer.removeClass('bottom');
... ... @@ -198,6 +198,7 @@ function reMarginFooter(fixedElement) {
a.src = j;
m.parentNode.insertBefore(a, m);
}(window, document, 'script', (document.location.protocol === 'https:' ? 'https' : 'http') + '://cdn.yoho.cn/yas-jssdk/1.0.17/yas.js', '_yas'));
(function() {
var uid = getUid();
... ...
... ... @@ -215,7 +215,7 @@ function loadMore($container, opt, url) {
success: function(data) {
var $newItems;
if (data === ' ') {
if (data === '') {
opt.end = true;
searching = false;
... ...
... ... @@ -3,6 +3,8 @@ var $ = require('yoho-jquery'),
var page = 1;
var flag = true;
require('../common');
loading.showLoadingMask();
function ajaxCurrencyDetail(curPage) {
... ...
... ... @@ -13,3 +13,7 @@ function getGender() {
}
require('../channel/maybe-like')(getGender());
if ($('#goods-list').length === 0) {
$('.maybe-like').hide();
}
... ...
... ... @@ -94,6 +94,10 @@ function setSubClassify($this) {
$shower.removeClass('default');
}
if (hCbFn) {
hCbFn();
}
return $sub;
}
... ...
... ... @@ -33,6 +33,8 @@ var now = new Date(),
month = now.getMonth() + 1,
date = now.getDate();
require('../../common/footer');
var $listNav = $('#list-nav'),
// 导航数据信息
... ... @@ -221,7 +223,7 @@ function search(opt) {
break;
}
if (data === ' ') {
if (data === ' ' || data === '') {
nav.end = true;
if (nav.reload) {
$container.html(noResult);
... ...
... ... @@ -192,7 +192,7 @@ function getQueryString(name) {
shopId = getQueryString('shop_id');
sort = getQueryString('sort');
outlets = getQueryString('outlets');
age_level = getQueryString('ageLevel');
age_level = getQueryString('age_level');
app_type = getQueryString('app_type');
msort = getQueryString('msort');
misort = getQueryString('misort');
... ... @@ -218,7 +218,6 @@ function search(opt) {
}
if (opt) {
// 筛选项变更则重置reload为true
for (att in navInfo) {
if (navInfo.hasOwnProperty(att)) {
... ... @@ -255,7 +254,7 @@ function search(opt) {
color: opt.id
};
break;
case 'age_level':
case 'ageLevel':
ext = {
age_level: opt.id
};
... ...
.iHelp {
.i-help {
width: 100%;
height: auto;
overflow: hidden;
... ... @@ -29,7 +29,7 @@
}
span {
width: 85%;
width: 92%;
height: 100%;
overflow: hidden;
float: left;
... ... @@ -43,7 +43,7 @@
}
}
.deal_main {
.deal-main {
margin: 0.5rem 3%;
font-size: 14.4PX;
width: 94%;
... ...
... ... @@ -223,7 +223,7 @@
height: auto;
color: #fff;
line-height: 40px;
font-size: 14px;
font-size: 14PX;
}
}
}
... ...
... ... @@ -30,7 +30,7 @@
.price {
margin: 0.3rem 0;
font-size: 16px;
font-size: 16PX;
}
.sale-price {
... ...
... ... @@ -107,7 +107,7 @@
font-size: 24px;
border-bottom: 1px solid #e0e0e0;
padding-bottom: 20px;
height: 120px;
height: 140px;
overflow: hidden;
position: relative;
... ... @@ -288,7 +288,7 @@
margin: 0 30px;
.swiper-slide {
width: 225px;
width: 255px;
height: 100%;
float: left;
padding-right: 30px;
... ...
... ... @@ -307,6 +307,7 @@
.num {
color: #e0e0e0;
float: right;
font-size: 16PX;
}
}
}
... ...
... ... @@ -124,14 +124,13 @@
.create-new-suggest {
display: block;
width: 100%;
height: 88px;
height: 150px;
line-height: 88px;
text-align: center;
font-size: 30px;
border-top: 30px solid #f0f0f0;
border-bottom: 30px solid #f0f0f0;
position: relative;
height: 88px;
.list-item {
padding: 0 35px;
... ...