修改跳转问题
This commit is contained in:
@@ -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) => {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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 = () => {
|
||||
|
||||
@@ -164,7 +164,7 @@ const getCommunityList = () =>{
|
||||
}
|
||||
|
||||
onLoad(() =>{
|
||||
getCommunityList()
|
||||
// getCommunityList()
|
||||
})
|
||||
|
||||
|
||||
|
||||
@@ -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) => {
|
||||
|
||||
@@ -469,7 +469,7 @@ const submitForm = () => {
|
||||
}
|
||||
|
||||
.time-value {
|
||||
color: #007aff;
|
||||
color: #000;
|
||||
}
|
||||
.input, .textarea {
|
||||
flex: 1;
|
||||
|
||||
@@ -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')
|
||||
|
||||
}
|
||||
|
||||
// 查看详情
|
||||
|
||||
Reference in New Issue
Block a user