<template>
	<view class="container safe-area-inset-bottom">
		<MessageNotification />

		<view class="_html" v-if="content">
			<u-parse :html="content"></u-parse>
		</view>

		<view class="img" v-if="!content">
			<image :src="infoList.cover" mode=""></image>
		</view>


		<button type="default" open-type="contact" class="btn">
			<u-icon name="kefu-ermai" color="#fff" size="36" style="margin-right: 8rpx;"></u-icon>
			咨询客服
		</button>
	</view>
</template>

<script>
	import {
		articleInfo
	} from '../../request/api/api';
	export default {
		data() {
			return {
				infoList: "",
				id: "",
				content: "",
			}
		},
		onLoad(op) {
			this.id = op.id
		},
		methods: {
			//获取药品分类
			getInfo() {
				articleInfo({
					method: "get",
					data: {
						id: this.id,
						store_id: uni.getStorageSync('store_id') || '11001',
					}
				}).then((res) => {
					// console.log(res, 'list');
					if (res.data.errcode == 0) {
						this.infoList = res.data.data
						this.content = res.data.data.content
					}
				})
			},
		},
		mounted() {
			this.getInfo()
		},
	}
</script>

<style lang="scss" scoped>
	.container {
		background: #F6F9FB;
		width: 750rpx;
		max-height: 100%;
		min-height: 100vh;
		padding-bottom: env(safe-area-inset-bottom);
		
		._html{
			padding: 20rpx 32rpx 120rpx;
		}

		.img {
			width: 100vw;
			height: 100vh;

			image {
				width: 100%;
				height: 100%;
			}
		}


		.btn {
			width: 686rpx;
			height: 86rpx;
			background: #569afe;
			border-radius: 68rpx;
			color: #fff;
			position: fixed;
			bottom: env(safe-area-inset-bottom);
			left: 4%;
			margin: 10rpx auto;
			line-height: 86rpx;
			display: flex;
			align-items: center;
			justify-content: center;
			z-index: 9999;
		}
	}
</style>