Authored by hf

fixes bug refs YW-1515

... ... @@ -52,14 +52,16 @@ class Call extends Factory
$keys['code'] = $_REQUEST['code'];
$keys['redirect_uri'] = $this->apiConfig['appCallbackUrl'];
try
{
$token = $this->oauth->getAccessToken('code', $keys);
}
catch (Exception $e)
{
// do nothing
}
// try
// {
// $token = $this->oauth->getAccessToken('code', $keys);
// }
// catch (Exception $e)
// {
// // do nothing
// }
}
return $token;
... ...
... ... @@ -13,7 +13,7 @@
{{/isLogin}}
{{^isLogin}}
<div class="user-info">
<a class="login-btn" href="/signin.html?refer=/home">
<a class="login-btn" href="{{signinUrl}}">
登录/注册
</a>
</div>
... ...
... ... @@ -48,6 +48,7 @@ class HomeController extends AbstractAction
'showDownloadApp' => true,
'pageFooter' => true,
'cartUrl' => Helpers::url('/cart/index/index', null),
'signinUrl' => Helpers::url('/signin.html', array('refer' => Helpers::url('/home')) ),
);
$uid = $this->getUid(true);
if ($uid) {
... ...
... ... @@ -157,8 +157,8 @@ class DetailModel
// 商品信息
if (!empty($baseInfo['goodsList'])) {
$colorGroup = array();
$sizeGroup = array();
// $colorGroup = array();
// $sizeGroup = array();
$goodsList = array();
$goodsGroup = array();
$colorId = 0;
... ... @@ -168,50 +168,45 @@ class DetailModel
if (isset($value['goodsImagesList'])) {
foreach ($value['goodsImagesList'] as $goods) {
$goodsList[$goods['goodsId']] = $colorId;
$goodsGroup[$colorId][] = array(
$goodsGroup[] = array(
'goodsId' => $goods['goodsId'],
'img' => $goods['imageUrl'],
);
$colorGroup[$colorId] = array(
'colorId' => $colorId,
'colorName' => $value['colorName'],
'colorImage' => Helpers::getImageUrl($value['colorImage'], 60, 60),
);
// $colorGroup[$colorId] = array(
// 'colorId' => $colorId,
// 'colorName' => $value['colorName'],
// 'colorImage' => Helpers::getImageUrl($value['colorImage'], 60, 60),
// );
}
}
// 商品的尺码列表
if (isset($value['goodsSizeBoList'])) {
foreach ($value['goodsSizeBoList'] as $size) {
$sizeGroup[$colorId] = array(
'sizeName' => $size['sizeName'],
'sizeSku' => $size['goodsSizeSkuId'],
'sizeStorage' => $size['goodsSizeStorageNum'],
);
}
}
// // 商品的尺码列表
// if (isset($value['goodsSizeBoList'])) {
// foreach ($value['goodsSizeBoList'] as $size) {
// $sizeGroup[$colorId] = array(
// 'sizeName' => $size['sizeName'],
// 'sizeSku' => $size['goodsSizeSkuId'],
// 'sizeStorage' => $size['goodsSizeStorageNum'],
// );
// }
// }
}
// 商品图
$goodsId = intval($goodsId);
if (isset($goodsList[$goodsId])) {
$colorId = $goodsList[$goodsId];
// 多个
if (isset($goodsGroup[$colorId][1])) {
foreach ($goodsGroup[$colorId] as $value) {
// 商品图: 多个
if (isset($goodsGroup[1])) {
foreach ($goodsGroup as $value) {
$result['bannerTop']['list'][] = array(
'img' => Helpers::getImageUrl($value['img'], 450, 600)
);
}
}
// 单个
elseif (isset($goodsGroup[$colorId][0])) {
// 商品图: 单个
elseif (isset($goodsGroup[0])) {
$result['bannerTop'] = array(
'img' => Helpers::getImageUrl($goodsGroup[$colorId][0]['img'], 450, 600)
'img' => Helpers::getImageUrl($goodsGroup[0]['img'], 450, 600)
);
}
}
}
// 悬浮的购物车信息
$result['cartInfo'] = array(
... ...