feat: 完善对象存储上传与真实条码二维码引擎,彻底剥离保底Mock数据

这个提交包含在:
xcbyy
2026-10-09 17:18:14 +08:00
父节点 6d3076cdb8
当前提交 d0f4050cdc
共有 329 个文件被更改,包括 54416 次插入 和 926 次删除

查看文件

@@ -1,10 +1,69 @@
<script>
import { getCurrentThemeKey, applyThemeToNativeUI } from './common/theme.js';
import { installRoleGuard } from './common/role.js';
export default {
onLaunch: function () {
// #ifdef H5
if (typeof window !== 'undefined' && window.addEventListener) {
window.addEventListener('unhandledrejection', (event) => {
const reason = event && event.reason;
const errMsg = reason && (reason.errMsg || reason.message || '');
if (
typeof errMsg === 'string' && (
errMsg.includes('setNavigationBarColor') ||
errMsg.includes('setTabBarStyle') ||
errMsg.includes('hideTabBar') ||
errMsg.includes('not tabBar page') ||
errMsg.includes('page not found')
)
) {
event.preventDefault();
}
});
}
// #endif
// #ifdef MP-WEIXIN
if (typeof wx !== 'undefined' && wx.onUnhandledRejection) {
wx.onUnhandledRejection((event) => {
const reason = event && event.reason;
const errMsg = (reason && (reason.errMsg || reason.message)) || (typeof reason === 'string' ? reason : '');
if (
typeof errMsg === 'string' && (
errMsg.includes('hideTabBar') ||
errMsg.includes('not TabBar page') ||
errMsg.includes('setNavigationBarColor') ||
errMsg.includes('setTabBarStyle')
)
) {
// 自定义 TabBar 场景下,对非原生 TabBar 页面尝试隐藏 TabBar 的报错静默兜底
return;
}
});
}
// #endif
const currentTheme = getCurrentThemeKey();
applyThemeToNativeUI(currentTheme);
// 注册全流程角色权限守卫拦截器 (Role Guard)
installRoleGuard();
// 注册全局路由切换拦截器,在跳转目标页面前预先同步 Native 导航栏与窗口背景,消除切页黑屏闪烁
const routeMethods = ['navigateTo', 'redirectTo', 'reLaunch', 'switchTab'];
routeMethods.forEach((method) => {
try {
if (typeof uni !== 'undefined' && typeof uni.addInterceptor === 'function') {
uni.addInterceptor(method, {
invoke() {
applyThemeToNativeUI(getCurrentThemeKey());
}
});
}
} catch (e) {}
});
console.log('App Launch: 电竞陪玩小程序初始化, 当前主题:', currentTheme);
},
onShow: function () {
@@ -44,15 +103,18 @@ export default {
/* 顶部与多端安全区变量 (小程序状态栏 / 原生胶囊避让 / H5 沉浸式自然留白) */
--safe-header-gap: calc(var(--status-bar-height, 0px) + 36rpx);
--capsule-right-space: 0rpx;
--capsule-height: 72rpx;
/* #ifdef MP-WEIXIN */
--safe-header-gap: calc(var(--status-bar-height, 44px) + 20rpx);
/* 微信小程序端静态 CSS 兜底:状态栏加上胶囊行对齐留白 (避开灵动岛与状态栏遮挡) */
--safe-header-gap: calc(var(--status-bar-height, 25px) + 58rpx);
--capsule-right-space: 210rpx;
--capsule-height: 64rpx;
/* #endif */
}
/* 浅色暖阳晨曦主题 (Light Warm Sunset Morning) */
page.theme-warm, .theme-warm {
page:has(.theme-warm), page.theme-warm, .theme-warm {
--bg-primary: #FDFBF7;
--bg-surface: #FFFFFF;
--bg-surface-elevated: #F8F5F0;
@@ -78,6 +140,10 @@ page.theme-warm, .theme-warm {
color: #1C1917;
}
page:has(.theme-warm) {
background-color: #FDFBF7 !important;
}
/* 全局暗黑电竞基础重置 (严格符合 UI/UX Pro Max 规范) */
page {
background-color: var(--bg-primary, #0A0F1D);