<template>
	<view>
		<navigation :showBack="true" class="navbg">
			<text class="big_title">
				{{this.$t('index').faq}}
			</text>
		</navigation>
		<scroll-view :scroll-y="true" class="main_con" style="max-height: 1320rpx;" lower-threshold="50">
		<view class="main">
				<view class="item" v-for="(item, index) in itemList" :key="index"
					:class="{'on': index==myIndex, 'bg': index==myIndex}">
					
					<view class="div1">
						<view class="btx">
							<image src="../../../static/tongyonh/plus.png" mode="aspectFit" class="teximg"
								v-if="index!=myIndex" @click="toClass(index)"></image>
							<image src="../../../static/tongyonh/xmark.png" mode="aspectFit" class="teximg"
								v-if="index==myIndex" @click.stop="noClass"></image>
							{{item.head}}
						</view>
				<scroll-view :scroll-y="true" class="main_con" style="max-height: 920rpx;" lower-threshold="50">
						<view class="div">
							{{item.body}}
						</view>
						</scroll-view>
					</view>
					
				</view>
		</view>
		</scroll-view>
	</view>
</template>

<script>
	import utils from '@/utils'
	import md5 from 'js-md5'
	import store from '@/store'
	import token from '@/utils/TokenUtil'
	import cont from "@/components/navigation/navigation.vue"

	export default {
		data() {
			return {
				myIndex: -1,
				recordInfo: [],
				form: {
					pageNum: 1,
					pageSize: 10,
					auAdPositionType: 'user_questions',
					terminalType: 'user_client',
				},
				itemList: [{
						head: this.$t('index').t1,
						body: this.$t('index').b1,
						open: true,
						disabled: true
					},
					{
						head: this.$t('index').t2,
						body: this.$t('index').b2,
						open: false,
					},

					{
						head: this.$t('index').t3,
						body: this.$t('index').b3,
						open: false,
					},
					{
						head: this.$t('index').t4,
						body: this.$t('index').b4,
						open: false,
					},
					{
						head: this.$t('index').t5,
						open: false,
						body: this.$t('index').b5,
					},
					{
						head: this.$t('index').t6,
						open: false,
						body: this.$t('index').b6,
					},
					{
						head: this.$t('index').t7,
						open: false,
						body: this.$t('index').b7,
					},
				],
			}
		},
		computed: {
			i18n() {
				return this.$t('index')
			},
		},
		onLoad() {
			// this.getHomeSlideFunc()
		},

		methods: {
			noClass() {
				console.log(12121)
				this.myIndex = -1
				console.log(this.myIndex)
			},
			toClass(i) {
				this.myIndex = i
			},
			async getHomeSlideFunc() {
				const response = await this.$api.getAuAdList(this.form)
				this.recordInfo = response.rows
				console.log(response, 777777777)
			},
		},
	}
</script>

<style>
	@import './index.css';
</style>
