fix logo, delete card
This commit is contained in:
+4
-9
@@ -157,23 +157,18 @@ function update() {
|
|||||||
position: fixed;
|
position: fixed;
|
||||||
bottom: 90px;
|
bottom: 90px;
|
||||||
right: 20px;
|
right: 20px;
|
||||||
width: 60px;
|
width: 70px;
|
||||||
height: 60px;
|
height: 70px;
|
||||||
border-radius: 50%;
|
//border-radius: 50%;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
box-shadow: 0 4px 10px rgba(0,0,0,0.3);
|
//box-shadow: 0 4px 10px rgba(0,0,0,0.3);
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: transform 0.2s ease, box-shadow 0.2s ease;
|
transition: transform 0.2s ease, box-shadow 0.2s ease;
|
||||||
z-index: 9999;
|
z-index: 9999;
|
||||||
}
|
}
|
||||||
|
|
||||||
#support-button:hover {
|
|
||||||
transform: scale(1.1);
|
|
||||||
box-shadow: 0 6px 14px rgba(0,0,0,0.3);
|
|
||||||
}
|
|
||||||
|
|
||||||
@media screen and (min-width: 426px) {
|
@media screen and (min-width: 426px) {
|
||||||
.desktopConfig {
|
.desktopConfig {
|
||||||
width: 426px;
|
width: 426px;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import useAxios from '@/utils/useAxios'
|
import useAxios from '@/utils/useAxios'
|
||||||
import type { Card, Wallet } from '@/models/wallet'
|
import type { Card, Wallet } from '@/models/wallet'
|
||||||
import type {Transaction} from '@/models/transaction'
|
import type {Transaction} from '@/models/transaction'
|
||||||
|
import type {Address} from "@/models/address";
|
||||||
|
|
||||||
export const getWallet = async () => await useAxios.get<Wallet>(`/customer/wallet/me`)
|
export const getWallet = async () => await useAxios.get<Wallet>(`/customer/wallet/me`)
|
||||||
|
|
||||||
@@ -16,6 +17,10 @@ export const createCard = async (obj: Card): Promise<any> => {
|
|||||||
return await useAxios.post<Transaction>(`/customer/account`, obj)
|
return await useAxios.post<Transaction>(`/customer/account`, obj)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function deleteCard(id: number) {
|
||||||
|
return await useAxios.delete(`customer/account/${id}`)
|
||||||
|
}
|
||||||
|
|
||||||
export const getActivatedCards = async () => await useAxios.get<Card[]>(`/customer/account/active`)
|
export const getActivatedCards = async () => await useAxios.get<Card[]>(`/customer/account/active`)
|
||||||
|
|
||||||
export const confirmCode = async (params: WithdrawConfirm): Promise<any> => {
|
export const confirmCode = async (params: WithdrawConfirm): Promise<any> => {
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 26 KiB |
@@ -98,8 +98,6 @@
|
|||||||
<!-- <div class="flex justify-center">خرید </div>
|
<!-- <div class="flex justify-center">خرید </div>
|
||||||
<div class="flex justify-center">محصول </div>-->
|
<div class="flex justify-center">محصول </div>-->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<!-- <div :class="setNavColor('buyProduct')" class="tab" @click="setRoute('buyProduct')">
|
<!-- <div :class="setNavColor('buyProduct')" class="tab" @click="setRoute('buyProduct')">
|
||||||
<Icon icon="vuesax-linear:coin" />
|
<Icon icon="vuesax-linear:coin" />
|
||||||
@@ -207,8 +205,8 @@ function setRoute(val: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.main_in {
|
.main_in {
|
||||||
height: 70px;
|
|
||||||
width: 70px;
|
width: 70px;
|
||||||
|
aspect-ratio: 1 / 1;
|
||||||
|
|
||||||
.circle_in {
|
.circle_in {
|
||||||
margin-top: -10px;
|
margin-top: -10px;
|
||||||
@@ -223,21 +221,26 @@ function setRoute(val: string) {
|
|||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
background-color: @App-primary-color;
|
background-color: @App-primary-color;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.circle_into {
|
.circle_into {
|
||||||
overflow:hidden;
|
overflow:hidden;
|
||||||
@apply bg-primary;
|
@apply bg-primary;
|
||||||
border-radius: 100%;
|
border-radius: 100%;
|
||||||
width: 90%;
|
width: 56px;
|
||||||
|
height: 56px;
|
||||||
|
aspect-ratio: 1 / 1;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-content: center;
|
align-content: center;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
height: 90%;
|
|
||||||
border: white 1px solid;
|
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="flex justify-between w-full">
|
||||||
<div class="text-white font-bold text-lg w-full">{{ props.title }}</div>
|
<div class="text-white font-bold text-lg w-full">{{ props.title }}</div>
|
||||||
<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'"
|
:class="active ? 'bg-green-600' : 'bg-red-600'"
|
||||||
>
|
>
|
||||||
{{ active ? 'فعال' : 'غیر فعال' }}
|
{{ active ? 'فعال' : 'غیر فعال' }}
|
||||||
</div>
|
</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>
|
||||||
<div
|
<div
|
||||||
v-if="props.cardNumber"
|
v-if="props.cardNumber"
|
||||||
@@ -31,6 +37,7 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed } from 'vue'
|
import { computed } from 'vue'
|
||||||
import { useCardNumber, useShabaNumber } from '@/utils/useCardNumber'
|
import { useCardNumber, useShabaNumber } from '@/utils/useCardNumber'
|
||||||
|
import {deleteCard} from "@/api/wallet";
|
||||||
|
|
||||||
interface Prop {
|
interface Prop {
|
||||||
sliderIndex: number
|
sliderIndex: number
|
||||||
@@ -40,6 +47,7 @@ interface Prop {
|
|||||||
shaba?: string
|
shaba?: string
|
||||||
color?: string
|
color?: string
|
||||||
active?: boolean
|
active?: boolean
|
||||||
|
id?: number
|
||||||
}
|
}
|
||||||
|
|
||||||
const localValue = computed({
|
const localValue = computed({
|
||||||
@@ -53,7 +61,7 @@ const localValue = computed({
|
|||||||
})
|
})
|
||||||
|
|
||||||
const props = defineProps<Prop>()
|
const props = defineProps<Prop>()
|
||||||
const emits = defineEmits(['update:sliderIndex'])
|
const emits = defineEmits(['update:sliderIndex', 'cardDeleted'])
|
||||||
|
|
||||||
function findPositionStyle(pos: number) {
|
function findPositionStyle(pos: number) {
|
||||||
// console.log(localValue.value)
|
// console.log(localValue.value)
|
||||||
@@ -82,6 +90,15 @@ function findPositionStyle(pos: number) {
|
|||||||
return debug
|
return debug
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function deleteCards() {
|
||||||
|
try {
|
||||||
|
await deleteCard(props?.id)
|
||||||
|
emits('cardDeleted')
|
||||||
|
} catch (e) {
|
||||||
|
console.error('Error deleting card:', e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
function findPositionStyle(pos: number) {
|
function findPositionStyle(pos: number) {
|
||||||
// console.log(localValue.value)
|
// console.log(localValue.value)
|
||||||
@@ -142,6 +159,8 @@ function topDetail(isAfterIndex: boolean, pos: number) {
|
|||||||
function checkTopLimit(val: number) {
|
function checkTopLimit(val: number) {
|
||||||
return val > 100 || val < 0
|
return val > 100 || val < 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="sass" scoped>
|
<style lang="sass" scoped>
|
||||||
|
|||||||
@@ -4,7 +4,8 @@
|
|||||||
<div ref="el" class="w-full flex flex-col relative h-full test">
|
<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"
|
<CardItem v-for="(item,i) in props?.items" :key="i" v-model:sliderIndex="index" :card-number="item?.cart_number"
|
||||||
:color="colors[i%3]"
|
: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="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">
|
<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">
|
<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 props = defineProps<Prop>()
|
||||||
const emits = defineEmits(['update:id'])
|
const emits = defineEmits(['update:id', 'cardDeleted'])
|
||||||
|
|
||||||
|
function handleCardDeleted() {
|
||||||
|
emits('cardDeleted')
|
||||||
|
}
|
||||||
|
|
||||||
const localValue = computed({
|
const localValue = computed({
|
||||||
get() {
|
get() {
|
||||||
|
|||||||
@@ -19,16 +19,15 @@
|
|||||||
<div class="card bg-pink" :style="findPositionStyle(9)" @click="index = 9"></div>-->
|
<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"
|
<CardItem v-for="(item,i) in props?.items" :key="i" v-model:sliderIndex="index"
|
||||||
:color="colors[i%3]"
|
:color="colors[i%3]"
|
||||||
:self-index="i" :img="item"/>
|
:self-index="i"
|
||||||
|
:img="item"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { onMounted, onUnmounted, ref, watch } from 'vue'
|
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 { useSwipe } from '@vueuse/core'
|
||||||
import CardItem from '@/views/base/wallet/components/CardItem.vue'
|
import CardItem from '@/views/base/wallet/components/CardItem.vue'
|
||||||
import type { Card } from '@/models/wallet'
|
import type { Card } from '@/models/wallet'
|
||||||
|
|||||||
@@ -121,6 +121,7 @@
|
|||||||
v-model:id="form.card_id"
|
v-model:id="form.card_id"
|
||||||
class="card-slider-wrap mt-[2vh] px-3 fixed bottom-10 right-0 left-0"
|
class="card-slider-wrap mt-[2vh] px-3 fixed bottom-10 right-0 left-0"
|
||||||
style="touch-action: none"
|
style="touch-action: none"
|
||||||
|
@cardDeleted="getCards"
|
||||||
/>
|
/>
|
||||||
<div
|
<div
|
||||||
v-else-if="!loading && cardItems.length === 0"
|
v-else-if="!loading && cardItems.length === 0"
|
||||||
|
|||||||
Reference in New Issue
Block a user