rk
2026-04-23 3696830fbaf2fd97d98020087abf20917e491bdc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<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>