|
@@ -1,9 +1,9 @@
|
|
|
<template>
|
|
|
<div class="booking">
|
|
|
- <img class="banner" src="@/assets/img/service/booking-banner.png" alt="" draggable="false">
|
|
|
+ <img class="banner" src="@/assets/img/service/老芜湖海关.png" alt="" draggable="false">
|
|
|
|
|
|
<van-calendar
|
|
|
- @confirm="onConfirm"
|
|
|
+ @confirm="onConfirmDate"
|
|
|
title="预约日期"
|
|
|
color="#ff615c"
|
|
|
:poppable="false"
|
|
@@ -25,7 +25,7 @@
|
|
|
:class="{
|
|
|
active: index === timeIdx,
|
|
|
}"
|
|
|
- @click="handleClick(index)"
|
|
|
+ @click="handleClickTime(index)"
|
|
|
>
|
|
|
<span>{{item.time}}</span><br>
|
|
|
<span>{{item.remain ? `剩余${item.remain}` : `已结束`}}</span>
|
|
@@ -65,21 +65,65 @@
|
|
|
</div>
|
|
|
|
|
|
<div class="submit-wrap">
|
|
|
- <button class="submit" :class="{
|
|
|
- active: canSubmit,
|
|
|
- }">
|
|
|
+ <button
|
|
|
+ class="submit"
|
|
|
+ :class="{
|
|
|
+ active: canSubmit,
|
|
|
+ }"
|
|
|
+ @click="onClickSubmit"
|
|
|
+ >
|
|
|
<div>立即预约</div>
|
|
|
</button>
|
|
|
</div>
|
|
|
+
|
|
|
+ <BookingSuccess v-if="isShowSuccess"
|
|
|
+ :bookingYear="bookingYear"
|
|
|
+ :bookingMonth="bookingMonth"
|
|
|
+ :bookingDay="bookingDay"
|
|
|
+ :bookingHour="bookingHour"
|
|
|
+ :bookingMinute="bookingMinute"
|
|
|
+ :bookingSecond="bookingSecond"
|
|
|
+ :year="year"
|
|
|
+ :month="month"
|
|
|
+ :day="day"
|
|
|
+ :weekDay="weekDay"
|
|
|
+ :time="timeList[timeIdx]?.time"
|
|
|
+ :number="number"
|
|
|
+ @close="$router.go(-1)"
|
|
|
+ ></BookingSuccess>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import Swiper from "../../assets/libs/swiper.js";
|
|
|
+import BookingSuccess from "@/components/BookingSuccess.vue";
|
|
|
+
|
|
|
+const weekDayList = [
|
|
|
+ '周一',
|
|
|
+ '周二',
|
|
|
+ '周三',
|
|
|
+ '周四',
|
|
|
+ '周五',
|
|
|
+ '周六',
|
|
|
+ '周日',
|
|
|
+]
|
|
|
|
|
|
export default {
|
|
|
+ components: {
|
|
|
+ BookingSuccess,
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
+ bookingYear: 'null',
|
|
|
+ bookingMonth: 'null',
|
|
|
+ bookingDay: 'null',
|
|
|
+ bookingHour: 'null',
|
|
|
+ bookingMinute: 'null',
|
|
|
+ bookingSecond: 'null',
|
|
|
+ year: null,
|
|
|
+ month: null,
|
|
|
+ day: null,
|
|
|
+ weekDay: null,
|
|
|
timeList: [
|
|
|
{
|
|
|
time: '9:00-12:00',
|
|
@@ -94,14 +138,14 @@ export default {
|
|
|
remain: 80,
|
|
|
},
|
|
|
],
|
|
|
- month: null,
|
|
|
- day: null,
|
|
|
- timeIdx: null,
|
|
|
+ timeIdx: 1,
|
|
|
name: ',jkl',
|
|
|
idCard: 'kljlk',
|
|
|
phone: 'kljlk',
|
|
|
age: 'lkjl',
|
|
|
number: '.lk;',
|
|
|
+
|
|
|
+ isShowSuccess: false,
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -124,16 +168,30 @@ export default {
|
|
|
initialSlide: 0,
|
|
|
});
|
|
|
const today = new Date()
|
|
|
- this.month = today.getMonth() + 1
|
|
|
- this.day = today.getDate()
|
|
|
+ this.year = today.getFullYear()
|
|
|
+ this.month = (today.getMonth() + 1).toString().padStart(2, '0')
|
|
|
+ this.day = today.getDate().toString().padStart(2, '0')
|
|
|
+ this.weekDay = weekDayList[today.getDay() + 1]
|
|
|
},
|
|
|
methods: {
|
|
|
- handleClick(index) {
|
|
|
+ onConfirmDate(date) {
|
|
|
+ this.year = date.getFullYear()
|
|
|
+ this.month = (date.getMonth() + 1).toString().padStart(2, '0')
|
|
|
+ this.day = date.getDate().toString().padStart(2, '0')
|
|
|
+ this.weekDay = weekDayList[date.getDay() + 1]
|
|
|
+ },
|
|
|
+ handleClickTime(index) {
|
|
|
this.timeIdx = index
|
|
|
},
|
|
|
- onConfirm(date) {
|
|
|
- this.month = date.getMonth() + 1
|
|
|
- this.day = date.getDate()
|
|
|
+ onClickSubmit() {
|
|
|
+ const now = new Date()
|
|
|
+ this.bookingYear = now.getFullYear()
|
|
|
+ this.bookingMonth = (now.getMonth() + 1).toString().padStart(2, '0')
|
|
|
+ this.bookingDay = now.getDate().toString().padStart(2, '0')
|
|
|
+ this.bookingHour = (now.getHours()).toString().padStart(2, '0')
|
|
|
+ this.bookingMinute = (now.getMinutes()).toString().padStart(2, '0')
|
|
|
+ this.bookingSecond = (now.getSeconds()).toString().padStart(2, '0')
|
|
|
+ this.isShowSuccess = true
|
|
|
},
|
|
|
}
|
|
|
}
|