Sfoglia il codice sorgente

feat(splash): 将过渡页从首页移入独立页面 pages/splash

iwt 2 mesi fa
parent
commit
d7a55c7dae

+ 7 - 3
cfc-frontend/App.vue

@@ -7,9 +7,13 @@ Vue.prototype.$config = config
 export default {
   onLaunch: function(options) {
     console.log('App Launch', options)
-    // 冷启动标记,首页根据此标记决定显示 splash overlay
-    uni.setStorageSync('_showSplashOverlay', '1')
-    // 处理小程序码场景值(从 wxacode 扫码进入)
+    // 冷启动:跳转到 splash 页展示过渡动画,2秒后自动进入首页
+    if (options.scene !== 1047 && options.scene !== 1048 && options.scene !== 1049) {
+      uni.setStorageSync('_isFirstLaunch', '1')
+      uni.redirectTo({ url: '/pages/splash/index' })
+      return
+    }
+    // 处理小程序码场景值(从 wxacode 扫码进入,跳过 splash)
     this.handleScene(options)
     
     // TabBar 始终显示 5 个底签,不因登录状态隐藏

+ 0 - 165
cfc-frontend/pages/index-home/index.vue

@@ -890,9 +890,7 @@ export default {
           var rawData = res.data && (Array.isArray(res.data) ? res.data : (res.data.data || res.data.records || []))
           self.dimensionActivities = Array.isArray(rawData) ? rawData.slice(0, 3) : []
         }
-        self._checkSplashReady()
       }).catch(function() {
-        self._checkSplashReady()
       })
     },
     loadFeaturedArticles: function() {
@@ -924,10 +922,8 @@ export default {
             }
           })
         }
