msgList.vue 1.57 KB
<template>
	<view>
		<z-paging ref="paging" v-model="dataList" @query="queryList" emptyViewImg="/static/nodata.png">
			<!-- z-paging默认铺满全屏,此时页面所有view都应放在z-paging标签内,否则会被盖住 -->
			<!-- 需要固定在页面顶部的view请通过slot="top"插入,包括自定义的导航栏 -->
			<uni-section title="通知公告" padding>
				<view class="msglist">
					<view class="msgitem" v-for="n in dataList" :key="n.id" @click="goDetail(n)">
						<!-- <text class="dot" :class="{'done':n.readFlag=='1'}"></text> -->
						<view class="tt esp">{{n.name}}</view>
						<view class="date">{{ n.belongTime }}</view>
					</view>
				</view>
			</uni-section>
		</z-paging>
	</view>
</template>

<script setup>
	import {
		ref
	} from 'vue'
	import * as api from '@/common/api.js';
	import {
		onLoad
	} from '@dcloudio/uni-app';
	const dataList = ref([])
	const paging = ref(null)
	const current = ref(2)

	function queryList(pageNum, pageSize) {
		api.notice({
			pageNum,
			pageSize
		}).then(res => {
			paging.value.complete(res.rows);
		})

	}
function goDetail(n){
	uni.navigateTo({
		url: `/pages/index/newsDetail?noteId=${n.noteId}`
	});
}
	function readMessage(item) {
		uni.navigateTo({
			url: item.path
		});
		api.reader({
			id: item.id
		}).then(res => {
			item.readFlag = '1'
		})
	}
</script>

<style lang="scss" scoped>
	:deep(.uni-section) {
		background-color: transparent;
	}

	:deep(.uni-section .uni-section-header__content) {
		font-size: 36rpx;
		color: #29343C;
	}
</style>