代码: 全选
<?php
if (!defined('__TYPECHO_ROOT_DIR__')) exit;
$this->need('header.php');
?>
<div class="layui-container">
<div class="layui-row layui-col-space15 main">
<div class="layui-col-md9 layui-col-lg9">
<?php while($this->next()): ?>
<div class="title-article list-card">
<div class="list-pic"><a href="<?php $this->permalink() ?>" title="<?php $this->title() ?>"><img src="<?php echo thumb($this); ?>" alt="<?php $this->title() ?>" class="img-full"></a></div>
<a href="<?php $this->permalink() ?>">
<h1><?php $this->title() ?></h1>
<p>
<?php $this->excerpt(300, '...'); ?>
</p>
</a>
<div class="title-msg">
<span><i class="layui-icon"></i> <?php $this->category(','); ?></span>
<span><i class="layui-icon"></i> <?php $this->date('Y-m-d A'); ?> </span>
<span class="layui-hide-xs"><i class="layui-icon"></i> <?php get_post_view($this); ?>℃</span>
<span class="layui-hide-xs"><i class="layui-icon"></i> <?php $this->commentsNum('%d'); ?>条</span>
<span><i class="layui-icon"></i> <a id="test"</a></span>
</div>
</div>
<?php endwhile; ?>
<div class="page-navigator">
<?php $this->pageNav('«', '»', 1, '...', array('wrapTag' => 'div', 'wrapClass' => 'layui-laypage layui-laypage-molv', 'itemTag' => '', 'currentClass' => 'current', )); ?>
</div>
</div>
<?php $this->need('sidebar.php'); ?>
</div>
</div>
<script>
layui.use('util', function(){
var util = layui.util;
var endTime = new Date("<?php $this->fields->expire(); ?>").getTime() //假设为结束日期,注意js的月份是0-11,!
,serverTime = new Date().getTime(); //假设为当前服务器时间,这里采用的是本地时间,实际使用一般是取服务端的
util.countdown(endTime, serverTime, function(date, serverTime, timer){
var str = date[0] + '天' + date[1] + '时' + date[2] + '分' + date[3] + '秒';
layui.$('#test').html(str);
});
});
</script>
<?php $this->need('footer.php'); ?>