45 lines
956 B
Vue
45 lines
956 B
Vue
<template>
|
|
<full-page mainStyle="background:#fff">
|
|
<view class="agreement">
|
|
<rich-text :nodes="nodes"></rich-text>
|
|
</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'
|
|
|
|
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
|
|
}
|
|
})
|
|
})
|
|
</script>
|
|
<style lang="scss" scoped>
|
|
.agreement {
|
|
padding: 0 30rpx 100rpx;
|
|
line-height: 1.5m;
|
|
word-break: break-all;
|
|
}
|
|
</style> |