feat(game): 新增酒桌小游戏功能并优化图标显示

- 添加了完整的酒桌小游戏页面,包含数字炸弹、猜拳大战、骰子大话和命运转盘四个游戏
- 实现了成就徽章组件的图标路径判断逻辑,支持图片和文字图标的动态切换
- 更新了饮酒分类常量中的白酒图标为酒杯样式,并修改成就图标为SVG路径
- 重构了动态卡片组件中的分类表情符号显示方式,支持SVG图标渲染
- 添加了游戏页面的路由配置和完整的交互功能实现
This commit is contained in:
cg
2026-07-20 23:25:55 +08:00
parent fabbb167cf
commit 49ef6eedb8
7 changed files with 1361 additions and 21 deletions
+12 -5
View File
@@ -20,7 +20,8 @@
<!-- 饮酒标签 -->
<view class="feed-drinks" v-if="feed.drinks && feed.drinks.length">
<view class="feed-drink-tag" v-for="(d, i) in feed.drinks" :key="i">
<text class="feed-drink-emoji">{{ categoryEmoji(d.category) }}</text>
<image v-if="isIconPath(getCatIcon(d.category))" :src="getCatIcon(d.category)" class="feed-drink-icon-img" mode="aspectFit"></image>
<text v-else class="feed-drink-emoji">{{ getCatIcon(d.category) }}</text>
<text class="feed-drink-name">{{ d.name }} {{ d.amount }}</text>
</view>
</view>
@@ -60,16 +61,16 @@
</template>
<script>
import { getCatIcon, isIconPath } from '../common/utils'
export default {
name: 'FeedCard',
props: {
feed: { type: Object, default: () => ({}) }
},
methods: {
categoryEmoji(cat) {
const map = { baijiu: '🏺', beer: '🍺', wine: '🍷', whisky: '🥃', huangjiu: '🫖', sake: '🍶', fruit: '🍹', cocktail: '🍸' }
return map[cat] || '🍻'
},
getCatIcon,
isIconPath,
feelingLabel(f) {
const map = { sober: '😌 清醒', buzzed: '😊 微醺', tipsy: '😄 小醉', drunk: '🥴 喝多了' }
return map[f] || '🍻 喝了点'
@@ -163,6 +164,12 @@ export default {
font-size: $fs-sm;
}
.feed-drink-icon-img {
width: 32rpx;
height: 32rpx;
flex-shrink: 0;
}
.feed-drink-name {
font-size: $fs-xs;
color: $text-secondary;