<template>
	<view class="container">
		<uni-nav-bar dark :fixed="true" backgroundColor="#3F9EFF" statusBar="false" left-icon="left" left-text="返回"
			@clickLeft="toBack">
			<view style="width: 100%;display: flex;flex-direction: row;justify-content: center;align-items: center;">
				<text style="color: white;font-size: 1rem;">{{title}}</text>
			</view>
		</uni-nav-bar>
		<view class="content" style="margin-top: 10px;">
			<view class="title">
				{{noticeInfo.title}}
			</view>
			<view class="static">
				<view class="left">
					<view class="block">
						{{noticeInfo.releaseTime}}
					</view>
				</view>
			</view>
			<view class="detail">
				<u-parse :html="noticeInfo.content"></u-parse>
			</view>
		</view>
	</view>
</template>

<script>
	import http from '@/http/api.js';
	export default {
		data() {
			return {
				title: '公告详情页',
				noticeInfo: {
					'title': '',
					'releaseTime': '',
					'content': '',
				}

			};
		},
		onLoad(options) {
			console.log(options.id)
			this.getNotice(options.id);
		},
		methods: {
			toBack() {
				uni.navigateBack({
					delta: 1
				})
			},
			getNotice(id) {
				const that = this;
				http.request({
					url: '/galaxy-business/notice/detail',
					method: 'GET',
					params: {
						'id': id,
					},
				}).then(res => {
					console.log(res.data)
					if (res.data != null) {
						that.noticeInfo = res.data;
					}

				}).catch(err => {
					console.log(err)
				})
			},
		}
	};
</script>

<style lang="scss">
	.container {
		padding: 0 0 150rpx;
	}

	.right-nav {
		display: flex;
		align-items: center;
		margin-right: 40rpx;

		.icon {
			height: auto;

			&-search {
				width: 40rpx;
				margin-right: 40rpx;
			}

			&-menu {
				width: 40rpx;
			}
		}
	}

	.header {
		display: flex;
		align-items: center;
		padding: 44rpx;

		.avatar {
			flex-shrink: 0;
			width: 69rpx;
			height: 69rpx;
			background: #ffffff;
			border: 1px solid #14b9c8;
			border-radius: 50%;
		}

		.info {
			flex: 1;
			margin-left: 14rpx;

			.name {
				display: flex;
				align-items: center;
				font-size: 28rpx;
				font-family: PingFang SC;
				font-weight: bold;
				color: #000000;
				line-height: 36rpx;

				.tag {
					margin-left: 10rpx;
					display: inline-block;
					padding: 8rpx 10rpx;
					font-size: 14rpx;
					font-family: PingFang SC;
					font-weight: 500;
					color: #4cbeca;
					line-height: 21rpx;
					border: 1px solid #0bb9c8;
					border-radius: 6px;
				}
			}

			.date {
				font-size: 24rpx;
				font-family: PingFang SC;
				font-weight: 500;
				color: #a3a3a3;
				line-height: 36rpx;
			}
		}

		.btn {
			padding: 8rpx 19rpx;
			background: #e6e6e6;
			border-radius: 6rpx;
			font-size: 20rpx;
			font-family: PingFang SC;
			font-weight: bold;
			color: #4cbeca;
			line-height: 1;
		}
	}

	.content {
		padding: 0 44rpx;

		.title {
			font-size: 40rpx;
			font-family: PingFang SC;
			font-weight: bold;
			color: #000000;
			line-height: 47rpx;
		}

		.static {
			margin-top: 34rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;

			.left,
			.right {
				display: flex;
				align-items: center;

				.block {
					display: flex;
					align-items: center;
					margin-right: 10rpx;
				}
			}

			.left {
				font-size: 20rpx;
				font-family: PingFang SC;
				font-weight: bold;
				color: #787878;
				line-height: 1;

				.gf {
					width: 24rpx;
					height: 24rpx;
					margin-right: 8rpx;
				}
			}

			.right {
				font-size: 20rpx;
				font-family: PingFang SC;
				font-weight: bold;
				color: #787878;
				line-height: 1;

				.l {
					width: 25rpx;
					height: auto;
					margin-right: 6rpx;
				}
			}
		}

		.detail {
			font-size: 24rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: #000000;
			line-height: 47rpx;
			margin-top: 50rpx;
		}
	}

	.footer {
		position: fixed;
		bottom: 0;
		left: 0;
		right: 0;
		z-index: 999;
		height: 100rpx;
		padding: 20rpx;
		box-sizing: border-box;
		display: flex;
		align-items: center;
		justify-content: center;
		background-color: #ffffff;

		.ipt {
			width: 380rpx;
			height: 77rpx;
			background: #f7f7f7;
			border-radius: 38px;
			padding: 0 37rpx;
			box-sizing: border-box;
			margin-right: 20rpx;
		}

		.control {
			flex: 1;
			display: flex;
			align-items: center;
			justify-content: space-around;

			.block {
				display: flex;
				align-items: center;
				justify-content: center;
				flex: 1;
			}

			.icon {
				height: auto;
			}

			.c {
				width: 41rpx;
				margin-right: 10rpx;
			}

			.s {
				width: 36rpx;
			}

			.t {
				width: 31rpx;
			}
		}
	}
</style>
