<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.notice.title1"></myNav>
			<!-- 身体 -->
			<view class="width-750 padding-b-40">
				<view @click="router.push('/pages/index/noticeDetails?id='+item.id)" v-for="(item,index) in list"
					class="padding-w-30 padding-c-24">
					<view class="height-72 flex align-center justify-between">
						<view class="flex align-center flex-1">
							<image class="width-72 height-72" src="/static/imgs/index/xitong@2x.png" mode=""></image>
							<text class="flex-1 font-28 margin-l-22">{{item.title}}</text>
						</view>
						<text class="font-24 color-C3C3C3">{{item.createtime}}</text>
					</view>
					<view class="margin-t-30 font-26">
						<text class="hidden-nowrap-ellipsis-2">{{item.content}}</text>
					</view>
				</view>
			</view>

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

<script>
	export default {
		data() {
			return {
				statusBar: uni.getSystemInfoSync().statusBarHeight,
				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('/index/message_list', {
						page: pageNo,
						page_num: pageSize
					}).then(res => {
						if (res.code == 1) {
							console.log(res)
							this.$refs.paging.complete(res.data.data);
						}
					})
				}, 500)
			},
		}
	}
</script>

<style lang="scss">
</style>
