<template>
  <el-button class="mt20 mb20" @click="router.back()">
    <el-icon><ArrowLeft /></el-icon>
    <span>{{$t('common.back')}}</span>
  </el-button>
  <div class="padding16 bg_color_fff border_radius_10 box_shadow_card">
    <div class="mb-20 bold font_size32 flex-center">{{$t('agreement.' + type)}}</div>
    <div class="font_size16 ql-container">
      <div class="ql-editor">
        <div v-html="agreementContent"></div>
      </div>
    </div>
  </div>
</template>
<script setup>
import { getAgreementType } from '@/api/common.js'
import { useRoute, useRouter } from 'vue-router'
import { ref,onMounted } from 'vue'

const route = useRoute()
const router = useRouter()
const type = route.query.type || '';
const agreementContent = ref('');

onMounted(() => {
  getAgreementTypeFn();
});

const getAgreementTypeFn = () => {
  getAgreementType({agreementType: type}).then(res => {
    console.log(res)
    agreementContent.value = res.data.content || '';
  })
};
</script>