<script lang="ts" setup>
import {appAgreementGetByCodePost} from "@/service";

const props = defineProps<{
  code?: string
}>()


const detailInfo = ref<Partial<Agreement>>({})

async function initData() {
  if (props.code) {
    try {
      appAgreementGetByCodePost({
        body: {
          code: props.code
        }
      }).then(res => {
        console.log(res)
        detailInfo.value = res.data
      })
    } catch (e) {
    }
  }
}

initData()
</script>

<template>
  <view class="">
    <navbar/>
    <view class="p-[20rpx+30rpx]">
      <mp-html
          :content="(detailInfo.content)"
          :preview-img="false"
          :show-img-menu="false"
          :tag-style="{
        div: 'white-space: pre-wrap;',
        p: 'white-space: pre-wrap;',
       img: 'width:100%;max-width: 100%;height:auto;',
      }"
          selectable
      ></mp-html>
    </view>
  </view>
</template>


<style lang="scss">
page {
  background-color: #fff;
}
</style>
