优化登录,修改bug

This commit is contained in:
zhouyanli
2026-07-29 17:47:10 +08:00
parent 9be76c6386
commit a6243cf466
24 changed files with 533 additions and 1012 deletions

View File

@@ -1,8 +1,5 @@
<template>
<view class="contentStyle" style="">
<view class="status-bar"></view>
<uni-nav-bar title="生活缴费" left-icon="left" @clickLeft="goBack" backgroundColor="transparent" :border="false">
</uni-nav-bar>
<view class="contentStyle">
<view class="topbox">
<image class="titleImg" src="https://wuyeadmin.bugtc.com/images/propertyImgs/payTitle.png"></image>
<image class="payImg" src="https://wuyeadmin.bugtc.com/images/propertyImgs/payImg.png"></image>
@@ -91,29 +88,14 @@
</template>
<script setup>
import {
ref,
onMounted,
computed
} from 'vue'
import {
onShow,
onReady,
onReachBottom,
onLoad,
onUnload,
onPullDownRefresh
} from '@dcloudio/uni-app'
import { ref } from 'vue'
import { onShow, onLoad } from '@dcloudio/uni-app'
import {
getTopUpSelectByResident,
postInsertOpenId,
postSubscribeAuth,
getTopUpDetails,
} from '/pageSubPack/api/apiSub.js'
// 响应式数据
const statusBarHeight = ref(20)
const detailslist = ref([])
const pageNum = ref(1)
const pageSize = ref(3)
@@ -179,29 +161,6 @@
const postOpenId = async () => {
// App 端直接从本地存储获取 openid
try {
const openid = uni.getStorageSync('openid')
if (!openid) {
uni.showToast({
title: '请先登录',
icon: 'none'
})
return
}
await postInsertOpenId({
openid: openid,
residentUserId: uni.getStorageSync('userId')
})
} catch (err) {
uni.showToast({
title: err.msg || '网络异常',
icon: 'none'
})
// console.error('列表接口报错:', err)
}
}
onShow(() => {
// Zy --------------
@@ -211,13 +170,8 @@
// 不再自动请求订阅消息,改为用户点击触发
})
// 生命周期
onReady(() => {})
onLoad(() => {
// postOpenId()
uni.hideTabBar({
animation: false // 关闭动画,更稳定
});
uni.hideTabBar({ animation: false });
getPayList()
})
@@ -278,21 +232,6 @@
uni.setStorageSync('addPaymentType', type.name)
}
const goBack = () => {
console.log('返回',uni.getStorageSync('sourcePage'))
if (uni.getStorageSync('sourcePage') == 'serviceIndex') {
uni.switchTab({
url: '/pages/serviceIndex/serviceIndex'
})
} else if (uni.getStorageSync('sourcePage') == 'index') {
uni.switchTab({
url: '/pages/index/index'
})
}
uni.removeStorageSync('sourcePage')
}
// 获取缴费列表
const getBillDetails = (isLoadMore = false) => {
if (isLoadMore) {
@@ -348,8 +287,9 @@
.contentStyle {
display: flex;
flex-direction: column;
height: 100vh;
min-height: 100vh;
background: linear-gradient(180deg, #dfedfd, #F6FAFF);
overflow-x: hidden;
}
.page {
@@ -557,11 +497,6 @@
font-weight: 600;
}
.status-bar {
width: 100vw;
height: 46px;
}
.details-scroll {
max-height: 500rpx;
margin-bottom: 40rpx;