Authored by hf

code review by hf: merge zhaobiao order logistic

/**
* 支付页面
* @author: 赵彪<bill.zhao@yoho.cn>
* @date: 2015/12/03
*/
function isWXOpen() {
var ua = navigator.userAgent.toLowerCase();
if (ua.match(/MicroMessenger/i) === 'micromessenger') {
return true;
} else {
return false;
}
}
function hideWeChatPay() {
var payApps = document.getElementsByClassName('app');
[].forEach.call(payApps, function(app, index) {
if (app.innerHTML.indexOf('微信') !== -1) {
app.parentNode.style.display = 'none';
return false;
}
});
}
function handleForWX() {
if (isWXOpen()) {
hideWeChatPay();
}
}
window.onload = handleForWX;
... ...
.pay-page {
padding: (40rem / $pxConvertRem) (20rem / $pxConvertRem) 0;
.box {
border: 1px solid #eee;
border-radius: 10rem / $pxConvertRem;
padding: (12rem / $pxConvertRem) (20rem / $pxConvertRem);
display: flex;
align-items: center;
margin-bottom: 20rem / $pxConvertRem;
> div {
min-height: 40rem / $pxConvertRem;
display: flex;
align-items: center;
}
.icon {
flex-grow: 0.3;
img {
width: 60rem / $pxConvertRem;
margin: 0;
}
}
.app {
flex-grow: 3;
font-size: 32rem / $pxConvertRem;
color: #414141;
//padding-left: 20rem/$pxConvertRem
}
.hint {
flex-grow: 4;
font-size: 24rem / $pxConvertRem;
color: #4b4b4b;
}
.iconfont {
flex-grow: 1;
justify-content: flex-end;
color: #e0e0e0;
font-size: 28rem / $pxConvertRem;
}
}
}
... ...
{{> layout/header}}
<div class="pay-page yoho-page">
{{# payAppInfo}}
<div class="box">
<div class="icon">
<img src="{{appIcon}}" alt="app图标">
</div>
<div class="app">{{app}}</div>
<div class="hint">
{{hint}}
{{#if subHint}}
<br>
{{subHint}}
{{/if}}
</div>
<div class="iconfont">&#xe604</div>
</div>
{{/ payAppInfo}}
</div>
{{> layout/footer}}
... ...
... ... @@ -670,7 +670,7 @@ class HomeController extends AbstractAction
$uid = $this->getUid(true);
$gender = Helpers::getGenderByCookie();
$channel = Helpers::getChannelByCookie();
$data = OrderModel::getOrder($type, $page, 10, $gender, $channel, $this->_uid);
$data = OrderModel::getOrder($type, $page, 10, $gender, $channel, 6315793);
/* 如果取不到订单数据时,分两种情况:
1、page>1时,echo一个空格字符串到浏览器。
2、page=1时,就给一个随便逛逛的链接。
... ... @@ -760,13 +760,21 @@ class HomeController extends AbstractAction
}
/*
* 我的订单-支付链接获取
*/
// private function paymentAction() {
// $gender = Helpers::getGenderByCookie();
// $yh_channel = $this->get('yh_channel', 1);
// OrderModel::payment($gender, $yh_channel);
// }
* 我的订单-付款跳转页
*/
public function payAction()
{
$this->_view->display('pay', array(
'payAppInfo' => array(
0 => array(
'appIcon' => '',
'app' => '微信支付',
'hint' => '需下载微信客户端',
'subHint' => '推荐使用',
),
),
));
}
// /*
// * 我的订单-确认收货
... ...
... ... @@ -111,6 +111,7 @@ class OrderModel
{
$code = self::CODE_PAYMENT;
$data = OrderData::paymentData($gender, $yh_channel, $code);
return $data;
}
/**
... ...