1
Showing
3 changed files
with
10 additions
and
15 deletions
| ... | @@ -23,7 +23,7 @@ const startCheckSuccessListener = (orderSn, actId) => { | ... | @@ -23,7 +23,7 @@ const startCheckSuccessListener = (orderSn, actId) => { |
| 23 | // 支付成功 | 23 | // 支付成功 |
| 24 | payment.showCodeDialog = false; | 24 | payment.showCodeDialog = false; |
| 25 | ElMessage({ type: "success", message: "支付成功" }); | 25 | ElMessage({ type: "success", message: "支付成功" }); |
| 26 | router.push({ | 26 | router.replace({ |
| 27 | path: "/seat/order", | 27 | path: "/seat/order", |
| 28 | }); | 28 | }); |
| 29 | } else { | 29 | } else { | ... | ... |
| 1 | <script setup> | 1 | <script setup> |
| 2 | import { setToken, getToken } from "./utils/local-store.js"; | ||
| 2 | import { getOrderList, immediatePay, cancelPay } from "./api/index.js"; | 3 | import { getOrderList, immediatePay, cancelPay } from "./api/index.js"; |
| 3 | import qrCodeDialog from "./components/qrCodeDialog.vue"; | 4 | import qrCodeDialog from "./components/qrCodeDialog.vue"; |
| 4 | import { ElMessageBox, ElMessage } from "element-plus"; | 5 | import { ElMessageBox, ElMessage } from "element-plus"; |
| ... | @@ -55,7 +56,6 @@ const order = reactive({ | ... | @@ -55,7 +56,6 @@ const order = reactive({ |
| 55 | fetchData() { | 56 | fetchData() { |
| 56 | getOrderList({ pageNo: order.pageNo, pageSize: order.pageSize }).then( | 57 | getOrderList({ pageNo: order.pageNo, pageSize: order.pageSize }).then( |
| 57 | (res) => { | 58 | (res) => { |
| 58 | // TODO: 后期优化 | ||
| 59 | order.noPay = res.data.lists.find((it) => it.state == 0); | 59 | order.noPay = res.data.lists.find((it) => it.state == 0); |
| 60 | order.data = res.data.lists; | 60 | order.data = res.data.lists; |
| 61 | order.total = res.data.count; | 61 | order.total = res.data.count; |
| ... | @@ -129,7 +129,7 @@ const order = reactive({ | ... | @@ -129,7 +129,7 @@ const order = reactive({ |
| 129 | totalTime -= 1000; | 129 | totalTime -= 1000; |
| 130 | // console.log(totalTime) | 130 | // console.log(totalTime) |
| 131 | } else { | 131 | } else { |
| 132 | clearInterval(timer); // 停止调用函数 | 132 | clearInterval(order.timer); // 停止调用函数 |
| 133 | } | 133 | } |
| 134 | }, 1000); | 134 | }, 1000); |
| 135 | } | 135 | } |
| ... | @@ -145,6 +145,10 @@ watch( | ... | @@ -145,6 +145,10 @@ watch( |
| 145 | } | 145 | } |
| 146 | ); | 146 | ); |
| 147 | 147 | ||
| 148 | onUnmounted(() => { | ||
| 149 | clearInterval(order.timer); | ||
| 150 | }); | ||
| 151 | |||
| 148 | order.fetchData(); | 152 | order.fetchData(); |
| 149 | </script> | 153 | </script> |
| 150 | 154 | ... | ... |
| ... | @@ -227,23 +227,13 @@ watch( | ... | @@ -227,23 +227,13 @@ watch( |
| 227 | <div class="time"> | 227 | <div class="time"> |
| 228 | 时间:{{ | 228 | 时间:{{ |
| 229 | detail.data?.startTime | 229 | detail.data?.startTime |
| 230 | ? dayjs(detail.data?.startTime).format("YYYY.MM.DD") | 230 | ? dayjs(detail.data?.startTime).format("YYYY.MM.DD ddd") |
| 231 | : "" | ||
| 232 | }} | ||
| 233 | {{ | ||
| 234 | detail.data?.startTime | ||
| 235 | ? dayjs(detail.data?.startTime).format("ddd") | ||
| 236 | : "" | 231 | : "" |
| 237 | }} | 232 | }} |
| 238 | — | 233 | — |
| 239 | {{ | 234 | {{ |
| 240 | detail.data?.endTime | 235 | detail.data?.endTime |
| 241 | ? dayjs(detail.data?.endTime).format("YYYY.MM.DD") | 236 | ? dayjs(detail.data?.endTime).format("YYYY.MM.DD ddd") |
| 242 | : "" | ||
| 243 | }} | ||
| 244 | {{ | ||
| 245 | detail.data?.endTime | ||
| 246 | ? dayjs(detail.data?.endTime).format("ddd") | ||
| 247 | : "" | 237 | : "" |
| 248 | }} | 238 | }} |
| 249 | </div> | 239 | </div> |
| ... | @@ -480,6 +470,7 @@ watch( | ... | @@ -480,6 +470,7 @@ watch( |
| 480 | .bottom { | 470 | .bottom { |
| 481 | padding: 50px; | 471 | padding: 50px; |
| 482 | margin-top: 30px; | 472 | margin-top: 30px; |
| 473 | margin-bottom: 30px; | ||
| 483 | .title { | 474 | .title { |
| 484 | padding: 20px 30px; | 475 | padding: 20px 30px; |
| 485 | background: linear-gradient(270deg, #493ceb 0%, #8623fc 100%); | 476 | background: linear-gradient(270deg, #493ceb 0%, #8623fc 100%); | ... | ... |
-
Please register or sign in to post a comment