<style>
	.newsInDetail .acdetailTop {
		width: 100%;
		height: auto;
		background-color: #fff;
		font-family: pingfang !important;
		padding: 10px;
	}

	.newsInDetail .acdetailImg {
		width: 100%;
		height: 190px;
		border-radius: 3px;
		overflow: hidden;
	}

	.newsInDetail .acdetaiTitle {
		margin: 15px auto;
		color: #0B0B0B;
		font-size: 16px;
		font-weight: 600;
	}

	.newsInDetail .acdetaiWriter {
		display: flex;
		justify-content: space-between;
		color: #B9B9B9;
		font-size: 12px;
		margin-top: 10px;
		align-items: center;
	}

	.newsInDetail .acdetaiLine {
		width: 100%;
		height: 10px;
		background-color: #F3F5F7;
	}

	.newsInDetail .acdetailBottom {
		width: 100%;
		min-height: 283px;
		padding: 15px 10px;
		background-color: #fff;
	}

	.newsInDetail .newsInDetail_Intro {
		color: #404040;
		font-size: 14px;
		line-height: 25px;
		margin-top: 20px;
	}
</style>
<template>
	<view class="newsInDetail" style="height:100vh;">
		<view class="acdetailTop">
			<view class="acdetaiTitle">{{dataList.Title}}</view>
			<view class="acdetaiWriter">
				<view>
					<u-tag :text="dataList.Industry" type="primary" style="margin-right: 12px;"></u-tag>
					<text>{{dataList.PublishTimeStr}}</text>
				</view>
			</view>
		</view>
		<view class="acdetailBottom">
			<view class="newsInDetail_Intro" v-html="richtext"></view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				pageTitle: '新闻详情',
				msg: {
					Id: 0
				},
				dataList: {},
				richtext: '',
				mainColor:''
			}
		},
		created() {},
		mounted() {
			uni.setNavigationBarTitle({
				title: this.pageTitle,
			});
		},
		onLoad(option) {
			this.msg.Id = option.Id;
			this.getList();
		},
		methods: {
			getList() {
				this.request2({
						url: "/api/AppletTrade/GetCommerceNews",
						data: this.msg,
					},
					(res) => {
						if (res.resultCode == 1) {
							this.dataList = res.data
							this.richtext = this.dataList.NewsInfo.replace(/<img[^>]*>/gi, function(match, capture) {
								var match = match.replace(/style=\"(.*)\"/gi,
									'style="max-width:100% !important"');
								return match;
							});
						}
					}
				);
			}
		}
	}
</script>
