<template>
	<view>
		<view class="chapter_item p14" v-for="(item,index) of chapterList" :key="index" @tap="toQuestion(item.configItemCode)">
			{{item.configItemName}}
		</view>
	</view>
</template>

<script>
	import {
		querySysConfigList
	} from '@/jtools/api/question';
	import storage from '@/jtools/storage';
	export default {
		data() {
			return {
				chapterList:[]
			}
		},
		onLoad(){
			this.getChapterList()
		},
		methods:{
			getChapterList(){
				const carTypeId=storage.get('carType') || '1001'
				querySysConfigList(carTypeId,'ChapterOfSubjectOne').then(resp=>{
					if(resp.code==='0000'){
						this.chapterList=resp.data
					}
				})
			},
			toQuestion(code){
				uni.navigateTo({
					url:"/pages/questionBank/questionBank?navTitle=章节技巧&chapter="+code
				})
			}
		}
	}
</script>

<style scoped>
	.chapter_item{
		border-bottom: 1px solid rgb(210,209,214);
		background-color: #fff;
	}
	.chapter_item:hover{
		background-color: rgb(210,209,214);
	}
</style>