feat(companion): 全面确立以陪吃·陪喝·陪唱为主的核心架构,重构首屏推荐阵容与歌声试听

这个提交包含在:
wikiboss
2026-09-16 20:16:56 +08:00
父节点 341023c77b
当前提交 9fd7ea2c5a
共有 14 个文件被更改,包括 749 次插入 和 82 次删除

查看文件

@@ -4,7 +4,7 @@
<view class="header-search">
<view class="search-box">
<image class="search-icon-img" :src="ICONS.search" mode="aspectFit" />
<input class="search-input" placeholder="搜索电竞陪玩、同城陪吃陪喝或大神" placeholder-class="placeholder-text" />
<input class="search-input" placeholder="搜索同城陪吃、陪喝、KTV陪唱或达人" placeholder-class="placeholder-text" />
</view>
</view>
@@ -116,10 +116,10 @@
</view>
<view class="rank-badge" v-else>{{ expert.rankTag }}</view>
<!-- 语音试听条 (矢量SVG播放图标,带播放高亮光晕) -->
<view class="voice-bar btn-active" :class="{ playing: playingId === expert.id }" @click.stop="toggleVoice(expert.id)">
<image class="voice-icon-svg" :src="playingId === expert.id ? ICONS.pause : ICONS.play" mode="aspectFit" />
<text class="voice-text">{{ playingId === expert.id ? '试听中...' : expert.voiceDuration + 's 原声试听' }}</text>
<!-- 语音/歌声试听条 (矢量SVG播放图标,带播放高亮光晕) -->
<view class="voice-bar btn-active" :class="{ playing: playingId === expert.id, 'song-bar': expert.voiceType === 'song' }" @click.stop="toggleVoice(expert.id)">
<image class="voice-icon-svg" :src="playingId === expert.id ? ICONS.pause : (expert.voiceType === 'song' ? ICONS.micVocal : ICONS.play)" mode="aspectFit" />
<text class="voice-text">{{ playingId === expert.id ? '播放中...' : (expert.voiceTitle || expert.voiceDuration + 's 原声试听') }}</text>
<view class="wave-lines" v-if="playingId === expert.id">
<view class="wave-item w1"></view>
<view class="wave-item w2"></view>
@@ -157,6 +157,7 @@ const filteredExperts = computed(() => {
const gameMap = {
offline_meal: '美食陪吃',
offline_drink: '下午茶陪喝',
offline_sing: '同城陪唱',
offline_play: '同城陪玩',
wzry: '王者荣耀',
hpjy: '和平精英',
@@ -616,6 +617,25 @@ const navTo = (url) => {
box-shadow: 0 0 14rpx rgba(99, 102, 241, 0.4);
}
&.song-bar {
background: rgba(244, 63, 94, 0.15);
border-color: rgba(244, 63, 94, 0.35);
.voice-text {
color: #FB7185;
}
&.playing {
background: rgba(244, 63, 94, 0.3);
border-color: #F43F5E;
box-shadow: 0 0 14rpx rgba(244, 63, 94, 0.4);
}
.wave-lines .wave-item {
background: #FB7185;
}
}
.voice-icon-svg {
width: 20rpx;
height: 20rpx;

查看文件

@@ -75,7 +75,7 @@
<block v-if="isOffline">
<view class="remark-row">
<text class="cell-label">碰面场所</text>
<input class="remark-input" v-model="meetVenue" placeholder="必须为公开正规场所,如:朝阳大悦城海底捞" placeholder-class="ph" />
<input class="remark-input" v-model="meetVenue" placeholder="正规场所,如:工体纯K量贩KTV/朝阳大悦城" placeholder-class="ph" />
</view>
<view class="expense-row">
<text class="cell-label">现场消费</text>
@@ -162,9 +162,11 @@ const isOffline = computed(() => {
return expert.value && (
expert.value.track === 'OFFLINE_MEAL' ||
expert.value.track === 'OFFLINE_DRINK' ||
expert.value.track === 'OFFLINE_SING' ||
expert.value.track === 'OFFLINE_PLAY' ||
expert.value.game === '美食陪吃' ||
expert.value.game === '下午茶陪喝' ||
expert.value.game === '同城陪唱' ||
expert.value.game === '同城陪玩'
);
});

查看文件

@@ -1,5 +1,5 @@
<template>
<view class="user-container">
<view class="user-container" :class="{ 'theme-warm': currentThemeKey === 'warm' }">
<!-- 用户头部个人资料卡 -->
<view class="profile-card">
<image class="user-avatar" :src="user.avatar" mode="aspectFill" />
@@ -92,6 +92,14 @@
<!-- 列表式功能菜单 (纯矢量SVG图标) -->
<view class="list-menu-card">
<view class="list-row btn-active" @click="handleSwitchTheme">
<image class="row-svg" :src="ICONS.palette" mode="aspectFit" />
<text class="row-label">界面主题风格</text>
<view class="theme-pill" :class="{ warm: currentThemeKey === 'warm' }">
<text>{{ currentThemeKey === 'warm' ? '暖阳赤焰' : '冷光暗夜' }}</text>
</view>
<text class="row-arrow">></text>
</view>
<view class="list-row btn-active" @click="contactService">
<image class="row-svg" :src="ICONS.headphones" mode="aspectFit" />
<text class="row-label">官方在线客服</text>
@@ -112,12 +120,43 @@
</template>
<script setup>
import { ref } from 'vue';
import { ref, onMounted, onUnmounted } from 'vue';
import { USER_PROFILE } from '@/common/mock.js';
import { ICONS } from '@/common/icons.js';
import { getCurrentThemeKey, setTheme, THEME_KEYS } from '@/common/theme.js';
const user = ref(USER_PROFILE);
const currentRole = ref('PLAYER');
const currentThemeKey = ref(getCurrentThemeKey());
const onThemeChanged = (key) => {
currentThemeKey.value = key;
};
onMounted(() => {
currentThemeKey.value = getCurrentThemeKey();
uni.$on('theme-change', onThemeChanged);
});
onUnmounted(() => {
uni.$off('theme-change', onThemeChanged);
});
const handleSwitchTheme = () => {
uni.showActionSheet({
itemList: ['冷光暗夜 (经典暗夜蓝紫)', '暖阳赤焰 (热情暖橙金流光)'],
success: (res) => {
const selectedKey = res.tapIndex === 1 ? THEME_KEYS.WARM : THEME_KEYS.COOL;
currentThemeKey.value = selectedKey;
setTheme(selectedKey);
uni.showToast({
title: selectedKey === THEME_KEYS.WARM ? '已切换至【暖阳赤焰】暖色系' : '已切换至【冷光暗夜】经典款',
icon: 'none',
duration: 1500
});
}
});
};
const toggleRole = () => {
if (currentRole.value === 'PLAYER') {
@@ -522,6 +561,23 @@ const navTo = (url) => {
color: #E2E8F0;
}
.theme-pill {
margin-right: 16rpx;
font-size: 22rpx;
color: #818CF8;
background: rgba(99, 102, 241, 0.15);
border: 1px solid rgba(99, 102, 241, 0.3);
padding: 4rpx 16rpx;
border-radius: 20rpx;
font-weight: 500;
&.warm {
color: #FB923C;
background: rgba(249, 115, 22, 0.15);
border-color: rgba(249, 115, 22, 0.3);
}
}
.row-arrow {
font-size: 24rpx;
color: #64748B;
@@ -529,6 +585,25 @@ const navTo = (url) => {
}
}
.user-container.theme-warm {
background-color: #140E0A;
.profile-card .user-avatar {
border-color: #F97316;
}
.role-switch-card .role-glow-border {
background: conic-gradient(from 0deg, #F97316, #F59E0B, #EA580C, #F97316);
}
.role-switch-card .btn-switch-role {
background: linear-gradient(135deg, #F97316, #EA580C);
box-shadow: 0 4rpx 16rpx rgba(249, 115, 22, 0.4);
}
.wallet-card, .menu-grid-card, .list-menu-card {
background-color: #221711;
border-color: rgba(249, 115, 22, 0.12);
}
}
@keyframes glowSpin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }