From 4590a4569ebd24e522861a8aa80735cd058b112f Mon Sep 17 00:00:00 2001 From: GuoQiYu <2478948023@qq.com> Date: Sat, 10 Apr 2021 22:45:29 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.js | 3 - src/router/modules/center.js | 6 + src/router/modules/myOrder.js | 19 -- src/views/Center/MyOrder/MyOrderCancelled.vue | 6 - src/views/Center/MyOrder/MyOrderComplated.vue | 6 - src/views/Center/MyOrder/MyOrderDetail.vue | 194 ++++++++++++++++++ src/views/Center/MyOrder/MyOrderToPay.vue | 6 - src/views/Center/MyOrder/MyOrders.vue | 159 ++++++++++---- 8 files changed, 316 insertions(+), 83 deletions(-) delete mode 100644 src/router/modules/myOrder.js delete mode 100644 src/views/Center/MyOrder/MyOrderCancelled.vue delete mode 100644 src/views/Center/MyOrder/MyOrderComplated.vue create mode 100644 src/views/Center/MyOrder/MyOrderDetail.vue delete mode 100644 src/views/Center/MyOrder/MyOrderToPay.vue diff --git a/src/router/index.js b/src/router/index.js index ecb2090..5d85f59 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -3,7 +3,6 @@ import VueRouter from 'vue-router' import Index from "./modules/index.js" import Center from "./modules/center.js" -import MyOrder from "./modules/myOrder.js" import MyBooking from "./modules/myBooking.js" import OrderConfirm from "./modules/orderConfirm.js" Vue.use(VueRouter) @@ -13,8 +12,6 @@ const routes = [ ...Index, // 我的模块 ...Center, - // 我的订餐模块 - ...MyOrder, // 我的餐桌预定模块 ...MyBooking, // 订单确认模块 diff --git a/src/router/modules/center.js b/src/router/modules/center.js index f9dfab6..d13d0e9 100644 --- a/src/router/modules/center.js +++ b/src/router/modules/center.js @@ -3,6 +3,7 @@ import Center from "@/views/Center/Center.vue" import MyBookings from "@/views/Center/MyBooking/MyBookings.vue" import MyCoupons from "@/views/Center/MyCoupons.vue" import MyOrders from "@/views/Center/MyOrder/MyOrders.vue" +import MyOrderDetail from "@/views/Center/MyOrder/MyOrderDetail.vue" export default [ { @@ -20,5 +21,10 @@ export default [ { path:"/myorders", component:MyOrders + }, + { + path:"/myorderdetail", + name:"myorderdetail", + component:MyOrderDetail } ] \ No newline at end of file diff --git a/src/router/modules/myOrder.js b/src/router/modules/myOrder.js deleted file mode 100644 index d8186bd..0000000 --- a/src/router/modules/myOrder.js +++ /dev/null @@ -1,19 +0,0 @@ -// 我的=>我的订单 模块 -import MyOrderCancelled from "@/views/Center/MyOrder/MyOrderCancelled.vue" -import MyOrderComplated from "@/views/Center/MyOrder/MyOrderComplated.vue" -import MyOrderToPay from "@/views/Center/MyOrder/MyOrderToPay.vue" - -export default [ - { - path:"/myordercancelled", - component:MyOrderCancelled - }, - { - path:"/myordercomplated", - component:MyOrderComplated - }, - { - path:"/myordertopay", - component:MyOrderToPay - } -] \ No newline at end of file diff --git a/src/views/Center/MyOrder/MyOrderCancelled.vue b/src/views/Center/MyOrder/MyOrderCancelled.vue deleted file mode 100644 index c564d74..0000000 --- a/src/views/Center/MyOrder/MyOrderCancelled.vue +++ /dev/null @@ -1,6 +0,0 @@ - \ No newline at end of file diff --git a/src/views/Center/MyOrder/MyOrderComplated.vue b/src/views/Center/MyOrder/MyOrderComplated.vue deleted file mode 100644 index a6fc0b8..0000000 --- a/src/views/Center/MyOrder/MyOrderComplated.vue +++ /dev/null @@ -1,6 +0,0 @@ - \ No newline at end of file diff --git a/src/views/Center/MyOrder/MyOrderDetail.vue b/src/views/Center/MyOrder/MyOrderDetail.vue new file mode 100644 index 0000000..f8985e3 --- /dev/null +++ b/src/views/Center/MyOrder/MyOrderDetail.vue @@ -0,0 +1,194 @@ + + + \ No newline at end of file diff --git a/src/views/Center/MyOrder/MyOrderToPay.vue b/src/views/Center/MyOrder/MyOrderToPay.vue deleted file mode 100644 index 8bac67f..0000000 --- a/src/views/Center/MyOrder/MyOrderToPay.vue +++ /dev/null @@ -1,6 +0,0 @@ - \ No newline at end of file diff --git a/src/views/Center/MyOrder/MyOrders.vue b/src/views/Center/MyOrder/MyOrders.vue index b46c91b..769ff4c 100644 --- a/src/views/Center/MyOrder/MyOrders.vue +++ b/src/views/Center/MyOrder/MyOrders.vue @@ -3,7 +3,7 @@
-
+
{{foodNameConcat(item.FoodList)}}
@@ -14,10 +14,16 @@
-
+
- +
应付金额:¥10
+
+
删除订单
+
取消订单
+
立即付款
+
+
@@ -49,15 +55,41 @@ export default { components:{ Coupon }, + computed:{ + filterList(){ + return (index)=>{ + let list=['all','topay','complated','cancelled'] + let state=list[index] + return this.ordersList.filter((item)=>{ + return state=="all"||item.orderSrate==state + }) + } + + } + }, methods:{ dateFormat(date){ return date.getFullYear()+"-"+date.getMonth()+"-"+date.getDate() }, foodNameConcat(list){ return list.reduce((total,item)=>{ + let arr=['topay','cancelled','complated'] return total+" "+item.foodName },"") + }, + onDeleteOrder(item){ + let order=item + let index=this.ordersList.indexOf(item) + this.$delete(this.ordersList,index) + }, + onCancelOrder(item){ + item.orderSrate='cancelled' + }, + toDefail(item){ + console.log(this.$router); + this.$router.push({name:'myorderdetail',params:{orderList:item}}) } + }, created(){ this.$http.get("https://www.fastmock.site/mock/0986597585a34d83a11da7a620d2fec3/food/myorder") @@ -69,59 +101,100 @@ export default { \ No newline at end of file -- Gitee From cf28e6c880943a393fbe8b258c93f89d7c1abadb Mon Sep 17 00:00:00 2001 From: GuoQiYu <2478948023@qq.com> Date: Sun, 11 Apr 2021 15:44:33 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E9=A2=84=E7=BA=A6=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.js | 3 - src/router/modules/center.js | 6 + .../Center/MyBooking/MyBookingCancelled.vue | 6 - .../Center/MyBooking/MyBookingComplated.vue | 6 - .../Center/MyBooking/MyBookingDetail.vue | 123 ++++++++++++++++++ .../Center/MyBooking/MyBookingSuccess.vue | 6 - src/views/Center/MyBooking/MyBookingWait.vue | 6 - src/views/Center/MyOrder/MyOrderDetail.vue | 5 +- 8 files changed, 132 insertions(+), 29 deletions(-) delete mode 100644 src/views/Center/MyBooking/MyBookingCancelled.vue delete mode 100644 src/views/Center/MyBooking/MyBookingComplated.vue create mode 100644 src/views/Center/MyBooking/MyBookingDetail.vue delete mode 100644 src/views/Center/MyBooking/MyBookingSuccess.vue delete mode 100644 src/views/Center/MyBooking/MyBookingWait.vue diff --git a/src/router/index.js b/src/router/index.js index 5d85f59..03b8dc9 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -3,7 +3,6 @@ import VueRouter from 'vue-router' import Index from "./modules/index.js" import Center from "./modules/center.js" -import MyBooking from "./modules/myBooking.js" import OrderConfirm from "./modules/orderConfirm.js" Vue.use(VueRouter) @@ -12,8 +11,6 @@ const routes = [ ...Index, // 我的模块 ...Center, - // 我的餐桌预定模块 - ...MyBooking, // 订单确认模块 ...OrderConfirm, // 重定向 diff --git a/src/router/modules/center.js b/src/router/modules/center.js index d13d0e9..9c60a42 100644 --- a/src/router/modules/center.js +++ b/src/router/modules/center.js @@ -4,6 +4,7 @@ import MyBookings from "@/views/Center/MyBooking/MyBookings.vue" import MyCoupons from "@/views/Center/MyCoupons.vue" import MyOrders from "@/views/Center/MyOrder/MyOrders.vue" import MyOrderDetail from "@/views/Center/MyOrder/MyOrderDetail.vue" +import MyBookingDetail from "@/views/Center/MyBooking/MyBookingDetail.vue" export default [ { @@ -26,5 +27,10 @@ export default [ path:"/myorderdetail", name:"myorderdetail", component:MyOrderDetail + }, + { + path:"/mybookingdetail", + name:"mybookingdetail", + component:MyBookingDetail } ] \ No newline at end of file diff --git a/src/views/Center/MyBooking/MyBookingCancelled.vue b/src/views/Center/MyBooking/MyBookingCancelled.vue deleted file mode 100644 index 712892b..0000000 --- a/src/views/Center/MyBooking/MyBookingCancelled.vue +++ /dev/null @@ -1,6 +0,0 @@ - \ No newline at end of file diff --git a/src/views/Center/MyBooking/MyBookingComplated.vue b/src/views/Center/MyBooking/MyBookingComplated.vue deleted file mode 100644 index 61c7cc2..0000000 --- a/src/views/Center/MyBooking/MyBookingComplated.vue +++ /dev/null @@ -1,6 +0,0 @@ - \ No newline at end of file diff --git a/src/views/Center/MyBooking/MyBookingDetail.vue b/src/views/Center/MyBooking/MyBookingDetail.vue new file mode 100644 index 0000000..708b6fa --- /dev/null +++ b/src/views/Center/MyBooking/MyBookingDetail.vue @@ -0,0 +1,123 @@ + + \ No newline at end of file diff --git a/src/views/Center/MyBooking/MyBookingSuccess.vue b/src/views/Center/MyBooking/MyBookingSuccess.vue deleted file mode 100644 index 20a7e32..0000000 --- a/src/views/Center/MyBooking/MyBookingSuccess.vue +++ /dev/null @@ -1,6 +0,0 @@ - \ No newline at end of file diff --git a/src/views/Center/MyBooking/MyBookingWait.vue b/src/views/Center/MyBooking/MyBookingWait.vue deleted file mode 100644 index 7ba76ad..0000000 --- a/src/views/Center/MyBooking/MyBookingWait.vue +++ /dev/null @@ -1,6 +0,0 @@ - \ No newline at end of file diff --git a/src/views/Center/MyOrder/MyOrderDetail.vue b/src/views/Center/MyOrder/MyOrderDetail.vue index f8985e3..d92254c 100644 --- a/src/views/Center/MyOrder/MyOrderDetail.vue +++ b/src/views/Center/MyOrder/MyOrderDetail.vue @@ -58,8 +58,9 @@
-
取消支付
-
立即付款
+
取消支付
+
立即付款
+
删除订单
-- Gitee