<template>
	<view>
		<!-- 头部 -->
		<headContent>
			<template #left>
				<reverse-back />
			</template>
			<template #content>
				<view class="haed-title">
					系统设置
				</view>
			</template>
		</headContent>

		<gap />
		<view class="set-list">
			<view class="set-item" @click.stop="setLanguage()">
				<text>语言切换</text>
				<view class="set-moer">
					<text class="set-moer-text">简体中文</text>
					<text class="set-moer-icon iconfont">&#xe88e;</text>
				</view>
			</view>
			<view class="set-item" @click.stop="setDiagnose()">
				<text>网络检查</text>
				<view class="set-moer">
					<text class="set-moer-icon iconfont">&#xe88e;</text>
				</view>
			</view>
			<view class="set-item" @click.stop="selectStocksColor()">
				<text>涨跌颜色</text>
				<view class="set-moer">
					<text class="set-moer-text set-color">{{ stocksColorObj[stocksColor] }}</text>
					<text class="set-moer-icon iconfont">&#xe88e;</text>
				</view>
			</view>
		</view>

		<setting-color ref="settingColorRef" />
	</view>
</template>

<script>
	import {
		mapGetters
	} from 'vuex'
	import reverseBack from "@/components/headModules/reverse-back.vue"
	export default {
		name: 'setting',
		components: {
			reverseBack
		},
		computed: {
			...mapGetters([
				'stocksColor'
			]),
		},

		data() {
			return {
				stocksColorObj: this.$stocksColorObj,
			};
		},
		methods: {
			// 修改股票颜色
			selectStocksColor() {
				return false
				this.$nextTick(() => {
					this.$refs.settingColorRef.open();
				})
			},

			// 网络检测
			setDiagnose() {
				uni.navigateTo({
					url: '/pages/content/diagnose'
				})
			},
			
			// 语言切换
			setLanguage() {
				return false
				uni.navigateTo({
					url: '/pages/content/language'
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.set-list {
		width: 100%;
		padding: 0 $pages-padding;

		.set-item {
			display: flex;
			justify-content: space-between;
			align-items: center;
			height: 90rpx;
			width: 100%;
			border-bottom: 1rpx solid $border-color;
			font-size: 24rpx;
			color: #0f0f0f;

			text {
				flex-shrink: 0;
			}

			.set-moer {
				flex-shrink: 0;
				display: flex;
				align-items: center;

				.set-moer-text {
					font-size: 26rpx;
				}

				.set-moer-icon {
					color: #ccc;
					font-size: 28rpx;
				}

				.set-color {
					color: $Theme-Color;
				}
			}
		}
	}
</style>