WAP——jit拆单,yoho币,订单详情优化
Showing
18 changed files
with
466 additions
and
65 deletions
@@ -75,10 +75,30 @@ class OrderData | @@ -75,10 +75,30 @@ class OrderData | ||
75 | * @param string $sessionKey 用户会话 | 75 | * @param string $sessionKey 用户会话 |
76 | * @return array | 76 | * @return array |
77 | */ | 77 | */ |
78 | +// public static function viewOrderData($orderCode, $uid, $sessionKey) | ||
79 | +// { | ||
80 | +// $param = Yohobuy::param(); | ||
81 | +// $param['method'] = 'app.SpaceOrders.info'; | ||
82 | +// $param['order_code'] = $orderCode; | ||
83 | +// $param['uid'] = $uid; | ||
84 | +// $param['session_key'] = $sessionKey; | ||
85 | +// $param['client_secret'] = Sign::getSign($param); | ||
86 | +// | ||
87 | +// return Yohobuy::get(Yohobuy::API_URL, $param); | ||
88 | +// } | ||
89 | + | ||
90 | + /** | ||
91 | + * 查看订单详情(new) | ||
92 | + * | ||
93 | + * @param string $orderCode 订单号 | ||
94 | + * @param int $uid 用户ID | ||
95 | + * @param string $sessionKey 用户会话 | ||
96 | + * @return array | ||
97 | + */ | ||
78 | public static function viewOrderData($orderCode, $uid, $sessionKey) | 98 | public static function viewOrderData($orderCode, $uid, $sessionKey) |
79 | { | 99 | { |
80 | $param = Yohobuy::param(); | 100 | $param = Yohobuy::param(); |
81 | - $param['method'] = 'app.SpaceOrders.info'; | 101 | + $param['method'] = 'app.SpaceOrders.detail'; |
82 | $param['order_code'] = $orderCode; | 102 | $param['order_code'] = $orderCode; |
83 | $param['uid'] = $uid; | 103 | $param['uid'] = $uid; |
84 | $param['session_key'] = $sessionKey; | 104 | $param['session_key'] = $sessionKey; |
static/js/cart/jit-detail.js
0 → 100644
1 | +/** | ||
2 | + * jit拆单配送信息页面 | ||
3 | + * @author: zhaobiao<bill.zhao@yoho.cn> | ||
4 | + * @date: 2016/04/26 | ||
5 | + */ | ||
6 | + | ||
7 | +var Swiper = require('yoho.iswiper'), | ||
8 | + $ = require('jquery'); | ||
9 | + | ||
10 | +var height = $(window).height() - $('#yoho-header').height(); | ||
11 | + | ||
12 | +// 为了展示页面背景色,需要把页面根据窗口大小撑开 | ||
13 | +$('.jit-detail-page').css('height', height); | ||
14 | + | ||
15 | +$('.jit-detail-page>div').show(); | ||
16 | + | ||
17 | +// 内容展示之后,再根据document高度,调整一次容器高度 | ||
18 | +height = $(document).height() - $('#yoho-header').height(); | ||
19 | +$('.jit-detail-page').css('height', height); | ||
20 | + | ||
21 | +(function() { | ||
22 | + return new Swiper('.swiper-container', { | ||
23 | + slidesPerView: 'auto', | ||
24 | + grabCursor: true, | ||
25 | + slideElement: 'a', | ||
26 | + lazyLoading: true, | ||
27 | + watchSlidesVisibility: true | ||
28 | + }); | ||
29 | +})(); | ||
30 | + |
@@ -10,7 +10,8 @@ var $ = require('jquery'), | @@ -10,7 +10,8 @@ var $ = require('jquery'), | ||
10 | 10 | ||
11 | var goodsSwiper, | 11 | var goodsSwiper, |
12 | $discountFolder = $('.goodsDiscount .discount-folder'), | 12 | $discountFolder = $('.goodsDiscount .discount-folder'), |
13 | - $discountArrow = $('.goodsDiscount .first-item span'); | 13 | + $downArea = $('.goodsDiscount .pull-down'); |
14 | +$upArea = $('.goodsDiscount .pull-up'); | ||
14 | 15 | ||
15 | var goodsDiscountEl = document.getElementById('goodsDiscount'), | 16 | var goodsDiscountEl = document.getElementById('goodsDiscount'), |
16 | goodsDiscountHammer = goodsDiscountEl && new Hammer(goodsDiscountEl), | 17 | goodsDiscountHammer = goodsDiscountEl && new Hammer(goodsDiscountEl), |
@@ -62,7 +63,7 @@ goodsSwiper = new Swiper('.banner-swiper', { | @@ -62,7 +63,7 @@ goodsSwiper = new Swiper('.banner-swiper', { | ||
62 | //初始化goods-discount | 63 | //初始化goods-discount |
63 | if (0 === $discountFolder.children().length) { | 64 | if (0 === $discountFolder.children().length) { |
64 | $discountFolder.css('display', 'none'); | 65 | $discountFolder.css('display', 'none'); |
65 | - $discountArrow.html(''); | 66 | + $downArea.hide(); |
66 | } | 67 | } |
67 | 68 | ||
68 | //goods-discount下拉按钮点击事件 | 69 | //goods-discount下拉按钮点击事件 |
@@ -70,12 +71,14 @@ if (goodsDiscountHammer && $discountFolder.children().length > 0) { | @@ -70,12 +71,14 @@ if (goodsDiscountHammer && $discountFolder.children().length > 0) { | ||
70 | goodsDiscountHammer.on('tap', function(e) { | 71 | goodsDiscountHammer.on('tap', function(e) { |
71 | if ($discountFolder.is(':hidden')) { | 72 | if ($discountFolder.is(':hidden')) { |
72 | $discountFirstItem.removeClass('short-text'); | 73 | $discountFirstItem.removeClass('short-text'); |
73 | - $discountArrow.removeClass('icon-down').addClass('icon-up').html(''); | 74 | + $downArea.hide(); |
74 | $discountFolder.slideDown(); | 75 | $discountFolder.slideDown(); |
76 | + $upArea.show(); | ||
75 | } else { | 77 | } else { |
76 | $discountFirstItem.addClass('short-text'); | 78 | $discountFirstItem.addClass('short-text'); |
77 | - $discountArrow.removeClass('icon-up').addClass('icon-down').html(''); | 79 | + $upArea.hide(); |
78 | $discountFolder.slideUp(); | 80 | $discountFolder.slideUp(); |
81 | + $downArea.show(); | ||
79 | } | 82 | } |
80 | }); | 83 | }); |
81 | } | 84 | } |
@@ -4,6 +4,7 @@ | @@ -4,6 +4,7 @@ | ||
4 | @import "order-ensure"; | 4 | @import "order-ensure"; |
5 | @import "select-coupon"; | 5 | @import "select-coupon"; |
6 | @import "select-address"; | 6 | @import "select-address"; |
7 | +@import "jit-detail"; | ||
7 | 8 | ||
8 | 9 | ||
9 | .icon-checkbox:before { content: "\e61c"; } | 10 | .icon-checkbox:before { content: "\e61c"; } |
@@ -462,6 +462,34 @@ | @@ -462,6 +462,34 @@ | ||
462 | height: auto; | 462 | height: auto; |
463 | resize: none; | 463 | resize: none; |
464 | } | 464 | } |
465 | + | ||
466 | + &.mt0 { | ||
467 | + margin-top: 0; | ||
468 | + } | ||
469 | + | ||
470 | + &.more-jit { | ||
471 | + padding-top: 0; | ||
472 | + padding-bottom: 0; | ||
473 | + margin-bottom: 0; | ||
474 | + border-bottom: none; | ||
475 | + } | ||
476 | + | ||
477 | + | ||
478 | + .more-jit { | ||
479 | + height: 88px; | ||
480 | + line-height: 88px; | ||
481 | + position: relative; | ||
482 | + | ||
483 | + span { | ||
484 | + font-size: 34px; | ||
485 | + color: #444; | ||
486 | + } | ||
487 | + | ||
488 | + .iconfont { | ||
489 | + position: absolute; | ||
490 | + right: 0; | ||
491 | + } | ||
492 | + } | ||
465 | } | 493 | } |
466 | 494 | ||
467 | #invoice { | 495 | #invoice { |
@@ -13,6 +13,35 @@ | @@ -13,6 +13,35 @@ | ||
13 | font-size: 40px; | 13 | font-size: 40px; |
14 | margin-top: -30px; | 14 | margin-top: -30px; |
15 | } | 15 | } |
16 | + | ||
17 | + &.more-jit { | ||
18 | + background: #fff; | ||
19 | + padding: 30px 20px; | ||
20 | + border-bottom: 1px solid #e0e0e0; | ||
21 | + padding-top: 0; | ||
22 | + padding-bottom: 0; | ||
23 | + margin-bottom: 0; | ||
24 | + } | ||
25 | + | ||
26 | + | ||
27 | + .more-jit { | ||
28 | + height: 88px; | ||
29 | + line-height: 88px; | ||
30 | + position: relative; | ||
31 | + | ||
32 | + span { | ||
33 | + font-size: 34px; | ||
34 | + color: #444; | ||
35 | + } | ||
36 | + | ||
37 | + .iconfont { | ||
38 | + position: absolute; | ||
39 | + right: 0; | ||
40 | + left: auto; | ||
41 | + top: auto; | ||
42 | + margin: 0; | ||
43 | + } | ||
44 | + } | ||
16 | } | 45 | } |
17 | 46 | ||
18 | .sub { | 47 | .sub { |
@@ -102,7 +131,21 @@ | @@ -102,7 +131,21 @@ | ||
102 | } | 131 | } |
103 | } | 132 | } |
104 | } | 133 | } |
105 | - | 134 | + .dollar{ |
135 | + background: #ffffff; | ||
136 | + padding: 0.5rem 0.75rem; | ||
137 | + height:1.5rem; | ||
138 | + line-height:1.5rem; | ||
139 | + .bg-dollar{ | ||
140 | + display: inline-block; | ||
141 | + width: 0.6rem; | ||
142 | + height: 0.6rem; | ||
143 | + background: url('../img/me/yoho-coin/dollar.png?1452827495') center center; | ||
144 | + background-size: 100% 100%; | ||
145 | + vertical-align: middle; | ||
146 | + } | ||
147 | + | ||
148 | + } | ||
106 | .opt { | 149 | .opt { |
107 | text-align: right; | 150 | text-align: right; |
108 | border-top: 1px solid #e0e0e0; | 151 | border-top: 1px solid #e0e0e0; |
@@ -373,26 +373,46 @@ $basicBtnC:#eb0313; | @@ -373,26 +373,46 @@ $basicBtnC:#eb0313; | ||
373 | border-bottom: 1px solid $borderC; | 373 | border-bottom: 1px solid $borderC; |
374 | h1 { | 374 | h1 { |
375 | position: relative; | 375 | position: relative; |
376 | - padding: 30px 60px 30px 28px; | 376 | + padding: 30px 60px 30px 75px; |
377 | line-height: 36px; | 377 | line-height: 36px; |
378 | } | 378 | } |
379 | 379 | ||
380 | + .act-logo { | ||
381 | + display:inline-block; | ||
382 | + position: absolute; | ||
383 | + left:28px; | ||
384 | + background: rgb(235,3,19); | ||
385 | + color:#fff; | ||
386 | + font-size:22px; | ||
387 | + padding:1px; | ||
388 | + height:28px; | ||
389 | + } | ||
390 | + | ||
391 | + .pull-area{ | ||
392 | + position: relative; | ||
393 | + height: 30px; | ||
394 | + .pull-icon{ | ||
395 | + position: absolute; | ||
396 | + top: 0; | ||
397 | + left: 50%; | ||
398 | + top:-10px; | ||
399 | + margin-left: -18px; | ||
400 | + width: 35px; | ||
401 | + font-size: 30px; | ||
402 | + color: #e0e0e0; | ||
403 | + } | ||
404 | + } | ||
405 | + | ||
406 | + .pull-up { | ||
407 | + display: none; | ||
408 | + } | ||
409 | + | ||
380 | .short-text { | 410 | .short-text { |
381 | white-space: nowrap; | 411 | white-space: nowrap; |
382 | overflow: hidden; | 412 | overflow: hidden; |
383 | text-overflow: ellipsis; | 413 | text-overflow: ellipsis; |
384 | } | 414 | } |
385 | 415 | ||
386 | - .iconfont { | ||
387 | - position: absolute; | ||
388 | - top: 30px; | ||
389 | - right: 36px; | ||
390 | - width: 35px; | ||
391 | - font-size: 45px; | ||
392 | - float: right; | ||
393 | - color: #e0e0e0; | ||
394 | - /*padding-left:50px;*/ | ||
395 | - } | ||
396 | .discount-folder { | 416 | .discount-folder { |
397 | .folder-item { | 417 | .folder-item { |
398 | border-top: 1px solid $borderC; | 418 | border-top: 1px solid $borderC; |
1 | +{{> layout/header}} | ||
2 | +<div class="jit-detail-page yoho-page"> | ||
3 | + {{#each packages}} | ||
4 | + <div class="top"> | ||
5 | + <span class="package-type">包裹{{packageType}}:</span> | ||
6 | + <span class="package-title">{{dispatchType}}</span> | ||
7 | + </div> | ||
8 | + <div class="middle"> | ||
9 | + <div class="swiper-container"> | ||
10 | + <div class="swiper-wrapper swiper-wrapper-jit"> | ||
11 | + {{#each goods}} | ||
12 | + <a class="swiper-slide" href="javascript:void(0);"> | ||
13 | + <img class="swiper-lazy img-box" data-src="{{thumb}}"> | ||
14 | + <div class="swiper-lazy-preloader"></div> | ||
15 | + {{#if isGift}} | ||
16 | + <span class="tag gift">赠品</span> | ||
17 | + {{/if}} | ||
18 | + | ||
19 | + {{#if isAdd}} | ||
20 | + <span class="tag add">加价购</span> | ||
21 | + {{/if}} | ||
22 | + </a> | ||
23 | + {{/each}} | ||
24 | + </div> | ||
25 | + </div> | ||
26 | + </div> | ||
27 | + <div class="bottom"> | ||
28 | + <span>运费: </span> | ||
29 | + <span>¥{{expressCost}} </span> | ||
30 | + <span>(已优惠¥{{discount}})</span> | ||
31 | + </div> | ||
32 | + {{/each}} | ||
33 | +</div> | ||
34 | +{{> layout/footer}} |
@@ -75,7 +75,12 @@ | @@ -75,7 +75,12 @@ | ||
75 | </ul> | 75 | </ul> |
76 | </div> | 76 | </div> |
77 | </section> | 77 | </section> |
78 | - <section class="block" style="margin-bottom: 0;"> | 78 | + |
79 | + | ||
80 | + {{#if isJit}} | ||
81 | + {{> me/order/jit-more}} | ||
82 | + {{/if}} | ||
83 | + <section class="block mt0" style="margin-bottom: 0;"> | ||
79 | {{#each goods}} | 84 | {{#each goods}} |
80 | {{> me/order/good}} | 85 | {{> me/order/good}} |
81 | {{/each}} | 86 | {{/each}} |
@@ -22,8 +22,8 @@ | @@ -22,8 +22,8 @@ | ||
22 | <span class="iconfont"></span> | 22 | <span class="iconfont"></span> |
23 | 23 | ||
24 | <p class="beside-icon sub-content"> | 24 | <p class="beside-icon sub-content"> |
25 | - <span class="sub-title">{{orderStatus}}</span> | ||
26 | - <span>订单编号:{{orderNum}}</span> | 25 | + <span class="sub-title">订单编号:{{orderNum}}</span> |
26 | + <span >{{orderStatus}}</span> | ||
27 | <span>下单时间:{{orderTime}}</span> | 27 | <span>下单时间:{{orderTime}}</span> |
28 | </p> | 28 | </p> |
29 | </div> | 29 | </div> |
@@ -42,50 +42,32 @@ | @@ -42,50 +42,32 @@ | ||
42 | </section> | 42 | </section> |
43 | 43 | ||
44 | <section class="goods block"> | 44 | <section class="goods block"> |
45 | + {{#if isJit}} | ||
46 | + {{> me/order/jit-more}} | ||
47 | + {{/if}} | ||
45 | {{# goods}} | 48 | {{# goods}} |
46 | {{> me/order/good}} | 49 | {{> me/order/good}} |
47 | {{/ goods}} | 50 | {{/ goods}} |
48 | </section> | 51 | </section> |
49 | 52 | ||
50 | <ul class="cost block"> | 53 | <ul class="cost block"> |
51 | - <li> | ||
52 | - 商品总金额 | ||
53 | - <span>{{sumPrice}}</span> | 54 | + {{#each orderBalance}} |
55 | + <li> {{promotion}}: | ||
56 | + <span>{{account}}</span> | ||
54 | </li> | 57 | </li> |
55 | - {{#if salePrice}} | ||
56 | - <li> | ||
57 | - 活动金额 | ||
58 | - <span>{{salePrice}}</span> | ||
59 | - </li> | ||
60 | - {{/if}} | ||
61 | - <li> | ||
62 | - 运费 | ||
63 | - <span>{{freight}}</span> | ||
64 | - </li> | ||
65 | - {{#if promo_code_amount}} | ||
66 | - <li> | ||
67 | - 优惠码 | ||
68 | - <span>{{promo_code_amount}}</span> | ||
69 | - </li> | ||
70 | - {{/if}} | ||
71 | - {{#if coupon}} | ||
72 | - <li> | ||
73 | - 优惠券 | ||
74 | - <span>{{coupon}}</span> | ||
75 | - </li> | ||
76 | - {{/if}} | ||
77 | - {{#if yohoCoin}} | ||
78 | - <li> | ||
79 | - YOHO币 | ||
80 | - <span>{{yohoCoin}}</span> | ||
81 | - </li> | ||
82 | - {{/if}} | 58 | + {{/each}} |
83 | <li> | 59 | <li> |
84 | 实付金额 | 60 | 实付金额 |
85 | <span>{{price}}</span> | 61 | <span>{{price}}</span> |
86 | </li> | 62 | </li> |
87 | </ul> | 63 | </ul> |
88 | - | 64 | + {{#if yohoCoin}} |
65 | + <p class="dollar"> | ||
66 | + <span class="bg-dollar"></span> | ||
67 | + 共返YOHO币: | ||
68 | + <span>{{yohoCoin}}</span>个 | ||
69 | + </p> | ||
70 | + {{/if}} | ||
89 | <div class="opt block"> | 71 | <div class="opt block"> |
90 | {{#unless unreceived}} | 72 | {{#unless unreceived}} |
91 | {{#unless unpaid}} | 73 | {{#unless unpaid}} |
@@ -77,12 +77,19 @@ | @@ -77,12 +77,19 @@ | ||
77 | </ul> | 77 | </ul> |
78 | {{/vipLevel}} | 78 | {{/vipLevel}} |
79 | 79 | ||
80 | + {{# commodityReturn}} | ||
81 | + <div class="goodsDiscount"> | ||
82 | + <h1 class="tap-hightlight"><span class="act-logo">返</span> {{commodityReturn}}</h1> | ||
83 | + </div> | ||
84 | + {{/commodityReturn}} | ||
85 | + | ||
80 | {{# goodsDiscount}} | 86 | {{# goodsDiscount}} |
81 | <div class="goodsDiscount" id="goodsDiscount"> | 87 | <div class="goodsDiscount" id="goodsDiscount"> |
82 | {{# list}} | 88 | {{# list}} |
83 | {{#if @first}} | 89 | {{#if @first}} |
84 | {{#if text}} | 90 | {{#if text}} |
85 | - <h1 class="first-item short-text tap-hightlight">{{text}}<span class="icon-down iconfont dropdown"></span></h1> | 91 | + <h1 class="first-item short-text tap-hightlight"><span class="act-logo">促</span>{{text}}</h1> |
92 | + <div class="pull-area pull-down"><span class="icon-down iconfont pull-icon dropdown"></span></div> | ||
86 | {{/if}} | 93 | {{/if}} |
87 | {{/if}} | 94 | {{/if}} |
88 | {{/ list}} | 95 | {{/ list}} |
@@ -96,6 +103,7 @@ | @@ -96,6 +103,7 @@ | ||
96 | {{/if}} | 103 | {{/if}} |
97 | {{/list}} | 104 | {{/list}} |
98 | </div> | 105 | </div> |
106 | + <div class="pull-area pull-up"><span class="icon-up iconfont pull-icon dropdown"></span></div> | ||
99 | </div> | 107 | </div> |
100 | {{/ goodsDiscount}} | 108 | {{/ goodsDiscount}} |
101 | 109 |
@@ -133,8 +133,8 @@ class OrderModel | @@ -133,8 +133,8 @@ class OrderModel | ||
133 | $build['date'] = $value['acceptTime']; | 133 | $build['date'] = $value['acceptTime']; |
134 | $result['logisticDetail'][] = $build; | 134 | $result['logisticDetail'][] = $build; |
135 | } | 135 | } |
136 | - | ||
137 | - } while (false); | 136 | + } |
137 | + while (false); | ||
138 | 138 | ||
139 | return $result; | 139 | return $result; |
140 | } | 140 | } |
@@ -197,6 +197,7 @@ class OrderModel | @@ -197,6 +197,7 @@ class OrderModel | ||
197 | 197 | ||
198 | if (is_numeric($orderCode) && is_numeric($uid) && is_string($sessionKey)) { | 198 | if (is_numeric($orderCode) && is_numeric($uid) && is_string($sessionKey)) { |
199 | $orderDetail = OrderData::viewOrderData($orderCode, $uid, $sessionKey); | 199 | $orderDetail = OrderData::viewOrderData($orderCode, $uid, $sessionKey); |
200 | + print_r($orderDetail); | ||
200 | if (isset($orderDetail['data']['order_code'])) { | 201 | if (isset($orderDetail['data']['order_code'])) { |
201 | $count = 0; | 202 | $count = 0; |
202 | 203 | ||
@@ -208,20 +209,36 @@ class OrderModel | @@ -208,20 +209,36 @@ class OrderModel | ||
208 | $result['orderNum'] = $orderDetail['data']['order_code']; | 209 | $result['orderNum'] = $orderDetail['data']['order_code']; |
209 | $result['orderTime'] = date('Y-m-d H:i:s', $orderDetail['data']['create_time']); | 210 | $result['orderTime'] = date('Y-m-d H:i:s', $orderDetail['data']['create_time']); |
210 | $result['goods'] = Helpers::formatOrderGoods($orderDetail['data']['order_goods'], $count, true); | 211 | $result['goods'] = Helpers::formatOrderGoods($orderDetail['data']['order_goods'], $count, true); |
211 | - $result['sumPrice'] = $orderDetail['data']['goods_total_amount']; // 商品总金额 | ||
212 | - $result['salePrice'] = self::filterOrderPrice($orderDetail['data']['promotion_amount']); // 活动金额 | ||
213 | - $result['freight'] = $orderDetail['data']['shipping_cost']; // 运费 | ||
214 | - $result['coupon'] = self::filterOrderPrice($orderDetail['data']['coupons_amount']); // 优惠券 | 212 | +// $result['sumPrice'] = $orderDetail['data']['goods_total_amount']; // 商品总金额 |
213 | +// $result['salePrice'] = self::filterOrderPrice($orderDetail['data']['promotion_amount']); // 活动金额 | ||
214 | +// $result['freight'] = $orderDetail['data']['shipping_cost']; // 运费 | ||
215 | +// $result['coupon'] = self::filterOrderPrice($orderDetail['data']['coupons_amount']); // 优惠券 | ||
215 | if (isset($orderDetail['data']['promo_code_amount'])) { | 216 | if (isset($orderDetail['data']['promo_code_amount'])) { |
216 | $result['promo_code_amount'] = self::filterOrderPrice($orderDetail['data']['promo_code_amount']); // 优惠码 | 217 | $result['promo_code_amount'] = self::filterOrderPrice($orderDetail['data']['promo_code_amount']); // 优惠码 |
217 | } | 218 | } |
218 | 219 | ||
219 | - $result['yohoCoin'] = self::filterOrderPrice($orderDetail['data']['yoho_coin_num']); // YOHO币 | 220 | +// $result['yohoCoin'] = $orderDetail['data']['yoho_give_coin']; // YOHO币 |
221 | + $result['yohoCoin'] = 100; | ||
222 | + | ||
220 | $result['price'] = $orderDetail['data']['amount']; // 实付金额 | 223 | $result['price'] = $orderDetail['data']['amount']; // 实付金额 |
221 | $result['goodsAmount'] = $orderDetail['data']['payment_amount']; // 商品总金额没有人民币符号 | 224 | $result['goodsAmount'] = $orderDetail['data']['payment_amount']; // 商品总金额没有人民币符号 |
222 | $result['orderCount'] = $count; // 订单总件数 | 225 | $result['orderCount'] = $count; // 订单总件数 |
223 | $result['isPay'] = $orderDetail['data']['payment_status'] === 'Y'; | 226 | $result['isPay'] = $orderDetail['data']['payment_status'] === 'Y'; |
224 | } | 227 | } |
228 | + //相关金额(商品总金额,活动金额,运费,优惠券,YOHO币) | ||
229 | + if (isset($orderDetail['data']['promotion_formulas']) && $orderDetail['data']['promotion_formulas']) { | ||
230 | + foreach ($orderDetail['data']['promotion_formulas'] as $pricek => $pricev) { | ||
231 | + $result['orderBalance'][$pricek] = array('promotion' => $pricev['promotion'], 'account' => $pricev['promotion_amount']); | ||
232 | + } | ||
233 | + } | ||
234 | + //为支付的拆单配送信息 | ||
235 | + if (isset($orderDetail['data']['is_multi_package']) && $orderDetail['data']['is_multi_package'] == 'Y') { | ||
236 | + $result['isJit'] = true; | ||
237 | + $result['jitDetailUrl'] = Helpers::url('/cart/index/jitDetail', array('orderCode' => $orderCode, 'sessionKey' => $sessionKey)); | ||
238 | + } | ||
239 | + //测试 | ||
240 | +// $result['isJit'] = true; | ||
241 | +// $result['jitDetailUrl'] = Helpers::url('/cart/index/jitDetail', array('orderCode' => $orderCode, 'sessionKey' => $sessionKey)); | ||
225 | } | 242 | } |
226 | 243 | ||
227 | return $result; | 244 | return $result; |
@@ -316,7 +333,7 @@ class OrderModel | @@ -316,7 +333,7 @@ class OrderModel | ||
316 | case 5: | 333 | case 5: |
317 | //待收货状态,给查看物流url | 334 | //待收货状态,给查看物流url |
318 | $result['unreceived'] = true; | 335 | $result['unreceived'] = true; |
319 | - self::assignExpressInfo($showLogistics, $order, $result); | 336 | + self::assignExpressInfo($showLogistics, $order, $result); |
320 | break; | 337 | break; |
321 | case 6: | 338 | case 6: |
322 | $result['completed'] = true; | 339 | $result['completed'] = true; |
@@ -325,7 +342,8 @@ class OrderModel | @@ -325,7 +342,8 @@ class OrderModel | ||
325 | default: | 342 | default: |
326 | break; | 343 | break; |
327 | } | 344 | } |
328 | - } while (false); | 345 | + } |
346 | + while (false); | ||
329 | 347 | ||
330 | return $result; | 348 | return $result; |
331 | } | 349 | } |
@@ -342,7 +360,7 @@ class OrderModel | @@ -342,7 +360,7 @@ class OrderModel | ||
342 | 360 | ||
343 | if ($showLogistics && isset($order['express_company']['caption'])) { | 361 | if ($showLogistics && isset($order['express_company']['caption'])) { |
344 | $result['logisticsCompany'] = $order['express_company']['caption']; | 362 | $result['logisticsCompany'] = $order['express_company']['caption']; |
345 | - $result['logisticsNum'] = isset($order['express_number']) ? $order['express_number'] : ''; | 363 | + $result['logisticsNum'] = isset($order['express_number']) ? $order['express_number'] : ''; |
346 | } | 364 | } |
347 | } | 365 | } |
348 | 366 | ||
@@ -354,11 +372,62 @@ class OrderModel | @@ -354,11 +372,62 @@ class OrderModel | ||
354 | */ | 372 | */ |
355 | private static function filterOrderPrice($price) | 373 | private static function filterOrderPrice($price) |
356 | { | 374 | { |
357 | - if (is_string($price) && strstr($price,'¥0.00') !== false) { | 375 | + if (is_string($price) && strstr($price, '¥0.00') !== false) { |
358 | return ''; | 376 | return ''; |
359 | - } else { | 377 | + } |
378 | + else { | ||
360 | return $price; | 379 | return $price; |
361 | } | 380 | } |
362 | } | 381 | } |
363 | 382 | ||
383 | + /** | ||
384 | + * 获取拆单信息数据 | ||
385 | + * @param type $uid 用户id | ||
386 | + * @param type $cartType 购物车类型 | ||
387 | + * @param type $skuList 商品信息 | ||
388 | + * @return boolean | ||
389 | + */ | ||
390 | + public static function getPackageInfo($orderCode, $uid, $sessionKey) | ||
391 | + { | ||
392 | + $result = array(); | ||
393 | + $carpay = OrderData::viewOrderData($orderCode, $uid, $sessionKey); | ||
394 | + do { | ||
395 | + if (!$carpay || $carpay['code'] != 200 || empty($carpay['data']['package_list'])) { | ||
396 | + break; | ||
397 | + } | ||
398 | + $package = $carpay['data']; | ||
399 | + // 拆单数据 | ||
400 | + if (isset($package['package_list']) && !empty($package['package_list'])) { | ||
401 | + $result['jitDetailPage'] = true; | ||
402 | + $packageList = $package['data']['package_list']; | ||
403 | + foreach ($packageList as $pk => $pv) { | ||
404 | + $result[$pk]['packageType'] = 1; | ||
405 | + $result[$pk]['dispatchType'] = ($pv['supplier_id'] == 0) ? '包裹1:总仓库' : '包裹2:异地调拨'; //仓库 | ||
406 | + $goodList = $pv['goods_list']; | ||
407 | + foreach ($goodList as $glk => $glv) { | ||
408 | + $result[$pk]['goods'][$glk]['thumb'] = Images::getImageUrl($glv['goods_images'], 90, 90); | ||
409 | + $tag = isset($glv['goods_type']) ? $glv['goods_type'] : ''; | ||
410 | + switch ($tag) { | ||
411 | + case 'price_gift' : | ||
412 | + //加价购 | ||
413 | + $result[$pk]['goods'][$glk]['isAdd'] = true; | ||
414 | + break; | ||
415 | + case 'gift' : | ||
416 | + //赠品 | ||
417 | + $result[$pk]['goods'][$glk]['isGift'] = true; | ||
418 | + break; | ||
419 | + default: | ||
420 | + break; | ||
421 | + } | ||
422 | + } | ||
423 | + $result[$pk]['expressCost'] = $pv['shopping_cost']; | ||
424 | +// $packages[$pk]['orign'] = $pv['shopping_orig_cost']; | ||
425 | + $result[$pk]['discount'] = intval($pv['shopping_orig_cost']) - intval($pv['shopping_cost']); | ||
426 | + } | ||
427 | + } | ||
428 | + } | ||
429 | + while (false); | ||
430 | + return $result; | ||
431 | + } | ||
432 | + | ||
364 | } | 433 | } |
@@ -345,6 +345,7 @@ class CartModel | @@ -345,6 +345,7 @@ class CartModel | ||
345 | } | 345 | } |
346 | 346 | ||
347 | $pay = CartData::cartPay($uid, $cartType, 0, $skuList); | 347 | $pay = CartData::cartPay($uid, $cartType, 0, $skuList); |
348 | +// print_r($pay); | ||
348 | 349 | ||
349 | do { | 350 | do { |
350 | if (!$pay || $pay['code'] != 200 || empty($pay['data']['goods_list'])) { | 351 | if (!$pay || $pay['code'] != 200 || empty($pay['data']['goods_list'])) { |
@@ -521,6 +522,14 @@ class CartModel | @@ -521,6 +522,14 @@ class CartModel | ||
521 | 522 | ||
522 | // 订单数据 | 523 | // 订单数据 |
523 | if (isset($payReturn['shopping_cart_data']) && !empty($payReturn['shopping_cart_data'])) { | 524 | if (isset($payReturn['shopping_cart_data']) && !empty($payReturn['shopping_cart_data'])) { |
525 | + //判断是否为JIT商品 | ||
526 | + if ($payReturn['shopping_cart_data']['is_multi_package'] == 'Y') { | ||
527 | + $result['isJit'] = true; | ||
528 | + $result['jitDetailUrl'] = Helpers::url('/cart/index/jitDetail', array('cartType' => $cartType, 'skuList' => $skuList)); | ||
529 | + } | ||
530 | + //测试 | ||
531 | +// $result['isJit'] = true; | ||
532 | +// $result['jitDetailUrl'] = Helpers::url('/cart/index/jitDetail', array('cartType' => $cartType, 'skuList' => $skuList)); | ||
524 | $result['cartPayData'] = isset($orderCompute['promotion_formula_list']) ? $orderCompute['promotion_formula_list'] : $payReturn['shopping_cart_data']['promotion_formula_list']; | 533 | $result['cartPayData'] = isset($orderCompute['promotion_formula_list']) ? $orderCompute['promotion_formula_list'] : $payReturn['shopping_cart_data']['promotion_formula_list']; |
525 | $price = isset($orderCompute['last_order_amount']) ? $orderCompute['last_order_amount'] : $payReturn['shopping_cart_data']['last_order_amount']; | 534 | $price = isset($orderCompute['last_order_amount']) ? $orderCompute['last_order_amount'] : $payReturn['shopping_cart_data']['last_order_amount']; |
526 | $result['price'] = Helpers::transPrice($price, true); | 535 | $result['price'] = Helpers::transPrice($price, true); |
@@ -975,4 +984,56 @@ class CartModel | @@ -975,4 +984,56 @@ class CartModel | ||
975 | return $result; | 984 | return $result; |
976 | } | 985 | } |
977 | 986 | ||
987 | + | ||
988 | + /** | ||
989 | + * 获取拆单信息数据 | ||
990 | + * @param type $uid 用户id | ||
991 | + * @param type $cartType 购物车类型 | ||
992 | + * @param type $skuList 商品信息 | ||
993 | + * @return boolean | ||
994 | + */ | ||
995 | + public static function getPackageInfo($uid, $cartType, $skuList) | ||
996 | + { | ||
997 | + $result = array(); | ||
998 | + $carpay = CartData::cartPay($uid, $cartType, 0, $skuList); | ||
999 | + do { | ||
1000 | + if (!$carpay || $carpay['code'] != 200 || empty($carpay['data']['shopping_cart_data'])) { | ||
1001 | + break; | ||
1002 | + } | ||
1003 | + $package = $carpay['data']; | ||
1004 | + // 拆单数据 | ||
1005 | + if (isset($package['shopping_cart_data']) && !empty($package['shopping_cart_data'])) { | ||
1006 | + $result['jitDetailPage'] = true; | ||
1007 | + $packageList = $package['data']['shopping_cart_data']['package_list']; | ||
1008 | + foreach ($packageList as $pk => $pv) { | ||
1009 | + $result[$pk]['packageType'] = 1; | ||
1010 | + $result[$pk]['dispatchType'] = ($pv['supplier_id'] == 0) ? '包裹1:总仓库' : '包裹2:异地调拨'; //仓库 | ||
1011 | + $goodList = $pv['goods_list']; | ||
1012 | + foreach ($goodList as $glk => $glv) { | ||
1013 | + $result[$pk]['goods'][$glk]['thumb'] = Images::getImageUrl($glv['goods_images'], 90, 90); | ||
1014 | + $tag = isset($glv['goods_type']) ? $glv['goods_type'] : ''; | ||
1015 | + switch($tag){ | ||
1016 | + case 'price_gift' : | ||
1017 | + //加价购 | ||
1018 | + $result[$pk]['goods'][$glk]['isAdd'] = true; | ||
1019 | + break; | ||
1020 | + case 'gift' : | ||
1021 | + //赠品 | ||
1022 | + $result[$pk]['goods'][$glk]['isGift'] = true; | ||
1023 | + break; | ||
1024 | + default: | ||
1025 | + break; | ||
1026 | + | ||
1027 | + } | ||
1028 | + } | ||
1029 | + $result[$pk]['expressCost'] = $pv['shopping_cost']; | ||
1030 | +// $packages[$pk]['orign'] = $pv['shopping_orig_cost']; | ||
1031 | + $result[$pk]['discount'] = intval($pv['shopping_orig_cost']) - intval($pv['shopping_cost']); | ||
1032 | + } | ||
1033 | + } | ||
1034 | + } | ||
1035 | + while (false); | ||
1036 | + return $result; | ||
1037 | + } | ||
1038 | + | ||
978 | } | 1039 | } |
@@ -41,6 +41,7 @@ class DetailModel | @@ -41,6 +41,7 @@ class DetailModel | ||
41 | elseif (is_numeric($productSkn)) { | 41 | elseif (is_numeric($productSkn)) { |
42 | $baseInfo = DetailData::baseInfo(null, $uid, $productSkn); | 42 | $baseInfo = DetailData::baseInfo(null, $uid, $productSkn); |
43 | } | 43 | } |
44 | +// print_r($baseInfo); | ||
44 | // 商品名称 | 45 | // 商品名称 |
45 | if (empty($baseInfo['productName'])) { | 46 | if (empty($baseInfo['productName'])) { |
46 | return $result; | 47 | return $result; |
@@ -91,6 +92,8 @@ class DetailModel | @@ -91,6 +92,8 @@ class DetailModel | ||
91 | if ($baseInfo['productPriceBo']['formatMarketPrice'] !== $baseInfo['productPriceBo']['formatSalesPrice']) { | 92 | if ($baseInfo['productPriceBo']['formatMarketPrice'] !== $baseInfo['productPriceBo']['formatSalesPrice']) { |
92 | $result['goodsPrice']['previousPrice'] = $baseInfo['productPriceBo']['formatMarketPrice']; | 93 | $result['goodsPrice']['previousPrice'] = $baseInfo['productPriceBo']['formatMarketPrice']; |
93 | } | 94 | } |
95 | + //商品返回Yoho币 | ||
96 | + $result['goodsPrice']['yohoCoinNum'] = $baseInfo['productPriceBo']['yohoCoinNum']; | ||
94 | } | 97 | } |
95 | // VIP商品价格 | 98 | // VIP商品价格 |
96 | if (isset($baseInfo['productPriceBo']['vipPrices'])) { | 99 | if (isset($baseInfo['productPriceBo']['vipPrices'])) { |
@@ -6,6 +6,7 @@ use Index\CartModel; | @@ -6,6 +6,7 @@ use Index\CartModel; | ||
6 | use Index\UserModel; | 6 | use Index\UserModel; |
7 | use Plugin\Helpers; | 7 | use Plugin\Helpers; |
8 | use Plugin\UnionTrans; | 8 | use Plugin\UnionTrans; |
9 | +use Home\OrderModel; | ||
9 | 10 | ||
10 | /** | 11 | /** |
11 | * 购物车相关的控制器 | 12 | * 购物车相关的控制器 |
@@ -308,6 +309,7 @@ class IndexController extends AbstractAction | @@ -308,6 +309,7 @@ class IndexController extends AbstractAction | ||
308 | $uid = $this->getUid(true); | 309 | $uid = $this->getUid(true); |
309 | $isAjax = $this->isAjax(); | 310 | $isAjax = $this->isAjax(); |
310 | $order = CartModel::cartPay($uid, $cartType, $orderInfo, $limitProductCode, $sku, $skn, $buyNumber, $isAjax); | 311 | $order = CartModel::cartPay($uid, $cartType, $orderInfo, $limitProductCode, $sku, $skn, $buyNumber, $isAjax); |
312 | +// print_r($order); | ||
311 | if (isset($order['cartUrl'])) { // 普通或者预售商品为空时 | 313 | if (isset($order['cartUrl'])) { // 普通或者预售商品为空时 |
312 | $this->go($order['cartUrl']); | 314 | $this->go($order['cartUrl']); |
313 | } | 315 | } |
@@ -521,4 +523,81 @@ class IndexController extends AbstractAction | @@ -521,4 +523,81 @@ class IndexController extends AbstractAction | ||
521 | $this->echoJson($result); | 523 | $this->echoJson($result); |
522 | } | 524 | } |
523 | 525 | ||
526 | + /** | ||
527 | + * jit拆单/配送信息 | ||
528 | + * | ||
529 | + * | ||
530 | + */ | ||
531 | + public function jitDetailAction() | ||
532 | + { | ||
533 | + $data = array(); | ||
534 | + | ||
535 | + $uid = $this->getUid(true); | ||
536 | + $cartType = $this->get('cartType', ''); //购物车类型 | ||
537 | + $skuList = $this->get('skuList', ''); //cookie中记录的一些订单有关数据 | ||
538 | + $orderCode = $this->get('orderCode', ''); //订单号 | ||
539 | + $sessionKey = $this->get('sessionKey', ''); //用户会话 | ||
540 | + if ($cartType && $skuList) { | ||
541 | + $data = CartModel::getPackageInfo($uid, $cartType, $skuList); | ||
542 | + }else{ | ||
543 | + $data = OrderModel::getPackageInfo($orderCode, $uid, $sessionKey); | ||
544 | + } | ||
545 | + // 返回地址 | ||
546 | + $returnUrl = Helpers::url('/home/orders'); | ||
547 | + | ||
548 | +// $data = array( | ||
549 | +// 'jitDetailPage' => true, | ||
550 | +// 'packages' => array( | ||
551 | +// array( | ||
552 | +// 'packageType' => 1, | ||
553 | +// 'dispatchType' => '总仓发货', | ||
554 | +// 'expressCost' => '3.00', | ||
555 | +// 'discount' => '7.00', | ||
556 | +// 'goods' => array( | ||
557 | +// array( | ||
558 | +// 'isGift' => true, | ||
559 | +// 'thumb' => 'http://img11.static.yhbimg.com/goodsimg/2016/04/22/03/014ef4962d8da94afb3a8b07bc584c3a24.jpg?imageMogr2/thumbnail/299x388/extent/299x388/background/d2hpdGU=/position/center/quality/80', | ||
560 | +// ), | ||
561 | +// array( | ||
562 | +// 'isAdd' => true, | ||
563 | +// 'thumb' => 'http://img11.static.yhbimg.com/goodsimg/2016/04/22/03/014ef4962d8da94afb3a8b07bc584c3a24.jpg?imageMogr2/thumbnail/299x388/extent/299x388/background/d2hpdGU=/position/center/quality/80', | ||
564 | +// ), | ||
565 | +// ) | ||
566 | +// ), | ||
567 | +// array( | ||
568 | +// 'packageType' => 1, | ||
569 | +// 'dispatchType' => '总仓发货', | ||
570 | +// 'expressCost' => '3.00', | ||
571 | +// 'discount' => '7.00', | ||
572 | +// 'goods' => array( | ||
573 | +// array( | ||
574 | +// 'isAdd' => true, | ||
575 | +// 'thumb' => 'http://img11.static.yhbimg.com/goodsimg/2016/04/22/03/014ef4962d8da94afb3a8b07bc584c3a24.jpg?imageMogr2/thumbnail/299x388/extent/299x388/background/d2hpdGU=/position/center/quality/80', | ||
576 | +// ), | ||
577 | +// array( | ||
578 | +// 'thumb' => 'http://img11.static.yhbimg.com/goodsimg/2016/04/22/03/014ef4962d8da94afb3a8b07bc584c3a24.jpg?imageMogr2/thumbnail/299x388/extent/299x388/background/d2hpdGU=/position/center/quality/80', | ||
579 | +// ), | ||
580 | +// array( | ||
581 | +// 'thumb' => 'http://img11.static.yhbimg.com/goodsimg/2016/04/22/03/014ef4962d8da94afb3a8b07bc584c3a24.jpg?imageMogr2/thumbnail/299x388/extent/299x388/background/d2hpdGU=/position/center/quality/80', | ||
582 | +// ), | ||
583 | +// array( | ||
584 | +// 'isGift' => true, | ||
585 | +// 'thumb' => 'http://img11.static.yhbimg.com/goodsimg/2016/04/22/03/014ef4962d8da94afb3a8b07bc584c3a24.jpg?imageMogr2/thumbnail/299x388/extent/299x388/background/d2hpdGU=/position/center/quality/80', | ||
586 | +// ), | ||
587 | +// array( | ||
588 | +// 'thumb' => 'http://img11.static.yhbimg.com/goodsimg/2016/04/22/03/014ef4962d8da94afb3a8b07bc584c3a24.jpg?imageMogr2/thumbnail/299x388/extent/299x388/background/d2hpdGU=/position/center/quality/80', | ||
589 | +// ), | ||
590 | +// array( | ||
591 | +// 'thumb' => 'http://img11.static.yhbimg.com/goodsimg/2016/04/22/03/014ef4962d8da94afb3a8b07bc584c3a24.jpg?imageMogr2/thumbnail/299x388/extent/299x388/background/d2hpdGU=/position/center/quality/80', | ||
592 | +// ) | ||
593 | +// ) | ||
594 | +// ) | ||
595 | +// ) | ||
596 | +// ); | ||
597 | + | ||
598 | + $this->setTitle('配送信息'); | ||
599 | + $this->setNavHeader('配送信息', $returnUrl, false); // 不显示右上角home按钮 | ||
600 | + $this->_view->display('jit-detail', $data); | ||
601 | + } | ||
602 | + | ||
524 | } | 603 | } |
-
Please register or login to post a comment