diff --git a/wuye-manager-uniapp/pageSubPack/loginSub/login.vue b/wuye-manager-uniapp/pageSubPack/loginSub/login.vue index 88a4e83..b8eae11 100644 --- a/wuye-manager-uniapp/pageSubPack/loginSub/login.vue +++ b/wuye-manager-uniapp/pageSubPack/loginSub/login.vue @@ -221,8 +221,8 @@ const handleLogin = () => { if (res.data) { uni.setStorageSync('token', res.data.token) // 存用户ID - if (res.data.userId) { - uni.setStorageSync('userId', res.data.userId) + if (res.data.user.userId) { + uni.setStorageSync('userId', res.data.user.userId) } // 清掉上次账号的小区缓存,防止新账号显示旧小区 uni.removeStorageSync('currentVillage') diff --git a/wuye-manager-uniapp/pageSubPack/notice-list/select-community.vue b/wuye-manager-uniapp/pageSubPack/notice-list/select-community.vue index d8dad84..fe581b2 100644 --- a/wuye-manager-uniapp/pageSubPack/notice-list/select-community.vue +++ b/wuye-manager-uniapp/pageSubPack/notice-list/select-community.vue @@ -118,6 +118,7 @@ switchVillage({ villageId: selectedItem.value.id }).then((res) =>{ if(res.code === 200){ uni.showToast({ title: '切换成功', icon: 'success', duration: 1500 }) + uni.hideLoading() uni.$emit('confirm', selectedItem.value) setTimeout(() => { uni.navigateBack() diff --git a/wuye-manager-uniapp/pages/index/index.vue b/wuye-manager-uniapp/pages/index/index.vue index af9b00d..ebae898 100644 --- a/wuye-manager-uniapp/pages/index/index.vue +++ b/wuye-manager-uniapp/pages/index/index.vue @@ -46,8 +46,16 @@ :current="current" mode="default" > - - + + @@ -166,7 +174,7 @@ import { // 列表数据状态 const current = ref(0) -const currentCommunity = ref('请选择小区') +const currentCommunity = ref('请先绑定房屋') const bannerList = ref([]) const noticeText = ref('暂无公告') const allCount = ref(0) // 全部巡检 @@ -239,7 +247,7 @@ const goToReport = () => { // 获取当前小区 const currentVillageData = () => { // 先重置,避免新账号无小区时仍显示旧账号的小区 - currentCommunity.value = '请选择小区' + currentCommunity.value = '请先绑定房屋' getCurrentVillage() .then(res => { const data = res.data @@ -290,7 +298,12 @@ function getbannarData() { getBannarList() .then(res => { if (res.code === 200 && res.data) { - bannerList.value = res.data + // 只有数据真正变化时才更新,避免 swiper 重新渲染导致闪动 + const newData = res.data + const oldData = bannerList.value + if (JSON.stringify(newData) !== JSON.stringify(oldData)) { + bannerList.value = newData + } } else { bannerList.value = [] }