2025-03-19 15:39:32 +08:00
|
|
|
<template>
|
2025-04-07 16:46:35 +08:00
|
|
|
<view class="container">
|
|
|
|
<navigation-bar-vue :title="title" style="width: 100%;" background-color="#ffffff"
|
|
|
|
title-color="#000000"></navigation-bar-vue>
|
|
|
|
<div class="body">
|
|
|
|
<rich-text style="width: 100%" :nodes="richTextHtml" />
|
|
|
|
</div>
|
|
|
|
</view>
|
2025-03-19 15:39:32 +08:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2025-04-07 16:46:35 +08:00
|
|
|
import navigationBarVue from '@/components/navigation/navigationBar.vue';
|
|
|
|
import {
|
|
|
|
getSiteConfig
|
|
|
|
} from '@/api/system/config'
|
|
|
|
import parser from 'rich-text-parser'
|
|
|
|
export default {
|
|
|
|
components: {
|
|
|
|
navigationBarVue
|
|
|
|
},
|
|
|
|
filters: {
|
|
|
|
formatRichText(html) { // 控制小程序中图片大小
|
|
|
|
// console.log(html)
|
|
|
|
const nodes = parser.getRichTextJson(html)
|
|
|
|
return nodes.children
|
|
|
|
}
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
title: "",
|
|
|
|
richTextHtml: '',
|
|
|
|
}
|
|
|
|
},
|
|
|
|
onLoad(options) {
|
|
|
|
this.title = options.title
|
|
|
|
this.getRichTextHtml(options.code)
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
async getRichTextHtml(code) {
|
|
|
|
let that = this
|
|
|
|
getSiteConfig({
|
|
|
|
code: code
|
|
|
|
}).then(res => {
|
|
|
|
let json = JSON.parse(res.data)
|
|
|
|
that.richTextHtml = json[0].value
|
|
|
|
}).catch((e) => {
|
|
|
|
uni.showToast({
|
|
|
|
icon: 'error',
|
|
|
|
duration: 2000,
|
|
|
|
title: e
|
|
|
|
});
|
|
|
|
})
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
2025-03-19 15:39:32 +08:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
2025-04-07 16:46:35 +08:00
|
|
|
.container {
|
|
|
|
padding-top: calc(90rpx + var(--status-bar-height));
|
|
|
|
height: 100%;
|
|
|
|
padding-left: 20rpx;
|
|
|
|
padding-right: 20rpx;
|
|
|
|
background: white;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
|
|
.body {
|
|
|
|
height: calc(100vh - var(--status-bar-height) - var(--window-bottom) - 95rpx);
|
|
|
|
overflow-y: scroll;
|
|
|
|
overflow: auto;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|