Authored by hf

fixes bug to call product detail api and order status

@@ -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
@@ -52,7 +52,7 @@ class HomeController extends AbstractAction @@ -52,7 +52,7 @@ class HomeController extends AbstractAction
52 $uid = $this->getUid(true); 52 $uid = $this->getUid(true);
53 if ($uid) { 53 if ($uid) {
54 $data['isLogin'] = true; 54 $data['isLogin'] = true;
55 - $udid = $this->getUdid(); 55 + $udid = $this->getUdid();
56 $data += UserModel::getUserProfileData($uid); 56 $data += UserModel::getUserProfileData($uid);
57 $data += UserModel::getInfoNumData($uid, $udid); 57 $data += UserModel::getInfoNumData($uid, $udid);
58 } 58 }
@@ -463,18 +463,17 @@ class HomeController extends AbstractAction @@ -463,18 +463,17 @@ 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) {
470 $service = Home\OnlineModel::getOnlineServiceDetail($cateId); 469 $service = Home\OnlineModel::getOnlineServiceDetail($cateId);
471 } 470 }
472 471
473 - $service = array(  
474 - 'header' => array('title' => '在线客服'), 472 + $service = array(
  473 + 'header' => array('title' => '在线客服'),
475 'pageFooter' => true, 474 'pageFooter' => true,
476 - 'service' => $service  
477 - ); 475 + 'service' => $service
  476 + );
478 477
479 $this->setTitle('在线客服'); 478 $this->setTitle('在线客服');
480 $this->setNavHeader($cateName, true, ''); 479 $this->setNavHeader($cateName, true, '');
@@ -761,7 +760,8 @@ class HomeController extends AbstractAction @@ -761,7 +760,8 @@ class HomeController extends AbstractAction
761 $this->setNavHeader('物流详情'); 760 $this->setNavHeader('物流详情');
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' => '',  
780 - 'weixin' => true,  
781 - 'app' => '微信支付',  
782 - 'hint' => '需下载微信客户端',  
783 - 'subHint' => '推荐使用',  
784 - ),  
785 - 783 + 'appIcon' => '',
  784 + 'appId' => 'weixin',
  785 + 'app' => '微信支付',
  786 + 'hint' => '需下载微信客户端',
  787 + 'subHint' => '推荐使用',
  788 + ),
  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;
@@ -33,7 +71,7 @@ class OrderModel @@ -33,7 +71,7 @@ class OrderModel
33 foreach ($data['data']['order_list'] as $key => $vo) { 71 foreach ($data['data']['order_list'] as $key => $vo) {
34 //订单号,支付状态,订单商品数量,订单总价格 72 //订单号,支付状态,订单商品数量,订单总价格
35 $result[$key]['orderNum'] = $vo['order_code']; 73 $result[$key]['orderNum'] = $vo['order_code'];
36 - $result[$key]['orderStatus'] = ($vo['is_cancel'] === 'Y') ? '已取消' : $vo['status_str']; 74 + $result[$key]['orderStatus'] = ($vo['is_cancel'] === 'Y') ? '已取消' : $vo['status_str'];
37 $result[$key]['count'] = count($vo['order_goods']); 75 $result[$key]['count'] = count($vo['order_goods']);
38 $result[$key]['sumCost'] = $vo['amount']; 76 $result[$key]['sumCost'] = $vo['amount'];
39 //类内调用格式化订单商品数据方法 77 //类内调用格式化订单商品数据方法
@@ -47,8 +85,8 @@ class OrderModel @@ -47,8 +85,8 @@ class OrderModel
47 break; 85 break;
48 } 86 }
49 /* 先判断订单付款方式,根据不同的付款方式计算订单状态。(注:货到付款没有待付款状态) 87 /* 先判断订单付款方式,根据不同的付款方式计算订单状态。(注:货到付款没有待付款状态)
50 - * 付款方式:1 => 在线支付,2 => 货到付款,3 => 现金支付,4 => 抵消支付;  
51 - */ 88 + * 付款方式:1 => 在线支付,2 => 货到付款,3 => 现金支付,4 => 抵消支付;
  89 + */
