<!-- 说明页面(四合一) -->
<template>
	<view class="instructions bx">
		<navbar :leftClick="leftClick"></navbar>
		
		<view class="content">
			<view v-html="$t('page.instructions.' + $route.query.key)"></view>
			<!-- <u-parse v-else :content="info[type[$i18n.locale]]"></u-parse> -->
		</view>
	</view>
</template>

<script>
	import navbar from '@/components/base/m-navbar.vue'

	export default {
		components: {
			navbar
		},
		computed : {
			
			info(){
				let data = this[this.$route.query.type || 'outList'][this.$route.query.index]
				if(!data) return {}
				return data
			},
			
			title(){
				
				let key = this.$route.query.type == 'onList' ? 'onTitleList' : 'titleList'
				
				return this.$t(`page.instructions.${this[key][this.$route.query.index]}`)
			}
			
		},
		data() {
			return {
				titleList: ['tcTitle', 'eventTitle', 'faqTitle', 'aboutTtitle','agreementTitle'],
				onTitleList: ['', 'certificate'],
				onList : [],
				outList : [],
				type : {
					en : 'englishValue',
					es : "spanishValue",
					"zh" : "chineseValue"
				},
			}
		},
		onShow() {
			if(this.$route.query.index != 4){		//注册页面跳转过来的就不用登录，不然会一直跳登录页面去
				this.getIndexIcon()
			}
		},
		methods: {
			leftClick() {
				let url = this.$route.query.index == 4 ? '/pages/register/register' : "/pages/center/center"
				uni.navigateTo({
					url
				})
			},
			//获取首页图标
			getIndexIcon(){
				this.request('indexIcon').then(res => {
					if(res.code == 200){
						this.onList = res.result.onList;
						this.outList = res.result.outList;
					}
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.instructions {
		width: 750rpx;
		min-height: 100vh;
		background-color: $uni-bg-color;
		margin: 0 auto;
		background-size: 100%;
		background-repeat: no-repeat;
		color: $uni-bg-color-app;

		.content {
			width: 96%;
			margin: 20rpx auto;
			font-size: 28rpx;
			line-height: 50rpx;
		}

		.t-c,
		.event,
		.faq,
		.about-us{
			padding-top: 60rpx;
		}

		.event {
			image {
				width: 750rpx;
				height: 1000rpx;
			}
		}
	}
</style>