<template>
    <global-page title="航班详情" navBarBackground="#0e42d2" :titleStyle="{color: '#fff'}">
        <view class="flightSupportDetails">
            <view class="details_header">
                <view class="header_no flex">
                    <image
                        class="flight-no-image"
                        :src="HnaPic"
                        mode="widthFix" />
                    <text>B9999</text>
                </view>

                <view class="header_info flex">
                    <text class="margin-r-32">机型：A999</text>
                    <text>机位：HG99</text>
                </view>
            </view>

            <view class="details_swiper">
                <detailsSwiper :currentAllRelatedFlights="currentAllRelatedFlights" />
            </view>

            <view class="details_tab">
                <view class="tabCont flex">
                    <view
                        v-for="(item, index) of tabList"
                        :key="item"
                        @click="tabCurrent = index"
                        class="f-flex-1 tabItem" :class="index == tabCurrent ? 'active' : ''"
                    >
                        {{ item }}--{{ tabCurrent }}
                    </view>
                </view>

                <detailsFlightInfo v-if="tabCurrent === 0" />
                <detailsOtherInfo v-else />

            </view>

        </view>

    </global-page>
</template>

<script setup>
import { ref, reactive } from 'vue'
import { storeToRefs } from 'pinia'
import { cloneDeep } from 'lodash'
import useBaseStore from 'mocp/store/base'
import useFlightSupportStore from 'mocp/store/flight-support'
import { onUnload } from '@dcloudio/uni-app'
import HnaPic from 'mocpStatic/image/air-company/hnhk.png'
import detailsSwiper from '../components/DetailsSwiper.vue'
import detailsFlightInfo from '../components/DetailsFlightInfo.vue'
import detailsOtherInfo from '../components/DetailsOtherInfo.vue'


const currentAllRelatedFlights = reactive([
    {
        flightNo: 'B7777',
        depStn: 'AKG',
        arrStn: 'WUH',
        stdChn: '16:16',
        staChn: '17:17'
    },
    {
        flightNo: 'B8888',
        depStn: 'VGF',
        arrStn: 'JHY',
        stdChn: '18:18',
        staChn: '19:19'
    },
    {
        flightNo: 'B9999',
        depStn: 'ERG',
        arrStn: 'MHG',
        stdChn: '20:20',
        staChn: '21:21'
    }
])
const tabList = ['航班信息', '其他信息']
const tabCurrent = ref(0)


</script>
<style lang="scss" scoped>
@import "../constants/details";
</style>
