Authored by 王水玲

sale

... ... @@ -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]
... ...
... ... @@ -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}}
... ...
... ... @@ -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";
... ...