cart-list.hbs 12.3 KB
<div id="cart_content">
    {{> common/cart-list-header}}
    {{> common/cart-list-body}}
    {{> common/statement}}
</div>

<script id="cart-content-tpl" type="text/html">
    <div class="cart-header">
        <div class="titles">
            <div class="item">
                <label id="toggle_check" class="toggle-chk chk-all \{{#if checkAll}}chk-group\{{/if}}">
                    <span class="iconfont checkbox not-checked">&#xe601;</span>
                    <span class="iconfont checkbox checked">&#xe602;</span>
                    全选
                </label>
            </div>
            <div class="item product">货品</div>
            <div class="item price">价格</div>
            <div class="item num">数量</div>
            <div class="item pro-total-price">总价</div>
            <div class="item actions">操作</div>
        </div>
    </div>
    \{{# if preSalePros}}
        <div class="cart-pro-list pre-pros">
            <div class="title">
                <span class="main">预售商品</span>
                <span class="note">不同上市期的商品我们将为您先到先发</span>
            </div>
            <div class="pro-list">
                \{{#each preSalePros}}
                    <div class="pros-group">
                        \{{# each this}}
                            <ul>
                                <li class="chk" data-product_info='{"goods_type": "advance", "buy_number": \{{buy_number}}, "selected": "\{{selected}}", "product_sku": "\{{product_sku}}", "promotion_id": 0}'>
                                    <label class="toggle-chk-item \{{#isEqual selected 'Y'}}chk-group\{{/isEqual}}">
                                        <span class="iconfont checkbox not-checked">&#xe601;</span>
                                        <span class="iconfont checkbox checked">&#xe602;</span>
                                    </label>
                                    <input type="hidden" name="product_ids[]"/>
                                </li>
                                <li>
                                    <img src="\{{image goods_images 100 134}}" alt="\{{product_name}}">
                                </li>
                                <li class="pro-info">
                                   \{{!--  <div class="brand-name">\{{brand_name}}</div> --}}
                                    <div class="pro-name">\{{product_name}}</div>
                                    <div class="size">
                                        \{{#if size_name}}
                                            <span>尺寸: \{{size_name}}</span>
                                        \{{/if}}
                                    </div>
                                    \{{#expect_arrival_time}}
                                        <div class="published-at">上市期: \{{expect_arrival_time}}</div>
                                    \{{/expect_arrival_time}}
                                </li>
                                <li class="price-num">
                                    <span class="price sale-price">¥\{{sales_price}}</span>
                                    <div class="stepper" data-productId=\{{productId}}>
                                        <div class="minus action">
                                            <span class="iconfont">&#xe621;</span>
                                        </div>
                                        <div class="num">
                                            <input type="text" class="input" value=\{{buy_number}} />
                                        </div>
                                        <div class="plus action">
                                            <span class="iconfont">&#xe61f;</span>
                                        </div>
                                    </div>
                                </li>
                                <li class="total-price-action">
                                    <span class="price item-total-price">¥\{{multiple sales_price buy_number}}</span>
                                    <div class="actions">
                                        <div class="remove-item action" data-product_id=\{{product_id}}><span class="iconfont">&#xe614;</span> &nbsp;删&nbsp;&nbsp;&nbsp;&nbsp;除</div>
                                        <div class="send-to-favorite action" data-product_id=\{{product_id}}>移入收藏夹</div>
                                    </div>
                                </li>
                            </ul>
                        \{{/each}}
                    </div>
                \{{/each}}
            </div>
        </div>
    \{{/ if}}

    \{{# if commonPros }}
        <div class="cart-pro-list common-pros">
            <div class="title">
                <span class="main">普通商品</span>
            </div>
            <div class="pro-list">
                \{{#each commonPros}}
                    <div class="pros-group">
                        \{{# each this}}
                            <ul>
                                <li class="chk" data-product_info='{"goods_type": "ordinary", "buy_number": \{{buy_number}}, "selected": "\{{selected}}", "product_sku": "\{{product_sku}}", "promotion_id": 0}'>
                                    <label class="toggle-chk-item \{{#isEqual selected 'Y'}}chk-group\{{/isEqual}}">
                                        <span class="iconfont checkbox not-checked">&#xe601;</span>
                                        <span class="iconfont checkbox checked">&#xe602;</span>
                                    </label>
                                    <input type="hidden" name="product_ids[]"/>
                                </li>
                                <li>
                                    <img src="\{{image goods_images 100 134}}" alt="\{{product_name}}">
                                </li>
                                <li class="pro-info">
                                    \{{!-- <div class="brand-name">\{{brandName}}</div> --}}
                                    <div class="pro-name">\{{product_name}}</div>
                                    <div class="color-size editable" data-product_id=\{{product_id}} id="edit_\{{product_id}}">
                                        \{{#if color_name}}
                                            <span class="mr20">颜色: \{{color_name}}</span>
                                        \{{/if}}
                                        \{{#if size_name}}
                                            <span>尺寸: \{{size_name}}</span>
                                        \{{/if}}
                                        <span class="iconfont">&#xe63c;</span>
                                    </div>
                                </li>
                                <li class="price-num">
                                    <span class="price sale-price">¥\{{sales_price}}</span>
                                    <div class="stepper" data-productId=\{{productId}}>
                                        <div class="minus action">
                                            <span class="iconfont">&#xe621;</span>
                                        </div>
                                        <div class="num">
                                            <input type="text" class="input" value=\{{buy_number}} />
                                        </div>
                                        <div class="plus action">
                                            <span class="iconfont">&#xe61f;</span>
                                        </div>
                                    </div>
                                </li>
                                <li class="total-price-action">
                                    <span class="price item-total-price">¥\{{multiple sales_price buy_number}}</span>
                                    <div class="actions">
                                        <div class="remove-item action" data-product_id=\{{product_id}}><span class="iconfont">&#xe614;</span> &nbsp;删&nbsp;&nbsp;&nbsp;&nbsp;除</div>
                                        <div class="send-to-favorite action" data-product_id=\{{product_id}}>移入收藏夹</div>
                                    </div>
                                </li>
                            </ul>
                        \{{/each}}
                    </div>
                \{{/each}}
            </div>
        </div>
    \{{/ if}}

    \{{# if invalidPros}}
        <div class="cart-pro-list invalid-pros">
            <div class="pro-list">
                \{{#each invalidPros}}
                    <ul>
                        <li class="chk">
                            <span class="iconfont warning">&#xe625;</span>
                        </li>
                                <li>
                                    <img src="\{{image defaultImages 100 134}}" alt="\{{productName}}">
                                </li>
                                <li class="pro-info">
                                    <div class="brand-name">\{{brandName}}</div>
                                    <div class="pro-name">\{{productName}}</div>
                                    <div class="size">尺寸: USB</div>
                                    <div class="published-at">上市期: 2016年8月</div>
                                </li>
                                <li class="price-num">
                                    <span class="price sale-price">¥\{{salesPrice}}</span>
                                    <div class="stepper" data-productId=\{{productId}}>
                                        <div class="minus action">
                                            <span class="iconfont">&#xe621;</span>
                                        </div>
                                        <div class="num">
                                            <input type="text" class="input" value=\{{buy_number}} />
                                        </div>
                                        <div class="plus action">
                                            <span class="iconfont">&#xe61f;</span>
                                        </div>
                                    </div>
                                </li>
                                <li class="total-price-action">
                                    <span class="price item-total-price">¥1289.00</span>
                                    <div class="actions">
                                        <div class="remove-item action" data-product_id=\{{product_id}}><span class="iconfont">&#xe614;</span> &nbsp;删&nbsp;&nbsp;&nbsp;&nbsp;除</div>
                                        <div class="send-to-favorite action" data-product_id=\{{product_id}}>移入收藏夹</div>
                                    </div>
                                </li>
                    </ul>
                \{{/each}}
            </div>
        </div>
    \{{/ if}}

    <div class="cart-statement">
        <div class="actions">
            <div class="action">
                <label id="toggle_check" class="toggle-chk chk-all \{{#if checkAll}}chk-group\{{/if}}">
                    <span class="iconfont checkbox not-checked">&#xe601;</span>
                    <span class="iconfont checkbox checked">&#xe602;</span>
                    <span>全选</span>
                </label>
            </div>
            <div id="remove_selected" class="action hoverable">删除选中的商品</div>
            <div id="send_favorite" class="action hoverable">移入收藏夹</div>
            <div id="clear_invalid" class="action hoverable">清除实效商品</div>
            <div class="selected-num">已选<span>\{{selectedNum}}</span>件</div>
            <div class="checkout-total">
                <div class="total-title">商品金额:</div>
                <div class="total-money">¥<span>58999.00</span></div>
            </div>
        </div>
        <div class="calculate">
            <div class="checkout-total pay-total">
                <div class="pay-title">应付金额(不含运费):</div>
                <div class="total-money">¥<span>58999.00</span></div>
            </div>
        </div>
        <div class="checkout">
            <a href="/" class="go-to-checkout">
                <span class="btn disable" id="checkout_btn">去结算</span>
            </a>
        </div>
    </div>
</script>