前端:商品订单价格修复
This commit is contained in:
parent
8e38bf000c
commit
6fdec47430
@ -72,7 +72,7 @@ const OrderContent = props => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const renderGoods = orderItems => {
|
const renderGoods = orderItems => {
|
||||||
return orderItems.map(({ skuName, skuImage, quantity, price }) => {
|
return orderItems.map(({ skuName, skuImage, quantity, presentPrice, presentTotal }) => {
|
||||||
return (
|
return (
|
||||||
<div key={skuName} className={styles.orderGoods}>
|
<div key={skuName} className={styles.orderGoods}>
|
||||||
<img alt={skuName} className={`${styles.image}`} src={skuImage} />
|
<img alt={skuName} className={`${styles.image}`} src={skuImage} />
|
||||||
@ -84,7 +84,7 @@ const OrderContent = props => {
|
|||||||
<div className={styles.contentItem}>
|
<div className={styles.contentItem}>
|
||||||
<div>{quantity}件</div>
|
<div>{quantity}件</div>
|
||||||
<div>
|
<div>
|
||||||
{price / 100} 元/{quantity * (price / 100)} 元
|
{presentPrice / 100.0} 元/{presentTotal / 100.0} 元
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -114,7 +114,7 @@ const OrderContent = props => {
|
|||||||
</div>
|
</div>
|
||||||
<div className={styles.contentItem}>
|
<div className={styles.contentItem}>
|
||||||
<div className={styles.columnName}>(实付金额)</div>
|
<div className={styles.columnName}>(实付金额)</div>
|
||||||
<div>{payAmount / 100}元</div>
|
<div>{item.presentPrice / 100}元</div>
|
||||||
<div>
|
<div>
|
||||||
{status === 1 ? <a onClick={() => handleUpdatePayAmount(props)}>修改价格</a> : ''}
|
{status === 1 ? <a onClick={() => handleUpdatePayAmount(props)}>修改价格</a> : ''}
|
||||||
</div>
|
</div>
|
||||||
|
@ -190,14 +190,6 @@ const routes = [
|
|||||||
requireAuth: true,
|
requireAuth: true,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
path: '/order/success',
|
|
||||||
component: () => import('../page/shipping/order-success'),
|
|
||||||
meta: {
|
|
||||||
title: '确认订单',
|
|
||||||
requireAuth: true,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: 'category',
|
name: 'category',
|
||||||
component: () => import('../page/category/index'),
|
component: () => import('../page/category/index'),
|
||||||
|
@ -19,8 +19,10 @@
|
|||||||
<div style="margin: 10px;">
|
<div style="margin: 10px;">
|
||||||
<van-button size="large" type="primary" style="height: 45px;line-height:45px;" @click="submit">登录</van-button>
|
<van-button size="large" type="primary" style="height: 45px;line-height:45px;" @click="submit">登录</van-button>
|
||||||
</div>
|
</div>
|
||||||
<div>1. 新注册的手机号验证后自动创建账户</div>
|
<van-panel title="友情提示">
|
||||||
<div>2. 默认验证码是 9999</div>
|
<van-cell>1. 新注册的手机号验证后自动创建账户</van-cell>
|
||||||
|
<van-cell>2. 默认验证码是 9999</van-cell>
|
||||||
|
</van-panel>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,35 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="order-success">
|
|
||||||
<headerNav title="提交成功"/>
|
|
||||||
|
|
||||||
<sapn>TODO 支付成功</sapn>
|
|
||||||
|
|
||||||
<router-link :to="'/user/order'">
|
|
||||||
<van-button size="small" type="danger">订单列表</van-button>
|
|
||||||
</router-link>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
|
|
||||||
import {createOrder} from '../../api/order';
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
|
|
||||||
},
|
|
||||||
activated() {
|
|
||||||
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="less">
|
|
||||||
.order-success {
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -177,24 +177,26 @@
|
|||||||
}).then(result => {
|
}).then(result => {
|
||||||
if (result) {
|
if (result) {
|
||||||
// const { orderNo } = result;
|
// const { orderNo } = result;
|
||||||
this.$router.push({ //核心语句
|
// this.$router.push({ //核心语句
|
||||||
path:`/order/success`, //跳转的路径
|
// path:`/order/success`, //跳转的路径
|
||||||
query:{ //路由传参时push和query搭配使用 ,作用时传递参数
|
// query:{ //路由传参时push和query搭配使用 ,作用时传递参数
|
||||||
...result,
|
// ...result,
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
|
this.$router.push('/pay?appId=POd4RC6a&orderId=' + result.id + '&returnUrl=' + encodeURI('/user/order/info/' + result.id));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else if (this.from === 'cart') {
|
} else if (this.from === 'cart') {
|
||||||
createOrderFromCart(userAddressId, couponCardId, remark).then(result => {
|
createOrderFromCart(userAddressId, couponCardId, remark).then(result => {
|
||||||
if (result) {
|
if (result) {
|
||||||
// const { orderNo } = result;
|
// const { orderNo } = result;
|
||||||
this.$router.push({ //核心语句
|
// this.$router.push({ //核心语句
|
||||||
path:`/order/success`, //跳转的路径
|
// path:`/order/success`, //跳转的路径
|
||||||
query:{ //路由传参时push和query搭配使用 ,作用时传递参数
|
// query:{ //路由传参时push和query搭配使用 ,作用时传递参数
|
||||||
...result,
|
// ...result,
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
|
this.$router.push('/pay?appId=POd4RC6a&orderId=' + result.id + '&returnUrl=' + encodeURI('/user/order/info/' + result.id));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -45,13 +45,36 @@ public class OrderItemBO implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private Integer quantity;
|
private Integer quantity;
|
||||||
/**
|
/**
|
||||||
* 价格(分)
|
* 原始单价,单位:分。
|
||||||
*/
|
*/
|
||||||
private Integer price;
|
private Integer originPrice;
|
||||||
/**
|
/**
|
||||||
* 支付金额(实付金额)
|
* 购买单价,单位:分
|
||||||
*/
|
*/
|
||||||
private Integer payAmount;
|
private Integer buyPrice;
|
||||||
|
/**
|
||||||
|
* 最终价格,单位:分。
|
||||||
|
*/
|
||||||
|
private Integer presentPrice;
|
||||||
|
/**
|
||||||
|
* 购买总金额,单位:分
|
||||||
|
*
|
||||||
|
* 用途类似 {@link #presentTotal}
|
||||||
|
*/
|
||||||
|
private Integer buyTotal;
|
||||||
|
/**
|
||||||
|
* 优惠总金额,单位:分。
|
||||||
|
*/
|
||||||
|
private Integer discountTotal;
|
||||||
|
/**
|
||||||
|
* 最终总金额,单位:分。
|
||||||
|
*
|
||||||
|
* 注意,presentPrice * quantity 不一定等于 presentTotal 。
|
||||||
|
* 因为,存在无法整除的情况。
|
||||||
|
* 举个例子,presentPrice = 8.33 ,quantity = 3 的情况,presentTotal 有可能是 24.99 ,也可能是 25 。
|
||||||
|
* 所以,需要存储一个该字段。
|
||||||
|
*/
|
||||||
|
private Integer presentTotal;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// 时间信息
|
/// 时间信息
|
||||||
|
@ -343,8 +343,8 @@ public class OrderServiceImpl implements OrderService {
|
|||||||
.setUserId(orderCreateDTO.getUserId())
|
.setUserId(orderCreateDTO.getUserId())
|
||||||
.setItems(new ArrayList<>(skus.size()))
|
.setItems(new ArrayList<>(skus.size()))
|
||||||
.setCouponCardId(orderCreateDTO.getCouponCardId());
|
.setCouponCardId(orderCreateDTO.getCouponCardId());
|
||||||
for (ProductSkuDetailBO item : skus) {
|
for (OrderCreateItemDTO item : orderCreateDTO.getOrderItems()) {
|
||||||
calcOrderPriceDTO.getItems().add(new CalcOrderPriceDTO.Item(item.getId(), item.getQuantity(), true));
|
calcOrderPriceDTO.getItems().add(new CalcOrderPriceDTO.Item(item.getSkuId(), item.getQuantity(), true));
|
||||||
}
|
}
|
||||||
// 执行计算
|
// 执行计算
|
||||||
return cartService.calcOrderPrice(calcOrderPriceDTO);
|
return cartService.calcOrderPrice(calcOrderPriceDTO);
|
||||||
|
Loading…
Reference in New Issue
Block a user