<template>
	<view class="problemList">
		<far-bottom></far-bottom>
		<scroll-view class="scrollView" :style="{ height: phoneHight }" :scroll-y="true" :lower-threshold="0" @scrolltolower='load'>
			<view class="problemMb" v-for="(item,index) in problemList" @click="goHelpInfo(item.id)">
				<span>{{item.title}}</span>
				<image :src="imgfixUrls + 'merchant/right.svg'"/>
			</view>
			<view class="tips">
				<span>{{text}}</span>
			</view>
		</scroll-view>
	</view>
</template>

<script>
import App from '@/common/js/app.js';

// #ifdef H5
import wxApi from '@/common/js/wxApi.js';
// #endif	
	
	export default {
		data() {
			return {
				id:null,
				page:1,
				phoneHight:0,
				problemList:{},
				text:''
			};
		},
		onLoad(e){
			uni.setNavigationBarTitle({
			    title: e.title
			});
			this.id=e.id
			this.init()
		},
		methods:{
			init(){
				let _this=this
				_this.getProblemList();
				uni.getSystemInfo({
					success(res) {
						_this.phoneHight = res.windowHeight + 'px';
					}
				});
			},
			// 跳转详情
			goHelpInfo(id){
				App.navigationTo({
					url:'pages/subPages/helpCenter/helpDetails/helpDetails?id='+id
				})
			},
			// 获取问题列表
			getProblemList(){
				let _this=this
				_this.text="... ...加载中"
				let data={
					is_recommend:0,
					type_id:_this.id,
					page:_this.page,
					page_index:20
				}
				App._post_form('&p=helper&do=problemList',data,res=>{
					_this.total=res.data.total
					_this.problemList={..._this.problemList,...res.data.list}
					_this.text=""
					if(_this.total==_this.page||_this.total==0){
						_this.text="已无更多数据"
					}
				})
			},
			// 加载
			load(){
				let _this=this
				if(_this.total==_this.page){
					_this.text="已无更多数据"
				}else{
					_this.page++
					_this.getProblemList();
				}
			}
		}
	}
</script>

<style lang="less" scoped>
.tips{
	height: 80upx;
	text-align: center;
	> span {
		line-height: 80upx;
		font-size: 28upx;
		
		
		color: black;
	}	
}	
.scrollView{
	width: 690upx;
	padding: 0 30upx;
}
.problemMb{
	height: 105upx;
	display: flex;
	justify-content: space-between;
	border-bottom:1upx solid rgba(238,238,238,1);
	>span{
		vertical-align: top;
		line-height: 105upx;
		font-size:28upx;
		lor:rgba(51,51,51,1);
	}
	>image{
		margin: 45upx 0 0 0;
		vertical-align: top;
		height: 30upx;
		width: 20upx;
	}
}
</style>
