refactor(data): 全面移除小程序写死的演示/兜底数据,测试数据统一落库
- 删除无引用的 common/mock.js;登录页与个人中心的演示账号改为 DB 配置 demo_accounts + /api/auth/demo-accounts、/api/auth/demo-login(签发真实 token) - 移除订单/活动/大神/动态/推广/工作台/门票/充值/举报等页面的演示列表与假兜底;新增真实空态 - 修复伪造成功:活动调价、评价回复、核销、海报保存、图片上传失败、提现/核销固定 1001、随机开黑房号、随机即时匹配、假语音播放等 - 服务端移除 101/2006 合成用户与合成大神兜底、移除默认服务包虚构价格;演示账号清单可在后台关闭 - 111 套件/733 用例全绿;已部署 20261021_162041,demo-accounts/demo-login 实测通过
这个提交包含在:
@@ -149,7 +149,7 @@
|
||||
<view class="rank-badge" v-else>{{ expert.rankTag }}</view>
|
||||
|
||||
<!-- 语音/歌声试听条 (矢量SVG播放图标,带播放高亮光晕) -->
|
||||
<view class="voice-bar btn-active" :class="{ playing: playingId === expert.id, 'song-bar': expert.voiceType === 'song' }" @click.stop="toggleVoice(expert.id)">
|
||||
<view class="voice-bar btn-active" :class="{ playing: playingId === expert.id, 'song-bar': expert.voiceType === 'song' }" @click.stop="toggleVoice(expert)">
|
||||
<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">
|
||||
@@ -468,6 +468,7 @@ onShow(() => {
|
||||
|
||||
onUnmounted(() => {
|
||||
uni.$off('theme-change', onThemeChanged);
|
||||
try { if (homeVoiceAudio) { homeVoiceAudio.destroy(); homeVoiceAudio = null; } } catch (_) {}
|
||||
});
|
||||
|
||||
const filteredExperts = computed(() => {
|
||||
@@ -584,16 +585,19 @@ const startInstantMatch = () => {
|
||||
if (matchTimer) clearTimeout(matchTimer);
|
||||
matchTimer = setTimeout(() => {
|
||||
isMatching.value = false;
|
||||
// 优先匹配当前列表中在线的大神,若无则取首位
|
||||
// 按真实在线状态与距离推荐(有 distanceKm 时取最近),不做随机抽取
|
||||
const onlineList = experts.value.filter(e => e.isOnline);
|
||||
if (onlineList.length > 0) {
|
||||
matchedExpert.value = onlineList[Math.floor(Math.random() * onlineList.length)];
|
||||
} else if (experts.value.length > 0) {
|
||||
matchedExpert.value = experts.value[0];
|
||||
} else {
|
||||
matchedExpert.value = null;
|
||||
}
|
||||
}, 1200);
|
||||
const candidates = onlineList.length > 0 ? onlineList : experts.value;
|
||||
const sorted = [...candidates].sort((a, b) => {
|
||||
const da = Number(a.distanceKm);
|
||||
const db = Number(b.distanceKm);
|
||||
if (Number.isFinite(da) && Number.isFinite(db)) return da - db;
|
||||
if (Number.isFinite(da)) return -1;
|
||||
if (Number.isFinite(db)) return 1;
|
||||
return 0;
|
||||
});
|
||||
matchedExpert.value = sorted[0] || null;
|
||||
}, 600);
|
||||
};
|
||||
|
||||
const closeMatchModal = () => {
|
||||
@@ -613,16 +617,31 @@ const confirmMatchedOrder = () => {
|
||||
}
|
||||
};
|
||||
|
||||
const toggleVoice = (id) => {
|
||||
if (playingId.value === id) {
|
||||
playingId.value = null;
|
||||
} else {
|
||||
playingId.value = id;
|
||||
uni.showToast({ title: '正在试听打招呼语音', icon: 'none' });
|
||||
setTimeout(() => {
|
||||
if (playingId.value === id) playingId.value = null;
|
||||
}, 4000);
|
||||
let homeVoiceAudio = null;
|
||||
const toggleVoice = (expertItem) => {
|
||||
const id = expertItem && expertItem.id !== undefined ? expertItem.id : expertItem;
|
||||
const url = expertItem && expertItem.voiceIntroUrl;
|
||||
if (!url) {
|
||||
uni.showToast({ title: '该大神还未上传语音介绍', icon: 'none' });
|
||||
return;
|
||||
}
|
||||
if (playingId.value === id) {
|
||||
try { homeVoiceAudio && homeVoiceAudio.stop(); } catch (_) {}
|
||||
playingId.value = null;
|
||||
return;
|
||||
}
|
||||
try { homeVoiceAudio && homeVoiceAudio.stop(); } catch (_) {}
|
||||
if (!homeVoiceAudio) {
|
||||
homeVoiceAudio = uni.createInnerAudioContext();
|
||||
homeVoiceAudio.onEnded(() => { playingId.value = null; });
|
||||
homeVoiceAudio.onError(() => {
|
||||
playingId.value = null;
|
||||
uni.showToast({ title: '语音播放失败', icon: 'none' });
|
||||
});
|
||||
}
|
||||
homeVoiceAudio.src = url;
|
||||
homeVoiceAudio.play();
|
||||
playingId.value = id;
|
||||
};
|
||||
|
||||
const goToExpert = (id) => {
|
||||
|
||||
在新工单中引用
屏蔽一个用户