<template>
	<view class="content">
		<view class="title">大卫博士学位争霸赛规则</view>
		<video style="width:100%; height:200px" v-if="pathVideo && seat == 0" :src="pathVideo" controls="controls" />
		<!-- <rich-text :nodes="contents"></rich-text> -->
		<view class="ql-container ql-snow" style="border:none">
		    <view class="ql-editor" v-html="contents"></view>
			<video style="width:100%; height:200px" v-if="pathVideo && seat == 1" :src="pathVideo" controls="controls" />
		 </view>
	</view>
</template>

<script>
	import { GetRule } from '../../api.js'
	import 'quill/dist/quill.snow.css'
	export default {
		data() {
			return {
				pageTitle: '赛季规则',
				contents: '',
				pathVideo:'',
				seat: 0
			};
		},
		onLoad() {
			this.getRules()
		},
		methods:{
			getRules() {
				this.$ajax.get(`${GetRule}`).then(([, { data: { code, msg, data }}]) => {
					if (code == 200) {
						this.contents = data.body
						this.pathVideo = data.video_url
						this.seat = data.seat
					} else {
						uni.showModal({ title: '提示', showCancel: false, content: msg })
					}
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
		.content {
			padding: 28rpx 20rpx;
			.title {
				text-align: center;
				font-size: 36rpx;
				font-weight: bold;
				margin-bottom: 20rpx;
			}
			.title1 {
				font-size: 28rpx;
			}
			.text {
				font-size: 26rpx;
				text-indent: 2em;
			}
			.item {
				font-size: 24rpx;
				text-indent: 2em;
			}
		}
</style>
