Authored by jinhu.tung

Merge branch 'feature/shopping' into release/1.0

1 {{> sign-header}} 1 {{> sign-header}}
2 <div class="blk-page center-content"> 2 <div class="blk-page center-content">
3 - {{> bc-nav}}  
4 - {{> cart/info}} 3 + {{> bc-nav}}
  4 + {{> cart/info}}
  5 + <div id="cart_content">
5 {{#if hasGoods}} 6 {{#if hasGoods}}
6 {{> cart-list}} 7 {{> cart-list}}
7 {{^}} 8 {{^}}
8 {{> cart/empty-cart}} 9 {{> cart/empty-cart}}
9 {{/if}} 10 {{/if}}
10 - {{!-- <button id="add_to_cart1">添加到购物车 1413600 number 1</button> --}} 11 + </div>
  12 + {{!-- <button id="add_to_cart1">添加到购物车 1413600 number 1</button> --}}
11 </div> 13 </div>
12 14
13 <script id="edit-color-size-tpl" type="text/html"> 15 <script id="edit-color-size-tpl" type="text/html">
@@ -72,3 +74,249 @@ @@ -72,3 +74,249 @@
72 </div> 74 </div>
73 </div> 75 </div>
74 </script> 76 </script>
  77 +
  78 +<script id="cart-content-tpl" type="text/html">
  79 + <div class="cart-header">
  80 + <div class="titles">
  81 + <div class="item">
  82 + <label id="toggle_check" class="toggle-chk chk-all \{{#if checkAll}}chk-group\{{/if}}">
  83 + <span class="iconfont checkbox not-checked">&#xe601;</span>
  84 + <span class="iconfont checkbox checked">&#xe602;</span>
  85 + 全选
  86 + </label>
  87 + </div>
  88 + <div class="item product">货品</div>
  89 + <div class="item price">价格</div>
  90 + <div class="item num">数量</div>
  91 + <div class="item pro-total-price">总价</div>
  92 + <div class="item actions">操作</div>
  93 + </div>
  94 + </div>
  95 + \{{# if preSalePros}}
  96 + <div class="cart-pro-list pre-pros">
  97 + <div class="title">
  98 + <span class="main">预售商品</span>
  99 + <span class="note">不同上市期的商品我们将为您先到先发</span>
  100 + </div>
  101 + <div class="pro-list">
  102 + \{{#each preSalePros}}
  103 + <div class="pros-group">
  104 + \{{# each this}}
  105 + <ul>
  106 + <li class="chk" data-product_info='{"goods_type": "advance", "buy_number": \{{buy_number}}, "selected": "\{{selected}}", "product_sku": "\{{product_sku}}", "promotion_id": 0}'>
  107 + <label class="toggle-chk-item \{{#isEqual selected 'Y'}}chk-group\{{/isEqual}}">
  108 + <span class="iconfont checkbox not-checked">&#xe601;</span>
  109 + <span class="iconfont checkbox checked">&#xe602;</span>
  110 + </label>
  111 + <input type="hidden" name="product_ids[]"/>
  112 + </li>
  113 + <li>
  114 + <a href="/product/pro_\{{product_id}}_\{{goods_id}}/\{{cn_alphabet}}.html" target="_blank">
  115 + <img src="\{{image goods_images 100 134}}" alt="\{{product_name}}">
  116 + </a>
  117 + </li>
  118 + <li class="pro-info">
  119 + \{{!-- <div class="brand-name">\{{brand_name}}</div> --}}
  120 + <div class="pro-name"><a href="/product/pro_\{{product_id}}_\{{goods_id}}/\{{cn_alphabet}}.html" target="_blank">\{{product_name}}</a></div>
  121 + <div class="size">
  122 + \{{#if size_name}}
  123 + <span>尺寸: \{{size_name}}</span>
  124 + \{{/if}}
  125 + </div>
  126 + \{{#expect_arrival_time}}
  127 + <div class="published-at">上市期: \{{expect_arrival_time}}</div>
  128 + \{{/expect_arrival_time}}
  129 + </li>
  130 + <li class="price-num">
  131 + <span class="price sale-price">¥ \{{round sales_price 2}}</span>
  132 + <div class="stepper" data-productType=\{{goods_type}}>
  133 + <div class="minus action \{{#isEqual buy_number 1}}disable\{{/isEqual}}">
  134 + <span class="iconfont">&#xe621;</span>
  135 + </div>
  136 + <div class="num">
  137 + <input type="text" class="input" value=\{{buy_number}} />
  138 + </div>
  139 + <div class="plus action \{{#isEqual left_number 0}}disable\{{/isEqual}}">
  140 + <span class="iconfont">&#xe61f;</span>
  141 + </div>
  142 + <div class="warning">
  143 + \{{showStorage left_number}}
  144 + </div>
  145 + </div>
  146 + </li>
  147 + <li class="total-price-action">
  148 + <span class="price item-total-price">¥ \{{round (multiple sales_price buy_number) 2}}</span>
  149 + <div class="actions">
  150 + <div class="remove-item action" data-product_id=\{{product_id}}><span class="iconfont">&#xe614;</span> &nbsp;删&nbsp;&nbsp;&nbsp;&nbsp;除</div>
  151 + <div class="send-to-favorite action" data-product_id=\{{product_id}}>移入收藏夹</div>
  152 + </div>
  153 + </li>
  154 + </ul>
  155 + \{{/each}}
  156 + </div>
  157 + \{{/each}}
  158 + </div>
  159 + </div>
  160 + \{{/ if}}
  161 +
  162 + \{{# if commonPros }}
  163 + <div class="cart-pro-list cart-pros">
  164 + <div class="title">
  165 + <span class="main">普通商品</span>
  166 + </div>
  167 + <div class="pro-list">
  168 + \{{#each commonPros}}
  169 + <div class="pros-group">
  170 + \{{# each this}}
  171 + <ul>
  172 + <li class="chk" data-product_info='{"goods_type": "ordinary", "buy_number": \{{buy_number}}, "selected": "\{{selected}}", "product_sku": "\{{product_sku}}", "promotion_id": 0}'>
  173 + <label class="toggle-chk-item \{{#isEqual selected 'Y'}}chk-group\{{/isEqual}}">
  174 + <span class="iconfont checkbox not-checked">&#xe601;</span>
  175 + <span class="iconfont checkbox checked">&#xe602;</span>
  176 + </label>
  177 + <input type="hidden" name="product_ids[]"/>
  178 + </li>
  179 + <li>
  180 + <a href="/product/pro_\{{product_id}}_\{{goods_id}}/\{{cn_alphabet}}.html" target="_blank">
  181 + <img src="\{{image goods_images 100 134}}" alt="\{{product_name}}">
  182 + </a>
  183 + </li>
  184 + <li class="pro-info">
  185 + \{{!-- <div class="brand-name">\{{brandName}}</div> --}}
  186 + <div class="pro-name"><a href="/product/pro_\{{product_id}}_\{{goods_id}}/\{{cn_alphabet}}.html" target="_blank">\{{product_name}}</a></div>
  187 + <div class="color-size editable" data-product_id=\{{product_id}} id="edit_\{{product_id}}">
  188 + \{{#if color_name}}
  189 + <span class="mr20">颜色: \{{color_name}}</span>
  190 + \{{/if}}
  191 + \{{#if size_name}}
  192 + <span>尺寸: \{{size_name}}</span>
  193 + \{{/if}}
  194 + <span class="iconfont">&#xe63c;</span>
  195 + </div>
  196 + </li>
  197 + <li class="price-num">
  198 + <span class="price sale-price">¥ \{{round sales_price 2}}</span>
  199 + <div class="stepper" data-productType=\{{goods_type}}>
  200 + <div class="minus action \{{#isEqual buy_number 1}}disable\{{/isEqual}}">
  201 + <span class="iconfont">&#xe621;</span>
  202 + </div>
  203 + <div class="num">
  204 + <input type="text" class="input" value=\{{buy_number}} />
  205 + </div>
  206 + <div class="plus action \{{#isEqual left_number 0}}disable\{{/isEqual}}">
  207 + <span class="iconfont">&#xe61f;</span>
  208 + </div>
  209 + <div class="warning">
  210 + \{{showStorage left_number}}
  211 + </div>
  212 + </div>
  213 + </li>
  214 + <li class="total-price-action">
  215 + <span class="price item-total-price">¥ \{{round (multiple sales_price buy_number) 2}}</span>
  216 + <div class="actions">
  217 + <div class="remove-item action" data-product_id=\{{product_id}}><span class="iconfont">&#xe614;</span> &nbsp;删&nbsp;&nbsp;&nbsp;&nbsp;除</div>
  218 + <div class="send-to-favorite action" data-product_id=\{{product_id}}>移入收藏夹</div>
  219 + </div>
  220 + </li>
  221 + </ul>
  222 + \{{/each}}
  223 + </div>
  224 + \{{/each}}
  225 + </div>
  226 + </div>
  227 + \{{/ if}}
  228 +
  229 + \{{# if invalidPros}}
  230 + <div class="cart-pro-list invalid-pros">
  231 + <div class="pro-list">
  232 + \{{#each invalidPros}}
  233 + <ul>
  234 + <li class="chk">
  235 + <span class="iconfont warning">&#xe625;</span>
  236 + </li>
  237 + <li>
  238 + <a href="/product/pro_\{{product_id}}_\{{goods_id}}/\{{cn_alphabet}}.html" target="_blank">
  239 + <img src="\{{image goods_images 100 134}}" alt="\{{product_name}}">
  240 + </a>
  241 + </li>
  242 + <li class="pro-info">
  243 + <div class="pro-name"><a href="/product/pro_\{{product_id}}_\{{goods_id}}/\{{cn_alphabet}}.html" target="_blank">\{{product_name}}</a></div>
  244 + <div>
  245 + \{{#if color_name}}
  246 + <span class="mr20">颜色: \{{color_name}}</span>
  247 + \{{/if}}
  248 + \{{#if size_name}}
  249 + <span>尺寸: \{{size_name}}</span>
  250 + \{{/if}}
  251 + </div>
  252 + </li>
  253 + <li class="price-num">
  254 + <span class="price sale-price">¥ \{{round salesPrice 2}}</span>
  255 + <div class="stepper" data-productType=\{{goods_type}}>
  256 + <div class="minus action \{{#isEqual buy_number 1}}disable\{{/isEqual}}">
  257 + <span class="iconfont">&#xe621;</span>
  258 + </div>
  259 + <div class="num">
  260 + <input type="text" class="input" value=\{{buy_number}} />
  261 + </div>
  262 + <div class="plus action \{{#isEqual left_number 0}}disable\{{/isEqual}}">
  263 + <span class="iconfont">&#xe61f;</span>
  264 + </div>
  265 + <div class="warning">
  266 + \{{showStorage left_number}}
  267 + </div>
  268 + </div>
  269 + </li>
  270 + <li class="total-price-action">
  271 + <span class="price item-total-price">¥ \{{round (multiple sales_price buy_number) 2}}</span>
  272 + <div class="actions">
  273 + <div class="remove-item action" data-product_id=\{{product_id}}><span class="iconfont">&#xe614;</span> &nbsp;删&nbsp;&nbsp;&nbsp;&nbsp;除</div>
  274 + <div class="send-to-favorite action" data-product_id=\{{product_id}}>移入收藏夹</div>
  275 + </div>
  276 + </li>
  277 + </ul>
  278 + \{{/each}}
  279 + </div>
  280 + </div>
  281 + \{{/ if}}
  282 +
  283 + <div class="cart-statement">
  284 + <div class="actions">
  285 + <div class="action">
  286 + <label id="toggle_check" class="toggle-chk chk-all \{{#if checkAll}}chk-group\{{/if}}">
  287 + <span class="iconfont checkbox not-checked">&#xe601;</span>
  288 + <span class="iconfont checkbox checked">&#xe602;</span>
  289 + <span>全选</span>
  290 + </label>
  291 + </div>
  292 + <div id="remove_selected" class="action hoverable">删除选中的商品</div>
  293 + <div id="send_favorite" class="action hoverable">移入收藏夹</div>
  294 + <div id="warning_invalid" class="action hoverable">清除实效商品</div>
  295 + <div class="selected-num">已选<span>\{{selectedNum}}</span>件</div>
  296 + <div class="checkout-total">
  297 + <div class="total-title">商品金额:</div>
  298 + <div class="total-money">¥ <span>\{{totalMoney}}</span></div>
  299 + </div>
  300 + </div>
  301 + <div class="calculate">
  302 + <div class="checkout-total pay-total">
  303 + <div class="pay-title">应付金额(不含运费):</div>
  304 + <div class="total-money">¥ <span>\{{totalMoney}}</span></div>
  305 + </div>
  306 + </div>
  307 + <div class="checkout">
  308 + <span class="btn \{{#unless selectedNum}}disable\{{/unless}}" id="checkout_btn">去结算</span>
  309 + </div>
  310 + </div>
  311 +</script>
  312 +
  313 +<script id="empty-cart-tpl" type="text/html">
  314 + <div class="empty-cart">
  315 + <div class="empty-cart-bg">
  316 + </div>
  317 + <p class="empty-cart-info">购物袋空空的哦,去看看心仪的商品吧~</p>
  318 + <a href="/" class="go-to-shop">
  319 + <span class="btn white">去购物</span>
  320 + </a>
  321 + </div>
  322 +</script>
1 <div class="cart-bc"> 1 <div class="cart-bc">
2 <ul class="breadcrumb"> 2 <ul class="breadcrumb">
3 - <li class="level-1{{#isEqual bcNavFocus 1}} current{{/isEqual}}"><a href="/">我的购物袋<em></em><i></i></a></li>  
4 - <li class="level-2{{#isEqual bcNavFocus 2}} current{{/isEqual}}"><a href="/vehicles/">填写核对订单信息<em></em><i></i></a></li>  
5 - <li class="level-3{{#isEqual bcNavFocus 3}} current{{/isEqual}}"><a href="/vehicles/vans/">成功提交订单<em></em><i></i></a></li> 3 + <li class="level-1{{#isEqual bcNavFocus 1}} current{{/isEqual}}"><a href="javascript:void(0)" >我的购物袋<em></em><i></i></a></li>
  4 + <li class="level-2{{#isEqual bcNavFocus 2}} current{{/isEqual}}"><a href="javascript:void(0)">填写核对订单信息<em></em><i></i></a></li>
  5 + <li class="level-3{{#isEqual bcNavFocus 3}} current{{/isEqual}}"><a href="javascript:void(0)">成功提交订单<em></em><i></i></a></li>
6 </ul> 6 </ul>
7 </div> 7 </div>
1 -<div id="cart_content"> 1 +<div id="cart_list">
2 {{> cart/cart-list-header}} 2 {{> cart/cart-list-header}}
3 {{> cart/cart-list-body}} 3 {{> cart/cart-list-body}}
4 {{> cart/statement}} 4 {{> cart/statement}}
5 -</div>  
6 -  
7 -<script id="cart-content-tpl" type="text/html">  
8 - <div class="cart-header">  
9 - <div class="titles">  
10 - <div class="item">  
11 - <label id="toggle_check" class="toggle-chk chk-all \{{#if checkAll}}chk-group\{{/if}}">  
12 - <span class="iconfont checkbox not-checked">&#xe601;</span>  
13 - <span class="iconfont checkbox checked">&#xe602;</span>  
14 - 全选  
15 - </label>  
16 - </div>  
17 - <div class="item product">货品</div>  
18 - <div class="item price">价格</div>  
19 - <div class="item num">数量</div>  
20 - <div class="item pro-total-price">总价</div>  
21 - <div class="item actions">操作</div>  
22 - </div>  
23 - </div>  
24 - \{{# if preSalePros}}  
25 - <div class="cart-pro-list pre-pros">  
26 - <div class="title">  
27 - <span class="main">预售商品</span>  
28 - <span class="note">不同上市期的商品我们将为您先到先发</span>  
29 - </div>  
30 - <div class="pro-list">  
31 - \{{#each preSalePros}}  
32 - <div class="pros-group">  
33 - \{{# each this}}  
34 - <ul>  
35 - <li class="chk" data-product_info='{"goods_type": "advance", "buy_number": \{{buy_number}}, "selected": "\{{selected}}", "product_sku": "\{{product_sku}}", "promotion_id": 0}'>  
36 - <label class="toggle-chk-item \{{#isEqual selected 'Y'}}chk-group\{{/isEqual}}">  
37 - <span class="iconfont checkbox not-checked">&#xe601;</span>  
38 - <span class="iconfont checkbox checked">&#xe602;</span>  
39 - </label>  
40 - <input type="hidden" name="product_ids[]"/>  
41 - </li>  
42 - <li>  
43 - <a href="/product/pro_\{{goods_id}}_\{{product_id}}/\{{cn_alphabet}}.html">  
44 - <img src="\{{image goods_images 100 134}}" alt="\{{product_name}}">  
45 - </a>  
46 - </li>  
47 - <li class="pro-info">  
48 - \{{!-- <div class="brand-name">\{{brand_name}}</div> --}}  
49 - <div class="pro-name"><a href="/product/pro_\{{goods_id}}_\{{product_id}}/\{{cn_alphabet}}.html">\{{product_name}}</a></div>  
50 - <div class="size">  
51 - \{{#if size_name}}  
52 - <span>尺寸: \{{size_name}}</span>  
53 - \{{/if}}  
54 - </div>  
55 - \{{#expect_arrival_time}}  
56 - <div class="published-at">上市期: \{{expect_arrival_time}}</div>  
57 - \{{/expect_arrival_time}}  
58 - </li>  
59 - <li class="price-num">  
60 - <span class="price sale-price">¥ \{{round sales_price 2}}</span>  
61 - <div class="stepper" data-productType=\{{goods_type}}>  
62 - <div class="minus action \{{#isEqual buy_number 1}}disable\{{/isEqual}}">  
63 - <span class="iconfont">&#xe621;</span>  
64 - </div>  
65 - <div class="num">  
66 - <input type="text" class="input" value=\{{buy_number}} />  
67 - </div>  
68 - <div class="plus action \{{#isEqual left_number 0}}disable\{{/isEqual}}">  
69 - <span class="iconfont">&#xe61f;</span>  
70 - </div>  
71 - <div class="warning">  
72 - \{{showStorage left_number}}  
73 - </div>  
74 - </div>  
75 - </li>  
76 - <li class="total-price-action">  
77 - <span class="price item-total-price">¥ \{{round (multiple sales_price buy_number) 2}}</span>  
78 - <div class="actions">  
79 - <div class="remove-item action" data-product_id=\{{product_id}}><span class="iconfont">&#xe614;</span> &nbsp;删&nbsp;&nbsp;&nbsp;&nbsp;除</div>  
80 - <div class="send-to-favorite action" data-product_id=\{{product_id}}>移入收藏夹</div>  
81 - </div>  
82 - </li>  
83 - </ul>  
84 - \{{/each}}  
85 - </div>  
86 - \{{/each}}  
87 - </div>  
88 - </div>  
89 - \{{/ if}}  
90 -  
91 - \{{# if commonPros }}  
92 - <div class="cart-pro-list cart-pros">  
93 - <div class="title">  
94 - <span class="main">普通商品</span>  
95 - </div>  
96 - <div class="pro-list">  
97 - \{{#each commonPros}}  
98 - <div class="pros-group">  
99 - \{{# each this}}  
100 - <ul>  
101 - <li class="chk" data-product_info='{"goods_type": "ordinary", "buy_number": \{{buy_number}}, "selected": "\{{selected}}", "product_sku": "\{{product_sku}}", "promotion_id": 0}'>  
102 - <label class="toggle-chk-item \{{#isEqual selected 'Y'}}chk-group\{{/isEqual}}">  
103 - <span class="iconfont checkbox not-checked">&#xe601;</span>  
104 - <span class="iconfont checkbox checked">&#xe602;</span>  
105 - </label>  
106 - <input type="hidden" name="product_ids[]"/>  
107 - </li>  
108 - <li>  
109 - <a href="/product/pro_\{{goods_id}}_\{{product_id}}/\{{cn_alphabet}}.html">  
110 - <img src="\{{image goods_images 100 134}}" alt="\{{product_name}}">  
111 - </a>  
112 - </li>  
113 - <li class="pro-info">  
114 - \{{!-- <div class="brand-name">\{{brandName}}</div> --}}  
115 - <div class="pro-name"><a href="/product/pro_\{{goods_id}}_\{{product_id}}/\{{cn_alphabet}}.html">\{{product_name}}</a></div>  
116 - <div class="color-size editable" data-product_id=\{{product_id}} id="edit_\{{product_id}}">  
117 - \{{#if color_name}}  
118 - <span class="mr20">颜色: \{{color_name}}</span>  
119 - \{{/if}}  
120 - \{{#if size_name}}  
121 - <span>尺寸: \{{size_name}}</span>  
122 - \{{/if}}  
123 - <span class="iconfont">&#xe63c;</span>  
124 - </div>  
125 - </li>  
126 - <li class="price-num">  
127 - <span class="price sale-price">¥ \{{round sales_price 2}}</span>  
128 - <div class="stepper" data-productType=\{{goods_type}}>  
129 - <div class="minus action \{{#isEqual buy_number 1}}disable\{{/isEqual}}">  
130 - <span class="iconfont">&#xe621;</span>  
131 - </div>  
132 - <div class="num">  
133 - <input type="text" class="input" value=\{{buy_number}} />  
134 - </div>  
135 - <div class="plus action \{{#isEqual left_number 0}}disable\{{/isEqual}}">  
136 - <span class="iconfont">&#xe61f;</span>  
137 - </div>  
138 - <div class="warning">  
139 - \{{showStorage left_number}}  
140 - </div>  
141 - </div>  
142 - </li>  
143 - <li class="total-price-action">  
144 - <span class="price item-total-price">¥ \{{round (multiple sales_price buy_number) 2}}</span>  
145 - <div class="actions">  
146 - <div class="remove-item action" data-product_id=\{{product_id}}><span class="iconfont">&#xe614;</span> &nbsp;删&nbsp;&nbsp;&nbsp;&nbsp;除</div>  
147 - <div class="send-to-favorite action" data-product_id=\{{product_id}}>移入收藏夹</div>  
148 - </div>  
149 - </li>  
150 - </ul>  
151 - \{{/each}}  
152 - </div>  
153 - \{{/each}}  
154 - </div>  
155 - </div>  
156 - \{{/ if}}  
157 -  
158 - \{{# if invalidPros}}  
159 - <div class="cart-pro-list invalid-pros">  
160 - <div class="pro-list">  
161 - \{{#each invalidPros}}  
162 - <ul>  
163 - <li class="chk">  
164 - <span class="iconfont warning">&#xe625;</span>  
165 - </li>  
166 - <li>  
167 - <a href="/product/pro_\{{goods_id}}_\{{product_id}}/\{{cn_alphabet}}.html">  
168 - <img src="\{{image goods_images 100 134}}" alt="\{{product_name}}">  
169 - </a>  
170 - </li>  
171 - <li class="pro-info">  
172 - <div class="pro-name"><a href="/product/pro_\{{goods_id}}_\{{product_id}}/\{{cn_alphabet}}.html">\{{product_name}}</a></div>  
173 - <div>  
174 - \{{#if color_name}}  
175 - <span class="mr20">颜色: \{{color_name}}</span>  
176 - \{{/if}}  
177 - \{{#if size_name}}  
178 - <span>尺寸: \{{size_name}}</span>  
179 - \{{/if}}  
180 - </div>  
181 - </li>  
182 - <li class="price-num">  
183 - <span class="price sale-price">¥ \{{round salesPrice 2}}</span>  
184 - <div class="stepper" data-productType=\{{goods_type}}>  
185 - <div class="minus action \{{#isEqual buy_number 1}}disable\{{/isEqual}}">  
186 - <span class="iconfont">&#xe621;</span>  
187 - </div>  
188 - <div class="num">  
189 - <input type="text" class="input" value=\{{buy_number}} />  
190 - </div>  
191 - <div class="plus action \{{#isEqual left_number 0}}disable\{{/isEqual}}">  
192 - <span class="iconfont">&#xe61f;</span>  
193 - </div>  
194 - <div class="warning">  
195 - \{{showStorage left_number}}  
196 - </div>  
197 - </div>  
198 - </li>  
199 - <li class="total-price-action">  
200 - <span class="price item-total-price">¥ \{{round (multiple sales_price buy_number) 2}}</span>  
201 - <div class="actions">  
202 - <div class="remove-item action" data-product_id=\{{product_id}}><span class="iconfont">&#xe614;</span> &nbsp;删&nbsp;&nbsp;&nbsp;&nbsp;除</div>  
203 - <div class="send-to-favorite action" data-product_id=\{{product_id}}>移入收藏夹</div>  
204 - </div>  
205 - </li>  
206 - </ul>  
207 - \{{/each}}  
208 - </div>  
209 - </div>  
210 - \{{/ if}}  
211 -  
212 - <div class="cart-statement">  
213 - <div class="actions">  
214 - <div class="action">  
215 - <label id="toggle_check" class="toggle-chk chk-all \{{#if checkAll}}chk-group\{{/if}}">  
216 - <span class="iconfont checkbox not-checked">&#xe601;</span>  
217 - <span class="iconfont checkbox checked">&#xe602;</span>  
218 - <span>全选</span>  
219 - </label>  
220 - </div>  
221 - <div id="remove_selected" class="action hoverable">删除选中的商品</div>  
222 - <div id="send_favorite" class="action hoverable">移入收藏夹</div>  
223 - <div id="warning_invalid" class="action hoverable">清除实效商品</div>  
224 - <div class="selected-num">已选<span>\{{selectedNum}}</span>件</div>  
225 - <div class="checkout-total">  
226 - <div class="total-title">商品金额:</div>  
227 - <div class="total-money">¥ <span>\{{totalMoney}}</span></div>  
228 - </div>  
229 - </div>  
230 - <div class="calculate">  
231 - <div class="checkout-total pay-total">  
232 - <div class="pay-title">应付金额(不含运费):</div>  
233 - <div class="total-money">¥ <span>\{{totalMoney}}</span></div>  
234 - </div>  
235 - </div>  
236 - <div class="checkout">  
237 - <a href="/" class="go-to-checkout">  
238 - <span class="btn \{{#unless selectedNum}}disable\{{/unless}}" id="checkout_btn">去结算</span>  
239 - </a>  
240 - </div>  
241 - </div>  
242 -</script>  
  5 +</div>
@@ -17,13 +17,13 @@ @@ -17,13 +17,13 @@
17 <input type="hidden" name="product_ids[]"/> 17 <input type="hidden" name="product_ids[]"/>
18 </li> 18 </li>
19 <li> 19 <li>
20 - <a href="/product/pro_{{goods_id}}_{{product_id}}/{{cn_alphabet}}.html"> 20 + <a href="/product/pro_{{product_id}}_{{goods_id}}/{{cn_alphabet}}.html" target="_blank">
21 <img src="{{image goods_images 100 134}}" alt="{{product_name}}"> 21 <img src="{{image goods_images 100 134}}" alt="{{product_name}}">
22 </a> 22 </a>
23 </li> 23 </li>
24 <li class="pro-info"> 24 <li class="pro-info">
25 {{!-- <div class="brand-name">{{brand_name}}</div> --}} 25 {{!-- <div class="brand-name">{{brand_name}}</div> --}}
26 - <div class="pro-name"><a href="/product/pro_{{goods_id}}_{{product_id}}/{{cn_alphabet}}.html">{{product_name}}</a></div> 26 + <div class="pro-name"><a href="/product/pro_{{product_id}}_{{goods_id}}/{{cn_alphabet}}.html" target="_blank">{{product_name}}</a></div>
27 <div class="size"> 27 <div class="size">
28 {{#if size_name}} 28 {{#if size_name}}
29 <span>尺寸: {{size_name}}</span> 29 <span>尺寸: {{size_name}}</span>
@@ -70,13 +70,13 @@ @@ -70,13 +70,13 @@
70 <input type="hidden" name="product_ids[]"/> 70 <input type="hidden" name="product_ids[]"/>
71 </li> 71 </li>
72 <li> 72 <li>
73 - <a href="/product/pro_{{goods_id}}_{{product_id}}/{{cn_alphabet}}.html"> 73 + <a href="/product/pro_{{product_id}}_{{goods_id}}/{{cn_alphabet}}.html" target="_blank">
74 <img src="{{image goods_images 100 134}}" alt="{{product_name}}"> 74 <img src="{{image goods_images 100 134}}" alt="{{product_name}}">
75 </a> 75 </a>
76 </li> 76 </li>
77 <li class="pro-info"> 77 <li class="pro-info">
78 {{!-- <div class="brand-name">{{brandName}}</div> --}} 78 {{!-- <div class="brand-name">{{brandName}}</div> --}}
79 - <div class="pro-name"><a href="/product/pro_{{goods_id}}_{{product_id}}/{{cn_alphabet}}.html">{{product_name}}</a></div> 79 + <div class="pro-name"><a href="/product/pro_{{product_id}}_{{goods_id}}/{{cn_alphabet}}.html" target="_blank">{{product_name}}</a></div>
80 <div class="color-size editable" data-productId={{product_id}} id="edit_{{product_id}}" data-productSkn={{product_skn}}> 80 <div class="color-size editable" data-productId={{product_id}} id="edit_{{product_id}}" data-productSkn={{product_skn}}>
81 {{#if color_name}} 81 {{#if color_name}}
82 <span class="mr20">颜色: <span class="default-color">{{color_name}}</span></span> 82 <span class="mr20">颜色: <span class="default-color">{{color_name}}</span></span>
@@ -115,12 +115,12 @@ @@ -115,12 +115,12 @@
115 <span class="iconfont warning">&#xe625;</span> 115 <span class="iconfont warning">&#xe625;</span>
116 </li> 116 </li>
117 <li> 117 <li>
118 - <a href="/product/pro_{{goods_id}}_{{product_id}}/{{cn_alphabet}}.html"> 118 + <a href="/product/pro_{{product_id}}_{{goods_id}}/{{cn_alphabet}}.html" target="_blank">
119 <img src="{{image goods_images 100 134}}" alt="{{product_name}}"> 119 <img src="{{image goods_images 100 134}}" alt="{{product_name}}">
120 </a> 120 </a>
121 </li> 121 </li>
122 <li class="pro-info"> 122 <li class="pro-info">
123 - <div class="pro-name"><a href="/product/pro_{{goods_id}}_{{product_id}}/{{cn_alphabet}}.html">{{product_name}}</a></div> 123 + <div class="pro-name"><a href="/product/pro_{{product_id}}_{{goods_id}}/{{cn_alphabet}}.html" target="_blank">{{product_name}}</a></div>
124 <div> 124 <div>
125 {{#if color_name}} 125 {{#if color_name}}
126 <span class="mr20">颜色: {{color_name}}</span> 126 <span class="mr20">颜色: {{color_name}}</span>
@@ -23,8 +23,6 @@ @@ -23,8 +23,6 @@
23 </div> 23 </div>
24 </div> 24 </div>
25 <div class="checkout"> 25 <div class="checkout">
26 - <a href="/" class="go-to-checkout">  
27 - <span class="btn {{#unless selectedNum}}disable{{/unless}}" id="checkout_btn">去结算</span>  
28 - </a> 26 + <span class="btn {{#unless selectedNum}}disable{{/unless}}" id="checkout_btn">去结算</span>
29 </div> 27 </div>
30 </div> 28 </div>
@@ -66,49 +66,16 @@ $(function() { @@ -66,49 +66,16 @@ $(function() {
66 }); 66 });
67 }).delegate('#checkout_btn', 'click', function(e) { 67 }).delegate('#checkout_btn', 'click', function(e) {
68 e.preventDefault(); 68 e.preventDefault();
69 - Cart.checkStorage(function() {  
70 - if (!$(this).hasClass('disable')) {  
71 - window.location.href = '/shopping/order';  
72 - }  
73 - }); 69 + if ($('.chk-group').length) {
  70 + Cart.checkStorage(function() {
  71 + if (!$(this).hasClass('disable')) {
  72 + window.location.href = '/shopping/order';
  73 + }
  74 + });
  75 + }
  76 + return false;
74 }); 77 });
75 78
76 - // // 全选和单选  
77 - // $('.toggle-chk, .toggle-chk-item').on('click', function() {  
78 - // Cart.toggleCheck.call(Cart, this);  
79 - // });  
80 -  
81 // 变动商品数量 79 // 变动商品数量
82 Stepper.init(); 80 Stepper.init();
83 -  
84 - // // 删除商品  
85 - // $('.remove-item').on('click', function() {  
86 - // Cart.removePro($(this).attr('data-productId'));  
87 - // });  
88 -  
89 - // // 移入收藏夹  
90 - // $('.send-to-favorite').on('click', function() {  
91 - // Cart.sendToFavorite($(this).attr('data-productId'));  
92 - // });  
93 -  
94 - // // 编辑商品颜色和属性  
95 - // $('.editable').on('click', function() {  
96 - // Cart.editColorOrSize($(this).attr('data-productId'));  
97 - // });  
98 -  
99 - // TODO=>  
100 - // $('#add_to_cart1').on('click', function() {  
101 - // Cart.addToCart({  
102 - // productSku: '1413600',  
103 - // buyNumber: 1  
104 - // });  
105 - // });  
106 -  
107 - // $('#add_to_cart2').on('click', function() {  
108 - // Cart.addToCart({  
109 - // productSku: '972201',  
110 - // buyNumber: 2  
111 - // });  
112 - // });  
113 - // TODO=>  
114 }); 81 });
@@ -37,6 +37,11 @@ var Util = { @@ -37,6 +37,11 @@ var Util = {
37 refreshCart: function(data, callback) { 37 refreshCart: function(data, callback) {
38 var template; 38 var template;
39 39
  40 + if (!data.hasGoods) {
  41 + $('#cart_content').html($('#empty-cart-tpl').html());
  42 + return;
  43 + }
  44 +
40 // helpers start 45 // helpers start
41 hbs.registerHelper('multiple', function(num1, num2) { 46 hbs.registerHelper('multiple', function(num1, num2) {
42 num1 = typeof num1 === 'number' ? num1 : parseFloat(num1, 10); 47 num1 = typeof num1 === 'number' ? num1 : parseFloat(num1, 10);
@@ -17,6 +17,12 @@ @@ -17,6 +17,12 @@
17 } 17 }
18 } 18 }
19 19
  20 + .chk-all {
  21 + &:hover {
  22 + cursor: pointer;
  23 + }
  24 + }
  25 +
20 .checked { 26 .checked {
21 display: none; 27 display: none;
22 } 28 }