From 6aa3c6fd6ce9a73446d68f00b1049bd24e02e9f1 Mon Sep 17 00:00:00 2001 From: zhangyibo95 <690096405@qq.com> Date: Fri, 3 Jul 2026 17:03:51 +0800 Subject: [PATCH] =?UTF-8?q?update:=E8=A1=A5=E5=85=85=E4=B9=B1=E6=96=97?= =?UTF-8?q?=E8=AF=AD=E9=9F=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/audioManager.js | 2 ++ src/components/BattleHeader.vue | 2 +- src/components/ShootProgress.vue | 7 ++++- src/pages/melee-battle.vue | 1 + src/pages/member/be-vip.vue | 50 +++++++++++++++++++++++--------- 5 files changed, 47 insertions(+), 15 deletions(-) diff --git a/src/audioManager.js b/src/audioManager.js index a0f55bb..3ef733e 100644 --- a/src/audioManager.js +++ b/src/audioManager.js @@ -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", 射击无效: diff --git a/src/components/BattleHeader.vue b/src/components/BattleHeader.vue index 1ade377..b5cafcf 100644 --- a/src/components/BattleHeader.vue +++ b/src/components/BattleHeader.vue @@ -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 { diff --git a/src/components/ShootProgress.vue b/src/components/ShootProgress.vue index 6ad4d49..8865cf7 100644 --- a/src/components/ShootProgress.vue +++ b/src/components/ShootProgress.vue @@ -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) { diff --git a/src/pages/melee-battle.vue b/src/pages/melee-battle.vue index 322a1a1..b7f5957 100644 --- a/src/pages/melee-battle.vue +++ b/src/pages/melee-battle.vue @@ -236,6 +236,7 @@ onShow(async () => { :tips="tips" :total="90" :melee="true" + :halfRest="halfRest" :battleId="battleId" /> diff --git a/src/pages/member/be-vip.vue b/src/pages/member/be-vip.vue index 7568e9c..f299225 100644 --- a/src/pages/member/be-vip.vue +++ b/src/pages/member/be-vip.vue @@ -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);