<?php $__env->startSection('head'); ?>
    @parent
    <style>
        .op-time-span {
            display: block;
            text-align: center;
            font-size: 0.8rem;
            color: #ccc;
        }
        .op-time-span > span{
            display:block
        }
    </style>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('main-content'); ?>
    <section class="content animated slideInRight">
        <div class="row">
            <div class="col-md-12">
                <div class="card card-primary card-outline">
                    <div class="card-header">
                        <a class="btn btn-primary btn-sm fa fa-plus-square-o white" href="/ticket_form"> 添加优惠券 </a>
                        <?php /*<a class="btn btn-info btn-sm fa fa-gear white" href="/product/setting"> 设置 </a>*/ ?>
                        <div class="card-tools" style="top:0.7rem">
                            <div class="input-group input-group-sm">
                                <input type="text" class="form-control title-input" placeholder="名称搜索">
                                <div class="input-group-append">
                                    <div class="btn btn-default">
                                        <i class="fa fa-search title-search"></i>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="card-body p-0">
                        <div class="table-responsive">
                            <table class="table table-hover admin-table" id="product-table">
                                <thead>
                                <tr>
                                    <th width="8%">选择</th>
                                    <th width="20%">名称</th>
                                    <th width="10%">价格</th>
                                    <th width="10%">库存</th>
                                    <th width="10%">状态</th>
                                    <th width="10%">推荐</th>
                                    <th width="15%">时间</th>
                                    <th width="19%">操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                <tr v-if="total == 0">
                                    <td colspan="8">暂无相关记录</td>
                                </tr>
                                <tr v-if="total > 0 " v-for="item in list">
                                    <td><input type="checkbox"></td>
                                    <td>
                                        <a :href="`/ticket_form/${item.id}`">
                                            <img :src="item.index_image" class="index_image" v-if="item.index_image">
                                            <span class="title_span cp grey"
                                                  :title="item.name">{{item['name']}}</span>
                                        </a>
                                    </td>
                                    <td>{{item.price}}</td>
                                    <td>{{item['storage']}}</td>
                                    <td>{{item['status'] ? '已发布' : '未发布'}}</td>
                                    <td>{{item['is_promote'] ? '已推荐' : '未推荐'}}</td>
                                    <td class="op-time-span">
                                        <span>开始时间 {{item.start_time.split(' ')[0]}}</span>
                                        <span>结束时间 {{item.end_time.split(' ')[0]}}</span>
                                    </td>
                                    <td>
                                        <i class="fa fa-paper-plane" title="发布" @click="publish(item.id)" v-show="item.status === 0"></i>
                                        <i class="fa fa-arrow-left" title="撤回" @click="rollback(item.id)" v-show="item.status === 1"></i>&nbsp;
                                        <i class="fa fa-thumbs-o-up" title="推荐首页" @click="promote(item.id)" v-show="item.is_promote === 0"></i>&nbsp;
                                        <i class="fa fa-thumbs-o-down" title="取消推荐" @click="dispromote(item.id)" v-show="item.is_promote === 1"></i>&nbsp;
                                        <i class="fa fa-trash-o" title="删除" @click="del(item.id)"></i>&nbsp;
                                    </td>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                    <div class="card-footer">
                        <div id="page-wrap"></div>
                    </div>
                </div>
            </div>
        </div>
        </div>
    </section>
<?php $__env->startSection('script'); ?>
    @parent
    <script src="/static/js/ticket/ticket.js?vt=<?php echo e(time()); ?>"></script>
<?php $__env->stopSection(); ?>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('admin.index', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>