feat: 改造入口页(自动跳转)和登录页(微信授权登录)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
jacobxu666
2026-06-14 17:30:05 +08:00
co-authored by Claude Opus 4.8
parent 37be873c3a
commit 6330edba00
3 changed files with 167 additions and 224 deletions
+21 -137
View File
@@ -1,77 +1,36 @@
<template>
<view class="container">
<view class="hero">
<image class="logo" src="/static/logo.png" mode="aspectFit" />
<text class="title">zhy-test</text>
<text class="subtitle">uni-app + Vue3 + TypeScript</text>
</view>
<view class="card-list">
<view class="card" @click="goToProfile">
<view class="card-icon">👤</view>
<view class="card-content">
<text class="card-title">个人中心</text>
<text class="card-desc">查看个人信息</text>
</view>
<view class="card-arrow">›</view>
</view>
<view class="card" @click="goToLogs">
<view class="card-icon">📝</view>
<view class="card-content">
<text class="card-title">日志记录</text>
<text class="card-desc">查看应用启动日志</text>
</view>
<view class="card-arrow">›</view>
</view>
<view class="card" @click="goToLogin">
<view class="card-icon">🔑</view>
<view class="card-content">
<text class="card-title">登录</text>
<text class="card-desc">用户登录页面</text>
</view>
<view class="card-arrow">›</view>
</view>
</view>
<view class="info">
<text class="info-title">支持多端发布</text>
<view class="tag-list">
<text class="tag">微信小程序</text>
<text class="tag">H5</text>
<text class="tag">App</text>
</view>
</view>
<view class="splash">
<image class="logo" src="/static/logo.png" mode="aspectFit" />
<text class="title">湖南12301文旅专区</text>
<text class="subtitle">加载中...</text>
</view>
</template>
<script setup lang="ts">
function goToProfile() {
uni.switchTab({ url: '/pages/profile/profile' })
}
import { onMounted } from 'vue'
import { useUserStore } from '../../store/user'
function goToLogs() {
uni.navigateTo({ url: '/pages/logs/logs' })
}
const userStore = useUserStore()
function goToLogin() {
uni.navigateTo({ url: '/pages/login/login' })
}
onMounted(() => {
setTimeout(() => {
if (userStore.isLogin) {
uni.switchTab({ url: '/packages/user/pages/index/index' })
} else {
uni.navigateTo({ url: '/pages/login/login' })
}
}, 800)
})
</script>
<style scoped>
.container {
padding: 30rpx;
min-height: 100vh;
box-sizing: border-box;
}
.hero {
.splash {
display: flex;
flex-direction: column;
align-items: center;
padding: 60rpx 0;
justify-content: center;
min-height: 100vh;
background: #fff;
}
.logo {
@@ -84,86 +43,11 @@ function goToLogin() {
font-size: 40rpx;
font-weight: bold;
color: #333;
margin-bottom: 10rpx;
margin-bottom: 16rpx;
}
.subtitle {
font-size: 26rpx;
color: #888;
}
.card-list {
background: #fff;
border-radius: 20rpx;
overflow: hidden;
margin-bottom: 40rpx;
}
.card {
display: flex;
align-items: center;
padding: 30rpx;
border-bottom: 1rpx solid #f0f0f0;
}
.card:last-child {
border-bottom: none;
}
.card-icon {
font-size: 40rpx;
margin-right: 20rpx;
}
.card-content {
flex: 1;
display: flex;
flex-direction: column;
}
.card-title {
font-size: 30rpx;
color: #333;
margin-bottom: 6rpx;
}
.card-desc {
font-size: 24rpx;
color: #999;
}
.card-arrow {
font-size: 40rpx;
color: #ccc;
}
.info {
padding: 30rpx;
background: #fff;
border-radius: 20rpx;
text-align: center;
}
.info-title {
font-size: 28rpx;
color: #666;
display: block;
margin-bottom: 20rpx;
}
.tag-list {
display: flex;
justify-content: center;
gap: 20rpx;
flex-wrap: wrap;
}
.tag {
display: inline-block;
padding: 10rpx 30rpx;
background: #e8f4ff;
color: #007aff;
border-radius: 30rpx;
font-size: 24rpx;
}
</style>