<template>
	<view>
		<view class="u-content">
			<u-parse :html="list.trainingItemContent"></u-parse>
		</view>
	</view>
</template>

<script>
	import {
		selectNurseAppletPersonTrainingItemDetailsList,
	} from '@/api/Videolearning/index.js'
	import baseurl from '@/api/baseurl.js'
	export default {
		data() {
			return {
				baseurl: undefined,
				nurseStationPersonId: undefined,
				list: undefined
			};
		},
		methods: {
			info() {
				selectNurseAppletPersonTrainingItemDetailsList(this.trainingItemId, this.nurseStationPersonId).then(
					res => {
						res.data.trainingItemContent = res.data.trainingItemContent.replace(/\<img/gi,
							"<br/> <img class='richPic'")
						res.data.trainingItemContent = res.data.trainingItemContent.replace(/\<p/gi,
							"<p class='ptext'")
						this.list = res.data
					})
			},
		},
		onLoad(options) {
			const that = this
			this.baseurl = baseurl
			this.trainingItemId = options.trainingItemId
			const value = uni.getStorageSync('nursePersonId');
			if (value) {
				that.nurseStationPersonId = value
				that.info();
			} else {}
		},
	}
</script>

<style lang="scss">
	page {
		background-color: #fff;
	}

	/deep/ .ptext {
		margin-top: 20rpx;
	}

	/deep/ .ptext:nth-child(1) {
		text-indent: 2em;
	}

	/deep/ .ql-size-small {
		font-size: 20rpx;
	}

	/deep/ .ql-size-large {
		font-size: 36rpx;
	}

	/deep/ .ql-size-huge {
		font-size: 46rpx;
	}

	/deep/ .richPic {
		width: 100% !important;
		height: 100% !important;
	}

	.u-content {
		margin: 15rpx auto;
		width: 96%;
		text-indent: 2em;
	}
</style>
