From b807a639664cda60e2ee0433737480561d9e9879 Mon Sep 17 00:00:00 2001
From: YunaiV <>
Date: Thu, 11 Apr 2019 19:49:58 +0800
Subject: [PATCH] =?UTF-8?q?=E5=90=8E=E7=AB=AF=20+=20=E5=89=8D=E7=AB=AF?=
=?UTF-8?q?=EF=BC=9A=E6=B7=BB=E5=8A=A0=E5=88=B0=E8=B4=AD=E7=89=A9=E8=BD=A6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
mobile-web/src/api/order.js | 21 ++++
.../src/components/common/productcard.vue | 3 +-
mobile-web/src/config/request.js | 1 +
mobile-web/src/config/router.js | 6 +-
mobile-web/src/page/cart/index.vue | 94 ++++++------------
mobile-web/src/page/product/detail.vue | 57 ++++++-----
mobile-web/src/page/shipping/order.vue | 30 ++++--
.../controller/users/UsersCartController.java | 99 ++++++++++++++++++-
.../vo/UsersOrderConfirmCreateVO.java | 9 ++
.../iocoder/mall/order/api/CartService.java | 5 +-
.../api/constant/CartItemStatusEnum.java | 46 +++++++++
.../api/constant/OrderErrorCodeEnum.java | 6 ++
.../mall/order/biz/dao/CartMapper.java | 39 ++++++++
.../mall/order/biz/dao/OrderCancelMapper.java | 1 +
.../mall/order/biz/dataobject/CartItemDO.java | 2 +-
.../order/biz/mock/ProductSpuServiceMock.java | 57 -----------
.../order/biz/service/CartServiceImpl.java | 96 ++++++++++++++++--
.../src/main/resources/mapper/CartMapper.xml | 99 +++++++++++++++++++
.../mall/product/api/ProductSpuService.java | 2 +
.../mall/product/api/bo/ProductSkuBO.java | 29 +++++-
.../product/convert/ProductSpuConvert.java | 10 +-
.../service/ProductSpuServiceImpl.java | 6 ++
22 files changed, 541 insertions(+), 177 deletions(-)
create mode 100644 order/order-service-api/src/main/java/cn/iocoder/mall/order/api/constant/CartItemStatusEnum.java
create mode 100644 order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dao/CartMapper.java
delete mode 100644 order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/mock/ProductSpuServiceMock.java
create mode 100644 order/order-service-impl/src/main/resources/mapper/CartMapper.xml
diff --git a/mobile-web/src/api/order.js b/mobile-web/src/api/order.js
index 1658558ee..0663873e6 100644
--- a/mobile-web/src/api/order.js
+++ b/mobile-web/src/api/order.js
@@ -45,3 +45,24 @@ export function createOrder(params) {
});
}
+// Cart
+
+export function addCart(skuId, quantity) {
+ return request({
+ url: '/order-api/users/cart/add',
+ method: 'post',
+ params: {
+ skuId,
+ quantity,
+ }
+ });
+}
+
+export function countCart() {
+ return request({
+ url: '/order-api/users/cart/count',
+ method: 'get',
+ params: {
+ }
+ });
+}
diff --git a/mobile-web/src/components/common/productcard.vue b/mobile-web/src/components/common/productcard.vue
index 51692d9d7..c5be62b2a 100644
--- a/mobile-web/src/components/common/productcard.vue
+++ b/mobile-web/src/components/common/productcard.vue
@@ -8,8 +8,7 @@
style="background:#fff"
>
-
-
+
diff --git a/mobile-web/src/config/request.js b/mobile-web/src/config/request.js
index 6bdbe764f..becd9ca02 100644
--- a/mobile-web/src/config/request.js
+++ b/mobile-web/src/config/request.js
@@ -208,6 +208,7 @@ service.interceptors.response.use(
// this.$router.push({ path: '/login' })
// TODO 跳转到登陆页.不是很优雅
location.replace('/#login');
+ location.reload();
}
}
});
diff --git a/mobile-web/src/config/router.js b/mobile-web/src/config/router.js
index 7c9960599..759f7183b 100644
--- a/mobile-web/src/config/router.js
+++ b/mobile-web/src/config/router.js
@@ -58,7 +58,8 @@ const routes = [
component: () => import('../page/user/info/detail'),
name: 'user',
meta: {
- title: '个人信息'
+ title: '个人信息',
+ requireAuth: true,
}
},
{
@@ -178,7 +179,8 @@ const routes = [
path: '/order',
component: () => import('../page/shipping/order'),
meta: {
- title: '确认订单'
+ title: '确认订单',
+ requireAuth: true,
}
},
{
diff --git a/mobile-web/src/page/cart/index.vue b/mobile-web/src/page/cart/index.vue
index d846f423d..3f25a72cb 100644
--- a/mobile-web/src/page/cart/index.vue
+++ b/mobile-web/src/page/cart/index.vue
@@ -6,74 +6,36 @@
全选
-
+
-
+