<view class="content">
    <!-- 核销凭证列表 -->
    <block wx:if="{{vouchers.length > 0}}">
        <view class="vouchers" wx:for="{{vouchers}}" wx:key="vouchers">
            <image class="vouchers-icon" src="/static/icons/sign.png" mode="widthFix" wx:if="{{!item.can_sign}}"></image>
            <view class="vouchers-info">
                <view class="vouchers-info-item title">{{item.empower.title}}(第{{item.semester.no}}期)</view>
                <view class="vouchers-info-item">报名人：{{item.name}}</view>
                <view class="vouchers-info-item">有效期：{{item.semester.end}}</view>
            </view>
            <view class="vouchers-btns">
                <view class="vouchers-btn" bindtap="onShowLay" data-index="{{index}}">{{item.can_sign ? '立即使用': '查看凭证'}}</view>
            </view>
        </view>
    </block>
    <view class="pack-center pages-hint" wx:else>
        <image src="/static/imgs/text_null.png"></image>
        <view>暂无数据</view>
    </view>

    <!-- 核销弹出层 -->
    <view class="lay-back {{popupShow ? 'active' : ''}}"></view>
    <view class="lay-info {{popupShow ? 'active' : ''}}">
        <block wx:if="{{vouchers.length > 0}}">
            <view class="lay-title">报名信息<image class="lay-title-icon" bindtap="usersHide" src="/static/icons/close.png"></image></view>
            <view class="lay-content">
                <view class="lay-item">
                    <label>报名课程</label>
                    <view class="lay-item-val">{{vouchers[layIndex].empower.title}}</view>
                </view>
                <view class="lay-item">
                    <label>学期名称</label>
                    <view class="lay-item-val">{{vouchers[layIndex].empower.subtitle}}</view>
                </view>
                <view class="lay-item">
                    <label>报名姓名</label>
                    <view class="lay-item-val">{{vouchers[layIndex].name}}</view>
                </view>
                <view class="lay-item">
                    <label>报名电话</label>
                    <view class="lay-item-val">{{vouchers[layIndex].mobile}}</view>
                </view>
                <view class="lay-item">
                    <label>开始时间</label>
                    <view class="lay-item-val">{{vouchers[layIndex].semester.start}}</view>
                </view>
                <view class="lay-item">
                    <label>结束时间</label>
                    <view class="lay-item-val">{{vouchers[layIndex].semester.end}}</view>
                </view>
                <view class="lay-item">
                    <label>课程地点</label>
                    <view class="lay-item-val">{{vouchers[layIndex].semester.address}}</view>
                </view>
            </view>
            <view class="lay-border"></view>
            <view class="lay-content">
                <view class="lay-item">
                    <label>签到状态</label>
                    <view class="lay-item-val bold">{{vouchers[layIndex].can_sign ? '未签到': '已签到'}}</view>
                </view>
                <view class="lay-item" wx:if="{{!vouchers[layIndex].can_sign}}">
                    <label>签到时间</label>
                    <view class="lay-item-val">{{vouchers[layIndex].sign_at}}</view>
                </view>
            </view>
            <view class="lay-btns">
                <button class="lay-btn" disabled="{{!vouchers[layIndex].can_sign}}" bindtap="onSign" data-id="{{vouchers[layIndex].item_id}}">{{vouchers[layIndex].can_sign ? '签到': '已签到'}}</button>
            </view>
        </block>
    </view>
</view>