Authored by zhangxiaoru

orderDetail

... ... @@ -186,6 +186,10 @@ 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
... ... @@ -243,17 +247,12 @@ const orderDetailData = (uid, orderCode) => {
isPay: true
});
}
console.log(orderDetail.canUpdateDeliveryAddress)
// 判断是否可以修改地址
if (orderDetail.canUpdateDeliveryAddress === 'Y') {
orderDetail = _.assign(orderDetail, {
changeable: true
});
} else {
orderDetail = _.assign(orderDetail, {
changeable: false
});
}
// 判断是否有关联订单
... ... @@ -290,7 +289,7 @@ const orderDetailData = (uid, orderCode) => {
cancelReason: resons
});
//console.log(orderDetail);
// console.log(orderDetail);
return orderDetail;
});
... ...
... ... @@ -35,7 +35,7 @@
<p class="beside-icon sub-content">
<span class="sub-title">订单编号:{{orderCode}}</span>
<span >订单状态:{{statusStr}}</span>
<span>下单时间:{{createTime}}</span>
<span>下单时间:<b class="createTime">{{createTime}}</b></span>
</p>
</div>
{{#if logisticsUrl}}
... ...
... ... @@ -8,20 +8,24 @@ var $ = require('yoho-jquery'),
lazyLoad = require('yoho-jquery-lazyload'),
Hammer = require('yoho-hammer'),
dialog = require('../plugin/dialog'),
tip = require('../plugin/tip'),
orderId = $('#order-detail').data('id'),
tip = require('../plugin/tip');
var orderId = $('#order-detail').data('id'),
$countDownHours = $('.hours'),
$countdownContainer = $('.count-down'),
Swiper = require('yoho-swiper'),
$ownerInfo = $('.owner-info'),
$reaMask = $('.reason-mask'),
reasonSwiper,
optHammer;
optHammer,
$createTime = new Date($('.createTime').text() * 1000);
lazyLoad({
try_again_css: 'order-failure'
});
require('../common');
function downCount(options) {
var difference = options, // difference of dates
... ... @@ -207,3 +211,43 @@ $reaMask.on('touchend', function(event) {
$reaMask.css('visibility', 'hidden');
event.stopPropagation();
});
function formatDate(objD) {
var str, colorhead, colorfoot,
yy = objD.getYear(),
MM = objD.getMonth() + 1,
dd = objD.getDate(),
hh = objD.getHours(),
mm = objD.getMinutes(),
ss = objD.getSeconds();
if (yy < 1900) {
yy = yy + 1900;
}
if (MM < 10) {
MM = '0' + MM;
}
if (dd < 10) {
dd = '0' + dd;
}
if (hh < 10) {
hh = '0' + hh;
}
if (mm < 10) {
mm = '0' + mm;
}
if (ss < 10) {
ss = '0' + ss;
}
str = yy + '-' + MM + '-' + dd + ' ' + hh + ':' + mm + ':' + ss;
$('.createTime').text(str);
}
formatDate($createTime);
... ...