<template>
	<view class="container">
		<view class="colking_list">
			<view class="colking_item" v-for="(item, index) in qetypelist" :key="index" @click="casequeview(item.typeid)" :class="[nowsetyindex === index ? 'colking_itemse' : '']">
				{{ item.title }}
			</view>
		</view>
		<view v-for="(item, index) in evenNumbers" :key="index" class="question_details">{{ item.quondels }}</view>
	</view>
</template>

<script>
export default {
	components: {},
	data() {
		return {
			primary:this.$theme.primary,
			settingFile:getApp().globalData.siteinfo,
			// 当前显示的问题视图层index
			nowsetyindex: 0,
			//常见问题类集
			qetypelist: [{ typeid: 0, title: '全部' }, { typeid: 1, title: '土地' }, { typeid: 2, title: '土地2' }],
			// 常见问题集(总池)
			questionlist: [{ typename: '土地', typeid: 1, quondels: '问题1' }, { typename: '土地2', typeid: 2, quondels: '问题2' }]
		};
	},
	onLoad(options) {},
	onShow: function() {},
	methods: {
		//切换当前问题视图层
		casequeview(typeid) {
			var that = this;
			that.nowsetyindex = typeid;
		}
	},
	computed: {
		//常见问题集(筛选结果池)
		evenNumbers: function() {
			return this.questionlist.filter(item => {
				if (this.nowsetyindex !== 0) {
					if (item.typeid === this.nowsetyindex) {
						return item;
					}
				} else {
					return item;
				}
			});
		}
	},
	// #ifndef MP-WEIXIN
	// 标题栏input搜索框点击
	onNavigationBarSearchInputClicked: async function(e) {},
	//点击导航栏 buttons 时触发
	onNavigationBarButtonTap(e) {}
	// #endif
};
</script>

<style lang="scss">
.container {
}
.colking_list {
	display: flex;
	justify-content: flex-start;
	margin-top: 15rpx;
}
.colking_item {
	margin: 0 25rpx;
	font-size: 32rpx;
	color: #000;
	padding-bottom: 15rpx;
}
.colking_itemse {
	color: #56AB2F;
	border-bottom: 3px solid #56AB2F;
}
.question_details {
	width: 90%;
	margin: 25rpx 5% 0 5%;
}
</style>
