Merge branch 'master' of http://gitea.bugtc.com/zhouyanli/property-manager-side
This commit is contained in:
@@ -18,6 +18,11 @@ onLaunch(() => {
|
|||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
getPushCID()
|
getPushCID()
|
||||||
}, 2000)
|
}, 2000)
|
||||||
|
|
||||||
|
// 安全兜底:正常由首页/引导页 onReady 关闭启动屏;若异常未关闭,5 秒后强制关闭,避免卡在启动屏
|
||||||
|
setTimeout(() => {
|
||||||
|
plus.navigator.closeSplashscreen()
|
||||||
|
}, 5000)
|
||||||
// #endif
|
// #endif
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,5 @@ if (process.env.NODE_ENV === 'development') {
|
|||||||
} else {
|
} else {
|
||||||
baseUrl = 'https://wuyeapi.ckdzkj.com' // 生产环境
|
baseUrl = 'https://wuyeapi.ckdzkj.com' // 生产环境
|
||||||
// baseUrl = 'https://wuyeapi.bugtc.com' // 生产环境
|
// baseUrl = 'https://wuyeapi.bugtc.com' // 生产环境
|
||||||
// baseUrl = 'http://192.168.1.222:8080' // 生产环境
|
|
||||||
}
|
}
|
||||||
export default baseUrl;
|
export default baseUrl;
|
||||||
|
|||||||
@@ -2,17 +2,17 @@
|
|||||||
"name" : "花开管家",
|
"name" : "花开管家",
|
||||||
"appid" : "__UNI__5F224F3",
|
"appid" : "__UNI__5F224F3",
|
||||||
"description" : "智慧社区管家端,专为小区物业管理人员打造,支持多小区灵活切换管理。集成账号密码、手机号密码双重登录模式,内置忘记密码找回功能,保障账号安全。涵盖消息通知、日常巡检、故障报修、一键开门、工单流转、投诉处理等核心办公功能,物业人员可在线完成巡检打卡、问题上报、工单派发跟进、投诉对接处理等日常工作,同时支持查看个人上报记录、巡检历史,便捷修改账号信息与登录密码。高效简化社区物业办公流程,提升小区服务与管理效率,打造便捷智能的社区管理服务平台。",
|
"description" : "智慧社区管家端,专为小区物业管理人员打造,支持多小区灵活切换管理。集成账号密码、手机号密码双重登录模式,内置忘记密码找回功能,保障账号安全。涵盖消息通知、日常巡检、故障报修、一键开门、工单流转、投诉处理等核心办公功能,物业人员可在线完成巡检打卡、问题上报、工单派发跟进、投诉对接处理等日常工作,同时支持查看个人上报记录、巡检历史,便捷修改账号信息与登录密码。高效简化社区物业办公流程,提升小区服务与管理效率,打造便捷智能的社区管理服务平台。",
|
||||||
"versionName" : "1.0.6",
|
"versionName" : "1.0.7",
|
||||||
"versionCode" : 106,
|
"versionCode" : 107,
|
||||||
"transformPx" : false,
|
"transformPx" : false,
|
||||||
"app-plus" : {
|
"app-plus" : {
|
||||||
"usingComponents" : true,
|
"usingComponents" : true,
|
||||||
"nvueStyleCompiler" : "uni-app",
|
"nvueStyleCompiler" : "uni-app",
|
||||||
"compilerVersion" : 3,
|
"compilerVersion" : 3,
|
||||||
"splashscreen" : {
|
"splashscreen" : {
|
||||||
"alwaysShowBeforeRender" : false,
|
"alwaysShowBeforeRender" : true,
|
||||||
"waiting" : true,
|
"waiting" : true,
|
||||||
"autoclose" : true,
|
"autoclose" : false,
|
||||||
"delay" : 0,
|
"delay" : 0,
|
||||||
"useOriginalMsgbox" : true
|
"useOriginalMsgbox" : true
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -308,12 +308,15 @@
|
|||||||
.filter-row {
|
.filter-row {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 20rpx;
|
|
||||||
|
|
||||||
.filter-item {
|
.filter-item {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
|
|
||||||
|
& + .filter-item {
|
||||||
|
margin-left: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
.filter-label {
|
.filter-label {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -352,7 +355,6 @@
|
|||||||
.btn-row {
|
.btn-row {
|
||||||
display: flex;
|
display: flex;
|
||||||
margin-top: 24rpx;
|
margin-top: 24rpx;
|
||||||
gap: 24rpx;
|
|
||||||
|
|
||||||
.reset-btn,
|
.reset-btn,
|
||||||
.search-btn {
|
.search-btn {
|
||||||
@@ -378,6 +380,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.search-btn {
|
.search-btn {
|
||||||
|
margin-left: 24rpx;
|
||||||
background: linear-gradient(135deg, #4D5DFA 0%, #6C7AFF 100%);
|
background: linear-gradient(135deg, #4D5DFA 0%, #6C7AFF 100%);
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
box-shadow: 0 8rpx 20rpx rgba(77, 93, 250, 0.25);
|
box-shadow: 0 8rpx 20rpx rgba(77, 93, 250, 0.25);
|
||||||
@@ -527,9 +530,11 @@
|
|||||||
padding: 16rpx 0 12rpx;
|
padding: 16rpx 0 12rpx;
|
||||||
|
|
||||||
.filter-row {
|
.filter-row {
|
||||||
gap: 12rpx;
|
|
||||||
|
|
||||||
.filter-item {
|
.filter-item {
|
||||||
|
& + .filter-item {
|
||||||
|
margin-left: 12rpx;
|
||||||
|
}
|
||||||
|
|
||||||
.filter-label {
|
.filter-label {
|
||||||
padding: 12rpx 16rpx;
|
padding: 12rpx 16rpx;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
|
|||||||
@@ -96,7 +96,7 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed } from 'vue'
|
import { ref, computed } from 'vue'
|
||||||
import { onLoad } from '@dcloudio/uni-app'
|
import { onLoad, onReady } from '@dcloudio/uni-app'
|
||||||
import { getLoginPassword } from '../../api/api.js'
|
import { getLoginPassword } from '../../api/api.js'
|
||||||
import { clearAccountStorage } from '../../api/request.js'
|
import { clearAccountStorage } from '../../api/request.js'
|
||||||
import PrivacyPopup from '@/components/privacy-popup/privacy-popup.vue'
|
import PrivacyPopup from '@/components/privacy-popup/privacy-popup.vue'
|
||||||
@@ -164,6 +164,13 @@ onLoad(() => {
|
|||||||
if (savedRemember) rememberPwd.value = savedRemember
|
if (savedRemember) rememberPwd.value = savedRemember
|
||||||
})
|
})
|
||||||
|
|
||||||
|
onReady(() => {
|
||||||
|
// 登录页渲染完成后关闭启动屏(登录过但未登录时直接进登录页)
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
plus.navigator.closeSplashscreen()
|
||||||
|
// #endif
|
||||||
|
})
|
||||||
|
|
||||||
// 登录逻辑
|
// 登录逻辑
|
||||||
const handleLogin = () => {
|
const handleLogin = () => {
|
||||||
if (!phoneNumber.value) {
|
if (!phoneNumber.value) {
|
||||||
|
|||||||
@@ -54,6 +54,7 @@
|
|||||||
const selectedItem = ref(null)
|
const selectedItem = ref(null)
|
||||||
const displayedCommunities = ref([])
|
const displayedCommunities = ref([])
|
||||||
const isLoading = ref(false)
|
const isLoading = ref(false)
|
||||||
|
const isConfirming = ref(false)
|
||||||
let searchTimeout = null
|
let searchTimeout = null
|
||||||
const defaultVillageId = ref('')
|
const defaultVillageId = ref('')
|
||||||
|
|
||||||
@@ -123,10 +124,13 @@
|
|||||||
|
|
||||||
// 确认选择
|
// 确认选择
|
||||||
const handleConfirm = () => {
|
const handleConfirm = () => {
|
||||||
|
// 防重复点击
|
||||||
|
if (isConfirming.value) return
|
||||||
if (!selectedItem.value) {
|
if (!selectedItem.value) {
|
||||||
uni.showToast({ title: '请先选择小区', icon: 'none', duration: 2000 })
|
uni.showToast({ title: '请先选择小区', icon: 'none', duration: 2000 })
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
isConfirming.value = true
|
||||||
uni.showLoading({ title: '切换中...', mask: true })
|
uni.showLoading({ title: '切换中...', mask: true })
|
||||||
switchVillage({ villageId: selectedItem.value.id }).then((res) =>{
|
switchVillage({ villageId: selectedItem.value.id }).then((res) =>{
|
||||||
if(res.code === 200){
|
if(res.code === 200){
|
||||||
@@ -137,9 +141,12 @@
|
|||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
}, 1500)
|
}, 1500)
|
||||||
}else{
|
}else{
|
||||||
|
isConfirming.value = false
|
||||||
|
uni.hideLoading()
|
||||||
uni.showToast({ title: res.msg || '切换失败', icon: 'none' })
|
uni.showToast({ title: res.msg || '切换失败', icon: 'none' })
|
||||||
}
|
}
|
||||||
}).catch((err)=>{
|
}).catch((err)=>{
|
||||||
|
isConfirming.value = false
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
uni.showToast({title:err.msg || '网络异常',icon:'none'})
|
uni.showToast({title:err.msg || '网络异常',icon:'none'})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,17 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="setting-container">
|
<view class="setting-container">
|
||||||
<!-- <view class="status_bar"></view> -->
|
|
||||||
<!-- 顶部导航栏 -->
|
|
||||||
<!-- <view class="nav-bar">
|
|
||||||
<view class="nav-left" @tap="goBack">
|
|
||||||
<uni-icons type="left" size="22" color="#000"></uni-icons>
|
|
||||||
</view>
|
|
||||||
<view class="nav-title">设置</view>
|
|
||||||
<view class="nav-right"></view>
|
|
||||||
</view> -->
|
|
||||||
|
|
||||||
<!-- 内容区域 -->
|
<!-- 内容区域 -->
|
||||||
<scroll-view class="content" scroll-y="true">
|
<view class="content">
|
||||||
<!-- 手机号设置项 -->
|
<!-- 手机号设置项 -->
|
||||||
<view class="setting-item" @tap="goToChangePhone">
|
<view class="setting-item" @tap="goToChangePhone">
|
||||||
<view class="item-label">手机号</view>
|
<view class="item-label">手机号</view>
|
||||||
@@ -31,9 +22,12 @@
|
|||||||
<!-- <view class="item-value">{{ }}</view> -->
|
<!-- <view class="item-value">{{ }}</view> -->
|
||||||
<uni-icons type="arrowright" size="20" color="#ccc"></uni-icons>
|
<uni-icons type="arrowright" size="20" color="#ccc"></uni-icons>
|
||||||
</view>
|
</view>
|
||||||
</scroll-view>
|
</view>
|
||||||
|
|
||||||
<!-- 退出登录按钮 -->
|
<!-- 底部占位,避免内容被固定按钮遮挡 -->
|
||||||
|
<view class="placeholder"></view>
|
||||||
|
|
||||||
|
<!-- 退出登录按钮(固定底部) -->
|
||||||
<view class="logout-btn-wrap">
|
<view class="logout-btn-wrap">
|
||||||
<button class="logout-btn" @tap="handleLogout">退出登录</button>
|
<button class="logout-btn" @tap="handleLogout">退出登录</button>
|
||||||
</view>
|
</view>
|
||||||
@@ -144,52 +138,19 @@ const confirmLogout = () => {
|
|||||||
.setting-container {
|
.setting-container {
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
display: flex;
|
box-sizing: border-box;
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
.status_bar {
|
|
||||||
width: 100%;
|
|
||||||
height: 46px;
|
|
||||||
}
|
|
||||||
/* 导航栏样式 */
|
|
||||||
.nav-bar {
|
|
||||||
height: 44px;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
padding: 0 15px;
|
|
||||||
border-bottom: 1px solid #f0f0f0;
|
|
||||||
background-color: #fff;
|
|
||||||
position: sticky;
|
|
||||||
top: 0;
|
|
||||||
z-index: 99;
|
|
||||||
}
|
|
||||||
|
|
||||||
.nav-left {
|
|
||||||
width: 40px;
|
|
||||||
height: 44px;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: flex-start;
|
|
||||||
}
|
|
||||||
|
|
||||||
.nav-title {
|
|
||||||
flex: 1;
|
|
||||||
text-align: center;
|
|
||||||
font-size: 32rpx;
|
|
||||||
font-weight: 500;
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
|
|
||||||
.nav-right {
|
|
||||||
width: 40px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 内容区域 */
|
/* 内容区域 */
|
||||||
.content {
|
.content {
|
||||||
flex: 1;
|
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 底部占位,高度与固定按钮区一致 */
|
||||||
|
.placeholder {
|
||||||
|
height: 104px;
|
||||||
|
}
|
||||||
|
|
||||||
/* 设置项样式 */
|
/* 设置项样式 */
|
||||||
.setting-item {
|
.setting-item {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -218,7 +179,12 @@ const confirmLogout = () => {
|
|||||||
|
|
||||||
/* 退出登录按钮 */
|
/* 退出登录按钮 */
|
||||||
.logout-btn-wrap {
|
.logout-btn-wrap {
|
||||||
|
position: fixed;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
padding: 30px 15px;
|
padding: 30px 15px;
|
||||||
|
background-color: #ffffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.logout-btn {
|
.logout-btn {
|
||||||
|
|||||||
@@ -313,7 +313,6 @@ onShow(() => {
|
|||||||
.rate-row {
|
.rate-row {
|
||||||
margin-top: 20rpx;
|
margin-top: 20rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 30rpx;
|
|
||||||
.rate-item {
|
.rate-item {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
border-radius: 8rpx;
|
border-radius: 8rpx;
|
||||||
@@ -324,6 +323,9 @@ onShow(() => {
|
|||||||
background-size: cover;
|
background-size: cover;
|
||||||
background-position: center;
|
background-position: center;
|
||||||
}
|
}
|
||||||
|
.rate-item + .rate-item {
|
||||||
|
margin-left: 30rpx;
|
||||||
|
}
|
||||||
.rate-occupy {
|
.rate-occupy {
|
||||||
background-image: url('https://wuye.ckdzkj.com/images/imgs/rate-occupy.png');
|
background-image: url('https://wuye.ckdzkj.com/images/imgs/rate-occupy.png');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
{
|
{
|
||||||
"pages": [{
|
"pages": [{
|
||||||
"path": "pages/guide/guide",
|
"path": "pages/index/index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "引导页",
|
"navigationBarTitleText": "工作台",
|
||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/index/index",
|
"path": "pages/guide/guide",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "工作台",
|
"navigationBarTitleText": "引导页",
|
||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="guide-page" v-if="!token">
|
<view class="guide-page">
|
||||||
|
<template v-if="!token">
|
||||||
<view class="status-bar"></view>
|
<view class="status-bar"></view>
|
||||||
<!-- 引导内容滑动容器 -->
|
<!-- 引导内容滑动容器 -->
|
||||||
<swiper
|
<swiper
|
||||||
@@ -67,11 +68,13 @@
|
|||||||
{{ currentStep === 2 ? '立即体验' : '下一步' }}
|
{{ currentStep === 2 ? '立即体验' : '下一步' }}
|
||||||
</button>
|
</button>
|
||||||
</view>
|
</view>
|
||||||
|
</template>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
|
import { onReady } from '@dcloudio/uni-app';
|
||||||
|
|
||||||
// ========== 已登录直接进首页,跳过引导页 ==========
|
// ========== 已登录直接进首页,跳过引导页 ==========
|
||||||
const token = uni.getStorageSync('token');
|
const token = uni.getStorageSync('token');
|
||||||
@@ -81,6 +84,15 @@ if (token) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 引导页渲染完成后关闭启动屏(仅未登录;已登录由首页 onReady 关闭)
|
||||||
|
onReady(() => {
|
||||||
|
if (!token) {
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
plus.navigator.closeSplashscreen()
|
||||||
|
// #endif
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// ========== 响应式数据 ==========
|
// ========== 响应式数据 ==========
|
||||||
// 当前引导步骤(0/1/2)
|
// 当前引导步骤(0/1/2)
|
||||||
const currentStep = ref(0);
|
const currentStep = ref(0);
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="content-class">
|
<view class="content-class">
|
||||||
|
<template v-if="isLoggedIn">
|
||||||
<!-- 顶部渐变背景层 -->
|
<!-- 顶部渐变背景层 -->
|
||||||
<view class="bg-gradient"></view>
|
<view class="bg-gradient"></view>
|
||||||
|
|
||||||
<!-- 页面内容区 -->
|
<!-- 页面内容区 -->
|
||||||
<view class="page-content">
|
<view class="page-content">
|
||||||
<!-- 粘性顶部区域(状态栏 + 导航栏 + 小区选择) -->
|
|
||||||
<view class="sticky-header">
|
<view class="sticky-header">
|
||||||
<!-- 状态栏占位 -->
|
<!-- 状态栏占位 -->
|
||||||
<view class="status_bar" :style="{ height: statusBarHeight + 'px' }"></view>
|
<view class="status_bar" :style="{ height: statusBarHeight + 'px' }"></view>
|
||||||
@@ -118,12 +118,14 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
</template>
|
||||||
|
<view v-else class="launch-placeholder"></view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import { onLoad, onUnload, onShow } from '@dcloudio/uni-app'
|
import { onLoad, onUnload, onShow, onReady } from '@dcloudio/uni-app'
|
||||||
import {
|
import {
|
||||||
getCurrentVillage,
|
getCurrentVillage,
|
||||||
getTodayInspection,
|
getTodayInspection,
|
||||||
@@ -136,7 +138,10 @@ import { usePermStore } from '@/stores/usePermStore'
|
|||||||
|
|
||||||
const permStore = usePermStore()
|
const permStore = usePermStore()
|
||||||
|
|
||||||
// 首次加载标记:onLoad 和 onShow 在首次进入时都会触发,用此标记避免重复请求
|
// 登录状态:未登录时启动跳引导页
|
||||||
|
const isLoggedIn = ref(!!uni.getStorageSync('token'))
|
||||||
|
|
||||||
|
// 首次加载标记
|
||||||
const hasInit = ref(false)
|
const hasInit = ref(false)
|
||||||
|
|
||||||
// banner 缓存 key 和缓存时长(30分钟)
|
// banner 缓存 key 和缓存时长(30分钟)
|
||||||
@@ -302,7 +307,6 @@ const handleFunctionClick = item => {
|
|||||||
}
|
}
|
||||||
// 获取当前小区
|
// 获取当前小区
|
||||||
const currentVillageData = () => {
|
const currentVillageData = () => {
|
||||||
// 先重置,避免新账号无小区时仍显示旧账号的小区
|
|
||||||
currentCommunity.value = '请先绑定房屋'
|
currentCommunity.value = '请先绑定房屋'
|
||||||
getCurrentVillage()
|
getCurrentVillage()
|
||||||
.then(res => {
|
.then(res => {
|
||||||
@@ -313,7 +317,9 @@ const currentVillageData = () => {
|
|||||||
getNoticeData()
|
getNoticeData()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(() => {})
|
.catch(() => {
|
||||||
|
currentCommunity.value = '请先绑定房屋'
|
||||||
|
})
|
||||||
}
|
}
|
||||||
// 获取今日巡检数据
|
// 获取今日巡检数据
|
||||||
const getInspectionData = () => {
|
const getInspectionData = () => {
|
||||||
@@ -339,17 +345,16 @@ const getInspectionData = () => {
|
|||||||
}
|
}
|
||||||
// 获取消息通知
|
// 获取消息通知
|
||||||
const getNoticeData = () => {
|
const getNoticeData = () => {
|
||||||
getNewNoticeData()
|
getNewNoticeData().then(res => {
|
||||||
.then(res => {
|
const notice = res.code === 200 && res.data ? (res.data.notice || '') : '暂无公告'
|
||||||
if (res.code === 200 && res.data) {
|
// 仅在内容真正变化时才更新
|
||||||
noticeText.value = res.data.notice || ''
|
if (noticeText.value !== notice) {
|
||||||
} else {
|
noticeText.value = notice
|
||||||
noticeText.value = '暂无公告'
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(() => {})
|
.catch(() => {})
|
||||||
}
|
}
|
||||||
// 获取bannar图(带缓存:30分钟内优先用缓存,请求成功后更新缓存)
|
// 获取bannar图
|
||||||
function getbannarData(forceRefresh = false) {
|
function getbannarData(forceRefresh = false) {
|
||||||
// 非强制刷新时,优先读缓存
|
// 非强制刷新时,优先读缓存
|
||||||
if (!forceRefresh) {
|
if (!forceRefresh) {
|
||||||
@@ -414,6 +419,7 @@ const slelctHomeData = data => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onShow(() => {
|
onShow(() => {
|
||||||
|
if (!isLoggedIn.value) return
|
||||||
if (!hasInit.value) {
|
if (!hasInit.value) {
|
||||||
// 首次加载:onLoad 已触发过核心数据请求,这里只补 onLoad 没调的和需要每次都刷新的
|
// 首次加载:onLoad 已触发过核心数据请求,这里只补 onLoad 没调的和需要每次都刷新的
|
||||||
hasInit.value = true
|
hasInit.value = true
|
||||||
@@ -434,11 +440,33 @@ onShow(() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
onLoad(() => {
|
onLoad(() => {
|
||||||
|
// 未登录:登录过→登录页;首次下载→引导页
|
||||||
|
if (!isLoggedIn.value) {
|
||||||
|
const hasShowGuide = uni.getStorageSync('hasShowGuide')
|
||||||
|
uni.hideTabBar({ animation: false })
|
||||||
|
uni.reLaunch({
|
||||||
|
url: hasShowGuide ? '/pageSubPack/loginSub/pwd-login' : '/pages/guide/guide',
|
||||||
|
animationType: 'none',
|
||||||
|
animationDuration: 0
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 已登录:确保 tabBar 显示(未登录启动时曾被 hideTabBar 隐藏,switchTab 不会自动恢复)
|
||||||
|
uni.showTabBar({ animation: false })
|
||||||
uni.$on('confirm', slelctHomeData)
|
uni.$on('confirm', slelctHomeData)
|
||||||
currentVillageData()
|
currentVillageData()
|
||||||
getInspectionData()
|
getInspectionData()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
onReady(() => {
|
||||||
|
// 已登录:首页即最终页,渲染完成后关闭启动屏(未登录由引导页 onReady 关闭)
|
||||||
|
if (isLoggedIn.value) {
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
plus.navigator.closeSplashscreen()
|
||||||
|
// #endif
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
onUnload(() => {
|
onUnload(() => {
|
||||||
uni.$off('confirm', slelctHomeData)
|
uni.$off('confirm', slelctHomeData)
|
||||||
})
|
})
|
||||||
@@ -465,6 +493,12 @@ onUnload(() => {
|
|||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 未登录启动占位:背景与引导页一致,过渡不闪烁 */
|
||||||
|
.launch-placeholder {
|
||||||
|
min-height: 100vh;
|
||||||
|
background: linear-gradient(to bottom, #e2f0ff, #f6faff);
|
||||||
|
}
|
||||||
|
|
||||||
/* 顶部渐变背景 - 增加高度确保覆盖粘性头部区域 */
|
/* 顶部渐变背景 - 增加高度确保覆盖粘性头部区域 */
|
||||||
.bg-gradient {
|
.bg-gradient {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
|||||||
Reference in New Issue
Block a user