首页活动,报事报修评价
Some checks failed
Uniapp 自动化打包 CI/CD / 打包 Uniapp 项目 (push) Has been cancelled

This commit is contained in:
2025-09-09 17:21:35 +08:00
parent fb02715afb
commit 400e95c81b
7 changed files with 199 additions and 71 deletions

View File

@@ -53,17 +53,17 @@
<view class="hot-section">
<view class="hot-title-row">
<text class="hot-title">热门活动</text>
<text class="hot-more">全部热门活动 ></text>
<text v-if="false" class="hot-more">全部热门活动 ></text>
</view>
<view class="hot-list">
<view class="hot-card" v-for="(item, idx) in hotList" :key="idx">
<image :src="item.img" class="hot-img" mode="aspectFill" />
<view class="hot-card" v-for="(item, idx) in hotList" :key="idx" @click="goActivityDetail(item)">
<image :src="item.activityImgUrl" class="hot-img" mode="aspectFill" />
<view class="hot-info">
<text class="hot-tag">#热门活动</text>
<text class="hot-desc">{{ item.title }}</text>
<view class="hot-meta">
<text class="hot-date">{{ item.date }}</text>
<text class="hot-status">进行中</text>
<text class="hot-date">{{ item.startTime }}</text>
<text class="hot-status">{{ getStatusText(item.status) }}</text>
</view>
</view>
</view>
@@ -80,13 +80,13 @@ import toast from '../../../uview-ui/libs/function/toast';
name: 'Home',
data() {
return {
banners: [{
img: '/static/aaa_banner1.png'
}
// ,
// {
// img: 'https://picsum.photos/750/300?random=2'
// }
banners: [{
img: '/static/aaa_banner1.png'
}
// ,
// {
// img: 'https://picsum.photos/750/300?random=2'
// }
],
current: 0,
gridList: [
@@ -120,29 +120,37 @@ import toast from '../../../uview-ui/libs/function/toast';
scrollTop: 0,
scrollInterval: null,
scrollHeight: 0,
hotList: [{
img: '/static/aaa_hd1.png',
title: '世界骑行日 低碳出行 让城市更美好',
date: '2025-07-03'
},
{
img: '/static/aaa_hd2.png',
title: '仲夏之夜低碳出行·绿色生活让城市更美好',
date: '2025-07-03'
}
hotList: [
]
}
},
onLoad() {
this.getNotices()
this.getActivityList()
},
methods: {
// 获取状态文字描述
getStatusText(status) {
const statusMap = {
'1': '待进行',
'2': '进行中',
'3': '已完成'
};
return statusMap[status] || '未知状态';
},
async getNotices() {
let res = await this.$u.api.getNotices();
if (res.code == '200') {
this.newsList = res.rows
}
},
async getActivityList() {
let res = await this.$u.api.getActivityList();
if (res.code == '200') {
this.hotList = res.rows
}
},
goNoticeDetail(item){
let params = {}
params.title = item.title
@@ -151,6 +159,15 @@ import toast from '../../../uview-ui/libs/function/toast';
const itemStr = encodeURIComponent(JSON.stringify(params));
uni.navigateTo({ url: '/pages/sys/user/serviceCenter/questionDetail?item=' + itemStr });
},
goActivityDetail(item){
let params = {}
params.title = item.title
params.content = item.activityContent
params.time = item.startTime
params.img = item.activityImgUrl
const itemStr = encodeURIComponent(JSON.stringify(params));
uni.navigateTo({ url: '/pages/sys/user/serviceCenter/questionDetail?item=' + itemStr });
},
onBannerChange(e) {
this.current = e.detail.current;
},