Merge branch 'Branch_1' of https://git.u8t.cn/tangxinyue/alipay-emulator into Branch_1
This commit is contained in:
commit
7bfa56cf5b
|
|
@ -326,6 +326,19 @@ onMounted(() => {
|
|||
if (stored) {
|
||||
Object.assign(data.ticketsInfo, stored)
|
||||
}
|
||||
|
||||
// 初始化时同步车票日期到出发时间
|
||||
const ticketDate = data.ticketsInfo.ticketInfo.date;
|
||||
if (ticketDate) {
|
||||
const parts = ticketDate.split('.');
|
||||
if (parts.length === 3) {
|
||||
const mmdd = `${parts[1]}-${parts[2]}`;
|
||||
const oldDepTime = data.ticketsInfo.ticketInfo.departureTime || '';
|
||||
const timePart = oldDepTime.split(' ')[1] || '00:00';
|
||||
data.ticketsInfo.ticketInfo.departureTime = `${mmdd} ${timePart}`;
|
||||
}
|
||||
}
|
||||
|
||||
updateDuration();
|
||||
})
|
||||
/**
|
||||
|
|
@ -482,6 +495,15 @@ const onTicketDateChange = (e) => {
|
|||
const dateObj = new Date(val.replace(/-/g, '/')); // Compatible
|
||||
const days = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'];
|
||||
data.ticketsInfo.ticketInfo.weekDay = days[dateObj.getDay()];
|
||||
|
||||
// 同步出发时间日期
|
||||
const parts = val.split('-');
|
||||
if (parts.length === 3) {
|
||||
const mmdd = `${parts[1]}-${parts[2]}`;
|
||||
const oldDepTime = data.ticketsInfo.ticketInfo.departureTime || '';
|
||||
const timePart = oldDepTime.split(' ')[1] || '00:00';
|
||||
data.ticketsInfo.ticketInfo.departureTime = `${mmdd} ${timePart}`;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue