update:补充乱斗语音

This commit is contained in:
2026-07-03 17:03:51 +08:00
parent 8c6374b2c5
commit 6aa3c6fd6c
5 changed files with 47 additions and 15 deletions
+2
View File
@@ -40,6 +40,8 @@ export const audioFils = {
"https://static.shelingxingqiu.com/attachment/2025-09-17/dcutya59b6pu0ur4um.mp3",
比赛开始:
"https://static.shelingxingqiu.com/attachment/2025-09-17/dcuu5z3a3lumkutske.mp3",
下半场开始:
"https://static.shelingxingqiu.com/shootmini/static/audio/%E4%B8%8B%E5%8D%8A%E5%9C%BA%E5%BC%80%E5%A7%8B.mp3",
请开始射击:
"https://static.shelingxingqiu.com/attachment/2025-09-17/dcutzdrl5u0iromqhf.mp3",
射击无效:
+1 -1
View File
@@ -207,7 +207,7 @@ const isMember = (player = {}) => player.vip === true || player.sVip === true;
justify-content: center;
color: #fff9;
font-size: 12px;
padding-top: 7px;
/* padding-top: 7px; */
flex: 0 0 auto;
}
.player-name {
+6 -1
View File
@@ -38,6 +38,10 @@ const props = defineProps({
type: Boolean,
default: false,
},
halfRest: {
type: Boolean,
default: false,
},
onStop: {
type: Function,
default: () => {},
@@ -136,8 +140,9 @@ const updateSound = () => {
async function onReceiveMessage(msg) {
if (Array.isArray(msg)) return;
if (msg.type === MESSAGETYPESV2.BattleStart) {
const audioKey = props.melee && (halfTime.value || props.halfRest) ? "下半场开始" : "比赛开始";
halfTime.value = false;
audioManager.play("比赛开始");
audioManager.play(audioKey);
} else if (msg.type === MESSAGETYPESV2.BattleEnd) {
audioManager.play("比赛结束", false);
} else if (msg.type === MESSAGETYPESV2.ShootResult) {
+1
View File
@@ -236,6 +236,7 @@ onShow(async () => {
:tips="tips"
:total="90"
:melee="true"
:halfRest="halfRest"
:battleId="battleId"
/>
<view v-if="start" class="user-row">
+37 -13
View File
@@ -145,6 +145,23 @@ const getMenuPrice = (item) => {
return value ? String(value).replace("¥", "").replace("¥", "") : "";
};
const getMenuSortValue = (item) => {
const value = item && item.sort;
if (value === undefined || value === null || value === "") return Number.MAX_SAFE_INTEGER;
const sort = Number(value);
return Number.isFinite(sort) ? sort : Number.MAX_SAFE_INTEGER;
};
const sortMenusBySort = (menus = []) => {
return menus
.map((item, index) => ({ item, index }))
.sort((a, b) => {
const sortDiff = getMenuSortValue(a.item) - getMenuSortValue(b.item);
return sortDiff || a.index - b.index;
})
.map(({ item }) => item);
};
const getMenuType = (item) => {
const vipType = Number(item.vipType);
if (vipType === 1) return "normal";
@@ -167,7 +184,7 @@ const getPackageMonths = (name) => {
};
const matchPackageSource = (type, pack, index) => {
const menus = configMenus.value;
const menus = sortMenusBySort(configMenus.value);
const typedMenus = menus.filter((item) => {
const menuType = getMenuType(item);
if (type.key === "super") return menuType === "super";
@@ -184,17 +201,24 @@ const matchPackageSource = (type, pack, index) => {
};
const getPackages = (type) => {
return type.packages.map((item, index) => {
const source = matchPackageSource(type, item, index);
return {
...item,
source,
name: source ? getMenuName(source) || item.name : item.name,
price: source ? getMenuPrice(source) || item.price : item.price,
icon: source && source.icon,
id: source && source.id,
};
});
return type.packages
.map((item, index) => {
const source = matchPackageSource(type, item, index);
return {
...item,
source,
name: source ? getMenuName(source) || item.name : item.name,
price: source ? getMenuPrice(source) || item.price : item.price,
icon: source && source.icon,
id: source && source.id,
};
})
.map((item, index) => ({ item, index }))
.sort((a, b) => {
const sortDiff = getMenuSortValue(a.item.source) - getMenuSortValue(b.item.source);
return sortDiff || a.index - b.index;
})
.map(({ item }) => item);
};
const currentPackages = computed(() => {
@@ -463,7 +487,7 @@ onShow(loadVipConfig);
<view class="package-list">
<view
v-for="(pack, index) in getPackages(type)"
:key="`${type.key}-${pack.name}`"
:key="`${type.key}-${pack.id || pack.name}`"
class="package-card"
:class="{ 'package-card--active': selectedPackageIndex === index }"
@click="selectPackage(index)"