<template>
|
<view class="rich-text-page">
|
<view class="rich-content" v-html="content"></view>
|
</view>
|
</template>
|
|
<script>
|
export default {
|
data() {
|
return {
|
type: '',
|
content: ''
|
}
|
},
|
onLoad(options) {
|
this.type = options.type || 'about'
|
this.getPlatformAboutUs()
|
},
|
methods: {
|
async getPlatformAboutUs() {
|
const res = await this.$u.api.getPlatformAboutUs({ type: this.type })
|
if (res.code === 200) {
|
if (this.type === 'about') {
|
this.content = res.data.aboutUs || ''
|
} else if (this.type === 'protocol') {
|
this.content = res.data.userAgreement || ''
|
} else if (this.type === 'privacy') {
|
this.content = res.data.privacyAgreement || ''
|
} else if (this.type === 'contact') {
|
this.content = res.data.aboutUs || ''
|
} else if (this.type === 'serverIntroduce') {
|
this.content = res.data.serverIntroduce || ''
|
}
|
const titleMap = {
|
'about': '关于我们',
|
'protocol': '用户协议',
|
'privacy': '隐私政策',
|
'contact': '用户协议',
|
'serverIntroduce': '规范须知'
|
}
|
uni.setNavigationBarTitle({
|
title: titleMap[this.type] || '详情'
|
})
|
}
|
}
|
}
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
.rich-text-page {
|
min-height: 100vh;
|
background: #ffffff;
|
padding: 30rpx;
|
box-sizing: border-box;
|
}
|
|
.rich-content {
|
width: 100%;
|
font-size: 28rpx;
|
color: #333333;
|
line-height: 1.6;
|
|
::v-deep {
|
image {
|
max-width: 100% !important;
|
height: auto !important;
|
}
|
p {
|
margin-bottom: 20rpx;
|
}
|
}
|
}
|
</style>
|