Authored by Rock Zhang

修复限购商品购买支付错误的bug

Code Review By Rock Zhang
... ... @@ -233,8 +233,12 @@ class DetailData
{
$param = Yohobuy::param();
$param['method'] = 'app.limitProduct.limitProductDetail';
$param['uid'] = $uid;
$param['limitProductCode'] = $productCode;
if (!empty($uid)) {
$param['uid'] = $uid;
}
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
... ...
... ... @@ -473,8 +473,8 @@ $yohoPage.on('touchstart', '.btn-minus', function() {
} else if (limitProductCode) {
// 当前面板选择的是限购商品
url = 'http://m.yohobuy.com/cart/index/orderEnsure?code=' + limitProductCode + '&&sku=' +
productSku + '&&skn=' + skn + '&&buy_num=' + buyNumber;
url = 'http://m.yohobuy.com/cart/index/orderEnsure?limitproductcode=' + limitProductCode + '&sku=' +
productSku + '&skn=' + skn + '&buy_number=' + buyNumber;
//打开结算页面,结束函数执行。
window.location.href = url;
... ...
... ... @@ -31,7 +31,7 @@ require('../common');
lazyLoad();
function getQueryParam() {
var queryArray = location.search.substr(1).split('&&'),
var queryArray = location.search.substr(1).split('&'),
i,
subArr = [],
obj = {};
... ... @@ -46,7 +46,7 @@ function getQueryParam() {
}
function isLimitGood() {
return getQueryParam().code;
return getQueryParam().limitproductcode;
}
... ... @@ -69,7 +69,11 @@ if (document.referrer && document.referrer.indexOf('/cart/index/index') !== -1)
isLimitGood() && (function() {
var a = [];
a.push(getQueryParam());
var data = getQueryParam();
data['type'] = 'limitcode';
a.push(data);
orderInfo('skuList', JSON.stringify(a));
})();
... ...
... ... @@ -757,7 +757,7 @@ class DetailModel
$result = array();
do {
if (empty($uid) || empty($productCode)) {
if (empty($productCode)) {
break;
}
... ...
... ... @@ -295,10 +295,10 @@ class IndexController extends AbstractAction
}
// 如果传递了code, sku,skn,buy_number就代表是限购商品
$limitProductCode = $this->get('code', '');
$limitProductCode = $this->get('limitproductcode', '');
$sku = $this->get('sku', '');
$skn = $this->get('skn', '');
$buyNumber = $this->get('buy_number', '');
$buyNumber = $this->get('buy_number', 1);
// 购物车商品为空跳转到购物车页面
$uid = $this->getUid(true);
... ...