From 717f4e1b083b460844793f7b05583be3ca6cebc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=A3=E4=BA=9B=E8=8A=B1=E5=84=BF?= <1156921458@qq.com> Date: Thu, 25 Sep 2025 21:43:49 +0800 Subject: [PATCH] .. --- .../sys/controller/SysHomeV4Controller.java | 14 +++---- .../resources/views/layouts/v4/home/act.js | 40 ++++++++++++++++--- 2 files changed, 41 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/budwk/app/sys/controller/SysHomeV4Controller.java b/src/main/java/com/budwk/app/sys/controller/SysHomeV4Controller.java index e12eecf7..199aa80e 100644 --- a/src/main/java/com/budwk/app/sys/controller/SysHomeV4Controller.java +++ b/src/main/java/com/budwk/app/sys/controller/SysHomeV4Controller.java @@ -29,14 +29,14 @@ public class SysHomeV4Controller { } +// @At("/home") +// @Ok("beetl:/layouts/v4/home.html") +// @SaCheckLogin +// public void home() { +// +// } + @At("/home") - @Ok("beetl:/layouts/v4/home.html") - @SaCheckLogin - public void home() { - - } - - @At("/home2") @Ok("beetl:/layouts/v4/home/index.html") @SaCheckLogin public void home2() { diff --git a/src/main/resources/views/layouts/v4/home/act.js b/src/main/resources/views/layouts/v4/home/act.js index 366041bc..395799a7 100644 --- a/src/main/resources/views/layouts/v4/home/act.js +++ b/src/main/resources/views/layouts/v4/home/act.js @@ -2,7 +2,7 @@ const act = { template: /*language=HTML*/ `
-
+
工会活动 @@ -18,6 +18,9 @@ const act = {
+ + {{getStatusText(activity)}} +

{{ activity.name}} @@ -44,13 +47,13 @@ const act = {

`, - data(){ - return{ + data() { + return { actList: [], swiper: null } }, - methods:{ + methods: { /*查询活动*/ listAct() { this.$axios.post("/platform/home/listHomeActivity").then((res) => { @@ -94,7 +97,19 @@ const act = { } }) }, - go(act){ + + // 活动状态 + getStatusText(item) { + if (this.$moment().unix() > this.$moment(item.endDate).unix()) { + return "已结束" + } else if (this.$moment().unix() < this.$moment(item.startDate).unix()) { + return "未开始" + } else { + return "进行中" + } + }, + + go(act) { if (!act.url) { this.$message.warning("管理员未配置活动链接") return @@ -102,7 +117,7 @@ const act = { window.open(act.url) } }, - mounted(){ + mounted() { this.listAct() }, style: /*language=CSS*/ ` @@ -221,8 +236,21 @@ const act = { width: 100%; height: 200px; overflow: hidden; + position: relative; } + .activity-swiper .swiper-slide .item .img-box .status { + position: absolute; + left: 0; + top: 0; + background: #c11623; + padding: 6px 2px; + min-width: 50px; + color: #ffffff; + border-radius: 0 0 50% 0; + } + + .activity-swiper .swiper-slide .item .img-box img { width: 100%; height: 100%;