diff --git a/src/router/index.js b/src/router/index.js index ecb2090aed8fd6b87f94ce7b8416fee7b89e382b..03b8dc99fee005df649e6b6d9c41567acdae899f 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -3,8 +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,10 +11,6 @@ const routes = [ ...Index, // 我的模块 ...Center, - // 我的订餐模块 - ...MyOrder, - // 我的餐桌预定模块 - ...MyBooking, // 订单确认模块 ...OrderConfirm, // 重定向 diff --git a/src/router/modules/center.js b/src/router/modules/center.js index f9dfab6eccb2ec396ce3ee6c85c73ee6a4eab4d0..9c60a42474181c000d2f211f718806e45a6fc11e 100644 --- a/src/router/modules/center.js +++ b/src/router/modules/center.js @@ -3,6 +3,8 @@ 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" +import MyBookingDetail from "@/views/Center/MyBooking/MyBookingDetail.vue" export default [ { @@ -20,5 +22,15 @@ export default [ { path:"/myorders", component:MyOrders + }, + { + path:"/myorderdetail", + name:"myorderdetail", + component:MyOrderDetail + }, + { + path:"/mybookingdetail", + name:"mybookingdetail", + component:MyBookingDetail } ] \ 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 d8186bdd730e185d7891a62d84b6dd48274412d6..0000000000000000000000000000000000000000 --- 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/MyBooking/MyBookingCancelled.vue b/src/views/Center/MyBooking/MyBookingCancelled.vue deleted file mode 100644 index 712892b7526c176b6ee563cd43cae7799e1263b9..0000000000000000000000000000000000000000 --- 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 61c7cc21c716f6021516ee3238b28aa1dd1c4f1c..0000000000000000000000000000000000000000 --- 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 0000000000000000000000000000000000000000..708b6fa9624f691bb3a0d7983731f452cf6186f9 --- /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 20a7e3295f8e10b808aa1bffd9900984da6a6874..0000000000000000000000000000000000000000 --- 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 7ba76ad5e49c9e2a13f87b7509d314e3944ffff0..0000000000000000000000000000000000000000 --- 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/MyOrderCancelled.vue b/src/views/Center/MyOrder/MyOrderCancelled.vue deleted file mode 100644 index c564d7452acd4a2da088ace1d7fc6972e272df2d..0000000000000000000000000000000000000000 --- 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 a6fc0b89b5d6115b989eb85cf39e6e8a4b10eec1..0000000000000000000000000000000000000000 --- 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 0000000000000000000000000000000000000000..d92254cc13b262bdc451e701adcb7c06d371c4d7 --- /dev/null +++ b/src/views/Center/MyOrder/MyOrderDetail.vue @@ -0,0 +1,195 @@ + + + \ 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 8bac67f1068aa5c7f41e3603365436a795a17d81..0000000000000000000000000000000000000000 --- 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 b46c91b560f93f12f4bd442ad47b73f6de58d008..769ff4c88e5d4559fc7d66753f094cb94dbbb9a1 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