feat 主页

This commit is contained in:
2026-02-12 18:43:10 +08:00
parent 045fd08139
commit 9f3089907c
3 changed files with 34 additions and 153 deletions

View File

@@ -1,7 +1,7 @@
const config = { const config = {
baseUrl: getBaseUrl(), baseUrl: getBaseUrl(),
api: { api: {
login: '/gw/open/login', login: '/gateway/open/login',
getQuestion: '/qgdzs/open/random/question', getQuestion: '/qgdzs/open/random/question',
answerQuestion: '/qgdzs/open/random/answer', answerQuestion: '/qgdzs/open/random/answer',
getAllCategory: '/qgdzs/open/category/get_category', getAllCategory: '/qgdzs/open/category/get_category',

View File

@@ -2,8 +2,8 @@
"name" : "卷王大乱斗", "name" : "卷王大乱斗",
"appid" : "__UNI__3947B70", "appid" : "__UNI__3947B70",
"description" : "", "description" : "",
"versionName" : "1.0.12", "versionName" : "1.0.13",
"versionCode" : 1012, "versionCode" : 1013,
"transformPx" : false, "transformPx" : false,
/* 5+App特有相关 */ /* 5+App特有相关 */
"app-plus" : { "app-plus" : {

View File

@@ -3,7 +3,6 @@
<view class="header"> <view class="header">
<view class="welcome"> <view class="welcome">
<text class="welcome-title">趣味答题</text> <text class="welcome-title">趣味答题</text>
<text class="welcome-subtitle">海量题库,轻松学习</text>
</view> </view>
<view v-if="!isNotLoggedIn" class="point-card"> <view v-if="!isNotLoggedIn" class="point-card">
<view class="point-info"> <view class="point-info">
@@ -14,42 +13,10 @@
<text class="level-text">{{ pointLevel }}</text> <text class="level-text">{{ pointLevel }}</text>
</view> </view>
</view> </view>
</view> <view v-else class="login-card" @click="handleLogin">
<text class="login-icon">🔐</text>
<view class="action-section"> <text class="login-title">登录即可累计与查看学识分</text>
<view class="action-card" @click="handleStartQuiz"> <text class="login-subtitle">点击登录</text>
<view class="action-icon">🎯</view>
<text class="action-title">开始答题</text>
<text class="action-desc">选择一种答题模式</text>
</view>
<view class="feature-section">
<view class="feature-card" @click="handleRandomQuiz">
<view class="feature-icon">🎲</view>
<text class="feature-title">随机答题</text>
<text class="feature-desc">随机抽取题目</text>
</view>
<view class="feature-card" @click="handleCategoryQuiz">
<view class="feature-icon">📚</view>
<text class="feature-title">类目答题</text>
<text class="feature-desc">按分类答题</text>
</view>
<view class="feature-card" @click="handleQuickQuiz">
<view class="feature-icon">⚡</view>
<text class="feature-title">快速答题</text>
<text class="feature-desc">限时挑战</text>
</view>
</view>
</view>
<view class="tips-section">
<view class="tip-item">
<text class="tip-icon">💡</text>
<text class="tip-text">每日答题,提升学识分</text>
</view>
<view class="tip-item">
<text class="tip-icon">🏆</text>
<text class="tip-text">解锁更高等级,展示你的知识水平</text>
</view> </view>
</view> </view>
</view> </view>
@@ -81,9 +48,10 @@ export default {
this.pointLoading = true this.pointLoading = true
try { try {
const res = await api.getPointInfo() const res = await api.getPointInfo()
if (res.data && res.data.point) { if (res.data) {
this.point = parseInt(res.data.point) || 0 this.point = parseInt(res.data.point) || 0
this.pointLevel = this.getPointLevel(this.point) this.pointLevel = this.getPointLevel(this.point)
this.isNotLoggedIn = false
} }
} catch (error) { } catch (error) {
console.error('获取学识分失败:', error) console.error('获取学识分失败:', error)
@@ -106,27 +74,9 @@ export default {
return '博士' return '博士'
}, },
handleStartQuiz() { handleLogin() {
uni.navigateTo({ uni.navigateTo({
url: '/pages/gameplay/gameplay' url: '/pages/login/login'
})
},
handleRandomQuiz() {
uni.navigateTo({
url: '/pages/random/random'
})
},
handleCategoryQuiz() {
uni.navigateTo({
url: '/pages/category/category'
})
},
handleQuickQuiz() {
uni.navigateTo({
url: '/pages/quick/quick'
}) })
} }
} }
@@ -140,15 +90,22 @@ export default {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
padding: 40rpx; padding: 40rpx;
box-sizing: border-box; box-sizing: border-box;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
} }
.header { .header {
margin-bottom: 60rpx; width: 100%;
display: flex;
flex-direction: column;
align-items: center;
} }
.welcome { .welcome {
text-align: center; text-align: center;
margin-bottom: 40rpx; margin-bottom: 60rpx;
} }
.welcome-title { .welcome-title {
@@ -156,13 +113,6 @@ export default {
font-size: 48rpx; font-size: 48rpx;
font-weight: bold; font-weight: bold;
color: #ffffff; color: #ffffff;
margin-bottom: 20rpx;
}
.welcome-subtitle {
display: block;
font-size: 28rpx;
color: rgba(255, 255, 255, 0.9);
} }
.point-card { .point-card {
@@ -211,17 +161,13 @@ export default {
box-shadow: 0 4rpx 15rpx rgba(0, 0, 0, 0.15); box-shadow: 0 4rpx 15rpx rgba(0, 0, 0, 0.15);
} }
.action-section { .login-card {
margin-bottom: 60rpx;
}
.action-card {
background: rgba(255, 255, 255, 0.2); background: rgba(255, 255, 255, 0.2);
border-radius: 20rpx; border-radius: 20rpx;
padding: 50rpx; padding: 40rpx;
margin: 0 auto 40rpx; margin: 0 auto;
width: 90%; width: 90%;
max-width: 500rpx; max-width: 400rpx;
backdrop-filter: blur(10rpx); backdrop-filter: blur(10rpx);
border: 2rpx solid rgba(255, 255, 255, 0.3); border: 2rpx solid rgba(255, 255, 255, 0.3);
display: flex; display: flex;
@@ -231,94 +177,29 @@ export default {
transition: all 0.3s; transition: all 0.3s;
} }
.action-card:active { .login-card:active {
transform: scale(0.98); transform: scale(0.98);
background: rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.3);
} }
.action-icon { .login-icon {
font-size: 80rpx; font-size: 80rpx;
margin-bottom: 10rpx;
} }
.action-title { .login-title {
font-size: 40rpx;
font-weight: bold;
color: #ffffff;
text-shadow: 0 4rpx 10rpx rgba(0, 0, 0, 0.2);
}
.action-desc {
font-size: 28rpx; font-size: 28rpx;
color: rgba(255, 255, 255, 0.9);
}
.feature-section {
display: flex;
flex-direction: column;
gap: 20rpx;
margin-top: 40rpx;
}
.feature-card {
background: rgba(255, 255, 255, 0.15);
border-radius: 16rpx;
padding: 30rpx;
backdrop-filter: blur(10rpx);
border: 2rpx solid rgba(255, 255, 255, 0.2);
display: flex;
align-items: center;
gap: 30rpx;
transition: all 0.3s;
}
.feature-card:active {
transform: scale(0.98);
background: rgba(255, 255, 255, 0.25);
}
.feature-icon {
font-size: 50rpx;
min-width: 60rpx;
}
.feature-title {
font-size: 32rpx;
font-weight: bold; font-weight: bold;
color: #ffffff; color: #ffffff;
flex: 1; text-align: center;
line-height: 1.4;
} }
.feature-desc { .login-subtitle {
font-size: 24rpx; font-size: 24rpx;
color: rgba(255, 255, 255, 0.8);
}
.tips-section {
margin-top: 60rpx;
}
.tip-item {
background: rgba(255, 255, 255, 0.1);
border-radius: 16rpx;
padding: 24rpx;
margin-bottom: 20rpx;
display: flex;
align-items: center;
gap: 20rpx;
backdrop-filter: blur(10rpx);
border: 2rpx solid rgba(255, 255, 255, 0.15);
}
.tip-icon {
font-size: 36rpx;
min-width: 40rpx;
}
.tip-text {
font-size: 26rpx;
color: rgba(255, 255, 255, 0.9); color: rgba(255, 255, 255, 0.9);
flex: 1; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
line-height: 1.6; padding: 10rpx 40rpx;
border-radius: 30rpx;
margin-top: 10rpx;
} }
</style> </style>