Authored by biao

Merge branch 'develop' of http://git.yoho.cn/fe/yohobuywap-node into develop

... ... @@ -55,7 +55,7 @@ exports.intro = (req, res) => {
};
/**
* 为你优选 待处理
* 为你优选
* @param {[type]} req [description]
* @param {[type]} res [description]
* @return {[type]} [description]
... ... @@ -66,11 +66,9 @@ exports.preference = (req, res) => {
yhchannel: req.params.yhchannel,
brandId: req.params.brandId
}).then((result) => {
res.send(result);
// res.render('preference', {
// result: result,
// devEnv: true
// });
res.render('detail/preference', {
result: result,
devEnv: true
});
});
};
... ...
... ... @@ -162,7 +162,7 @@ exports.filter = (req, res) => {
let params = Object.assign({}, req.query);
saleModel.getFilterData(params).then((result) => {
res.render('filter', {
res.render('sale/filter', {
layout: false,
params: params,
filter: result
... ... @@ -196,7 +196,7 @@ exports.search = (req, res) => {
}, vipObj);
}
res.render('product', Object.assign({
res.render('sale/product', Object.assign({
layout: false,
params: params,
goods: result[0]
... ...
... ... @@ -2,35 +2,19 @@
* @Author: Targaryen
* @Date: 2016-05-18 11:42:11
* @Last Modified by: Targaryen
* @Last Modified time: 2016-05-18 17:38:19
* @Last Modified time: 2016-05-30 13:48:17
*/
'use strict';
const library = '../../../library';
const utils = '../../../utils';
const API = require(`${library}/api`).API;
const sign = require(`${library}/sign`);
const _ = require('lodash');
// const helpers = require(`${library}/helpers`);
// const _ = require('lodash');
// const log = require(`${library}/logger`);
const productProcess = require(`${utils}/product-process`);
var api = new API();
/**
* 处理偏好信息
* @param {Object} origin [description]
* @return {Object} [description]
*/
const getPreference = (origin) => {
var dest = origin;
return dest;
};
module.exports = (data) => {
var finalResult;
... ... @@ -40,8 +24,9 @@ module.exports = (data) => {
yhchannel: data.yhchannel,
brandId: data.brandId
})).then(result => {
if (!_.isEmpty(result)) {
finalResult = getPreference(result);
if (!_.isEmpty(result) && result.code === 200) {
// 为你优选数据处理,接口没有数据,待处理,待验证
finalResult = productProcess.processProductList(result.data);
}
return finalResult;
... ...
... ... @@ -17,7 +17,6 @@ const productProcess = require(`${utils}/product-process`);
const _ = require('lodash');
const api = new API();
const serviceAPI = new ServiceAPI();
const aMinute = 60000;
const anHour = 3600000;
const aDay = anHour * 24;
... ... @@ -72,34 +71,6 @@ const processTime = (time) => {
};
/**
* 折扣专场专题详情过期时间处理
* @param {[string]} time
* @return {[boject]}
*/
const processTimes = (time) => {
let data = {};
let type = '';
if (time > aDay) {
type = 'dhms';
} else {
if (time > anHour) {
type = 'hms';
} else {
if (time > aMinute) {
type = 'ms';
} else {
type = 's';
}
}
}
data.time = helpers.dateDiffFormat(timeFormat[type], time, 'ms');
return data;
};
/**
* 折扣专场列表数据处理
* @param {[array]} list
* @return {[array]}
... ... @@ -119,8 +90,6 @@ const processSpecial = (list) => {
if (flag === true) {
data.specialUrl = `/product/specialDetail?id=${data.id}`;
_.merge(data, processTime(data.leftTime));
} else {
_.merge(data, processTimes(data.leftTime));
}
formatData.push(data);
... ...
<div class="break-code-page discount-page yoho-page">
<div class="break-code-page goods-page yoho-page">
{{#content}}
{{! 头部banner}}
... ...
<div class="discount-page sale-page yoho-page">
<div class="goods-page sale-page yoho-page">
{{#content}}
{{! 头部banner}}
... ...
<div class="sale-channel-page discount-page yoho-page">
<div class="sale-channel-page goods-page yoho-page">
{{> product/sale/banner}}
... ...
<div class="sale-vip-page discount-page yoho-page">
<div class="sale-vip-page goods-page yoho-page">
{{> product/sale/banner}}
... ...
... ... @@ -13,7 +13,7 @@ module.exports = {
port: 6001,
siteUrl: 'http://m.yohobuy.com',
domains: {
api: 'http://testapi.yoho.cn:28078/', // http://192.168.102.205:8080/gateway http://testapi.yoho.cn:28078/
api: 'http://testapi.yoho.cn:28078/', // http://192.168.102.205:8080/gateway
service: 'http://testservice.yoho.cn:28077/'
},
useOneapm: false,
... ...
... ... @@ -15,6 +15,7 @@ camelCaseObject = (obj) => {
obj[k] = camelCase(obj[k]);
if (/[_-]/.test(k)) {
obj[_.camelCase(k)] = obj[k];
delete obj[k];
}
});
return obj;
... ...
... ... @@ -12,8 +12,6 @@ var $filter;
var fCbFn, hCbFn; // 筛选和关闭的回调
var missStatus; // 是否忽略选中状态
// 隐藏筛选界面
function hideFilter() {
$filter.addClass('hide');
... ... @@ -122,7 +120,8 @@ function initFilter(opt) {
fCbFn = opt.fCbFn;
hCbFn = opt.hCbFn;
missStatus = opt.missStatus;
// 是否忽略选中状态
window.missStatus = opt.missStatus;
highlightMainItem();
highlightSubItem();
... ...
... ... @@ -9,6 +9,10 @@ var $ = require('yoho-jquery'),
var $activityTime = $('.activity-time'),
endTime = $activityTime.data('time-ms');
var anHour = 3600000,
aMinute = 60000,
aSecond = 1000;
require('./sale/search');
lazyLoad($('img.lazy'));
... ... @@ -16,10 +20,7 @@ lazyLoad($('img.lazy'));
// 倒计时
function getRTime() {
var anHour = 3600000,
aMinute = 60000,
aSecond = 1000,
showTime = '',
var showTime = '',
d = 0,
h = 0,
m = 0,
... ...
.discount-page {
background-color: #fff;
.swiper-container {
width: 100%;
height: 240px;
img {
width: 100%;
height: 100%;
}
ul {
height: 240px;
}
.swiper-pagination {
bottom: 0;
left: 0;
width: 100%;
}
.swiper-pagination-bullet-active {
background: #fff;
}
}
.banner-top-single {
width: 100%;
height: 200px;
img {
display: block;
width: 100%;
height: 100%;
}
}
.goods-page {
.list-nav {
border-top: 1px solid #e6e6e6;
... ...
@import "break-code";
@import "discount";
@import "goods-list";
@import "sale";
@import "special";
@import "special-detail";
... ...