Authored by 黄涛

Merge branch 'feature/isSolded' into 'release/5.3'

Feature/is solded



See merge request !11
... ... @@ -45,7 +45,8 @@ const homeNav = [
{name: '我的退/换货', href: '/home/returns'},
{name: '我的咨询', href: '/home/consult'},
{name: '我的评论', href: '/home/comment'},
{name: '我的投诉', href: '/home/complaints'},
/* {name: '我的投诉', href: '/home/complaints'}, */
{name: '我的信息', href: '/home/message', count: 0},
{name: '在线客服', href: 'http://chat8.live800.com/live800/chatClient/chatbox.jsp?companyID=620092&configID=149091&jid=8732423409&info=', isBlank: true}
]
... ...
... ... @@ -5,8 +5,20 @@
const headerModel = require('../models/header');
const logger = global.yoho.logger;
const forceNoCache = (res) => {
if (res) {
res.set({
'Cache-Control': 'no-cache',
Pragma: 'no-cache',
Expires: (new Date(1900, 0, 1, 0, 0, 0, 0)).toUTCString()
});
}
};
exports.notFound = () => {
return (req, res, next) => {
forceNoCache(res);
if (req.xhr) {
return res.status(404).json({
code: 404,
... ... @@ -32,6 +44,8 @@ exports.notFound = () => {
*/
exports.serverError = () => {
return (err, req, res, next) => {
forceNoCache(res);
logger.error(`error at path: ${req.url}`);
logger.error(err);
if (!res.headersSent) {
... ...
... ... @@ -39,11 +39,9 @@
<p class="few-tag">即将售罄</p>
{{/ is_few}}
{{#if is_sale_out}}
<a class="sale-out" href="{{url}}">
<span class="sale-out-tip">已抢光</span>
</a>
{{/if}}
{{# is_solded}}
<p class="sale-out">已售罄</p>
{{/ is_solded}}
{{#if show_col_btn}}
<span class="col-btn iconfont{{#if coled}} coled{{/if}}">&#xe616;</span>
... ...
... ... @@ -30,23 +30,19 @@
bottom: 0;
}
.sale-out {
.sale-out{
width: 100%;
height: 100%;
text-align: center;
top: 0;
position: absolute;
background: resolve("product/sale-out-bg.png");
left: 0;
height: 16px;
line-height: 16px;
background: #bebebe;
color: #fff;
font-size: 12px;
text-align: center;
bottom: 0;
}
.sale-out-tip {
width: 110px;
height: 110px;
margin-top: 105px;
display: inline-block;
background: resolve("product/sale-out-tip.png") no-repeat center center;
text-indent: -9999px;
}
}
.good-detail-text {
... ...
... ... @@ -155,11 +155,6 @@ exports.processProductList = (list, options) => {
return;
}
// 如果库存为0,显示已抢完
if (product.storage_num === 0 && product.status === 1) {
product.is_sale_out = true;
}
// 市场价和售价一样,则不显示市场价, 不显示折扣信息
if (product.market_price === product.sales_price) {
delete product.market_price;
... ... @@ -222,6 +217,9 @@ exports.processProductList = (list, options) => {
case 'is_soon_sold_out': // 即将售磬
options.showFew && (tag.is_few = true, isfew = true);
break;
case 'is_solded': // 已售磬
product.is_solded = true;
break;
case 'is_new': // 新品NEW
options.showNew && (tag.is_new = true);
break;
... ...