<!-- 消息通知 -->
<template>
	<view class="notice">
		<z-paging
			ref="paging"
			v-model="noticeList"
			@query="queryList"
		>
			<!-- 选项卡 -->
			<view class="notice-tab" slot="top">
				<u-tabs :list="tabList" :is-scroll="false" :current="current" @change="tabChange" bg-color="#f2f2f2" inactive-color="#000000" active-color="#709078" :bold="false" bar-width="40" bar-height="6" :active-item-style="{color: '#000000'}"></u-tabs>
			</view>
			
			<view class="notice-list">
				<view class="notice-list-item" v-for="(item, index) in noticeList" :key="index">
					<view class="notice-list-item-title">{{ item.title }}</view>
					<view class="notice-list-item-content">{{ item.content }}</view>
					<view class="notice-list-item-bottom">
						<view>发布于{{ item.createTime }}</view>
						<view class="is-read" v-if="item.status === 1">已读</view>
						<view class="no-read" v-else>未读</view>
					</view>
				</view>
			</view>
		</z-paging>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				current: 0,
				tabList: [
					{ value: 1, name: '培训通知', count: 10 },
					{ value: 2, name: '就业消息', count: 0 },
					{ value: 3, name: '系统通知', count: 100 }
				],
				noticeList: []
			}
		},
		methods: {
			getList() {
				
			},
			/**
			 * tab切换
			 * @param { Number } cur
			 */
			tabChange(cur) {
				this.current = cur
			},
			/**
			 * 下拉分页组件触发
			 * @param {Number} pageNum
			 * @param {Number} pageSize
			 */
			queryList(pageNum, pageSize) {
				this.$refs.paging.complete([
					{
					  id: 1,
					  title: '请问针对退役军人就业有哪些什么政策',
					  content: '退役军人就业政策，每个地方的规定不一样，但都会按照相关规定实行阳光安置，根据退役军人相关条件和考试成绩进行选择安置。',
					  createTime: '发布于2021.09.23 12:31',
					  status: 1
					},
					{
					  id: 2,
					  title: '请问针对退役军人就业有哪些什么政策',
					  content: '退役军人就业政策，每个地方的规定不一样，但都会按照相关规定实行阳光安置，根据退役军人相关条件和考试成绩进行选择安置。',
					  createTime: '发布于2021.09.23 12:31',
					  status: 0
					}
				])
			}
		}
	}
</script>

<style lang="scss" scoped>
@import './scss/notification.scss';
</style>