You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.2 KiB
52 lines
1.2 KiB
11 months ago
|
<script setup lang="ts">
|
||
|
import { agreementInfoApi } from '~/server/userApi'
|
||
|
import useRouterItem from '~/composables/useRouterItem'
|
||
|
import { ref, watch } from 'vue'
|
||
|
import {payPaymentApi} from "~/server/orderApi";
|
||
|
const route = useRoute()
|
||
|
const title = ref<string>(<string>route.query.name)
|
||
|
watch(
|
||
|
() => route.query,
|
||
|
(newValue) => {
|
||
|
if (newValue) {
|
||
|
title.value = <string>newValue.name
|
||
|
getAgreement()
|
||
|
}
|
||
|
}
|
||
|
)
|
||
|
|
||
|
const agreementData = ref<any>('')
|
||
|
const loading = ref<boolean>(false)
|
||
|
const getAgreement = async () => {
|
||
|
try {
|
||
|
loading.value = true
|
||
|
const res = await agreementInfoApi(route.query.type)
|
||
|
loading.value = false
|
||
|
agreementData.value = JSON.parse(res).agreement
|
||
|
} catch (err: any) {
|
||
|
loading.value = false
|
||
|
}
|
||
|
}
|
||
|
getAgreement()
|
||
|
</script>
|
||
|
|
||
|
<template>
|
||
|
<div>
|
||
|
<div class="text-18px text-#333 font-500 mb-30px">{{title}}</div>
|
||
|
<div v-loading="loading" class="detail-content px-10px htmlClass" v-html="agreementData ? agreementData.replace(/<br\/>/gi, '') : ''"></div>
|
||
|
</div>
|
||
|
|
||
|
</template>
|
||
|
|
||
|
<style scoped lang="scss">
|
||
|
.detail-content {
|
||
|
:deep(div) {
|
||
|
width: 100% !important;
|
||
|
}
|
||
|
:deep(img) {
|
||
|
display: block;
|
||
|
width: 100% !important;
|
||
|
}
|
||
|
}
|
||
|
</style>
|