Authored by 毕凯

微信访问隐藏支付宝

@@ -115,9 +115,22 @@ function hideWeChatPay() { @@ -115,9 +115,22 @@ function hideWeChatPay() {
115 }); 115 });
116 } 116 }
117 117
  118 +function hideAliPay() {
  119 + var $payApps = $('.app');
  120 +
  121 + $payApps.each(function(idx, app) {
  122 + if ($(app).parent().attr('id') === 'alipay') {
  123 + $(app).closest('a').css('display', 'none');
  124 + return false;
  125 + }
  126 + });
  127 +}
  128 +
118 function handleForWX() { 129 function handleForWX() {
119 if (!isWXOpen()) { 130 if (!isWXOpen()) {
120 hideWeChatPay(); 131 hideWeChatPay();
  132 + } else {
  133 + hideAliPay();
121 } 134 }
122 } 135 }
123 136
@@ -998,7 +998,7 @@ class HomeController extends AbstractAction @@ -998,7 +998,7 @@ class HomeController extends AbstractAction
998 'appId' => 'alipay', 998 'appId' => 'alipay',
999 'app' => '支付宝支付', 999 'app' => '支付宝支付',
1000 'hint' => '支付宝钱包支付', 1000 'hint' => '支付宝钱包支付',
1001 - 'subHint' => '推荐支付宝用户使用', 1001 + 'subHint' => '推荐支付宝用户使用'
1002 ), 1002 ),
1003 1 => array( 1003 1 => array(
1004 'appIcon' => '', 1004 'appIcon' => '',
@@ -1006,14 +1006,10 @@ class HomeController extends AbstractAction @@ -1006,14 +1006,10 @@ class HomeController extends AbstractAction
1006 'appId' => 'weixin', 1006 'appId' => 'weixin',
1007 'app' => '微信支付', 1007 'app' => '微信支付',
1008 'hint' => '推荐使用', 1008 'hint' => '推荐使用',
1009 - 'subHint' => '', 1009 + 'subHint' => ''
1010 ), 1010 ),
1011 ); 1011 );
1012 1012
1013 - if (stripos($this->server('HTTP_USER_AGENT', ''), 'MicroMessenger') !== false) {  
1014 - unset($payList[0]);  
1015 - }  
1016 -  
1017 $this->_view->display('pay', array( 1013 $this->_view->display('pay', array(
1018 'payCenterPage' => true, 1014 'payCenterPage' => true,
1019 'payAppInfo' => $payList, 1015 'payAppInfo' => $payList,