Authored by ccbikai(👎🏻🍜)

Merge branch 'master' into qCloud

... ... @@ -104,9 +104,10 @@ const getResources = (params, options) => {
}
list = {
id: res.template_id,
title: res.data.title,
more_url: res.data.more_url,
more_name: res.data.more_name,
moreUrl: res.data.more_url,
moreName: res.data.more_name,
image: res.data.image
};
... ... @@ -115,8 +116,8 @@ const getResources = (params, options) => {
case 'titleFloor':
list = {
name: res.data.title.name,
more_url: res.data.title.more_url,
more_name: res.data.title.more_name
moreUrl: res.data.title.more_url,
moreName: res.data.title.more_name
};
if (res.data.title.name === '热门商品') {
... ...
... ... @@ -45,7 +45,7 @@
<div class="focus-left-right">
{{#each result.focus2.data}}
<a href="{{url}}" title="{{title}}">
<img class="lazy" data-original="{{image src 250 250}}">
<img src="{{image src 250 250}}">
</a>
{{/each}}
</div>
... ...
... ... @@ -208,7 +208,7 @@ const myDetails = (uid) => {
// return finalResult;
});
} else {
return false;
return Promise.resolve({});
}
};
... ... @@ -404,7 +404,7 @@ const getGrade = (param) => {
return resu;
});
} else {
return false;
return Promise.resolve({});
}
};
... ...
... ... @@ -16,7 +16,7 @@ module.exports = (req, res, next) => {
});
}
res.redirect(helpers.urlFormat('/signin.html', {
return res.redirect(helpers.urlFormat('/signin.html', {
refer: req.originalUrl
}));
}
... ...
... ... @@ -16,6 +16,12 @@ module.exports = () => {
req.url = `/activity${req.url}`;
}
if (/^\/sale/.test(req.url)) {
// sale 兼容php的url
res.redirect(301, helpers.urlFormat('/product/sale', req.query, 'default'));
return;
}
if (req.subdomains.length) {
switch (req.subdomains[0]) {
case 'guang': // 逛
... ... @@ -75,4 +81,4 @@ module.exports = () => {
}
next();
};
};
\ No newline at end of file
};
... ...
{
"name": "m-yohobuy-node",
"version": "5.0.11",
"version": "5.0.12",
"private": true,
"description": "A New Yohobuy Project With Express",
"repository": {
... ...
... ... @@ -352,32 +352,34 @@ function givePoint(parameter) {
var channel = cookie('_Channel');
var header = $('#yoho-header');
switch (channel) {
case 'boys':
if (!header.hasClass('boys')) {
header.addClass('boys');
}
break;
case 'girls':
if (!header.hasClass('girls')) {
header.addClass('girls');
}
break;
case 'lifestyle':
if (!header.hasClass('life-style')) {
header.addClass('life-style');
}
break;
case 'kids':
if (!header.hasClass('kids')) {
header.addClass('kids');
}
break;
default:
if (!header.hasClass('boys')) {
header.addClass('boys');
}
break;
if (!/^\/home/.test(location.pathname)) {
switch (channel) {
case 'boys':
if (!header.hasClass('boys')) {
header.addClass('boys');
}
break;
case 'girls':
if (!header.hasClass('girls')) {
header.addClass('girls');
}
break;
case 'lifestyle':
if (!header.hasClass('life-style')) {
header.addClass('life-style');
}
break;
case 'kids':
if (!header.hasClass('kids')) {
header.addClass('kids');
}
break;
default:
if (!header.hasClass('boys')) {
header.addClass('boys');
}
break;
}
}
}());
... ...
var $ = require('yoho-jquery'),
tip = require('../plugin/tip'),
Swiper = require('yoho-swiper'),
loading = require('../plugin/loading'),
lazyLoad = require('yoho-jquery-lazyload');
loading = require('../plugin/loading');
var plusstar = {},
$footer = $('#yoho-footer');
require('yoho-jquery-lazyload');
require('../common');
plusstar = {
... ... @@ -82,16 +82,8 @@ plusstar = {
that.resInit();
loading.hideLoadingMask();
lazyLoad($('img.lazy'));
// 处理左右滑动,未加载的图片
setTimeout(function() {
$('img.lazy').each(function() {
if ($(this).attr('src') !== $(this).data('original')) {
$(this).attr('src', $(this).data('original'));
}
});
}, 40);
$('.plusstar-resources').find('img.lazy').lazyload();
// 设置滚动条的位置
if (window.localStorage) {
... ...
... ... @@ -169,36 +169,42 @@ $search.on('touchend', function() {
history,
historys, i, num = 1;
if (localStorage) {
historys = localStorage.getItem(historyval);
try {
if (localStorage) {
historys = localStorage.getItem(historyval);
if (historys && historys.length > 0) {
historys = historys.split(ranToken);
for (i = historys.length; i > 0; i--) {
history = historys[i - 1];
if (historys && historys.length > 0) {
historys = historys.split(ranToken);
for (i = historys.length; i > 0; i--) {
history = historys[i - 1];
if (history === '') {
continue;
}
if (history === '') {
continue;
}
if (num++ > 10) {
break;
if (num++ > 10) {
break;
}
html += '<li><a href="javascript:void(0);">' + history + '</li>';
}
html += '<li><a href="javascript:void(0);">' + history + '</li>';
}
$history.html(html);
$history.html(html);
if (html !== '') {
$clearHistory.removeClass('hide');
$historySearch.removeClass('hide');
}
if (html !== '') {
$clearHistory.removeClass('hide');
$historySearch.removeClass('hide');
window.rePosFooter();
} else {
$historySearch.hide();
$clearHistory.hide();
}
window.rePosFooter();
} else {
$historySearch.hide();
$clearHistory.hide();
}
} catch (e) {
console.log(e);
$historySearch.hide();
$clearHistory.hide();
}
}());
... ...
... ... @@ -20,17 +20,21 @@ function getHistoryval() {
function setHistoryValFun(query) {
var historys;
if (localStorage) {
historys = localStorage.getItem(historyval);
try {
if (localStorage) {
historys = localStorage.getItem(historyval);
historys = historys ? historys.replace(new RegExp((query + ranToken), 'g'), '') : '';
historys = historys ? historys.replace(new RegExp((query + ranToken), 'g'), '') : '';
if (historys === '') {
query = ranToken + query;
}
if (historys === '') {
query = ranToken + query;
}
historys += query + ranToken;
localStorage.setItem(historyval, historys);
historys += query + ranToken;
localStorage.setItem(historyval, historys);
}
} catch (e) {
console.log(e);
}
}
... ...
... ... @@ -163,13 +163,11 @@
a {
display: inline-block;
margin: 0 15px;
width: 213px;
height: 213px;
}
img {
width: 100%;
height: 100%;
width: 213px;
height: 213px;
}
}
... ... @@ -180,7 +178,11 @@
a {
display: inline-block;
width: 50%;
overflow: hidden;
img {
width: 320px;
height: 320px;
}
}
}
... ...
... ... @@ -88,6 +88,10 @@ exports.processProductList = (list, options) => {
}, options);
_.forEach(list, (product) => {
if (!product) {
return;
}
// 商品信息有问题,则不显示
if (!product.product_id || !product.goods_list || product.goods_list.length === 0) {
return;
... ...