修改活动报名按钮状态,报修添加小区参数;访客返回数据

This commit is contained in:
zhouyanli
2026-06-24 09:06:10 +08:00
parent d5cacf4087
commit a501524646
9 changed files with 82 additions and 21 deletions

View File

@@ -37,7 +37,11 @@
<scroll-view class="main-scroll" scroll-y>
<!-- banner -->
<view class="bannarClass">
<up-swiper :key="bannerSwiperKey" :list="bannerList" indicator indicatorMode="dot" imgMode="aspectFill" radius="10"></up-swiper>
<up-swiper :key="bannerSwiperKey" :list="bannerList" indicator indicatorMode="dot" radius="10">
<template #default="{ item, index }">
<image :src="item" mode="aspectFill" class="banner-img" @tap="bannerClick(index)"></image>
</template>
</up-swiper>
</view>
<!-- 公告 -->
<view class="noticeClass" @click="getNoticeMore">
@@ -182,6 +186,7 @@ const currentCommunity = ref('请绑定房屋')
const currentVillageId = ref('')
const statusBarHeight = ref(0)
const bannerList = ref([])
const bannerRawData = ref([]) // 保留原始数据含link
const bannerSwiperKey = ref(0)
const noticeText = ref('暂无公告')
const noticeId = ref('')
@@ -205,7 +210,8 @@ const getbannarData = async () =>{
try{
const res = await getBannarList({villageId:uni.getStorageSync('currentVillageId')})
if(res.code === 200){
const newList = res.data.map(item => item.url)
bannerRawData.value = res.data || []
const newList = (res.data || []).map(item => item.url)
// 只有 banner 数据真正变化时才更新,避免 swiper 反复重建
if (JSON.stringify(newList) !== JSON.stringify(bannerList.value)) {
bannerList.value = newList
@@ -220,6 +226,13 @@ const getbannarData = async () =>{
uni.showToast({title: msg,icon:'error'})
}
}
// banner点击跳转
const bannerClick = (index) => {
const item = bannerRawData.value[index]
if (item && item.link) {
uni.navigateTo({ url: item.link })
}
}
// 接收选择小区返回的参数
const slelctHomeData = (data) =>{
// console.log('收到B页面返回的数据', data)
@@ -317,6 +330,7 @@ const resetPageData = () => {
currentVillageId.value = ''
activityList.value = []
bannerList.value = []
bannerRawData.value = []
noticeText.value = '暂无公告'
noticeId.value = ''
}
@@ -555,6 +569,11 @@ const moreClick = () =>{
::v-deep .u-swiper__wrapper__item__wrapper__image{
height: 300rpx !important;
}
::v-deep .banner-img{
height: 300rpx !important;
width: 100%;
border-radius: 10rpx;
}
}
.noticeClass{
padding: 0rpx 36rpx;