fix: 修复bug
This commit is contained in:
@@ -10,38 +10,46 @@
|
||||
<template>
|
||||
<view class="withdrawal-type-page min-h-screen pb-100">
|
||||
<template v-if="list.length > 0">
|
||||
<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
|
||||
v-if="Number(item.card_type) === 1"
|
||||
class="w-45 h-45"
|
||||
src="@/static/images/invest/unionpay-icon.png"
|
||||
mode="aspectFit"
|
||||
/>
|
||||
<image
|
||||
v-if="Number(item.card_type) === 2"
|
||||
class="w-45 h-45"
|
||||
src="@/static/images/invest/alipay-icon.png"
|
||||
mode="aspectFit"
|
||||
/>
|
||||
<image
|
||||
v-if="Number(item.card_type) === 3"
|
||||
class="w-45 h-45"
|
||||
src="@/static/images/invest/wechat-icon.png"
|
||||
mode="aspectFit"
|
||||
/>
|
||||
<view class="flex-1 ml-15">
|
||||
<view class="text-16 font-bold">
|
||||
{{ ['银行卡', '支付宝', '微信'][Number(item.card_type) - 1] }}
|
||||
<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"
|
||||
@click="onSelectType(item)"
|
||||
>
|
||||
<image
|
||||
v-if="Number(item.card_type) === 1"
|
||||
class="w-45 h-45"
|
||||
src="@/static/images/invest/unionpay-icon.png"
|
||||
mode="aspectFit"
|
||||
/>
|
||||
<image
|
||||
v-if="Number(item.card_type) === 2"
|
||||
class="w-45 h-45"
|
||||
src="@/static/images/invest/alipay-icon.png"
|
||||
mode="aspectFit"
|
||||
/>
|
||||
<image
|
||||
v-if="Number(item.card_type) === 3"
|
||||
class="w-45 h-45"
|
||||
src="@/static/images/invest/wechat-icon.png"
|
||||
mode="aspectFit"
|
||||
/>
|
||||
<view class="flex-1 ml-15">
|
||||
<view class="text-16 font-bold">
|
||||
{{ ['银行卡', '支付宝', '微信'][Number(item.card_type) - 1] }}
|
||||
</view>
|
||||
<view class="mt-10 text-14 text-#889BC6">{{ item.card_account }}</view>
|
||||
</view>
|
||||
<view class="mt-10 text-14 text-#889BC6">{{ item.card_account }}</view>
|
||||
<wd-icon v-if="isSelect" name="arrow-right" size="14px"></wd-icon>
|
||||
</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>
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user