From 49ef6eedb8dcb061f6a2ca4fc6621d91d542667c Mon Sep 17 00:00:00 2001 From: cheng <545895878@qq.com> Date: Mon, 20 Jul 2026 23:25:55 +0800 Subject: [PATCH] =?UTF-8?q?feat(game):=20=E6=96=B0=E5=A2=9E=E9=85=92?= =?UTF-8?q?=E6=A1=8C=E5=B0=8F=E6=B8=B8=E6=88=8F=E5=8A=9F=E8=83=BD=E5=B9=B6?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=9B=BE=E6=A0=87=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加了完整的酒桌小游戏页面,包含数字炸弹、猜拳大战、骰子大话和命运转盘四个游戏 - 实现了成就徽章组件的图标路径判断逻辑,支持图片和文字图标的动态切换 - 更新了饮酒分类常量中的白酒图标为酒杯样式,并修改成就图标为SVG路径 - 重构了动态卡片组件中的分类表情符号显示方式,支持SVG图标渲染 - 添加了游戏页面的路由配置和完整的交互功能实现 --- common/constants.js | 4 +- components/AchievementBadge.vue | 13 +- components/FeedCard.vue | 17 +- pages.json | 7 + pages/games/games.vue | 1282 +++++++++++++++++++++++++++++++ pages/login/login.vue | 4 + pages/profile/profile.vue | 55 +- 7 files changed, 1361 insertions(+), 21 deletions(-) create mode 100644 pages/games/games.vue diff --git a/common/constants.js b/common/constants.js index f78ad5a..532d584 100644 --- a/common/constants.js +++ b/common/constants.js @@ -2,7 +2,7 @@ // 酒类分类 export const DRINK_CATEGORIES = [ - { id: 'baijiu', name: '白酒', emoji: '⚱️', icon: '/static/icons/baijiu.svg', defaultDegree: 52 }, + { id: 'baijiu', name: '白酒', emoji: '🥃', icon: '/static/icons/baijiu.svg', defaultDegree: 52 }, { id: 'beer', name: '啤酒', emoji: '🍺', defaultDegree: 5 }, { id: 'wine', name: '红酒', emoji: '🍷', defaultDegree: 13 }, { id: 'whisky', name: '洋酒', emoji: '🥂', defaultDegree: 40 }, @@ -176,7 +176,7 @@ export const ACHIEVEMENTS = [ id: 'baijiu_master', name: '白酒达人', desc: '白酒累计打卡20次', - icon: '⚱️', + icon: '/static/icons/baijiu.svg', condition: { type: 'category_records', category: 'baijiu', value: 20 } }, { diff --git a/components/AchievementBadge.vue b/components/AchievementBadge.vue index 89b0e62..a584999 100644 --- a/components/AchievementBadge.vue +++ b/components/AchievementBadge.vue @@ -5,7 +5,8 @@ @click="$emit('click')" > - {{ achievement.icon }} + + {{ achievement.icon }} 🔒 @@ -15,11 +16,14 @@ @@ -74,6 +78,11 @@ export default { font-size: 48rpx; } +.badge-icon-img { + width: 52rpx; + height: 52rpx; +} + .badge-lock { position: absolute; bottom: -4rpx; diff --git a/components/FeedCard.vue b/components/FeedCard.vue index 2a6f70e..4abc60d 100644 --- a/components/FeedCard.vue +++ b/components/FeedCard.vue @@ -20,7 +20,8 @@ - {{ categoryEmoji(d.category) }} + + {{ getCatIcon(d.category) }} {{ d.name }} {{ d.amount }} @@ -60,16 +61,16 @@ + + diff --git a/pages/login/login.vue b/pages/login/login.vue index aba5cb1..b9b352b 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -142,6 +142,10 @@ export default { uni.showToast({ title: '请先同意用户协议和隐私政策', icon: 'none', duration: 2000 }) return } + if (!this.nickname.trim()) { + uni.showToast({ title: '请先填写昵称', icon: 'none', duration: 2000 }) + return + } this.loginLoading = true try { // 1. 获取微信登录 code diff --git a/pages/profile/profile.vue b/pages/profile/profile.vue index f27b275..b6d080a 100644 --- a/pages/profile/profile.vue +++ b/pages/profile/profile.vue @@ -78,7 +78,8 @@ - {{ personaEmoji }} + + {{ personaEmoji }} {{ personaTitle }} {{ personaDesc }} @@ -118,17 +119,17 @@ - - - - 🍻 + + + + 🎲 - 酒友圈 - NEW + 酒桌小游戏 + HOT - 看看酒友们今晚都在喝什么 + 数字炸弹·猜拳·骰子·转盘,今晚谁喝? @@ -148,7 +149,8 @@ - {{ detailAchievement.icon }} + + {{ detailAchievement.icon }} {{ detailAchievement.name }} {{ detailAchievement.desc }} @@ -164,7 +166,7 @@