Authored by 周少峰

order count down js

... ... @@ -19,28 +19,8 @@ lazyLoad({
});
function downCount(options) {
var settings = new Date(options),
targetDateFunction = function() {
var orderDate = new Date(settings),
utc = orderDate.getTime(),
newDate = new Date(utc);
return newDate;
},
difference = targetDateFunction(),// difference of dates
var difference = options,// difference of dates
interval;
// Throw error if date is not set
if (!settings) {
$.error('Date is not defined.');
}
// Throw error if date is set incorectly
if (!Date.parse(settings)) {
$.error('Incorrect date format, it should look like this, 12/24/2012 12:00:00.');
}
/**
* Main downCount function that calculates everything
*/
... ...
... ... @@ -207,8 +207,8 @@ class OrderModel
$result['orderNum'] = $orderDetail['data']['order_code'];
$result['orderTime'] = date('Y-m-d H:i:s', $orderDetail['data']['create_time']);
//倒计时时间
if (isset($orderDetail['counter_flag']) && $orderDetail['counter_flag'] == 'Y') {
$result['leftTime'] = $orderDetail['data']['pay_lefttime'];
if (isset($orderDetail['data']['counter_flag']) && $orderDetail['data']['counter_flag'] == 'Y') {
$result['leftTime'] = $orderDetail['data']['pay_lefttime']*1000;
}
$result['goods'] = Helpers::formatOrderGoods($orderDetail['data']['order_goods'], $count, true);
$result['sumPrice'] = $orderDetail['data']['goods_total_amount']; // 商品总金额
... ... @@ -226,7 +226,6 @@ class OrderModel
$result['isPay'] = $orderDetail['data']['payment_status'] === 'Y';
}
}
return $result;
}
... ...