fix: 修复bug

This commit is contained in:
anonymous
2025-01-03 22:39:31 +08:00
parent db653bba97
commit 4ff9d1d182
2 changed files with 55 additions and 33 deletions
+26 -4
View File
@@ -10,10 +10,9 @@
<template>
<view class="withdrawal-type-page min-h-screen pb-100">
<template v-if="list.length > 0">
<wd-swipe-action v-for="item in list" :key="item.id">
<view
class="flex items-center justify-between py-15 text-14 shadow-[0_0_10px_rgba(10,68,245,0.1)] rounded-10 m-15 p-15"
v-for="item in list"
:key="item.id"
@click="onSelectType(item)"
>
<image
@@ -42,6 +41,15 @@
</view>
<wd-icon v-if="isSelect" name="arrow-right" size="14px"></wd-icon>
</view>
<template #right>
<view
class="px-15 mr-15 rounded-10 bg-#ff000040 h-full flex items-center text-14 text-red-600"
@click="onDelete(item)"
>
删除
</view>
</template>
</wd-swipe-action>
</template>
<template v-else>
<wd-status-tip image="content" tip="暂无内容" />
@@ -55,7 +63,8 @@
</template>
<script setup lang="ts">
import { getBankCardListAPI } from '@/service'
import { deleteBankCardAPI, getBankCardListAPI } from '@/service'
import { showModal } from '@/utils'
import { onLoad } from '@dcloudio/uni-app'
const isSelect = ref(false)
@@ -82,8 +91,21 @@ const onAddType = () => {
})
}
const onDelete = async (item) => {
await showModal('确认删除?')
await deleteBankCardAPI({
card_account: item.card_account,
})
await showModal('删除成功')
loadData()
}
const list = ref([])
onShow(async () => {
const loadData = async () => {
list.value = (await getBankCardListAPI().then((res) => res.data)) as any
}
onShow(async () => {
loadData()
})
</script>
+1 -1
View File
@@ -70,7 +70,7 @@
class="bg-white fixed bottom-0 left-0 right-0 px-15 py-10 shadow-[0_0_10px_rgba(10,68,245,0.1)]"
>
<view class="flex items-center pb-safe">
<view class="text-gradient flex-1 text-14">到账CNY:13123.00</view>
<view class="text-gradient flex-1 text-14">到账CNY:{{ form.cash_money }}</view>
<view
class="btn-gradient text-center text-white rounded-full text-14 px-30 py-10"
@click="onSubmit"