流程完善
This commit is contained in:
@@ -138,10 +138,10 @@ const nextStep = async () => {
|
||||
};
|
||||
|
||||
const onClose = () => {
|
||||
if (
|
||||
practiseResult.value.arrows &&
|
||||
practiseResult.value.arrows.length === total
|
||||
) {
|
||||
const validArrows = (practiseResult.value.arrows || []).filter(
|
||||
(a) => a.x !== -30 && a.y !== -30
|
||||
);
|
||||
if (validArrows.length === total) {
|
||||
setTimeout(() => {
|
||||
practiseResult.value = {};
|
||||
showGuide.value = false;
|
||||
@@ -255,7 +255,11 @@ const onClose = () => {
|
||||
:onClose="onClose"
|
||||
:result="practiseResult"
|
||||
:tipSrc="`../static/${
|
||||
practiseResult.arrows.length < total ? 'un' : ''
|
||||
practiseResult.arrows.filter(
|
||||
(arrow) => arrow.x !== -30 && arrow.y !== -30
|
||||
).length < total
|
||||
? 'un'
|
||||
: ''
|
||||
}finish-tip.png`"
|
||||
/>
|
||||
<canvas class="share-canvas" canvas-id="shareCanvas"></canvas>
|
||||
|
||||
@@ -98,10 +98,10 @@ async function onReceiveMessage(messages = []) {
|
||||
}
|
||||
|
||||
async function onComplete() {
|
||||
if (
|
||||
practiseResult.value.arrows &&
|
||||
practiseResult.value.arrows.length === total
|
||||
) {
|
||||
const validArrows = (practiseResult.value.arrows || []).filter(
|
||||
(a) => a.x !== -30 && a.y !== -30
|
||||
);
|
||||
if (validArrows.length === total) {
|
||||
uni.navigateBack();
|
||||
} else {
|
||||
practiseId.value = "";
|
||||
@@ -178,7 +178,11 @@ onBeforeUnmount(() => {
|
||||
:onClose="onComplete"
|
||||
:result="practiseResult"
|
||||
:tipSrc="`../static/${
|
||||
practiseResult.arrows.length < total ? 'un' : ''
|
||||
practiseResult.arrows.filter(
|
||||
(arrow) => arrow.x !== -30 && arrow.y !== -30
|
||||
).length < total
|
||||
? 'un'
|
||||
: ''
|
||||
}finish-tip.png`"
|
||||
/>
|
||||
<canvas class="share-canvas" canvas-id="shareCanvas"></canvas>
|
||||
|
||||
@@ -64,16 +64,17 @@ async function onReceiveMessage(messages = []) {
|
||||
}
|
||||
|
||||
async function onComplete() {
|
||||
if (
|
||||
practiseResult.value.arrows &&
|
||||
practiseResult.value.arrows.length === total
|
||||
) {
|
||||
const validArrows = (practiseResult.value.arrows || []).filter(
|
||||
(a) => a.x !== -30 && a.y !== -30
|
||||
);
|
||||
if (validArrows.length === total) {
|
||||
uni.navigateBack();
|
||||
} else {
|
||||
practiseId.value = "";
|
||||
practiseResult.value = {};
|
||||
start.value = false;
|
||||
scores.value = [];
|
||||
currentRound.value = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,7 +135,11 @@ onBeforeUnmount(() => {
|
||||
:onClose="onComplete"
|
||||
:result="practiseResult"
|
||||
:tipSrc="`../static/${
|
||||
practiseResult.arrows.length < total ? '2un' : ''
|
||||
practiseResult.arrows.filter(
|
||||
(arrow) => arrow.x !== -30 && arrow.y !== -30
|
||||
).length < total
|
||||
? '2un'
|
||||
: ''
|
||||
}finish-tip.png`"
|
||||
/>
|
||||
<canvas class="share-canvas" canvas-id="shareCanvas"></canvas>
|
||||
|
||||
Reference in New Issue
Block a user