Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
2
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
Rock Zhang
9 years ago
Commit
3568bb9f304bd41d90131b5b7de48905e5a1cdad
1 parent
1794aef3
修改订单结算页底部的价格有关信息为直接读取接口返回的数据
Code Review By Rock Zhang
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
56 deletions
static/js/cart/order-ensure.js
template/m.yohobuy.com/actions/cart/index/order-ensure.phtml
yohobuy/m.yohobuy.com/application/models/Index/Cart.php
static/js/cart/order-ensure.js
View file @
3568bb9
...
...
@@ -90,7 +90,7 @@ function orderCompute() {
if
(
!
res
)
{
tip
.
show
(
'网络出错'
);
}
else
{
if
(
res
.
order_amount
)
{
/*
if (res.order_amount) {
res.order_amount = (+res.order_amount).toFixed(2);
}
if (res.discount_amount) {
...
...
@@ -98,14 +98,9 @@ function orderCompute() {
}
if (res.last_order_amount) {
res.last_order_amount = (+res.last_order_amount).toFixed(2);
}
}
*/
priceHtml
=
priceTmpl
({
sumPrice
:
res
.
order_amount
,
salePrice
:
res
.
discount_amount
,
freight
:
res
.
promotion_formula_list
[
1
].
promotion_amount
,
couponPrice
:
res
.
coupon_amount
,
yohoCoin
:
res
.
use_yoho_coin
,
price
:
res
.
last_order_amount
cartPayData
:
res
.
promotion_formula_list
});
$price
.
html
(
priceHtml
);
...
...
template/m.yohobuy.com/actions/cart/index/order-ensure.phtml
View file @
3568bb9
...
...
@@ -98,31 +98,12 @@
<section
class=
"price-cal block"
>
<ul
class=
"total"
>
{
{#cartPayData
}
}
<li>
<span>总价</span>
¥
{
{sumPrice
}
}
</li>
<li>
<span>活动价</span>
-
¥
{
{salePrice
}
}
</li>
<li>
<span>运费</span>
+
{
{freight
}
}
</li>
{
{#couponPrice
}
}
<li>
<span>优惠券</span>
-
¥
{
{.
}
}
</li>
{
{/couponPrice
}
}
<li>
<span>YOHO币</span>
-
¥
{
{yohoCoin
}
}
</li>
<li
class=
"cost"
>
应付金额:
<em>¥
{
{price
}
}</em>
<span>
{
{promotion
}
}</span>
{
{promotion_amount
}
}
</li>
{
{/cartPayData
}
}
</ul>
</section>
...
...
@@ -144,31 +125,12 @@
</div>
<script
id=
"tmpl-price"
type=
"text/tmpl"
>
<ul
class=
"total"
>
\
{
{#cartPayData
}
}
<li>
<span>总价</span>
¥\
{
{sumPrice
}
}
</li>
<li>
<span>活动价</span>
-
¥\
{
{salePrice
}
}
</li>
<li>
<span>运费</span>
+
\
{
{freight
}
}
</li>
\
{
{#couponPrice
}
}
<li>
<span>优惠券</span>
-
¥\
{
{.
}
}
</li>
\
{
{/couponPrice
}
}
<li>
<span>YOHO币</span>
-
¥\
{
{yohoCoin
}
}
</li>
<li
class=
"cost"
>
应付金额:
<em>¥\
{
{price
}
}</em>
<span>\
{
{promotion
}
}</span>
\
{
{promotion_amount
}
}
</li>
\
{
{/cartPayData
}
}
</ul>
</script>
{
{>
layout/footer
}
}
...
...
yohobuy/m.yohobuy.com/application/models/Index/Cart.php
View file @
3568bb9
...
...
@@ -450,7 +450,9 @@ class CartModel
// 订单数据
if
(
isset
(
$payReturn
[
'shopping_cart_data'
])
&&
!
empty
(
$payReturn
[
'shopping_cart_data'
]))
{
$sumPrice
=
isset
(
$orderCompute
[
'order_amount'
])
?
$orderCompute
[
'order_amount'
]
:
$payReturn
[
'shopping_cart_data'
][
'order_amount'
];
$result
[
'cartPayData'
]
=
isset
(
$orderCompute
[
'promotion_formula_list'
])
?
$orderCompute
[
'promotion_formula_list'
]
:
$payReturn
[
'shopping_cart_data'
][
'promotion_formula_list'
];
/*$sumPrice = isset($orderCompute['order_amount']) ? $orderCompute['order_amount'] : $payReturn['shopping_cart_data']['order_amount'];
$freight = '¥0';
if (isset($orderCompute['promotion_formula_list'][1]['promotion_amount'])) {
...
...
@@ -466,7 +468,7 @@ class CartModel
$result['salePrice'] = Helpers::transPrice($salePrice);
$result['price'] = Helpers::transPrice($price);
$result['freight'] = $freight;
$result
[
'couponPrice'
]
=
$couponPrice
;
$result['couponPrice'] = $couponPrice;
*/
}
// 发票有关数据
...
...
Please
register
or
login
to post a comment