From 413ab4db85fffa8d257ceb7c11704752b19237c9 Mon Sep 17 00:00:00 2001 From: fanyuying <1037103437@qq.com> Date: Fri, 9 Apr 2021 14:48:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=AD=E5=BF=83=E9=A4=90?= =?UTF-8?q?=E6=A1=8C=E9=A2=84=E7=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + src/App.vue | 1 + src/api/http.js | 12 + src/components/FootBar.vue | 14 +- src/components/HeadBar.vue | 1 + src/main.js | 6 +- src/router/index.js | 20 +- src/router/modules/center.js | 11 +- src/router/modules/index.js | 3 +- src/router/modules/myBooking.js | 3 +- src/store/index.js | 11 + src/views/Center/Center.vue | 196 ++++++++- src/views/Center/Login.vue | 88 ++++ src/views/Center/MyBooking/MyBookingWait.vue | 17 +- src/views/Index/Booking/Booking.vue | 426 ++++++++++++++++++- src/views/Index/Booking/BookingConfirm.vue | 164 ++++++- src/views/Index/Index.vue | 2 +- 17 files changed, 952 insertions(+), 24 deletions(-) create mode 100644 src/views/Center/Login.vue diff --git a/package.json b/package.json index 482fb6e..9907504 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "dependencies": { "axios": "^0.21.1", "core-js": "^3.6.5", + "moment": "^2.29.1", "vant": "^2.12.11", "vue": "^2.6.11", "vue-router": "^3.2.0", diff --git a/src/App.vue b/src/App.vue index 767bde7..d1b5999 100644 --- a/src/App.vue +++ b/src/App.vue @@ -24,4 +24,5 @@ export default { margin: 0; } + diff --git a/src/api/http.js b/src/api/http.js index 3b4a5f3..4fdc206 100644 --- a/src/api/http.js +++ b/src/api/http.js @@ -1,5 +1,17 @@ import axios from "axios" +import store from '@/store/index' + +axios.interceptors.request.use((config) => { + // config参数:请求发送时需要的信息对象 + // 常用场景:为部分/所有的请求添加特定的请求头信息(例如有些接口需要做token鉴权的) + // 在这里添加jwt到请求头中 + config.headers["authorization"] = store.state._token; + return config; +}); axios.interceptors.response.use(res=>{ + let _token =res.data._token?res.data._token:"" + store.commit("setToken",_token) + return res.data||res }) export default axios \ No newline at end of file diff --git a/src/components/FootBar.vue b/src/components/FootBar.vue index 46da0b3..74bae66 100644 --- a/src/components/FootBar.vue +++ b/src/components/FootBar.vue @@ -1,6 +1,6 @@ + + \ No newline at end of file diff --git a/src/views/Center/Login.vue b/src/views/Center/Login.vue new file mode 100644 index 0000000..65847b8 --- /dev/null +++ b/src/views/Center/Login.vue @@ -0,0 +1,88 @@ + + + \ No newline at end of file diff --git a/src/views/Center/MyBooking/MyBookingWait.vue b/src/views/Center/MyBooking/MyBookingWait.vue index 7ba76ad..8b87c89 100644 --- a/src/views/Center/MyBooking/MyBookingWait.vue +++ b/src/views/Center/MyBooking/MyBookingWait.vue @@ -3,4 +3,19 @@ MyBookingWait 我的餐桌预定=>等待中的餐桌 - \ No newline at end of file + + \ No newline at end of file diff --git a/src/views/Index/Booking/Booking.vue b/src/views/Index/Booking/Booking.vue index 70a4fe1..76c7771 100644 --- a/src/views/Index/Booking/Booking.vue +++ b/src/views/Index/Booking/Booking.vue @@ -1,6 +1,424 @@ \ No newline at end of file +
+ +
+
+

今天{{ time(Date.now(), 0) }}

+
+
+

明天{{ time(Date.now(), 1) }}

+
+
+

后天{{ time(Date.now(), 2) }}

+
+
+

+ {{ e() }}{{ time(Date.now(), 3) }} +

+
+
+ +
+ + +
+
+
+ + + + +
+
+

餐桌类型

+
+
+

{{data.dating}}

+

{{data.people}}

+
+ +
+
+
+

可预订时间

+
+
+

{{data.time}}

+
+
+ +
+ + + + + + diff --git a/src/views/Index/Booking/BookingConfirm.vue b/src/views/Index/Booking/BookingConfirm.vue index 236d59c..726c0cf 100644 --- a/src/views/Index/Booking/BookingConfirm.vue +++ b/src/views/Index/Booking/BookingConfirm.vue @@ -1,6 +1,162 @@ \ No newline at end of file +
+

预约信息

+
+

预定时间 : {{list.data}}

+

餐桌类型 : {{list.type}}

+

就餐人数 : {{list.peopleNum}}

+
+
+
+
联系人信息
+
+

联系人:

+

性别:

+

手机号:

+
+

备注:

+
+ + + + + + \ No newline at end of file diff --git a/src/views/Index/Index.vue b/src/views/Index/Index.vue index 2a8b3e7..30c71fd 100644 --- a/src/views/Index/Index.vue +++ b/src/views/Index/Index.vue @@ -49,7 +49,7 @@