<template>
	<view class="content">
		<view class="top-haed">
			<view class="" @click="back()">
				<u-icon name="arrow-left" size="20"></u-icon>
			</view>
			<view class="title_">量表详情页</view>
			<view class=""></view>
		</view>

		<!-- <view class="head">
			<image class="img" src="/static/images/liangbiao-bg.png" mode="widthFix"></image>
		</view> -->
		<view class="head">
			<image src="../../static/images/banner2.png"></image>
		</view>
		<view class="center">

			<view class="center-title">{{ table.tableInfo.tableName }}</view>
			<view class="center-text">
				<u-parse :content="table.tableInfo.tableJson" class="table-content"></u-parse>
			</view>
		</view>
		<view class="bottom">
			<view class="btn" @click="toFillInfo">填写信息</view>
		</view>
	</view>
</template>

<script>
	let music = uni.createInnerAudioContext(); //创建播放器对象
	export default {
		data() {
			return {
				tableAlias: null,
				table: {
					tableInfo: {
						tableName: null,
						tableJson: null,
						tableBgmusic: null
					}
				}
			}
		},
		onLoad(option) {
			this.tableAlias = option.alias
			this.table = JSON.parse(uni.getStorageSync(option.alias));
			console.log('36', this.table, option)
			// this.playBgMusic(this.table.tableInfo.tableBgmusic);
		},
		methods: {
			back() {
				uni.navigateBack()
			},
			playBgMusic(url) {
				if (url) {
					url = this.baseUrl + url;
					music.src = url; //选择播放的音频
					music.loop = true;
					music.play(); //执行播放
				}
			},
			toFillInfo() {
				console.log('48', this.table.tableInfo.tableBgmusic)
				uni.navigateTo({
					url: '/tablePackage/pages/infoFill?alias=' + this.tableAlias + "&tableName=" + this.table
						.tableInfo.tableName
				})
			}
		}
	}
</script>

<style lang="less">
	.top-haed {
		width: 60%;
		margin: 0 auto;
		display: flex;
		align-items: center;
		justify-content: space-between;
		height: 44px;

		.title_ {
			font-weight: bold;
		}

	}

	.head {
		width: 60%;
		height: 350px;
		margin: 0 auto;

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

	.content {


		.center {
			width: 60%;
			margin: 45px auto;
			margin-top: 45px;
			line-height: 20px;
			border-radius: 10px;
			background-color: rgba(255, 255, 255, 1);
			text-align: center;
			box-shadow: 0px 2px 6px 0px rgba(228, 228, 228, 100);
			padding: 22rpx 60rpx;

			.center-title {
				color: rgba(16, 16, 16, 1);
				font-size: 20px;
				font-weight: bold;
				margin-bottom: 24rpx;
			}

			.center-text {
				color: rgba(82, 81, 81, 1);
				font-size: 14px;
				text-align: left;
			}

			.attention {
				display: flex;
				align-items: center;
				font-size: 28rpx;
				color: rgba(82, 81, 81, 1);
				margin-top: 20rpx;
				margin-bottom: 10rpx;

				text {
					margin-left: 10rpx;
				}
			}
		}

		.bottom {
			display: flex;
			justify-content: center;
			margin-top: 50rpx;

			.btn {
				width: 700rpx;
				height: 100rpx;
				border-radius: 50rpx;
				background-color: rgba(40, 123, 206, 1);
				color: rgba(255, 255, 255, 1);
				font-size: 14px;
				text-align: center;
				line-height: 100rpx;
				margin-bottom: 50rpx;
			}
		}

		.table-content {
			text-indent: 2em;
		}
	}
</style>