From d1448cb0ef10f358bb7bddb4e1ec268515e0b787 Mon Sep 17 00:00:00 2001 From: gaoluyang <2820782392@qq.com> Date: 星期二, 15 七月 2025 11:46:57 +0800 Subject: [PATCH] 项目初始化 --- pages/work/notice/list.vue | 112 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 112 insertions(+), 0 deletions(-) diff --git a/pages/work/notice/list.vue b/pages/work/notice/list.vue new file mode 100644 index 0000000..c24354d --- /dev/null +++ b/pages/work/notice/list.vue @@ -0,0 +1,112 @@ +<template> + <view class="mobile-item-container"> + <Navbar title="閫氱煡鍏憡" bgColor="#fff" :h5Show="false"></Navbar> + <u-tabs :activeStyle="activeStyle" :list="tabs" @change="tabChange"></u-tabs> + <!-- 鏈 --> + <view v-if="activeKey == 'unread'"> + <view style="padding: 16px 0 10px;"> + <view class="notice-item-tips"> + <text>閫氱煡</text> + <u-tag text="1" size="mini" type="primary" style="margin: 0 8px;"></u-tag> + <text>鏉★紝鍏憡</text> + <u-tag text="1" size="mini" type="success" style="margin: 0 8px;"></u-tag> + <text>鏉★紝鍏� 2 鏉°��</text> + </view> + </view> + <Record :list="list" @click="toDetail"></Record> + </view> + <!-- 宸茶 --> + <view v-if="activeKey == 'read'"> + <view style="padding: 16px 0 10px;"> + <u-search :show-action="true" actionText="鎼滅储" :animation="true" shape="square" height="40px"></u-search> + </view> + <Record :list="[]" @click="toDetail"></Record> + </view> + <!-- 鍏ㄩ儴 --> + <view v-if="activeKey == 'all'"> + <view style="padding: 16px 0 10px;"> + <u-search :show-action="true" actionText="鎼滅储" :animation="true" shape="square" height="40px"></u-search> + </view> + <Record :list="list" @click="toDetail"></Record> + </view> + </view> +</template> + +<script> +import * as NoticeApi from '@/api/work/notice' +import Navbar from '@/components/navbar/Navbar' +import Record from './record' + +export default { + components: { + Navbar, + Record, + }, + data () { + return { + activeKey: 'unread', + tabs: [{ + name: '鏈', + key: 'unread', + badge: { + value: 2, + } + }, { + name: '宸茶', + key: 'read' + }, { + name: '鍏ㄩ儴', + key: 'all' + }], + params: { + pageNum: 0, + pageSize: 10 + }, + list: [], + activeStyle: { + color: '#303133', + fontSize: '20px', + fontWeight: 'bold', + transform: 'scale(1.05)' + } + } + }, + created () { + this.loadData() + }, + methods: { + // 鍔犺浇閫氱煡鍏憡鏁版嵁 + loadData () { + const app = this + this.params.pageNum += 1; + NoticeApi.noticeList(this.params).then(res => { + app.list = res.rows; + }) + }, + tabChange (item) { + this.activeKey = item.key; + this.params.pageNum = 0; + this.loadData(); + }, + // 婊氬姩鍒嗛〉鍔犺浇鏁版嵁 + scrolltolower () { + this.loadData(); + }, + toDetail (notice) { + uni.navigateTo({ url: '/pages/work/notice/detail?id=' + notice.noticeId }) + } + } +} +</script> + +<style lang="scss" scoped> +.notice-item-tips { + border-radius: 8px; + background-color: #f4f4f5; + padding: 9px 16px; + display: flex; + flex-direction: row; + flex-wrap: wrap; + align-items: center; +} +</style> \ No newline at end of file -- Gitblit v1.9.3