Files
xl-mobile/src/pages/addPaymentAccount/index.vue

87 lines
2.1 KiB
Vue
Raw Normal View History

2025-04-14 17:26:40 +08:00
<script setup>
import {defineAsyncComponent, ref} from "vue";
import XNav from "../../components/XNav.vue";
import XNoticeBar from "../../components/XNoticeBar.vue";
2025-05-21 15:45:10 +08:00
import {onLoad} from "@dcloudio/uni-app";
import Api from "../../api/index.js";
import {showToast} from "../../utils/uils.js";
2025-04-14 17:26:40 +08:00
2025-05-06 11:36:14 +08:00
// #ifdef APP-PLUS
import AliPay from "./components/AliPay.vue";
import BankPay from "./components/BankPay.vue";
// #endif
// #ifndef APP-PLUS
2025-04-14 17:26:40 +08:00
const AliPay = defineAsyncComponent(() => import('./components/AliPay.vue'));
const BankPay = defineAsyncComponent(() => import('./components/BankPay.vue'));
2025-05-06 11:36:14 +08:00
// #endif
2025-04-14 17:26:40 +08:00
2025-05-21 15:45:10 +08:00
const id = ref(null);
2025-04-14 17:26:40 +08:00
const currentTab = ref(0);
const tabs = [
{
name: '支付宝账号',
component: AliPay,
},
{
name: '银行卡账号',
component: BankPay,
},
];
const change = (e) => {
2025-05-21 15:45:10 +08:00
if (id.value) {
showToast('无法修改类型');
return;
}
2025-04-14 17:26:40 +08:00
currentTab.value = e.index;
}
2025-05-21 15:45:10 +08:00
onLoad((options) => {
const {id: _id} = options;
if (_id) {
id.value = _id;
Api.system.getWithdrawalInfo(id.value).then(({data}) => {
currentTab.value = data.type - 1;
});
}
});
2025-04-14 17:26:40 +08:00
</script>
<template>
<!-- 立即提现 -->
<x-nav></x-nav>
<x-notice-bar
status="success"
:tile="true"
2025-05-21 15:45:10 +08:00
text-color="var(--primary-color)"
2025-07-07 18:08:16 +08:00
:text="['平台承诺:所有信息仅用于打款,不会用作其他用途。为了您的资金安全,大额提现会通过第三方支付代发,请填写实名信息和银行卡进行验证。']">
2025-04-14 17:26:40 +08:00
</x-notice-bar>
<view class="bg-[#fff]">
<tui-tabs
:tabs="tabs"
:currentTab="currentTab"
@change="change"
width="300">
</tui-tabs>
<Suspense>
<template #default>
<view class="px-[34rpx] !mt-[40rpx]">
2025-05-21 15:45:10 +08:00
<component :is="tabs[currentTab].component" :id="id"></component>
2025-04-14 17:26:40 +08:00
</view>
</template>
<template #fallback>
加载中...
</template>
</Suspense>
</view>
</template>
<style scoped lang="scss">
</style>