update:分包、对接个人练习
This commit is contained in:
+234
-1
@@ -3,7 +3,240 @@
|
|||||||
"compileType": "miniprogram",
|
"compileType": "miniprogram",
|
||||||
"libVersion": "3.7.7",
|
"libVersion": "3.7.7",
|
||||||
"packOptions": {
|
"packOptions": {
|
||||||
"ignore": [],
|
"ignore": [
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"value": "static/common/dialog-light.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"value": "static/common/dialog-bg.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"value": "static/common/dialog-icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"value": "static/prompt-bg-square.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"value": "static/coach-comment.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"value": "static/screen-hint-bg.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"value": "static/red-team-win.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"value": "static/blue-team-win.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"value": "static/my-grow.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"value": "static/gold-shining.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"value": "static/bow-target.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"value": "static/matching-bg.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"value": "static/versus.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"value": "static/point-champion.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"value": "static/my-practise.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"value": "static/shining-bg.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"value": "static/donate.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"value": "static/friend-battle.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"value": "static/user-upgrade.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"value": "static/finish-frame.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"value": "static/vip/svip-jian.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"value": "static/battle-header.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"value": "static/battle-header-melee.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"value": "static/player-bg.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"value": "static/mvp-blue.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"value": "static/finish-tip.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"value": "static/2unfinish-tip.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"value": "static/have-no-device.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"value": "static/device-icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"value": "static/unfinish-tip.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"value": "static/test-tip.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"value": "static/mvp-red.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"value": "static/vip/svip-lie.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"value": "static/mvp-tip.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"value": "static/rank/battle-choose.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"value": "static/back-to-game-bg.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"value": "static/complete-light1.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"value": "static/complete-light2.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"value": "static/title-2v2.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"value": "static/tab-bg.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"value": "static/scan.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"value": "static/choose-battle-mode.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"value": "static/shooter.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"value": "static/my-growth.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"value": "static/juezhanbang.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"value": "static/title-3v3.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"value": "static/point-book-tip-bg.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"value": "static/reward-us.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"value": "static/rank/star.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"value": "static/tab-point-book.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"value": "static/pk-icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"value": "static/first-try.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"value": "static/row-yellow-bg.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"value": "static/room-notfound-title.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"value": "static/title-mvp.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"value": "static/long-bubble-tall.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"value": "static/battle-result.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"value": "static/tab-mall.png"
|
||||||
|
}
|
||||||
|
],
|
||||||
"include": []
|
"include": []
|
||||||
},
|
},
|
||||||
"setting": {
|
"setting": {
|
||||||
|
|||||||
+12
-2
@@ -8,8 +8,8 @@ try {
|
|||||||
|
|
||||||
switch (envVersion) {
|
switch (envVersion) {
|
||||||
case "develop": // 开发版
|
case "develop": // 开发版
|
||||||
// BASE_URL = "http://192.168.1.2:8000/api/shoot";
|
BASE_URL = "http://192.168.1.2:8000/api/shoot";
|
||||||
BASE_URL = "https://apitest.shelingxingqiu.com/api/shoot";
|
// BASE_URL = "https://apitest.shelingxingqiu.com/api/shoot";
|
||||||
break;
|
break;
|
||||||
case "trial": // 体验版
|
case "trial": // 体验版
|
||||||
BASE_URL = "https://apitest.shelingxingqiu.com/api/shoot";
|
BASE_URL = "https://apitest.shelingxingqiu.com/api/shoot";
|
||||||
@@ -26,6 +26,7 @@ try {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const ADDONS_BASE_URL = BASE_URL.replace(/\/api\/shoot$/, "/api/shoot");
|
const ADDONS_BASE_URL = BASE_URL.replace(/\/api\/shoot$/, "/api/shoot");
|
||||||
|
const PRACTICE_BASE_URL = BASE_URL.replace(/\/api\/shoot$/, "/api");
|
||||||
|
|
||||||
// 统一处理业务接口请求,包含登录态、业务错误和 WiFi 连接空响应兼容。
|
// 统一处理业务接口请求,包含登录态、业务错误和 WiFi 连接空响应兼容。
|
||||||
function request(method, url, data = {}, baseUrl = BASE_URL) {
|
function request(method, url, data = {}, baseUrl = BASE_URL) {
|
||||||
@@ -263,6 +264,15 @@ export const createPractiseAPI = (arrows, time, target) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const createPractiseV2API = (arrows, time, target, deviceId) => {
|
||||||
|
return request("POST", "/practice/create-v2", {
|
||||||
|
shootNumber: arrows,
|
||||||
|
shootTime: time,
|
||||||
|
targetType: Number(target || 1) * 20,
|
||||||
|
deviceId,
|
||||||
|
}, PRACTICE_BASE_URL);
|
||||||
|
};
|
||||||
|
|
||||||
export const startPractiseAPI = () => {
|
export const startPractiseAPI = () => {
|
||||||
return request("POST", "/user/practice/begin");
|
return request("POST", "/user/practice/begin");
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
const tabs = [
|
const tabs = [
|
||||||
{ image: "../static/tab-vip.png" },
|
{ image: "../static/tab-vip.png" },
|
||||||
{ image: "../static/tab-point-book.png" },
|
{ image: "https://static.shelingxingqiu.com/shootmini/static/tab-point-book.png" },
|
||||||
{ image: "../static/tab-mall.png" },
|
{ image: "https://static.shelingxingqiu.com/shootmini/static/tab-mall.png" },
|
||||||
];
|
];
|
||||||
|
|
||||||
function handleTabClick(index) {
|
function handleTabClick(index) {
|
||||||
@@ -26,7 +26,7 @@ function handleTabClick(index) {
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<view class="footer">
|
<view class="footer">
|
||||||
<image class="footer-bg" src="../static/tab-bg.png" mode="widthFix" />
|
<image class="footer-bg" src="https://static.shelingxingqiu.com/shootmini/static/tab-bg.png" mode="widthFix" />
|
||||||
<view
|
<view
|
||||||
v-for="(tab, index) in tabs"
|
v-for="(tab, index) in tabs"
|
||||||
:key="index"
|
:key="index"
|
||||||
|
|||||||
@@ -97,9 +97,9 @@ onBeforeUnmount(() => {
|
|||||||
class="back-to-game"
|
class="back-to-game"
|
||||||
@click="onClick"
|
@click="onClick"
|
||||||
>
|
>
|
||||||
<image src="../static/back-to-game-bg.png" mode="widthFix" />
|
<image src="https://static.shelingxingqiu.com/shootmini/static/back-to-game-bg.png" mode="widthFix" />
|
||||||
<block v-if="game.inBattle">
|
<block v-if="game.inBattle">
|
||||||
<image src="../static/pk-icon.png" mode="widthFix" />
|
<image src="https://static.shelingxingqiu.com/shootmini/static/pk-icon.png" mode="widthFix" />
|
||||||
<text>返回进行中的对局</text>
|
<text>返回进行中的对局</text>
|
||||||
</block>
|
</block>
|
||||||
<block v-else-if="game.roomID">
|
<block v-else-if="game.roomID">
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ const normalRounds = computed(() => {
|
|||||||
<template>
|
<template>
|
||||||
<view class="container">
|
<view class="container">
|
||||||
<view class="guide-row">
|
<view class="guide-row">
|
||||||
<image src="../static/shooter.png" mode="widthFix" />
|
<image src="https://static.shelingxingqiu.com/shootmini/static/shooter.png" mode="widthFix" />
|
||||||
<view
|
<view
|
||||||
:style="{
|
:style="{
|
||||||
marginBottom: '10px',
|
marginBottom: '10px',
|
||||||
@@ -42,7 +42,7 @@ const normalRounds = computed(() => {
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view>
|
||||||
<image src="../static/battle-header-melee.png" mode="widthFix" />
|
<image src="https://static.shelingxingqiu.com/shootmini/static/battle-header-melee.png" mode="widthFix" />
|
||||||
<text>蓝队({{ bluePoints }})</text>
|
<text>蓝队({{ bluePoints }})</text>
|
||||||
<text>红队({{ redPoints }})</text>
|
<text>红队({{ redPoints }})</text>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ const isMember = (player = {}) => player.vip === true || player.sVip === true;
|
|||||||
<view class="container" :style="{ paddingTop: showHeader ? '5px' : '0' }">
|
<view class="container" :style="{ paddingTop: showHeader ? '5px' : '0' }">
|
||||||
<image
|
<image
|
||||||
v-if="showHeader"
|
v-if="showHeader"
|
||||||
:src="`../static/battle-header${players.length ? '-melee' : ''}.png`"
|
:src="`https://static.shelingxingqiu.com/shootmini/static/battle-header${players.length ? '-melee' : ''}.png`"
|
||||||
mode="widthFix"
|
mode="widthFix"
|
||||||
/>
|
/>
|
||||||
<view
|
<view
|
||||||
|
|||||||
@@ -246,7 +246,7 @@ onBeforeUnmount(() => {
|
|||||||
>
|
>
|
||||||
<image
|
<image
|
||||||
class="shot-arrow"
|
class="shot-arrow"
|
||||||
src="../static/vip/svip-jian.png"
|
src="https://static.shelingxingqiu.com/shootmini/static/vip/svip-jian.png"
|
||||||
mode="heightFix"
|
mode="heightFix"
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
@@ -263,7 +263,7 @@ onBeforeUnmount(() => {
|
|||||||
<image
|
<image
|
||||||
:key="`crack-${animationKey}`"
|
:key="`crack-${animationKey}`"
|
||||||
class="shot-crack"
|
class="shot-crack"
|
||||||
src="../static/vip/svip-lie.png"
|
src="https://static.shelingxingqiu.com/shootmini/static/vip/svip-lie.png"
|
||||||
mode="aspectFit"
|
mode="aspectFit"
|
||||||
@animationend="handleCrackAnimationEnd"
|
@animationend="handleCrackAnimationEnd"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -505,7 +505,7 @@ onBeforeUnmount(() => {
|
|||||||
@impact="shakeTarget"
|
@impact="shakeTarget"
|
||||||
@complete="completeShotEffect"
|
@complete="completeShotEffect"
|
||||||
/>
|
/>
|
||||||
<image src="../static/bow-target.png" mode="widthFix" />
|
<image src="https://static.shelingxingqiu.com/shootmini/static/bow-target.png" mode="widthFix" />
|
||||||
</view>
|
</view>
|
||||||
<view class="footer">
|
<view class="footer">
|
||||||
<PointSwitcher
|
<PointSwitcher
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ const createRoom = debounce(async () => {
|
|||||||
<view class="container">
|
<view class="container">
|
||||||
<view class="target-options-header">
|
<view class="target-options-header">
|
||||||
<view class="target-options-header-line-left"></view>
|
<view class="target-options-header-line-left"></view>
|
||||||
<image class="target-options-header-title-img" src="../static/choose-battle-mode.png" mode="widthFix" />
|
<image class="target-options-header-title-img" src="https://static.shelingxingqiu.com/shootmini/static/choose-battle-mode.png" mode="widthFix" />
|
||||||
<view class="target-options-header-line-right"></view>
|
<view class="target-options-header-line-right"></view>
|
||||||
</view>
|
</view>
|
||||||
<view class="create-options">
|
<view class="create-options">
|
||||||
|
|||||||
@@ -12,13 +12,13 @@ defineProps({
|
|||||||
const bubbleTypes = [
|
const bubbleTypes = [
|
||||||
"../static/long-bubble.png",
|
"../static/long-bubble.png",
|
||||||
"../static/long-bubble-middle.png",
|
"../static/long-bubble-middle.png",
|
||||||
"../static/long-bubble-tall.png",
|
"https://static.shelingxingqiu.com/shootmini/static/long-bubble-tall.png",
|
||||||
];
|
];
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<view class="container">
|
<view class="container">
|
||||||
<image src="../static/shooter.png" mode="widthFix" />
|
<image src="https://static.shelingxingqiu.com/shootmini/static/shooter.png" mode="widthFix" />
|
||||||
<view>
|
<view>
|
||||||
<image
|
<image
|
||||||
v-if="!noBg"
|
v-if="!noBg"
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ onBeforeUnmount(() => {
|
|||||||
<template>
|
<template>
|
||||||
<view class="matching">
|
<view class="matching">
|
||||||
<image
|
<image
|
||||||
src="../static/matching-bg.png"
|
src="https://static.shelingxingqiu.com/shootmini/static/matching-bg.png"
|
||||||
mode="widthFix"
|
mode="widthFix"
|
||||||
class="matching-bg"
|
class="matching-bg"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -52,19 +52,19 @@ const handleConfirm = () => {
|
|||||||
<view class="modal-wrap scale-in">
|
<view class="modal-wrap scale-in">
|
||||||
<image
|
<image
|
||||||
class="dialog-light"
|
class="dialog-light"
|
||||||
src="../static/common/dialog-light.png"
|
src="https://static.shelingxingqiu.com/shootmini/static/common/dialog-light.png"
|
||||||
mode="widthFix"
|
mode="widthFix"
|
||||||
/>
|
/>
|
||||||
<image
|
<image
|
||||||
class="dialog-icon"
|
class="dialog-icon"
|
||||||
src="../static/common/dialog-icon.png"
|
src="https://static.shelingxingqiu.com/shootmini/static/common/dialog-icon.png"
|
||||||
mode="widthFix"
|
mode="widthFix"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<view class="dialog-panel">
|
<view class="dialog-panel">
|
||||||
<image
|
<image
|
||||||
class="dialog-bg"
|
class="dialog-bg"
|
||||||
src="../static/common/dialog-bg.png"
|
src="https://static.shelingxingqiu.com/shootmini/static/common/dialog-bg.png"
|
||||||
mode="scaleToFill"
|
mode="scaleToFill"
|
||||||
/>
|
/>
|
||||||
<view class="dialog-content">
|
<view class="dialog-content">
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ const seats = new Array(props.total).fill(1);
|
|||||||
<template>
|
<template>
|
||||||
<view class="players">
|
<view class="players">
|
||||||
<view v-for="(_, index) in seats" :key="index">
|
<view v-for="(_, index) in seats" :key="index">
|
||||||
<image src="../static/player-bg.png" mode="widthFix" />
|
<image src="https://static.shelingxingqiu.com/shootmini/static/player-bg.png" mode="widthFix" />
|
||||||
<view v-if="players[index] && players[index].name" class="avatar">
|
<view v-if="players[index] && players[index].name" class="avatar">
|
||||||
<Avatar
|
<Avatar
|
||||||
:src="players[index].avatar || '../static/user-icon.png'"
|
:src="players[index].avatar || '../static/user-icon.png'"
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ onMounted(() => {
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="right-part">
|
<view class="right-part">
|
||||||
<image src="../static/bow-target.png" mode="widthFix" />
|
<image src="https://static.shelingxingqiu.com/shootmini/static/bow-target.png" mode="widthFix" />
|
||||||
<view class="arrow-amount">
|
<view class="arrow-amount">
|
||||||
<text>{{ data.actualTotalRing }}</text>
|
<text>{{ data.actualTotalRing }}</text>
|
||||||
<text>/</text>
|
<text>/</text>
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ onMounted(async () => {
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<view class="container">
|
<view class="container">
|
||||||
<image src="../static/donate.png" mode="widthFix" />
|
<image src="https://static.shelingxingqiu.com/shootmini/static/donate.png" mode="widthFix" />
|
||||||
<text>感谢您对我们公益项目的支持!</text>
|
<text>感谢您对我们公益项目的支持!</text>
|
||||||
<view class="amounts">
|
<view class="amounts">
|
||||||
<button
|
<button
|
||||||
|
|||||||
@@ -26,8 +26,8 @@ const items = ref(new Array(props.total).fill(9));
|
|||||||
const width = ref(92);
|
const width = ref(92);
|
||||||
const itemWidth = ref(0);
|
const itemWidth = ref(0);
|
||||||
const bgImages = [
|
const bgImages = [
|
||||||
"../static/complete-light1.png",
|
"https://static.shelingxingqiu.com/shootmini/static/complete-light1.png",
|
||||||
"../static/complete-light2.png",
|
"https://static.shelingxingqiu.com/shootmini/static/complete-light2.png",
|
||||||
];
|
];
|
||||||
const bgIndex = ref(0);
|
const bgIndex = ref(0);
|
||||||
watch(
|
watch(
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ const openCoachComment = () => {
|
|||||||
<view class="container">
|
<view class="container">
|
||||||
<view :class="['container-header', showPanel ? 'scale-in' : 'scale-out']">
|
<view :class="['container-header', showPanel ? 'scale-in' : 'scale-out']">
|
||||||
<image :src="tipSrc" mode="widthFix" />
|
<image :src="tipSrc" mode="widthFix" />
|
||||||
<image src="../static/finish-frame.png" mode="widthFix" />
|
<image src="https://static.shelingxingqiu.com/shootmini/static/finish-frame.png" mode="widthFix" />
|
||||||
<text
|
<text
|
||||||
>完成<text class="gold-text">{{ validArrows }}</text
|
>完成<text class="gold-text">{{ validArrows }}</text
|
||||||
>箭,获得<text class="gold-text">{{ validArrows }}</text
|
>箭,获得<text class="gold-text">{{ validArrows }}</text
|
||||||
|
|||||||
@@ -27,22 +27,22 @@ const getContentHeight = () => {
|
|||||||
<view class="scale-in" :style="{ height: getContentHeight() }">
|
<view class="scale-in" :style="{ height: getContentHeight() }">
|
||||||
<image
|
<image
|
||||||
v-if="mode === 'normal'"
|
v-if="mode === 'normal'"
|
||||||
src="../static/screen-hint-bg.png"
|
src="https://static.shelingxingqiu.com/shootmini/static/screen-hint-bg.png"
|
||||||
mode="widthFix"
|
mode="widthFix"
|
||||||
/>
|
/>
|
||||||
<image
|
<image
|
||||||
v-if="mode === 'tall'"
|
v-if="mode === 'tall'"
|
||||||
src="../static/coach-comment.png"
|
src="https://static.shelingxingqiu.com/shootmini/static/coach-comment.png"
|
||||||
mode="widthFix"
|
mode="widthFix"
|
||||||
/>
|
/>
|
||||||
<image
|
<image
|
||||||
v-if="mode === 'square'"
|
v-if="mode === 'square'"
|
||||||
src="../static/prompt-bg-square.png"
|
src="https://static.shelingxingqiu.com/shootmini/static/prompt-bg-square.png"
|
||||||
mode="widthFix"
|
mode="widthFix"
|
||||||
/>
|
/>
|
||||||
<image
|
<image
|
||||||
v-if="mode === 'small'"
|
v-if="mode === 'small'"
|
||||||
src="../static/finish-frame.png"
|
src="https://static.shelingxingqiu.com/shootmini/static/finish-frame.png"
|
||||||
mode="widthFix"
|
mode="widthFix"
|
||||||
/>
|
/>
|
||||||
<slot />
|
<slot />
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ const props = defineProps({
|
|||||||
<template>
|
<template>
|
||||||
<view class="container" :style="{ display: show ? 'flex' : 'none' }">
|
<view class="container" :style="{ display: show ? 'flex' : 'none' }">
|
||||||
<view class="scale-in">
|
<view class="scale-in">
|
||||||
<image src="../static/point-book-tip-bg.png" mode="widthFix" />
|
<image src="https://static.shelingxingqiu.com/shootmini/static/point-book-tip-bg.png" mode="widthFix" />
|
||||||
<slot />
|
<slot />
|
||||||
</view>
|
</view>
|
||||||
<IconButton
|
<IconButton
|
||||||
|
|||||||
@@ -191,7 +191,7 @@ onBeforeUnmount(() => {
|
|||||||
<template>
|
<template>
|
||||||
<view class="container" :style="{ display: show ? 'block' : 'none' }">
|
<view class="container" :style="{ display: show ? 'block' : 'none' }">
|
||||||
<view>
|
<view>
|
||||||
<image src="../static/shooter.png" mode="widthFix" />
|
<image src="https://static.shelingxingqiu.com/shootmini/static/shooter.png" mode="widthFix" />
|
||||||
<text>{{ tipContent }}</text>
|
<text>{{ tipContent }}</text>
|
||||||
<button hover-class="none" @click="updateSound">
|
<button hover-class="none" @click="updateSound">
|
||||||
<image
|
<image
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ onBeforeUnmount(() => {
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="isBattle" class="ready-timer">
|
<view v-if="isBattle" class="ready-timer">
|
||||||
<image src="../static/test-tip.png" mode="widthFix" />
|
<image src="https://static.shelingxingqiu.com/shootmini/static/test-tip.png" mode="widthFix" />
|
||||||
<view v-if="count >= 0">
|
<view v-if="count >= 0">
|
||||||
<text>具体正式比赛还有</text>
|
<text>具体正式比赛还有</text>
|
||||||
<text>{{ count }}</text>
|
<text>{{ count }}</text>
|
||||||
|
|||||||
@@ -54,23 +54,23 @@ onBeforeUnmount(() => {
|
|||||||
<view v-if="showRank" class="up-rank">
|
<view v-if="showRank" class="up-rank">
|
||||||
<image :src="user.avatar || '../static/user-icon.png'" mode="widthFix" />
|
<image :src="user.avatar || '../static/user-icon.png'" mode="widthFix" />
|
||||||
<image :src="nextRankImage" mode="widthFix" />
|
<image :src="nextRankImage" mode="widthFix" />
|
||||||
<image class="bg-effect" src="../static/shining-bg.png" mode="widthFix" />
|
<image class="bg-effect" src="https://static.shelingxingqiu.com/shootmini/static/shining-bg.png" mode="widthFix" />
|
||||||
<image
|
<image
|
||||||
class="bg-effect"
|
class="bg-effect"
|
||||||
src="../static/gold-shining.png"
|
src="https://static.shelingxingqiu.com/shootmini/static/gold-shining.png"
|
||||||
mode="widthFix"
|
mode="widthFix"
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="showGrade" class="up-grade">
|
<view v-if="showGrade" class="up-grade">
|
||||||
<image
|
<image
|
||||||
class="scale-in"
|
class="scale-in"
|
||||||
src="../static/user-upgrade.png"
|
src="https://static.shelingxingqiu.com/shootmini/static/user-upgrade.png"
|
||||||
mode="widthFix"
|
mode="widthFix"
|
||||||
/>
|
/>
|
||||||
<image class="bg-effect" src="../static/shining-bg.png" mode="widthFix" />
|
<image class="bg-effect" src="https://static.shelingxingqiu.com/shootmini/static/shining-bg.png" mode="widthFix" />
|
||||||
<image
|
<image
|
||||||
class="bg-effect"
|
class="bg-effect"
|
||||||
src="../static/gold-shining.png"
|
src="https://static.shelingxingqiu.com/shootmini/static/gold-shining.png"
|
||||||
mode="widthFix"
|
mode="widthFix"
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -53,6 +53,242 @@
|
|||||||
"quickapp" : {},
|
"quickapp" : {},
|
||||||
"mp-weixin" : {
|
"mp-weixin" : {
|
||||||
"appid" : "wxa8f5989dcd45cc23",
|
"appid" : "wxa8f5989dcd45cc23",
|
||||||
|
"packOptions" : {
|
||||||
|
"ignore" : [
|
||||||
|
{
|
||||||
|
"type" : "file",
|
||||||
|
"value" : "static/common/dialog-light.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type" : "file",
|
||||||
|
"value" : "static/common/dialog-bg.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type" : "file",
|
||||||
|
"value" : "static/common/dialog-icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type" : "file",
|
||||||
|
"value" : "static/prompt-bg-square.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type" : "file",
|
||||||
|
"value" : "static/coach-comment.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type" : "file",
|
||||||
|
"value" : "static/screen-hint-bg.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type" : "file",
|
||||||
|
"value" : "static/red-team-win.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type" : "file",
|
||||||
|
"value" : "static/blue-team-win.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type" : "file",
|
||||||
|
"value" : "static/my-grow.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type" : "file",
|
||||||
|
"value" : "static/gold-shining.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type" : "file",
|
||||||
|
"value" : "static/bow-target.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type" : "file",
|
||||||
|
"value" : "static/matching-bg.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type" : "file",
|
||||||
|
"value" : "static/versus.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type" : "file",
|
||||||
|
"value" : "static/point-champion.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type" : "file",
|
||||||
|
"value" : "static/my-practise.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type" : "file",
|
||||||
|
"value" : "static/shining-bg.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type" : "file",
|
||||||
|
"value" : "static/donate.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type" : "file",
|
||||||
|
"value" : "static/friend-battle.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type" : "file",
|
||||||
|
"value" : "static/user-upgrade.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type" : "file",
|
||||||
|
"value" : "static/finish-frame.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type" : "file",
|
||||||
|
"value" : "static/vip/svip-jian.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type" : "file",
|
||||||
|
"value" : "static/battle-header.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type" : "file",
|
||||||
|
"value" : "static/battle-header-melee.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type" : "file",
|
||||||
|
"value" : "static/player-bg.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type" : "file",
|
||||||
|
"value" : "static/mvp-blue.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type" : "file",
|
||||||
|
"value" : "static/finish-tip.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type" : "file",
|
||||||
|
"value" : "static/2unfinish-tip.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type" : "file",
|
||||||
|
"value" : "static/have-no-device.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type" : "file",
|
||||||
|
"value" : "static/device-icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type" : "file",
|
||||||
|
"value" : "static/unfinish-tip.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type" : "file",
|
||||||
|
"value" : "static/test-tip.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type" : "file",
|
||||||
|
"value" : "static/mvp-red.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type" : "file",
|
||||||
|
"value" : "static/vip/svip-lie.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type" : "file",
|
||||||
|
"value" : "static/mvp-tip.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type" : "file",
|
||||||
|
"value" : "static/rank/battle-choose.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type" : "file",
|
||||||
|
"value" : "static/back-to-game-bg.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type" : "file",
|
||||||
|
"value" : "static/complete-light1.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type" : "file",
|
||||||
|
"value" : "static/complete-light2.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type" : "file",
|
||||||
|
"value" : "static/title-2v2.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type" : "file",
|
||||||
|
"value" : "static/tab-bg.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type" : "file",
|
||||||
|
"value" : "static/scan.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type" : "file",
|
||||||
|
"value" : "static/choose-battle-mode.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type" : "file",
|
||||||
|
"value" : "static/shooter.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type" : "file",
|
||||||
|
"value" : "static/my-growth.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type" : "file",
|
||||||
|
"value" : "static/juezhanbang.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type" : "file",
|
||||||
|
"value" : "static/title-3v3.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type" : "file",
|
||||||
|
"value" : "static/point-book-tip-bg.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type" : "file",
|
||||||
|
"value" : "static/reward-us.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type" : "file",
|
||||||
|
"value" : "static/rank/star.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type" : "file",
|
||||||
|
"value" : "static/tab-point-book.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type" : "file",
|
||||||
|
"value" : "static/pk-icon.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type" : "file",
|
||||||
|
"value" : "static/first-try.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type" : "file",
|
||||||
|
"value" : "static/row-yellow-bg.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type" : "file",
|
||||||
|
"value" : "static/room-notfound-title.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type" : "file",
|
||||||
|
"value" : "static/title-mvp.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type" : "file",
|
||||||
|
"value" : "static/long-bubble-tall.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type" : "file",
|
||||||
|
"value" : "static/battle-result.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type" : "file",
|
||||||
|
"value" : "static/tab-mall.png"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
"setting" : {
|
"setting" : {
|
||||||
"urlCheck" : false,
|
"urlCheck" : false,
|
||||||
"minified" : true,
|
"minified" : true,
|
||||||
|
|||||||
+30
-1
@@ -42,6 +42,7 @@ const BUSINESS_TYPE_BY_SERVER_TYPE = {
|
|||||||
[ServerMessageType.SERVER_MSG_TIMEOUT]: MESSAGETYPESV2.BattleEnd,
|
[ServerMessageType.SERVER_MSG_TIMEOUT]: MESSAGETYPESV2.BattleEnd,
|
||||||
[ServerMessageType.SERVER_MSG_CHECK]: MESSAGETYPESV2.TestDistance,
|
[ServerMessageType.SERVER_MSG_CHECK]: MESSAGETYPESV2.TestDistance,
|
||||||
[ServerMessageType.SERVER_MSG_NOT_ENOUGH_DISTANCE]: MESSAGETYPESV2.InvalidShot,
|
[ServerMessageType.SERVER_MSG_NOT_ENOUGH_DISTANCE]: MESSAGETYPESV2.InvalidShot,
|
||||||
|
[ServerMessageType.SERVER_MSG_PRACTICE_END]: MESSAGETYPESV2.BattleEnd,
|
||||||
};
|
};
|
||||||
|
|
||||||
const MATCH_READY_SNAPSHOT_PREFIX = "match-ready-snapshot:";
|
const MATCH_READY_SNAPSHOT_PREFIX = "match-ready-snapshot:";
|
||||||
@@ -57,27 +58,53 @@ function normalizeShootData(shootData) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 兼容普通接口通知的 camelCase 和 protobuf 解码后的 snake_case。
|
// 兼容普通接口通知的 camelCase 和 protobuf 解码后的 snake_case。
|
||||||
|
function normalizePracticeInfo(practiceInfo = {}) {
|
||||||
|
if (!practiceInfo || typeof practiceInfo !== "object") return {};
|
||||||
|
|
||||||
|
const normalized = normalizePlainObject(practiceInfo);
|
||||||
|
if (practiceInfo.shoot_data || normalized.shootData) {
|
||||||
|
normalized.shootData = normalizeShootData(
|
||||||
|
normalizePlainObject(practiceInfo.shoot_data || normalized.shootData)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (Array.isArray(practiceInfo.details || normalized.details)) {
|
||||||
|
normalized.details = (practiceInfo.details || normalized.details)
|
||||||
|
.map(normalizePlainObject)
|
||||||
|
.map(normalizeShootData);
|
||||||
|
}
|
||||||
|
|
||||||
|
return normalized;
|
||||||
|
}
|
||||||
|
|
||||||
function buildBusinessMessage(message) {
|
function buildBusinessMessage(message) {
|
||||||
const businessType = BUSINESS_TYPE_BY_SERVER_TYPE[message.type];
|
const businessType = BUSINESS_TYPE_BY_SERVER_TYPE[message.type];
|
||||||
if (!businessType) return null;
|
if (!businessType) return null;
|
||||||
|
|
||||||
const matchInfo = normalizeMatchInfo(message.match_info);
|
const matchInfo = normalizeMatchInfo(message.match_info);
|
||||||
|
const practiceInfo = normalizePracticeInfo(message.practice_info);
|
||||||
const matchId = normalizeId(
|
const matchId = normalizeId(
|
||||||
pickField(message, "matchId", "match_id") ||
|
pickField(message, "matchId", "match_id") ||
|
||||||
matchInfo.matchId ||
|
matchInfo.matchId ||
|
||||||
|
practiceInfo.id ||
|
||||||
currentContext?.matchId
|
currentContext?.matchId
|
||||||
);
|
);
|
||||||
const shootData = normalizeShootData(
|
const shootData = normalizeShootData(
|
||||||
matchInfo.shootData ||
|
matchInfo.shootData ||
|
||||||
|
practiceInfo.shootData ||
|
||||||
(message.shoot_data ? normalizePlainObject(message.shoot_data) : undefined)
|
(message.shoot_data ? normalizePlainObject(message.shoot_data) : undefined)
|
||||||
);
|
);
|
||||||
|
const details = Array.isArray(practiceInfo.details)
|
||||||
|
? practiceInfo.details
|
||||||
|
: matchInfo.details;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...matchInfo,
|
...matchInfo,
|
||||||
|
...practiceInfo,
|
||||||
type: businessType,
|
type: businessType,
|
||||||
id: matchId,
|
id: matchId,
|
||||||
matchId,
|
matchId,
|
||||||
shootData,
|
shootData,
|
||||||
|
details,
|
||||||
sequence: message.sequence,
|
sequence: message.sequence,
|
||||||
timestamp: message.timestamp,
|
timestamp: message.timestamp,
|
||||||
matchWsType: message.type,
|
matchWsType: message.type,
|
||||||
@@ -230,6 +257,7 @@ function getAckAudioKeys(message, businessMessage) {
|
|||||||
return getShootResultAudioKeys(businessMessage?.shootData);
|
return getShootResultAudioKeys(businessMessage?.shootData);
|
||||||
case ServerMessageType.SERVER_MSG_MATCH_END:
|
case ServerMessageType.SERVER_MSG_MATCH_END:
|
||||||
case ServerMessageType.SERVER_MSG_TIMEOUT:
|
case ServerMessageType.SERVER_MSG_TIMEOUT:
|
||||||
|
case ServerMessageType.SERVER_MSG_PRACTICE_END:
|
||||||
return ["比赛结束"];
|
return ["比赛结束"];
|
||||||
case ServerMessageType.SERVER_MSG_CHECK:
|
case ServerMessageType.SERVER_MSG_CHECK:
|
||||||
return getTestDistanceAudioKeys(businessMessage?.shootData);
|
return getTestDistanceAudioKeys(businessMessage?.shootData);
|
||||||
@@ -243,7 +271,8 @@ function getAckAudioKeys(message, businessMessage) {
|
|||||||
function shouldCloseAfterAck(message) {
|
function shouldCloseAfterAck(message) {
|
||||||
return (
|
return (
|
||||||
message.type === ServerMessageType.SERVER_MSG_MATCH_END ||
|
message.type === ServerMessageType.SERVER_MSG_MATCH_END ||
|
||||||
message.type === ServerMessageType.SERVER_MSG_TIMEOUT
|
message.type === ServerMessageType.SERVER_MSG_TIMEOUT ||
|
||||||
|
message.type === ServerMessageType.SERVER_MSG_PRACTICE_END
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+33
-22
@@ -30,9 +30,6 @@
|
|||||||
"navigationBarTitleText": ""
|
"navigationBarTitleText": ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"path": "pages/team-battle/index"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"path": "pages/melee-battle"
|
"path": "pages/melee-battle"
|
||||||
},
|
},
|
||||||
@@ -69,21 +66,6 @@
|
|||||||
{
|
{
|
||||||
"path": "pages/user"
|
"path": "pages/user"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"path": "pages/member/orders"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/member/order-detail"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/member/be-vip"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/member/vip-intro"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/member/agreement"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"path": "pages/grade-intro"
|
"path": "pages/grade-intro"
|
||||||
},
|
},
|
||||||
@@ -117,9 +99,6 @@
|
|||||||
{
|
{
|
||||||
"path": "pages/match-detail"
|
"path": "pages/match-detail"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"path": "pages/team-battle/team-bow-data"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"path": "pages/melee-bow-data"
|
"path": "pages/melee-bow-data"
|
||||||
},
|
},
|
||||||
@@ -150,5 +129,37 @@
|
|||||||
"^uni-(.*)": "@dcloudio/uni-ui/lib/uni-$1/uni-$1.vue"
|
"^uni-(.*)": "@dcloudio/uni-ui/lib/uni-$1/uni-$1.vue"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"subPackages": []
|
"subPackages": [
|
||||||
|
{
|
||||||
|
"root": "pages/member",
|
||||||
|
"pages": [
|
||||||
|
{
|
||||||
|
"path": "orders"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "order-detail"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "be-vip"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "vip-intro"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "agreement"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"root": "pages/team-battle",
|
||||||
|
"pages": [
|
||||||
|
{
|
||||||
|
"path": "index"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "team-bow-data"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ const checkBowData = () => {
|
|||||||
<view class="container">
|
<view class="container">
|
||||||
<block v-if="data.mode <= 3">
|
<block v-if="data.mode <= 3">
|
||||||
<view class="header-team" :style="{ marginTop: '25%' }">
|
<view class="header-team" :style="{ marginTop: '25%' }">
|
||||||
<image src="../static/battle-result.png" mode="widthFix" />
|
<image src="https://static.shelingxingqiu.com/shootmini/static/battle-result.png" mode="widthFix" />
|
||||||
<view class="header-solo" v-if="data.mode === 1">
|
<view class="header-solo" v-if="data.mode === 1">
|
||||||
<text
|
<text
|
||||||
:style="{
|
:style="{
|
||||||
@@ -107,7 +107,7 @@ const checkBowData = () => {
|
|||||||
</view>
|
</view>
|
||||||
<view class="header-mvp" v-if="data.mode === 2 || data.mode === 3">
|
<view class="header-mvp" v-if="data.mode === 2 || data.mode === 3">
|
||||||
<image
|
<image
|
||||||
:src="`../static/${data.winTeam === 1 ? 'blue' : 'red'}-team-win.png`"
|
:src="`https://static.shelingxingqiu.com/shootmini/static/${data.winTeam === 1 ? 'blue' : 'red'}-team-win.png`"
|
||||||
mode="widthFix"
|
mode="widthFix"
|
||||||
/>
|
/>
|
||||||
<view
|
<view
|
||||||
@@ -118,7 +118,7 @@ const checkBowData = () => {
|
|||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<view v-if="data.mvp && data.mvp.totalRings">
|
<view v-if="data.mvp && data.mvp.totalRings">
|
||||||
<image src="../static/title-mvp.png" mode="widthFix" />
|
<image src="https://static.shelingxingqiu.com/shootmini/static/title-mvp.png" mode="widthFix" />
|
||||||
<text
|
<text
|
||||||
>斩获<text
|
>斩获<text
|
||||||
:style="{
|
:style="{
|
||||||
@@ -153,7 +153,7 @@ const checkBowData = () => {
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="battle-winner">
|
<view class="battle-winner">
|
||||||
<image src="../static/shining-bg.png" mode="widthFix" />
|
<image src="https://static.shelingxingqiu.com/shootmini/static/shining-bg.png" mode="widthFix" />
|
||||||
<image
|
<image
|
||||||
:src="ifWin ? '../static/you-win.png' : '../static/you-lost.png'"
|
:src="ifWin ? '../static/you-win.png' : '../static/you-lost.png'"
|
||||||
mode="widthFix"
|
mode="widthFix"
|
||||||
@@ -173,7 +173,7 @@ const checkBowData = () => {
|
|||||||
<block v-else>
|
<block v-else>
|
||||||
<view class="header-melee">
|
<view class="header-melee">
|
||||||
<view />
|
<view />
|
||||||
<image src="../static/battle-result.png" mode="widthFix" />
|
<image src="https://static.shelingxingqiu.com/shootmini/static/battle-result.png" mode="widthFix" />
|
||||||
<view />
|
<view />
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view
|
||||||
@@ -248,7 +248,7 @@ const checkBowData = () => {
|
|||||||
class="battle-e"
|
class="battle-e"
|
||||||
:style="{ marginTop: data.mode > 3 ? '20px' : '20vw' }"
|
:style="{ marginTop: data.mode > 3 ? '20px' : '20vw' }"
|
||||||
>
|
>
|
||||||
<image src="../static/row-yellow-bg.png" mode="widthFix" />
|
<image src="https://static.shelingxingqiu.com/shootmini/static/row-yellow-bg.png" mode="widthFix" />
|
||||||
<view class="team-avatar">
|
<view class="team-avatar">
|
||||||
<Avatar
|
<Avatar
|
||||||
:src="user.avatar"
|
:src="user.avatar"
|
||||||
|
|||||||
@@ -400,7 +400,7 @@ onBeforeUnmount(() => {
|
|||||||
<view v-else class="no-player" :style="{ transform: 'translateY(-60px)' }">
|
<view v-else class="no-player" :style="{ transform: 'translateY(-60px)' }">
|
||||||
<image src="../static/question-mark.png" mode="widthFix" />
|
<image src="../static/question-mark.png" mode="widthFix" />
|
||||||
</view>
|
</view>
|
||||||
<image src="../static/versus.png" mode="widthFix" />
|
<image src="https://static.shelingxingqiu.com/shootmini/static/versus.png" mode="widthFix" />
|
||||||
<view v-if="opponent.id" class="player" :style="{ transform: 'translateY(60px)' }">
|
<view v-if="opponent.id" class="player" :style="{ transform: 'translateY(60px)' }">
|
||||||
<Avatar :src="opponent.avatar" :size="60" />
|
<Avatar :src="opponent.avatar" :size="60" />
|
||||||
<text class="ready" :style="{ opacity: opponent.ready ? 1 : 0 }">
|
<text class="ready" :style="{ opacity: opponent.ready ? 1 : 0 }">
|
||||||
@@ -420,8 +420,8 @@ onBeforeUnmount(() => {
|
|||||||
<block v-if="room.battleType === 1 && room.count >= 4">
|
<block v-if="room.battleType === 1 && room.count >= 4">
|
||||||
<view class="all-players">
|
<view class="all-players">
|
||||||
<image src="https://static.shelingxingqiu.com/attachment/2025-08-13/dc0x1p59iab6cvbhqc.png" mode="widthFix" />
|
<image src="https://static.shelingxingqiu.com/attachment/2025-08-13/dc0x1p59iab6cvbhqc.png" mode="widthFix" />
|
||||||
<image v-if="room.count === 4" src="../static/title-2v2.png" mode="widthFix" />
|
<image v-if="room.count === 4" src="https://static.shelingxingqiu.com/shootmini/static/title-2v2.png" mode="widthFix" />
|
||||||
<image v-if="room.count === 6" src="../static/title-3v3.png" mode="widthFix" />
|
<image v-if="room.count === 6" src="https://static.shelingxingqiu.com/shootmini/static/title-3v3.png" mode="widthFix" />
|
||||||
<view>
|
<view>
|
||||||
<view v-for="(item, index) in players" :key="index">
|
<view v-for="(item, index) in players" :key="index">
|
||||||
<Avatar v-if="item.id" :src="item.avatar" :size="36" />
|
<Avatar v-if="item.id" :src="item.avatar" :size="36" />
|
||||||
|
|||||||
+45
-21
@@ -15,19 +15,18 @@ import BubbleTip from "@/components/BubbleTip.vue";
|
|||||||
import audioManager from "@/audioManager";
|
import audioManager from "@/audioManager";
|
||||||
import {
|
import {
|
||||||
createPractiseAPI,
|
createPractiseAPI,
|
||||||
startPractiseAPI,
|
|
||||||
endPractiseAPI,
|
|
||||||
getPractiseAPI,
|
getPractiseAPI,
|
||||||
laserAimAPI,
|
laserAimAPI,
|
||||||
laserCloseAPI,
|
laserCloseAPI,
|
||||||
} from "@/apis";
|
} from "@/apis";
|
||||||
|
import { connectMatchWebSocket, closeMatchWebSocket } from "@/matchWebsocket";
|
||||||
import { sharePractiseData } from "@/canvas";
|
import { sharePractiseData } from "@/canvas";
|
||||||
import { wxShare, debounce } from "@/util";
|
import { wxShare, debounce } from "@/util";
|
||||||
import { MESSAGETYPESV2 } from "@/constants";
|
import { MESSAGETYPESV2 } from "@/constants";
|
||||||
import useStore from "@/store";
|
import useStore from "@/store";
|
||||||
import { storeToRefs } from "pinia";
|
import { storeToRefs } from "pinia";
|
||||||
const store = useStore();
|
const store = useStore();
|
||||||
const { user } = storeToRefs(store);
|
const { user, device } = storeToRefs(store);
|
||||||
const scores = ref([]);
|
const scores = ref([]);
|
||||||
const isSvip = ref(false);
|
const isSvip = ref(false);
|
||||||
const step = ref(0);
|
const step = ref(0);
|
||||||
@@ -50,6 +49,7 @@ const showGuide = ref(false);
|
|||||||
const laserActive = ref(false);
|
const laserActive = ref(false);
|
||||||
const guideSwiperIndex = ref(0);
|
const guideSwiperIndex = ref(0);
|
||||||
const sharing = ref(false);
|
const sharing = ref(false);
|
||||||
|
const RESULT_TIP_CDN = "https://static.shelingxingqiu.com/shootmini/static";
|
||||||
|
|
||||||
const guideImages = [
|
const guideImages = [
|
||||||
"https://static.shelingxingqiu.com/shootmini/static/target.png",
|
"https://static.shelingxingqiu.com/shootmini/static/target.png",
|
||||||
@@ -104,21 +104,42 @@ const closeCalibrationLaser = async () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const createPractise = async (arrows) => {
|
const createPractise = async (arrows) => {
|
||||||
const result = await createPractiseAPI(arrows, 1);
|
closeMatchWebSocket({ reason: "practice-recreate" });
|
||||||
|
const result = await createPractiseAPI(
|
||||||
|
arrows,
|
||||||
|
120,
|
||||||
|
1,
|
||||||
|
device.value.deviceId
|
||||||
|
);
|
||||||
if (result) practiseId.value = result.id;
|
if (result) practiseId.value = result.id;
|
||||||
|
if (!result?.serverAddr) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "练习连接信息异常,请重试",
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
connectMatchWebSocket({
|
||||||
|
serverAddr: result.serverAddr,
|
||||||
|
matchId: result.id,
|
||||||
|
userId: user.value.id,
|
||||||
|
});
|
||||||
|
return result;
|
||||||
};
|
};
|
||||||
|
|
||||||
const onOver = async () => {
|
const onOver = async (message) => {
|
||||||
practiseResult.value = await getPractiseAPI(practiseId.value);
|
practiseResult.value = Array.isArray(message?.details)
|
||||||
|
? message
|
||||||
|
: await getPractiseAPI(practiseId.value);
|
||||||
start.value = false;
|
start.value = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
async function onReceiveMessage(msg) {
|
async function onReceiveMessage(msg) {
|
||||||
if (msg.type === MESSAGETYPESV2.ShootResult) {
|
if (msg.type === MESSAGETYPESV2.ShootResult) {
|
||||||
isSvip.value = msg.sVip === true;
|
isSvip.value = msg.sVip === true;
|
||||||
scores.value = msg.details;
|
scores.value = Array.isArray(msg.details) ? msg.details : scores.value;
|
||||||
} else if (msg.type === MESSAGETYPESV2.BattleEnd) {
|
} else if (msg.type === MESSAGETYPESV2.BattleEnd) {
|
||||||
setTimeout(onOver, 1500);
|
setTimeout(() => onOver(msg), 1500);
|
||||||
} else if (msg.type === MESSAGETYPESV2.TestDistance && step.value === 3) {
|
} else if (msg.type === MESSAGETYPESV2.TestDistance && step.value === 3) {
|
||||||
if (msg.shootData.distance / 100 >= 5) {
|
if (msg.shootData.distance / 100 >= 5) {
|
||||||
audioManager.play("距离合格");
|
audioManager.play("距离合格");
|
||||||
@@ -173,7 +194,7 @@ onBeforeUnmount(async () => {
|
|||||||
uni.$off("share-image", onClickShare);
|
uni.$off("share-image", onClickShare);
|
||||||
await closeCalibrationLaser();
|
await closeCalibrationLaser();
|
||||||
audioManager.stopAll();
|
audioManager.stopAll();
|
||||||
endPractiseAPI();
|
closeMatchWebSocket({ reason: "practice-leave" });
|
||||||
});
|
});
|
||||||
|
|
||||||
const nextStep = async () => {
|
const nextStep = async () => {
|
||||||
@@ -196,15 +217,18 @@ const nextStep = async () => {
|
|||||||
btnDisabled.value = true;
|
btnDisabled.value = true;
|
||||||
step.value = 3;
|
step.value = 3;
|
||||||
title.value = "-感知距离";
|
title.value = "-感知距离";
|
||||||
const result = await createPractiseAPI(total, 120);
|
const result = await createPractise(total);
|
||||||
if (result) practiseId.value = result.id;
|
if (!result) {
|
||||||
|
btnDisabled.value = false;
|
||||||
|
step.value = 2;
|
||||||
|
return;
|
||||||
|
}
|
||||||
} else if (step.value === 3) {
|
} else if (step.value === 3) {
|
||||||
showGuide.value = false;
|
showGuide.value = false;
|
||||||
step.value = 4;
|
step.value = 4;
|
||||||
title.value = "-小试牛刀";
|
title.value = "-小试牛刀";
|
||||||
} else if (step.value === 4) {
|
} else if (step.value === 4) {
|
||||||
title.value = "小试牛刀";
|
title.value = "小试牛刀";
|
||||||
await startPractiseAPI();
|
|
||||||
scores.value = [];
|
scores.value = [];
|
||||||
isSvip.value = false;
|
isSvip.value = false;
|
||||||
step.value = 5;
|
step.value = 5;
|
||||||
@@ -235,10 +259,16 @@ const onClose = async () => {
|
|||||||
scores.value = [];
|
scores.value = [];
|
||||||
isSvip.value = false;
|
isSvip.value = false;
|
||||||
step.value = 4;
|
step.value = 4;
|
||||||
const result = await createPractiseAPI(total, 120);
|
await createPractise(total);
|
||||||
if (result) practiseId.value = result.id;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const getResultTipSrc = (result = {}) => {
|
||||||
|
const validCount = (result.details || []).filter(
|
||||||
|
(arrow) => arrow.x !== -30 && arrow.y !== -30
|
||||||
|
).length;
|
||||||
|
return `${RESULT_TIP_CDN}/${validCount < total ? "un" : ""}finish-tip.png`;
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -361,13 +391,7 @@ const onClose = async () => {
|
|||||||
:total="total"
|
:total="total"
|
||||||
:onClose="onClose"
|
:onClose="onClose"
|
||||||
:result="practiseResult"
|
:result="practiseResult"
|
||||||
:tipSrc="`../static/${
|
:tipSrc="getResultTipSrc(practiseResult)"
|
||||||
practiseResult.details.filter(
|
|
||||||
(arrow) => arrow.x !== -30 && arrow.y !== -30
|
|
||||||
).length < total
|
|
||||||
? 'un'
|
|
||||||
: ''
|
|
||||||
}finish-tip.png`"
|
|
||||||
/>
|
/>
|
||||||
<canvas class="share-canvas" id="shareCanvas" type="2d"></canvas>
|
<canvas class="share-canvas" id="shareCanvas" type="2d"></canvas>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -404,12 +404,12 @@ function goBack() {
|
|||||||
<!-- 背景图:蓝队用 mvp-blue.png,红队用 mvp-red.png(平行四边形渐变切图) -->
|
<!-- 背景图:蓝队用 mvp-blue.png,红队用 mvp-red.png(平行四边形渐变切图) -->
|
||||||
<image
|
<image
|
||||||
class="mvp-bg"
|
class="mvp-bg"
|
||||||
:src="mvpTeam === 1 ? '../static/mvp-blue.png' : '../static/mvp-red.png'"
|
:src="mvpTeam === 1 ? 'https://static.shelingxingqiu.com/shootmini/static/mvp-blue.png' : 'https://static.shelingxingqiu.com/shootmini/static/mvp-red.png'"
|
||||||
mode="scaleToFill"
|
mode="scaleToFill"
|
||||||
/>
|
/>
|
||||||
<!-- 左:MVP 标题图 + 斩获环数 -->
|
<!-- 左:MVP 标题图 + 斩获环数 -->
|
||||||
<view class="mvp-info">
|
<view class="mvp-info">
|
||||||
<image class="mvp-badge" src="../static/mvp-tip.png" mode="widthFix" />
|
<image class="mvp-badge" src="https://static.shelingxingqiu.com/shootmini/static/mvp-tip.png" mode="widthFix" />
|
||||||
<view class="mvp-rings">
|
<view class="mvp-rings">
|
||||||
斩获<text class="mvp-rings-num">{{ mvpPlayer.totalRing }}</text>环
|
斩获<text class="mvp-rings-num">{{ mvpPlayer.totalRing }}</text>环
|
||||||
</view>
|
</view>
|
||||||
@@ -439,7 +439,7 @@ function goBack() {
|
|||||||
<!-- 本场战绩标题:装饰横线 + 标题图 + 装饰横线 -->
|
<!-- 本场战绩标题:装饰横线 + 标题图 + 装饰横线 -->
|
||||||
<view class="melee-title">
|
<view class="melee-title">
|
||||||
<view class="melee-title-line" />
|
<view class="melee-title-line" />
|
||||||
<image class="melee-title-img" src="../static/battle-result.png" mode="scaleToFill" />
|
<image class="melee-title-img" src="https://static.shelingxingqiu.com/shootmini/static/battle-result.png" mode="scaleToFill" />
|
||||||
<view class="melee-title-line" />
|
<view class="melee-title-line" />
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|||||||
@@ -209,10 +209,10 @@ onLoad(async (options) => {
|
|||||||
</view>
|
</view>
|
||||||
<view class="create-room">
|
<view class="create-room">
|
||||||
<image src="https://static.shelingxingqiu.com/attachment/2025-07-15/dbcejys872iyun92h6.png" mode="widthFix" />
|
<image src="https://static.shelingxingqiu.com/attachment/2025-07-15/dbcejys872iyun92h6.png" mode="widthFix" />
|
||||||
<image src="../static/room-notfound-title.png" mode="widthFix" />
|
<image src="https://static.shelingxingqiu.com/shootmini/static/room-notfound-title.png" mode="widthFix" />
|
||||||
<view>
|
<view>
|
||||||
<image :src="user.avatar" mode="widthFix" />
|
<image :src="user.avatar" mode="widthFix" />
|
||||||
<image src="../static/versus.png" mode="widthFix" />
|
<image src="https://static.shelingxingqiu.com/shootmini/static/versus.png" mode="widthFix" />
|
||||||
<view>
|
<view>
|
||||||
<image src="../static/question-mark.png" mode="widthFix" />
|
<image src="../static/question-mark.png" mode="widthFix" />
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
+5
-5
@@ -423,7 +423,7 @@ onShareTimeline(() => {
|
|||||||
<text v-else-if="online">设备在线</text>
|
<text v-else-if="online">设备在线</text>
|
||||||
</block>
|
</block>
|
||||||
<image
|
<image
|
||||||
src="../static/first-try.png"
|
src="https://static.shelingxingqiu.com/shootmini/static/first-try.png"
|
||||||
mode="widthFix"
|
mode="widthFix"
|
||||||
@click="() => toPage('/pages/first-try')"
|
@click="() => toPage('/pages/first-try')"
|
||||||
/>
|
/>
|
||||||
@@ -434,10 +434,10 @@ onShareTimeline(() => {
|
|||||||
</view>
|
</view>
|
||||||
<view class="play-card">
|
<view class="play-card">
|
||||||
<view @click="$clickSound(() => toPage('/pages/practise'))">
|
<view @click="$clickSound(() => toPage('/pages/practise'))">
|
||||||
<image src="../static/my-practise.png" mode="widthFix"/>
|
<image src="https://static.shelingxingqiu.com/shootmini/static/my-practise.png" mode="widthFix"/>
|
||||||
</view>
|
</view>
|
||||||
<view @click="$clickSound(() => toPage('/pages/friend-battle'))">
|
<view @click="$clickSound(() => toPage('/pages/friend-battle'))">
|
||||||
<image src="../static/friend-battle.png" mode="widthFix"/>
|
<image src="https://static.shelingxingqiu.com/shootmini/static/friend-battle.png" mode="widthFix"/>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -452,7 +452,7 @@ onShareTimeline(() => {
|
|||||||
hover-class="none"
|
hover-class="none"
|
||||||
></button>
|
></button>
|
||||||
<view class="ranking-players" @click="toRankListPage">
|
<view class="ranking-players" @click="toRankListPage">
|
||||||
<img src="../static/juezhanbang.png" mode="widthFix"/>
|
<img src="https://static.shelingxingqiu.com/shootmini/static/juezhanbang.png" mode="widthFix"/>
|
||||||
<view class="divide-line"></view>
|
<view class="divide-line"></view>
|
||||||
<view class="player-avatars">
|
<view class="player-avatars">
|
||||||
<view
|
<view
|
||||||
@@ -486,7 +486,7 @@ onShareTimeline(() => {
|
|||||||
</view>
|
</view>
|
||||||
<view class="my-data">
|
<view class="my-data">
|
||||||
<view @click="() => toPage('/pages/my-growth')">
|
<view @click="() => toPage('/pages/my-growth')">
|
||||||
<image src="../static/my-growth.png" mode="widthFix"/>
|
<image src="https://static.shelingxingqiu.com/shootmini/static/my-growth.png" mode="widthFix"/>
|
||||||
</view>
|
</view>
|
||||||
<view @click="() => toPage('/pages/ranking')">
|
<view @click="() => toPage('/pages/ranking')">
|
||||||
<view>
|
<view>
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ onLoad(async (options) => {
|
|||||||
<Container title="靶纸">
|
<Container title="靶纸">
|
||||||
<view class="container">
|
<view class="container">
|
||||||
<image
|
<image
|
||||||
src="../static/battle-header-melee.png"
|
src="https://static.shelingxingqiu.com/shootmini/static/battle-header-melee.png"
|
||||||
mode="widthFix"
|
mode="widthFix"
|
||||||
:style="{ top: '-50rpx' }"
|
:style="{ top: '-50rpx' }"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -161,7 +161,7 @@ onShow(async () => {
|
|||||||
<Container title="弓箭绑定">
|
<Container title="弓箭绑定">
|
||||||
<view v-if="!device.deviceId" class="scan-code">
|
<view v-if="!device.deviceId" class="scan-code">
|
||||||
<button hover-class="none" @click="$clickSound(handleScan)">
|
<button hover-class="none" @click="$clickSound(handleScan)">
|
||||||
<image src="../static/scan.png" mode="widthFix" />
|
<image src="https://static.shelingxingqiu.com/shootmini/static/scan.png" mode="widthFix" />
|
||||||
</button>
|
</button>
|
||||||
<button hover-class="none" @click="showTip = true">
|
<button hover-class="none" @click="showTip = true">
|
||||||
<text>扫</text>
|
<text>扫</text>
|
||||||
@@ -172,7 +172,7 @@ onShow(async () => {
|
|||||||
<text>射灵智能弓箭,三模传感系统与独创靶环算法,</text>
|
<text>射灵智能弓箭,三模传感系统与独创靶环算法,</text>
|
||||||
<text>毫秒级在线实时对战,让你拥有全球约战的乐趣!</text>
|
<text>毫秒级在线实时对战,让你拥有全球约战的乐趣!</text>
|
||||||
<button hover-class="none" @click="toDeviceIntroPage">
|
<button hover-class="none" @click="toDeviceIntroPage">
|
||||||
<image src="../static/have-no-device.png" mode="widthFix" />
|
<image src="https://static.shelingxingqiu.com/shootmini/static/have-no-device.png" mode="widthFix" />
|
||||||
</button>
|
</button>
|
||||||
<ScreenHint
|
<ScreenHint
|
||||||
mode="square"
|
mode="square"
|
||||||
@@ -219,7 +219,7 @@ onShow(async () => {
|
|||||||
:style="{ marginBottom: calibration ? '250rpx' : '100rpx' }"
|
:style="{ marginBottom: calibration ? '250rpx' : '100rpx' }"
|
||||||
>
|
>
|
||||||
<view>
|
<view>
|
||||||
<image src="../static/device-icon.png" mode="widthFix" />
|
<image src="https://static.shelingxingqiu.com/shootmini/static/device-icon.png" mode="widthFix" />
|
||||||
<text>{{ device.deviceName }}</text>
|
<text>{{ device.deviceName }}</text>
|
||||||
<view class="calibration" v-if="calibration">
|
<view class="calibration" v-if="calibration">
|
||||||
<button hover-class="none" @click="goCalibration">
|
<button hover-class="none" @click="goCalibration">
|
||||||
@@ -286,7 +286,7 @@ onShow(async () => {
|
|||||||
<view v-if="device.deviceId && !justBind" class="has-device">
|
<view v-if="device.deviceId && !justBind" class="has-device">
|
||||||
<view class="device-binded">
|
<view class="device-binded">
|
||||||
<view>
|
<view>
|
||||||
<image src="../static/device-icon.png" mode="widthFix" />
|
<image src="https://static.shelingxingqiu.com/shootmini/static/device-icon.png" mode="widthFix" />
|
||||||
<text>{{ device.deviceName }}</text>
|
<text>{{ device.deviceName }}</text>
|
||||||
<view class="calibration">
|
<view class="calibration">
|
||||||
<button hover-class="none" @click="goCalibration">
|
<button hover-class="none" @click="goCalibration">
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ onMounted(async () => {
|
|||||||
<Container :bgType="5" bgColor="#F5F5F5" :whiteBackArrow="false">
|
<Container :bgType="5" bgColor="#F5F5F5" :whiteBackArrow="false">
|
||||||
<view class="top-part">
|
<view class="top-part">
|
||||||
<view>
|
<view>
|
||||||
<image src="../static/point-champion.png" mode="widthFix" />
|
<image src="https://static.shelingxingqiu.com/shootmini/static/point-champion.png" mode="widthFix" />
|
||||||
<image
|
<image
|
||||||
:src="list[0] && list[0].avatar ? list[0].avatar : ''"
|
:src="list[0] && list[0].avatar ? list[0].avatar : ''"
|
||||||
mode="widthFix"
|
mode="widthFix"
|
||||||
|
|||||||
@@ -348,7 +348,7 @@ onShareTimeline(() => {
|
|||||||
/>
|
/>
|
||||||
<view class="heat-map">
|
<view class="heat-map">
|
||||||
<image
|
<image
|
||||||
:src="bowTargetSrc || '../static/bow-target.png'"
|
:src="bowTargetSrc || 'https://static.shelingxingqiu.com/shootmini/static/bow-target.png'"
|
||||||
mode="widthFix"
|
mode="widthFix"
|
||||||
/>
|
/>
|
||||||
<image
|
<image
|
||||||
@@ -374,7 +374,7 @@ onShareTimeline(() => {
|
|||||||
</view>
|
</view>
|
||||||
<view class="reward" v-if="data.totalArrow">
|
<view class="reward" v-if="data.totalArrow">
|
||||||
<button hover-class="none" @click="showTip = true">
|
<button hover-class="none" @click="showTip = true">
|
||||||
<image src="../static/reward-us.png" mode="widthFix" />
|
<image src="https://static.shelingxingqiu.com/shootmini/static/reward-us.png" mode="widthFix" />
|
||||||
</button>
|
</button>
|
||||||
</view>
|
</view>
|
||||||
<RingBarChart :data="data.ringRate" v-if="user.id" />
|
<RingBarChart :data="data.ringRate" v-if="user.id" />
|
||||||
|
|||||||
+44
-28
@@ -15,10 +15,9 @@ import audioManager from "@/audioManager";
|
|||||||
|
|
||||||
import {
|
import {
|
||||||
createPractiseAPI,
|
createPractiseAPI,
|
||||||
startPractiseAPI,
|
|
||||||
endPractiseAPI,
|
|
||||||
getPractiseAPI,
|
getPractiseAPI,
|
||||||
} from "@/apis";
|
} from "@/apis";
|
||||||
|
import { connectMatchWebSocket, closeMatchWebSocket } from "@/matchWebsocket";
|
||||||
import { sharePractiseData } from "@/canvas";
|
import { sharePractiseData } from "@/canvas";
|
||||||
import { wxShare, debounce } from "@/util";
|
import { wxShare, debounce } from "@/util";
|
||||||
import { MESSAGETYPESV2, roundsName } from "@/constants";
|
import { MESSAGETYPESV2, roundsName } from "@/constants";
|
||||||
@@ -26,7 +25,7 @@ import { MESSAGETYPESV2, roundsName } from "@/constants";
|
|||||||
import useStore from "@/store";
|
import useStore from "@/store";
|
||||||
import { storeToRefs } from "pinia";
|
import { storeToRefs } from "pinia";
|
||||||
const store = useStore();
|
const store = useStore();
|
||||||
const { user } = storeToRefs(store);
|
const { user, device } = storeToRefs(store);
|
||||||
|
|
||||||
const start = ref(false);
|
const start = ref(false);
|
||||||
const scores = ref([]);
|
const scores = ref([]);
|
||||||
@@ -40,6 +39,7 @@ const showGuide = ref(false);
|
|||||||
const tips = ref("");
|
const tips = ref("");
|
||||||
const targetType = ref(1);
|
const targetType = ref(1);
|
||||||
const sharing = ref(false);
|
const sharing = ref(false);
|
||||||
|
const RESULT_TIP_CDN = "https://static.shelingxingqiu.com/shootmini/static";
|
||||||
|
|
||||||
onLoad((options) => {
|
onLoad((options) => {
|
||||||
if (options.target) {
|
if (options.target) {
|
||||||
@@ -47,8 +47,31 @@ onLoad((options) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const createPractise = async () => {
|
||||||
|
closeMatchWebSocket({ reason: "practice-recreate" });
|
||||||
|
const result = await createPractiseAPI(
|
||||||
|
total,
|
||||||
|
120,
|
||||||
|
targetType.value,
|
||||||
|
device.value.deviceId
|
||||||
|
);
|
||||||
|
if (result?.id) practiseId.value = result.id;
|
||||||
|
if (!result?.serverAddr) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "练习连接信息异常,请重试",
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
connectMatchWebSocket({
|
||||||
|
serverAddr: result.serverAddr,
|
||||||
|
matchId: result.id,
|
||||||
|
userId: user.value.id,
|
||||||
|
});
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
|
||||||
const onReady = async () => {
|
const onReady = async () => {
|
||||||
await startPractiseAPI();
|
|
||||||
scores.value = [];
|
scores.value = [];
|
||||||
isSvip.value = false;
|
isSvip.value = false;
|
||||||
xRingStreak.value = 0; // 新一局开始,重置 X 环连续计数
|
xRingStreak.value = 0; // 新一局开始,重置 X 环连续计数
|
||||||
@@ -56,8 +79,10 @@ const onReady = async () => {
|
|||||||
audioManager.play("练习开始");
|
audioManager.play("练习开始");
|
||||||
};
|
};
|
||||||
|
|
||||||
const onOver = async () => {
|
const onOver = async (message) => {
|
||||||
practiseResult.value = await getPractiseAPI(practiseId.value);
|
practiseResult.value = Array.isArray(message?.details)
|
||||||
|
? message
|
||||||
|
: await getPractiseAPI(practiseId.value);
|
||||||
start.value = false;
|
start.value = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -87,14 +112,14 @@ async function onReceiveMessage(msg) {
|
|||||||
if (msg.type === MESSAGETYPESV2.ShootResult) {
|
if (msg.type === MESSAGETYPESV2.ShootResult) {
|
||||||
const prevLen = scores.value.length;
|
const prevLen = scores.value.length;
|
||||||
isSvip.value = msg.sVip === true;
|
isSvip.value = msg.sVip === true;
|
||||||
scores.value = msg.details;
|
scores.value = Array.isArray(msg.details) ? msg.details : scores.value;
|
||||||
// 有新箭时取最后一箭判断是否 10 环及以上并检测连续计数
|
// 有新箭时取最后一箭判断是否 10 环及以上并检测连续计数
|
||||||
if (scores.value.length > prevLen) {
|
if (scores.value.length > prevLen) {
|
||||||
const latestArrow = scores.value[scores.value.length - 1];
|
const latestArrow = scores.value[scores.value.length - 1];
|
||||||
checkAndPlayTententen(isTenPlusRing(latestArrow));
|
checkAndPlayTententen(isTenPlusRing(latestArrow));
|
||||||
}
|
}
|
||||||
} else if (msg.type === MESSAGETYPESV2.BattleEnd) {
|
} else if (msg.type === MESSAGETYPESV2.BattleEnd) {
|
||||||
// setTimeout(onOver, 1500);
|
setTimeout(() => onOver(msg), 1500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -111,11 +136,17 @@ async function onComplete() {
|
|||||||
scores.value = [];
|
scores.value = [];
|
||||||
isSvip.value = false;
|
isSvip.value = false;
|
||||||
xRingStreak.value = 0; // 重新开始练习,重置 X 环连续计数
|
xRingStreak.value = 0; // 重新开始练习,重置 X 环连续计数
|
||||||
const result = await createPractiseAPI(total, 120);
|
await createPractise();
|
||||||
if (result) practiseId.value = result.id;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const getResultTipSrc = (result = {}) => {
|
||||||
|
const validCount = (result.details || []).filter(
|
||||||
|
(arrow) => arrow.x !== -30 && arrow.y !== -30
|
||||||
|
).length;
|
||||||
|
return `${RESULT_TIP_CDN}/${validCount < total ? "un" : ""}finish-tip.png`;
|
||||||
|
};
|
||||||
|
|
||||||
const onClickShare = debounce(async () => {
|
const onClickShare = debounce(async () => {
|
||||||
if (sharing.value) return;
|
if (sharing.value) return;
|
||||||
sharing.value = true;
|
sharing.value = true;
|
||||||
@@ -132,12 +163,6 @@ const onClickShare = debounce(async () => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
function onAudioEnded(s) {
|
|
||||||
if (s.indexOf("比赛结束") >= 0) {
|
|
||||||
onOver()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
// audioManager.play("第一轮");
|
// audioManager.play("第一轮");
|
||||||
uni.setKeepScreenOn({
|
uni.setKeepScreenOn({
|
||||||
@@ -145,9 +170,7 @@ onMounted(async () => {
|
|||||||
});
|
});
|
||||||
uni.$on("socket-inbox", onReceiveMessage);
|
uni.$on("socket-inbox", onReceiveMessage);
|
||||||
uni.$on("share-image", onClickShare);
|
uni.$on("share-image", onClickShare);
|
||||||
uni.$on("audioEnded", onAudioEnded);
|
await createPractise();
|
||||||
const result = await createPractiseAPI(total, 120, targetType.value);
|
|
||||||
if (result) practiseId.value = result.id;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
@@ -156,9 +179,8 @@ onBeforeUnmount(() => {
|
|||||||
});
|
});
|
||||||
uni.$off("socket-inbox", onReceiveMessage);
|
uni.$off("socket-inbox", onReceiveMessage);
|
||||||
uni.$off("share-image", onClickShare);
|
uni.$off("share-image", onClickShare);
|
||||||
uni.$off("audioEnded", onAudioEnded);
|
|
||||||
audioManager.stopAll();
|
audioManager.stopAll();
|
||||||
endPractiseAPI();
|
closeMatchWebSocket({ reason: "practice-leave" });
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -203,13 +225,7 @@ onBeforeUnmount(() => {
|
|||||||
:total="total"
|
:total="total"
|
||||||
:onClose="onComplete"
|
:onClose="onComplete"
|
||||||
:result="practiseResult"
|
:result="practiseResult"
|
||||||
:tipSrc="`../static/${
|
:tipSrc="getResultTipSrc(practiseResult)"
|
||||||
practiseResult.details.filter(
|
|
||||||
(arrow) => arrow.x !== -30 && arrow.y !== -30
|
|
||||||
).length < total
|
|
||||||
? 'un'
|
|
||||||
: ''
|
|
||||||
}finish-tip.png`"
|
|
||||||
/>
|
/>
|
||||||
<canvas class="share-canvas" id="shareCanvas" type="2d"></canvas>
|
<canvas class="share-canvas" id="shareCanvas" type="2d"></canvas>
|
||||||
</block>
|
</block>
|
||||||
|
|||||||
+44
-20
@@ -14,10 +14,9 @@ import audioManager from "@/audioManager";
|
|||||||
|
|
||||||
import {
|
import {
|
||||||
createPractiseAPI,
|
createPractiseAPI,
|
||||||
startPractiseAPI,
|
|
||||||
endPractiseAPI,
|
|
||||||
getPractiseAPI,
|
getPractiseAPI,
|
||||||
} from "@/apis";
|
} from "@/apis";
|
||||||
|
import { connectMatchWebSocket, closeMatchWebSocket } from "@/matchWebsocket";
|
||||||
import { sharePractiseData } from "@/canvas";
|
import { sharePractiseData } from "@/canvas";
|
||||||
import { wxShare, debounce } from "@/util";
|
import { wxShare, debounce } from "@/util";
|
||||||
import { MESSAGETYPESV2 } from "@/constants";
|
import { MESSAGETYPESV2 } from "@/constants";
|
||||||
@@ -26,7 +25,7 @@ import useStore from "@/store";
|
|||||||
import { storeToRefs } from "pinia";
|
import { storeToRefs } from "pinia";
|
||||||
import {onLoad} from "@dcloudio/uni-app";
|
import {onLoad} from "@dcloudio/uni-app";
|
||||||
const store = useStore();
|
const store = useStore();
|
||||||
const { user } = storeToRefs(store);
|
const { user, device } = storeToRefs(store);
|
||||||
|
|
||||||
const start = ref(false);
|
const start = ref(false);
|
||||||
const scores = ref([]);
|
const scores = ref([]);
|
||||||
@@ -39,6 +38,7 @@ const practiseId = ref("");
|
|||||||
const showGuide = ref(false);
|
const showGuide = ref(false);
|
||||||
const targetType = ref(1);
|
const targetType = ref(1);
|
||||||
const sharing = ref(false);
|
const sharing = ref(false);
|
||||||
|
const RESULT_TIP_CDN = "https://static.shelingxingqiu.com/shootmini/static";
|
||||||
|
|
||||||
onLoad((options) => {
|
onLoad((options) => {
|
||||||
if (options.target) {
|
if (options.target) {
|
||||||
@@ -46,8 +46,31 @@ onLoad((options) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const createPractise = async () => {
|
||||||
|
closeMatchWebSocket({ reason: "practice-recreate" });
|
||||||
|
const result = await createPractiseAPI(
|
||||||
|
total,
|
||||||
|
3600,
|
||||||
|
targetType.value,
|
||||||
|
device.value.deviceId
|
||||||
|
);
|
||||||
|
if (result?.id) practiseId.value = result.id;
|
||||||
|
if (!result?.serverAddr) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "练习连接信息异常,请重试",
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
connectMatchWebSocket({
|
||||||
|
serverAddr: result.serverAddr,
|
||||||
|
matchId: result.id,
|
||||||
|
userId: user.value.id,
|
||||||
|
});
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
|
||||||
const onReady = async () => {
|
const onReady = async () => {
|
||||||
await startPractiseAPI();
|
|
||||||
scores.value = [];
|
scores.value = [];
|
||||||
isSvip.value = false;
|
isSvip.value = false;
|
||||||
xRingStreak.value = 0; // 新一局开始,重置 X 环连续计数
|
xRingStreak.value = 0; // 新一局开始,重置 X 环连续计数
|
||||||
@@ -55,8 +78,10 @@ const onReady = async () => {
|
|||||||
audioManager.play("练习开始");
|
audioManager.play("练习开始");
|
||||||
};
|
};
|
||||||
|
|
||||||
const onOver = async () => {
|
const onOver = async (message) => {
|
||||||
practiseResult.value = await getPractiseAPI(practiseId.value);
|
practiseResult.value = Array.isArray(message?.details)
|
||||||
|
? message
|
||||||
|
: await getPractiseAPI(practiseId.value);
|
||||||
start.value = false;
|
start.value = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -86,14 +111,14 @@ async function onReceiveMessage(msg) {
|
|||||||
if (msg.type === MESSAGETYPESV2.ShootResult) {
|
if (msg.type === MESSAGETYPESV2.ShootResult) {
|
||||||
const prevLen = scores.value.length;
|
const prevLen = scores.value.length;
|
||||||
isSvip.value = msg.sVip === true;
|
isSvip.value = msg.sVip === true;
|
||||||
scores.value = msg.details;
|
scores.value = Array.isArray(msg.details) ? msg.details : scores.value;
|
||||||
// 有新箭时取最后一箭判断是否 10 环及以上并检测连续计数
|
// 有新箭时取最后一箭判断是否 10 环及以上并检测连续计数
|
||||||
if (scores.value.length > prevLen) {
|
if (scores.value.length > prevLen) {
|
||||||
const latestArrow = scores.value[scores.value.length - 1];
|
const latestArrow = scores.value[scores.value.length - 1];
|
||||||
checkAndPlayTententen(isTenPlusRing(latestArrow));
|
checkAndPlayTententen(isTenPlusRing(latestArrow));
|
||||||
}
|
}
|
||||||
} else if (msg.type === MESSAGETYPESV2.BattleEnd) {
|
} else if (msg.type === MESSAGETYPESV2.BattleEnd) {
|
||||||
setTimeout(onOver, 1500);
|
setTimeout(() => onOver(msg), 1500);
|
||||||
}
|
}
|
||||||
// messages.forEach((msg) => {
|
// messages.forEach((msg) => {
|
||||||
// if (msg.constructor === MESSAGETYPES.ShootSyncMeArrowID) {
|
// if (msg.constructor === MESSAGETYPES.ShootSyncMeArrowID) {
|
||||||
@@ -126,11 +151,17 @@ async function onComplete() {
|
|||||||
scores.value = [];
|
scores.value = [];
|
||||||
isSvip.value = false;
|
isSvip.value = false;
|
||||||
xRingStreak.value = 0; // 重新开始练习,重置 X 环连续计数
|
xRingStreak.value = 0; // 重新开始练习,重置 X 环连续计数
|
||||||
const result = await createPractiseAPI(total, 3600);
|
await createPractise();
|
||||||
if (result) practiseId.value = result.id;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const getResultTipSrc = (result = {}) => {
|
||||||
|
const validCount = (result.details || []).filter(
|
||||||
|
(arrow) => arrow.x !== -30 && arrow.y !== -30
|
||||||
|
).length;
|
||||||
|
return `${RESULT_TIP_CDN}/${validCount < total ? "2un" : ""}finish-tip.png`;
|
||||||
|
};
|
||||||
|
|
||||||
const onClickShare = debounce(async () => {
|
const onClickShare = debounce(async () => {
|
||||||
if (sharing.value) return;
|
if (sharing.value) return;
|
||||||
sharing.value = true;
|
sharing.value = true;
|
||||||
@@ -153,8 +184,7 @@ onMounted(async () => {
|
|||||||
});
|
});
|
||||||
uni.$on("socket-inbox", onReceiveMessage);
|
uni.$on("socket-inbox", onReceiveMessage);
|
||||||
uni.$on("share-image", onClickShare);
|
uni.$on("share-image", onClickShare);
|
||||||
const result = await createPractiseAPI(total, 3600, targetType.value);
|
await createPractise();
|
||||||
if (result) practiseId.value = result.id;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
@@ -164,7 +194,7 @@ onBeforeUnmount(() => {
|
|||||||
uni.$off("socket-inbox", onReceiveMessage);
|
uni.$off("socket-inbox", onReceiveMessage);
|
||||||
uni.$off("share-image", onClickShare);
|
uni.$off("share-image", onClickShare);
|
||||||
audioManager.stopAll();
|
audioManager.stopAll();
|
||||||
endPractiseAPI();
|
closeMatchWebSocket({ reason: "practice-leave" });
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -211,13 +241,7 @@ onBeforeUnmount(() => {
|
|||||||
:rowCount="9"
|
:rowCount="9"
|
||||||
:onClose="onComplete"
|
:onClose="onComplete"
|
||||||
:result="practiseResult"
|
:result="practiseResult"
|
||||||
:tipSrc="`../static/${
|
:tipSrc="getResultTipSrc(practiseResult)"
|
||||||
practiseResult.details.filter(
|
|
||||||
(arrow) => arrow.x !== -30 && arrow.y !== -30
|
|
||||||
).length < total
|
|
||||||
? '2un'
|
|
||||||
: ''
|
|
||||||
}finish-tip.png`"
|
|
||||||
/>
|
/>
|
||||||
<canvas class="share-canvas" id="shareCanvas" type="2d"></canvas>
|
<canvas class="share-canvas" id="shareCanvas" type="2d"></canvas>
|
||||||
</block>
|
</block>
|
||||||
|
|||||||
@@ -328,8 +328,8 @@ onShow(async () => {
|
|||||||
<view class="battle-types-box">
|
<view class="battle-types-box">
|
||||||
<view class="battle-types">
|
<view class="battle-types">
|
||||||
<view class="first">
|
<view class="first">
|
||||||
<image src="../static/rank/battle-choose.png" mode="widthFix" />
|
<image src="https://static.shelingxingqiu.com/shootmini/static/rank/battle-choose.png" mode="widthFix" />
|
||||||
<image class="star" src="../static/rank/star.png" mode="widthFix" />
|
<image class="star" src="https://static.shelingxingqiu.com/shootmini/static/rank/star.png" mode="widthFix" />
|
||||||
</view>
|
</view>
|
||||||
<image
|
<image
|
||||||
src="../static/rank/battle1v1.svg"
|
src="../static/rank/battle1v1.svg"
|
||||||
|
|||||||
@@ -97,9 +97,9 @@ onBeforeUnmount(() => {
|
|||||||
class="back-to-game"
|
class="back-to-game"
|
||||||
@click="onClick"
|
@click="onClick"
|
||||||
>
|
>
|
||||||
<image src="../../../static/back-to-game-bg.png" mode="widthFix" />
|
<image src="https://static.shelingxingqiu.com/shootmini/static/back-to-game-bg.png" mode="widthFix" />
|
||||||
<block v-if="game.inBattle">
|
<block v-if="game.inBattle">
|
||||||
<image src="../../../static/pk-icon.png" mode="widthFix" />
|
<image src="https://static.shelingxingqiu.com/shootmini/static/pk-icon.png" mode="widthFix" />
|
||||||
<text>返回进行中的对局</text>
|
<text>返回进行中的对局</text>
|
||||||
</block>
|
</block>
|
||||||
<block v-else-if="game.roomID">
|
<block v-else-if="game.roomID">
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ const normalRounds = computed(() => {
|
|||||||
<template>
|
<template>
|
||||||
<view class="container">
|
<view class="container">
|
||||||
<view class="guide-row">
|
<view class="guide-row">
|
||||||
<image src="../../../static/shooter.png" mode="widthFix" />
|
<image src="https://static.shelingxingqiu.com/shootmini/static/shooter.png" mode="widthFix" />
|
||||||
<view
|
<view
|
||||||
:style="{
|
:style="{
|
||||||
marginBottom: '10px',
|
marginBottom: '10px',
|
||||||
@@ -42,7 +42,7 @@ const normalRounds = computed(() => {
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view>
|
||||||
<image src="../../../static/battle-header-melee.png" mode="widthFix" />
|
<image src="https://static.shelingxingqiu.com/shootmini/static/battle-header-melee.png" mode="widthFix" />
|
||||||
<text>蓝队({{ bluePoints }})</text>
|
<text>蓝队({{ bluePoints }})</text>
|
||||||
<text>红队({{ redPoints }})</text>
|
<text>红队({{ redPoints }})</text>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ const isMember = (player = {}) => player.vip === true || player.sVip === true;
|
|||||||
<view class="container" :style="{ paddingTop: showHeader ? '5px' : '0' }">
|
<view class="container" :style="{ paddingTop: showHeader ? '5px' : '0' }">
|
||||||
<image
|
<image
|
||||||
v-if="showHeader"
|
v-if="showHeader"
|
||||||
:src="`../../../static/battle-header${players.length ? '-melee' : ''}.png`"
|
:src="`https://static.shelingxingqiu.com/shootmini/static/battle-header${players.length ? '-melee' : ''}.png`"
|
||||||
mode="widthFix"
|
mode="widthFix"
|
||||||
/>
|
/>
|
||||||
<view
|
<view
|
||||||
|
|||||||
@@ -531,7 +531,7 @@ onBeforeUnmount(() => {
|
|||||||
@impact="shakeTarget"
|
@impact="shakeTarget"
|
||||||
@complete="completeShotEffect"
|
@complete="completeShotEffect"
|
||||||
/>
|
/>
|
||||||
<image src="../../../static/bow-target.png" mode="widthFix" />
|
<image src="https://static.shelingxingqiu.com/shootmini/static/bow-target.png" mode="widthFix" />
|
||||||
</view>
|
</view>
|
||||||
<view class="footer">
|
<view class="footer">
|
||||||
<PointSwitcher
|
<PointSwitcher
|
||||||
|
|||||||
@@ -12,13 +12,13 @@ defineProps({
|
|||||||
const bubbleTypes = [
|
const bubbleTypes = [
|
||||||
"../../../static/long-bubble.png",
|
"../../../static/long-bubble.png",
|
||||||
"../../../static/long-bubble-middle.png",
|
"../../../static/long-bubble-middle.png",
|
||||||
"../../../static/long-bubble-tall.png",
|
"https://static.shelingxingqiu.com/shootmini/static/long-bubble-tall.png",
|
||||||
];
|
];
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<view class="container">
|
<view class="container">
|
||||||
<image src="../../../static/shooter.png" mode="widthFix" />
|
<image src="https://static.shelingxingqiu.com/shootmini/static/shooter.png" mode="widthFix" />
|
||||||
<view>
|
<view>
|
||||||
<image
|
<image
|
||||||
v-if="!noBg"
|
v-if="!noBg"
|
||||||
|
|||||||
@@ -27,22 +27,22 @@ const getContentHeight = () => {
|
|||||||
<view class="scale-in" :style="{ height: getContentHeight() }">
|
<view class="scale-in" :style="{ height: getContentHeight() }">
|
||||||
<image
|
<image
|
||||||
v-if="mode === 'normal'"
|
v-if="mode === 'normal'"
|
||||||
src="../../../static/screen-hint-bg.png"
|
src="https://static.shelingxingqiu.com/shootmini/static/screen-hint-bg.png"
|
||||||
mode="widthFix"
|
mode="widthFix"
|
||||||
/>
|
/>
|
||||||
<image
|
<image
|
||||||
v-if="mode === 'tall'"
|
v-if="mode === 'tall'"
|
||||||
src="../../../static/coach-comment.png"
|
src="https://static.shelingxingqiu.com/shootmini/static/coach-comment.png"
|
||||||
mode="widthFix"
|
mode="widthFix"
|
||||||
/>
|
/>
|
||||||
<image
|
<image
|
||||||
v-if="mode === 'square'"
|
v-if="mode === 'square'"
|
||||||
src="../../../static/prompt-bg-square.png"
|
src="https://static.shelingxingqiu.com/shootmini/static/prompt-bg-square.png"
|
||||||
mode="widthFix"
|
mode="widthFix"
|
||||||
/>
|
/>
|
||||||
<image
|
<image
|
||||||
v-if="mode === 'small'"
|
v-if="mode === 'small'"
|
||||||
src="../../../static/finish-frame.png"
|
src="https://static.shelingxingqiu.com/shootmini/static/finish-frame.png"
|
||||||
mode="widthFix"
|
mode="widthFix"
|
||||||
/>
|
/>
|
||||||
<slot />
|
<slot />
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ onBeforeUnmount(() => {
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="isBattle" class="ready-timer">
|
<view v-if="isBattle" class="ready-timer">
|
||||||
<image src="../../../static/test-tip.png" mode="widthFix" />
|
<image src="https://static.shelingxingqiu.com/shootmini/static/test-tip.png" mode="widthFix" />
|
||||||
<view v-if="count >= 0">
|
<view v-if="count >= 0">
|
||||||
<text>具体正式比赛还有</text>
|
<text>具体正式比赛还有</text>
|
||||||
<text>{{ count }}</text>
|
<text>{{ count }}</text>
|
||||||
|
|||||||
+1
-1
@@ -136,7 +136,7 @@ const buildVersion = typeof __BUILD_TIME__ !== 'undefined' ? __BUILD_TIME__ : ''
|
|||||||
<text>点</text>
|
<text>点</text>
|
||||||
</UserItem>
|
</UserItem>
|
||||||
<view class="my-grow" @click="toMyGrowthPage">
|
<view class="my-grow" @click="toMyGrowthPage">
|
||||||
<image src="../static/my-grow.png" mode="widthFix" />
|
<image src="https://static.shelingxingqiu.com/shootmini/static/my-grow.png" mode="widthFix" />
|
||||||
</view>
|
</view>
|
||||||
<UserItem title="关于我们" :onClick="toAboutUsPage" />
|
<UserItem title="关于我们" :onClick="toAboutUsPage" />
|
||||||
<UserItem
|
<UserItem
|
||||||
|
|||||||
@@ -0,0 +1,131 @@
|
|||||||
|
"use strict";
|
||||||
|
|
||||||
|
var utf8 = exports;
|
||||||
|
var replacementChar = "\ufffd";
|
||||||
|
|
||||||
|
function utf8Read(buffer, start, end, fatal) {
|
||||||
|
var str = "";
|
||||||
|
for (var i = start; i < end;) {
|
||||||
|
var first = buffer[i++];
|
||||||
|
if (first <= 0x7F) {
|
||||||
|
str += String.fromCharCode(first);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
var needed = 0;
|
||||||
|
var codePoint = 0;
|
||||||
|
var minCodePoint = 0;
|
||||||
|
|
||||||
|
if (first >= 0xC2 && first <= 0xDF) {
|
||||||
|
needed = 1;
|
||||||
|
codePoint = first & 0x1F;
|
||||||
|
minCodePoint = 0x80;
|
||||||
|
} else if (first >= 0xE0 && first <= 0xEF) {
|
||||||
|
needed = 2;
|
||||||
|
codePoint = first & 0x0F;
|
||||||
|
minCodePoint = 0x800;
|
||||||
|
} else if (first >= 0xF0 && first <= 0xF4) {
|
||||||
|
needed = 3;
|
||||||
|
codePoint = first & 0x07;
|
||||||
|
minCodePoint = 0x10000;
|
||||||
|
} else {
|
||||||
|
if (fatal) throw Error("invalid UTF-8 encoding");
|
||||||
|
str += replacementChar;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (i + needed > end) {
|
||||||
|
if (fatal) throw Error("invalid UTF-8 encoding");
|
||||||
|
str += replacementChar;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
var valid = true;
|
||||||
|
for (var j = 0; j < needed; ++j) {
|
||||||
|
var next = buffer[i + j];
|
||||||
|
if ((next & 0xC0) !== 0x80) {
|
||||||
|
valid = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
codePoint = codePoint << 6 | next & 0x3F;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
!valid ||
|
||||||
|
codePoint < minCodePoint ||
|
||||||
|
codePoint > 0x10FFFF ||
|
||||||
|
codePoint >= 0xD800 && codePoint <= 0xDFFF
|
||||||
|
) {
|
||||||
|
if (fatal) throw Error("invalid UTF-8 encoding");
|
||||||
|
str += replacementChar;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
i += needed;
|
||||||
|
if (codePoint <= 0xFFFF) {
|
||||||
|
str += String.fromCharCode(codePoint);
|
||||||
|
} else {
|
||||||
|
codePoint -= 0x10000;
|
||||||
|
str += String.fromCharCode(0xD800 + (codePoint >> 10));
|
||||||
|
str += String.fromCharCode(0xDC00 + (codePoint & 0x3FF));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
|
utf8.length = function utf8_length(string) {
|
||||||
|
var len = 0,
|
||||||
|
c = 0;
|
||||||
|
for (var i = 0; i < string.length; ++i) {
|
||||||
|
c = string.charCodeAt(i);
|
||||||
|
if (c < 128)
|
||||||
|
len += 1;
|
||||||
|
else if (c < 2048)
|
||||||
|
len += 2;
|
||||||
|
else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) {
|
||||||
|
++i;
|
||||||
|
len += 4;
|
||||||
|
} else
|
||||||
|
len += 3;
|
||||||
|
}
|
||||||
|
return len;
|
||||||
|
};
|
||||||
|
|
||||||
|
utf8.read = function utf8_read(buffer, start, end) {
|
||||||
|
if (end - start < 1)
|
||||||
|
return "";
|
||||||
|
return utf8Read(buffer, start, end, false);
|
||||||
|
};
|
||||||
|
|
||||||
|
utf8.readStrict = function utf8_read_strict(buffer, start, end) {
|
||||||
|
if (end - start < 1)
|
||||||
|
return "";
|
||||||
|
return utf8Read(buffer, start, end, true);
|
||||||
|
};
|
||||||
|
|
||||||
|
utf8.write = function utf8_write(string, buffer, offset) {
|
||||||
|
var start = offset,
|
||||||
|
c1,
|
||||||
|
c2;
|
||||||
|
for (var i = 0; i < string.length; ++i) {
|
||||||
|
c1 = string.charCodeAt(i);
|
||||||
|
if (c1 < 128) {
|
||||||
|
buffer[offset++] = c1;
|
||||||
|
} else if (c1 < 2048) {
|
||||||
|
buffer[offset++] = c1 >> 6 | 192;
|
||||||
|
buffer[offset++] = c1 & 63 | 128;
|
||||||
|
} else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) {
|
||||||
|
c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF);
|
||||||
|
++i;
|
||||||
|
buffer[offset++] = c1 >> 18 | 240;
|
||||||
|
buffer[offset++] = c1 >> 12 & 63 | 128;
|
||||||
|
buffer[offset++] = c1 >> 6 & 63 | 128;
|
||||||
|
buffer[offset++] = c1 & 63 | 128;
|
||||||
|
} else {
|
||||||
|
buffer[offset++] = c1 >> 12 | 224;
|
||||||
|
buffer[offset++] = c1 >> 6 & 63 | 128;
|
||||||
|
buffer[offset++] = c1 & 63 | 128;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return offset - start;
|
||||||
|
};
|
||||||
+2
-2
@@ -24,8 +24,8 @@ function createWebSocket(token, onMessage) {
|
|||||||
|
|
||||||
switch (envVersion) {
|
switch (envVersion) {
|
||||||
case "develop": // 开发版
|
case "develop": // 开发版
|
||||||
// url = "ws://192.168.1.2:8000/socket";
|
url = "ws://192.168.1.2:8000/socket";
|
||||||
url = "wss://apitest.shelingxingqiu.com/socket";
|
// url = "wss://apitest.shelingxingqiu.com/socket";
|
||||||
break;
|
break;
|
||||||
case "trial": // 体验版
|
case "trial": // 体验版
|
||||||
url = "wss://apitest.shelingxingqiu.com/socket";
|
url = "wss://apitest.shelingxingqiu.com/socket";
|
||||||
|
|||||||
@@ -1,8 +1,23 @@
|
|||||||
import { fileURLToPath, URL } from 'node:url'
|
import { fileURLToPath, URL } from 'node:url'
|
||||||
|
import { readFileSync } from 'node:fs'
|
||||||
|
|
||||||
import { defineConfig } from 'vite'
|
import { defineConfig } from 'vite'
|
||||||
import uni from '@dcloudio/vite-plugin-uni'
|
import uni from '@dcloudio/vite-plugin-uni'
|
||||||
|
|
||||||
|
const protobufUtf8CompatPath = fileURLToPath(new URL('./src/utils/protobufUtf8Compat.js', import.meta.url))
|
||||||
|
|
||||||
|
function protobufUtf8CompatPlugin() {
|
||||||
|
return {
|
||||||
|
name: 'protobufjs-utf8-miniprogram-compat',
|
||||||
|
load(id) {
|
||||||
|
const normalizedId = id.replace(/\\/g, '/')
|
||||||
|
if (normalizedId.endsWith('/node_modules/protobufjs/src/util/utf8.js')) {
|
||||||
|
return readFileSync(protobufUtf8CompatPath, 'utf8')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
@@ -10,6 +25,7 @@ export default defineConfig({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
|
protobufUtf8CompatPlugin(),
|
||||||
uni(),
|
uni(),
|
||||||
],
|
],
|
||||||
/** 构建时常量注入:__BUILD_TIME__ 在源码中展开为精确的打包时刻字符串 */
|
/** 构建时常量注入:__BUILD_TIME__ 在源码中展开为精确的打包时刻字符串 */
|
||||||
|
|||||||
Reference in New Issue
Block a user