<template>
	<view class="" style="margin: 0 40upx;">
		<u-navbar  :back-text="i18n('Back')" :back-text-style="backStyle"
			back-icon-color="#fff" title-color="#fff" 
			:title="i18n('InformationDetails')" 
			:background="background">
		</u-navbar>
		<view class="overFlow">
			{{initData.title}}
		</view>
		<view class="time">
			{{ formatDate(initData.publishDate) }} | {{$t('common.Source')}} {{initData.auther}}
		</view>
		
		<rich-text class="content" :nodes="initData.contentHtml" 
		></rich-text>
	</view>
</template>

<script>
export default {
	data() {
		return {
			baseEntityId:null,
			initData:{},
			background:{
				backgroundImage: 'linear-gradient(270deg, #4BC0E2 0%, #538BE7 100%)',
			},
			backStyle:{
				color:'#fff'
			},
		}
	},
	onShow(){
		this.getinitData();
	},
	onLoad(option){
		this.baseEntityId = option.id;
		
	},
	methods:{
		i18n (data) {
		    return this.$t('common.'+data);
		},
		async getinitData(){
			const res = await this.$myRequest({
				url: 'cms/cmsInformationViews/getInformationById',
				data: {
					baseId:this.baseEntityId,
					language:this.$i18n.locale.toUpperCase()
				}
			});
			if(res.data){
				this.initData = res.data.cmsInformationView;
			}
		}
	}
}
</script>

<style lang="scss" scoped>
	page {
		background-color: #fff;
	}
	.overFlow {
		
		margin: 10upx 0upx;
		font-size:36upx;
		// text-align: center;
		font-weight: 700;
	}
	.time {
		margin: 0 0upx;
	}
	/deep/.u-line-1 {
		overflow: visible !important;
	}
</style>
