|
|
@@ -147,6 +147,8 @@ onPullDownRefresh(() => {
|
|
|
const card_number = ref('')
|
|
|
// 判断是今天还是明天
|
|
|
const dateType = ref('今天')
|
|
|
+// 当前年份
|
|
|
+const currentYear = ref('')
|
|
|
// 当前月份
|
|
|
const currentMonth = ref('')
|
|
|
// 当前日期
|
|
|
@@ -208,14 +210,11 @@ const getPathList = async () => {
|
|
|
// 根据路线查询所有车次
|
|
|
const getBusList = async (route) => {
|
|
|
busList.value = []
|
|
|
- // 处理时间参数
|
|
|
- let date = new Date()
|
|
|
- let year = date.getFullYear()
|
|
|
|
|
|
const res = await myRequest({
|
|
|
url: '/appqueryCarNums.action',
|
|
|
data: {
|
|
|
- date: `${year}-${currentMonth.value}-${currentDay.value}`,
|
|
|
+ date: `${currentYear.value}-${currentMonth.value}-${currentDay.value}`,
|
|
|
route: route || currentPath.value,
|
|
|
card_number: card_number.value
|
|
|
}
|
|
|
@@ -301,13 +300,10 @@ const handleSub = () => {
|
|
|
|
|
|
// 预约请求
|
|
|
const handleSubscribe = async () => {
|
|
|
- // 处理时间参数
|
|
|
- let date = new Date()
|
|
|
- let year = date.getFullYear()
|
|
|
const res = await myRequest({
|
|
|
url: '/appmakeAppointment.action',
|
|
|
data: {
|
|
|
- date: `${year}-${currentMonth.value}-${currentDay.value}`,
|
|
|
+ date: `${currentYear.value}-${currentMonth.value}-${currentDay.value}`,
|
|
|
card_number: card_number.value,
|
|
|
id: currentBusId.value,
|
|
|
yyEnd: yy_end.value
|
|
|
@@ -397,15 +393,19 @@ const handleChangeTime = () => {
|
|
|
// 获取格式化时间 日期 和 星期
|
|
|
const getTimeFormat = (dayType) => {
|
|
|
let date = new Date()
|
|
|
+
|
|
|
if (dayType) {
|
|
|
let targetday = date.getTime() + 1000 * 60 * 60 * 24
|
|
|
date.setTime(targetday)
|
|
|
}
|
|
|
+
|
|
|
+ let year = date.getFullYear()
|
|
|
let month = (date.getMonth() + 1 + '').padStart(2, '0')
|
|
|
let day = (date.getDate() + '').padStart(2, '0')
|
|
|
let week = date.getDay()
|
|
|
let weekArr = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六']
|
|
|
|
|
|
+ currentYear.value = year
|
|
|
currentMonth.value = month
|
|
|
currentDay.value = day
|
|
|
currentWeek.value = weekArr[week]
|