细节优化
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user