
<template>
  <view class="report">
    <view class="report-tab">
      <view
        v-for="item in tabList"
        :key="item"
        :class="{
          'report-tab-item': true,
          'report-tab-item-active': item === tab,
        }"
        @click="() => (tab = item)"
        >{{ item }}</view
      >
    </view>
    <view class="report-tab-content">
      <reportTask v-if="tab === '任务'" />
      <reportUser v-else-if="tab === '我的'" />
      <reportGasStation v-else-if="tab === '油站'" />
    </view>
  </view>
</template>
<script setup lang="ts">
import { ref } from 'vue'
import reportTask from './component/reportTask.vue'
import reportGasStation from './component/reportGasStation.vue'
import reportUser from './component/reportUser.vue'
const tab = ref('任务')
const tabList = ref(['任务', '我的', '油站'])
</script>
<style scoped lang="scss">
.report {
  height: calc(100vh - 188rpx);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6rpx 26rpx;
  box-sizing: border-box;
  overflow: hidden;
  .report-tab {
    width: 100%;
    height: 80rpx;
    display: flex;
    gap: 108rpx;
    align-items: center;
    .report-tab-item {
      font-size: 32rpx;
      font-weight: 400;
      color: #4e5969;
      padding-bottom: 8rpx;
    }
    .report-tab-item-active {
      font-size: 32rpx;
      font-weight: 500;
      color: #20222a;
      position: relative;
      &::after {
        content: '';
        position: absolute;
        bottom: -6rpx;
        left: 50%;
        transform: translateX(-50%);
        width: 60%;
        height: 4rpx;
        background-color: #215acd;
        border-radius: 4rpx 4rpx 0 0;
      }
    }
  }
  .report-tab-content {
    flex: 1;
    width: 100%;
    margin-top: 20rpx;
    overflow-y: auto;
    overflow-x: hidden;
  }
}
</style>
