机票时长默认自动计算,可修改

This commit is contained in:
tangxinyue 2026-02-27 10:04:19 +08:00
parent c6dcc7ab4d
commit 3da8a73f1d
1 changed files with 459 additions and 441 deletions

View File

@ -86,10 +86,10 @@
<text class="label">到达机场</text>
<input class="input" v-model="ticketsInfo.flightInfo.endAirport" />
</view>
<!-- <view class="form-item">
<view class="form-item">
<text class="label">时长</text>
<input class="input" v-model="ticketsInfo.flightInfo.duration" placeholder="例: 2时5分" />
</view> -->
</view>
<view class="form-item">
<text class="label">机型</text>
<input class="input" v-model="ticketsInfo.flightInfo.aircraftType" />
@ -218,7 +218,8 @@
<text class="label">等级</text>
<view class="input"
:style="{ color: !ticketsInfo.ctripOrderInfo.level ? '#999' : '#333' }">
{{ getLevelLabel(ticketsInfo.ctripOrderInfo.level) || '请选择等级' }}</view>
{{ getLevelLabel(ticketsInfo.ctripOrderInfo.level) || '请选择等级' }}
</view>
</view>
</picker>
<view class="tips-container">
@ -256,8 +257,14 @@
<script setup>
import NavBar from '@/components/nav-bar/nav-bar.vue'
import { reactive, toRefs, onMounted } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
import {
reactive,
toRefs,
onMounted
} from 'vue';
import {
onLoad
} from '@dcloudio/uni-app';
import defualtData from '@/pages/other/air-tickets/commom/defualt.json';
import airlineJson from '@/static/json/air-line.json';
@ -280,7 +287,11 @@ const data = reactive({
}
})
const { ticketsInfo, collapsed, dragInfo } = toRefs(data)
const {
ticketsInfo,
collapsed,
dragInfo
} = toRefs(data)
const onAirlineChange = (e) => {
const index = e.detail.value;
@ -292,8 +303,7 @@ const onAirlineChange = (e) => {
}
//
const ctripLevelList = [
{
const ctripLevelList = [{
label: "白银",
value: 1
},
@ -548,8 +558,12 @@ const onFlightDateChange = (e) => {
}
// Custom Time Picker Data
const hours = Array.from({ length: 24 }, (_, i) => i.toString().padStart(2, '0'));
const minutes = Array.from({ length: 60 }, (_, i) => i.toString().padStart(2, '0'));
const hours = Array.from({
length: 24
}, (_, i) => i.toString().padStart(2, '0'));
const minutes = Array.from({
length: 60
}, (_, i) => i.toString().padStart(2, '0'));
const timeRange = [hours, minutes];
const getTimeIndex = (timeStr) => {
@ -586,7 +600,11 @@ const updateDuration = () => {
const h = Math.floor(diffMin / 60)
const m = diffMin % 60
if (h > 0) {
ft.duration = `${h}${m}`
} else {
ft.duration = `${m}`
}
}
}
</script>