小程序初始化

This commit is contained in:
2026-02-27 11:32:50 +08:00
parent 93574dbb45
commit 97e1ea2706
252 changed files with 32427 additions and 12363 deletions
+207
View File
@@ -0,0 +1,207 @@
<script setup>
import { ref } from 'vue'
import { onLaunch, onShow, onHide } from '@dcloudio/uni-app'
import { useAppStore } from './stores/app.js'
const statusBarHeight = ref(0)
const safeAreaTop = ref(0)
const safeAreaBottom = ref(0)
onLaunch(async () => {
console.log('App Launch')
const store = useAppStore()
await store.initialize()
const systemInfo = uni.getSystemInfoSync()
statusBarHeight.value = systemInfo.statusBarHeight || 20
safeAreaTop.value = systemInfo.safeAreaInsets?.top || systemInfo.statusBarHeight || 20
safeAreaBottom.value = systemInfo.safeAreaInsets?.bottom || 0
uni.setStorageSync('statusBarHeight', statusBarHeight.value)
uni.setStorageSync('safeAreaTop', safeAreaTop.value)
uni.setStorageSync('safeAreaBottom', safeAreaBottom.value)
})
onShow(() => {
console.log('App Show')
})
onHide(() => {
console.log('App Hide')
})
</script>
<style>
page {
background-color: #0F071A;
color: #F3E8FF;
font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
padding-top: 0;
padding-bottom: 0;
}
.status-bar-space {
width: 100%;
background: transparent;
flex-shrink: 0;
}
.safe-area-bottom {
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
}
.safe-area-top {
padding-top: constant(safe-area-inset-top);
padding-top: env(safe-area-inset-top);
}
.glass-card {
background: rgba(168, 85, 247, 0.05);
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
border: 1px solid rgba(168, 85, 247, 0.15);
border-radius: 24rpx;
}
.glass-card-gold {
background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(232, 121, 249, 0.1));
border: 1px solid rgba(168, 85, 247, 0.3);
border-radius: 32rpx;
}
.glass-input {
background: rgba(255, 255, 255, 0.05);
border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: 24rpx;
padding: 24rpx 32rpx;
color: #F3E8FF;
font-size: 28rpx;
}
.glass-input::placeholder {
color: rgba(255, 255, 255, 0.3);
}
.btn-primary {
background: linear-gradient(135deg, #9333EA 0%, #7C3AED 100%);
border-radius: 32rpx;
padding: 28rpx 48rpx;
color: white;
font-weight: 600;
font-size: 30rpx;
border: none;
box-shadow: 0 8rpx 32rpx rgba(168, 85, 247, 0.3);
}
.btn-primary:active {
transform: scale(0.98);
opacity: 0.9;
}
.btn-secondary {
background: rgba(255, 255, 255, 0.08);
border: 1px solid rgba(255, 255, 255, 0.15);
border-radius: 24rpx;
padding: 24rpx 40rpx;
color: rgba(255, 255, 255, 0.8);
font-size: 28rpx;
}
.bottom-nav {
background: rgba(15, 7, 26, 0.85);
backdrop-filter: blur(40rpx);
-webkit-backdrop-filter: blur(40rpx);
border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.nav-item {
color: rgba(255, 255, 255, 0.4);
transition: all 0.3s ease;
}
.nav-item.active {
color: #C084FC;
transform: translateY(-8rpx);
}
.step-indicator {
display: flex;
gap: 12rpx;
}
.step-dot {
width: 24rpx;
height: 8rpx;
background: rgba(255, 255, 255, 0.1);
border-radius: 4rpx;
transition: all 0.4s ease;
}
.step-dot.active {
width: 40rpx;
background: #A855F7;
box-shadow: 0 0 24rpx rgba(168, 85, 247, 0.6);
}
.hint-chip {
background: rgba(255, 255, 255, 0.05);
border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: 32rpx;
padding: 12rpx 24rpx;
font-size: 22rpx;
color: rgba(243, 232, 255, 0.8);
}
.hint-chip:active {
background: rgba(168, 85, 247, 0.2);
border-color: rgba(168, 85, 247, 0.4);
}
::-webkit-scrollbar {
width: 4rpx;
}
::-webkit-scrollbar-thumb {
background: rgba(168, 85, 247, 0.3);
border-radius: 10rpx;
}
@keyframes fadeIn {
from { opacity: 0; transform: translateY(20rpx); }
to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in {
animation: fadeIn 0.5s ease-out;
}
@keyframes pulse {
0%, 100% { opacity: 0.3; }
50% { opacity: 0.7; }
}
.animate-pulse-slow {
animation: pulse 6s ease-in-out infinite;
}
.text-primary { color: #A855F7; }
.text-primary-light { color: #C084FC; }
.text-accent { color: #E879F9; }
.text-muted { color: rgba(255, 255, 255, 0.4); }
.font-serif { font-family: 'Cinzel', serif; }
.bg-dark { background-color: #0F071A; }
.bg-gradient-purple {
background: linear-gradient(180deg, #1A0B2E 0%, #0F071A 50%, #050208 100%);
}
.safe-area-bottom {
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
}
.safe-area-top {
padding-top: constant(safe-area-inset-top);
padding-top: env(safe-area-inset-top);
}
</style>