update:补充乱斗语音
This commit is contained in:
@@ -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/dcutya59b6pu0ur4um.mp3",
|
||||||
比赛开始:
|
比赛开始:
|
||||||
"https://static.shelingxingqiu.com/attachment/2025-09-17/dcuu5z3a3lumkutske.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",
|
"https://static.shelingxingqiu.com/attachment/2025-09-17/dcutzdrl5u0iromqhf.mp3",
|
||||||
射击无效:
|
射击无效:
|
||||||
|
|||||||
@@ -207,7 +207,7 @@ const isMember = (player = {}) => player.vip === true || player.sVip === true;
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
color: #fff9;
|
color: #fff9;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
padding-top: 7px;
|
/* padding-top: 7px; */
|
||||||
flex: 0 0 auto;
|
flex: 0 0 auto;
|
||||||
}
|
}
|
||||||
.player-name {
|
.player-name {
|
||||||
|
|||||||
@@ -38,6 +38,10 @@ const props = defineProps({
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
|
halfRest: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
onStop: {
|
onStop: {
|
||||||
type: Function,
|
type: Function,
|
||||||
default: () => {},
|
default: () => {},
|
||||||
@@ -136,8 +140,9 @@ const updateSound = () => {
|
|||||||
async function onReceiveMessage(msg) {
|
async function onReceiveMessage(msg) {
|
||||||
if (Array.isArray(msg)) return;
|
if (Array.isArray(msg)) return;
|
||||||
if (msg.type === MESSAGETYPESV2.BattleStart) {
|
if (msg.type === MESSAGETYPESV2.BattleStart) {
|
||||||
|
const audioKey = props.melee && (halfTime.value || props.halfRest) ? "下半场开始" : "比赛开始";
|
||||||
halfTime.value = false;
|
halfTime.value = false;
|
||||||
audioManager.play("比赛开始");
|
audioManager.play(audioKey);
|
||||||
} else if (msg.type === MESSAGETYPESV2.BattleEnd) {
|
} else if (msg.type === MESSAGETYPESV2.BattleEnd) {
|
||||||
audioManager.play("比赛结束", false);
|
audioManager.play("比赛结束", false);
|
||||||
} else if (msg.type === MESSAGETYPESV2.ShootResult) {
|
} else if (msg.type === MESSAGETYPESV2.ShootResult) {
|
||||||
|
|||||||
@@ -236,6 +236,7 @@ onShow(async () => {
|
|||||||
:tips="tips"
|
:tips="tips"
|
||||||
:total="90"
|
:total="90"
|
||||||
:melee="true"
|
:melee="true"
|
||||||
|
:halfRest="halfRest"
|
||||||
:battleId="battleId"
|
:battleId="battleId"
|
||||||
/>
|
/>
|
||||||
<view v-if="start" class="user-row">
|
<view v-if="start" class="user-row">
|
||||||
|
|||||||
@@ -145,6 +145,23 @@ const getMenuPrice = (item) => {
|
|||||||
return value ? String(value).replace("¥", "").replace("¥", "") : "";
|
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 getMenuType = (item) => {
|
||||||
const vipType = Number(item.vipType);
|
const vipType = Number(item.vipType);
|
||||||
if (vipType === 1) return "normal";
|
if (vipType === 1) return "normal";
|
||||||
@@ -167,7 +184,7 @@ const getPackageMonths = (name) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const matchPackageSource = (type, pack, index) => {
|
const matchPackageSource = (type, pack, index) => {
|
||||||
const menus = configMenus.value;
|
const menus = sortMenusBySort(configMenus.value);
|
||||||
const typedMenus = menus.filter((item) => {
|
const typedMenus = menus.filter((item) => {
|
||||||
const menuType = getMenuType(item);
|
const menuType = getMenuType(item);
|
||||||
if (type.key === "super") return menuType === "super";
|
if (type.key === "super") return menuType === "super";
|
||||||
@@ -184,7 +201,8 @@ const matchPackageSource = (type, pack, index) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const getPackages = (type) => {
|
const getPackages = (type) => {
|
||||||
return type.packages.map((item, index) => {
|
return type.packages
|
||||||
|
.map((item, index) => {
|
||||||
const source = matchPackageSource(type, item, index);
|
const source = matchPackageSource(type, item, index);
|
||||||
return {
|
return {
|
||||||
...item,
|
...item,
|
||||||
@@ -194,7 +212,13 @@ const getPackages = (type) => {
|
|||||||
icon: source && source.icon,
|
icon: source && source.icon,
|
||||||
id: source && source.id,
|
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(() => {
|
const currentPackages = computed(() => {
|
||||||
@@ -463,7 +487,7 @@ onShow(loadVipConfig);
|
|||||||
<view class="package-list">
|
<view class="package-list">
|
||||||
<view
|
<view
|
||||||
v-for="(pack, index) in getPackages(type)"
|
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"
|
||||||
:class="{ 'package-card--active': selectedPackageIndex === index }"
|
:class="{ 'package-card--active': selectedPackageIndex === index }"
|
||||||
@click="selectPackage(index)"
|
@click="selectPackage(index)"
|
||||||
|
|||||||
Reference in New Issue
Block a user