<template>
	<view>
		<uni-nav-bar id="nav-bar" status-bar="true" @clickLeft="onBack()" :title="title" color="#000000" fixed="true"
			:border="false">
			<view slot="left">
				<view class=" flex align-center margin-left">
					<image class="p-left-arrow" src="../../../static/p-left-arrow.png"></image>
				</view>
			</view>

		</uni-nav-bar>
		<view class="card-view settings-item" v-for="(item,index) in list" :key="index">
			<view class="content position-relative" @tap="onNavTo(item)">
				<text class="text-black text-regular text-16px margin-left-xl">{{item.gameName}}</text>
				<view class="only-arrow"></view>
			</view>
		</view>
	</view>
</template>

<script>
	import reqUtil from "@/util/util-js/requstUtil.js"
	import config from "@/common/config.js"
	import {
		mapState
	} from 'vuex';
	export default {
		computed: mapState(['platform', 'gamePlatform']),
		data() {
			return {
				list: [{
						gameName: '新手指导',
						navType: 'password'
					}, {
						gameName: '蓝牙连接指导',
						navType: 'guide'
					},
					{
						gameName: '游戏手柄校准指导',
						navType: 'feedback'
					},
					{
						gameName: '游戏指导',
						navType: 'feedback'
					}
				],
				title: "新手指导",
				type: '',
			}
		},
		onLoad(option) {



		},
		methods: {

			onBack() {
				uni.navigateBack({
					delta: 1
				})
			},

			onNavTo(item) {
				console.log(item);
				let url = '';
				switch (item.navType) {
					case 'password':
						//todo 判断密码是否已经设置。如果没有，进入设置密码，如果已经设置了，进入修改密码；
						break;
					case 'guide':
						break;
					case 'feedback':
						break;
				}


				// uni.navigateTo({
				// 	url: url,
				// 	success: res => {},
				// 	fail: () => {},
				// 	complete: () => {}
				// });
			}
		}
	}
</script>

<style>
	.content {
		display: flex;
		flex-direction: row;
		align-items: center;
		height: 50px;
	}

	.settings-item {
		position: relative;
		background-color: #FFFFFF;
		border-radius: 10px;
	}
</style>
