deming/pageE/mine/ArticleDetails.vue
2020-06-24 16:39:31 +08:00

47 lines
968 B
Vue

<template>
<view class="article-details">
<rich-text :nodes="nodes"></rich-text>
</view>
</template>
<script>
export default {
data() {
return {
nodes: '',
}
},
onLoad(option) {
// console.log(option);
this.getUseHelpInfo(option.id);
},
methods: {
setTitle(title){
uni.setNavigationBarTitle({
title: title
});
},
// 处理富文本
unescapeHTML (temp){
temp = "" + temp;
return temp.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&").replace(/&quot;/g, '"').replace(/&apos;/g, "'");
},
getUseHelpInfo(id) {
this.$u.api.getUseHelpInfo({
launch_id: id,
}).then((res)=>{
if (res.errCode == 0) {
this.nodes = this.unescapeHTML(res.data.info[0].help_info);
this.setTitle(res.data.info[0].help_title);
}
})
}
},
}
</script>
<style lang="scss" scoped>
.article-details {
min-height: calc(100vh - var(--window-top));
background: #ECECEC;
padding: 20rpx 35rpx 0;
}
</style>