样式更新
This commit is contained in:
@@ -235,16 +235,14 @@ button::after {
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
margin-top: 5px;
|
margin-top: 20rpx;
|
||||||
}
|
}
|
||||||
.see-more > text {
|
.see-more > text {
|
||||||
color: #39a8ff;
|
color: #39a8ff;
|
||||||
margin-top: 2px;
|
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
}
|
}
|
||||||
.see-more > image {
|
.see-more > image {
|
||||||
width: 15px;
|
width: 15px;
|
||||||
margin-top: 2px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ const dragStartPos = ref({ x: 0, y: 0 });
|
|||||||
const capsuleHeight = ref(0);
|
const capsuleHeight = ref(0);
|
||||||
const scale = ref(1);
|
const scale = ref(1);
|
||||||
const scrollTop = ref(0);
|
const scrollTop = ref(0);
|
||||||
|
const selected = ref(null);
|
||||||
let lastMoveTime = 0;
|
let lastMoveTime = 0;
|
||||||
|
|
||||||
// 点击靶纸创建新的点
|
// 点击靶纸创建新的点
|
||||||
@@ -160,39 +161,42 @@ const getNewPos = () => {
|
|||||||
return { left: "calc(50% - 12px)", bottom: "-12px" };
|
return { left: "calc(50% - 12px)", bottom: "-12px" };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const setEditArrow = (data) => {
|
||||||
|
selected.value = data;
|
||||||
|
// if (data === null) {
|
||||||
|
// arrow.value = null;
|
||||||
|
// scale.value = 1;
|
||||||
|
// scrollTop.value = 0;
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
// if (props.id === 7 || props.id === 9) {
|
||||||
|
// scale.value = 1.4;
|
||||||
|
// const viewportH = rect.value.width; // 容器高度等于宽度(100vw)
|
||||||
|
// const contentH = scale.value * rect.value.width; // 内容高度
|
||||||
|
// const clickYInContainer = contentH * data.y - rect.value.top;
|
||||||
|
// let target = clickYInContainer * scale.value - viewportH / 2;
|
||||||
|
// target = Math.max(0, Math.min(contentH - viewportH, target));
|
||||||
|
// setTimeout(() => {
|
||||||
|
// scrollTop.value = target > 180 ? target + 10 : target;
|
||||||
|
// }, 200);
|
||||||
|
// }
|
||||||
|
// arrow.value = {
|
||||||
|
// ...data,
|
||||||
|
// x: data.x * scale.value,
|
||||||
|
// y: data.y * scale.value,
|
||||||
|
// };
|
||||||
|
};
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
const menuBtnInfo = uni.getMenuButtonBoundingClientRect();
|
const menuBtnInfo = uni.getMenuButtonBoundingClientRect();
|
||||||
capsuleHeight.value = menuBtnInfo.top - 9;
|
capsuleHeight.value = menuBtnInfo.top - 9;
|
||||||
const result = await getElementRect(".container");
|
const result = await getElementRect(".container");
|
||||||
rect.value = result;
|
rect.value = result;
|
||||||
uni.$on("set-edit-arrow", (data) => {
|
uni.$on("set-edit-arrow", setEditArrow);
|
||||||
if (data === null) {
|
|
||||||
arrow.value = null;
|
|
||||||
scale.value = 1;
|
|
||||||
scrollTop.value = 0;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (props.id === 7 || props.id === 9) {
|
|
||||||
scale.value = 1.4;
|
|
||||||
const viewportH = rect.value.width; // 容器高度等于宽度(100vw)
|
|
||||||
const contentH = scale.value * rect.value.width; // 内容高度
|
|
||||||
const clickYInContainer = contentH * data.y - rect.value.top;
|
|
||||||
let target = clickYInContainer * scale.value - viewportH / 2;
|
|
||||||
target = Math.max(0, Math.min(contentH - viewportH, target));
|
|
||||||
setTimeout(() => {
|
|
||||||
scrollTop.value = target > 180 ? target + 10 : target;
|
|
||||||
}, 200);
|
|
||||||
}
|
|
||||||
arrow.value = {
|
|
||||||
...data,
|
|
||||||
x: data.x * scale.value,
|
|
||||||
y: data.y * scale.value,
|
|
||||||
};
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
uni.$off("set-edit-arrow");
|
uni.$off("set-edit-arrow", setEditArrow);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -220,7 +224,9 @@ onBeforeUnmount(() => {
|
|||||||
<view
|
<view
|
||||||
v-for="(arrow, index) in arrows"
|
v-for="(arrow, index) in arrows"
|
||||||
:key="index"
|
:key="index"
|
||||||
class="arrow-point"
|
:class="`arrow-point ${
|
||||||
|
selected !== null && index === selected ? 'selected-arrow-point' : ''
|
||||||
|
}`"
|
||||||
:style="{
|
:style="{
|
||||||
left: (arrow.x !== undefined ? arrow.x : 0) * 100 + '%',
|
left: (arrow.x !== undefined ? arrow.x : 0) * 100 + '%',
|
||||||
top: (arrow.y !== undefined ? arrow.y : 0) * 100 + '%',
|
top: (arrow.y !== undefined ? arrow.y : 0) * 100 + '%',
|
||||||
@@ -411,4 +417,15 @@ onBeforeUnmount(() => {
|
|||||||
height: 115px;
|
height: 115px;
|
||||||
background-color: #ff000055;
|
background-color: #ff000055;
|
||||||
}
|
}
|
||||||
|
.selected-arrow-point .point {
|
||||||
|
background: linear-gradient(180deg, #ffdaa6 0%, #e9a333 100%) !important;
|
||||||
|
box-shadow: 0rpx 2rpx 4rpx 0rpx rgba(0, 0, 0, 0.18);
|
||||||
|
animation: duang 0.35s ease-out;
|
||||||
|
}
|
||||||
|
@keyframes duang {
|
||||||
|
0% { transform: translate(-50%, -50%) scale(0.7); }
|
||||||
|
45% { transform: translate(-50%, -50%) scale(1.4); }
|
||||||
|
70% { transform: translate(-50%, -50%) scale(0.9); }
|
||||||
|
100% { transform: translate(-50%, -50%) scale(1); }
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ const onClick = async () => {
|
|||||||
}
|
}
|
||||||
.rank-item > text:nth-child(1) {
|
.rank-item > text:nth-child(1) {
|
||||||
width: 52rpx;
|
width: 52rpx;
|
||||||
font-size: 30rpx;
|
font-size: 28rpx;
|
||||||
color: #333333;
|
color: #333333;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ const onSelectArrow = (index) => {
|
|||||||
currentArrow.value = index;
|
currentArrow.value = index;
|
||||||
const arrow = arrowGroups.value[currentGroup.value][currentArrow.value];
|
const arrow = arrowGroups.value[currentGroup.value][currentArrow.value];
|
||||||
if (arrow && arrow.x && arrow.y) {
|
if (arrow && arrow.x && arrow.y) {
|
||||||
uni.$emit("set-edit-arrow", arrow);
|
uni.$emit("set-edit-arrow", index);
|
||||||
} else {
|
} else {
|
||||||
uni.$emit("set-edit-arrow", null);
|
uni.$emit("set-edit-arrow", null);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -324,7 +324,7 @@ onShareTimeline(() => {
|
|||||||
</view>
|
</view>
|
||||||
<view class="statistics-item">
|
<view class="statistics-item">
|
||||||
<text>{{ data.averageRing || "-" }}</text>
|
<text>{{ data.averageRing || "-" }}</text>
|
||||||
<text>箭</text>
|
<text>环</text>
|
||||||
<text>平均环数</text>
|
<text>平均环数</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
Reference in New Issue
Block a user