计分本细节调整
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
<script setup>
|
||||
|
||||
const tabs = [
|
||||
{ image: "../static/tab-vip.png" },
|
||||
{ image: "../static/tab-point-book.png" },
|
||||
@@ -34,7 +33,7 @@ function handleTabClick(index) {
|
||||
class="tab-item"
|
||||
@click="handleTabClick(index)"
|
||||
:style="{
|
||||
width: index === 1 ? '36%' : '10%',
|
||||
width: index === 1 ? '36%' : '20%',
|
||||
}"
|
||||
>
|
||||
<image :src="tab.image" mode="widthFix" />
|
||||
@@ -64,10 +63,13 @@ function handleTabClick(index) {
|
||||
justify-content: center;
|
||||
}
|
||||
.tab-item > image {
|
||||
width: 86%;
|
||||
width: 65rpx;
|
||||
}
|
||||
.tab-item:last-child > image {
|
||||
width: 85rpx;
|
||||
}
|
||||
.tab-item:nth-child(2) {
|
||||
transform: translate(25%, 30%);
|
||||
transform: translate(10%, 40%);
|
||||
}
|
||||
.tab-item:nth-child(3) {
|
||||
margin-bottom: 25rpx;
|
||||
@@ -76,6 +78,6 @@ function handleTabClick(index) {
|
||||
width: 140rpx;
|
||||
}
|
||||
.tab-item:nth-child(4) {
|
||||
transform: translate(-25%, 30%);
|
||||
transform: translate(-10%, 44%);
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -109,7 +109,7 @@ const arrowStyle = computed(() => {
|
||||
return {
|
||||
transform: `rotateX(180deg) translate(-50%, -50%) rotate(${
|
||||
360 - angle.value
|
||||
}deg) translateY(100%)`,
|
||||
}deg) translateY(105%)`,
|
||||
};
|
||||
});
|
||||
|
||||
@@ -119,9 +119,12 @@ async function onReceiveMessage(messages = []) {
|
||||
msg.constructor === MESSAGETYPES.ShootSyncMeArrowID ||
|
||||
msg.constructor === MESSAGETYPES.ShootResult
|
||||
) {
|
||||
if (msg.userId === user.value.id) {
|
||||
angle.value =
|
||||
!msg.target.ring && msg.target.angle >= 0 ? msg.target.angle : null;
|
||||
if (
|
||||
msg.userId === user.value.id &&
|
||||
!msg.target.ring &&
|
||||
msg.target.angle >= 0
|
||||
) {
|
||||
angle.value = msg.target.angle;
|
||||
dirTimer.value = setTimeout(() => {
|
||||
angle.value = null;
|
||||
}, 1200);
|
||||
|
||||
@@ -19,6 +19,10 @@ const props = defineProps({
|
||||
type: Function,
|
||||
default: null,
|
||||
},
|
||||
scroll: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
});
|
||||
|
||||
const rect = ref({});
|
||||
@@ -166,7 +170,7 @@ onMounted(async () => {
|
||||
|
||||
<template>
|
||||
<scroll-view
|
||||
scroll-y
|
||||
:scroll-y="scroll"
|
||||
scroll-with-animation
|
||||
:scroll-top="scrollTop"
|
||||
class="container"
|
||||
|
||||
@@ -6,17 +6,9 @@ const props = defineProps({
|
||||
type: Object,
|
||||
default: () => {},
|
||||
},
|
||||
onRemove: {
|
||||
type: Function,
|
||||
default: null,
|
||||
},
|
||||
});
|
||||
const bowOptions = ref({});
|
||||
const targetOptions = ref({});
|
||||
// 使用插槽自定义右侧按钮为图标,若需要文字按钮可恢复 rightOptions
|
||||
|
||||
// 根据是否传入 onRemove 来决定是否允许左滑
|
||||
const canSwipe = computed(() => typeof props.onRemove === "function");
|
||||
|
||||
const toDetailPage = () => {
|
||||
const config = uni.getStorageSync("point-book-config");
|
||||
@@ -46,60 +38,41 @@ onMounted(() => {
|
||||
targetOptions.value[item.id] = item;
|
||||
});
|
||||
});
|
||||
|
||||
const onSwipeActionClick = () => {
|
||||
if (typeof props.onRemove === "function") props.onRemove(props.data);
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<uni-swipe-action>
|
||||
<uni-swipe-action-item :disabled="!canSwipe" @change="() => {}">
|
||||
<template v-slot:right v-if="canSwipe">
|
||||
<view class="swipe-right" @click="onSwipeActionClick">
|
||||
<image
|
||||
class="swipe-icon"
|
||||
src="../static/delete-white.png"
|
||||
mode="widthFix"
|
||||
/>
|
||||
</view>
|
||||
</template>
|
||||
<view class="container" @click="toDetailPage">
|
||||
<view class="left-part">
|
||||
<view class="labels">
|
||||
<view></view>
|
||||
<text>{{
|
||||
bowOptions[data.bowType] ? bowOptions[data.bowType].name : ""
|
||||
}}</text>
|
||||
<text>{{ data.distance }} 米</text>
|
||||
<text>{{
|
||||
targetOptions[data.targetType]
|
||||
? targetOptions[data.targetType].name
|
||||
: ""
|
||||
}}</text>
|
||||
</view>
|
||||
<view>
|
||||
<text>{{ data.createAt }}</text>
|
||||
</view>
|
||||
<view>
|
||||
<text
|
||||
>黄心率:{{ Number((data.yellowRate * 100).toFixed(2)) }}%</text
|
||||
>
|
||||
<text>10环数:{{ data.tenRings }}</text>
|
||||
<text>平均:{{ data.averageRing }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="right-part">
|
||||
<image src="../static/bow-target.png" mode="widthFix" />
|
||||
<view class="arrow-amount">
|
||||
<text>{{ data.actualTotalRing }}</text>
|
||||
<text>/</text>
|
||||
<text>{{ data.totalRing }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="container" @click="toDetailPage">
|
||||
<view class="left-part">
|
||||
<view class="labels">
|
||||
<view></view>
|
||||
<text>{{
|
||||
bowOptions[data.bowType] ? bowOptions[data.bowType].name : ""
|
||||
}}</text>
|
||||
<text>{{ data.distance }} 米</text>
|
||||
<text>{{
|
||||
targetOptions[data.targetType]
|
||||
? targetOptions[data.targetType].name
|
||||
: ""
|
||||
}}</text>
|
||||
</view>
|
||||
</uni-swipe-action-item>
|
||||
</uni-swipe-action>
|
||||
<view>
|
||||
<text>{{ data.createAt }}</text>
|
||||
</view>
|
||||
<view>
|
||||
<text>黄心率:{{ Number((data.yellowRate * 100).toFixed(2)) }}%</text>
|
||||
<text>10环数:{{ data.tenRings }}</text>
|
||||
<text>平均:{{ data.averageRing }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="right-part">
|
||||
<image src="../static/bow-target.png" mode="widthFix" />
|
||||
<view class="arrow-amount">
|
||||
<text>{{ data.actualTotalRing }}</text>
|
||||
<text>/</text>
|
||||
<text>{{ data.totalRing }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
@@ -176,18 +149,4 @@ const onSwipeActionClick = () => {
|
||||
font-size: 30rpx;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
/* 右侧滑动按钮(自定义宽度与图标) */
|
||||
.swipe-right {
|
||||
width: 120rpx; /* 这里可按需调整按钮宽度 */
|
||||
height: 100%;
|
||||
background-color: #ff7c7c;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.swipe-icon {
|
||||
width: 44rpx;
|
||||
height: 44rpx;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user