上拉刷新

feasure-livedata
lld 2026-03-29 22:12:27 +08:00
parent e5ea9577ac
commit ff4b627d87
7 changed files with 282 additions and 24 deletions

44
api/warn/autolog.js Normal file
View File

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询自动模式日志列表
export function listAutolog(query) {
return request({
url: '/warn/autolog/list',
method: 'get',
params: query
})
}
// 查询自动模式日志详细
export function getAutolog(id) {
return request({
url: '/warn/autolog/' + id,
method: 'get'
})
}
// 新增自动模式日志
export function addAutolog(data) {
return request({
url: '/warn/autolog',
method: 'post',
data: data
})
}
// 修改自动模式日志
export function updateAutolog(data) {
return request({
url: '/warn/autolog',
method: 'put',
data: data
})
}
// 删除自动模式日志
export function delAutolog(id) {
return request({
url: '/warn/autolog/' + id,
method: 'delete'
})
}

View File

@ -33,12 +33,12 @@
}
}
},
{
"path": "pages/data/indexDemo",
"style": {
"navigationBarTitleText": "数据中心11"
}
},
// {
// "path": "pages/data/indexDemo",
// "style": {
// "navigationBarTitleText": "数据中心11"
// }
// },
{
"path": "pages/news/index",
"style": {
@ -219,12 +219,12 @@
"selectedIconPath": "static/images/tabbar/data_.png",
"text": "历史数据"
},
{
"pagePath": "pages/data/indexDemo",
"iconPath": "static/images/tabbar/data.png",
"selectedIconPath": "static/images/tabbar/data_.png",
"text": "历史数据"
},
// {
// "pagePath": "pages/data/indexDemo",
// "iconPath": "static/images/tabbar/data.png",
// "selectedIconPath": "static/images/tabbar/data_.png",
// "text": "历史数据"
// },
{
"pagePath": "pages/news/index",
"iconPath": "static/images/tabbar/news.png",

View File

@ -44,7 +44,7 @@
</scroll-view>
<view class="empty__item tn-margin-top" v-else>
<tn-empty icon="https://resource.tuniaokj.com/images/empty/alien/2.png"
text="近7天暂无消息,可下拉查看历史消息" :imgWidth="200"
text="近7天暂无消息" :imgWidth="200"
:imgHeight="200"></tn-empty>
</view>
</view>
@ -139,12 +139,11 @@ export default {
}
},
onShow() {
//
this.getSortDate();
},
methods: {
goTo(id) {
this.scrollId = id;
},
//
isSameMinute(time1, time2) {
const date1 = new Date(time1);
@ -219,6 +218,7 @@ export default {
// scrollId
this.$nextTick(() => {
//
this.scrollId = "item"+this.messageList[10].id;
});

View File

View File

@ -1,7 +1,10 @@
<template>
<view class="message-page">
<!-- 消息列表 -->
<scroll-view scroll-y class="message-list" v-if="messageList.length>0">
<scroll-view :scroll-y="true"
class="message-list"
@scrolltolower="onLoadMore"
v-if="messageList.length>0">
<view
v-for="(item, index) in messageList"
:key="index"
@ -32,6 +35,7 @@
<text class="send-time">{{ item.time }}</text>
</view>
</view>
<uni-load-more v-if="messageList.length>4" iconType="auto" :status="status" :content-text="contentText" />
</scroll-view>
<view class="empty__item tn-margin-top" v-else>
<tn-empty icon="https://resource.tuniaokj.com/images/empty/alien/2.png"
@ -42,11 +46,13 @@
</template>
<script>
export default {
data() {
return {
messageList: [
{
id: 1,
image: "https://picsum.photos/id/1031/800/400", //
title: "下班时间到了,勿浪费公司水电,请滚",
sender: "图鸟官方团队",
@ -55,6 +61,7 @@ export default {
desc: ""
},
{
id: 2,
image: "https://picsum.photos/id/1059/800/400", //
title: "新年新气象,除夕快乐",
sender: "图鸟官方团队",
@ -63,6 +70,16 @@ export default {
desc: ""
},
{
id:3,
image: "https://picsum.photos/id/180/800/400", //
title: "企业认证,到期后企业使用将受限",
sender: "图鸟官方团队",
time: "2024-01-22 16:28",
unread: false,
desc: "请于2024年06月08日前认证否则认证标识将变为未认证状态部分功能也将受限点击"
},
{
id:4,
image: "https://picsum.photos/id/180/800/400", //
title: "企业认证,到期后企业使用将受限",
sender: "图鸟官方团队",
@ -70,9 +87,19 @@ export default {
unread: false,
desc: "请于2024年06月08日前认证否则认证标识将变为未认证状态部分功能也将受限点击"
}
]
],
isHaveOldData: true,
contentText: {
contentdown: '查看更多',
contentrefresh: '加载中',
contentnomore: '没有更多数据了'
},
status: 'more'
}
},
onShow() {
//
},
methods: {
handleLink() {
// ""
@ -84,7 +111,91 @@ export default {
uni.navigateTo({
url: "/pages/news/subpages/eventDetail/index?title=" + item.title
})
}
},
onLoadMore() {
this.status = 'loading'
if (!this.isHaveOldData) {
setTimeout(() => {
this.$modal.msg("没有更早数据!");
//
this.status = 'nomore'
}, 800);
return;
}
//
setTimeout(() => {
// 10
const newData = [
{
id: 3,
image: "https://picsum.photos/id/180/800/400",
title: "企业认证,到期后企业使用将受限",
sender: "图鸟官方团队",
time: "2024-01-22 16:28",
unread: false,
desc: "请于2024年06月08日前认证否则认证标识将变为未认证状态部分功能也将受限点击"
},
{
id: 4,
image: "https://picsum.photos/id/119/800/400",
title: "系统版本更新通知",
sender: "平台运营中心",
time: "2024-02-15 09:12",
unread: true,
desc: "新版本已发布,优化了页面加载速度并修复已知问题,建议立即更新体验。"
},
{
id: 5,
image: "https://picsum.photos/id/110/800/400",
title: "账号安全提醒:异地登录检测",
sender: "安全中心",
time: "2024-02-18 21:45",
unread: true,
desc: "检测到您的账号在陌生设备登录,如非本人操作请及时修改密码并锁定账号。"
},
{
id: 6,
image: "https://picsum.photos/id/116/800/400",
title: "企业套餐续费提醒",
sender: "客户服务部",
time: "2024-03-01 14:30",
unread: false,
desc: "您的企业套餐即将到期,为不影响正常使用,请尽快完成续费操作。"
},
{
id: 7,
image: "https://picsum.photos/id/111/800/400",
title: "新功能上线邀请体验",
sender: "产品团队",
time: "2024-03-10 11:20",
unread: false,
desc: "数据可视化与批量导出功能正式上线,诚邀您体验并提出宝贵意见。"
},
{
id: 8,
image: "https://picsum.photos/id/114/800/400",
title: "违规内容处理通知",
sender: "内容审核组",
time: "2024-03-20 16:05",
unread: true,
desc: "您发布的部分内容不符合平台规范,已做隐藏处理,请及时修改后重新提交。"
},
{
id: 9,
image: "https://picsum.photos/id/112/800/400",
title: "月度使用报告已生成",
sender: "数据中心",
time: "2024-04-01 10:00",
unread: false,
desc: "您上月的平台使用数据报告已生成,包含使用时长、功能频次等详细信息。"
}
]
//
this.messageList = [ ...this.messageList,...newData];
this.status = 'more'
}, 800);
},
}
}
</script>

View File

@ -20,7 +20,7 @@
</view>
<!-- 公告列表 -->
<scroll-view scroll-y class="notice-list" v-if="noticeList.length>0">
<scroll-view :scroll-y="true" class="notice-list" @scrolltolower="onLoadMore" v-if="noticeList.length>0">
<view
v-for="(item, index) in noticeList"
:key="index"
@ -49,6 +49,7 @@
<text class="notice-time">{{ item.time }}</text>
</view>
</view>
<uni-load-more v-if="noticeList.length>8" iconType="auto" :status="status" :content-text="contentText" />
</scroll-view>
<view class="empty__item tn-margin-top" v-else>
<tn-empty icon="https://resource.tuniaokj.com/images/empty/alien/2.png"
@ -99,6 +100,66 @@ export default {
'#ff9800'
],
contentList: [
{
title: '2024年春节放假通知',
content: '各位同事一年一度的春节又到啦根据国家法定节假日规定2024年春节放假安排如下02月01日—...',
author: '那只猪-图鸟人事部',
time: '2024-01-26 10:12',
dotColor: '#e53935',
dotInner: true, //
isRead: 0,
avatar: 'https://img.xiaoces.com/photos/logo.png' //
},
{
title: '2024年春节放假通知',
content: '各位同事一年一度的春节又到啦根据国家法定节假日规定2024年春节放假安排如下02月01retrt345日—...',
author: '那只猪-图鸟人事部',
time: '2024-01-26 10:12',
dotColor: '#e53935',
dotInner: true, //
isRead: 0,
avatar: 'https://img.xiaoces.com/photos/logo.png' //
},
{
title: '2024年春节放假通知',
content: '各位同事一年一度的春节又到啦根据国家法定节假日规定2024年春45353535节放假安排如下02月01日—...',
author: '那只猪-图鸟人事部',
time: '2024-01-26 10:12',
dotColor: '#e53935',
dotInner: true, //
isRead: 0,
avatar: 'https://img.xiaoces.com/photos/logo.png' //
},
{
title: '2024年春节放假通知',
content: '各位同事一年一度的春节又到啦根据国家法定节假日规定2024年春节放假安排如下02月01日—...',
author: '那只猪-图鸟人事部',
time: '2024-01-26 10:12',
dotColor: '#e53935',
dotInner: true, //
isRead: 0,
avatar: 'https://img.xiaoces.com/photos/logo.png' //
},
{
title: '2024年春节放假通知',
content: '各位同事一年一度的春节又到啦根据国家法定节假日规定2024年春节放假安排如下02月01retrt345日—...',
author: '那只猪-图鸟人事部',
time: '2024-01-26 10:12',
dotColor: '#e53935',
dotInner: true, //
isRead: 0,
avatar: 'https://img.xiaoces.com/photos/logo.png' //
},
{
title: '2024年春节放假通知',
content: '各位同事一年一度的春节又到啦根据国家法定节假日规定2024年春45353535节放假安排如下02月01日—...',
author: '那只猪-图鸟人事部',
time: '2024-01-26 10:12',
dotColor: '#e53935',
dotInner: true, //
isRead: 0,
avatar: 'https://img.xiaoces.com/photos/logo.png' //
},
{
title: '2024年春节放假通知',
content: '各位同事一年一度的春节又到啦根据国家法定节假日规定2024年春节放假安排如下02月01日—...',
@ -176,8 +237,14 @@ export default {
content:null,
author:null,
avatar:null
}
},
status: 'more',
contentText: {
contentdown: '查看更多',
contentrefresh: '加载中',
contentnomore: '没有更多数据了'
},
isHaveOldData: true
}
},
methods: {
@ -192,10 +259,40 @@ export default {
},
closeShowNotice() {
this.$refs.showNotice.close();
}
},
onLoadMore() {
this.status = 'loading'
if (!this.isHaveOldData) {
setTimeout(() => {
this.$modal.msg("没有更早数据!");
//
this.status = 'nomore'
}, 800);
return;
}
//
setTimeout(() => {
// 10
const newData = [];
for (let i = 0; i < 10; i++) {
newData.push({
title: '2024年春节放假通知',
content: '各位同事一年一度的春节又到啦根据国家法定节假日规定2024年春节放假安排如下02月01日—...',
author: '那只猪-图鸟人事部',
time: '2024-01-26 10:12',
dotColor: '#e53935',
dotInner: true,
})
}
this.noticeList = [ ...this.noticeList,...newData];
this.status = 'more'
}, 800);
},
},
onShow() {
//
//
this.noticeList = this.contentList.filter(item =>
item.isRead===0);
},
@ -210,7 +307,7 @@ page {
/* 页面容器 */
.notice-page {
height: 100vh;
display: flex;
flex-direction: column;
box-sizing: border-box;
@ -258,6 +355,7 @@ page {
overflow: hidden;
/* 新增H5端避免滚动条样式不一致 */
scrollbar-width: thin;
height: 100vh;
}
.notice-item {
background-color: #fff;

View File

@ -120,6 +120,10 @@ export default {
]
}
},
mounted() {
//
// this.videoList = this.getDateList1();
},
methods: {
parseTime,
handleDateClick(item) {
@ -274,6 +278,7 @@ export default {
.video-list {
flex: 1;
padding: 0 30rpx;
height: calc(100vh - var(--status-bar-height) - 180rpx);
}
.video-item {
display: flex;