修正多处问题
This commit is contained in:
@@ -80,6 +80,7 @@ export function navigateToPage(url) {
|
||||
// 这种情况应该使用 switchToTabPage(会清空页面栈)
|
||||
if (TAB_PAGES.has(path)) {
|
||||
console.warn('[navigateToPage] 不应该用 navigateTo 跳转 TabBar 页面,请使用 switchToTabPage')
|
||||
uni.hideLoading()
|
||||
switchToTabPage(path)
|
||||
return
|
||||
}
|
||||
@@ -90,6 +91,7 @@ export function navigateToPage(url) {
|
||||
url,
|
||||
fail: (err) => {
|
||||
console.error('[navigateTo]', url, err)
|
||||
uni.hideLoading()
|
||||
// 页面栈满时降级使用 redirectTo
|
||||
if (err.errMsg && err.errMsg.includes('limit')) {
|
||||
uni.redirectTo({ url })
|
||||
@@ -97,11 +99,11 @@ export function navigateToPage(url) {
|
||||
uni.showToast({ title: '页面跳转失败', icon: 'none' })
|
||||
}
|
||||
},
|
||||
success: () => {
|
||||
setTimeout(() => {
|
||||
uni.hideLoading()
|
||||
},3000)
|
||||
}
|
||||
complete: () => {
|
||||
// 页面已发起跳转,隐藏 loading
|
||||
// 目标页面的 onLoad/onReady 也会调用 hideLoading 做兜底
|
||||
uni.hideLoading()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -122,19 +124,21 @@ export function switchToTabPage(url) {
|
||||
console.log('[switchToTabPage] 跳转到 TabBar:', path)
|
||||
|
||||
tabNavigating = true
|
||||
uni.switchTab({ // ✅ 改用 switchTab,而不是 reLaunch
|
||||
uni.switchTab({
|
||||
url: path,
|
||||
complete: () => {
|
||||
uni.hideLoading()
|
||||
setTimeout(() => {
|
||||
tabNavigating = false
|
||||
}, 320)
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error('[switchTab]', path, err)
|
||||
// 降级使用 reLaunch
|
||||
uni.hideLoading()
|
||||
uni.reLaunch({
|
||||
url: path,
|
||||
complete: () => {
|
||||
uni.hideLoading()
|
||||
setTimeout(() => {
|
||||
tabNavigating = false
|
||||
}, 320)
|
||||
|
||||
@@ -54,7 +54,9 @@ function applyCardInfo(store) {
|
||||
export function syncStats(store) {
|
||||
store.stats = {
|
||||
...store.stats,
|
||||
pointsBalance: store.stats.pointsBalance ?? 1250
|
||||
checkInCount: store.stats.checkInCount ?? 0,
|
||||
courseCount: store.stats.courseCount ?? 0,
|
||||
pointsBalance: store.stats.pointsBalance ?? 0
|
||||
}
|
||||
return store
|
||||
}
|
||||
@@ -230,7 +232,7 @@ export function getCenterPageData(store) {
|
||||
return {
|
||||
stats: {
|
||||
checkInCount: store.stats?.checkInCount ?? 0,
|
||||
trainingHours: store.stats?.trainingHours ?? 0,
|
||||
courseCount: store.stats?.courseCount ?? 0,
|
||||
pointsBalance: store.stats?.pointsBalance ?? 0
|
||||
},
|
||||
cardInfo: { ...store.cardInfo },
|
||||
|
||||
@@ -362,27 +362,29 @@
|
||||
}
|
||||
|
||||
.member-card-section__count {
|
||||
display: flex;
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
padding: 4px 12px;
|
||||
border-radius: 12px;
|
||||
background-color: rgba(255, 255, 255, 0.2);
|
||||
gap: 4rpx;
|
||||
padding: 4rpx 14rpx;
|
||||
border-radius: 20rpx;
|
||||
background: rgba(255, 255, 255, 0.25);
|
||||
backdrop-filter: blur(4px);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.member-card-section__count-num {
|
||||
font-size: var(--font-size-md);
|
||||
font-family: var(--font-family);
|
||||
font-size: 26rpx;
|
||||
font-weight: 700;
|
||||
color: var(--text-inverse);
|
||||
color: #333;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.member-card-section__count-text {
|
||||
font-size: var(--font-size-xs);
|
||||
font-family: var(--font-family);
|
||||
font-size: 22rpx;
|
||||
font-weight: 400;
|
||||
color: rgba(255, 212, 184, 1);
|
||||
color: #333;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.member-card-preview__tag--expiring {
|
||||
|
||||
Reference in New Issue
Block a user