Authored by 周少峰

list and detail goods

... ... @@ -618,9 +618,10 @@ class Helpers
* @param array $orderGoods 订单
* @param int $count 计订单件数
* @param bool $haveLink 控制是否需要商品链接
* @param bool $tickets 门票
* @return array $arr 处理之后的订单商品数据
*/
public static function formatOrderGoods($orderGoods, &$count = 0, $haveLink = false)
public static function formatOrderGoods($orderGoods, &$count = 0, $haveLink = false, $tickets = false)
{
$arr = array();
... ... @@ -647,6 +648,11 @@ class Helpers
}
// 累计购买数
$count += intval($vo['buy_number']);
//门票
if ($tickets) {
$arr[$key]['tickets'] = true;
}
}
return $arr;
... ...
... ... @@ -398,7 +398,7 @@ function ticketsConfirm () {
success: function(ticket) {
//下单成功调整支付页面
if (ticket.code === 200) {
window.location.href = '/home/orders/pay?order_code=' + ticket.data.order_code
}
},
... ...
... ... @@ -267,4 +267,18 @@
.btn-rebuy {
margin-left: 10px;
}
.tickets-mobile {
font-size:32px;
height: 90px;
line-height: 90px;
.pull-left {
float:left;
}
.pull-right {
float:right;
}
}
}
... ...
... ... @@ -2,24 +2,33 @@
<div class="order-detail-page yoho-page">
{{# orderDetail}}
<div id="order-detail" data-id="{{orderNum}}">
<section class="owner-info block" data-changeable="{{changeable}}" data-url="{{url}}">
<span class="iconfont">&#xe637;</span>
{{#if virtual}}
<section class="block">
<div class="tickets-mobile">
<span class="pull-left">手机号码:</span>
<span class="pull-right">{{mobile}}</span>
</div>
</section>
{{else}}
<section class="owner-info block" data-changeable="{{changeable}}" data-url="{{url}}">
<span class="iconfont">&#xe637;</span>
<div class="beside-icon">
<p class="name-phone">
{{name}}
<span>{{phoneNum}}</span>
</p>
<div class="beside-icon">
<p class="name-phone">
{{name}}
<span>{{phoneNum}}</span>
</p>
<p class="address">
{{address}}
</p>
<p class="address">
{{address}}
</p>
<div class="rest">其他地址<span class="iconfont iconAddress">&#xe614;</span></div>
</div>
</section>
<div class="range"></div>
<div class="rest">其他地址<span class="iconfont iconAddress">&#xe614;</span></div>
</div>
</section>
<div class="range"></div>
{{/if}}
<section class="order-status block">
<div class="status sub">
<span class="iconfont">&#xe632;</span>
... ... @@ -101,6 +110,12 @@
<span class="btn btn-check-logistics">查看物流</span>
</a>
{{/if}}
{{#if qrcode}}
<a href="{{qrcode}}">
<span class="btn btn-check-logistics">查看二维码</span>
</a>
{{/if}}
</div>
</div>
... ...
... ... @@ -12,13 +12,13 @@
<p class="row">
{{#if color}}
<span class="color">
颜色:{{color}}
{{#if tickets}}日期{{else}}颜色{{/if}}:{{color}}
</span>
{{/if}}
{{#if size}}
<span class="size">
尺码:{{size}}
{{#if tickets}}区域{{else}}尺码{{/if}}:{{size}}
</span>
{{/if}}
</p>
... ...
... ... @@ -203,6 +203,15 @@ class OrderModel
if (isset($orderDetail['data']['order_code'])) {
$count = 0;
$result = self::getOrderStatus($orderDetail['data'], true); // 订单状态
//门票
if (isset($orderDetail['data']['virtual_type']) && $orderDetail['data']['virtual_type'] == 3) {
//手机号
$result['virtual'] = true;
$result['mobile'] = isset($orderDetail['data']['mobile']) ? $orderDetail['data']['mobile'] : '';
//二维码
$result['qrcode'] = Helpers::url('/qrcode/'.$orderDetail['data']['order_code']);
}
$result['name'] = $orderDetail['data']['user_name'];
$result['phoneNum'] = $orderDetail['data']['mobile'];
$result['address'] = $orderDetail['data']['area'] . $orderDetail['data']['address'];
... ... @@ -213,7 +222,7 @@ class OrderModel
if (isset($orderDetail['data']['counter_flag']) && $orderDetail['data']['counter_flag'] == 'Y') {
$result['leftTime'] = $orderDetail['data']['pay_lefttime']*1000;
}
$result['goods'] = Helpers::formatOrderGoods($orderDetail['data']['order_goods'], $count, true);
$result['goods'] = Helpers::formatOrderGoods($orderDetail['data']['order_goods'], $count, true, true);
if (isset($orderDetail['data']['promo_code_amount'])) {
$result['promo_code_amount'] = self::filterOrderPrice($orderDetail['data']['promo_code_amount']); // 优惠码
}
... ...