Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYWAP
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
cailing
9 years ago
Commit
828f8c4b773f1b2f07cb91860dd6d5ed3d97b8fa
1 parent
29d0d067
WAP——jit拆单,yoho币,订单详情优化
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
466 additions
and
65 deletions
library/LibModels/Wap/Home/OrderData.php
static/js/cart/entry.js
static/js/cart/jit-detail.js
static/js/product/detail/detail.js
static/sass/cart/_index.css
static/sass/cart/_order-ensure.css
static/sass/me/_order-detail.css
static/sass/product/_detail.css
template/m.yohobuy.com/actions/cart/index/jit-detail.phtml
template/m.yohobuy.com/actions/cart/index/order-ensure.phtml
template/m.yohobuy.com/actions/index/home/order-detail.phtml
template/m.yohobuy.com/actions/product/detail/index.phtml
template/m.yohobuy.com/partials/layout/use.phtml
template/m.yohobuy.com/partials/me/order/jit-more.phtml
yohobuy/m.yohobuy.com/application/models/Home/Order.php
yohobuy/m.yohobuy.com/application/models/Index/Cart.php
yohobuy/m.yohobuy.com/application/models/Product/Detail.php
yohobuy/m.yohobuy.com/application/modules/Cart/controllers/Index.php
library/LibModels/Wap/Home/OrderData.php
View file @
828f8c4
...
...
@@ -75,10 +75,30 @@ class OrderData
* @param string $sessionKey 用户会话
* @return array
*/
// public static function viewOrderData($orderCode, $uid, $sessionKey)
// {
// $param = Yohobuy::param();
// $param['method'] = 'app.SpaceOrders.info';
// $param['order_code'] = $orderCode;
// $param['uid'] = $uid;
// $param['session_key'] = $sessionKey;
// $param['client_secret'] = Sign::getSign($param);
//
// return Yohobuy::get(Yohobuy::API_URL, $param);
// }
/**
* 查看订单详情(new)
*
* @param string $orderCode 订单号
* @param int $uid 用户ID
* @param string $sessionKey 用户会话
* @return array
*/
public
static
function
viewOrderData
(
$orderCode
,
$uid
,
$sessionKey
)
{
$param
=
Yohobuy
::
param
();
$param
[
'method'
]
=
'app.SpaceOrders.
info
'
;
$param
[
'method'
]
=
'app.SpaceOrders.
detail
'
;
$param
[
'order_code'
]
=
$orderCode
;
$param
[
'uid'
]
=
$uid
;
$param
[
'session_key'
]
=
$sessionKey
;
...
...
static/js/cart/entry.js
View file @
828f8c4
...
...
@@ -9,3 +9,4 @@ require('./gift-advance');
require
(
'./order-ensure'
);
require
(
'./select-coupon'
);
require
(
'./select-address'
);
require
(
'./jit-detail'
);
...
...
static/js/cart/jit-detail.js
0 → 100644
View file @
828f8c4
/**
* jit拆单配送信息页面
* @author: zhaobiao<bill.zhao@yoho.cn>
* @date: 2016/04/26
*/
var
Swiper
=
require
(
'yoho.iswiper'
),
$
=
require
(
'jquery'
);
var
height
=
$
(
window
).
height
()
-
$
(
'#yoho-header'
).
height
();
// 为了展示页面背景色,需要把页面根据窗口大小撑开
$
(
'.jit-detail-page'
).
css
(
'height'
,
height
);
$
(
'.jit-detail-page>div'
).
show
();
// 内容展示之后,再根据document高度,调整一次容器高度
height
=
$
(
document
).
height
()
-
$
(
'#yoho-header'
).
height
();
$
(
'.jit-detail-page'
).
css
(
'height'
,
height
);
(
function
()
{
return
new
Swiper
(
'.swiper-container'
,
{
slidesPerView
:
'auto'
,
grabCursor
:
true
,
slideElement
:
'a'
,
lazyLoading
:
true
,
watchSlidesVisibility
:
true
});
})();
...
...
static/js/product/detail/detail.js
View file @
828f8c4
...
...
@@ -10,7 +10,8 @@ var $ = require('jquery'),
var
goodsSwiper
,
$discountFolder
=
$
(
'.goodsDiscount .discount-folder'
),
$discountArrow
=
$
(
'.goodsDiscount .first-item span'
);
$downArea
=
$
(
'.goodsDiscount .pull-down'
);
$upArea
=
$
(
'.goodsDiscount .pull-up'
);
var
goodsDiscountEl
=
document
.
getElementById
(
'goodsDiscount'
),
goodsDiscountHammer
=
goodsDiscountEl
&&
new
Hammer
(
goodsDiscountEl
),
...
...
@@ -62,7 +63,7 @@ goodsSwiper = new Swiper('.banner-swiper', {
//初始化goods-discount
if
(
0
===
$discountFolder
.
children
().
length
)
{
$discountFolder
.
css
(
'display'
,
'none'
);
$d
iscountArrow
.
html
(
''
);
$d
ownArea
.
hide
(
);
}
//goods-discount下拉按钮点击事件
...
...
@@ -70,12 +71,14 @@ if (goodsDiscountHammer && $discountFolder.children().length > 0) {
goodsDiscountHammer
.
on
(
'tap'
,
function
(
e
)
{
if
(
$discountFolder
.
is
(
':hidden'
))
{
$discountFirstItem
.
removeClass
(
'short-text'
);
$d
iscountArrow
.
removeClass
(
'icon-down'
).
addClass
(
'icon-up'
).
html
(
''
);
$d
ownArea
.
hide
(
);
$discountFolder
.
slideDown
();
$upArea
.
show
();
}
else
{
$discountFirstItem
.
addClass
(
'short-text'
);
$
discountArrow
.
removeClass
(
'icon-up'
).
addClass
(
'icon-down'
).
html
(
''
);
$
upArea
.
hide
(
);
$discountFolder
.
slideUp
();
$downArea
.
show
();
}
});
}
...
...
static/sass/cart/_index.css
View file @
828f8c4
...
...
@@ -4,6 +4,7 @@
@import
"order-ensure"
;
@import
"select-coupon"
;
@import
"select-address"
;
@import
"jit-detail"
;
.icon-checkbox
:before
{
content
:
"\e61c"
;
}
...
...
static/sass/cart/_order-ensure.css
View file @
828f8c4
...
...
@@ -462,6 +462,34 @@
height
:
auto
;
resize
:
none
;
}
&
.mt0
{
margin-top
:
0
;
}
&
.more-jit
{
padding-top
:
0
;
padding-bottom
:
0
;
margin-bottom
:
0
;
border-bottom
:
none
;
}
.more-jit
{
height
:
88px
;
line-height
:
88px
;
position
:
relative
;
span
{
font-size
:
34px
;
color
:
#444
;
}
.iconfont
{
position
:
absolute
;
right
:
0
;
}
}
}
#invoice
{
...
...
static/sass/me/_order-detail.css
View file @
828f8c4
...
...
@@ -13,6 +13,35 @@
font-size
:
40px
;
margin-top
:
-30px
;
}
&
.more-jit
{
background
:
#fff
;
padding
:
30px
20px
;
border-bottom
:
1px
solid
#e0e0e0
;
padding-top
:
0
;
padding-bottom
:
0
;
margin-bottom
:
0
;
}
.more-jit
{
height
:
88px
;
line-height
:
88px
;
position
:
relative
;
span
{
font-size
:
34px
;
color
:
#444
;
}
.iconfont
{
position
:
absolute
;
right
:
0
;
left
:
auto
;
top
:
auto
;
margin
:
0
;
}
}
}
.sub
{
...
...
@@ -102,7 +131,21 @@
}
}
}
.dollar
{
background
:
#ffffff
;
padding
:
0.5rem
0.75rem
;
height
:
1.5rem
;
line-height
:
1.5rem
;
.bg-dollar{
display
:
inline-block
;
width
:
0.6rem
;
height
:
0.6rem
;
background
:
url('../img/me/yoho-coin/dollar.png?1452827495')
center
center
;
background-size
:
100%
100%
;
vertical-align
:
middle
;
}
}
.opt
{
text-align
:
right
;
border-top
:
1px
solid
#e0e0e0
;
...
...
static/sass/product/_detail.css
View file @
828f8c4
...
...
@@ -373,26 +373,46 @@ $basicBtnC:#eb0313;
border-bottom
:
1px
solid
$
borderC
;
h1
{
position
:
relative
;
padding
:
30px
60px
30px
28
px
;
padding
:
30px
60px
30px
75
px
;
line-height
:
36px
;
}
.act-logo
{
display
:
inline-block
;
position
:
absolute
;
left
:
28px
;
background
:
rgb
(
235
,
3
,
19
);
color
:
#fff
;
font-size
:
22px
;
padding
:
1px
;
height
:
28px
;
}
.pull-area
{
position
:
relative
;
height
:
30px
;
.pull-icon{
position
:
absolute
;
top
:
0
;
left
:
50%
;
top
:
-10px
;
margin-left
:
-18px
;
width
:
35px
;
font-size
:
30px
;
color
:
#e0e0e0
;
}
}
.pull-up
{
display
:
none
;
}
.short-text
{
white-space
:
nowrap
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
}
.iconfont
{
position
:
absolute
;
top
:
30px
;
right
:
36px
;
width
:
35px
;
font-size
:
45px
;
float
:
right
;
color
:
#e0e0e0
;
/*padding-left:50px;*/
}
.discount-folder
{
.folder-item
{
border-top
:
1px
solid
$
borderC
;
...
...
template/m.yohobuy.com/actions/cart/index/jit-detail.phtml
0 → 100644
View file @
828f8c4
{
{>
layout/header
}
}
<div
class=
"jit-detail-page yoho-page"
>
{
{#each
packages
}
}
<div
class=
"top"
>
<span
class=
"package-type"
>包裹
{
{packageType
}
}:</span>
<span
class=
"package-title"
>
{
{dispatchType
}
}</span>
</div>
<div
class=
"middle"
>
<div
class=
"swiper-container"
>
<div
class=
"swiper-wrapper swiper-wrapper-jit"
>
{
{#each
goods
}
}
<a
class=
"swiper-slide"
href=
"javascript:void(0);"
>
<img
class=
"swiper-lazy img-box"
data-src=
"{{thumb}}"
>
<div
class=
"swiper-lazy-preloader"
></div>
{
{#if
isGift
}
}
<span
class=
"tag gift"
>赠品</span>
{
{/if
}
}
{
{#if
isAdd
}
}
<span
class=
"tag add"
>加价购</span>
{
{/if
}
}
</a>
{
{/each
}
}
</div>
</div>
</div>
<div
class=
"bottom"
>
<span>运费:
</span>
<span>¥
{
{expressCost
}
}
</span>
<span>(已优惠¥
{
{discount
}
})</span>
</div>
{
{/each
}
}
</div>
{
{>
layout/footer
}
}
...
...
template/m.yohobuy.com/actions/cart/index/order-ensure.phtml
View file @
828f8c4
...
...
@@ -75,7 +75,12 @@
</ul>
</div>
</section>
<section
class=
"block"
style=
"margin-bottom: 0;"
>
{
{#if
isJit
}
}
{
{>
me/order/jit-more
}
}
{
{/if
}
}
<section
class=
"block mt0"
style=
"margin-bottom: 0;"
>
{
{#each
goods
}
}
{
{>
me/order/good
}
}
{
{/each
}
}
...
...
template/m.yohobuy.com/actions/index/home/order-detail.phtml
View file @
828f8c4
...
...
@@ -22,8 +22,8 @@
<span
class=
"iconfont"
>
632
;</span>
<p
class=
"beside-icon sub-content"
>
<span
class=
"sub-title"
>
{
{orderStatus
}
}</span>
<span>订单编号:
{
{orderNum
}
}</span>
<span
class=
"sub-title"
>订单编号:
{
{orderNum
}
}</span>
<span
>
{
{orderStatus
}
}</span>
<span>下单时间:
{
{orderTime
}
}</span>
</p>
</div>
...
...
@@ -42,50 +42,32 @@
</section>
<section
class=
"goods block"
>
{
{#if
isJit
}
}
{
{>
me/order/jit-more
}
}
{
{/if
}
}
{
{#
goods
}
}
{
{>
me/order/good
}
}
{
{/
goods
}
}
</section>
<ul
class=
"cost block"
>
<li>
商品总金额
<span>
{
{sumPrice
}
}</span>
{
{#each
orderBalance
}
}
<li>
{
{promotion
}
}:
<span>
{
{account
}
}</span>
</li>
{
{#if
salePrice
}
}
<li>
活动金额
<span>
{
{salePrice
}
}</span>
</li>
{
{/if
}
}
<li>
运费
<span>
{
{freight
}
}</span>
</li>
{
{#if
promo_code_amount
}
}
<li>
优惠码
<span>
{
{promo_code_amount
}
}</span>
</li>
{
{/if
}
}
{
{#if
coupon
}
}
<li>
优惠券
<span>
{
{coupon
}
}</span>
</li>
{
{/if
}
}
{
{#if
yohoCoin
}
}
<li>
YOHO币
<span>
{
{yohoCoin
}
}</span>
</li>
{
{/if
}
}
{
{/each
}
}
<li>
实付金额
<span>
{
{price
}
}</span>
</li>
</ul>
{
{#if
yohoCoin
}
}
<p
class=
"dollar"
>
<span
class=
"bg-dollar"
></span>
共返YOHO币:
<span>
{
{yohoCoin
}
}</span>个
</p>
{
{/if
}
}
<div
class=
"opt block"
>
{
{#unless
unreceived
}
}
{
{#unless
unpaid
}
}
...
...
template/m.yohobuy.com/actions/product/detail/index.phtml
View file @
828f8c4
...
...
@@ -77,12 +77,19 @@
</ul>
{
{/vipLevel
}
}
{
{#
commodityReturn
}
}
<div
class=
"goodsDiscount"
>
<h
1
class=
"tap-hightlight"
><span
class=
"act-logo"
>返</span>
{
{commodityReturn
}
}</h
1
>
</div>
{
{/commodityReturn
}
}
{
{#
goodsDiscount
}
}
<div
class=
"goodsDiscount"
id=
"goodsDiscount"
>
{
{#
list
}
}
{
{#if
@first
}
}
{
{#if
text
}
}
<h
1
class=
"first-item short-text tap-hightlight"
>
{
{text
}
}<span
class=
"icon-down iconfont dropdown"
>
609
;</span></h
1
>
<h
1
class=
"first-item short-text tap-hightlight"
><span
class=
"act-logo"
>促</span>
{
{text
}
}</h
1
>
<div
class=
"pull-area pull-down"
><span
class=
"icon-down iconfont pull-icon dropdown"
>
609
;</span></div>
{
{/if
}
}
{
{/if
}
}
{
{/
list
}
}
...
...
@@ -96,6 +103,7 @@
{
{/if
}
}
{
{/list
}
}
</div>
<div
class=
"pull-area pull-up"
><span
class=
"icon-up iconfont pull-icon dropdown"
>
608
;</span></div>
</div>
{
{/
goodsDiscount
}
}
...
...
template/m.yohobuy.com/partials/layout/use.phtml
View file @
828f8c4
...
...
@@ -384,3 +384,9 @@
seajs.use('js/index/coupon');
</script>
{{/if}}
{{#if jitDetailPage}}
<script>
seajs.use('js/cart/jit-detail');
</script>
{{/if}}
...
...
template/m.yohobuy.com/partials/me/order/jit-more.phtml
0 → 100644
View file @
828f8c4
<section class="block more-jit">
<a href="{{jitDetailUrl}}">
<div class="more-jit">
<span>商品需要分仓调拨</span>
<span class="iconfont icon-right-arrow"></span>
</div>
</a>
</section>
...
...
yohobuy/m.yohobuy.com/application/models/Home/Order.php
View file @
828f8c4
...
...
@@ -133,8 +133,8 @@ class OrderModel
$build
[
'date'
]
=
$value
[
'acceptTime'
];
$result
[
'logisticDetail'
][]
=
$build
;
}
}
while
(
false
);
}
while
(
false
);
return
$result
;
}
...
...
@@ -197,6 +197,7 @@ class OrderModel
if
(
is_numeric
(
$orderCode
)
&&
is_numeric
(
$uid
)
&&
is_string
(
$sessionKey
))
{
$orderDetail
=
OrderData
::
viewOrderData
(
$orderCode
,
$uid
,
$sessionKey
);
print_r
(
$orderDetail
);
if
(
isset
(
$orderDetail
[
'data'
][
'order_code'
]))
{
$count
=
0
;
...
...
@@ -208,20 +209,36 @@ class OrderModel
$result
[
'orderNum'
]
=
$orderDetail
[
'data'
][
'order_code'
];
$result
[
'orderTime'
]
=
date
(
'Y-m-d H:i:s'
,
$orderDetail
[
'data'
][
'create_time'
]);
$result
[
'goods'
]
=
Helpers
::
formatOrderGoods
(
$orderDetail
[
'data'
][
'order_goods'
],
$count
,
true
);
$result
[
'sumPrice'
]
=
$orderDetail
[
'data'
][
'goods_total_amount'
];
// 商品总金额
$result
[
'salePrice'
]
=
self
::
filterOrderPrice
(
$orderDetail
[
'data'
][
'promotion_amount'
]);
// 活动金额
$result
[
'freight'
]
=
$orderDetail
[
'data'
][
'shipping_cost'
];
// 运费
$result
[
'coupon'
]
=
self
::
filterOrderPrice
(
$orderDetail
[
'data'
][
'coupons_amount'
]);
// 优惠券
// $result['sumPrice'] = $orderDetail['data']['goods_total_amount']; // 商品总金额
// $result['salePrice'] = self::filterOrderPrice($orderDetail['data']['promotion_amount']); // 活动金额
// $result['freight'] = $orderDetail['data']['shipping_cost']; // 运费
// $result['coupon'] = self::filterOrderPrice($orderDetail['data']['coupons_amount']); // 优惠券
if
(
isset
(
$orderDetail
[
'data'
][
'promo_code_amount'
]))
{
$result
[
'promo_code_amount'
]
=
self
::
filterOrderPrice
(
$orderDetail
[
'data'
][
'promo_code_amount'
]);
// 优惠码
}
$result
[
'yohoCoin'
]
=
self
::
filterOrderPrice
(
$orderDetail
[
'data'
][
'yoho_coin_num'
]);
// YOHO币
// $result['yohoCoin'] = $orderDetail['data']['yoho_give_coin']; // YOHO币
$result
[
'yohoCoin'
]
=
100
;
$result
[
'price'
]
=
$orderDetail
[
'data'
][
'amount'
];
// 实付金额
$result
[
'goodsAmount'
]
=
$orderDetail
[
'data'
][
'payment_amount'
];
// 商品总金额没有人民币符号
$result
[
'orderCount'
]
=
$count
;
// 订单总件数
$result
[
'isPay'
]
=
$orderDetail
[
'data'
][
'payment_status'
]
===
'Y'
;
}
//相关金额(商品总金额,活动金额,运费,优惠券,YOHO币)
if
(
isset
(
$orderDetail
[
'data'
][
'promotion_formulas'
])
&&
$orderDetail
[
'data'
][
'promotion_formulas'
])
{
foreach
(
$orderDetail
[
'data'
][
'promotion_formulas'
]
as
$pricek
=>
$pricev
)
{
$result
[
'orderBalance'
][
$pricek
]
=
array
(
'promotion'
=>
$pricev
[
'promotion'
],
'account'
=>
$pricev
[
'promotion_amount'
]);
}
}
//为支付的拆单配送信息
if
(
isset
(
$orderDetail
[
'data'
][
'is_multi_package'
])
&&
$orderDetail
[
'data'
][
'is_multi_package'
]
==
'Y'
)
{
$result
[
'isJit'
]
=
true
;
$result
[
'jitDetailUrl'
]
=
Helpers
::
url
(
'/cart/index/jitDetail'
,
array
(
'orderCode'
=>
$orderCode
,
'sessionKey'
=>
$sessionKey
));
}
//测试
// $result['isJit'] = true;
// $result['jitDetailUrl'] = Helpers::url('/cart/index/jitDetail', array('orderCode' => $orderCode, 'sessionKey' => $sessionKey));
}
return
$result
;
...
...
@@ -316,7 +333,7 @@ class OrderModel
case
5
:
//待收货状态,给查看物流url
$result
[
'unreceived'
]
=
true
;
self
::
assignExpressInfo
(
$showLogistics
,
$order
,
$result
);
self
::
assignExpressInfo
(
$showLogistics
,
$order
,
$result
);
break
;
case
6
:
$result
[
'completed'
]
=
true
;
...
...
@@ -325,7 +342,8 @@ class OrderModel
default
:
break
;
}
}
while
(
false
);
}
while
(
false
);
return
$result
;
}
...
...
@@ -342,7 +360,7 @@ class OrderModel
if
(
$showLogistics
&&
isset
(
$order
[
'express_company'
][
'caption'
]))
{
$result
[
'logisticsCompany'
]
=
$order
[
'express_company'
][
'caption'
];
$result
[
'logisticsNum'
]
=
isset
(
$order
[
'express_number'
])
?
$order
[
'express_number'
]
:
''
;
$result
[
'logisticsNum'
]
=
isset
(
$order
[
'express_number'
])
?
$order
[
'express_number'
]
:
''
;
}
}
...
...
@@ -354,11 +372,62 @@ class OrderModel
*/
private
static
function
filterOrderPrice
(
$price
)
{
if
(
is_string
(
$price
)
&&
strstr
(
$price
,
'¥0.00'
)
!==
false
)
{
if
(
is_string
(
$price
)
&&
strstr
(
$price
,
'¥0.00'
)
!==
false
)
{
return
''
;
}
else
{
}
else
{
return
$price
;
}
}
/**
* 获取拆单信息数据
* @param type $uid 用户id
* @param type $cartType 购物车类型
* @param type $skuList 商品信息
* @return boolean
*/
public
static
function
getPackageInfo
(
$orderCode
,
$uid
,
$sessionKey
)
{
$result
=
array
();
$carpay
=
OrderData
::
viewOrderData
(
$orderCode
,
$uid
,
$sessionKey
);
do
{
if
(
!
$carpay
||
$carpay
[
'code'
]
!=
200
||
empty
(
$carpay
[
'data'
][
'package_list'
]))
{
break
;
}
$package
=
$carpay
[
'data'
];
// 拆单数据
if
(
isset
(
$package
[
'package_list'
])
&&
!
empty
(
$package
[
'package_list'
]))
{
$result
[
'jitDetailPage'
]
=
true
;
$packageList
=
$package
[
'data'
][
'package_list'
];
foreach
(
$packageList
as
$pk
=>
$pv
)
{
$result
[
$pk
][
'packageType'
]
=
1
;
$result
[
$pk
][
'dispatchType'
]
=
(
$pv
[
'supplier_id'
]
==
0
)
?
'包裹1:总仓库'
:
'包裹2:异地调拨'
;
//仓库
$goodList
=
$pv
[
'goods_list'
];
foreach
(
$goodList
as
$glk
=>
$glv
)
{
$result
[
$pk
][
'goods'
][
$glk
][
'thumb'
]
=
Images
::
getImageUrl
(
$glv
[
'goods_images'
],
90
,
90
);
$tag
=
isset
(
$glv
[
'goods_type'
])
?
$glv
[
'goods_type'
]
:
''
;
switch
(
$tag
)
{
case
'price_gift'
:
//加价购
$result
[
$pk
][
'goods'
][
$glk
][
'isAdd'
]
=
true
;
break
;
case
'gift'
:
//赠品
$result
[
$pk
][
'goods'
][
$glk
][
'isGift'
]
=
true
;
break
;
default
:
break
;
}
}
$result
[
$pk
][
'expressCost'
]
=
$pv
[
'shopping_cost'
];
// $packages[$pk]['orign'] = $pv['shopping_orig_cost'];
$result
[
$pk
][
'discount'
]
=
intval
(
$pv
[
'shopping_orig_cost'
])
-
intval
(
$pv
[
'shopping_cost'
]);
}
}
}
while
(
false
);
return
$result
;
}
}
...
...
yohobuy/m.yohobuy.com/application/models/Index/Cart.php
View file @
828f8c4
...
...
@@ -345,6 +345,7 @@ class CartModel
}
$pay
=
CartData
::
cartPay
(
$uid
,
$cartType
,
0
,
$skuList
);
// print_r($pay);
do
{
if
(
!
$pay
||
$pay
[
'code'
]
!=
200
||
empty
(
$pay
[
'data'
][
'goods_list'
]))
{
...
...
@@ -521,6 +522,14 @@ class CartModel
// 订单数据
if
(
isset
(
$payReturn
[
'shopping_cart_data'
])
&&
!
empty
(
$payReturn
[
'shopping_cart_data'
]))
{
//判断是否为JIT商品
if
(
$payReturn
[
'shopping_cart_data'
][
'is_multi_package'
]
==
'Y'
)
{
$result
[
'isJit'
]
=
true
;
$result
[
'jitDetailUrl'
]
=
Helpers
::
url
(
'/cart/index/jitDetail'
,
array
(
'cartType'
=>
$cartType
,
'skuList'
=>
$skuList
));
}
//测试
// $result['isJit'] = true;
// $result['jitDetailUrl'] = Helpers::url('/cart/index/jitDetail', array('cartType' => $cartType, 'skuList' => $skuList));
$result
[
'cartPayData'
]
=
isset
(
$orderCompute
[
'promotion_formula_list'
])
?
$orderCompute
[
'promotion_formula_list'
]
:
$payReturn
[
'shopping_cart_data'
][
'promotion_formula_list'
];
$price
=
isset
(
$orderCompute
[
'last_order_amount'
])
?
$orderCompute
[
'last_order_amount'
]
:
$payReturn
[
'shopping_cart_data'
][
'last_order_amount'
];
$result
[
'price'
]
=
Helpers
::
transPrice
(
$price
,
true
);
...
...
@@ -975,4 +984,56 @@ class CartModel
return
$result
;
}
/**
* 获取拆单信息数据
* @param type $uid 用户id
* @param type $cartType 购物车类型
* @param type $skuList 商品信息
* @return boolean
*/
public
static
function
getPackageInfo
(
$uid
,
$cartType
,
$skuList
)
{
$result
=
array
();
$carpay
=
CartData
::
cartPay
(
$uid
,
$cartType
,
0
,
$skuList
);
do
{
if
(
!
$carpay
||
$carpay
[
'code'
]
!=
200
||
empty
(
$carpay
[
'data'
][
'shopping_cart_data'
]))
{
break
;
}
$package
=
$carpay
[
'data'
];
// 拆单数据
if
(
isset
(
$package
[
'shopping_cart_data'
])
&&
!
empty
(
$package
[
'shopping_cart_data'
]))
{
$result
[
'jitDetailPage'
]
=
true
;
$packageList
=
$package
[
'data'
][
'shopping_cart_data'
][
'package_list'
];
foreach
(
$packageList
as
$pk
=>
$pv
)
{
$result
[
$pk
][
'packageType'
]
=
1
;
$result
[
$pk
][
'dispatchType'
]
=
(
$pv
[
'supplier_id'
]
==
0
)
?
'包裹1:总仓库'
:
'包裹2:异地调拨'
;
//仓库
$goodList
=
$pv
[
'goods_list'
];
foreach
(
$goodList
as
$glk
=>
$glv
)
{
$result
[
$pk
][
'goods'
][
$glk
][
'thumb'
]
=
Images
::
getImageUrl
(
$glv
[
'goods_images'
],
90
,
90
);
$tag
=
isset
(
$glv
[
'goods_type'
])
?
$glv
[
'goods_type'
]
:
''
;
switch
(
$tag
){
case
'price_gift'
:
//加价购
$result
[
$pk
][
'goods'
][
$glk
][
'isAdd'
]
=
true
;
break
;
case
'gift'
:
//赠品
$result
[
$pk
][
'goods'
][
$glk
][
'isGift'
]
=
true
;
break
;
default
:
break
;
}
}
$result
[
$pk
][
'expressCost'
]
=
$pv
[
'shopping_cost'
];
// $packages[$pk]['orign'] = $pv['shopping_orig_cost'];
$result
[
$pk
][
'discount'
]
=
intval
(
$pv
[
'shopping_orig_cost'
])
-
intval
(
$pv
[
'shopping_cost'
]);
}
}
}
while
(
false
);
return
$result
;
}
}
...
...
yohobuy/m.yohobuy.com/application/models/Product/Detail.php
View file @
828f8c4
...
...
@@ -41,6 +41,7 @@ class DetailModel
elseif
(
is_numeric
(
$productSkn
))
{
$baseInfo
=
DetailData
::
baseInfo
(
null
,
$uid
,
$productSkn
);
}
// print_r($baseInfo);
// 商品名称
if
(
empty
(
$baseInfo
[
'productName'
]))
{
return
$result
;
...
...
@@ -91,6 +92,8 @@ class DetailModel
if
(
$baseInfo
[
'productPriceBo'
][
'formatMarketPrice'
]
!==
$baseInfo
[
'productPriceBo'
][
'formatSalesPrice'
])
{
$result
[
'goodsPrice'
][
'previousPrice'
]
=
$baseInfo
[
'productPriceBo'
][
'formatMarketPrice'
];
}
//商品返回Yoho币
$result
[
'goodsPrice'
][
'yohoCoinNum'
]
=
$baseInfo
[
'productPriceBo'
][
'yohoCoinNum'
];
}
// VIP商品价格
if
(
isset
(
$baseInfo
[
'productPriceBo'
][
'vipPrices'
]))
{
...
...
yohobuy/m.yohobuy.com/application/modules/Cart/controllers/Index.php
View file @
828f8c4
...
...
@@ -6,6 +6,7 @@ use Index\CartModel;
use
Index\UserModel
;
use
Plugin\Helpers
;
use
Plugin\UnionTrans
;
use
Home\OrderModel
;
/**
* 购物车相关的控制器
...
...
@@ -308,6 +309,7 @@ class IndexController extends AbstractAction
$uid
=
$this
->
getUid
(
true
);
$isAjax
=
$this
->
isAjax
();
$order
=
CartModel
::
cartPay
(
$uid
,
$cartType
,
$orderInfo
,
$limitProductCode
,
$sku
,
$skn
,
$buyNumber
,
$isAjax
);
// print_r($order);
if
(
isset
(
$order
[
'cartUrl'
]))
{
// 普通或者预售商品为空时
$this
->
go
(
$order
[
'cartUrl'
]);
}
...
...
@@ -521,4 +523,81 @@ class IndexController extends AbstractAction
$this
->
echoJson
(
$result
);
}
/**
* jit拆单/配送信息
*
*
*/
public
function
jitDetailAction
()
{
$data
=
array
();
$uid
=
$this
->
getUid
(
true
);
$cartType
=
$this
->
get
(
'cartType'
,
''
);
//购物车类型
$skuList
=
$this
->
get
(
'skuList'
,
''
);
//cookie中记录的一些订单有关数据
$orderCode
=
$this
->
get
(
'orderCode'
,
''
);
//订单号
$sessionKey
=
$this
->
get
(
'sessionKey'
,
''
);
//用户会话
if
(
$cartType
&&
$skuList
)
{
$data
=
CartModel
::
getPackageInfo
(
$uid
,
$cartType
,
$skuList
);
}
else
{
$data
=
OrderModel
::
getPackageInfo
(
$orderCode
,
$uid
,
$sessionKey
);
}
// 返回地址
$returnUrl
=
Helpers
::
url
(
'/home/orders'
);
// $data = array(
// 'jitDetailPage' => true,
// 'packages' => array(
// array(
// 'packageType' => 1,
// 'dispatchType' => '总仓发货',
// 'expressCost' => '3.00',
// 'discount' => '7.00',
// 'goods' => array(
// array(
// 'isGift' => true,
// 'thumb' => 'http://img11.static.yhbimg.com/goodsimg/2016/04/22/03/014ef4962d8da94afb3a8b07bc584c3a24.jpg?imageMogr2/thumbnail/299x388/extent/299x388/background/d2hpdGU=/position/center/quality/80',
// ),
// array(
// 'isAdd' => true,
// 'thumb' => 'http://img11.static.yhbimg.com/goodsimg/2016/04/22/03/014ef4962d8da94afb3a8b07bc584c3a24.jpg?imageMogr2/thumbnail/299x388/extent/299x388/background/d2hpdGU=/position/center/quality/80',
// ),
// )
// ),
// array(
// 'packageType' => 1,
// 'dispatchType' => '总仓发货',
// 'expressCost' => '3.00',
// 'discount' => '7.00',
// 'goods' => array(
// array(
// 'isAdd' => true,
// 'thumb' => 'http://img11.static.yhbimg.com/goodsimg/2016/04/22/03/014ef4962d8da94afb3a8b07bc584c3a24.jpg?imageMogr2/thumbnail/299x388/extent/299x388/background/d2hpdGU=/position/center/quality/80',
// ),
// array(
// 'thumb' => 'http://img11.static.yhbimg.com/goodsimg/2016/04/22/03/014ef4962d8da94afb3a8b07bc584c3a24.jpg?imageMogr2/thumbnail/299x388/extent/299x388/background/d2hpdGU=/position/center/quality/80',
// ),
// array(
// 'thumb' => 'http://img11.static.yhbimg.com/goodsimg/2016/04/22/03/014ef4962d8da94afb3a8b07bc584c3a24.jpg?imageMogr2/thumbnail/299x388/extent/299x388/background/d2hpdGU=/position/center/quality/80',
// ),
// array(
// 'isGift' => true,
// 'thumb' => 'http://img11.static.yhbimg.com/goodsimg/2016/04/22/03/014ef4962d8da94afb3a8b07bc584c3a24.jpg?imageMogr2/thumbnail/299x388/extent/299x388/background/d2hpdGU=/position/center/quality/80',
// ),
// array(
// 'thumb' => 'http://img11.static.yhbimg.com/goodsimg/2016/04/22/03/014ef4962d8da94afb3a8b07bc584c3a24.jpg?imageMogr2/thumbnail/299x388/extent/299x388/background/d2hpdGU=/position/center/quality/80',
// ),
// array(
// 'thumb' => 'http://img11.static.yhbimg.com/goodsimg/2016/04/22/03/014ef4962d8da94afb3a8b07bc584c3a24.jpg?imageMogr2/thumbnail/299x388/extent/299x388/background/d2hpdGU=/position/center/quality/80',
// )
// )
// )
// )
// );
$this
->
setTitle
(
'配送信息'
);
$this
->
setNavHeader
(
'配送信息'
,
$returnUrl
,
false
);
// 不显示右上角home按钮
$this
->
_view
->
display
(
'jit-detail'
,
$data
);
}
}
...
...
Please
register
or
login
to post a comment