优化:小程序记住登录与启动跳转

This commit is contained in:
2026-10-10 16:41:37 +08:00
parent ae1b568131
commit d38c5cd4fe
13 changed files with 194 additions and 21 deletions
+20
View File
@@ -0,0 +1,20 @@
const { BRAND_CONFIG } = require('../../utils/config')
Page({
data: {
appName: BRAND_CONFIG.appName,
message: '正在安全登录…'
},
onLoad() {
this.startLogin()
},
async startLogin() {
try {
await getApp().bootstrapWechatLogin()
} catch (error) {
this.setData({ message: '登录状态检查失败,正在返回登录页…' })
}
}
})
+4
View File
@@ -0,0 +1,4 @@
{
"navigationStyle": "custom",
"backgroundColor": "#FFFFFF"
}
+5
View File
@@ -0,0 +1,5 @@
<view class="launch-page">
<image class="launch-logo" src="/assets/images/app-icon.png" mode="aspectFill"></image>
<text class="launch-name">{{appName}}</text>
<view class="launch-status"><view class="loading-dot"></view><text>{{message}}</text></view>
</view>
+6
View File
@@ -0,0 +1,6 @@
.launch-page { display:flex; min-height:100vh; box-sizing:border-box; flex-direction:column; align-items:center; justify-content:center; padding-bottom:100rpx; background:#fff; }
.launch-logo { width:196rpx; height:196rpx; border-radius:46rpx; }
.launch-name { margin-top:26rpx; color:#202522; font-size:40rpx; font-weight:800; letter-spacing:3rpx; }
.launch-status { display:flex; align-items:center; margin-top:42rpx; color:#8a918d; font-size:23rpx; }
.loading-dot { width:14rpx; height:14rpx; margin-right:14rpx; border-radius:50%; background:#2f8f78; animation:pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity:.25; transform:scale(.75); } 50% { opacity:1; transform:scale(1); } }