diff --git a/property-uniapp-project/pageSubPack/activity-list/activityList.vue b/property-uniapp-project/pageSubPack/activity-list/activityList.vue index 6b128a4..22a6ff6 100644 --- a/property-uniapp-project/pageSubPack/activity-list/activityList.vue +++ b/property-uniapp-project/pageSubPack/activity-list/activityList.vue @@ -176,7 +176,14 @@ const narBack = () => { */ const switchTab = (tab) => { activeTab.value = tab - resetAndLoad() + if (tab === 'list') { + resetAndLoad() + } else { + // 暂无审核功能,"我的活动"默认显示暂无数据 + displayedActivities.value = [] + hasMoreData.value = false + currentPage.value = 1 + } } /** @@ -185,7 +192,7 @@ const switchTab = (tab) => { */ const switchFilter = (filter) => { myFilter.value = filter - resetAndLoad() + // resetAndLoad() } /** @@ -287,7 +294,9 @@ const viewActivityDetail = (activity) => { * 页面显示时刷新数据 */ onShow(() => { - getActivityListData(1) // 强制刷新第一页 + if (activeTab.value === 'list') { + getActivityListData(1) // 强制刷新第一页 + } }) /** @@ -296,7 +305,7 @@ onShow(() => { onLoad(() => { // 监听详情页报名/取消报名后的刷新通知 uni.$on('refreshActivityList', (data) => { - console.log('收到活动列表刷新通知:', data) + // console.log('收到活动列表刷新通知:', data) getActivityListData(1) }) }) @@ -312,9 +321,7 @@ onUnload(() => { * 监听我的活动筛选条件变化 */ watch(() => myFilter.value, () => { - if (activeTab.value === 'my') { - resetAndLoad() - } + // 暂无审核功能,筛选条件暂不触发加载 }) diff --git a/property-uniapp-project/pageSubPack/api/api.js b/property-uniapp-project/pageSubPack/api/api.js index 91240b4..228e965 100644 --- a/property-uniapp-project/pageSubPack/api/api.js +++ b/property-uniapp-project/pageSubPack/api/api.js @@ -22,6 +22,10 @@ export const getResetPassword = (data) =>{ return post('/api/resident/auth/resetPassword',data) } // =========首页======= +// 获取bannar图 +export const getBannarList = (data) =>{ + return get('/resident/banner',data) +} // 首页最新公告 export const getNoticeLatest = () =>{ return get('/api/resident/notice/latest') diff --git a/property-uniapp-project/pageSubPack/api/request.js b/property-uniapp-project/pageSubPack/api/request.js index b760238..315239a 100644 --- a/property-uniapp-project/pageSubPack/api/request.js +++ b/property-uniapp-project/pageSubPack/api/request.js @@ -26,7 +26,7 @@ export default function request(url, data = {}, method = "GET") { // HTTP 失败 if (res.statusCode !== 200) { - reject(`请求异常 ${res.statusCode}`); + reject({ msg: `请求异常 ${res.statusCode}`, code: res.statusCode }); return; } @@ -39,7 +39,7 @@ export default function request(url, data = {}, method = "GET") { setTimeout(() => { uni.reLaunch({ url: '/pageSubPack/loginSub/pwd-login' }); }, 1500); - reject('登录过期'); + reject({ msg: '登录过期', code: 401 }); return; } @@ -47,14 +47,14 @@ export default function request(url, data = {}, method = "GET") { if (resData.code === 200) { resolve(resData); } - // 业务失败:只 reject,不弹窗! + // 业务失败 else { - reject(resData); // 把完整错误返回给页面! + reject({ msg: resData.msg || '请求失败', code: resData.code, data: resData }); } }, fail: (err) => { uni.hideLoading(); - reject(err); + reject({ msg: '网络异常', code: -1, raw: err }); } }); }); diff --git a/property-uniapp-project/pageSubPack/loginSub/login.vue b/property-uniapp-project/pageSubPack/loginSub/login.vue index bcabd8b..1bc4b37 100644 --- a/property-uniapp-project/pageSubPack/loginSub/login.vue +++ b/property-uniapp-project/pageSubPack/loginSub/login.vue @@ -62,7 +62,6 @@ @@ -191,7 +191,46 @@ // 处理注册逻辑 const handleRegister = () => { - if (!canRegister.value) return; + if (!phoneNumber.value) { + uni.showToast({ title: '请输入手机号', icon: 'none' }); + return; + } + if (!/^1[3-9]\d{9}$/.test(phoneNumber.value)) { + uni.showToast({ title: '请输入正确的手机号', icon: 'none' }); + return; + } + if (!verifyCode.value) { + uni.showToast({ title: '请输入验证码', icon: 'none' }); + return; + } + if (!/^\d{6}$/.test(verifyCode.value)) { + uni.showToast({ title: '验证码为 6 位数字', icon: 'none' }); + return; + } + if (!account.value) { + uni.showToast({ title: '请输入账号', icon: 'none' }); + return; + } + if (account.value.length < 4 || account.value.length > 20) { + uni.showToast({ title: '账号长度需为 4-20 位', icon: 'none' }); + return; + } + if (!password.value) { + uni.showToast({ title: '请输入密码', icon: 'none' }); + return; + } + if (password.value.length < 6) { + uni.showToast({ title: '密码至少输入 6 位', icon: 'none' }); + return; + } + if (password.value.length > 16) { + uni.showToast({ title: '密码不能超过 16 位', icon: 'none' }); + return; + } + if (!agreeAgreement.value) { + uni.showToast({ title: '请勾选协议', icon: 'none' }); + return; + } uni.showLoading({ title: '注册中...', mask: true diff --git a/property-uniapp-project/pageSubPack/online-repair/repairDetail.vue b/property-uniapp-project/pageSubPack/online-repair/repairDetail.vue index 2abfe27..1d39da9 100644 --- a/property-uniapp-project/pageSubPack/online-repair/repairDetail.vue +++ b/property-uniapp-project/pageSubPack/online-repair/repairDetail.vue @@ -267,11 +267,12 @@ const previewImage = (url) => { .photo-item { width: 80px; height: 80px; - border: 1px dashed #ccc; + /* border: 1px solid #ccc; */ border-radius: 4px; display: flex; align-items: center; justify-content: center; + background-color: #f5f5f5; } .btn-container { diff --git a/property-uniapp-project/pages/index/index.vue b/property-uniapp-project/pages/index/index.vue index e56d227..74a2662 100644 --- a/property-uniapp-project/pages/index/index.vue +++ b/property-uniapp-project/pages/index/index.vue @@ -165,7 +165,7 @@ import { ref } from 'vue' import {onLoad,onUnload,onShow} from '@dcloudio/uni-app' import moment from 'moment' -import {getNoticeLatest,getCurrentVillage,getActivitylatest} from "/pageSubPack/api/api.js" +import {getNoticeLatest,getCurrentVillage,getActivitylatest,getBannarList} from "/pageSubPack/api/api.js" // 列表数据状态 @@ -176,7 +176,7 @@ const currentCommunity = ref('请认证小区') const currentVillageId = ref('') const bannerList = ref([ // 'http://47.104.199.163:9090/images/home/banner.png', - "http://47.104.199.163:9090/images/propertyImgs/serviceImg2.png" + // "http://47.104.199.163:9090/images/propertyImgs/serviceImg2.png" ]) const noticeText = ref('暂无公告') @@ -195,6 +195,20 @@ const getNoticeMore = () =>{ url:"/pageSubPack/notice-list/noticeList" }) } +// 获取bannar列表 +const getbannarData = async () =>{ + try{ + const res = await getBannarList({villageId:uni.getStorageSync('currentVillageId')}) + if(res.code === 200){ + bannerList.value = res.data.map(item =>item.url) + }else{ + uni.showToast({title:'获取失败',icon:'error'}) + } + }catch (err){ + const msg = err?.msg || (typeof err === 'string' ? err : '获取失败') + uni.showToast({title: msg,icon:'error'}) + } +} // 接收选择小区返回的参数 const slelctHomeData = (data) =>{ // console.log('收到B页面返回的数据:', data) @@ -221,7 +235,7 @@ const getCurrentCommunityData = () => { } }).catch(err =>{ uni.showToast({ - title: '网络异常', + title: err.msg || '网络异常', icon: 'error' }); }) @@ -251,7 +265,7 @@ const getNoticeData = async() =>{ } catch (err) { // console.error('获取通知数据异常:', err) uni.showToast({ - title: err.msg, + title: err.msg || '网络异常', icon: 'error', duration: 1000 }) @@ -276,6 +290,7 @@ onLoad(() => { } getNoticeData() getNewActivityList() + getbannarData() }) // 页面销毁时移除监听(防止内存泄漏) @@ -387,7 +402,7 @@ const moreClick = () =>{ width: 100%; background: repeating-linear-gradient(to right, #EDF4FA , #C0E4FB); position: absolute; - + } .status_bar { height: 46px;