<script lang="ts" setup>
import { fetchGetAgreementList } from '@/api/config'

const route = useRoute()
const agreementList = ref<any[]>([])

async function getData() {
  fetchGetAgreementList().then((res) => {
    if (res.data)
      agreementList.value = res.data
  })
}

const text = computed(() => agreementList.value.find((item: any) => item.key === route.query.key)?.value || '')

onMounted(() => {
  getData()
})
</script>

<template>
  <div class="agreement-wrap">
    <div class="agreement-text" v-html="text" />
  </div>
</template>

<style lang="scss" scoped>
.agreement-wrap {
  box-sizing: border-box;
  padding: 12px;
  .agreement-text {
    font-size: 14px;
    p {
      margin: 6px 0;
    }
  }
}
</style>
