解决登录显示、首页显示bug

This commit is contained in:
2026-05-19 11:06:46 +08:00
parent 2f7e097e6c
commit 00a859c551
181 changed files with 55329 additions and 998 deletions

View File

@@ -1,11 +1,6 @@
<!-- 商家端 - 机构中心 -->
<template>
<view class="merchant-profile">
<!-- #ifdef MP-WEIXIN -->
<view class="mp-tab-navbar">
<text class="mp-tab-title">机构中心</text>
</view>
<!-- #endif -->
<scroll-view direction="vertical" class="profile-scroll">
<!-- 店铺信息头部:与 index 同源数据 -->
<view class="profile-header">
@@ -181,6 +176,7 @@
<script lang="uts">
import supa from '@/components/supadb/aksupainstance.uts'
import MerchantTabBar from '@/components/merchant-tabbar/MerchantTabBar.uvue'
import { requireMerchantAuth } from '@/utils/merchantAuth.uts'
import { USE_MOCK, MOCK_MERCHANT_ID, MOCK_SHOP_INFO, MOCK_TODAY_STATS, MOCK_PENDING_COUNTS, getMockRecentOrders } from '@/pages/mall/merchant/mock/merchant-mock-data.uts'
// ---- 复用 index 的类型定义 ----
@@ -303,15 +299,27 @@
}
}
} catch(e) {}
// 后台完整刷新
if (this.merchantId) {
this.loadAllData()
} else {
setTimeout(() => { this.loadAllData() }, 500)
}
this.handlePageShow()
},
methods: {
async ensureMerchantAuth(): Promise<boolean> {
if (USE_MOCK) return true
const result = await requireMerchantAuth({ redirectOnFail: true, toastOnFail: true })
if (!result.ok) {
this.merchantId = ''
return false
}
this.merchantId = result.userInfo != null && result.userInfo.id != null ? result.userInfo.id : ''
return this.merchantId !== ''
},
async handlePageShow() {
const passed = await this.ensureMerchantAuth()
if (!passed) return
this.loadAllData()
},
// 底部安全区动态高度,与 orders.uvue 方式一致
initSafeArea() {
// #ifdef MP-WEIXIN
@@ -711,7 +719,7 @@
display: flex;
flex-direction: row;
align-items: center;
padding: 40rpx 30rpx;
padding: calc(40rpx + var(--status-bar-height)) 30rpx 40rpx;
background: linear-gradient(135deg, #A6F1E4 0%, #69DFC2 100%);
}