Authored by Rock Zhang

修改订单结算页底部的价格有关信息为直接读取接口返回的数据

Code Review By Rock Zhang
... ... @@ -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);
... ...
... ... @@ -98,31 +98,12 @@
<section class="price-cal block">
<ul class="total">
{{#cartPayData}}
<li>
<span>总价</span>
&nbsp;&nbsp;¥{{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>
&nbsp;&nbsp;{{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>
&nbsp;&nbsp;¥\{{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>
&nbsp;&nbsp;\{{promotion_amount}}
</li>
\{{/cartPayData}}
</ul>
</script>
{{> layout/footer}}
... ...
... ... @@ -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;*/
}
// 发票有关数据
... ...