细节优化

This commit is contained in:
kron
2025-06-22 15:04:10 +08:00
parent bd438e7b62
commit 1e681b46c7
11 changed files with 115 additions and 63 deletions

View File

@@ -18,7 +18,7 @@ const tabs = [
];
function handleTabClick(index) {
if (index !== 2 && !user.value.id) return props.signin();
if (index !== 0 && !user.value.id) return props.signin();
if (index === 0) {
uni.navigateTo({
url: "/pages/be-vip",

View File

@@ -1,5 +1,6 @@
<script setup>
import { ref } from "vue";
import { debounce } from "@/util";
const props = defineProps({
width: {
type: String,
@@ -28,15 +29,23 @@ const props = defineProps({
});
const loading = ref(false);
const onBtnClick = async () => {
const timer = ref(null);
const onBtnClick = debounce(async () => {
if (props.disabled || loading.value) return;
loading.value = true;
let loadingTimer = null;
loadingTimer = setTimeout(() => {
loading.value = true;
}, 300);
try {
await props.onClick();
} finally {
clearTimeout(loadingTimer);
loading.value = false;
}
};
});
</script>
<template>

View File

@@ -50,9 +50,8 @@ const handleChange = (e) => {
<style scoped>
.swiper-container {
width: calc(100% - 20px);
margin: 10px;
height: 560px;
width: 100%;
height: 570px;
position: relative;
border-radius: 10px;
overflow: hidden;
@@ -64,12 +63,13 @@ const handleChange = (e) => {
}
.swiper-container image {
width: 100%;
width: calc(100% - 20px);
margin: 10px;
}
.dots {
position: absolute;
bottom: 14%;
bottom: 13%;
left: 50%;
transform: translateX(-50%);
display: flex;