<template>
	<view :style="'background-color: '+theme.bg" style="padding: 10rpx 0;">
		
		<myNav :title="titleFilter"></myNav>
		<view class="width-100b padding-30" v-html="content">
			
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title:'about_us',
				content:'',
				theme:'',
			}
		},
		computed: {
			i18n() {
				return this.$t('message');
			},
			titleFilter(){
				if(this.title=='about_us'){
					return this.i18n.mine.about.title
				}
				if(this.title=='user_item'){
					return  this.i18n.mine.about.list1
				}
				if(this.title=='privacy_treaty'){
					return  this.i18n.mine.about.list2
				}
				if(this.title=='agreement'){
					return  this.i18n.mine.about.list5
				}
				if(this.title=='tuikuan'){
					return  this.i18n.recharge.text18
				}
			}
		},
		onLoad(option) {
			this.title = option.title
			this.getInfo()
		},
		onShow() {
			if (uni.getStorageSync("theme") == "dark") {
				this.theme = this.$store.state.darkTheme
			}else{
				this.theme = this.$store.state.lightTheme
			}
		},
		methods: {
			getInfo(){
				this.post('/publics/get_common_data').then(res => {
					console.log(res)
					if(res.code == 1){
						if(this.title == 'about_us'){
							this.content = res.data.about_us
						}
						if(this.title == 'user_item'){
							this.content = res.data.user_item
						}
						if(this.title == 'privacy_treaty'){
							this.content = res.data.privacy_treaty
						}
						if(this.title == 'agreement'){
							this.content = res.data.agreement
						}
						if(this.title == 'tuikuan'){
							this.content = res.data.refund_text
						}
					}
				})
			}
		}
	}
</script>

<style>
</style>
