Authored by zhangxiaoru

合并master 解决冲突

... ... @@ -163,7 +163,7 @@ let shopRecom = (req, res, next) => {
}).then(result => {
res.send(result);
}).catch(next);
}
};
/**
* 获取用户vip信息
... ... @@ -187,12 +187,12 @@ let userVip = (req, res, next) => {
res.json({
code: 500,
msg: '出错了',
})
});
}
});
}
}
};
module.exports = {
switchChannel,
... ...
... ... @@ -31,5 +31,5 @@ router.get('/brands/delBrandHistory', brandController.delBrandHistory); // 删
// 5.2新楼层功能
router.post('/channel/shopRecom', channel.shopRecom); // 店铺推荐收藏状态
router.post('/channel/userVip', channel.userVip)
router.post('/channel/userVip', channel.userVip);
module.exports = router;
... ...
... ... @@ -31,9 +31,9 @@ const index = (req, res, next) => {
copyright: '2015 yoho.inc',
generator: 'http://m.yohobuy.com',
updated: new Date(),
})
});
_.forEach(result, item => {
item.url = item.url.indexOf('http') >= 0 ? item.url : 'http://'+item.url
item.url = item.url.indexOf('http') >= 0 ? item.url : 'http://' + item.url;
feed.addItem({
title: item.title,
link: `${item.url}&ref=rss`,
... ... @@ -41,13 +41,13 @@ const index = (req, res, next) => {
author: [{
name: (item.author && item.author.name) || ' '
}],
date: new Date(item.publishTimeLong && parseFloat(item.publishTimeLong) || moment(item.publishTime, "MM月DD日 HH:mm"))
date: new Date(item.publishTimeLong && parseFloat(item.publishTimeLong) || moment(item.publishTime, 'MM月DD日 HH:mm'))
});
});
if (req.params[0] && req.params[0] === '/atom') {
return res.send(feed.render('atom-1.0'));
}
return res.send(feed.render('rss-2.0'))
return res.send(feed.render('rss-2.0'));
});
};
const rss = (req, res, next, gmt) => {
... ... @@ -59,8 +59,8 @@ const rss = (req, res, next, gmt) => {
return next();
}
_.forEach(result, item => {
item.url = item.url.indexOf('http') >= 0 ? item.url : 'http://'+item.url;
let time = new Date(item.publishTimeLong && parseFloat(item.publishTimeLong) || moment(item.publishTime, "MM月DD日 HH:mm"));
item.url = item.url.indexOf('http') >= 0 ? item.url : 'http://' + item.url;
let time = new Date(item.publishTimeLong && parseFloat(item.publishTimeLong) || moment(item.publishTime, 'MM月DD日 HH:mm'));
let format = gmt ? 'ddd, MM MMM YYYY hh:mm:ss +0800' : 'YYYY-MM-DD hh:mm:ss +0800';
item.publishTime = moment(time).format(format);
... ...
... ... @@ -45,7 +45,7 @@ const getRssArticle = (gender) => {
if (typeof value.id !== 'undefined') {
build = guangProcess.formatArticle(value, false, false, true);
build.author = build.author || {};
build.author.name = (build.author && build.author.name) || ''
build.author.name = (build.author && build.author.name) || '';
return _genIntro(value.id).then((intro) => {
build.intro = intro;
result.push(build);
... ...
... ... @@ -311,10 +311,10 @@ const account = (req, res) => {
if (req.cookies.appVersion) {
var versions = req.cookies.appVersion.split('.');
if (versions.length >= 2) {
if (versions[0] < 5 || (parseInt(versions[0], 10)===5 && versions[1] <= 1)) {
if (versions[0] < 5 || (parseInt(versions[0], 10) === 5 && versions[1] <= 1)) {
} else {
url = helpers.appUrlFormat(url, 'go.instalmentMyCard')
url = helpers.appUrlFormat(url, 'go.instalmentMyCard');
}
}
}
... ...
... ... @@ -9,7 +9,7 @@ exports.getQr = (params) => {
try {
uid = crypto.decrypt(PASSWORD, decodeURIComponent(params.token));
uid = parseInt(uid, 10)
uid = parseInt(uid, 10);
} catch (e) {
uid = params.token;
}
... ...
... ... @@ -1595,7 +1595,7 @@ let _detailDataPkgAsync = (origin, uid, vipLevel, ua) => {
if (origin.is_secKill) {
dest.isDepositAdvance = origin.isDeposit_advance;// A定金预售字段 = origin.is_deposit_advance === 'Y'; // 是否定金预售
dest.isPresale = Boolean(origin.expect_arrival_time)
dest.isPresale = Boolean(origin.expect_arrival_time);
}
// 商品返回 YOHO 币
... ...
... ... @@ -339,7 +339,7 @@ $reaMask.on('touchend', function(event) {
event.stopPropagation();
});
$('.nav-tap').on('click', function(e){
$('.nav-tap').on('click', function(e) {
var $cur = $(e.target);
location.replace($cur.data('url'));
})
\ No newline at end of file
});
... ...
... ... @@ -35,7 +35,7 @@ $pwd.bind('input', function() {
});
$btnSure.toggleClass('disable', !bool);
})
});
qs = window.queryString;
... ...
... ... @@ -32,11 +32,11 @@ $content.on('focus', function() {
$content.val('请输入咨询内容');
}
});
var getUrlParam = function (paramName) {
var reg = "[\\?|\\&]+" + paramName + "=([^&]*)[^&]?";
var exp = (window.location.href + "").match(reg);
return exp ? exp[1] : "";
}
var getUrlParam = function(paramName) {
var reg = '[\\?|\\&]+' + paramName + '=([^&]*)[^&]?';
var exp = (window.location.href + '').match(reg);
return exp ? exp[1] : '';
};
// 提交表单请求
$consultForm.on('submit', function() {
... ...
... ... @@ -43,6 +43,7 @@ var winH = $(window).height(),
noResult = '<p class="no-result">未找到相关搜索结果</p>';
require('../common');
// 默认筛选条件
var defaultOpt = require('../common/query-param');
... ... @@ -51,7 +52,7 @@ var defaultOpt = require('../common/query-param');
var param = location.search;
var isApp = param.indexOf('app_version') > -1 || param.indexOf('appVersion') > -1;
//不阻塞字体文件加载
// 不阻塞字体文件加载
setTimeout(function() {
if (isApp) {
$.ajax({
... ... @@ -95,7 +96,7 @@ var defaultOpt = require('../common/query-param');
skns: $('.popularity-title').data('skns'),
},
success: function(data) {
$('.product-warp>.goods-container').html(data)
$('.product-warp>.goods-container').html(data);
},
error: function() {
tip.show('网络断开连接了~');
... ... @@ -126,7 +127,7 @@ var defaultOpt = require('../common/query-param');
});
}
});
}, 0)
}, 0);
}());
... ... @@ -229,6 +230,7 @@ function getPageGoods(info) {
navType = info.data.type;
nav = navInfo[navType];
// 不需要重新加载并且数据请求结束
if (nav.end && toTop) {
toTop = false;
... ... @@ -332,8 +334,8 @@ function tabChange(dom, index) {
// 首页导航
(function(nav, posNav, main) {
var scrollToNav1 = function() {
window.scrollTo(0, $('#nav').offset().top + 5)
}
window.scrollTo(0, $('#nav').offset().top + 5);
};
$(nav + ' li, ' + posNav + ' li').not('li.all-goods').on('touchstart', function() {
var index = $(this).index(),
activeTab = $(this).attr('tab');
... ... @@ -376,7 +378,8 @@ function scrollHandler() {
nav2OffsetTop = $('#list-nav').length ? $('#list-nav').offset().top : 0;
var tra;
//分页加载店铺商品列表
// 分页加载店铺商品列表
if (sTop + winH > scH - 0.25 * $goodsContainer.height() - 50) {
if ($pre !== undefined) {
search({
... ... @@ -389,7 +392,7 @@ function scrollHandler() {
}
}
//分页加载“上新”和“人气”商品数据
// 分页加载“上新”和“人气”商品数据
if (sTop + winH * 2 > scH) {
switch (viewType) {
case 2:
... ... @@ -419,7 +422,7 @@ function scrollHandler() {
document.addEventListener('touchmove', function(e) {
// sub classify不阻止默认事件
if ($(e.target).closest('.sub-classify').length === 0) {
//e.preventDefault();
// e.preventDefault();
}
if ($('.filter-mask').length && !$('.filter-mask').hasClass('hide')) {
e.preventDefault();
... ... @@ -445,7 +448,7 @@ $(window).ready(function() {
scH = $('#scroller').outerHeight();
}, 500);
$(document).scroll(scrollHandler)
$(document).scroll(scrollHandler);
lazyLoad($('img.lazy'));
});
... ... @@ -682,7 +685,7 @@ $subNav.on('touchend touchcancel', function(e) {
}
}
window.scrollTo(0, $('#list-nav').offset().top + 5)
window.scrollTo(0, $('#list-nav').offset().top + 5);
} else {
filter.hideFilter();// 隐藏面板
... ... @@ -776,7 +779,7 @@ $subNav.on('touchend touchcancel', function(e) {
url: '/product/search/search',
nextPage: false
}, function() {
window.scrollTo(0, $('#list-nav').offset().top + 5)
window.scrollTo(0, $('#list-nav').offset().top + 5);
});
}
}
... ...