From 6fdec4743088a36f72ff58ef8c818edddf108b64 Mon Sep 17 00:00:00 2001
From: YunaiV <>
Date: Mon, 22 Apr 2019 22:43:40 +0800
Subject: [PATCH] =?UTF-8?q?=E5=89=8D=E7=AB=AF=EF=BC=9A=E5=95=86=E5=93=81?=
=?UTF-8?q?=E8=AE=A2=E5=8D=95=E4=BB=B7=E6=A0=BC=E4=BF=AE=E5=A4=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
admin-web/src/pages/Order/OrderList.js | 6 ++--
mobile-web/src/config/router.js | 8 -----
mobile-web/src/page/account/phonelogin.vue | 6 ++--
.../src/page/shipping/order-success.vue | 35 -------------------
mobile-web/src/page/shipping/order.vue | 26 +++++++-------
.../mall/order/api/bo/OrderItemBO.java | 31 +++++++++++++---
.../order/biz/service/OrderServiceImpl.java | 4 +--
7 files changed, 50 insertions(+), 66 deletions(-)
delete mode 100644 mobile-web/src/page/shipping/order-success.vue
diff --git a/admin-web/src/pages/Order/OrderList.js b/admin-web/src/pages/Order/OrderList.js
index c527b88f2..35a0f93c0 100644
--- a/admin-web/src/pages/Order/OrderList.js
+++ b/admin-web/src/pages/Order/OrderList.js
@@ -72,7 +72,7 @@ const OrderContent = props => {
};
const renderGoods = orderItems => {
- return orderItems.map(({ skuName, skuImage, quantity, price }) => {
+ return orderItems.map(({ skuName, skuImage, quantity, presentPrice, presentTotal }) => {
return (
@@ -84,7 +84,7 @@ const OrderContent = props => {
{quantity}件
- {price / 100} 元/{quantity * (price / 100)} 元
+ {presentPrice / 100.0} 元/{presentTotal / 100.0} 元
@@ -114,7 +114,7 @@ const OrderContent = props => {
(实付金额)
-
{payAmount / 100}元
+
{item.presentPrice / 100}元
diff --git a/mobile-web/src/config/router.js b/mobile-web/src/config/router.js
index d00ed074d..4e492d8c8 100644
--- a/mobile-web/src/config/router.js
+++ b/mobile-web/src/config/router.js
@@ -190,14 +190,6 @@ const routes = [
requireAuth: true,
}
},
- {
- path: '/order/success',
- component: () => import('../page/shipping/order-success'),
- meta: {
- title: '确认订单',
- requireAuth: true,
- }
- },
{
name: 'category',
component: () => import('../page/category/index'),
diff --git a/mobile-web/src/page/account/phonelogin.vue b/mobile-web/src/page/account/phonelogin.vue
index 6fe20cb64..66bf1921c 100644
--- a/mobile-web/src/page/account/phonelogin.vue
+++ b/mobile-web/src/page/account/phonelogin.vue
@@ -19,8 +19,10 @@
登录
-
1. 新注册的手机号验证后自动创建账户
-
2. 默认验证码是 9999
+
+ 1. 新注册的手机号验证后自动创建账户
+ 2. 默认验证码是 9999
+
diff --git a/mobile-web/src/page/shipping/order-success.vue b/mobile-web/src/page/shipping/order-success.vue
deleted file mode 100644
index 244ea54f0..000000000
--- a/mobile-web/src/page/shipping/order-success.vue
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
- TODO 支付成功
-
-
- 订单列表
-
-
-
-
-
-
-
diff --git a/mobile-web/src/page/shipping/order.vue b/mobile-web/src/page/shipping/order.vue
index 641500065..993e4699e 100644
--- a/mobile-web/src/page/shipping/order.vue
+++ b/mobile-web/src/page/shipping/order.vue
@@ -177,24 +177,26 @@
}).then(result => {
if (result) {
// const { orderNo } = result;
- this.$router.push({ //核心语句
- path:`/order/success`, //跳转的路径
- query:{ //路由传参时push和query搭配使用 ,作用时传递参数
- ...result,
- }
- });
+ // this.$router.push({ //核心语句
+ // path:`/order/success`, //跳转的路径
+ // query:{ //路由传参时push和query搭配使用 ,作用时传递参数
+ // ...result,
+ // }
+ // });
+ this.$router.push('/pay?appId=POd4RC6a&orderId=' + result.id + '&returnUrl=' + encodeURI('/user/order/info/' + result.id));
}
});
} else if (this.from === 'cart') {
createOrderFromCart(userAddressId, couponCardId, remark).then(result => {
if (result) {
// const { orderNo } = result;
- this.$router.push({ //核心语句
- path:`/order/success`, //跳转的路径
- query:{ //路由传参时push和query搭配使用 ,作用时传递参数
- ...result,
- }
- });
+ // this.$router.push({ //核心语句
+ // path:`/order/success`, //跳转的路径
+ // query:{ //路由传参时push和query搭配使用 ,作用时传递参数
+ // ...result,
+ // }
+ // });
+ this.$router.push('/pay?appId=POd4RC6a&orderId=' + result.id + '&returnUrl=' + encodeURI('/user/order/info/' + result.id));
}
});
}
diff --git a/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/OrderItemBO.java b/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/OrderItemBO.java
index 3a6d196c4..e7e61392c 100644
--- a/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/OrderItemBO.java
+++ b/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/bo/OrderItemBO.java
@@ -45,13 +45,36 @@ public class OrderItemBO implements Serializable {
*/
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;
///
/// 时间信息
diff --git a/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/service/OrderServiceImpl.java b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/service/OrderServiceImpl.java
index 38057ff5b..89e6594f0 100644
--- a/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/service/OrderServiceImpl.java
+++ b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/service/OrderServiceImpl.java
@@ -343,8 +343,8 @@ public class OrderServiceImpl implements OrderService {
.setUserId(orderCreateDTO.getUserId())
.setItems(new ArrayList<>(skus.size()))
.setCouponCardId(orderCreateDTO.getCouponCardId());
- for (ProductSkuDetailBO item : skus) {
- calcOrderPriceDTO.getItems().add(new CalcOrderPriceDTO.Item(item.getId(), item.getQuantity(), true));
+ for (OrderCreateItemDTO item : orderCreateDTO.getOrderItems()) {
+ calcOrderPriceDTO.getItems().add(new CalcOrderPriceDTO.Item(item.getSkuId(), item.getQuantity(), true));
}
// 执行计算
return cartService.calcOrderPrice(calcOrderPriceDTO);