Authored by 郭成尧

'easy-computer'

... ... @@ -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.compute';
$param['method'] = empty($activityInfo) ? 'app.Shopping.compute' : 'app.Shopping.easyCompute';
$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);
... ...
... ... @@ -193,6 +193,13 @@ function orderCompute() {
skuList: isLimitGood() ? orderInfo('skuList') : undefined
};
// 套餐
if ($.queryString().activityType === 'bundle') {
Object.assign(data, {
activityType: 'bundle'
});
}
//门票
if (isTickets) {
data = {
... ...
... ... @@ -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']);
... ...
... ... @@ -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);
}
}
... ...