优化启动页
This commit is contained in:
@@ -96,7 +96,7 @@
|
||||
|
||||
<script setup>
|
||||
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 { clearAccountStorage } from '../../api/request.js'
|
||||
import PrivacyPopup from '@/components/privacy-popup/privacy-popup.vue'
|
||||
@@ -164,6 +164,13 @@ onLoad(() => {
|
||||
if (savedRemember) rememberPwd.value = savedRemember
|
||||
})
|
||||
|
||||
onReady(() => {
|
||||
// 登录页渲染完成后关闭启动屏(登录过但未登录时直接进登录页)
|
||||
// #ifdef APP-PLUS
|
||||
plus.navigator.closeSplashscreen()
|
||||
// #endif
|
||||
})
|
||||
|
||||
// 登录逻辑
|
||||
const handleLogin = () => {
|
||||
if (!phoneNumber.value) {
|
||||
|
||||
@@ -54,6 +54,7 @@
|
||||
const selectedItem = ref(null)
|
||||
const displayedCommunities = ref([])
|
||||
const isLoading = ref(false)
|
||||
const isConfirming = ref(false)
|
||||
let searchTimeout = null
|
||||
const defaultVillageId = ref('')
|
||||
|
||||
@@ -123,10 +124,13 @@
|
||||
|
||||
// 确认选择
|
||||
const handleConfirm = () => {
|
||||
// 防重复点击
|
||||
if (isConfirming.value) return
|
||||
if (!selectedItem.value) {
|
||||
uni.showToast({ title: '请先选择小区', icon: 'none', duration: 2000 })
|
||||
return
|
||||
}
|
||||
isConfirming.value = true
|
||||
uni.showLoading({ title: '切换中...', mask: true })
|
||||
switchVillage({ villageId: selectedItem.value.id }).then((res) =>{
|
||||
if(res.code === 200){
|
||||
@@ -137,9 +141,12 @@
|
||||
uni.navigateBack()
|
||||
}, 1500)
|
||||
}else{
|
||||
isConfirming.value = false
|
||||
uni.hideLoading()
|
||||
uni.showToast({ title: res.msg || '切换失败', icon: 'none' })
|
||||
}
|
||||
}).catch((err)=>{
|
||||
isConfirming.value = false
|
||||
uni.hideLoading()
|
||||
uni.showToast({title:err.msg || '网络异常',icon:'none'})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user