<template style="background-color:#F6F6F6 ;">
	<view style="margin-top: 20rpx;background-color: #FFFFFF;">
		<!-- 标题 -->
		<view class="title">常见问题</view>
		<!-- 线 -->
		<u-line color="#EFEFEF" />
		<!-- 问题列表 -->
		<view class="list">
			<u-collapse>
				<u-collapse-item :title="item.title" v-for="(item, index) in itemList" :key="index" head-style="font-size: 28rpx;">
					<div class="body">{{item.content}}</div>
				</u-collapse-item>
			</u-collapse>
		</view>
		<view class="footer">
			<view class="cu-bar bg-white tabbar border shop" style="width: 100%;">
				<view class="submit" @click="next" style="background-color: #0B73B9; color: #FFFFFF; font-size: 32rpx;">添加意见反馈</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				itemList: [],
				pageindex: 1
			}
		},
		mounted() {
			this.gethelpData()
		},
		onReachBottom() {
			this.gethelpData()
		},
		methods: {
			next(e) {
				uni.navigateTo({
					url: '/pages/common_tools/help_feedback/opinion1'
				})
			},
			gethelpData: async function() {
				let res = await this.$request.post("/api/v1/common/getHelpList", {
					page: this.pageindex
				})
				console.log(res)
				if (res.status == 0) {
					if (this.pageindex > res.data.last_page) {
						uni.showToast({
							title: "没有更多了",
							icon: "none"
						})
					} else {
						this.itemList = this.itemList.concat(res.data.data)
						this.pageindex++
					}
				}
			}
		}
	}
</script>

<style lang="scss">
	.title {
		height: auto;
		display: flex;
		align-items: center;
		padding: 30rpx 0 30rpx 30rpx;
		font-size: 30rpx;
		font-weight: bold;
	}

	.list {
		height: auto;
		width: 100%;
		padding: 0 30rpx;

		.body {
			padding: 20rpx 30rpx 20rpx 20rpx;
			word-break: break-all;
			word-wrap: break-word
		}
	}

	.footer {
		width: 100%;
		height: auto;
		display: flex;
		position: fixed;
		bottom: 0;
	}
</style>
