去掉登录页

This commit is contained in:
zhouyanli
2026-08-04 08:40:57 +08:00
parent cc43bcd0e7
commit 4d038dbaf9
3 changed files with 56 additions and 148 deletions

View File

@@ -9,15 +9,8 @@
</view>
<scroll-view class="page" scroll-y="true">
<view class="container">
<!-- 未登录提示条 -->
<view class="login-tip" v-if="!isLogin" @click="handleLoginPrompt">
<image class="login-tip-icon" src="https://wuyeadmin.bugtc.com/images/login/phone.png"></image>
<text class="login-tip-text">登录后可查看缴费账单</text>
<text class="login-tip-link">去登录</text>
</view>
<!-- 账单列表(仅登录后显示) -->
<view class="bill-list" v-if="isLogin && paymentList.length > 0">
<!-- 账单列表 -->
<view class="bill-list" v-if="paymentList.length > 0">
<view class="bill-item" @click="goToBill(item)" v-for="item,index in paymentList" :key="index">
<image class="billIcon" src="https://wuyeadmin.bugtc.com/images/propertyImgs/water.png"
@@ -62,7 +55,7 @@
import { ref } from 'vue'
import { onShow, onLoad } from '@dcloudio/uni-app'
import { getTopUpSelectByResident, getopenIdByCode, postInsertOpenId } from '/pageSubPack/api/apiSub.js'
import { isLoggedIn, requireAuth } from '/pageSubPack/api/auth.js'
import { isLoggedIn } from '/pageSubPack/api/auth.js'
import { getAppPaymentData, clearAppPaymentData, buildPaymentItemFromApp } from '/pageSubPack/api/appLaunch.js'
const isLogin = ref(false)
@@ -86,7 +79,7 @@
}
};
// ===== openid 相关(仅登录后) =====
// ===== openid 相关 =====
const postOpenId = async () => {
if (!isLogin.value) return;
try {
@@ -126,19 +119,13 @@
// ===== 生命周期 =====
onLoad(() => {
refreshLoginState();
if (isLogin.value) {
postOpenId();
// 检查是否由 App 跳转而来,携带了支付参数
checkAppLaunchPayment();
// getPayList();
}
postOpenId();
// 检查是否由 App 跳转而来,携带了支付参数
checkAppLaunchPayment();
});
onShow(() => {
refreshLoginState();
if (isLogin.value) {
// getPayList();
}
});
// ===== App 跳转支付:检测 extraData 并直接进入支付页 =====
@@ -158,63 +145,21 @@
uni.redirectTo({ url: "/pages/arrearsPayment/arrearsPayment" })
}
// ===== 点击事件(统一用 isLogin 判断) =====
// 点击"去登录"提示条
const handleLoginPrompt = () => {
if (isLogin.value) return;
requireAuth({
title: '查看缴费账单',
onLoggedIn: () => {
refreshLoginState();
// getPayList();
}
});
};
// ===== 点击事件 =====
// 点击账单明细
const goToBill = (item) => {
if (!isLogin.value) {
requireAuth({
title: '查看缴费详情',
onLoggedIn: () => {
refreshLoginState();
goToBill(item);
}
});
return;
}
uni.setStorageSync('arrearsPayment', item)
uni.redirectTo({ url: '/pages/arrearsPayment/arrearsPayment' })
};
// 点击缴费记录
const goToRecord = () => {
if (!isLogin.value) {
requireAuth({
title: '查看缴费记录',
onLoggedIn: () => {
refreshLoginState();
goToRecord();
}
});
return;
}
uni.redirectTo({ url: '/pageSubPack/payment-list/paymentRecord' })
};
// 点击新增缴费(水表/电表等)
const goToAdd = (type) => {
if (!isLogin.value) {
requireAuth({
title: '新增缴费',
onLoggedIn: () => {
refreshLoginState();
goToAdd(type);
}
});
return;
}
if (type.name == '燃气' || type.name == '暖气') {
uni.redirectTo({ url: '/pageSubPack/payment-list/selectPaymentEntity' })
} else if (type.name == '水表' || type.name == '电表') {
@@ -272,32 +217,6 @@
bottom: -140rpx;
}
/* ===== 未登录提示条 ===== */
.login-tip {
display: flex;
align-items: center;
background-color: #fff;
padding: 24rpx 30rpx;
border-radius: 10rpx;
margin-bottom: 30rpx;
box-shadow: 0 2rpx 10rpx rgba(0,0,0,0.05);
}
.login-tip-icon {
width: 40rpx;
height: 40rpx;
margin-right: 16rpx;
}
.login-tip-text {
flex: 1;
font-size: 28rpx;
color: #666;
}
.login-tip-link {
font-size: 28rpx;
color: #1677ff;
font-weight: 500;
}
.bill-list {
margin-bottom: 40rpx;
background-color: #fff;