hn-hlw-app/pages/consult/agreement.vue

45 lines
956 B
Vue
Raw Normal View History

2026-07-27 11:26:39 +08:00
<template>
<full-page mainStyle="background:#fff">
<view class="agreement">
<rich-text :nodes="nodes"></rich-text>
2026-07-27 11:26:39 +08:00
</view>
</full-page>
</template>
<script setup>
import { ref } from 'vue';
import { onLoad } from "@dcloudio/uni-app";
import parse from 'mini-html-parser2';
import userService from './protocols/user-service';
import informedConsent from './protocols/informed-consent'
2026-07-27 11:26:39 +08:00
import fullPage from "@/components/full-page.vue";
const type = ref('');
const nodes = ref([]);
const textMap = {
protocol: userService,
agreement: informedConsent
}
onLoad((e) => {
type.value = e.type;
e.title && uni.setNavigationBarTitle({
title: e.title
})
const text = textMap[type.value] || '';
parse(text.trim(), (err, elements) => {
if (err) {
nodes.value = []
} else {
nodes.value = elements
}
2026-07-27 11:26:39 +08:00
})
})
2026-07-27 11:26:39 +08:00
</script>
<style lang="scss" scoped>
.agreement {
padding: 0 30rpx 100rpx;
line-height: 1.5m;
word-break: break-all;
}
2026-07-27 11:26:39 +08:00
</style>