Authored by hf

fixes bug to call product detail api and order status

... ... @@ -26,9 +26,11 @@
{{#if unpaid}}
<div class="order-opt">
<span class="btn cancel">取消订单</span>
{{#if payUrl}}
<a class="locHref" href="{{payUrl}}">
<span class="btn pay">立即付款</span>
</a>
{{/if}}
</div>
{{/if}}
... ...
... ... @@ -463,7 +463,6 @@ class HomeController extends AbstractAction
*/
public function onlineServiceDetailAction()
{
$service = array();
$cateId = $this->get('cateId', 0);
$cateName = $this->get('cateName', '');
if ($cateId > 0) {
... ... @@ -762,6 +761,7 @@ class HomeController extends AbstractAction
$orderCode = $this->get('order_code');
$data = OrderModel::Logistics($orderCode, $this->_uid);
$data['logisticInfoPage'] = true;
$data['pageFooter'] = true;
... ... @@ -771,18 +771,28 @@ class HomeController extends AbstractAction
/*
* 我的订单-付款跳转页
*/
public function payAction()
{
$this->setTitle('支付');
$this->setNavHeader('支付');
$this->_view->display('pay', array(
'payAppInfo' => array(
0 => array(
'appIcon' => '',
'weixin' => true,
'appId' => 'weixin',
'app' => '微信支付',
'hint' => '需下载微信客户端',
'subHint' => '推荐使用',
),
1 => array(
'appIcon' => '',
'appId' => 'baidu',
'app' => '百度支付',
'hint' => '需下载百度支付客户端',
'subHint' => '推荐使用',
),
),
));
}
... ...
... ... @@ -17,13 +17,51 @@ class OrderModel
/**
* 订单相关数据处理
*
* payment_type:
'1' => array(//在线支付
0 => '待付款',
1 => '已付款',
2 => '已付款',
3 => '已付款',
4 => '已发货',
5 => '已发货',
6 => '交易成功'
),
'2' => array(//货到付款
0 => '备货中',
1 => '已付款',
2 => '已付款',
3 => '已付款',
4 => '已发货',
5 => '已发货',
6 => '交易成功'
),
'3' => array(//现金支付
0 => '待付款',
1 => '已付款',
2 => '已付款',
3 => '已付款',
4 => '已发货',
5 => '已发货',
6 => '交易成功'
),
'4' => array(//抵消支付
0 => '待付款',
1 => '已付款',
2 => '已付款',
3 => '已付款',
4 => '已发货',
5 => '已发货',
6 => '交易成功'
)
*/
public static function getOrder($type, $page, $limit, $gender, $yh_channel, $uid)
{
$result = array();
//调用接口获得数据
$data = OrderData::getOrderData($type, $page, $limit, $gender, $yh_channel, $uid);
$data = OrderData::getOrderData($type, $page, $limit, $gender, $yh_channel, 5772257);
// 判断是否还有数据, 没有数据则返回空
if (isset($data['data']['page_total']) && $page > $data['data']['page_total']) {
return $result;
... ... @@ -80,6 +118,7 @@ class OrderModel
//订单为货到付款订单时,计算订单状态。(货到付款没有待付款状态)
switch ($vo['status']) {
case 0:
$result[$key]['unpaid'] = true;
break;
case 1:
case 2:
... ... @@ -163,7 +202,7 @@ class OrderModel
'name' => $value,
'typeId' => $key,
'active' => $act,
'url' => Helpers::url('/home/order', array('type' => $key))
'url' => Helpers::url('/home/orders', array('type' => $key))
);
}
... ...
... ... @@ -300,8 +300,12 @@ class DetailModel
$referenceName = '参考尺码(女)';
}
$showReference = false;
$sizeNameList = array(0 => array('param' => '吊牌尺码')); // 尺码名称
// 判断是否显示参考尺码
$showReference = !empty($sizeInfo['sizeInfoBo']['sizeBoList'][0]['referenceSize']);
if ($showReference) {
$sizeNameList[1] = array('param' => $referenceName);
}
$referenceList = array();
$sizeBoGroup = array(); // 尺码按ID分组
foreach ($sizeInfo['sizeInfoBo']['sizeAttributeBos'] as $attr) {
... ... @@ -309,6 +313,9 @@ class DetailModel
}
foreach ($sizeInfo['sizeInfoBo']['sizeBoList'] as $value) {
$sizeNameList[] = array('param' => $value['sizeName']);
if (!empty($value['referenceSize']['gender']) && ($value['referenceSize']['gender'] == $gender || $value['referenceSize']['gender'] == 3)) {
$referenceList[] = array('param' => $value['referenceSize']['referenceName']);
}
foreach ($value['sortAttributes'] as $attr) {
$sizeBoGroup[$attr['id']][] = array('param' => $attr['sizeValue']);
}
... ... @@ -316,6 +323,9 @@ class DetailModel
// 根据模板页面的显示,按表格一列一列来显示
$result['sizeInfo']['detail']['list'][0]['params'] = $sizeNameList;
if ($showReference) {
$result['sizeInfo']['detail']['list'][1]['params'] = $referenceList;
}
foreach ($sizeBoGroup as $value) {
$result['sizeInfo']['detail']['list'][]['params'] = $value;
}
... ...
... ... @@ -17,13 +17,19 @@ class LoginController extends AbstractAction
*/
public function indexAction()
{
$this->setTitle('登录');
$refer = $this->get('refer');
// 已登录则直接跳回
$uid = $this->getUid();
if ($uid) {
$refer = empty($refer) ? SITE_MAIN . '/?go=1' : rawurldecode($refer);
$this->go($refer);
}
if (!empty($refer)) {
$this->setCookie('refer', $refer);
}
$this->setTitle('登录');
$data = array(
'loginIndex' => true, // 模板中使用JS的标识
'backUrl' => '/', // 返回的URL链接
... ... @@ -47,13 +53,19 @@ class LoginController extends AbstractAction
*/
public function internationalAction()
{
$this->setTitle('国际账号登录');
$refer = $this->get('refer');
// 已登录则直接跳回
$uid = $this->getUid();
if ($uid) {
$refer = empty($refer) ? SITE_MAIN . '/?go=1' : rawurldecode($refer);
$this->go($refer);
}
if (!empty($refer)) {
$this->setCookie('refer', $refer);
}
$this->setTitle('国际账号登录');
$data = array();
$data['loginInternational'] = true; // 模板中使用JS的标识
$data['backUrl'] = '/'; // 返回的URL链接
... ... @@ -61,6 +73,7 @@ class LoginController extends AbstractAction
$data['isPassportPage'] = true; // 模板中模块标识
$data['areaCode'] = '+86'; // 默认区号
$data['countrys'] = RegData::getAreasData(); // 地区信息列表
// 渲染模板
$this->_view->display('international', $data);
}
... ... @@ -127,7 +140,6 @@ class LoginController extends AbstractAction
}
$data['data']['session'] = Helpers::syncUserSession($data['data']['uid']);
$data['data']['href'] = $refer;
} while (false);
$this->echoJson($data);
... ...