fix logo, delete card

This commit is contained in:
2026-02-19 13:49:13 +03:30
parent b8c919d232
commit 984d9edde2
8 changed files with 52 additions and 25 deletions
+11 -8
View File
@@ -98,8 +98,6 @@
<!-- <div class="flex justify-center">خرید </div>
<div class="flex justify-center">محصول </div>-->
</div>
</div>
<!-- <div :class="setNavColor('buyProduct')" class="tab" @click="setRoute('buyProduct')">
<Icon icon="vuesax-linear:coin" />
@@ -207,8 +205,8 @@ function setRoute(val: string) {
}
.main_in {
height: 70px;
width: 70px;
aspect-ratio: 1 / 1;
.circle_in {
margin-top: -10px;
@@ -223,21 +221,26 @@ function setRoute(val: string) {
flex-wrap: wrap;
background-color: @App-primary-color;
.circle_into {
overflow:hidden;
@apply bg-primary;
border-radius: 100%;
width: 90%;
width: 56px;
height: 56px;
aspect-ratio: 1 / 1;
display: flex;
justify-content: center;
align-content: center;
flex-wrap: wrap;
height: 90%;
border: white 1px solid;
}
.circle_into img {
width: 100%;
height: 100%;
object-fit: cover;
}
}
}
}
@@ -8,11 +8,17 @@
<div class="flex justify-between w-full">
<div class="text-white font-bold text-lg w-full">{{ props.title }}</div>
<div
class="text-white px-2 flex justify-center items-center rounded-lg w-5rem"
class="text-white px-1 flex justify-center items-center rounded-lg w-6rem"
:class="active ? 'bg-green-600' : 'bg-red-600'"
>
{{ active ? 'فعال' : 'غیر فعال' }}
</div>
<div
@click="deleteCards"
class="text-white px-1 flex mr-1 justify-center items-center rounded-lg bg-red-600 w-7rem"
>
حذف کارت
</div>
</div>
<div
v-if="props.cardNumber"
@@ -31,6 +37,7 @@
<script lang="ts" setup>
import { computed } from 'vue'
import { useCardNumber, useShabaNumber } from '@/utils/useCardNumber'
import {deleteCard} from "@/api/wallet";
interface Prop {
sliderIndex: number
@@ -40,6 +47,7 @@ interface Prop {
shaba?: string
color?: string
active?: boolean
id?: number
}
const localValue = computed({
@@ -53,7 +61,7 @@ const localValue = computed({
})
const props = defineProps<Prop>()
const emits = defineEmits(['update:sliderIndex'])
const emits = defineEmits(['update:sliderIndex', 'cardDeleted'])
function findPositionStyle(pos: number) {
// console.log(localValue.value)
@@ -82,6 +90,15 @@ function findPositionStyle(pos: number) {
return debug
}
async function deleteCards() {
try {
await deleteCard(props?.id)
emits('cardDeleted')
} catch (e) {
console.error('Error deleting card:', e)
}
}
/*
function findPositionStyle(pos: number) {
// console.log(localValue.value)
@@ -142,6 +159,8 @@ function topDetail(isAfterIndex: boolean, pos: number) {
function checkTopLimit(val: number) {
return val > 100 || val < 0
}
</script>
<style lang="sass" scoped>
@@ -4,7 +4,8 @@
<div ref="el" class="w-full flex flex-col relative h-full test">
<CardItem v-for="(item,i) in props?.items" :key="i" v-model:sliderIndex="index" :card-number="item?.cart_number"
:color="colors[i%3]"
:self-index="i" :shaba="item?.shaba_number" :title="item?.bank_name" :active="item.sts === 2"/>
:self-index="i" :shaba="item?.shaba_number" :title="item?.bank_name" :active="item.sts === 2" :id="item?.id"
@cardDeleted="handleCardDeleted"/>
<div class="absolute bottom-15vh right-0 left-0 z-100 flex justify-center items-center opacity-70">
<div class="flex gap-1 bg-gray-500 px-2 py-1 rounded-lg">
<Transition name="slide-up" mode="out-in" v-for="i in items.length" :key="i">
@@ -35,7 +36,11 @@ interface Prop {
}
const props = defineProps<Prop>()
const emits = defineEmits(['update:id'])
const emits = defineEmits(['update:id', 'cardDeleted'])
function handleCardDeleted() {
emits('cardDeleted')
}
const localValue = computed({
get() {
@@ -19,16 +19,15 @@
<div class="card bg-pink" :style="findPositionStyle(9)" @click="index = 9"></div>-->
<CardItem v-for="(item,i) in props?.items" :key="i" v-model:sliderIndex="index"
:color="colors[i%3]"
:self-index="i" :img="item"/>
:self-index="i"
:img="item"
/>
</div>
</div>
</template>
<script lang="ts" setup>
import { onMounted, onUnmounted, ref, watch } from 'vue'
// import {usePointerSwipe} from '@vueuse/core'
// import type {UseSwipeDirection} from '@vueuse/core'
// import type { UseSwipeDirection } from '@vueuse/core'
import { useSwipe } from '@vueuse/core'
import CardItem from '@/views/base/wallet/components/CardItem.vue'
import type { Card } from '@/models/wallet'
+1
View File
@@ -121,6 +121,7 @@
v-model:id="form.card_id"
class="card-slider-wrap mt-[2vh] px-3 fixed bottom-10 right-0 left-0"
style="touch-action: none"
@cardDeleted="getCards"
/>
<div
v-else-if="!loading && cardItems.length === 0"