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

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


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

async function initData() {
  if (props.code) {
    try {
      const res = await appAgreementGetByCodePost({
        body: {
          code: props.code
        }
      })
      console.log('res', res)

      detailInfo.value = res.data || {}
    } catch (e) {
    }
  }
}

initData()
</script>

<template>
  <view class="">
    <navbar/>
    <view class="p-[20rpx+30rpx]">
      <mp-html
          selectable
          :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;',
      }"
          :content="(detailInfo.content)"
      ></mp-html>
    </view>
  </view>
</template>


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