Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yoho-blk
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
1
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Plain Diff
Browse Files
Authored by
jinhu.tung
2016-07-21 14:25:44 +0800
Commit
992cc49fd5ef373865abbf275a1f036cc77bebc7
2 parents
ba721dfe
46923461
Merge branch 'feature/shopping' into release/1.0
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
282 additions
and
295 deletions
apps/shopping/views/action/cart.hbs
apps/shopping/views/partial/bc-nav.hbs
apps/shopping/views/partial/cart-list.hbs
apps/shopping/views/partial/cart/cart-list-body.hbs
apps/shopping/views/partial/cart/statement.hbs
public/js/shopping/cart.page.js
public/js/shopping/cart/util.js
public/scss/shopping/_cart-header.css
apps/shopping/views/action/cart.hbs
View file @
992cc49
{{>
sign-header
}}
<div
class=
"blk-page center-content"
>
{{>
bc-nav
}}
{{>
cart
/
info
}}
{{>
bc-nav
}}
{{>
cart
/
info
}}
<div
id=
"cart_content"
>
{{#if
hasGoods
}}
{{>
cart-list
}}
{{^}}
{{>
cart
/
empty-cart
}}
{{/if}}
{{!-- <button id="add_to_cart1">添加到购物车 1413600 number 1</button> --}}
</div>
{{!-- <button id="add_to_cart1">添加到购物车 1413600 number 1</button> --}}
</div>
<script
id=
"edit-color-size-tpl"
type=
"text/html"
>
...
...
@@ -72,3 +74,249 @@
<
/div
>
<
/div
>
</script>
<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"></span>
<span class="iconfont checkbox checked"></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"></span>
<span class="iconfont checkbox checked"></span>
</label>
<input type="hidden" name="product_ids[]"/>
</li>
<li>
<a href="/product/pro_\{{product_id}}_\{{goods_id}}/\{{cn_alphabet}}.html" target="_blank">
<img src="\{{image goods_images 100 134}}" alt="\{{product_name}}">
</a>
</li>
<li class="pro-info">
\{{!-- <div class="brand-name">\{{brand_name}}</div> --}}
<div class="pro-name"><a href="/product/pro_\{{product_id}}_\{{goods_id}}/\{{cn_alphabet}}.html" target="_blank">\{{product_name}}</a></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">¥ \{{round sales_price 2}}</span>
<div class="stepper" data-productType=\{{goods_type}}>
<div class="minus action \{{#isEqual buy_number 1}}disable\{{/isEqual}}">
<span class="iconfont"></span>
</div>
<div class="num">
<input type="text" class="input" value=\{{buy_number}} />
</div>
<div class="plus action \{{#isEqual left_number 0}}disable\{{/isEqual}}">
<span class="iconfont"></span>
</div>
<div class="warning">
\{{showStorage left_number}}
</div>
</div>
</li>
<li class="total-price-action">
<span class="price item-total-price">¥ \{{round (multiple sales_price buy_number) 2}}</span>
<div class="actions">
<div class="remove-item action" data-product_id=\{{product_id}}><span class="iconfont"></span> 删 除</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 cart-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"></span>
<span class="iconfont checkbox checked"></span>
</label>
<input type="hidden" name="product_ids[]"/>
</li>
<li>
<a href="/product/pro_\{{product_id}}_\{{goods_id}}/\{{cn_alphabet}}.html" target="_blank">
<img src="\{{image goods_images 100 134}}" alt="\{{product_name}}">
</a>
</li>
<li class="pro-info">
\{{!-- <div class="brand-name">\{{brandName}}</div> --}}
<div class="pro-name"><a href="/product/pro_\{{product_id}}_\{{goods_id}}/\{{cn_alphabet}}.html" target="_blank">\{{product_name}}</a></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"></span>
</div>
</li>
<li class="price-num">
<span class="price sale-price">¥ \{{round sales_price 2}}</span>
<div class="stepper" data-productType=\{{goods_type}}>
<div class="minus action \{{#isEqual buy_number 1}}disable\{{/isEqual}}">
<span class="iconfont"></span>
</div>
<div class="num">
<input type="text" class="input" value=\{{buy_number}} />
</div>
<div class="plus action \{{#isEqual left_number 0}}disable\{{/isEqual}}">
<span class="iconfont"></span>
</div>
<div class="warning">
\{{showStorage left_number}}
</div>
</div>
</li>
<li class="total-price-action">
<span class="price item-total-price">¥ \{{round (multiple sales_price buy_number) 2}}</span>
<div class="actions">
<div class="remove-item action" data-product_id=\{{product_id}}><span class="iconfont"></span> 删 除</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"></span>
</li>
<li>
<a href="/product/pro_\{{product_id}}_\{{goods_id}}/\{{cn_alphabet}}.html" target="_blank">
<img src="\{{image goods_images 100 134}}" alt="\{{product_name}}">
</a>
</li>
<li class="pro-info">
<div class="pro-name"><a href="/product/pro_\{{product_id}}_\{{goods_id}}/\{{cn_alphabet}}.html" target="_blank">\{{product_name}}</a></div>
<div>
\{{#if color_name}}
<span class="mr20">颜色: \{{color_name}}</span>
\{{/if}}
\{{#if size_name}}
<span>尺寸: \{{size_name}}</span>
\{{/if}}
</div>
</li>
<li class="price-num">
<span class="price sale-price">¥ \{{round salesPrice 2}}</span>
<div class="stepper" data-productType=\{{goods_type}}>
<div class="minus action \{{#isEqual buy_number 1}}disable\{{/isEqual}}">
<span class="iconfont"></span>
</div>
<div class="num">
<input type="text" class="input" value=\{{buy_number}} />
</div>
<div class="plus action \{{#isEqual left_number 0}}disable\{{/isEqual}}">
<span class="iconfont"></span>
</div>
<div class="warning">
\{{showStorage left_number}}
</div>
</div>
</li>
<li class="total-price-action">
<span class="price item-total-price">¥ \{{round (multiple sales_price buy_number) 2}}</span>
<div class="actions">
<div class="remove-item action" data-product_id=\{{product_id}}><span class="iconfont"></span> 删 除</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"></span>
<span class="iconfont checkbox checked"></span>
<span>全选</span>
</label>
</div>
<div id="remove_selected" class="action hoverable">删除选中的商品</div>
<div id="send_favorite" class="action hoverable">移入收藏夹</div>
<div id="warning_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>\{{totalMoney}}</span></div>
</div>
</div>
<div class="calculate">
<div class="checkout-total pay-total">
<div class="pay-title">应付金额(不含运费):</div>
<div class="total-money">¥ <span>\{{totalMoney}}</span></div>
</div>
</div>
<div class="checkout">
<span class="btn \{{#unless selectedNum}}disable\{{
/
unless
}}
" id="
checkout_btn
"
>
去结算
<
/span
>
<
/div
>
<
/div
>
</script>
<script
id=
"empty-cart-tpl"
type=
"text/html"
>
<
div
class
=
"empty-cart"
>
<
div
class
=
"empty-cart-bg"
>
<
/div
>
<
p
class
=
"empty-cart-info"
>
购物袋空空的哦,去看看心仪的商品吧
~<
/p
>
<
a
href
=
"/"
class
=
"go-to-shop"
>
<
span
class
=
"btn white"
>
去购物
<
/span
>
<
/a
>
<
/div
>
</script>
...
...
apps/shopping/views/partial/bc-nav.hbs
View file @
992cc49
<div
class=
"cart-bc"
>
<ul
class=
"breadcrumb"
>
<li
class=
"level-1
{{#
isEqual
bcNavFocus
1
}}
current
{{/
isEqual
}}
"
><a
href=
"/"
>
我的购物袋
<em></em><i></i></a></li>
<li
class=
"level-2
{{#
isEqual
bcNavFocus
2
}}
current
{{/
isEqual
}}
"
><a
href=
"/vehicles/"
>
填写核对订单信息
<em></em><i></i></a></li>
<li
class=
"level-3
{{#
isEqual
bcNavFocus
3
}}
current
{{/
isEqual
}}
"
><a
href=
"/vehicles/vans/"
>
成功提交订单
<em></em><i></i></a></li>
<li
class=
"level-1
{{#
isEqual
bcNavFocus
1
}}
current
{{/
isEqual
}}
"
><a
href=
"javascript:void(0)"
>
我的购物袋
<em></em><i></i></a></li>
<li
class=
"level-2
{{#
isEqual
bcNavFocus
2
}}
current
{{/
isEqual
}}
"
><a
href=
"javascript:void(0)"
>
填写核对订单信息
<em></em><i></i></a></li>
<li
class=
"level-3
{{#
isEqual
bcNavFocus
3
}}
current
{{/
isEqual
}}
"
><a
href=
"javascript:void(0)"
>
成功提交订单
<em></em><i></i></a></li>
</ul>
</div>
\ No newline at end of file
...
...
apps/shopping/views/partial/cart-list.hbs
View file @
992cc49
<div
id=
"cart_
conten
t"
>
<div
id=
"cart_
lis
t"
>
{{>
cart
/
cart-list-header
}}
{{>
cart
/
cart-list-body
}}
{{>
cart
/
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"></span>
<span class="iconfont checkbox checked"></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"></span>
<span class="iconfont checkbox checked"></span>
</label>
<input type="hidden" name="product_ids[]"/>
</li>
<li>
<a href="/product/pro_\{{goods_id}}_\{{product_id}}/\{{cn_alphabet}}.html">
<img src="\{{image goods_images 100 134}}" alt="\{{product_name}}">
</a>
</li>
<li class="pro-info">
\{{!-- <div class="brand-name">\{{brand_name}}</div> --}}
<div class="pro-name"><a href="/product/pro_\{{goods_id}}_\{{product_id}}/\{{cn_alphabet}}.html">\{{product_name}}</a></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">¥ \{{round sales_price 2}}</span>
<div class="stepper" data-productType=\{{goods_type}}>
<div class="minus action \{{#isEqual buy_number 1}}disable\{{/isEqual}}">
<span class="iconfont"></span>
</div>
<div class="num">
<input type="text" class="input" value=\{{buy_number}} />
</div>
<div class="plus action \{{#isEqual left_number 0}}disable\{{/isEqual}}">
<span class="iconfont"></span>
</div>
<div class="warning">
\{{showStorage left_number}}
</div>
</div>
</li>
<li class="total-price-action">
<span class="price item-total-price">¥ \{{round (multiple sales_price buy_number) 2}}</span>
<div class="actions">
<div class="remove-item action" data-product_id=\{{product_id}}><span class="iconfont"></span> 删 除</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 cart-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"></span>
<span class="iconfont checkbox checked"></span>
</label>
<input type="hidden" name="product_ids[]"/>
</li>
<li>
<a href="/product/pro_\{{goods_id}}_\{{product_id}}/\{{cn_alphabet}}.html">
<img src="\{{image goods_images 100 134}}" alt="\{{product_name}}">
</a>
</li>
<li class="pro-info">
\{{!-- <div class="brand-name">\{{brandName}}</div> --}}
<div class="pro-name"><a href="/product/pro_\{{goods_id}}_\{{product_id}}/\{{cn_alphabet}}.html">\{{product_name}}</a></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"></span>
</div>
</li>
<li class="price-num">
<span class="price sale-price">¥ \{{round sales_price 2}}</span>
<div class="stepper" data-productType=\{{goods_type}}>
<div class="minus action \{{#isEqual buy_number 1}}disable\{{/isEqual}}">
<span class="iconfont"></span>
</div>
<div class="num">
<input type="text" class="input" value=\{{buy_number}} />
</div>
<div class="plus action \{{#isEqual left_number 0}}disable\{{/isEqual}}">
<span class="iconfont"></span>
</div>
<div class="warning">
\{{showStorage left_number}}
</div>
</div>
</li>
<li class="total-price-action">
<span class="price item-total-price">¥ \{{round (multiple sales_price buy_number) 2}}</span>
<div class="actions">
<div class="remove-item action" data-product_id=\{{product_id}}><span class="iconfont"></span> 删 除</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"></span>
</li>
<li>
<a href="/product/pro_\{{goods_id}}_\{{product_id}}/\{{cn_alphabet}}.html">
<img src="\{{image goods_images 100 134}}" alt="\{{product_name}}">
</a>
</li>
<li class="pro-info">
<div class="pro-name"><a href="/product/pro_\{{goods_id}}_\{{product_id}}/\{{cn_alphabet}}.html">\{{product_name}}</a></div>
<div>
\{{#if color_name}}
<span class="mr20">颜色: \{{color_name}}</span>
\{{/if}}
\{{#if size_name}}
<span>尺寸: \{{size_name}}</span>
\{{/if}}
</div>
</li>
<li class="price-num">
<span class="price sale-price">¥ \{{round salesPrice 2}}</span>
<div class="stepper" data-productType=\{{goods_type}}>
<div class="minus action \{{#isEqual buy_number 1}}disable\{{/isEqual}}">
<span class="iconfont"></span>
</div>
<div class="num">
<input type="text" class="input" value=\{{buy_number}} />
</div>
<div class="plus action \{{#isEqual left_number 0}}disable\{{/isEqual}}">
<span class="iconfont"></span>
</div>
<div class="warning">
\{{showStorage left_number}}
</div>
</div>
</li>
<li class="total-price-action">
<span class="price item-total-price">¥ \{{round (multiple sales_price buy_number) 2}}</span>
<div class="actions">
<div class="remove-item action" data-product_id=\{{product_id}}><span class="iconfont"></span> 删 除</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"></span>
<span class="iconfont checkbox checked"></span>
<span>全选</span>
</label>
</div>
<div id="remove_selected" class="action hoverable">删除选中的商品</div>
<div id="send_favorite" class="action hoverable">移入收藏夹</div>
<div id="warning_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>\{{totalMoney}}</span></div>
</div>
</div>
<div class="calculate">
<div class="checkout-total pay-total">
<div class="pay-title">应付金额(不含运费):</div>
<div class="total-money">¥ <span>\{{totalMoney}}</span></div>
</div>
</div>
<div class="checkout">
<a href="/" class="go-to-checkout">
<span class="btn \{{#unless selectedNum}}disable\{{
/
unless
}}
" id="
checkout_btn
"
>
去结算
<
/span
>
<
/a
>
<
/div
>
<
/div
>
</script>
\ No newline at end of file
</div>
\ No newline at end of file
...
...
apps/shopping/views/partial/cart/cart-list-body.hbs
View file @
992cc49
...
...
@@ -17,13 +17,13 @@
<input
type=
"hidden"
name=
"product_ids[]"
/>
</li>
<li>
<a
href=
"/product/pro_
{{
goods_id
}}
_
{{
product_id
}}
/
{{
cn_alphabet
}}
.html
"
>
<a
href=
"/product/pro_
{{
product_id
}}
_
{{
goods_id
}}
/
{{
cn_alphabet
}}
.html"
target=
"_blank
"
>
<img
src=
"
{{
image
goods_images
100
134
}}
"
alt=
"
{{
product_name
}}
"
>
</a>
</li>
<li
class=
"pro-info"
>
{{!-- <div class="brand-name">{{brand_name}}</div> --}}
<div
class=
"pro-name"
><a
href=
"/product/pro_
{{
goods_id
}}
_
{{
product_id
}}
/
{{
cn_alphabet
}}
.html
"
>
{{
product_name
}}
</a></div>
<div
class=
"pro-name"
><a
href=
"/product/pro_
{{
product_id
}}
_
{{
goods_id
}}
/
{{
cn_alphabet
}}
.html"
target=
"_blank
"
>
{{
product_name
}}
</a></div>
<div
class=
"size"
>
{{#if
size_name
}}
<span>
尺寸:
{{
size_name
}}
</span>
...
...
@@ -70,13 +70,13 @@
<input
type=
"hidden"
name=
"product_ids[]"
/>
</li>
<li>
<a
href=
"/product/pro_
{{
goods_id
}}
_
{{
product_id
}}
/
{{
cn_alphabet
}}
.html
"
>
<a
href=
"/product/pro_
{{
product_id
}}
_
{{
goods_id
}}
/
{{
cn_alphabet
}}
.html"
target=
"_blank
"
>
<img
src=
"
{{
image
goods_images
100
134
}}
"
alt=
"
{{
product_name
}}
"
>
</a>
</li>
<li
class=
"pro-info"
>
{{!-- <div class="brand-name">{{brandName}}</div> --}}
<div
class=
"pro-name"
><a
href=
"/product/pro_
{{
goods_id
}}
_
{{
product_id
}}
/
{{
cn_alphabet
}}
.html
"
>
{{
product_name
}}
</a></div>
<div
class=
"pro-name"
><a
href=
"/product/pro_
{{
product_id
}}
_
{{
goods_id
}}
/
{{
cn_alphabet
}}
.html"
target=
"_blank
"
>
{{
product_name
}}
</a></div>
<div
class=
"color-size editable"
data-productId=
{{
product_id
}}
id="edit_
{{
product_id
}}
"
data-productSkn=
{{
product_skn
}}
>
{{#if
color_name
}}
<span
class=
"mr20"
>
颜色:
<span
class=
"default-color"
>
{{
color_name
}}
</span></span>
...
...
@@ -115,12 +115,12 @@
<span
class=
"iconfont warning"
>

</span>
</li>
<li>
<a
href=
"/product/pro_
{{
goods_id
}}
_
{{
product_id
}}
/
{{
cn_alphabet
}}
.html
"
>
<a
href=
"/product/pro_
{{
product_id
}}
_
{{
goods_id
}}
/
{{
cn_alphabet
}}
.html"
target=
"_blank
"
>
<img
src=
"
{{
image
goods_images
100
134
}}
"
alt=
"
{{
product_name
}}
"
>
</a>
</li>
<li
class=
"pro-info"
>
<div
class=
"pro-name"
><a
href=
"/product/pro_
{{
goods_id
}}
_
{{
product_id
}}
/
{{
cn_alphabet
}}
.html
"
>
{{
product_name
}}
</a></div>
<div
class=
"pro-name"
><a
href=
"/product/pro_
{{
product_id
}}
_
{{
goods_id
}}
/
{{
cn_alphabet
}}
.html"
target=
"_blank
"
>
{{
product_name
}}
</a></div>
<div>
{{#if
color_name
}}
<span
class=
"mr20"
>
颜色:
{{
color_name
}}
</span>
...
...
apps/shopping/views/partial/cart/statement.hbs
View file @
992cc49
...
...
@@ -23,8 +23,6 @@
</div>
</div>
<div
class=
"checkout"
>
<a
href=
"/"
class=
"go-to-checkout"
>
<span
class=
"btn
{{#
unless
selectedNum
}}
disable
{{/
unless
}}
"
id=
"checkout_btn"
>
去结算
</span>
</a>
<span
class=
"btn
{{#
unless
selectedNum
}}
disable
{{/
unless
}}
"
id=
"checkout_btn"
>
去结算
</span>
</div>
</div>
\ No newline at end of file
...
...
public/js/shopping/cart.page.js
View file @
992cc49
...
...
@@ -66,49 +66,16 @@ $(function() {
});
}).
delegate
(
'#checkout_btn'
,
'click'
,
function
(
e
)
{
e
.
preventDefault
();
Cart
.
checkStorage
(
function
()
{
if
(
!
$
(
this
).
hasClass
(
'disable'
))
{
window
.
location
.
href
=
'/shopping/order'
;
}
});
if
(
$
(
'.chk-group'
).
length
)
{
Cart
.
checkStorage
(
function
()
{
if
(
!
$
(
this
).
hasClass
(
'disable'
))
{
window
.
location
.
href
=
'/shopping/order'
;
}
});
}
return
false
;
});
// // 全选和单选
// $('.toggle-chk, .toggle-chk-item').on('click', function() {
// Cart.toggleCheck.call(Cart, this);
// });
// 变动商品数量
Stepper
.
init
();
// // 删除商品
// $('.remove-item').on('click', function() {
// Cart.removePro($(this).attr('data-productId'));
// });
// // 移入收藏夹
// $('.send-to-favorite').on('click', function() {
// Cart.sendToFavorite($(this).attr('data-productId'));
// });
// // 编辑商品颜色和属性
// $('.editable').on('click', function() {
// Cart.editColorOrSize($(this).attr('data-productId'));
// });
// TODO=>
// $('#add_to_cart1').on('click', function() {
// Cart.addToCart({
// productSku: '1413600',
// buyNumber: 1
// });
// });
// $('#add_to_cart2').on('click', function() {
// Cart.addToCart({
// productSku: '972201',
// buyNumber: 2
// });
// });
// TODO=>
});
...
...
public/js/shopping/cart/util.js
View file @
992cc49
...
...
@@ -37,6 +37,11 @@ var Util = {
refreshCart
:
function
(
data
,
callback
)
{
var
template
;
if
(
!
data
.
hasGoods
)
{
$
(
'#cart_content'
).
html
(
$
(
'#empty-cart-tpl'
).
html
());
return
;
}
// helpers start
hbs
.
registerHelper
(
'multiple'
,
function
(
num1
,
num2
)
{
num1
=
typeof
num1
===
'number'
?
num1
:
parseFloat
(
num1
,
10
);
...
...
public/scss/shopping/_cart-header.css
View file @
992cc49
...
...
@@ -17,6 +17,12 @@
}
}
.chk-all
{
&:hover
{
cursor
:
pointer
;
}
}
.checked
{
display
:
none
;
}
...
...
Please
register
or
login
to post a comment