<template>
	<view class="page">
		<nav-bar title="Languages" bgColor="#fff"></nav-bar>
		<view class="cell_list" @click="changeLang('en')">
			<view class="cell_left txt">English</view>
			<view class="cell_right">
				<uni-icons size="20" v-if="lang=='en'" style=" margin-left: 10px; color: blue;" type="checkbox-filled"></uni-icons>
			</view>
		</view>
		<view class="cell_list" @click="changeLang('zh')">
			<view class="cell_left txt">简体中文</view>
			<view class="cell_right">
				<uni-icons size="20" v-if="lang=='zh'" style=" margin-left: 10px; color: blue;" type="checkbox-filled"></uni-icons>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		mapState,
		mapMutations
	} from 'vuex';
	export default {
		data() {
			return {
				lang: 'en'
			};
		},
		computed: {
			...mapState(['userInfo'])
		},
		//第一次加载
		onLoad(e) {
			if(this.$i18n.locale=="en"){
				this.lang = 'en';
			}else{
				this.lang = 'zh'
			}
		},
		//页面显示
		onShow() {},
		//方法
		methods: {
			onPageJump(url) {
				uni.navigateTo({
					url: url+""
				});
			},
			onTokenJump(url) {
				this.judgeLogin(() => {
					uni.navigateTo({
						url: url
					});
				});
			},
			changeLang(l){
				this.$i18n.locale = l;
				setTimeout(() => {
					uni.navigateBack();
				}, 500);
			},
		},
		//页面隐藏
		onHide() {},
		//页面卸载
		onUnload() {},
		//页面下来刷新
		onPullDownRefresh() {},
		//页面上拉触底
		onReachBottom() {},
		//用户点击分享
		onShareAppMessage(e) {
			return this.wxShare();
		}
	};
</script>
<style lang="scss" scoped>
	@import '@/style/mixin.scss';
	body{background-color: #fff;}
	.rechargeTitle{
		font-weight: 400;font-size: 16px;color: #999999;line-height: 23px; text-align: center; margin-top: 30px;
	}
	.rechargeNet{
		font-weight: 600;font-size: 20px;color: #333;line-height: 23px; text-align: center; margin-top: 20px;
	}
</style>