Toggle navigation
Toggle navigation
This project
Loading...
Sign in
wangshusheng
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to dashboard
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Plain Diff
Browse Files
Authored by
梁志锋
2015-12-20 16:26:50 +0800
Commit
190731573d02988c2a16480962faf6d7887554e0
2 parents
07cc5edd
0c8ba77e
Merge branch 'develop' of
http://git.dev.yoho.cn/web/yohobuy
into develop
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
114 additions
and
72 deletions
docs/data-structure.md
static/js/cart/cart.js
static/js/cart/gift-advance.js
static/js/cart/good.js
static/js/cart/order-ensure.js
static/js/cart/select-address.js
static/sass/cart/_index.scss
template/m.yohobuy.com/actions/cart/index/index.phtml
template/m.yohobuy.com/actions/cart/index/order-ensure.phtml
template/m.yohobuy.com/partials/cart/good.phtml
yohobuy/m.yohobuy.com/application/modules/Cart/controllers/Index.php
docs/data-structure.md
View file @
1907315
...
...
@@ -846,7 +846,16 @@
{
id: 1,
inValid: true, //是否是失效商品,
showCheckbox: true, //是否显示checkbox【赠品和加价购不显示】
checked: true, //是否选中
thumb: '',
isAdvanceBuy: true, //是否是加价购商品
isGift: ture, //是否是赠品
name: '',
color: '黄色',
size: 'L',
...
...
static/js/cart/cart.js
View file @
1907315
...
...
@@ -50,6 +50,10 @@ if ($('.cart-nav').length > 0) {
//trigger lazyload
$
(
window
).
trigger
(
'scroll'
);
});
setTimeout
(
function
()
{
$
(
'#presell-tip'
).
addClass
(
'hide'
);
},
3000
);
}
$
(
'.btn-balance'
).
on
(
'touchend'
,
function
()
{
...
...
static/js/cart/gift-advance.js
View file @
1907315
...
...
@@ -25,7 +25,7 @@ function getProductInfo(skn, promotionId) {
return
;
}
chosePanel
.
show
(
html
);
}
).
fail
(
function
()
{
}
,
function
()
{
tip
.
show
(
'网络错误'
);
}).
always
(
function
()
{
loading
.
hideLoadingMask
();
...
...
static/js/cart/good.js
View file @
1907315
...
...
@@ -107,12 +107,11 @@ $('.cart-goods').on('touchstart', '.checkbox', function() {
fast
:
true
});
history
.
go
(
0
);
}
else
{
tip
.
show
(
data
.
message
);
}
},
function
()
{
dialog
.
showDialog
({
autoHide
:
true
,
dialogText
:
'网络异常'
});
tip
.
show
(
'网络异常'
);
});
});
...
...
static/js/cart/order-ensure.js
View file @
1907315
...
...
@@ -78,7 +78,7 @@ function orderCompute() {
method
:
'POST'
,
url
:
'/cart/index/orderCompute'
,
data
:
{
cartType
:
orderInfo
(
'cartType'
)
,
cartType
:
queryString
.
cartType
||
queryString
.
carttype
||
'ordinary'
,
deliveryId
:
orderInfo
(
'deliveryId'
),
paymentTypeId
:
orderInfo
(
'paymentTypeId'
),
couponCode
:
orderInfo
(
'couponCode'
),
...
...
@@ -89,6 +89,7 @@ function orderCompute() {
if
(
!
res
)
{
tip
.
show
(
'网络出错'
);
window
.
location
.
reload
();
}
else
{
/*if (res.order_amount) {
res.order_amount = (+res.order_amount).toFixed(2);
...
...
@@ -108,6 +109,7 @@ function orderCompute() {
}
}).
fail
(
function
()
{
tip
.
show
(
'网络出错'
);
window
.
location
.
reload
();
});
}
...
...
static/js/cart/select-address.js
View file @
1907315
...
...
@@ -7,9 +7,20 @@
var
$
=
require
(
'jquery'
),
orderInfo
=
require
(
'./order-info'
).
orderInfo
;
var
$confim
=
$
(
'.confim-mask'
),
deleteId
;
$
(
'.address-item'
).
on
(
'touchend'
,
function
()
{
orderInfo
(
'addressId'
,
$
(
this
).
data
(
'address-id'
));
}).
on
(
'touchend'
,
'.edit'
,
function
()
{
window
.
location
.
href
=
$
(
this
).
data
(
'href'
);
return
false
;
}).
on
(
'touchend'
,
'.del'
,
function
()
{
deleteId
=
$
(
this
).
data
(
'address-id'
);
});
$confim
.
on
(
'touchend'
,
'.confim'
,
function
()
{
if
(
orderInfo
(
'addressId'
)
===
deleteId
)
{
orderInfo
(
'addressId'
,
null
);
}
});
...
...
static/sass/cart/_index.scss
View file @
1907315
...
...
@@ -36,6 +36,37 @@
li
:first-child
span
{
border-right
:
1px
solid
#e0e0e0
;
}
li
:last-child
{
position
:
relative
;
}
.presell-tip
{
position
:
absolute
;
z-index
:
1
;
left
:
-2rem
;
top
:
1
.75rem
;
}
.triangle
{
width
:
0
;
height
:
0
;
border-left
:
8px
solid
transparent
;
border-right
:
8px
solid
transparent
;
border-bottom
:
12px
solid
#000
;
margin-left
:
6rem
;
}
.pt-content
{
position
:
relative
;
padding
:
10px
;
background
:
#000
;
color
:
#fff
;
font-size
:
20px
;
@include
border-radius
(
5px
);
text-align
:
center
;
width
:
7rem
;
}
}
.login-info
{
...
...
@@ -195,8 +226,6 @@
}
}
}
.shopping-cart-zero
{
.cart-zero
{
width
:
100%
;
height
:
auto
;
...
...
template/m.yohobuy.com/actions/cart/index/index.phtml
View file @
1907315
{
{>
layout/header
}
}
{
{#
shoppingCart
}
}
{
{#if
isEmptyCart
}
}
<div
class=
"shopping-cart-zero yoho-page"
>
<div
class=
"cart-zero"
>
<i
class=
"iconfont"
>
62
c</i>
<p>您的购物车暂无商品</p>
<a
href=
"/product/new"
>随便逛逛</a>
</div>
{
{>
product/recommend-for-you
}
}
</div>
{
{^
}
}
<div
id=
"mainCart"
class=
"shopping-cart-page yoho-page"
>
{
{#if
showLoginInfo
}
}
<div
id=
"mainCart"
class=
"shopping-cart-page yoho-page"
>
{
{#
shoppingCart
}
}
{
{#if
showLoginInfo
}
}
<p
class=
"login-info"
>
<span
class=
"iconfont"
>
628
;</span>
请您先
<a
class=
"btn btn-login"
href=
"{{signurl}}"
>登录</a>
可以同步电脑和手机中的商品
</p>
{
{^
}
}
{
{#if
cartNav
}
}
{
{/if
}
}
{
{#if
isEmptyCart
}
}
<div
class=
"cart-zero"
>
<i
class=
"iconfont"
>
62
c</i>
<p>您的购物车暂无商品</p>
<a
href=
"/product/new"
>随便逛逛</a>
</div>
{
{>
product/recommend-for-you
}
}
{
{^
}
}
{
{#if
cartNav
}
}
<ul
class=
"cart-nav clearfix"
>
<li
class=
"active"
>
<span>
...
...
@@ -33,33 +28,33 @@
<span>
预售商品(
{
{presellGoodsCount
}
})
</span>
<div
id=
"presell-tip"
class=
"presell-tip"
>
<div
class=
"triangle"
></div>
<p
class=
"pt-content"
>预售商品点这里结算哦~</p>
</div>
</li>
</ul>
{
{/if
}
}
{
{/if
}
}
{
{#
commonCart
}
}
<div
class=
"cart-content common"
>
{
{>
cart/cart-content
}
}
</div>
<div
class=
"cart-content common"
>
{
{>
cart/cart-content
}
}
</div>
{
{/
commonCart
}
}
{
{#
preSellCart
}
}
<div
class=
"cart-content presell hide"
>
<p
class=
"presell-info"
>
<span
class=
"iconfont"
>
61
a;</span>
<span
class=
"txt"
>预售商品全场包邮,到货后立即发货</span>
<span
class=
"txt"
>预售商品不参加活动,不可使用优惠券</span>
</p>
{
{>
cart/cart-content
}
}
</div>
<div
class=
"cart-content presell hide"
>
<p
class=
"presell-info"
>
<span
class=
"iconfont"
>
61
a;</span>
<span
class=
"txt"
>预售商品全场包邮,到货后立即发货</span>
<span
class=
"txt"
>预售商品不参加活动,不可使用优惠券</span>
</p>
{
{>
cart/cart-content
}
}
</div>
{
{/
preSellCart
}
}
</div>
{
{/if
}
}
<input
id=
"cartType"
type=
"hidden"
value=
"{{cartType}}"
>
{
{/
shoppingCart
}
}
{
{>
cart/chose-panel
}
}
{
{/
shoppingCart
}
}
</div>
{
{>
layout/footer
}
}
...
...
template/m.yohobuy.com/actions/cart/index/order-ensure.phtml
View file @
1907315
...
...
@@ -65,11 +65,18 @@
</li>
<li
class=
"coin"
data-yoho-coin=
"{{yohoCoin}}"
>
<span
class=
"title"
>YOHO币</span>
<span
class=
"desc"
>可抵¥
{
{yohoCoin
}
}</span>
<span
class=
"coin-check"
>
<em>-
¥
{
{yohoCoin
}
}</em>
<i
class=
"iconfont checkbox icon-cb-checked"
></i>
</span>
{
{#if
yohoCoin
}
}
<span
class=
"desc"
>可抵¥
{
{yohoCoin
}
}</span>
<span
class=
"coin-check"
>
<em>-
¥
{
{yohoCoin
}
}</em>
<i
class=
"iconfont checkbox icon-cb-checked"
></i>
</span>
{
{^
}
}
<span
class=
"not-used coin-check"
>
无YOHO币可用
</span>
{
{/if
}
}
</li>
{
{#if
invoice
}
}
...
...
template/m.yohobuy.com/partials/cart/good.phtml
View file @
1907315
<div class="shopping-cart-good clearfix" data-id={{id}}>
{{#if isSoldOut}}
<div class="shopping-cart-good clearfix" data-id="{{id}}">
{{#if inValid}}
<span class="few-tag-expire">失效</span>
{{^}}
{{#if isSelected}}
<span class="checkbox icon-cb-checked iconfont"></span>
{{^}}
<span class="checkbox icon-checkbox iconfont"></span>
{{/if}}
{{/if}}
{{#if showCheckbox}}
<span class="checkbox{{#if checked}} icon-cb-checked{{^}} icon-checkbox{{/if}}iconfont"></span>
{{/if}}
<div class="info">
<img class="thumb lazy" data-original=
{{thumb}}
>
<img class="thumb lazy" data-original=
"{{thumb}}"
>
{{#if isAdvanceBuy}}
<p class="few-tag plus-tag">加价购</p>
{{^}}
{{#if isGift}}
{{/if}}
{{#if isGift}}
<p class="few-tag gift-tag">赠品</p>
{{/if}}
{{/if}}
</a>
<div class="deps show">
<p class="name row">{{name}}</p>
...
...
@@ -67,15 +63,5 @@
</p>
{{/if}}
</div>
<div class="calculate-num hide">
<div class="calculate">
<p><i class="iconfont cut"></i><span>{{count}}</span><i class="iconfont add"></i></p>
<p><span>颜色:{{color}}尺码:{{size}}{{name}}</span><i class="iconfont down"></i></p>
</div>
<p><span class="price"> ¥{{price}}</span></p>
<span class="count">
×{{count}}
</span>
</div>
</div>
</div>
...
...
yohobuy/m.yohobuy.com/application/modules/Cart/controllers/Index.php
View file @
1907315
...
...
@@ -271,7 +271,7 @@ class IndexController extends AbstractAction
$this
->
auditJumpLogin
();
$this
->
setTitle
(
'确认订单'
);
$this
->
setNavHeader
(
'确认订单'
);
$this
->
setNavHeader
(
'确认订单'
,
true
,
false
);
// 不显示右上角home按钮
// 购物车商品为空跳转到购物车页面
$shoppingKey
=
Helpers
::
getShoppingKeyByCookie
();
...
...
Please
register
or
login
to post a comment