<!--components/static/coupon-popup/coupon-popup.wxml-->
<popup visible="{{visible}}" bind:close="closePopup">
    <view slot="header" class="popup-header">
        选择优惠券
    </view>

    <view class="list-container">
        <view wx:for="{{couponList}}" wx:key="name" class="large" data-index="{{index}}">
            <view class="large-left">
                <view class="amount">{{'￥'+item.discountPrice}}</view>
                <view class="min-price">满{{item.usePrice}}元可用</view>
                <view class="min-price">剩余{{item.count}}张</view>
            </view>
            <view class="large-center"></view>
            <view class="large-right">
                <view class="large-title">
                    <tag propStyle="background: rgba(0, 0, 0, 0.2);border:none;color:white;">
                        {{item.discountType===1?'代金券':'折扣券'}}
                    </tag>
                    <view class="name">{{item.name}}</view>
                </view>
                <view class="desc">优惠开始时间：{{item.validStartTime}}</view>
                <view class="desc">优惠结束时间：{{item.validEndTime}}</view>
                <div class="large-bottom">
                    <div class="id">ID：{{item.couponIds}}</div>
                    <button class="button large-button" data-index="{{index}}" bind:tap="handleSelect">选择</button>
                </div>
            </view>
        </view>
    </view>

    <view class="no-use" bind:tap="handleSelect">
        不使用优惠券
    </view>
    <view style="height:{{hasTabBar? safeBottom/2 + 90  : safeBottom}}rpx;"></view>
</popup>