Files
car-system-app/pages/common/textview/index.vue
2024-06-26 20:22:11 +08:00

127 lines
2.9 KiB
Vue

<template>
<view class="page">
<u-navbar :title="title" :autoBack="true" safeAreaInsetTop placeholder>
</u-navbar>
<u-parse :content="content"></u-parse>
</view>
</template>
<script>
import {
getUserprivacyinfo,
getInviteRule,
getAboutusinfo,
getClockRule,
getRentalRule,
getCarBuyWayInfo,
getAgreementApplication,
getRebateactivitiesinfo
} from '@/api/system/config.js'
import {
articleInfo
} from "@/api/message/message.js"
export default {
data() {
return {
title: '',
content: '',
type: 0
}
},
onLoad(options) {
console.log(options);
this.title = options.title
if (options.title == '邀请规则') this.getInviteRuleFn()
if (options.title == '用户协议') this.getUserAgreement()
if (options.title == '隐私政策') this.getPrivacyPolicy()
//天天打卡
if (options.title == '规则详情') this.getClockRuleFn()
if (options.title == '租卖协议') this.getRentalRuleFn()
if (options.title == '应用介绍') this.getAgreementApplicationFn()
if (options.title == '返佣规则') this.getRebateactivitiesinfoFn()
if (options.title == '购车方案') {
this.getCarBuyWayInfoFn(options.carBuyWayId)
}
if (options.id) {
articleInfo(options.id).then(res => {
this.title = res.data.title
this.content = res.data.content
})
}
},
methods: {
//获取返佣规则
getRebateactivitiesinfoFn(){
getRebateactivitiesinfo().then(res => {
this.content = JSON.parse(res.data).agreement
})
},
//获取应用介绍
getAgreementApplicationFn(){
getAgreementApplication().then(res => {
this.content = JSON.parse(res.data).agreement
})
},
//获取购车方案详情
getCarBuyWayInfoFn(id){
getCarBuyWayInfo(id).then(res=>{
this.title= res.data.name
this.content = res.data.content
})
},
//获取租车协议
getRentalRuleFn(){
getRentalRule().then(res => {
this.content = JSON.parse(res.data).agreement
})
},
//获取天天打卡规则
getClockRuleFn() {
getClockRule().then(res => {
this.content = JSON.parse(res.data).agreement
})
},
//获取邀请规则
getInviteRuleFn() {
getInviteRule().then(res => {
this.content = JSON.parse(res.data).agreement
})
},
// 获取用户协议
getUserAgreement() {
getAboutusinfo().then(res => {
this.content = JSON.parse(res.data).agreement
})
},
// 获取隐私政策
getPrivacyPolicy() {
getUserprivacyinfo().then(res => {
this.content = JSON.parse(res.data).agreement
})
},
}
}
</script>
<style scoped>
page {
background-color: #ffffff;
}
.page {
padding: 48rpx 40rpx;
border-top: 1rpx solid #ededed;
}
.view-title {
font-weight: bold;
}
.view-content {
font-size: 26rpx;
padding: 12px 5px 0;
color: #333;
line-height: 24px;
font-weight: normal;
}
</style>