Showing
4 changed files
with
23 additions
and
26 deletions
@@ -529,10 +529,10 @@ class CartData | @@ -529,10 +529,10 @@ class CartData | ||
529 | * @param int $uid 用户ID | 529 | * @param int $uid 用户ID |
530 | * @param type int $productSku 产品sku | 530 | * @param type int $productSku 产品sku |
531 | * @param type int $buyNumber 购买数量,范围1-4 | 531 | * @param type int $buyNumber 购买数量,范围1-4 |
532 | - * @param type int $yohoNum yoho币 | 532 | + * @param type int $yohoCoin yoho币 |
533 | * @return type [] | 533 | * @return type [] |
534 | */ | 534 | */ |
535 | - public static function addTicket($uid, $productSku, $buyNumber, $yohoNum = 0) | 535 | + public static function addTicket($uid, $productSku, $buyNumber, $yohoCoin = 0) |
536 | { | 536 | { |
537 | $param = Yohobuy::param(); | 537 | $param = Yohobuy::param(); |
538 | $param['method'] = 'app.shopping.ticket'; | 538 | $param['method'] = 'app.shopping.ticket'; |
@@ -540,8 +540,8 @@ class CartData | @@ -540,8 +540,8 @@ class CartData | ||
540 | $param['product_sku'] = intval($productSku); | 540 | $param['product_sku'] = intval($productSku); |
541 | $param['buy_number'] = intval($buyNumber); | 541 | $param['buy_number'] = intval($buyNumber); |
542 | //yoho币转换成元,1yoho币等于一分钱 | 542 | //yoho币转换成元,1yoho币等于一分钱 |
543 | - if (isset($yohoNum) && $yohoNum > 0) { | ||
544 | - $param['use_yoho_coin'] = $yohoNum / 100; | 543 | + if (isset($yohoCoin) && $yohoCoin > 0) { |
544 | + $param['use_yoho_coin'] = $yohoCoin / 100; | ||
545 | } | 545 | } |
546 | $param['client_secret'] = Sign::getSign($param); | 546 | $param['client_secret'] = Sign::getSign($param); |
547 | return Yohobuy::get(API_URL, $param); | 547 | return Yohobuy::get(API_URL, $param); |
@@ -553,10 +553,10 @@ class CartData | @@ -553,10 +553,10 @@ class CartData | ||
553 | * @param type int $productSku 产品sku | 553 | * @param type int $productSku 产品sku |
554 | * @param type int $buyNumber 购买数量,范围1-4 | 554 | * @param type int $buyNumber 购买数量,范围1-4 |
555 | * @param type string $mobile 手机号码 | 555 | * @param type string $mobile 手机号码 |
556 | - * @param type int $yohoNum yoho币 | 556 | + * @param type int $yohoCoin yoho币 |
557 | * @return type [] | 557 | * @return type [] |
558 | */ | 558 | */ |
559 | - public static function submitTicket($uid, $productSku, $buyNumber, $mobile, $yohoNum = 0) | 559 | + public static function submitTicket($uid, $productSku, $buyNumber, $mobile, $yohoCoin = 0) |
560 | { | 560 | { |
561 | $param = Yohobuy::param(); | 561 | $param = Yohobuy::param(); |
562 | $param['method'] = 'app.shopping.submitTicket'; | 562 | $param['method'] = 'app.shopping.submitTicket'; |
@@ -565,8 +565,8 @@ class CartData | @@ -565,8 +565,8 @@ class CartData | ||
565 | $param['buy_number'] = intval($buyNumber); | 565 | $param['buy_number'] = intval($buyNumber); |
566 | $param['mobile'] = $mobile; | 566 | $param['mobile'] = $mobile; |
567 | //yoho币转换成元,1yoho币等于一分钱 | 567 | //yoho币转换成元,1yoho币等于一分钱 |
568 | - if (isset($yohoNum) && $yohoNum > 0) { | ||
569 | - $param['use_yoho_coin'] = $yohoNum / 100; | 568 | + if (isset($yohoCoin) && $yohoCoin > 0) { |
569 | + $param['use_yoho_coin'] = $yohoCoin / 100; | ||
570 | } | 570 | } |
571 | $param['client_secret'] = Sign::getSign($param); | 571 | $param['client_secret'] = Sign::getSign($param); |
572 | return Yohobuy::get(API_URL, $param); | 572 | return Yohobuy::get(API_URL, $param); |
@@ -157,7 +157,7 @@ var TicketCat = { | @@ -157,7 +157,7 @@ var TicketCat = { | ||
157 | el.$loading.show(); | 157 | el.$loading.show(); |
158 | $.ajax({ | 158 | $.ajax({ |
159 | type: 'POST', | 159 | type: 'POST', |
160 | - url: '/cart/index/orderCompute', | 160 | + url: '/cart/index/setTicket', |
161 | data: selectData, | 161 | data: selectData, |
162 | success: function(data) { | 162 | success: function(data) { |
163 | el.$loading.hide(); | 163 | el.$loading.hide(); |
@@ -227,7 +227,7 @@ var TicketCat = { | @@ -227,7 +227,7 @@ var TicketCat = { | ||
227 | render: function(data) { | 227 | render: function(data) { |
228 | var e = this.el, | 228 | var e = this.el, |
229 | i, | 229 | i, |
230 | - dArr = data.promotion_formula_list, | 230 | + dArr = data.shopping_cart_data.promotion_formula_list, |
231 | str = '', | 231 | str = '', |
232 | isExpress = ''; | 232 | isExpress = ''; |
233 | 233 | ||
@@ -250,14 +250,14 @@ var TicketCat = { | @@ -250,14 +250,14 @@ var TicketCat = { | ||
250 | } | 250 | } |
251 | 251 | ||
252 | e.$payTotal.html(str); | 252 | e.$payTotal.html(str); |
253 | - e.$toPay.html((data.last_order_amount).toFixed(2)); | 253 | + e.$toPay.html((data.shopping_cart_data.last_order_amount).toFixed(2)); |
254 | 254 | ||
255 | //有货币清零状态更新 | 255 | //有货币清零状态更新 |
256 | - $('#biprice').val(accMul(100, data.use_yoho_coin)); | 256 | + $('#biprice').val(accMul(100, data.shopping_cart_data.use_yoho_coin)); |
257 | if (data.use_yoho_coin === 0) { | 257 | if (data.use_yoho_coin === 0) { |
258 | $('.errbitip').text(''); | 258 | $('.errbitip').text(''); |
259 | } else { | 259 | } else { |
260 | - $('.errbitip').text('抵扣' + data.use_yoho_coin.toFixed(2) + '元'); | 260 | + $('.errbitip').text('抵扣' + data.shopping_cart_data.use_yoho_coin.toFixed(2) + '元'); |
261 | } | 261 | } |
262 | 262 | ||
263 | }, | 263 | }, |
@@ -1411,12 +1411,12 @@ class CartModel | @@ -1411,12 +1411,12 @@ class CartModel | ||
1411 | * @param int $uid 用户ID | 1411 | * @param int $uid 用户ID |
1412 | * @param type int $productSku 产品sku | 1412 | * @param type int $productSku 产品sku |
1413 | * @param type int $buyNumber 购买数量,范围1-4 | 1413 | * @param type int $buyNumber 购买数量,范围1-4 |
1414 | - * @param type int $yohoNum yoho币 | 1414 | + * @param type int $yohoCoin yoho币 |
1415 | * @return type [] | 1415 | * @return type [] |
1416 | */ | 1416 | */ |
1417 | - public function addTicket($uid, $productSku, $buyNumber, $yohoNum = 0) | 1417 | + public function addTicket($uid, $productSku, $buyNumber, $yohoCoin = 0) |
1418 | { | 1418 | { |
1419 | - return CartData::addTicket($uid, $productSku, $buyNumber, $yohoNum); | 1419 | + return CartData::addTicket($uid, $productSku, $buyNumber, $yohoCoin); |
1420 | } | 1420 | } |
1421 | 1421 | ||
1422 | /** | 1422 | /** |
@@ -1424,14 +1424,14 @@ class CartModel | @@ -1424,14 +1424,14 @@ class CartModel | ||
1424 | * @param int $uid 用户ID | 1424 | * @param int $uid 用户ID |
1425 | * @param type int $productSku 产品sku | 1425 | * @param type int $productSku 产品sku |
1426 | * @param type int $buyNumber 购买数量,范围1-4 | 1426 | * @param type int $buyNumber 购买数量,范围1-4 |
1427 | - * @param type int $yohoNum yoho币 | 1427 | + * @param type int $yohoCoin yoho币 |
1428 | * @return type | 1428 | * @return type |
1429 | */ | 1429 | */ |
1430 | - public function filterTicket($uid, $productSku, $buyNumber, $yohoNum = 0) | 1430 | + public function filterTicket($uid, $productSku, $buyNumber, $yohoCoin = 0) |
1431 | { | 1431 | { |
1432 | $cartType = 'advance'; | 1432 | $cartType = 'advance'; |
1433 | 1433 | ||
1434 | - $data = self::addTicket($uid, $productSku, $buyNumber, $yohoNum); | 1434 | + $data = self::addTicket($uid, $productSku, $buyNumber, $yohoCoin); |
1435 | 1435 | ||
1436 | return self::filterCartPay($data, $cartType, false); | 1436 | return self::filterCartPay($data, $cartType, false); |
1437 | } | 1437 | } |
@@ -582,16 +582,13 @@ class IndexController extends WebAction | @@ -582,16 +582,13 @@ class IndexController extends WebAction | ||
582 | //购买数量,范围1-4 | 582 | //购买数量,范围1-4 |
583 | $buyNumber = $this->post('buyNumber', 0); | 583 | $buyNumber = $this->post('buyNumber', 0); |
584 | //yoho币数量 | 584 | //yoho币数量 |
585 | - $yohoNum = $this->post('yohoNum', 0); | 585 | + $yohoCoin = $this->post('yohoCoin', 0); |
586 | // 执行加入购物车操作 | 586 | // 执行加入购物车操作 |
587 | - $orderEnsure = CartModel::filterTicket($uid, $productSku, $buyNumber, $yohoNum); | 587 | + $orderEnsure = CartModel::filterTicket($uid, $productSku, $buyNumber, $yohoCoin); |
588 | // if (empty($orderEnsure)) { | 588 | // if (empty($orderEnsure)) { |
589 | // $this->error(); | 589 | // $this->error(); |
590 | // } | 590 | // } |
591 | 591 | ||
592 | -// print_r($orderEnsure); | ||
593 | -// print_r($result); | ||
594 | -// exit; | ||
595 | $this->_view->display('ticket-ensure', array( | 592 | $this->_view->display('ticket-ensure', array( |
596 | 'ticketEnsurePage' => true, | 593 | 'ticketEnsurePage' => true, |
597 | 'orderEnsure' => $orderEnsure, | 594 | 'orderEnsure' => $orderEnsure, |
@@ -621,9 +618,9 @@ class IndexController extends WebAction | @@ -621,9 +618,9 @@ class IndexController extends WebAction | ||
621 | //购买数量,范围1-4 | 618 | //购买数量,范围1-4 |
622 | $buyNumber = $this->post('buyNumber', 0); | 619 | $buyNumber = $this->post('buyNumber', 0); |
623 | //yoho币数量 | 620 | //yoho币数量 |
624 | - $yohoNum = $this->post('yohoNum', 0); | 621 | + $yohoCoin = $this->post('yohoCoin', 0); |
625 | // 执行加入购物车操作 | 622 | // 执行加入购物车操作 |
626 | - $result = CartModel::addTicket($uid, $productSku, $buyNumber, $yohoNum); | 623 | + $result = CartModel::addTicket($uid, $productSku, $buyNumber, $yohoCoin); |
627 | 624 | ||
628 | } while (false); | 625 | } while (false); |
629 | 626 |
-
Please register or login to post a comment