<template>
  <div id="index">
    <el-row>
      <el-col :span="24" class="main animate__animated animate__backInRight" v-loading="loading">
        <el-col :span="24" class="one">
          <el-col :span="24" class="one_1 w_1200">
            <el-image class="image" :src="siteInfo.logo_url"></el-image>
            <span>{{ siteInfo.zhTitle }}--{{ router_title }}</span>
          </el-col>
        </el-col>
        <el-col :span="24" class="two">
          <el-col :span="24" class="two_1 w_1200">
            <el-col :span="17" class="l">
              <component :is="cForm"></component>
            </el-col>
            <el-col :span="6" class="r">
              <el-col :span="24" class="title">常见问题</el-col>
              <el-col :span="24" class="r_1">
                <el-col :span="24" class="list" v-for="(item, index) in questionList" :key="index">
                  <p>{{ index + 1 + '.' }}{{ item.title }}</p>
                  <p>{{ item.content }}</p>
                  <p>{{ item.other }}</p>
                </el-col>
              </el-col>
            </el-col>
          </el-col>
        </el-col>
        <el-col :span="24" class="thr">
          <el-col :span="24" class="thr_1 w_1200">
            <p v-html="footInfo.content"></p>
          </el-col>
        </el-col>
      </el-col>
    </el-row>
  </div>
</template>

<script setup lang="ts">
// 基础
import { siteInfo, footInfo, questionList } from '@common/src/layout/site';
import cForm from './parts/c-form.vue';
import type { Ref } from 'vue';
import { useRoute } from 'vue-router';
import { onMounted, ref } from 'vue';

// 路由
const route = useRoute();
// 加载中
const loading: Ref<any> = ref(false);
// 路由地址名称
const router_title: Ref<any> = ref('');
// 请求
onMounted(async () => {
  loading.value = true;
  router_title.value = route.meta.title;
  loading.value = false;
});
</script>
<style scoped lang="scss">
.main {
  background-color: #f1f1f1;
  .one {
    height: 100px;
    overflow: hidden;
    border-bottom: 4px solid #44b549;
    background-color: #ffffff;
    .one_1 {
      padding: 10px 0;
      .image {
        width: 66px;
        height: 66px;
        overflow: hidden;
      }
      span {
        position: absolute;
        top: 30px;
        font-size: 25px;
        padding: 0 20px;
        font-family: cursive;
        color: #2d64b3;
      }
    }
  }
  .two {
    padding: 10px 0;
    .two_1 {
      display: flex;
      .l {
        background-color: #ffffff;
        margin: 0 15px 0 0;
        padding: 10px;
      }
      .r {
        background-color: #ffffff;
        padding: 10px;
        .title {
          padding: 0 0 10px 0;
          margin: 0 0 5px 0;
          border-bottom: 1px dashed #cccccc;
        }
        .r_1 {
          .list {
            border-bottom: 1px dashed #ccc;
            padding: 10px 0;
            p {
              font-size: 14px;
            }
            p:nth-child(1) {
              font-weight: bold;
              padding: 5px 0 0 0;
            }
            p:nth-child(2) {
              color: #ff0000;
              padding: 5px 0 0 0;
            }
            p:nth-child(3) {
              font-weight: bold;
              padding: 5px 0 0 0;
              span {
                color: #ff0000;
              }
            }
          }
          .list:last-child {
            border-bottom: none;
          }
        }
      }
    }
  }
  .thr {
    height: 120px;
    background-color: #3a3637;
    .thr_1 {
      padding: 10px 0;
      color: #999999;
      :deep(p) {
        p {
          margin: 0 0 5px 0;
        }
      }
    }
  }
}
</style>
