<template>
	<view>
		<z-paging :language="$i18n.locale" ref="paging" v-model="list" @query="queryList" :pageSize="20"
		:style="'background-color: '+theme.bg+';color: '+theme.text">
			<!-- 下拉刷新 -->
			<custom-refresher slot="refresher" slot-scope="{refresherStatus}" :status="refresherStatus">
			</custom-refresher>

			<!-- 头部 -->
			<myNav slot="top" :title="i18n.mine.bangzhu.title"></myNav>
			<!-- 身体 -->
			<view>
				<view @click="goDetails(item.id)" :style="'background-color: '+theme.fu_bg+';color: '+theme.fu_text"
				class="listBox" v-for="(item,index) in list" :key="index">
					<text class="width-100b font-30 bold-font hidden-nowrap-ellipsis-1">{{item.title}}</text>
					<text class="font-24 nummedium-font">{{item.createtime}}</text>
				</view>
			</view>

		</z-paging>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [],
				theme: '',
			}
		},
		computed: {
			i18n() {
				return this.$t('message');
			},
		},
		onShow() {
			if (uni.getStorageSync("theme") == "dark") {
				this.theme = this.$store.state.darkTheme
			} else {
				this.theme = this.$store.state.lightTheme
			}
		},
		methods: {
			queryList(pageNo, pageSize) {
				setTimeout(()=>{
					this.post('/my/help_list', {
						page: pageNo,
						page_num: pageSize
					}).then(res => {
						if (res.code == 1) {
							console.log(res)
							this.$refs.paging.complete(res.data.data);
						}
					})
				},500)
			},
			goDetails(id) {
				uni.navigateTo({
					url: '/pages/my/help/details?id=' + id
				})
			},
		}
	}
</script>

<style lang="scss">
	.listBox {
		width: 100%;
		height: 160rpx;
		// background: #FFFFFF;
		padding: 34rpx 45rpx;
		margin: 0 auto 12rpx;
		display: flex;
		flex-direction: column;
		align-items: flex-start;
		justify-content: space-between;
	}
</style>