-        self._checkSplashReady()
       }).catch(function() {
         self.articlesLoading = false
-        self._checkSplashReady()
       })
     },
     goActivities: function() {
@@ -1464,167 +1460,6 @@ export default {
   color: #bbb;
 }
 
-/* ===== Splash Loading Overlay(冷启动蒙板,来自 merge splash.vue) ===== */
-.splash-overlay {
-  position: fixed;
-  top: 0; left: 0; right: 0; bottom: 0;
-  z-index: 9999;
-  display: flex;
-  align-items: center;
-  justify-content: center;
-  background: linear-gradient(160deg, #FFF7ED 0%, #FFEDD5 50%, #FED7AA 100%);
-  overflow: hidden;
-  opacity: 1;
-  transition: opacity 0.4s ease;
-}
-.splash-overlay.fade-out {
-  opacity: 0;
-  pointer-events: none;
-}
-
-/* ---- bg circles from splash.vue ---- */
-.splash-overlay-bg { position: absolute; top: 0; left: 0; right: 0; bottom: 0; pointer-events: none; }
-.bg-circle {
-  position: absolute;
-  border-radius: 50%;
-  opacity: 0.12;
-}
-.bg-circle-1 {
-  width: 400rpx; height: 400rpx;
-  background: #FF8C42;
-  top: -100rpx; right: -80rpx;
-  animation: splash-float-1 4s ease-in-out infinite;
-}
-.bg-circle-2 {
-  width: 280rpx; height: 280rpx;
-  background: #FF6B9D;
-  bottom: 80rpx; left: -60rpx;
-  animation: splash-float-2 5s ease-in-out infinite;
-}
-.bg-circle-3 {
-  width: 180rpx; height: 180rpx;
-  background: #6366F1;
-  top: 50%; right: -40rpx;
-  animation: splash-float-3 6s ease-in-out infinite;
-}
-@keyframes splash-float-1 {
-  0%, 100% { transform: translateY(0) scale(1); }
-  50% { transform: translateY(-30rpx) scale(1.05); }
-}
-@keyframes splash-float-2 {
-  0%, 100% { transform: translateY(0) scale(1); }
-  50% { transform: translateY(20rpx) scale(1.08); }
-}
-@keyframes splash-float-3 {
-  0%, 100% { transform: translateY(0) rotate(0deg); }
-  50% { transform: translateY(-20rpx) rotate(10deg); }
-}
-
-/* ---- body fade-in ---- */
-.splash-overlay-body {
-  display: flex;
-  flex-direction: column;
-  align-items: center;
-  animation: splash-body-in 0.8s cubic-bezier(0.16,1,0.3,1) forwards;
-}
-@keyframes splash-body-in {
-  from { opacity: 0; transform: translateY(40rpx) scale(0.96); }
-  to   { opacity: 1; transform: translateY(0) scale(1); }
-}
-
-/* ---- logo ---- */
-.splash-logo-wrap {
-  width: 160rpx; height: 160rpx;
-  border-radius: 40rpx;
-  background: rgba(255,255,255,0.95);
-  display: flex; align-items: center; justify-content: center;
-  margin-bottom: 16rpx;
-  box-shadow: 0 8rpx 32rpx rgba(249,115,22,0.25);
-  animation: splash-logo-pulse 2.5s ease-in-out infinite;
-}
-@keyframes splash-logo-pulse {
-  0%, 100% { box-shadow: 0 8rpx 32rpx rgba(249,115,22,0.25); }
-  50% { box-shadow: 0 8rpx 48rpx rgba(249,115,22,0.45); }
-}
-.splash-logo-img { width: 100rpx; height: 100rpx; }
-
-/* ---- brand ---- */
-.splash-brand-name {
-  font-size: 64rpx; font-weight: 800;
-  color: #7C2D12;
-  letter-spacing: 10rpx;
-  margin-bottom: 2rpx;
-}
-.splash-brand-en {
-  font-size: 20rpx;
-  color: rgba(124,45,18,0.5);
-  letter-spacing: 6rpx;
-  margin-bottom: 30rpx;
-}
-.splash-tagline {
-  font-size: 26rpx;
-  color: rgba(124,45,18,0.7);
-  letter-spacing: 4rpx;
-  margin-top: 24rpx;
-}
-
-/* ---- dims row from splash.vue (rounded circles) ---- */
-.splash-dims-row {
-  display: flex; flex-direction: row;
-  align-items: center; justify-content: center;
-  gap: 28rpx;
-}
-.splash-dim-item {
-  display: flex; flex-direction: column;
-  align-items: center; gap: 8rpx;
-}
-.splash-dim-circle {
-  width: 80rpx; height: 80rpx;
-  border-radius: 50%;
-  display: flex; align-items: center; justify-content: center;
-}
-.splash-dim-icon { font-size: 36rpx; line-height: 1; }
-.splash-dim-label {
-  font-size: 22rpx; font-weight: 500;
-  color: rgba(124,45,18,0.75);
-  line-height: 1;
-}
-
-/* ---- staggered dim entry from splash.vue ---- */
-.splash-dim-item:nth-child(1) { animation: splash-dim-in 0.5s ease 0.1s both; }
-.splash-dim-item:nth-child(2) { animation: splash-dim-in 0.5s ease 0.2s both; }
-.splash-dim-item:nth-child(3) { animation: splash-dim-in 0.5s ease 0.3s both; }
-.splash-dim-item:nth-child(4) { animation: splash-dim-in 0.5s ease 0.4s both; }
-.splash-dim-item:nth-child(5) { animation: splash-dim-in 0.5s ease 0.5s both; }
-@keyframes splash-dim-in {
-  from { opacity: 0; transform: translateY(16rpx) scale(0.8); }
-  to   { opacity: 1; transform: translateY(0) scale(1); }
-}
-
-/* ---- loading dots ---- */
-.splash-overlay-loading {
-  position: absolute;
-  bottom: 120rpx;
-  left: 0; right: 0;
-  display: flex;
-  justify-content: center;
-  align-items: center;
-  gap: 12rpx;
-}
-.splash-overlay-dot {
-  width: 14rpx; height: 14rpx;
-  border-radius: 50%;
-  background: rgba(249,115,22,0.6);
-  animation: splash-dot-bounce 1.4s ease-in-out infinite both;
-}
-.splash-overlay-dot:nth-child(1) { animation-delay: -0.32s; }
-.splash-overlay-dot:nth-child(2) { animation-delay: -0.16s; }
-.splash-overlay-dot:nth-child(3) { animation-delay: 0s; }
-@keyframes splash-dot-bounce {
-  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
-  40%           { transform: scale(1);   opacity: 1; }
-}
-
 /* ---- 登录态内容布局 ---- */
 .logged-in-container {
   padding-bottom: 40rpx;

+ 1 - 1
cfc-web/.last_build_commit

@@ -1 +1 @@
-ab7e997d8a7d0f3c0ffbe25cd8199c0d5eaf2dea
+8679b87b24a1b0ad7e5f6df85ff0690254927307

+ 2 - 2
cfc-web/package-lock.json

@@ -1,12 +1,12 @@
 {
   "name": "cfc-web",
-  "version": "1.0.877",
+  "version": "1.0.878",
   "lockfileVersion": 3,
   "requires": true,
   "packages": {
     "": {
       "name": "cfc-web",
-      "version": "1.0.877",
+      "version": "1.0.878",
       "dependencies": {
         "@wangeditor/editor": "^5.1.23",
         "@wangeditor/editor-for-vue": "^1.0.2",