56 lines
2.1 KiB
Vue
56 lines
2.1 KiB
Vue
<template>
|
||
<view class="">
|
||
<!-- 使用标题栏 -->
|
||
<status-nav :statusBackw="true" :whereCome="whereCome*1" :statusTitle="true" :title-val="'公告详情'" :tabcolor="'#ffffff'"></status-nav>
|
||
<view :style="{paddingTop:(statusHNH+10)+'px'}">
|
||
<view class="margin20" style="margin-top: 0;">
|
||
<view class="fon32 padding-s10">{{dataInfo.title}}</view>
|
||
<view class="fon24 color6 margin-sx10 disac"><view>发布时间:{{$toolAll.tools.timestampToTime(dataInfo.create_time)}}</view><view class="margin-z20">来源:{{dataInfo.source}}</view></view>
|
||
<view class="borbot margin-sx20"></view>
|
||
<rich-text class="fon24" :nodes="conArr" style="text-indent:2em;line-height: 46rpx;"></rich-text>
|
||
<view class="fon24" style="text-indent:2em;line-height: 46rpx;">{{dataInfo.summary}}</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</template>
|
||
|
||
<script>
|
||
export default {
|
||
data() {
|
||
return {
|
||
whereCome:'',
|
||
dataInfo:{},
|
||
conArr:[],
|
||
statusHNH:uni.getStorageSync('statusHNH')
|
||
}
|
||
},
|
||
onLoad(options) {
|
||
let ya = this
|
||
let here = options.index
|
||
ya.whereCome = here
|
||
if(uni.getStorageSync('noticeInfo')!=undefined){
|
||
this.dataInfo = uni.getStorageSync('noticeInfo');
|
||
this.conArr = this.$toolAll.tools.escape2Html(this.dataInfo.content)
|
||
this.conArr = ya.escape2Html(this.dataInfo.content);
|
||
}
|
||
},
|
||
onShow() {
|
||
this.$toolAll.tools.guoq()
|
||
},
|
||
methods: {
|
||
//转义方法
|
||
escape2Html(str) {
|
||
var arrEntities = { 'lt': '<', 'gt': '>', 'nbsp': ' ', 'amp': '&', 'quot': '"' };
|
||
return str.replace(/&(lt|gt|nbsp|amp|quot|src);/ig, function (all, t) { return arrEntities[t]; }).replace('<section', '<div').replace(/\<img/g, '<img style="max-width:100%;height:auto" ').replace(/src=\"/g,'src="https://dengrui.scdxtc.cn');
|
||
}
|
||
},
|
||
onUnload() {
|
||
uni.removeStorageSync('noticeInfo')
|
||
}
|
||
}
|
||
</script>
|
||
|
||
<style>
|
||
page{background-color: #FFFFFF;}
|
||
</style>
|