select-coupons.hbs 5.13 KB
{{#result}}
<section>
    <div class="filter-box">
        <span class="filter-btn valid active" data-num="{{usableCouponNumStr}}">可用({{usableCouponNumStr}})</span>
        <span class="filter-btn invalid" data-num="{{unusableCouponNumStr}}">不可用({{unusableCouponNumStr}})</span>
    </div>
    <div class="exchange-box">
        <input type="text" name="couponCodeInput" placeholder="请输入优惠券码">
        <button id="exchangeCouponBtn" class="exchange-coupon-btn">兑换</button>
    </div>
    <div class="tip-box{{#if noShowTips}} hide{{/if}}">
        <div class="tips">
            {{{headMsg}}}
        </div>
        <div class="tip-close">
            <span class="iconfont">&#xe623;</span>
        </div>
    </div>
    <div class="coupon-list usable">
        {{#usableCouponsList}}
            {{#each ./coupons}}
                <div class="coupon{{#isEqualOr is_selected_support 'N'}} no-support-selected{{/isEqualOr}}" data-code="{{coupon_code}}">
                    <div class="coupon-left{{#isEqualOr is_selected_support 'Y'}}
                        {{#isEqualOr catalog 200}} coupon-left-activity{{/isEqualOr}}
                        {{#isEqualOr catalog 300}} coupon-left-freight{{/isEqualOr}}
                        {{#isEqualOr catalog 100}} coupon-left-shop{{/isEqualOr}}
                    {{/isEqualOr}}">
                        <p class="value">
                            <span>{{coupon_value_str}}</span>
                        </p>
                        <p class="threshold">{{use_rule}}</p>
                    </div>
                    <div class="coupon-right">
                        <div class="info">
                            <p class="title">
                                <span>[{{catalog_name}}]</span> {{coupon_name}}</p>
                            <p class="time">{{coupon_validity}}</p>
                            {{#isEqualOr is_selected_support 'N'}}
                            <p class="desc">{{desc}}</p>
                            {{/isEqualOr}}
                        </div>
                        <div class="check">
                            {{#isEqualOr is_selected_support 'Y'}}
                            <span class="iconfont checkbox{{#isEqualOr selected 'Y'}} icon-cb-radio{{^}} icon-radio{{/isEqualOr}}"></span>
                            {{^}}
                            <span class="iconfont icon-point1"></span>
                            {{/isEqualOr}}
                        </div>
                    </div>
                    {{#isEqualOr is_overdue_soon 'Y'}}
                    <span class="top-tip"></span>
                    {{/isEqualOr}}
                </div>
            {{/each}}
            {{/ usableCouponsList}}
            {{#isEqualOr usableCouponNumStr '0'}}
            <div class="no-conpon-now">
                <div class="icon-not"></div>
                <p>暂无优惠券</p>
            </div>
            {{/isEqualOr}}
    </div>
    <div class="coupon-list unusable hide">
        {{#unusableCouponsList}}
            {{#if ./name}}
            <div class="coupon-list-type"><hr><span>{{./name}}</span><hr></div>
            {{/if}}
            {{#each ./coupons}}
                <div class="coupon">
                    <div class="coupon-left{{#isEqualOr catalog 200}} coupon-left-activity{{/isEqualOr}}{{#isEqualOr catalog 300}} coupon-left-freight{{/isEqualOr}}{{#isEqualOr catalog 100}} coupon-left-shop{{/isEqualOr}}">
                        <p class="value">
                            <span>{{coupon_value_str}}</span>
                        </p>
                        <p class="threshold">{{use_rule}}</p>
                    </div>
                    <div class="coupon-right">
                        <div class="info">
                            <p class="title">
                                <span class="{{#isEqualOr catalog 200}} type-activity{{/isEqualOr}}{{#isEqualOr catalog 300}} type-freight{{/isEqualOr}}{{#isEqualOr catalog 100}} type-shop{{/isEqualOr}}">[{{catalog_name}}]</span> {{coupon_name}}</p>
                            <p class="time">{{coupon_validity}}</p>
                            <p class="desc unusable-desc">{{desc}}</p>
                        </div>
                    </div>
                    {{#isEqualOr is_overdue_soon 'Y'}}
                    <span class="top-tip"></span>
                    {{/isEqualOr}}
                </div>
            {{/each}}
            {{/ unusableCouponsList}}
            {{#isEqualOr unusableCouponNumStr '0'}}
                <div class="no-conpon-now">
                    <div class="icon-not"></div>
                    <p>暂无优惠券</p>
                </div>
            {{/isEqualOr}}
    </div>
    <div class="use-now" id="useNowBox">
        {{#couponPay}}
        <div class="left-info">
            <p>已选择
                <span class="nums">{{coupon_count}}</span> 张,共优惠
                <span class="nums">{{coupon_amount_str}}</span></p>
            <p>待支付
                <span class="nums">{{to_pay_amount_str}}</span></p>
        </div>
        {{/ couponPay}}
        <button class="use-now-btn" id="useNowBtn">确认</button>
    </div>
    {{/ result}}
</section>