fixes bug to call product detail api and order status
Showing
5 changed files
with
84 additions
and
11 deletions
@@ -26,9 +26,11 @@ | @@ -26,9 +26,11 @@ | ||
26 | {{#if unpaid}} | 26 | {{#if unpaid}} |
27 | <div class="order-opt"> | 27 | <div class="order-opt"> |
28 | <span class="btn cancel">取消订单</span> | 28 | <span class="btn cancel">取消订单</span> |
29 | + {{#if payUrl}} | ||
29 | <a class="locHref" href="{{payUrl}}"> | 30 | <a class="locHref" href="{{payUrl}}"> |
30 | <span class="btn pay">立即付款</span> | 31 | <span class="btn pay">立即付款</span> |
31 | </a> | 32 | </a> |
33 | + {{/if}} | ||
32 | </div> | 34 | </div> |
33 | {{/if}} | 35 | {{/if}} |
34 | 36 |
@@ -463,7 +463,6 @@ class HomeController extends AbstractAction | @@ -463,7 +463,6 @@ class HomeController extends AbstractAction | ||
463 | */ | 463 | */ |
464 | public function onlineServiceDetailAction() | 464 | public function onlineServiceDetailAction() |
465 | { | 465 | { |
466 | - $service = array(); | ||
467 | $cateId = $this->get('cateId', 0); | 466 | $cateId = $this->get('cateId', 0); |
468 | $cateName = $this->get('cateName', ''); | 467 | $cateName = $this->get('cateName', ''); |
469 | if ($cateId > 0) { | 468 | if ($cateId > 0) { |
@@ -762,6 +761,7 @@ class HomeController extends AbstractAction | @@ -762,6 +761,7 @@ class HomeController extends AbstractAction | ||
762 | 761 | ||
763 | $orderCode = $this->get('order_code'); | 762 | $orderCode = $this->get('order_code'); |
764 | $data = OrderModel::Logistics($orderCode, $this->_uid); | 763 | $data = OrderModel::Logistics($orderCode, $this->_uid); |
764 | + | ||
765 | $data['logisticInfoPage'] = true; | 765 | $data['logisticInfoPage'] = true; |
766 | $data['pageFooter'] = true; | 766 | $data['pageFooter'] = true; |
767 | 767 | ||
@@ -771,18 +771,28 @@ class HomeController extends AbstractAction | @@ -771,18 +771,28 @@ class HomeController extends AbstractAction | ||
771 | /* | 771 | /* |
772 | * 我的订单-付款跳转页 | 772 | * 我的订单-付款跳转页 |
773 | */ | 773 | */ |
774 | + | ||
774 | public function payAction() | 775 | public function payAction() |
775 | { | 776 | { |
777 | + $this->setTitle('支付'); | ||
778 | + $this->setNavHeader('支付'); | ||
779 | + | ||
776 | $this->_view->display('pay', array( | 780 | $this->_view->display('pay', array( |
777 | 'payAppInfo' => array( | 781 | 'payAppInfo' => array( |
778 | 0 => array( | 782 | 0 => array( |
779 | 'appIcon' => '', | 783 | 'appIcon' => '', |
780 | - 'weixin' => true, | 784 | + 'appId' => 'weixin', |
781 | 'app' => '微信支付', | 785 | 'app' => '微信支付', |
782 | 'hint' => '需下载微信客户端', | 786 | 'hint' => '需下载微信客户端', |
783 | 'subHint' => '推荐使用', | 787 | 'subHint' => '推荐使用', |
784 | ), | 788 | ), |
785 | - | 789 | + 1 => array( |
790 | + 'appIcon' => '', | ||
791 | + 'appId' => 'baidu', | ||
792 | + 'app' => '百度支付', | ||
793 | + 'hint' => '需下载百度支付客户端', | ||
794 | + 'subHint' => '推荐使用', | ||
795 | + ), | ||
786 | ), | 796 | ), |
787 | )); | 797 | )); |
788 | } | 798 | } |
@@ -17,13 +17,51 @@ class OrderModel | @@ -17,13 +17,51 @@ class OrderModel | ||
17 | 17 | ||
18 | /** | 18 | /** |
19 | * 订单相关数据处理 | 19 | * 订单相关数据处理 |
20 | + * | ||
21 | + * payment_type: | ||
22 | + '1' => array(//在线支付 | ||
23 | + 0 => '待付款', | ||
24 | + 1 => '已付款', | ||
25 | + 2 => '已付款', | ||
26 | + 3 => '已付款', | ||
27 | + 4 => '已发货', | ||
28 | + 5 => '已发货', | ||
29 | + 6 => '交易成功' | ||
30 | + ), | ||
31 | + '2' => array(//货到付款 | ||
32 | + 0 => '备货中', | ||
33 | + 1 => '已付款', | ||
34 | + 2 => '已付款', | ||
35 | + 3 => '已付款', | ||
36 | + 4 => '已发货', | ||
37 | + 5 => '已发货', | ||
38 | + 6 => '交易成功' | ||
39 | + ), | ||
40 | + '3' => array(//现金支付 | ||
41 | + 0 => '待付款', | ||
42 | + 1 => '已付款', | ||
43 | + 2 => '已付款', | ||
44 | + 3 => '已付款', | ||
45 | + 4 => '已发货', | ||
46 | + 5 => '已发货', | ||
47 | + 6 => '交易成功' | ||
48 | + ), | ||
49 | + '4' => array(//抵消支付 | ||
50 | + 0 => '待付款', | ||
51 | + 1 => '已付款', | ||
52 | + 2 => '已付款', | ||
53 | + 3 => '已付款', | ||
54 | + 4 => '已发货', | ||
55 | + 5 => '已发货', | ||
56 | + 6 => '交易成功' | ||
57 | + ) | ||
20 | */ | 58 | */ |
21 | 59 | ||
22 | public static function getOrder($type, $page, $limit, $gender, $yh_channel, $uid) | 60 | public static function getOrder($type, $page, $limit, $gender, $yh_channel, $uid) |
23 | { | 61 | { |
24 | $result = array(); | 62 | $result = array(); |
25 | //调用接口获得数据 | 63 | //调用接口获得数据 |
26 | - $data = OrderData::getOrderData($type, $page, $limit, $gender, $yh_channel, $uid); | 64 | + $data = OrderData::getOrderData($type, $page, $limit, $gender, $yh_channel, 5772257); |
27 | // 判断是否还有数据, 没有数据则返回空 | 65 | // 判断是否还有数据, 没有数据则返回空 |
28 | if (isset($data['data']['page_total']) && $page > $data['data']['page_total']) { | 66 | if (isset($data['data']['page_total']) && $page > $data['data']['page_total']) { |
29 | return $result; | 67 | return $result; |
@@ -80,6 +118,7 @@ class OrderModel | @@ -80,6 +118,7 @@ class OrderModel | ||
80 | //订单为货到付款订单时,计算订单状态。(货到付款没有待付款状态) | 118 | //订单为货到付款订单时,计算订单状态。(货到付款没有待付款状态) |
81 | switch ($vo['status']) { | 119 | switch ($vo['status']) { |
82 | case 0: | 120 | case 0: |
121 | + $result[$key]['unpaid'] = true; | ||
83 | break; | 122 | break; |
84 | case 1: | 123 | case 1: |
85 | case 2: | 124 | case 2: |
@@ -163,7 +202,7 @@ class OrderModel | @@ -163,7 +202,7 @@ class OrderModel | ||
163 | 'name' => $value, | 202 | 'name' => $value, |
164 | 'typeId' => $key, | 203 | 'typeId' => $key, |
165 | 'active' => $act, | 204 | 'active' => $act, |
166 | - 'url' => Helpers::url('/home/order', array('type' => $key)) | 205 | + 'url' => Helpers::url('/home/orders', array('type' => $key)) |
167 | ); | 206 | ); |
168 | } | 207 | } |
169 | 208 |
@@ -300,8 +300,12 @@ class DetailModel | @@ -300,8 +300,12 @@ class DetailModel | ||
300 | $referenceName = '参考尺码(女)'; | 300 | $referenceName = '参考尺码(女)'; |
301 | } | 301 | } |
302 | 302 | ||
303 | - $showReference = false; | ||
304 | $sizeNameList = array(0 => array('param' => '吊牌尺码')); // 尺码名称 | 303 | $sizeNameList = array(0 => array('param' => '吊牌尺码')); // 尺码名称 |
304 | + // 判断是否显示参考尺码 | ||
305 | + $showReference = !empty($sizeInfo['sizeInfoBo']['sizeBoList'][0]['referenceSize']); | ||
306 | + if ($showReference) { | ||
307 | + $sizeNameList[1] = array('param' => $referenceName); | ||
308 | + } | ||
305 | $referenceList = array(); | 309 | $referenceList = array(); |
306 | $sizeBoGroup = array(); // 尺码按ID分组 | 310 | $sizeBoGroup = array(); // 尺码按ID分组 |
307 | foreach ($sizeInfo['sizeInfoBo']['sizeAttributeBos'] as $attr) { | 311 | foreach ($sizeInfo['sizeInfoBo']['sizeAttributeBos'] as $attr) { |
@@ -309,6 +313,9 @@ class DetailModel | @@ -309,6 +313,9 @@ class DetailModel | ||
309 | } | 313 | } |
310 | foreach ($sizeInfo['sizeInfoBo']['sizeBoList'] as $value) { | 314 | foreach ($sizeInfo['sizeInfoBo']['sizeBoList'] as $value) { |
311 | $sizeNameList[] = array('param' => $value['sizeName']); | 315 | $sizeNameList[] = array('param' => $value['sizeName']); |
316 | + if (!empty($value['referenceSize']['gender']) && ($value['referenceSize']['gender'] == $gender || $value['referenceSize']['gender'] == 3)) { | ||
317 | + $referenceList[] = array('param' => $value['referenceSize']['referenceName']); | ||
318 | + } | ||
312 | foreach ($value['sortAttributes'] as $attr) { | 319 | foreach ($value['sortAttributes'] as $attr) { |
313 | $sizeBoGroup[$attr['id']][] = array('param' => $attr['sizeValue']); | 320 | $sizeBoGroup[$attr['id']][] = array('param' => $attr['sizeValue']); |
314 | } | 321 | } |
@@ -316,6 +323,9 @@ class DetailModel | @@ -316,6 +323,9 @@ class DetailModel | ||
316 | 323 | ||
317 | // 根据模板页面的显示,按表格一列一列来显示 | 324 | // 根据模板页面的显示,按表格一列一列来显示 |
318 | $result['sizeInfo']['detail']['list'][0]['params'] = $sizeNameList; | 325 | $result['sizeInfo']['detail']['list'][0]['params'] = $sizeNameList; |
326 | + if ($showReference) { | ||
327 | + $result['sizeInfo']['detail']['list'][1]['params'] = $referenceList; | ||
328 | + } | ||
319 | foreach ($sizeBoGroup as $value) { | 329 | foreach ($sizeBoGroup as $value) { |
320 | $result['sizeInfo']['detail']['list'][]['params'] = $value; | 330 | $result['sizeInfo']['detail']['list'][]['params'] = $value; |
321 | } | 331 | } |
@@ -17,13 +17,19 @@ class LoginController extends AbstractAction | @@ -17,13 +17,19 @@ class LoginController extends AbstractAction | ||
17 | */ | 17 | */ |
18 | public function indexAction() | 18 | public function indexAction() |
19 | { | 19 | { |
20 | - $this->setTitle('登录'); | ||
21 | - | ||
22 | $refer = $this->get('refer'); | 20 | $refer = $this->get('refer'); |
21 | + // 已登录则直接跳回 | ||
22 | + $uid = $this->getUid(); | ||
23 | + if ($uid) { | ||
24 | + $refer = empty($refer) ? SITE_MAIN . '/?go=1' : rawurldecode($refer); | ||
25 | + $this->go($refer); | ||
26 | + } | ||
23 | if (!empty($refer)) { | 27 | if (!empty($refer)) { |
24 | $this->setCookie('refer', $refer); | 28 | $this->setCookie('refer', $refer); |
25 | } | 29 | } |
26 | 30 | ||
31 | + $this->setTitle('登录'); | ||
32 | + | ||
27 | $data = array( | 33 | $data = array( |
28 | 'loginIndex' => true, // 模板中使用JS的标识 | 34 | 'loginIndex' => true, // 模板中使用JS的标识 |
29 | 'backUrl' => '/', // 返回的URL链接 | 35 | 'backUrl' => '/', // 返回的URL链接 |
@@ -47,13 +53,19 @@ class LoginController extends AbstractAction | @@ -47,13 +53,19 @@ class LoginController extends AbstractAction | ||
47 | */ | 53 | */ |
48 | public function internationalAction() | 54 | public function internationalAction() |
49 | { | 55 | { |
50 | - $this->setTitle('国际账号登录'); | ||
51 | - | ||
52 | $refer = $this->get('refer'); | 56 | $refer = $this->get('refer'); |
57 | + // 已登录则直接跳回 | ||
58 | + $uid = $this->getUid(); | ||
59 | + if ($uid) { | ||
60 | + $refer = empty($refer) ? SITE_MAIN . '/?go=1' : rawurldecode($refer); | ||
61 | + $this->go($refer); | ||
62 | + } | ||
53 | if (!empty($refer)) { | 63 | if (!empty($refer)) { |
54 | $this->setCookie('refer', $refer); | 64 | $this->setCookie('refer', $refer); |
55 | } | 65 | } |
56 | 66 | ||
67 | + $this->setTitle('国际账号登录'); | ||
68 | + | ||
57 | $data = array(); | 69 | $data = array(); |
58 | $data['loginInternational'] = true; // 模板中使用JS的标识 | 70 | $data['loginInternational'] = true; // 模板中使用JS的标识 |
59 | $data['backUrl'] = '/'; // 返回的URL链接 | 71 | $data['backUrl'] = '/'; // 返回的URL链接 |
@@ -61,6 +73,7 @@ class LoginController extends AbstractAction | @@ -61,6 +73,7 @@ class LoginController extends AbstractAction | ||
61 | $data['isPassportPage'] = true; // 模板中模块标识 | 73 | $data['isPassportPage'] = true; // 模板中模块标识 |
62 | $data['areaCode'] = '+86'; // 默认区号 | 74 | $data['areaCode'] = '+86'; // 默认区号 |
63 | $data['countrys'] = RegData::getAreasData(); // 地区信息列表 | 75 | $data['countrys'] = RegData::getAreasData(); // 地区信息列表 |
76 | + | ||
64 | // 渲染模板 | 77 | // 渲染模板 |
65 | $this->_view->display('international', $data); | 78 | $this->_view->display('international', $data); |
66 | } | 79 | } |
@@ -127,7 +140,6 @@ class LoginController extends AbstractAction | @@ -127,7 +140,6 @@ class LoginController extends AbstractAction | ||
127 | } | 140 | } |
128 | $data['data']['session'] = Helpers::syncUserSession($data['data']['uid']); | 141 | $data['data']['session'] = Helpers::syncUserSession($data['data']['uid']); |
129 | $data['data']['href'] = $refer; | 142 | $data['data']['href'] = $refer; |
130 | - | ||
131 | } while (false); | 143 | } while (false); |
132 | 144 | ||
133 | $this->echoJson($data); | 145 | $this->echoJson($data); |
-
Please register or login to post a comment