order.hbs 3.35 KB
<div class="order" data-id="{{orderNum}}" data-href="{{detailUrl}}">
    <header class="header">
        订单编号:{{orderNum}}
        <span class="order-status">{{orderStatus}}</span>
    </header>
    <section class="order-goods">
        {{# goods}}
            {{> order/good}}
        {{/ goods}}
    </section>
    <footer class="footer">
{{count}}件商品  实付<span class="sum-cost">¥{{sumCost}}</span>
        {{#shippingCost}}(含运费¥{{.}}){{/shippingCost}}
    </footer>

    {{!-- 对应订单状态的操作逻辑 --}}
    {{#if isDepositAdvance}}
        <div class="order-opt">
          <span class="order-opt-info">请到App完成订单相关操作</span>
        </div>
    {{^}}
        {{!-- 完成和取消订单显示删除按钮 --}}
        {{#unless isAdvance}}
            {{#unless unpaid}}
                <div class="order-opt">
                    {{#unless unreceived}}
                        <span class="btn del">删除订单</span>
                        {{#if isVirtual}}
                            <!--虚拟商品-->
                        {{else}}
                            {{#unless useLimitCode}}<span class="btn rebuy">再次购买</span>{{/unless}}
                        {{/if}}
                    {{/unless}}

                    {{#if qrcode}}
                        <a class="locHref" href="{{qrcode}}">
                            <span class="btn check-logistics">查看二维码</span>
                        </a>
                    {{/if}}

                    {{!-- 申请退款 --}}
                    {{#if refundApply}}
                         <span class="btn refund">申请退款</span>
                    {{/if}}
                    {{!-- 修改地址 --}}
                    {{#if modifyAddress.modifyAddress}}
                        <a class="btn btn-add-change" href="{{modifyAddress.modifyAddressUrl}}">
                            <span>修改地址</span>
                        </a>
                    {{/if}}
                </div>
            {{/unless}}
        {{/unless}}

        {{#unless isAdvance}}
            {{#if unpaid}}
                <div class="order-opt">
                    <ul class="count-down hide">
                        <li>
                            <span class="iconfont count-down-icon">&#xe64a;</span>
                        </li>
                        <li>
                            <span class="hours">{{leftTime}}</span>
                        </li>
                    </ul>
                    <span class="btn cancel">取消订单</span>
                    {{#if payUrl}}
                        <a class="locHref" href="{{payUrl}}">
                            <span class="btn pay">立即付款</span>
                        </a>
                    {{/if}}
                </div>
            {{/if}}
        {{^}}
            <div class="order-opt">
                *定金预售订单只能在APP端操作
            </div>
        {{/unless}}

        {{!-- 包含未发货和已发货状态,未发货不传logisticsUrl --}}
        {{#if unreceived}}
            {{#if logisticsUrl}}
                <div class="order-opt">
                    <a class="locHref" href="{{logisticsUrl}}">
                        <span class="btn check-logistics">查看物流</span>
                    </a>
                </div>
            {{/if}}
        {{/if}}

    {{/if}}
</div>