diff --git a/TODOs.md b/TODOs.md index 83aa2be..e86578e 100644 --- a/TODOs.md +++ b/TODOs.md @@ -2,8 +2,6 @@ 小程序提审要做的: -小程序首页密码修改 - 订单发货小程序端显示发货详情 体温上报添加一个按钮 可以删除当日填报 diff --git a/backend/microservice-common/src/main/java/com/cxyxiaomo/epp/common/pojo/Order.java b/backend/microservice-common/src/main/java/com/cxyxiaomo/epp/common/pojo/Order.java index cec7f20..96ba810 100644 --- a/backend/microservice-common/src/main/java/com/cxyxiaomo/epp/common/pojo/Order.java +++ b/backend/microservice-common/src/main/java/com/cxyxiaomo/epp/common/pojo/Order.java @@ -17,4 +17,7 @@ public class Order { private String orderStatus; private BigDecimal orderPrice; private LocalDateTime payDate; + private LocalDateTime cancelDate; + private LocalDateTime shipDate; + private LocalDateTime deliverDate; } diff --git a/backend/microservice-common/src/main/java/com/cxyxiaomo/epp/common/vo/OrderVO.java b/backend/microservice-common/src/main/java/com/cxyxiaomo/epp/common/vo/OrderVO.java index 9ff0a0d..12c2cdb 100644 --- a/backend/microservice-common/src/main/java/com/cxyxiaomo/epp/common/vo/OrderVO.java +++ b/backend/microservice-common/src/main/java/com/cxyxiaomo/epp/common/vo/OrderVO.java @@ -26,7 +26,10 @@ public class OrderVO implements Serializable { private String orderStatus; private String orderStatusCode; private String orderPrice; - private LocalDateTime payDate; + private String payDate; + private String cancelDate; + private String shipDate; + private String deliverDate; public static OrderVO convertFrom(Order order) { if (order == null) { @@ -41,6 +44,19 @@ public class OrderVO implements Serializable { orderVO.setOrderStatusCode(order.getOrderStatus()); String price = order.getOrderPrice().setScale(2, RoundingMode.FLOOR).toPlainString(); orderVO.setOrderPrice(price); + + if (order.getOrderDate() != null) { + orderVO.setPayDate(order.getOrderDate().toString().replace("T", " ")); + } + if (order.getCancelDate() != null) { + orderVO.setCancelDate(order.getCancelDate().toString().replace("T", " ")); + } + if (order.getShipDate() != null) { + orderVO.setShipDate(order.getShipDate().toString().replace("T", " ")); + } + if (order.getDeliverDate() != null) { + orderVO.setDeliverDate(order.getDeliverDate().toString().replace("T", " ")); + } return orderVO; } diff --git a/backend/microservice-gateway/src/main/java/com/cxyxiaomo/epp/gateway/controller/Controller.java b/backend/microservice-gateway/src/main/java/com/cxyxiaomo/epp/gateway/controller/Controller.java index 9c27432..97531cd 100644 --- a/backend/microservice-gateway/src/main/java/com/cxyxiaomo/epp/gateway/controller/Controller.java +++ b/backend/microservice-gateway/src/main/java/com/cxyxiaomo/epp/gateway/controller/Controller.java @@ -23,6 +23,8 @@ public class Controller { public HashMap WxMiniProgramAuditSpecialHandle() { boolean showCode = true; boolean showShop = true; + + // 底部 tabbar LinkedList tabbarItem = new LinkedList<>(); tabbarItem.push("pages/index/index"); if (showCode) tabbarItem.push("pages/residents/code"); @@ -30,12 +32,14 @@ public class Controller { if (showShop) tabbarItem.push("pages/shop/shop"); tabbarItem.push("pages/person/person"); + // 首页显示按钮 LinkedList indexItem = new LinkedList<>(); indexItem.push("/pages/index/login"); if (showCode) indexItem.push("/pages/residents/code"); if (showCode) indexItem.push("scanQRCode"); indexItem.push("/pages/residents/report"); if (showShop) indexItem.push("/pages/shop/shop"); + if (showShop) indexItem.push("/pages/shop/myOrder"); indexItem.push("/pages/person/person"); indexItem.push("/pages/person/updpwd"); diff --git a/backend/microservice-provider-shop-8003/src/main/java/com/cxyxiaomo/epp/shop/dao/OrderDao.java b/backend/microservice-provider-shop-8003/src/main/java/com/cxyxiaomo/epp/shop/dao/OrderDao.java index 352fa73..37ef678 100644 --- a/backend/microservice-provider-shop-8003/src/main/java/com/cxyxiaomo/epp/shop/dao/OrderDao.java +++ b/backend/microservice-provider-shop-8003/src/main/java/com/cxyxiaomo/epp/shop/dao/OrderDao.java @@ -57,7 +57,7 @@ public interface OrderDao { * 更新订单状态 * * @param orderId - * @param status + * @param orderStatus * @return */ int updateOrderStatus(@Param("orderId") Long orderId, @Param("orderStatus") String orderStatus); diff --git a/backend/microservice-provider-shop-8003/src/main/resources/mybatis/mapper/OrderMapper.xml b/backend/microservice-provider-shop-8003/src/main/resources/mybatis/mapper/OrderMapper.xml index e181f24..17c2553 100644 --- a/backend/microservice-provider-shop-8003/src/main/resources/mybatis/mapper/OrderMapper.xml +++ b/backend/microservice-provider-shop-8003/src/main/resources/mybatis/mapper/OrderMapper.xml @@ -9,6 +9,11 @@ + + + + + @@ -68,6 +73,22 @@ UPDATE `order` SET order_status = #{orderStatus} + # 如果取消订单,那么更新 cancel_date + + , cancel_date = CURRENT_TIMESTAMP + + # 如果支付完成,那么更新 pay_date + + , pay_date = CURRENT_TIMESTAMP + + # 如果已经发货,那么更新 ship_date + + , ship_date = CURRENT_TIMESTAMP + + # 如果已经确认收货,那么更新 deliver_date + + , deliver_date = CURRENT_TIMESTAMP + WHERE id = #{orderId} LIMIT 1 diff --git a/database/epp.sql b/database/epp.sql index 677482a..9be2c43 100644 --- a/database/epp.sql +++ b/database/epp.sql @@ -11,7 +11,7 @@ Target Server Version : 80012 File Encoding : 65001 - Date: 17/04/2023 00:21:11 + Date: 17/04/2023 22:15:30 */ SET NAMES utf8mb4; @@ -302,6 +302,9 @@ CREATE TABLE `order` ( `order_status` enum('Pending','Processing','Shipped','Delivered','Cancelled') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '订单状态', `order_price` decimal(10, 2) NOT NULL COMMENT '订单总金额', `pay_date` datetime NULL DEFAULT NULL COMMENT '订单支付时间', + `cancel_date` datetime NULL DEFAULT NULL COMMENT '订单取消时间', + `ship_date` datetime NULL DEFAULT NULL COMMENT '订单发货时间', + `deliver_date` datetime NULL DEFAULT NULL COMMENT '订单送达时间', PRIMARY KEY (`id`) USING BTREE, UNIQUE INDEX `id`(`id`) USING BTREE, INDEX `user_id`(`user_id`) USING BTREE @@ -310,21 +313,21 @@ CREATE TABLE `order` ( -- ---------------------------- -- Records of order -- ---------------------------- -INSERT INTO `order` VALUES (1748800678865801225, 3, '2023-03-21 15:50:19', 'Pending', 21.99, NULL); -INSERT INTO `order` VALUES (1749495597129404427, 3, '2023-03-21 16:30:54', 'Pending', 5.99, NULL); -INSERT INTO `order` VALUES (1749495896040673288, 3, '2023-03-21 16:32:06', 'Pending', 5.99, NULL); -INSERT INTO `order` VALUES (1749496012575215624, 3, '2023-03-21 16:32:33', 'Pending', 17.97, NULL); -INSERT INTO `order` VALUES (1750312359831932932, 3, '2023-03-23 22:36:26', 'Cancelled', 87.50, NULL); -INSERT INTO `order` VALUES (1750312445567700999, 3, '2023-03-23 22:36:46', 'Processing', 87.50, NULL); -INSERT INTO `order` VALUES (1750313361633054722, 3, '2023-03-23 22:40:25', 'Processing', 2.50, NULL); -INSERT INTO `order` VALUES (1758148329772027912, 3, '2023-04-14 13:33:47', 'Pending', 2.00, NULL); -INSERT INTO `order` VALUES (1758148627185930246, 3, '2023-04-14 13:34:58', 'Cancelled', 2.00, NULL); -INSERT INTO `order` VALUES (1758148669368045578, 3, '2023-04-14 13:35:08', 'Processing', 3.00, NULL); -INSERT INTO `order` VALUES (1758659566150750208, 3, '2023-04-15 23:25:15', 'Processing', 19.90, NULL); -INSERT INTO `order` VALUES (1758659642495471619, 3, '2023-04-15 23:25:33', 'Processing', 138.00, NULL); -INSERT INTO `order` VALUES (1758659766395211784, 3, '2023-04-15 23:26:03', 'Processing', 59.80, NULL); -INSERT INTO `order` VALUES (1758659860087574537, 3, '2023-04-15 23:26:25', 'Processing', 98.00, NULL); -INSERT INTO `order` VALUES (1758660000932302858, 3, '2023-04-15 23:26:59', 'Processing', 37932.00, NULL); +INSERT INTO `order` VALUES (1748800678865801225, 3, '2023-03-21 15:50:19', 'Pending', 21.99, NULL, NULL, NULL, NULL); +INSERT INTO `order` VALUES (1749495597129404427, 3, '2023-03-21 16:30:54', 'Processing', 5.99, '2023-04-17 21:57:45', NULL, NULL, NULL); +INSERT INTO `order` VALUES (1749495896040673288, 3, '2023-03-21 16:32:06', 'Pending', 5.99, NULL, NULL, NULL, NULL); +INSERT INTO `order` VALUES (1749496012575215624, 3, '2023-03-21 16:32:33', 'Pending', 17.97, NULL, NULL, NULL, NULL); +INSERT INTO `order` VALUES (1750312359831932932, 3, '2023-03-23 22:36:26', 'Cancelled', 87.50, NULL, NULL, NULL, NULL); +INSERT INTO `order` VALUES (1750312445567700999, 3, '2023-03-23 22:36:46', 'Processing', 87.50, NULL, NULL, NULL, NULL); +INSERT INTO `order` VALUES (1750313361633054722, 3, '2023-03-23 22:40:25', 'Processing', 2.50, NULL, NULL, NULL, NULL); +INSERT INTO `order` VALUES (1758148329772027912, 3, '2023-04-14 13:33:47', 'Pending', 2.00, NULL, NULL, NULL, NULL); +INSERT INTO `order` VALUES (1758148627185930246, 3, '2023-04-14 13:34:58', 'Cancelled', 2.00, NULL, NULL, NULL, NULL); +INSERT INTO `order` VALUES (1758148669368045578, 3, '2023-04-14 13:35:08', 'Processing', 3.00, NULL, NULL, NULL, NULL); +INSERT INTO `order` VALUES (1758659566150750208, 3, '2023-04-15 23:25:15', 'Processing', 19.90, NULL, NULL, NULL, NULL); +INSERT INTO `order` VALUES (1758659642495471619, 3, '2023-04-15 23:25:33', 'Processing', 138.00, NULL, NULL, NULL, NULL); +INSERT INTO `order` VALUES (1758659766395211784, 3, '2023-04-15 23:26:03', 'Processing', 59.80, NULL, NULL, NULL, NULL); +INSERT INTO `order` VALUES (1758659860087574537, 3, '2023-04-15 23:26:25', 'Processing', 98.00, NULL, NULL, NULL, NULL); +INSERT INTO `order` VALUES (1758660000932302858, 3, '2023-04-15 23:26:59', 'Processing', 37932.00, NULL, NULL, NULL, NULL); -- ---------------------------- -- Table structure for order_detail @@ -453,14 +456,14 @@ CREATE TABLE `user` ( PRIMARY KEY (`id`) USING BTREE, UNIQUE INDEX `username`(`username`) USING BTREE, UNIQUE INDEX `wx_code`(`wx_code`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 23 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC; +) ENGINE = InnoDB AUTO_INCREMENT = 30 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC; -- ---------------------------- -- Records of user -- ---------------------------- INSERT INTO `user` VALUES (1, 'root', '99adc231b045331e514a516b4b7680f588e3823213abe901738bc3ad67b2f6fcb3c64efb93d18002588d3ccc1a49efbae1ce20cb43df36b38651f11fa75678e8', '管理员 密码root', '420111111111111112', '18911111111', 1, '28-1', '1101', '1', NULL, NULL); INSERT INTO `user` VALUES (2, 'admin', 'c7ad44cbad762a5da0a452f9e854fdc1e0e7a52a38015f23f3eab1d80b931dd472634dfac71cd34ebc35d16ab7fb8a90c81f975113d6c7538dc69dd8de9077ec', '社区管理员 密码admin', '420111111111111111', '027-22222121', 2, '16-3', '0203', '1', NULL, NULL); -INSERT INTO `user` VALUES (3, 'user', 'b14361404c078ffd549c03db443c3fede2f3e534d73f78f77301ed97d4a436a9fd9db05ee8b325c0ad36438b43fec8510c204fc1c1edb21d0941c00e9e2c1ce2', '用户 密码user', '420111111111111111', '18911111111', 3, '20-2', '0802', '1', NULL, NULL); +INSERT INTO `user` VALUES (3, 'user', 'b14361404c078ffd549c03db443c3fede2f3e534d73f78f77301ed97d4a436a9fd9db05ee8b325c0ad36438b43fec8510c204fc1c1edb21d0941c00e9e2c1ce2', '用户 密码user', '420111111111111111', '18911111111', 3, '20-2', '0802', '1', NULL, 'oFzuC4pvbPzY7vI6vmP6_57iTk-U'); INSERT INTO `user` VALUES (4, 'user2', 'b14361404c078ffd549c03db443c3fede2f3e534d73f78f77301ed97d4a436a9fd9db05ee8b325c0ad36438b43fec8510c204fc1c1edb21d0941c00e9e2c1ce2', '用户2 密码user', '420111111111111111', '027-22222121', 3, '20-2', '0802', '1', NULL, NULL); INSERT INTO `user` VALUES (5, 'user3', 'b14361404c078ffd549c03db443c3fede2f3e534d73f78f77301ed97d4a436a9fd9db05ee8b325c0ad36438b43fec8510c204fc1c1edb21d0941c00e9e2c1ce2', '用户3 密码user', '420111111111111111', '112', 3, '20-2', '0802', '1', NULL, NULL); INSERT INTO `user` VALUES (6, 'user4', 'b14361404c078ffd549c03db443c3fede2f3e534d73f78f77301ed97d4a436a9fd9db05ee8b325c0ad36438b43fec8510c204fc1c1edb21d0941c00e9e2c1ce2', '用户4 密码user', '420111111111111111', '112', 3, '20-2', '0802', '1', NULL, NULL); @@ -478,8 +481,7 @@ INSERT INTO `user` VALUES (18, 'dgciqwqhj', 'bec427eb1d7767afd214f6524f5aebc07e1 INSERT INTO `user` VALUES (19, 'cm', '105056cce8fc85bdbecaed247db90332cf785c8fed9cbcb71dba57187aded6b81d049679a9b56155716c9e47958bc676722985956d0ab2fd040ae0e8cdb7720f', '指及价常件', '124677736597155066', '05961067874', 3, '54-64', '1370', '1', NULL, NULL); INSERT INTO `user` VALUES (20, 'fcslfbk', '975c3a52d5435ae60a6f30f4572e754ab458613d0d6c309783bde047198f7944b75b54a62cfbae58594f30573717882aca9bebcccb3ade84fdd5a7d2dd9a0c0f', '集命问已土美石日', '464715523910577877', '0785-3674834', 4, '63-94', '2420', '1', NULL, NULL); INSERT INTO `user` VALUES (21, 'vrk', 'f7e3fa3af542e7dd3960069eebb22b5e76adb57e5cf1df0ef0da5cea79e3e8f1a8414b612ebc6f4f08e64bddce070c7e6e55a8f4c098f90145b476acdd3f2808', '称红', '441911654591292', '17474066066', 2, '22-23', '7866', '1', NULL, NULL); -INSERT INTO `user` VALUES (23, '1723787d-7', 'de7c6d14-c62d-40da-bd86-54eb136c80a4', '微信用户17237', NULL, NULL, 3, NULL, NULL, '1', NULL, NULL); -INSERT INTO `user` VALUES (29, '3595009cab', 'f5ab242d-ba78-4437-814f-5cf75d99918a', '微信用户35950', NULL, NULL, 3, NULL, NULL, '1', NULL, 'oFzuC4pvbPzY7vI6vmP6_57iTk-U'); +INSERT INTO `user` VALUES (29, '3595009cab', '4dff4ea340f0a823f15d3f4f01ab62eae0e5da579ccb851f8db9dfe84c58b2b37b89903a740e1ee172da793a6e79d560e5f7f9bd058a12a280433ed6fa46510a', '微信用户35950', NULL, NULL, 3, NULL, NULL, '1', NULL, ''); -- ---------------------------- -- Table structure for visitor1 diff --git a/weixin-miniprogram/image/icon/order.svg b/weixin-miniprogram/image/icon/order.svg new file mode 100644 index 0000000..a5cd3fb --- /dev/null +++ b/weixin-miniprogram/image/icon/order.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/weixin-miniprogram/pages/shop/orderDetail.wxml b/weixin-miniprogram/pages/shop/orderDetail.wxml index 03186b2..2bf8e00 100644 --- a/weixin-miniprogram/pages/shop/orderDetail.wxml +++ b/weixin-miniprogram/pages/shop/orderDetail.wxml @@ -38,10 +38,13 @@ 订单号:{{order.id}} - 订单创建时间:{{orderTime}} - 订单支付时间:{{order.payDate}} 订单总金额:{{order.orderPrice}} 元 订单状态:{{order.orderStatus}} + 订单创建时间:{{orderTime}} + 订单支付时间:{{order.payDate}} + 订单取消时间:{{order.cancelDate}} + 订单发货时间:{{order.shipDate}} + 确认收货时间:{{order.deliverDate}} 订单详情 diff --git a/weixin-miniprogram/utils/menuList.js b/weixin-miniprogram/utils/menuList.js index afc2981..4a5a0aa 100644 --- a/weixin-miniprogram/utils/menuList.js +++ b/weixin-miniprogram/utils/menuList.js @@ -39,6 +39,13 @@ let menuItemDict = { switchFunc: switchTab, url: '/pages/shop/shop' }, + 'myOrder': { + for: ['user'], + title: "我的订单", + image: "order.svg", + switchFunc: navigateTo, + url: '/pages/shop/myOrder' + }, // 'apply-record': { // for: ['visitor'], // title: "申请记录",