修改跳转问题

This commit is contained in:
zhouyanli
2026-04-20 17:10:47 +08:00
parent 8af229f25b
commit c8940e5b02
9 changed files with 85 additions and 88 deletions

View File

@@ -330,12 +330,15 @@
// 返回
const narBack = () =>{
// uni.navigateBack({
// delta: 1
// })
if(uni.getStorageSync('sourcePage') === "index"){
uni.switchTab({
url:"/pages/index/index"
})
}else if(uni.getStorageSync('sourcePage') === "serviceIndex"){
uni.switchTab({
url:"/pages/serviceIndex/serviceIndex"
})
}
}
// 切换选项卡
const switchTab = (tab) => {

View File

@@ -56,7 +56,7 @@
</view>
</up-col>
<up-col span="3">
<view class="demo-layout bg-purple-light openClass">
<view class="demo-layout bg-purple-light openClass" @click="payMentClick">
<view class="iconClass">
<image src="/static/首页/生活缴费.png" mode="" style="width: 70px;height: 70px;border-radius: 8px;"></image>
</view>
@@ -189,12 +189,13 @@ const activityList = ref([
const currentCommunity = ref('碧桂园小区')
const bannerList = ref([
'/static/首页/banner.png',
'/static/bannar2.png'
])
const noticeText = ref('公告公告本小区今天安装了摄像头')
// =======方法=======
const getNoticeMore = () =>{
uni.setStorageSync('sourcePage',"index")
uni.navigateTo({
url:"/pages/notice-list/noticeList"
})
@@ -218,10 +219,18 @@ onUnload(() => {
// 方法逻辑
const openDoorClick = () =>{
uni.setStorageSync('sourcePage',"index")
uni.navigateTo({
url:"/pages/notice-list/oneClickOpen"
})
}
// 生活缴费
const payMentClick =() =>{
uni.setStorageSync('sourcePage',"index")
uni.navigateTo({
url:"/pages/payment-list/paymentIndex"
})
}
const navigateToPage = () => {
uni.navigateTo({
@@ -229,18 +238,21 @@ const navigateToPage = () => {
})
}
const onlineRepairClick = () =>{
uni.setStorageSync('sourcePage',"index")
uni.navigateTo({
url:'/pages/online-repair/onlineRepair'
})
}
// 访客邀请
const visitorClick = () =>{
uni.setStorageSync('sourcePage',"index")
uni.navigateTo({
url:"/pages/visitor/visitor-list"
})
}
// 活动列表的查看更多
const moreClick = () =>{
uni.setStorageSync('sourcePage',"index")
uni.navigateTo({
url:"/pages/activity-list/activityList"
})
@@ -332,7 +344,7 @@ const moreClick = () =>{
}
.noticeClass{
position: relative;
top: 167rpx;
top: 160rpx;
left: 0;
padding: 40rpx 36rpx;
}
@@ -349,7 +361,7 @@ const moreClick = () =>{
}
.bg-card-open{
position: relative;
top: 102rpx;
top: 98rpx;
left: 0;
padding: 20rpx;
background-color: #fff;
@@ -382,7 +394,7 @@ const moreClick = () =>{
// margin-top: 30rpx;
border-radius: 28rpx;
position: relative;
top:50px;
top:45px;
left: 0;
.titleLeft{
text-align: left;
@@ -400,7 +412,7 @@ const moreClick = () =>{
}
.activity-card{
position: relative;
top: 45px;
top: 40px;
left: 0;
bottom: 20;
}

View File

@@ -94,12 +94,13 @@ const checkForm = () => {};
onLoad(() =>{
});
// const handleLogin = async () => {
// if (!canLogin.value) return;
// // 防止多次点击触发登录
// // canLogin.value = false;
// // // 2. 空值校验
// 登录逻辑
const handleLogin = () => {
if (!canLogin.value) return
let params = {
username:phoneNumber.value,
password:password.value
}
// if (!phoneNumber.value) {
// uni.showToast({ title: '请输入手机号', icon: 'none' });
// // canLogin.value = true;
@@ -110,51 +111,6 @@ onLoad(() =>{
// // canLogin.value = true;
// return;
// }
// const params = {
// username: phoneNumber.value,
// password: password.value
// };
// try {
// // 3. 调用登录接口
// const res = await getLoginPassword(params);
// // 登录成功逻辑
// // 如果后端返回token这里保存
// // uni.setStorageSync('token', res.token || '');
// uni.showToast({ title: '登录成功', icon: 'success' });
// // 登录成功后再跳转
// setTimeout(() => {
// uni.switchTab({ url: '/pages/index/index' });
// }, 1500);
// } catch (err) {
// // 登录失败逻辑(所有错误:账号不存在/密码错/网络异常都走这里)
// uni.showToast({ title: `${err || '登录失败'}`, icon: 'none' });
// } finally {
// // 无论成功/失败,解锁按钮
// canLogin.value = true;
// }
// };
// 登录逻辑
const handleLogin = () => {
if (!canLogin.value) return
let params = {
username:phoneNumber.value,
password:password.value
}
if (!phoneNumber.value) {
uni.showToast({ title: '请输入手机号', icon: 'none' });
// canLogin.value = true;
return;
}
if (!password.value) {
uni.showToast({ title: '请输入密码', icon: 'none' });
// canLogin.value = true;
return;
}
// getLoginPassword(params).then(res =>{
// // console.log('33333',res)
// if(res.code === 200){
@@ -168,6 +124,9 @@ const handleLogin = () => {
// }
// })
uni.showLoading({
title: '登录中...'
});
setTimeout(() => {
uni.switchTab({ url: '/pages/index/index' });
}, 1500);

View File

@@ -122,12 +122,16 @@
}
// 返回
const narBack = () =>{
// uni.navigateBack({
// delta: 1
// })
if(uni.getStorageSync('sourcePage') === "index"){
uni.switchTab({
url:"/pages/index/index"
})
}else if(uni.getStorageSync('sourcePage') === "serviceIndex"){
uni.switchTab({
url:"/pages/serviceIndex/serviceIndex"
})
}
uni.removeStorageSync('sourcePage')
}
</script>

View File

@@ -68,12 +68,17 @@ const selectDoor = (index) => {
}
// 返回
const narBack = () =>{
// uni.navigateBack({
// delta: 1
// })
if(uni.getStorageSync('sourcePage') === "index"){
uni.switchTab({
url:"/pages/index/index"
})
}else if(uni.getStorageSync('sourcePage') === "serviceIndex"){
uni.switchTab({
url:"/pages/serviceIndex/serviceIndex"
})
}
uni.removeStorageSync('sourcePage')
}
// 确认开门方法
const openDoor = () => {

View File

@@ -164,7 +164,7 @@ const getCommunityList = () =>{
}
onLoad(() =>{
getCommunityList()
// getCommunityList()
})

View File

@@ -153,10 +153,17 @@ function personalClick(){
}
// 返回上一页
const goBack = () => {
// uni.navigateBack()
if(uni.getStorageSync('sourcePage') === "index"){
uni.switchTab({
url:"/pages/index/index"
})
}else if(uni.getStorageSync('sourcePage') === "serviceIndex"){
uni.switchTab({
url:"/pages/serviceIndex/serviceIndex"
})
}
uni.removeStorageSync('sourcePage')
}
// 跳转报修详情
const goDetail = (item) => {

View File

@@ -469,7 +469,7 @@ const submitForm = () => {
}
.time-value {
color: #007aff;
color: #000;
}
.input, .textarea {
flex: 1;

View File

@@ -123,10 +123,17 @@ const filterdList = computed(() => {
})
// 返回上一页
const goBack = () => {
// uni.navigateBack()
if(uni.getStorageSync('sourcePage') === "index"){
uni.switchTab({
url:"/pages/index/index"
})
}else if(uni.getStorageSync('sourcePage') === "serviceIndex"){
uni.switchTab({
url:"/pages/serviceIndex/serviceIndex"
})
}
uni.removeStorageSync('sourcePage')
}
// 查看详情