巡检
Some checks failed
Uniapp 自动化打包 CI/CD / 打包 Uniapp 项目 (push) Has been cancelled

This commit is contained in:
2025-09-08 11:30:52 +08:00
parent 60aa1f09fa
commit 2e604b1823
3 changed files with 102 additions and 83 deletions

View File

@@ -39,9 +39,14 @@
<!-- 滚动资讯条 -->
<view class="news-bar">
<text class="news-label">头条</text>
<scroll-view scroll-x class="news-scroll">
<text v-for="(item, idx) in newsList" :key="idx" class="news-item">{{ item }}</text>
</scroll-view>
<view class="news-scroll-container">
<scroll-view scroll-y class="news-scroll" :scroll-top="scrollTop" @scroll="onScroll">
<view class="news-list">
<!-- 重复列表以实现无缝循环 -->
<text v-for="(item, idx) in [...newsList, ...newsList]" :key="idx" class="news-item">{{ item }}</text>
</view>
</scroll-view>
</view>
<text class="news-arrow"></text>
</view>
<!-- 热门活动区 -->
@@ -82,72 +87,37 @@
// }
],
current: 0,
gridList: [
{
icon: '/static/aaaa_gd.png',
text: '工单',
url:'/pages/sys/workbench/order/order'
},
{
icon: '/static/aaaa_yjcl.png',
text: '预警处理',
url:'/pages/sys/workbench/earlyWarning/earlyWarning'
},
{
icon: '/static/aaaa_jk.png',
text: '监控',
url:'/pages/sys/workbench/monitor/monitors'
},
{
icon: '/static/aaaa_bsbx.png',
text: '报事报修',
url:'/pages/sys/user/myRepair/myRepair'
},
// {
// icon: '/static/aaa_bsbx.png',
// text: '报事报修',
// url:'/pages/sys/user/myRepair/myRepair'
// },
// {
// icon: '/static/aaa_tcjf.png',
// text: '停车缴费',
// url:'/pages/sys/user/myPayment/myPayment'
// },
// {
// icon: '/static/aaa_shfw.png',
// text: '生活服务'
// },
// {
// icon: '/static/aaa_fwzx.png',
// text: '服务中心',
// url:'/pages/sys/user/serviceCenter/serviceCenter'
// },
// {
// icon: '/static/aaa_hyyy.png',
// text: '会议预约',
// url:'/pages/sys/workbench/meet/meet'
// },
// {
// icon: '/static/aaa_gdgl.png',
// text: '工单管理',
// url:'/pages/sys/workbench/order/order'
// },
// {
// icon: '/static/aaa_fkgl.png',
// text: '访客管理',
// url:'/pages/sys/user/myVisitor/myVisitor'
// },
// {
// icon: '/static/aaa_jqqd.png',
// text: '敬请期待'
// }
gridList: [
{
icon: '/static/aaaa_gd.png',
text: '工单',
url:'/pages/sys/workbench/order/order'
},
{
icon: '/static/aaaa_yjcl.png',
text: '预警处理',
url:'/pages/sys/workbench/earlyWarning/earlyWarning'
},
{
icon: '/static/aaaa_jk.png',
text: '监控',
url:'/pages/sys/workbench/monitor/monitors'
},
{
icon: '/static/aaaa_bsbx.png',
text: '报事报修',
url:'/pages/sys/user/myRepair/myRepair'
},
],
newsList: [
'数智南川|最新资讯1',
'数智南川|最新资讯2',
'数智南川|最新资讯3'
],
scrollTop: 0,
scrollInterval: null,
scrollHeight: 0,
hotList: [{
img: '/static/aaa_hd1.png',
title: '世界骑行日 低碳出行 让城市更美好',
@@ -194,6 +164,40 @@
uni.navigateTo({
url: url
});
},
// 资讯跑马灯控制
startScroll() {
// 清除之前的定时器
if (this.scrollInterval) {
clearInterval(this.scrollInterval);
}
// 设置新的定时器
this.scrollHeight = this.newsList.length * 60;
this.scrollTop = 0;
this.scrollInterval = setInterval(() => {
this.scrollTop++;
// 当滚动到一半时重置位置,实现无缝循环
if (this.scrollTop >= this.scrollHeight) {
this.scrollTop = 0;
}
}, 50);
},
onScroll(e) {
// 滚动事件处理
}
},
mounted() {
// 页面加载完成后启动跑马灯
this.$nextTick(() => {
this.startScroll();
});
},
beforeDestroy() {
// 页面销毁前清除定时器
if (this.scrollInterval) {
clearInterval(this.scrollInterval);
}
}
}
@@ -363,6 +367,7 @@
padding: 10rpx 0;
border-top: 1rpx solid #f5f5f5;
margin-top: 10rpx;
height: 60rpx;
}
.news-label {
@@ -373,23 +378,37 @@
border: 1rpx solid #FF6A00;
border-radius: 4rpx;
padding: 2rpx 6rpx;
flex-shrink: 0;
}
.news-scroll-container {
flex: 1;
height: 60rpx;
overflow: hidden;
}
.news-scroll {
flex: 1;
height: 60rpx;
white-space: nowrap;
}
.news-list {
display: flex;
flex-direction: column;
}
.news-item {
display: inline-block;
margin-right: 30rpx;
height: 60rpx;
line-height: 60rpx;
color: #666;
font-size: 24rpx;
flex-shrink: 0;
}
.news-arrow {
color: #999;
font-size: 32rpx;
flex-shrink: 0;
}
.hot-section {