<template>
	<view class="main">
		<view class="back" />
		<u-navbar
			title="帮助"
			:safeAreaInsetTop="true"
			:fixed="true"
			bgColor="#FFFFFF"
			:placeholder="true"
			@leftClick="onBackTouched"
		/>
		<view style="
			position: relative;
			width: 702rpx;
			height: 1360rpx;
			left: 24rpx;
			top: 24rpx;
			border-radius: 20rpx;
		">
			<u-list
				preLoadScreen=0
				height="1360rpx"
			>
				<u-list-item
					v-for="(item,index) in question" :key="index"
				>
					<view style="width: 100%;height: 80rpx;
								display: flex;
								flex-direction: row;
								align-items: center;
								justify-content: space-between;"
								@click="onTouchThisItem(index)"
								>
						<text class="content_title">{{item.textmsg}}</text>
						<u-icon name="arrow-right" customStyle="margin-right: 20rpx;"/>
					</view>
					<u-line color="#E2E2E2" length="662rpx" customStyle="border: 1px solid #E2E2E2;margin-left:20rpx;" :hairline="true"></u-line>
				</u-list-item>
			</u-list>
		</view>
	</view>
	
</template>

<script>
	import { post } from "@/common/api.js"
	import SkipData from '@/common/SkipData.js'
	import HelpItem from "@/components/HelpItem/HelpItem.vue"
	var Define			= getApp().globalData.Define;
	var mainPageData	= getApp().globalData.mainPageData;
	export default {
		components:{
			HelpItem
		},
		onLoad() {
			if(mainPageData.isMoreQuestionGot){
				return;
			}
			post('pages/comprobmore',{
				pagecount : 100,
				pageindex : 1,
			}).then(res=>{
				var infos = Define.onNetMessage(res);
				if(!infos){
					return;
				}
				mainPageData.isMoreQuestionGot = true;
				this.question = [];
				console.log("帮助界面收到了消息：",infos);
				var moreprob	= infos.moreprob;
				for(var i = 0;i<moreprob.length;i++){
					var data = moreprob[i];
					var skData	= new SkipData();
					skData.initWithNetData(data);
					this.question.push(skData);
				}
				mainPageData.question = this.question;
			});
		},
		data() {
			return {
				question : mainPageData.question,
			};
		},
		methods:{
			onBackTouched(){
				uni.navigateBack({
					
				})
			},
			onTouchThisItem(index){
				var data = this.question[index];
				console.log("点击了问题：",data);
				getApp().globalData.showingSkipData = data;
				uni.navigateTo({
					url:'/pages/SkipView/SkipView'
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.content_title{
		height: 33rpx;
		font-size: 24rpx;
		font-family: PingFang SC;
		font-weight: 400;
		color: #333333;
		opacity: 1;
		margin-left: 20rpx;
	}
</style>
