修复bug
This commit is contained in:
@@ -18,18 +18,9 @@
|
|||||||
getPushCID()
|
getPushCID()
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
// 路由分发(同步):所有人先进首页,点击功能再提示登录
|
// 路由分发:全局拦截器注册(首页 onLoad 中处理首次引导页跳转)
|
||||||
const token = uni.getStorageSync('token') || ''
|
const token = uni.getStorageSync('token') || ''
|
||||||
const hasShowGuide = uni.getStorageSync('hasShowGuide')
|
console.log('App 启动(hasToken=' + !!token + ')')
|
||||||
|
|
||||||
// 首次使用:标记引导已看过(不再强制引导页),直接进首页
|
|
||||||
if (!token && !hasShowGuide) {
|
|
||||||
console.log('首次启动,标记引导已看过,进入首页')
|
|
||||||
uni.setStorageSync('hasShowGuide', true)
|
|
||||||
}
|
|
||||||
|
|
||||||
// 所有人统一进首页
|
|
||||||
console.log('进入首页(hasToken=' + !!token + ')')
|
|
||||||
|
|
||||||
// 全局 navigateTo 拦截器:未登录用户访问需登录页面时自动跳转登录页
|
// 全局 navigateTo 拦截器:未登录用户访问需登录页面时自动跳转登录页
|
||||||
uni.addInterceptor('navigateTo', {
|
uni.addInterceptor('navigateTo', {
|
||||||
|
|||||||
@@ -51,7 +51,6 @@
|
|||||||
<image src="https://wuyeadmin.bugtc.com/images/login/password.png" mode="" style="height: 100%;width: 100%;"></image>
|
<image src="https://wuyeadmin.bugtc.com/images/login/password.png" mode="" style="height: 100%;width: 100%;"></image>
|
||||||
</view>
|
</view>
|
||||||
<uni-easyinput class="input-content" type="password" v-model="password"
|
<uni-easyinput class="input-content" type="password" v-model="password"
|
||||||
@input="password = password.replace(/\s/g, '')"
|
|
||||||
placeholder="请输入密码" :inputBorder="false" maxlength="16" :placeholderStyle="placeholderStyle">
|
placeholder="请输入密码" :inputBorder="false" maxlength="16" :placeholderStyle="placeholderStyle">
|
||||||
</uni-easyinput>
|
</uni-easyinput>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -49,7 +49,7 @@
|
|||||||
<image src="https://wuyeadmin.bugtc.com/images/login/password.png" mode=""
|
<image src="https://wuyeadmin.bugtc.com/images/login/password.png" mode=""
|
||||||
style="height: 100%;width: 100%;"></image>
|
style="height: 100%;width: 100%;"></image>
|
||||||
</view>
|
</view>
|
||||||
<uni-easyinput class="input-content" type="password" v-model="password" @input="password = password.replace(/\s/g, '')" @blur="validatePassword" @focus="clearPasswordError" placeholder="请输入密码(6-16位)"
|
<uni-easyinput class="input-content" type="password" v-model="password" @blur="validatePassword" @focus="clearPasswordError" placeholder="请输入密码(6-16位)"
|
||||||
:inputBorder="false" maxlength="16" :placeholderStyle="placeholderStyle" />
|
:inputBorder="false" maxlength="16" :placeholderStyle="placeholderStyle" />
|
||||||
</view>
|
</view>
|
||||||
<text class="input-error" v-if="passwordError">{{ passwordError }}</text>
|
<text class="input-error" v-if="passwordError">{{ passwordError }}</text>
|
||||||
@@ -86,6 +86,7 @@
|
|||||||
import {
|
import {
|
||||||
ref,
|
ref,
|
||||||
computed,
|
computed,
|
||||||
|
watch,
|
||||||
onUnmounted
|
onUnmounted
|
||||||
} from 'vue';
|
} from 'vue';
|
||||||
import {
|
import {
|
||||||
@@ -127,6 +128,18 @@
|
|||||||
agreeAgreement.value;
|
agreeAgreement.value;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 实时校验密码格式(输入空格或特殊符号立即提示)
|
||||||
|
watch(password, (val) => {
|
||||||
|
if (!val) { passwordError.value = ''; return }
|
||||||
|
if (val.length < 6 || val.length > 16) {
|
||||||
|
passwordError.value = '密码需 6-16 位'
|
||||||
|
} else if (/[^a-zA-Z0-9]/.test(val)) {
|
||||||
|
passwordError.value = '密码格式错误'
|
||||||
|
} else {
|
||||||
|
passwordError.value = ''
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
// ========== 方法 ==========
|
// ========== 方法 ==========
|
||||||
const goBack = () => {
|
const goBack = () => {
|
||||||
uni.navigateBack();
|
uni.navigateBack();
|
||||||
@@ -160,8 +173,8 @@
|
|||||||
if (!val) { passwordError.value = ''; return }
|
if (!val) { passwordError.value = ''; return }
|
||||||
if (val.length < 6 || val.length > 16) {
|
if (val.length < 6 || val.length > 16) {
|
||||||
passwordError.value = '密码需 6-16 位'
|
passwordError.value = '密码需 6-16 位'
|
||||||
} else if (/\s/.test(val)) {
|
} else if (/[^a-zA-Z0-9]/.test(val)) {
|
||||||
passwordError.value = '密码不能包含空格'
|
passwordError.value = '密码格式错误'
|
||||||
} else {
|
} else {
|
||||||
passwordError.value = ''
|
passwordError.value = ''
|
||||||
}
|
}
|
||||||
@@ -288,8 +301,8 @@
|
|||||||
uni.showToast({ title: '密码不能超过 16 位', icon: 'none' });
|
uni.showToast({ title: '密码不能超过 16 位', icon: 'none' });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (/\s/.test(password.value)) {
|
if (/[^a-zA-Z0-9]/.test(password.value)) {
|
||||||
uni.showToast({ title: '密码格式不对,不允许注册', icon: 'none' });
|
uni.showToast({ title: '密码格式错误', icon: 'none' });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!agreeAgreement.value) {
|
if (!agreeAgreement.value) {
|
||||||
|
|||||||
@@ -294,16 +294,14 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
const goBack = () => {
|
const goBack = () => {
|
||||||
uni.removeStorageSync('carNum')
|
uni.removeStorageSync("carNum")
|
||||||
uni.removeStorageSync('carBrand')
|
uni.removeStorageSync("carBrand")
|
||||||
uni.removeStorageSync('carModel')
|
uni.removeStorageSync("carModel")
|
||||||
uni.removeStorageSync('carColor')
|
uni.removeStorageSync("carColor")
|
||||||
uni.removeStorageSync('carImageUrl')
|
uni.removeStorageSync("carImageUrl")
|
||||||
uni.removeStorageSync('carBrandId')
|
uni.removeStorageSync("carBrandId")
|
||||||
uni.removeStorageSync('checkType')
|
uni.removeStorageSync("checkType")
|
||||||
uni.navigateTo({
|
uni.navigateBack()
|
||||||
url: '/pageSubPack/my/myCarIndex'
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -869,25 +869,20 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
const goBack = () => {
|
const goBack = () => {
|
||||||
uni.removeStorageSync('communityId');
|
uni.removeStorageSync("communityId");
|
||||||
uni.removeStorageSync('communityName');
|
uni.removeStorageSync("communityName");
|
||||||
uni.removeStorageSync('buildingId');
|
uni.removeStorageSync("buildingId");
|
||||||
uni.removeStorageSync('buildingName');
|
uni.removeStorageSync("buildingName");
|
||||||
uni.removeStorageSync('unitId');
|
uni.removeStorageSync("unitId");
|
||||||
uni.removeStorageSync('unitName');
|
uni.removeStorageSync("unitName");
|
||||||
uni.removeStorageSync('floorId');
|
uni.removeStorageSync("floorId");
|
||||||
uni.removeStorageSync('floorName');
|
uni.removeStorageSync("floorName");
|
||||||
uni.removeStorageSync('houseNumberId');
|
uni.removeStorageSync("houseNumberId");
|
||||||
uni.removeStorageSync('houseNumberName');
|
uni.removeStorageSync("houseNumberName");
|
||||||
uni.removeStorageSync('houseStatus')
|
uni.removeStorageSync("houseStatus")
|
||||||
uni.removeStorageSync('houseIsDefault')
|
uni.removeStorageSync("houseIsDefault")
|
||||||
uni.removeStorageSync('updateHouseId')
|
uni.removeStorageSync("updateHouseId")
|
||||||
uni.navigateTo({
|
uni.navigateBack()
|
||||||
url: '/pageSubPack/my/myHouseIndex',
|
|
||||||
success: res => {},
|
|
||||||
fail: () => {},
|
|
||||||
complete: () => {}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
|||||||
@@ -324,23 +324,19 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
const goBack = () => {
|
const goBack = () => {
|
||||||
uni.removeStorageSync('communityId')
|
uni.removeStorageSync("communityId")
|
||||||
uni.removeStorageSync('communityName')
|
uni.removeStorageSync("communityName")
|
||||||
// uni.removeStorageSync('bindHouseId')
|
uni.removeStorageSync("checkType")
|
||||||
// uni.removeStorageSync('bindHouseName')
|
uni.removeStorageSync("parkingLotId")
|
||||||
uni.removeStorageSync('checkType')
|
uni.removeStorageSync("parkingLotName")
|
||||||
uni.removeStorageSync('parkingLotId')
|
uni.removeStorageSync("parkingSpaceId")
|
||||||
uni.removeStorageSync('parkingLotName')
|
uni.removeStorageSync("parkingStatus")
|
||||||
uni.removeStorageSync('parkingSpaceId')
|
uni.removeStorageSync("parkingSpaceName")
|
||||||
uni.removeStorageSync('parkingStatus')
|
uni.removeStorageSync("bindCarId")
|
||||||
uni.removeStorageSync('parkingSpaceName')
|
uni.removeStorageSync("bindCarName")
|
||||||
uni.removeStorageSync('bindCarId')
|
uni.removeStorageSync("ownerId")
|
||||||
uni.removeStorageSync('bindCarName')
|
uni.removeStorageSync("ownerName")
|
||||||
uni.removeStorageSync('ownerId')
|
uni.navigateBack()
|
||||||
uni.removeStorageSync('ownerName')
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pageSubPack/my/myParkingSpaceIndex'
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -190,9 +190,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
const goBack = () => {
|
const goBack = () => {
|
||||||
uni.navigateTo({
|
uni.navigateBack()
|
||||||
url: '/pageSubPack/my/addParkingSpace'
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -211,12 +211,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
const goBack = () => {
|
const goBack = () => {
|
||||||
uni.navigateTo({
|
uni.navigateBack()
|
||||||
url: '/pageSubPack/my/addParkingSpace',
|
|
||||||
success: res => {},
|
|
||||||
fail: () => {},
|
|
||||||
complete: () => {}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -140,9 +140,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
const goBack = () => {
|
const goBack = () => {
|
||||||
uni.navigateTo({
|
uni.navigateBack()
|
||||||
url: '/pageSubPack/my/myCarIndex'
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -135,9 +135,7 @@ const onSubmit = () => {
|
|||||||
|
|
||||||
// 返回
|
// 返回
|
||||||
const goBack = () => {
|
const goBack = () => {
|
||||||
uni.navigateTo({
|
uni.navigateBack()
|
||||||
url: '/pageSubPack/my/settingIndex'
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 页面卸载清除定时器
|
// 页面卸载清除定时器
|
||||||
|
|||||||
@@ -80,9 +80,7 @@ import { authChangePassword } from '../api/apiSub.js'
|
|||||||
}
|
}
|
||||||
|
|
||||||
const goBack = () =>{
|
const goBack = () =>{
|
||||||
uni.navigateTo({
|
uni.navigateBack()
|
||||||
url: '/pageSubPack/my/settingIndex',
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -92,9 +92,7 @@ const onDeleteAccount = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const goBack = () => {
|
const goBack = () => {
|
||||||
uni.navigateTo({
|
uni.navigateBack()
|
||||||
url: '/pageSubPack/my/settingIndex',
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 页面进入时开始倒计时
|
// 页面进入时开始倒计时
|
||||||
|
|||||||
@@ -249,9 +249,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
const goBack = () => {
|
const goBack = () => {
|
||||||
uni.navigateTo({
|
uni.navigateBack()
|
||||||
url: '/pageSubPack/my/myHouseIndex'
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -129,9 +129,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
const goBack = () => {
|
const goBack = () => {
|
||||||
uni.switchTab({
|
uni.navigateBack()
|
||||||
url: '/pages/myIndex/myIndex'
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,7 @@
|
|||||||
<text
|
<text
|
||||||
class="value">{{ item.houseStatus==0?'自住':item.houseStatus==1?'闲置':item.houseStatus==2?'租赁':item.houseStatus==3?'其他':''}}</text>
|
class="value">{{ item.houseStatus==0?'自住':item.houseStatus==1?'闲置':item.houseStatus==2?'租赁':item.houseStatus==3?'其他':''}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="defaultBox" v-if="item.certificationStatus=='1'&&!item.isDefault==1">
|
<view class="defaultBox" >
|
||||||
<text class="set-default">设为默认</text>
|
<text class="set-default">设为默认</text>
|
||||||
<switch class="no-cross-switch" :checked="item.isDefault==1" color="#1677ff"
|
<switch class="no-cross-switch" :checked="item.isDefault==1" color="#1677ff"
|
||||||
@change="onSwitchChange($event,item)" @click.stop />
|
@change="onSwitchChange($event,item)" @click.stop />
|
||||||
@@ -144,10 +144,6 @@
|
|||||||
|
|
||||||
|
|
||||||
const onSwitchChange = async (e, i) => {
|
const onSwitchChange = async (e, i) => {
|
||||||
// uni.showLoading({
|
|
||||||
// title: '设置中...',
|
|
||||||
// mask: true
|
|
||||||
// });
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const res = await setMyHouseDefault({
|
const res = await setMyHouseDefault({
|
||||||
@@ -155,17 +151,15 @@
|
|||||||
})
|
})
|
||||||
const data = res
|
const data = res
|
||||||
if (data.code === 200) {
|
if (data.code === 200) {
|
||||||
// uni.hideLoading();
|
|
||||||
pageNum.value = 1
|
pageNum.value = 1
|
||||||
noMoreData.value = false
|
noMoreData.value = false
|
||||||
getList()
|
getList()
|
||||||
uni.setStorageSync('houseIsDefault', e.detail.value)
|
uni.setStorageSync('houseIsDefault', e.detail.value)
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '设置默认房屋成功',
|
title: res.msg || '设置默认房屋成功',
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// uni.hideLoading();
|
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res.msg,
|
title: res.msg,
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
@@ -205,12 +199,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
const goBack = () => {
|
const goBack = () => {
|
||||||
uni.switchTab({
|
uni.navigateBack()
|
||||||
url: '/pages/myIndex/myIndex',
|
|
||||||
success: res => {},
|
|
||||||
fail: () => {},
|
|
||||||
complete: () => {}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -164,9 +164,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
const goBack = () => {
|
const goBack = () => {
|
||||||
uni.switchTab({
|
uni.navigateBack()
|
||||||
url: '/pages/myIndex/myIndex'
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -258,9 +258,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
const goBack = () => {
|
const goBack = () => {
|
||||||
uni.navigateTo({
|
uni.navigateBack()
|
||||||
url: '/pageSubPack/my/myParkingSpaceIndex'
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -152,22 +152,20 @@
|
|||||||
|
|
||||||
// 返回新增
|
// 返回新增
|
||||||
const goBackAdd = () => {
|
const goBackAdd = () => {
|
||||||
if (checkType.value === '楼栋') {
|
if (checkType.value === "楼栋") {
|
||||||
uni.removeStorageSync('buildingId')
|
uni.removeStorageSync("buildingId")
|
||||||
uni.removeStorageSync('buildingName')
|
uni.removeStorageSync("buildingName")
|
||||||
} else if (checkType.value === '单元') {
|
} else if (checkType.value === "单元") {
|
||||||
uni.removeStorageSync('unitId')
|
uni.removeStorageSync("unitId")
|
||||||
uni.removeStorageSync('unitName')
|
uni.removeStorageSync("unitName")
|
||||||
} else if (checkType.value === '楼层') {
|
} else if (checkType.value === "楼层") {
|
||||||
uni.removeStorageSync('floorId')
|
uni.removeStorageSync("floorId")
|
||||||
uni.removeStorageSync('floorName')
|
uni.removeStorageSync("floorName")
|
||||||
} else if (checkType.value === '户号') {
|
} else if (checkType.value === "户号") {
|
||||||
uni.removeStorageSync('houseNumberId')
|
uni.removeStorageSync("houseNumberId")
|
||||||
uni.removeStorageSync('houseNumberName')
|
uni.removeStorageSync("houseNumberName")
|
||||||
}
|
}
|
||||||
uni.navigateTo({
|
uni.navigateBack()
|
||||||
url: '/pageSubPack/my/addHouse'
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
// 获取数据
|
// 获取数据
|
||||||
const getList = async (type) => {
|
const getList = async (type) => {
|
||||||
|
|||||||
@@ -152,15 +152,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
const goBackAdd = () => {
|
const goBackAdd = () => {
|
||||||
uni.removeStorageSync('carBrandId');
|
uni.removeStorageSync("carBrandId");
|
||||||
uni.removeStorageSync('carBrandName');
|
uni.removeStorageSync("carBrandName");
|
||||||
|
uni.navigateBack()
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pageSubPack/my/addCar',
|
|
||||||
success: res => {},
|
|
||||||
fail: () => {},
|
|
||||||
complete: () => {}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onShow(() => {})
|
onShow(() => {})
|
||||||
|
|||||||
@@ -171,9 +171,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
const goBack = () => {
|
const goBack = () => {
|
||||||
uni.navigateTo({
|
uni.navigateBack()
|
||||||
url: '/pageSubPack/my/addParkingSpace'
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -146,16 +146,14 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
const goBackAdd = () => {
|
const goBackAdd = () => {
|
||||||
if (checkType.value == '停车场') {
|
if (checkType.value == "停车场") {
|
||||||
uni.removeStorageSync('parkingLotId')
|
uni.removeStorageSync("parkingLotId")
|
||||||
uni.removeStorageSync('parkingLotName')
|
uni.removeStorageSync("parkingLotName")
|
||||||
} else if (checkType.value == '车位编号') {
|
} else if (checkType.value == "车位编号") {
|
||||||
uni.removeStorageSync('parkingSpaceId')
|
uni.removeStorageSync("parkingSpaceId")
|
||||||
uni.removeStorageSync('parkingSpaceName')
|
uni.removeStorageSync("parkingSpaceName")
|
||||||
}
|
}
|
||||||
uni.navigateTo({
|
uni.navigateBack()
|
||||||
url: '/pageSubPack/my/addParkingSpace'
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -146,25 +146,9 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
const goBackAdd = () => {
|
const goBackAdd = () => {
|
||||||
uni.removeStorageSync('communityId');
|
uni.removeStorageSync("communityId");
|
||||||
uni.removeStorageSync('communityName');
|
uni.removeStorageSync("communityName");
|
||||||
if (sourcePage.value == 'addHouse') {
|
uni.navigateBack()
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pageSubPack/my/addHouse',
|
|
||||||
success: res => {},
|
|
||||||
fail: () => {},
|
|
||||||
complete: () => {}
|
|
||||||
});
|
|
||||||
} else if (sourcePage.value == 'addParkingSpace') {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pageSubPack/my/addParkingSpace',
|
|
||||||
success: res => {},
|
|
||||||
fail: () => {},
|
|
||||||
complete: () => {}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -58,12 +58,12 @@
|
|||||||
title: '注销账号',
|
title: '注销账号',
|
||||||
type: 'arrow'
|
type: 'arrow'
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
title: '升级版本',
|
// title: '升级版本',
|
||||||
type: 'text',
|
// type: 'text',
|
||||||
value: '当前版本 1.0.0',
|
// value: '当前版本 1.0.0',
|
||||||
valueClass: 'item-version'
|
// valueClass: 'item-version'
|
||||||
}
|
// }
|
||||||
])
|
])
|
||||||
|
|
||||||
// 格式化字节大小
|
// 格式化字节大小
|
||||||
@@ -105,8 +105,10 @@
|
|||||||
currentVersion.value = manifest.version
|
currentVersion.value = manifest.version
|
||||||
}
|
}
|
||||||
// #endif
|
// #endif
|
||||||
|
if (settingList.value[5]) {
|
||||||
settingList.value[5].value = '当前版本 ' + currentVersion.value
|
settingList.value[5].value = '当前版本 ' + currentVersion.value
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 版本号比较:v1 > v2 返回 1,v1 = v2 返回 0,v1 < v2 返回 -1
|
// 版本号比较:v1 > v2 返回 1,v1 = v2 返回 0,v1 < v2 返回 -1
|
||||||
const compareVersion = (v1, v2) => {
|
const compareVersion = (v1, v2) => {
|
||||||
@@ -247,7 +249,12 @@
|
|||||||
url: '/pageSubPack/my/changePwd'
|
url: '/pageSubPack/my/changePwd'
|
||||||
});
|
});
|
||||||
} else if (item.title == '清除缓存') {
|
} else if (item.title == '清除缓存') {
|
||||||
uni.clearStorageSync();
|
// 保存登录相关数据,清完恢复
|
||||||
|
const preserveKeys = ['token', 'userId', 'currentVillageId', 'hasShowGuide', 'push_cid']
|
||||||
|
const saved = {}
|
||||||
|
preserveKeys.forEach(key => { saved[key] = uni.getStorageSync(key) })
|
||||||
|
uni.clearStorageSync()
|
||||||
|
preserveKeys.forEach(key => { if (saved[key]) uni.setStorageSync(key, saved[key]) })
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
plus.cache.clear(() => {})
|
plus.cache.clear(() => {})
|
||||||
// #endif
|
// #endif
|
||||||
@@ -279,52 +286,30 @@
|
|||||||
title: '提示',
|
title: '提示',
|
||||||
content: '确定要退出当前账号吗?',
|
content: '确定要退出当前账号吗?',
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
if (res.confirm) {
|
if (!res.confirm) return
|
||||||
uni.showLoading({
|
uni.showLoading({ title: '退出中...', mask: true })
|
||||||
title: '退出中...',
|
|
||||||
mask: true
|
const clearAndGo = () => {
|
||||||
});
|
uni.removeStorageSync('token')
|
||||||
|
uni.removeStorageSync('userId')
|
||||||
|
uni.removeStorageSync('currentVillageId')
|
||||||
|
uni.hideLoading()
|
||||||
|
uni.hideToast()
|
||||||
|
uni.reLaunch({ url: '/pageSubPack/loginSub/login?mode=pwd' })
|
||||||
|
}
|
||||||
|
|
||||||
authLogout().then(res => {
|
authLogout().then(res => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
// 清除本地登录凭证
|
uni.hideLoading()
|
||||||
uni.removeStorageSync('token');
|
uni.showToast({ title: '退出成功', icon: 'success' })
|
||||||
uni.removeStorageSync('userId');
|
setTimeout(clearAndGo, 1500)
|
||||||
uni.removeStorageSync('currentVillageId');
|
|
||||||
uni.hideLoading();
|
|
||||||
uni.showToast({
|
|
||||||
title: '退出成功',
|
|
||||||
icon: 'success'
|
|
||||||
});
|
|
||||||
setTimeout(() => {
|
|
||||||
uni.hideLoading();
|
|
||||||
uni.reLaunch({
|
|
||||||
url: '/pageSubPack/loginSub/login?mode=pwd'
|
|
||||||
});
|
|
||||||
}, 1500);
|
|
||||||
} else {
|
} else {
|
||||||
// 即使服务端返回失败,也清除本地数据并跳转登录页
|
clearAndGo()
|
||||||
uni.removeStorageSync('token');
|
|
||||||
uni.removeStorageSync('userId');
|
|
||||||
uni.removeStorageSync('currentVillageId');
|
|
||||||
uni.hideLoading();
|
|
||||||
uni.reLaunch({
|
|
||||||
url: '/pageSubPack/loginSub/login?mode=pwd'
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
console.log(err);
|
console.log(err)
|
||||||
// 网络异常时也清除本地数据并跳转登录页
|
clearAndGo()
|
||||||
uni.removeStorageSync('token');
|
|
||||||
uni.removeStorageSync('userId');
|
|
||||||
uni.removeStorageSync('currentVillageId');
|
|
||||||
uni.hideLoading();
|
|
||||||
uni.reLaunch({
|
|
||||||
url: '/pageSubPack/loginSub/login?mode=pwd'
|
|
||||||
});
|
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -184,7 +184,7 @@
|
|||||||
|
|
||||||
weixin.launchMiniProgram({
|
weixin.launchMiniProgram({
|
||||||
id: 'gh_a765aef0172c',
|
id: 'gh_a765aef0172c',
|
||||||
type: 1, // 0 正式版 / 1测试版 / 2预览版
|
type: 0, // 0 正式版 / 1测试版 / 2预览版
|
||||||
path: 'pages/arrearsPayment/arrearsPayment?' + queryString,
|
path: 'pages/arrearsPayment/arrearsPayment?' + queryString,
|
||||||
}, (res) => {
|
}, (res) => {
|
||||||
console.log('回调---回调结果(App)', JSON.stringify(res))
|
console.log('回调---回调结果(App)', JSON.stringify(res))
|
||||||
|
|||||||
@@ -229,6 +229,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
const goToAdd = (type) => {
|
const goToAdd = (type) => {
|
||||||
|
uni.setStorageSync('addPaymentType', type.name)
|
||||||
if (type.name == '燃气' || type.name == '暖气') {
|
if (type.name == '燃气' || type.name == '暖气') {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pageSubPack/payment-list/selectPaymentEntity'
|
url: '/pageSubPack/payment-list/selectPaymentEntity'
|
||||||
@@ -238,7 +239,6 @@
|
|||||||
url: '/pageSubPack/payment-list/addHydropower'
|
url: '/pageSubPack/payment-list/addHydropower'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
uni.setStorageSync('addPaymentType', type.name)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取缴费列表
|
// 获取缴费列表
|
||||||
|
|||||||
@@ -290,9 +290,7 @@ const submitForm = async () => {
|
|||||||
|
|
||||||
// 返回
|
// 返回
|
||||||
const goBack = () => {
|
const goBack = () => {
|
||||||
uni.navigateTo({
|
uni.navigateBack()
|
||||||
url: '/pageSubPack/service-list/complaintsSuggestionsIndex'
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
|||||||
@@ -120,9 +120,7 @@ const previewImage = (index) => {
|
|||||||
|
|
||||||
// 返回
|
// 返回
|
||||||
const goBack = () => {
|
const goBack = () => {
|
||||||
uni.navigateTo({
|
uni.navigateBack()
|
||||||
url: '/pageSubPack/service-list/complaintsSuggestionsIndex'
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,5 @@
|
|||||||
{
|
{
|
||||||
"pages": [{
|
"pages": [{
|
||||||
"path": "pages/index/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "",
|
|
||||||
"navigationStyle": "custom"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/navigation/navigation",
|
"path": "pages/navigation/navigation",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "引导页",
|
"navigationBarTitleText": "引导页",
|
||||||
@@ -15,6 +8,13 @@
|
|||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/index/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "",
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/serviceIndex/serviceIndex",
|
"path": "pages/serviceIndex/serviceIndex",
|
||||||
"style": {
|
"style": {
|
||||||
|
|||||||
@@ -242,7 +242,11 @@
|
|||||||
currentVillageId.value = ''
|
currentVillageId.value = ''
|
||||||
}
|
}
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
|
// 有 token 才提示错误(无 token 用户正常浏览首页,API 401 属于预期行为)
|
||||||
|
const token = uni.getStorageSync('token')
|
||||||
|
if (token) {
|
||||||
uni.showToast({ title: err.msg || '网络异常', icon: 'error' })
|
uni.showToast({ title: err.msg || '网络异常', icon: 'error' })
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -80,11 +80,8 @@ const tokenSave = uni.getStorageSync('token')
|
|||||||
const needRedirect = hasShowGuide || tokenSave
|
const needRedirect = hasShowGuide || tokenSave
|
||||||
|
|
||||||
if (needRedirect) {
|
if (needRedirect) {
|
||||||
if (tokenSave) {
|
// 已登录或已看过引导页:直接进首页
|
||||||
uni.reLaunch({ url: '/pages/index/index' })
|
uni.reLaunch({ url: '/pages/index/index' })
|
||||||
} else if (hasShowGuide) {
|
|
||||||
uni.reLaunch({ url: '/pageSubPack/loginSub/login?mode=pwd' })
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ========== 响应式数据 ==========
|
// ========== 响应式数据 ==========
|
||||||
@@ -122,17 +119,10 @@ const handleBtnClick = () => {
|
|||||||
isNavigating.value = true;
|
isNavigating.value = true;
|
||||||
// 记录引导已完成
|
// 记录引导已完成
|
||||||
uni.setStorageSync('hasShowGuide', true);
|
uni.setStorageSync('hasShowGuide', true);
|
||||||
// 检查是否已有登录 token,有则直接进首页,否则跳转登录页
|
// 直接进入首页(未登录用户可正常浏览首页,需登录的功能由点击拦截处理)
|
||||||
const token = uni.getStorageSync('token');
|
|
||||||
if (token) {
|
|
||||||
uni.switchTab({
|
uni.switchTab({
|
||||||
url: '/pages/index/index'
|
url: '/pages/index/index'
|
||||||
})
|
})
|
||||||
} else {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: "/pageSubPack/loginSub/login?mode=pwd"
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user