<template>
|
<div class="protocol">
|
<van-nav-bar
|
:title="title"
|
left-text
|
left-arrow
|
@click-left="onClickLeft"
|
/>
|
<div class="contentBox" v-html="contentBox"></div>
|
</div>
|
</template>
|
<script>
|
export default {
|
data() {
|
return {
|
protocol: "",
|
title: "",
|
contentBox: ""
|
};
|
},
|
created() {
|
this.getProtocol();
|
},
|
methods: {
|
onClickLeft() {
|
var that = this;
|
that.$router.push({
|
path: "/personalCenter"
|
});
|
},
|
//获取用户协议
|
getProtocol() {
|
var that = this;
|
that.MG.resource
|
.getItem({
|
path: "tourism_protocol",
|
fields: {
|
tourism_content: [],
|
tourism_tag: []
|
}
|
})
|
.then(res => {
|
try {
|
const agreementData = res.datas.find(
|
e => e.refCode == "tourism_userRegistrationAgreement"
|
);
|
const teacherData = res.datas.find(
|
e => e.refCode == "tourism_teacherCertificationAgreement"
|
);
|
if (
|
agreementData &&
|
agreementData.tourism_content &&
|
this.$route.query.type
|
) {
|
that.title = agreementData.name;
|
that.contentBox = agreementData.tourism_content.replace(
|
/<strong>/gi,
|
'<strong class="p_class">'
|
);
|
}
|
if (
|
teacherData &&
|
teacherData.tourism_content &&
|
!this.$route.query.type
|
) {
|
that.title = teacherData.name;
|
that.contentBox = teacherData.tourism_content.replace(
|
/<strong>/gi,
|
'<strong class="p_class">'
|
);
|
}
|
} catch (error) {
|
console.log(error);
|
}
|
});
|
}
|
}
|
};
|
</script>
|
<style scoped>
|
.protocol {
|
width: 100vw;
|
height: 100vh;
|
}
|
.contentBox {
|
padding: 30px;
|
box-sizing: border-box;
|
height: calc(100vh - 46px);
|
overflow: auto;
|
}
|
</style>
|