Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
2
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Plain Diff
Browse Files
Authored by
xuqi
9 years ago
Commit
c0aa4e3f5acc0850b996d497f0870bf6466ff25f
2 parents
80db51b6
0d274923
Merge branch 'develop' of
http://git.dev.yoho.cn/web/yohobuy
into develop
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
9 deletions
static/js/cart/good.js
yohobuy/m.yohobuy.com/application/models/Index/Cart.php
yohobuy/m.yohobuy.com/application/modules/Cart/controllers/Index.php
static/js/cart/good.js
View file @
c0aa4e3
...
...
@@ -106,7 +106,7 @@ $('.cart-goods').on('touchstart', '.checkbox', function() {
});
orderInfo
(
'couponCode'
,
null
);
orderInfo
(
'couponName'
,
null
);
history
.
go
(
0
);
window
.
location
.
href
=
'/cart/index/index?cartType='
+
$
(
'#cartType'
).
val
(
);
}
else
{
tip
.
show
(
data
.
message
);
}
...
...
yohobuy/m.yohobuy.com/application/models/Index/Cart.php
View file @
c0aa4e3
...
...
@@ -313,10 +313,10 @@ class CartModel
*
* @param int $uid 用户ID
* @param string $cartType 购物车类型,ordinary表示普通购物车
* @param
null|string $cookieData
cookie中记录的一些订单有关数据
* @param
array $orderInfo
cookie中记录的一些订单有关数据
* @return array 接口返回的数据
*/
public
static
function
cartPay
(
$uid
,
$cartType
,
$
cookieData
)
public
static
function
cartPay
(
$uid
,
$cartType
,
$
orderInfo
)
{
$result
=
array
();
...
...
@@ -324,13 +324,11 @@ class CartModel
if
(
$pay
&&
isset
(
$pay
[
'code'
])
&&
$pay
[
'code'
]
===
200
)
{
$payReturn
=
$pay
[
'data'
];
$orderInfo
=
array
();
$address
=
array
();
$orderCompute
=
array
();
// cookie保存的数据
if
(
!
empty
(
$cookieData
))
{
$orderInfo
=
json_decode
(
$cookieData
,
true
);
if
(
!
empty
(
$orderInfo
))
{
$orderCompute
=
self
::
orderCompute
(
$uid
,
$cartType
,
$orderInfo
[
'deliveryId'
],
$orderInfo
[
'paymentTypeId'
],
$orderInfo
[
'couponCode'
],
$orderInfo
[
'yohoCoin'
]);
}
...
...
yohobuy/m.yohobuy.com/application/modules/Cart/controllers/Index.php
View file @
c0aa4e3
...
...
@@ -277,6 +277,12 @@ class IndexController extends AbstractAction
// 购物车商品为空跳转到购物车页面
$cartType
=
$this
->
get
(
'cartType'
,
'ordinary'
);
$cookieData
=
$this
->
getCookie
(
'order-info'
,
null
);
$orderInfo
=
array
();
if
(
!
empty
(
$cookieData
))
{
$orderInfo
=
json_decode
(
$cookieData
,
true
);
$cartType
=
$orderInfo
[
'cartType'
];
}
$cartKey
=
'commonCart'
;
if
(
$cartType
===
'advance'
)
{
$cartKey
=
'preSellCart'
;
...
...
@@ -289,12 +295,10 @@ class IndexController extends AbstractAction
$this
->
go
(
Helpers
::
url
(
'/cart/index/index'
));
}
$cookieData
=
$this
->
getCookie
(
'order-info'
,
null
);
$uid
=
$this
->
getUid
(
true
);
$data
=
array
(
'orderEnsurePage'
=>
true
,
'isOrdinaryCart'
=>
(
$cartType
!==
'advance'
),
'orderEnsure'
=>
CartModel
::
cartPay
(
$uid
,
$cartType
,
$
cookieData
)
'orderEnsure'
=>
CartModel
::
cartPay
(
$uid
,
$cartType
,
$
orderInfo
)
);
$this
->
_view
->
display
(
'order-ensure'
,
$data
);
...
...
Please
register
or
login
to post a comment