Authored by 郝肖肖

Merge branch 'feature/orderDetailOptim' into release/wap-optim

... ... @@ -21,15 +21,14 @@ const orderDetailData = (req, res, next) => {
orderDetailModel.orderDetailData(uid, orderCode).then(result => {
result.serviceUrl = serviceUrl;
res.render('orderDetail', {
module: 'home',
page: 'order-detail',
pageHeader: headerModel.setNav({
navTitle: '订单详情',
navBtn: false
}),
title: '订单详情',
pageFooter: true,
orderDetail: result
orderDetail: result,
localCss: true,
});
}).catch(next);
... ...
... ... @@ -199,10 +199,6 @@ const orderDetailData = (uid, orderCode) => {
// createTime: date('Y-m-d H:i:s', orderDetail.createTime)
});
// _.defer(function(orderDetail.createTime) {
// console.log(_.now() - orderDetail.createTime);
// }, _.now());
if (orderDetail.counterFlag && orderDetail.counterFlag === 'Y') {
orderDetail = _.assign(orderDetail, {
leftTime: parseInt(orderDetail.payLefttime, 10) * 1000
... ... @@ -216,7 +212,7 @@ const orderDetailData = (uid, orderCode) => {
obj = _.assign(obj, {
thumb: data.goodsImage,
name: data.productName,
color: data.factoryColorName? data.factoryColorName : data.colorName,
color: data.factoryColorName ? data.factoryColorName : data.colorName,
size: data.sizeName,
price: data.goodsPrice,
count: count
... ... @@ -313,12 +309,8 @@ const orderDetailData = (uid, orderCode) => {
cancelReason: resons
});
//console.log(orderDetail)
return orderDetail;
});
// return orderDetail;
} else {
logger.error('detail info return no 200');
return {};
... ...
... ... @@ -285,7 +285,8 @@ const wechat = {
doPassportCallback(openId, nickname, 'wechat', req, res).catch(next);
})(req, res, next);
} else {
return next('Auth State Mismatch');
log.error('Auth State Mismatch:' + req.originalUrl);
return res.redirect(loginPage);
}
}
};
... ... @@ -310,7 +311,8 @@ const sina = {
doPassportCallback(openId, nickname, 'sina', req, res).catch(next);
})(req, res, next);
} else {
return next('Auth State Mismatch');
log.error('Auth State Mismatch:' + req.originalUrl);
return res.redirect(loginPage);
}
}
};
... ... @@ -336,7 +338,8 @@ const qq = {
doPassportCallback(openId, nickname, 'qq', req, res).catch(next);
})(req, res, next);
} else {
return next('Auth State Mismatch' + req.originalUrl);
log.error('Auth State Mismatch:' + req.originalUrl);
return res.redirect(loginPage);
}
}
};
... ...
... ... @@ -4,6 +4,8 @@
* @date: 2015/11/16
*/
require('../../scss/home/_order-detail-index.css');
var $ = require('yoho-jquery'),
lazyLoad = require('yoho-jquery-lazyload'),
Hammer = require('yoho-hammer'),
... ... @@ -26,8 +28,6 @@ lazyLoad({
try_again_css: 'order-failure'
});
require('../common');
function downCount(options) {
var difference = options, // difference of dates
... ... @@ -214,10 +214,8 @@ $reaMask.on('touchend', function(event) {
event.stopPropagation();
});
function formatDate(objD) {
var str, colorhead, colorfoot,
var str,
yy = objD.getYear(),
MM = objD.getMonth() + 1,
dd = objD.getDate(),
... ... @@ -252,4 +250,5 @@ function formatDate(objD) {
str = yy + '-' + MM + '-' + dd + ' ' + hh + ':' + mm + ':' + ss;
$('.createTime').text(str);
}
formatDate($createTime);
... ...
... ... @@ -65,6 +65,7 @@ $('.pitch').on('click', function() {
});
function setPassword() {
$btnSure.addClass('disable');
return $.ajax({
type: 'POST',
url: '/passport/reg/setpassword',
... ... @@ -96,8 +97,12 @@ function setPassword() {
location.href = res.href;
}, 1500);
} else {
$btnSure.removeClass('disable');
showErrTip(data.message);
}
},
error: function() {
$btnSure.removeClass('disable');
}
});
}
... ... @@ -114,6 +119,7 @@ $btnSure.on('touchstart', function() {
} else {
if ($('.pitch').hasClass('select')) {
setPassword();
} else {
$('.prompt').show();
... ...
@import "order";
@import "order-detail";
... ...