Commit b6d4d73f by 朱继来

添加付款时间倒计时

parent 0a3d1adb
......@@ -276,3 +276,22 @@ input[type="color"],
float: left;
display: none;
}
/* 付款时间 */
.checked_section {
position: relative;
height: 60px;
}
.checked_left {
position: absolute;
left: 0;
}
.checked_right {
position: absolute;
right: 0;
line-height: 60px;
}
.count_time {
color: red;
font-size: 20px;
}
\ No newline at end of file
......@@ -175,21 +175,25 @@
@endif
@if ($order_info['status'] == 2)
<p>交易状态:&nbsp;审核通过,请联系客户及时付款!</p>
<div class="checked_section">
<div class="checked_left">
<p>交易状态:&nbsp;审核通过,请联系客户及时付款!订单付款时间截止至:{{date('Y-m-d H:i:s', $order_info['pay_time'])}}</p>
@if ($order_info['adjust_count'] < 2)
<a class="btn btn-default" href="{{URL('adjustPrice', ['order_id'=>$order_info['order_id']])}}">再次调价</a><span class="warn-tip">每笔订单仅有一次“再次调价”机会</span>
@endif
<div>
<p>订单付款时间截止至:{{date('Y-m-d h:i:s', $order_info['pay_time'])}}</p>
<p>剩余时间:
{{floor(($order_info['pay_time'] - time()) / 86400) }}天
{{floor(($order_info['pay_time'] - time()) % 86400 / 3600) }}小时
{{floor(($order_info['pay_time'] - time()) % 3600 / 60) }}分
{{floor(($order_info['pay_time'] - time()) % 60) }}秒</p>
</div>
<div class="checked_right">
<p>
<span class="error">剩余付款时间:</span>
<span class="count_time count_day"></span>
<span class="count_time count_hour"></span>
<span class="count_time count_min"></span>
<span class="count_time count_sec"></span>
</p>
</div>
</div>
@endif
@if ($order_info['status'] == -1)
......@@ -207,4 +211,42 @@
var order_amount = "{{$order_info['order_amount']}}";
var currency = "{{$order_info['currency']}}";
var order_pay_type = "{{$order_info['order_pay_type']}}";
var rest_time = "{{$order_info['pay_time'] - time()}}";
countDown(rest_time);
// 倒计时
function countDown(times){
var timer=null;
timer = setInterval(function(){
var day=0,
hour=0,
minute=0,
second=0;//时间默认值
if (times > 0) {
day = Math.floor(times / (60 * 60 * 24));
hour = Math.floor(times / (60 * 60)) - (day * 24);
minute = Math.floor(times / 60) - (day * 24 * 60) - (hour * 60);
second = Math.floor(times) - (day * 24 * 60 * 60) - (hour * 60 * 60) - (minute * 60);
}
if (day <= 9) day = '0' + day;
if (hour <= 9) hour = '0' + hour;
if (minute <= 9) minute = '0' + minute;
if (second <= 9) second = '0' + second;
$('.count_day').text(day);
$('.count_hour').text(hour);
$('.count_min').text(minute);
$('.count_sec').text(second);
times--;
}, 1000);
if (times <= 0 ) {
clearInterval(timer);
}
}
</script>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment