细节优化
This commit is contained in:
@@ -6,12 +6,22 @@ const props = defineProps({
|
||||
default: 0,
|
||||
},
|
||||
});
|
||||
const bgs = ref(["../static/app-bg.png", "../static/app-bg2.png"]);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<view class="background">
|
||||
<image class="bg-image" :src="bgs[type]" mode="widthFix" />
|
||||
<image
|
||||
class="bg-image"
|
||||
v-if="type === 0"
|
||||
src="../static/app-bg.png"
|
||||
mode="widthFix"
|
||||
/>
|
||||
<image
|
||||
class="bg-image"
|
||||
v-if="type === 1"
|
||||
src="../static/app-bg2.png"
|
||||
mode="widthFix"
|
||||
/>
|
||||
<view class="bg-overlay" v-if="type === 0"></view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -45,7 +45,7 @@ const onClick = async () => {
|
||||
}
|
||||
.back-to-game > image:nth-child(2) {
|
||||
position: relative;
|
||||
width: 50px;
|
||||
width: 60px;
|
||||
}
|
||||
.back-to-game > text:nth-child(3) {
|
||||
position: relative;
|
||||
|
||||
@@ -198,7 +198,7 @@ const simulShoot2 = async () => {
|
||||
? 'green'
|
||||
: 'red',
|
||||
}"
|
||||
>{{ index + 1 }}</view
|
||||
><text>{{ index + 1 }}</text></view
|
||||
>
|
||||
</block>
|
||||
<block v-for="(bow, index) in blueScores" :key="index">
|
||||
@@ -214,7 +214,7 @@ const simulShoot2 = async () => {
|
||||
top: calcRealY(bow.y),
|
||||
backgroundColor: 'blue',
|
||||
}"
|
||||
>{{ index + 1 }}</view
|
||||
><text>{{ index + 1 }}</text></view
|
||||
>
|
||||
</block>
|
||||
<image src="../static/bow-target.png" mode="widthFix" />
|
||||
@@ -288,6 +288,10 @@ const simulShoot2 = async () => {
|
||||
transition: all 0.3s ease;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.hit > text {
|
||||
transform: scaleX(0.7);
|
||||
display: block;
|
||||
}
|
||||
.header {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
|
||||
@@ -40,12 +40,16 @@ const showGlobalHint = (type) => {
|
||||
hintType.value = type;
|
||||
showHint.value = true;
|
||||
};
|
||||
const hideGlobalHint = () => {
|
||||
showHint.value = false;
|
||||
};
|
||||
onMounted(() => {
|
||||
const deviceInfo = uni.getDeviceInfo();
|
||||
isIos.value = deviceInfo.osName === "ios";
|
||||
});
|
||||
onShow(() => {
|
||||
uni.$showHint = showGlobalHint;
|
||||
uni.$hideHint = hideGlobalHint;
|
||||
showHint.value = false;
|
||||
});
|
||||
const backToGame = debounce(async () => {
|
||||
@@ -86,10 +90,10 @@ const goBack = () => {
|
||||
<text>离开比赛可能会导致比赛失败,</text>
|
||||
<text>确认离开吗?</text>
|
||||
<view>
|
||||
<button hover-class="none" @click="goBack">离开比赛</button>
|
||||
<button hover-class="none" @click="() => (showHint = false)">
|
||||
继续比赛
|
||||
</button>
|
||||
<button hover-class="none" @click="goBack">离开比赛</button>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="hintType === 3" class="tip-content">
|
||||
|
||||
Reference in New Issue
Block a user