Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYWAP
·
Commits
Go to a project
GitLab
Go to group
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
Email Patches
Plain Diff
Browse Files
Authored by
郭成尧
8 years ago
Commit
7d280ba1a13006ad769ccabe00dfefb1f3a74771
1 parent
c4eafab3
'easy-computer'
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
9 deletions
library/LibModels/Wap/Home/CartData.php
static/js/cart/order-ensure.js
yohobuy/m.yohobuy.com/application/models/Index/Cart.php
yohobuy/m.yohobuy.com/application/modules/Cart/controllers/Index.php
library/LibModels/Wap/Home/CartData.php
View file @
7d280ba
...
...
@@ -287,12 +287,13 @@ class CartData
* @param string $couponCode 优惠券码
* @param mixed $yohoCoin 使用的有货币数量
* @param string $skuList 购买限购商品时需要传递的参数
* @param $activityInfo
* @return array 接口返回的数据
*/
public
static
function
orderCompute
(
$uid
,
$cartType
,
$deliveryWay
,
$paymentType
,
$couponCode
,
$yohoCoin
,
$skuList
)
public
static
function
orderCompute
(
$uid
,
$cartType
,
$deliveryWay
,
$paymentType
,
$couponCode
,
$yohoCoin
,
$skuList
,
$activityInfo
)
{
$param
=
Yohobuy
::
param
();
$param
[
'method'
]
=
'app.Shopping.c
ompute'
;
$param
[
'method'
]
=
empty
(
$activityInfo
)
?
'app.Shopping.compute'
:
'app.Shopping.easyC
ompute'
;
$param
[
'cart_type'
]
=
$cartType
;
$param
[
'delivery_way'
]
=
$deliveryWay
;
$param
[
'payment_type'
]
=
$paymentType
;
...
...
@@ -304,10 +305,16 @@ class CartData
}
// 购买限购商品时需要传递product_sku_list参数
if
(
!
empty
(
$skuList
))
{
if
(
!
empty
(
$skuList
)
&&
empty
(
$activityInfo
)
)
{
$param
[
'product_sku_list'
]
=
$skuList
;
}
// 购买套餐商品需要的数据
if
(
!
empty
(
$activityInfo
))
{
$param
[
'activity_id'
]
=
$activityInfo
[
'activity_id'
];
$param
[
'product_sku_list'
]
=
json_encode
(
$activityInfo
[
'product_sku_list'
]);
}
$param
[
'uid'
]
=
$uid
;
$param
[
'client_secret'
]
=
Sign
::
getSign
(
$param
);
...
...
static/js/cart/order-ensure.js
View file @
7d280ba
...
...
@@ -193,6 +193,13 @@ function orderCompute() {
skuList
:
isLimitGood
()
?
orderInfo
(
'skuList'
)
:
undefined
};
// 套餐
if
(
$
.
queryString
().
activityType
===
'bundle'
)
{
Object
.
assign
(
data
,
{
activityType
:
'bundle'
});
}
//门票
if
(
isTickets
)
{
data
=
{
...
...
yohobuy/m.yohobuy.com/application/models/Index/Cart.php
View file @
7d280ba
...
...
@@ -693,11 +693,11 @@ class CartModel
* @param string
$skuList
购买限购商品时需要传递的参数
* @return array 接口返回的数据
*/
public static function orderCompute(
$uid
,
$cartType
,
$deliveryWay
,
$paymentType
,
$couponCode
,
$yohoCoin
,
$skuList
)
public static function orderCompute(
$uid
,
$cartType
,
$deliveryWay
,
$paymentType
,
$couponCode
,
$yohoCoin
,
$skuList
,
$activityInfo
)
{
$result
= array();
$compute
= CartData::orderCompute(
$uid
,
$cartType
,
$deliveryWay
,
$paymentType
,
$couponCode
,
$yohoCoin
,
$skuList
);
$compute
= CartData::orderCompute(
$uid
,
$cartType
,
$deliveryWay
,
$paymentType
,
$couponCode
,
$yohoCoin
,
$skuList
,
$activityInfo
);
if (
$compute
&& isset(
$compute['code']
) &&
$compute['code']
=== 200) {
// 有货币添加.00后缀
$compute['data']['use_yoho_coin']
= Helpers::transPrice(
$compute['data']['use_yoho_coin']
);
...
...
yohobuy/m.yohobuy.com/application/modules/Cart/controllers/Index.php
View file @
7d280ba
...
...
@@ -544,10 +544,14 @@ class IndexController extends AbstractAction
$type
=
$this
->
post
(
'type'
,
null
);
//type : tickets 门票
if
(
$type
!==
'tickets'
)
{
$result
=
CartModel
::
orderCompute
(
$uid
,
$cartType
,
$deliveryWay
,
$paymentType
,
$couponCode
,
$yohoCoin
,
$skuList
);
}
//非门票
else
{
if
(
$this
->
post
(
'activityType'
,
null
)
===
'bundle'
)
{
$activityInfo
=
json_decode
(
$this
->
getCookie
(
'activity-info'
,
null
),
true
);
$result
=
CartModel
::
orderCompute
(
$uid
,
$cartType
,
$deliveryWay
,
$paymentType
,
$couponCode
,
$yohoCoin
,
null
,
$activityInfo
);
}
else
{
// 非门票
$result
=
CartModel
::
orderCompute
(
$uid
,
$cartType
,
$deliveryWay
,
$paymentType
,
$couponCode
,
$yohoCoin
,
$skuList
);
}
}
else
{
$result
=
CartModel
::
ticketsOrderCompute
(
$uid
,
$productSku
,
$buyNumber
,
$yohoCoin
);
}
}
...
...
Please
register
or
login
to post a comment