52 //支付方式为非货到付款时,计算订单状态。 90 //支付方式为非货到付款时,计算订单状态。
53 if ($vo['payment_type'] != 2) { 91 if ($vo['payment_type'] != 2) {
54 switch ($vo['status']) { 92 switch ($vo['status']) {
@@ -79,7 +117,8 @@ class OrderModel @@ -79,7 +117,8 @@ class OrderModel
79 117
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:
@@ -126,7 +165,7 @@ class OrderModel @@ -126,7 +165,7 @@ class OrderModel
126 public static function Logistics($orderCode, $uid) 165 public static function Logistics($orderCode, $uid)
127 { 166 {
128 $result = array(); 167 $result = array();
129 - 168 +
130 if (isset($orderCode) && is_numeric($uid)) { 169 if (isset($orderCode) && is_numeric($uid)) {
131 $logistics = OrderData::LogisticsData($orderCode, $uid); 170 $logistics = OrderData::LogisticsData($orderCode, $uid);
132 if (!empty($logistics['data'])) { 171 if (!empty($logistics['data'])) {
@@ -134,7 +173,7 @@ class OrderModel @@ -134,7 +173,7 @@ class OrderModel
134 $result['logisticImg'] = $logistics['data']['logo']; 173 $result['logisticImg'] = $logistics['data']['logo'];
135 $result['logisticCompany'] = $logistics['data']['caption']; 174 $result['logisticCompany'] = $logistics['data']['caption'];
136 $result['logisticNumber'] = $logistics['data']['express_number']; 175 $result['logisticNumber'] = $logistics['data']['express_number'];
137 - 176 +
138 $build = array(); 177 $build = array();
139 foreach ($logistics['data']['express_detail'] as $value) { 178 foreach ($logistics['data']['express_detail'] as $value) {
140 $build['status'] = $value['accept_address']; 179 $build['status'] = $value['accept_address'];
@@ -143,10 +182,10 @@ class OrderModel @@ -143,10 +182,10 @@ class OrderModel
143 } 182 }
144 } 183 }
145 } 184 }
146 - 185 +
147 return $result; 186 return $result;
148 } 187 }
149 - 188 +
150 /** 189 /**
151 * 根据type值设置nav属性 190 * 根据type值设置nav属性
152 */ 191 */
@@ -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 }
@@ -16,14 +16,20 @@ class LoginController extends AbstractAction @@ -16,14 +16,20 @@ class LoginController extends AbstractAction
16 * 登录页 16 * 登录页
17 */ 17 */
18 public function indexAction() 18 public function indexAction()
19 - {  
20 - $this->setTitle('登录');  
21 - 19 + {
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 }
@@ -74,7 +87,7 @@ class LoginController extends AbstractAction @@ -74,7 +87,7 @@ class LoginController extends AbstractAction
74 87
75 $refer = $this->server('HTTP_REFERER', SITE_MAIN); 88 $refer = $this->server('HTTP_REFERER', SITE_MAIN);
76 $token = $this->get('token'); 89 $token = $this->get('token');
77 - 90 +
78 LoginData::signoutSession($token); 91 LoginData::signoutSession($token);
79 92
80 $this->go($refer); 93 $this->go($refer);
@@ -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);
@@ -174,14 +186,14 @@ class LoginController extends AbstractAction @@ -174,14 +186,14 @@ class LoginController extends AbstractAction
174 if (isset($realName, $email, $userId)) { 186 if (isset($realName, $email, $userId)) {
175 $result = LoginData::signinByOpenID($realName, $userId, 'alipay'); 187 $result = LoginData::signinByOpenID($realName, $userId, 'alipay');
176 } 188 }
177 - 189 +
178 $refer = $this->getCookie('refer'); 190 $refer = $this->getCookie('refer');
179 if (empty($refer)) { 191 if (empty($refer)) {
180 $refer = SITE_MAIN . '/?go=1'; 192 $refer = SITE_MAIN . '/?go=1';
181 } else { 193 } else {
182 $refer = rawurldecode($refer); 194 $refer = rawurldecode($refer);
183 } 195 }
184 - 196 +
185 if ($result['code'] == 200 && !empty($result['data']['uid'])) { 197 if ($result['code'] == 200 && !empty($result['data']['uid'])) {
186 $this->go(Helpers::syncUserSession($result['data']['uid'], $refer)); 198 $this->go(Helpers::syncUserSession($result['data']['uid'], $refer));
187 } else { 199 } else {
@@ -201,7 +213,7 @@ class LoginController extends AbstractAction @@ -201,7 +213,7 @@ class LoginController extends AbstractAction
201 213
202 $result = array(); 214 $result = array();
203 if ($partnerInfo && is_array($partnerInfo)) { 215 if ($partnerInfo && is_array($partnerInfo)) {
204 - $result = LoginData::signinByOpenID($partnerInfo['nickname'], $access['openid'], 'qq'); 216 + $result = LoginData::signinByOpenID($partnerInfo['nickname'], $access['openid'], 'qq');
205 } 217 }
206 218
207 $refer = $this->getCookie('refer'); 219 $refer = $this->getCookie('refer');
@@ -210,7 +222,7 @@ class LoginController extends AbstractAction @@ -210,7 +222,7 @@ class LoginController extends AbstractAction
210 } else { 222 } else {
211 $refer = rawurldecode($refer); 223 $refer = rawurldecode($refer);
212 } 224 }
213 - 225 +
214 if ($result['code'] == 200 && !empty($result['data']['uid'])) { 226 if ($result['code'] == 200 && !empty($result['data']['uid'])) {
215 $this->go(Helpers::syncUserSession($result['data']['uid'], $refer)); 227 $this->go(Helpers::syncUserSession($result['data']['uid'], $refer));
216 } else { 228 } else {
@@ -239,7 +251,7 @@ class LoginController extends AbstractAction @@ -239,7 +251,7 @@ class LoginController extends AbstractAction
239 } else { 251 } else {
240 $refer = rawurldecode($refer); 252 $refer = rawurldecode($refer);
241 } 253 }
242 - 254 +
243 if ($result['code'] == 200 && !empty($result['data']['uid'])) { 255 if ($result['code'] == 200 && !empty($result['data']['uid'])) {
244 $this->go(Helpers::syncUserSession($result['data']['uid'], $refer)); 256 $this->go(Helpers::syncUserSession($result['data']['uid'], $refer));
245 } else { 257 } else {