feat: 接口对接完成

This commit is contained in:
anonymous
2025-01-03 16:44:05 +08:00
parent 0889d068a8
commit 2d19bbce4c
37 changed files with 1220 additions and 398 deletions
+60 -10
View File
@@ -23,10 +23,17 @@
<view
class="flex items-center text-14 mt-15 text-#333 p-16 shadow-[0_0_10px_rgba(10,68,245,0.1)] rounded-10"
>
<input type="number" placeholder="请输入提现金额" class="text-14 text-#333 flex-1" />
<view class="text-12 text-#04A9F9">全部</view>
<input
v-model="form.money"
type="number"
placeholder="请输入提现金额"
class="text-14 text-#333 flex-1"
/>
<view class="text-12 text-#04A9F9" @click="form.money = userStore.userInfo.money">
全部
</view>
</view>
<view class="text-12 text-#889BC6 mt-15">当前余额10012.12</view>
<view class="text-12 text-#889BC6 mt-15">当前余额{{ userStore.userInfo.money }}</view>
</view>
<view class="mt-50">
@@ -35,7 +42,9 @@
class="flex items-center text-14 mt-15 text-#333 p-16 shadow-[0_0_10px_rgba(10,68,245,0.1)] rounded-10"
@click="onSelectPayType"
>
<view class="flex-1">请选择收款方式</view>
<view class="flex-1">
{{ typeName ? `${typeName}${currentBank?.card_account}` : '请选择收款方式' }}
</view>
<wd-icon name="arrow-right" size="16px"></wd-icon>
</view>
</view>
@@ -43,7 +52,12 @@
<view class="mt-50">
<view class="text-14 text-#333">交易密码</view>
<view class="text-14 mt-15 text-#333 p-16 shadow-[0_0_10px_rgba(10,68,245,0.1)] rounded-10">
<input type="password" placeholder="请输入交易密码" class="text-14 text-#333" />
<input
v-model="form.tpassword"
type="password"
placeholder="请输入交易密码"
class="text-14 text-#333"
/>
</view>
</view>
</view>
@@ -65,6 +79,17 @@
<script setup lang="ts">
import NavBar from '@/components/NavBar.vue'
import { submitWithdrawalAPI } from '@/service'
import { useUserStore } from '@/store'
import { showModal } from '@/utils'
const userStore = useUserStore()
const form = ref({
money: '',
bankid: '6',
tpassword: '',
})
const onWithdrawalDetail = () => {
uni.navigateTo({
@@ -72,19 +97,44 @@ const onWithdrawalDetail = () => {
})
}
const typeName = computed(() => {
return ['支付宝', '微信', '银行卡'][Number(unref(currentBank)?.card_type) - 1]
})
const currentBank = ref<any>(null)
const onSelectPayType = () => {
uni.$once('withdrawal-type', (data: any) => {
console.log(data)
form.value.bankid = data.id
currentBank.value = data
})
uni.navigateTo({
url: '/pages-sub/withdrawal-type/index?type=select',
})
}
const onSubmit = () => {
uni.redirectTo({
url: '/pages-sub/invest-result/index',
})
const onSubmit = async () => {
if (!form.value.money) {
return uni.showToast({
title: '请输入提现金额',
icon: 'none',
})
}
if (!form.value.bankid) {
return uni.showToast({
title: '请选择收款方式',
icon: 'none',
})
}
if (!form.value.tpassword) {
return uni.showToast({
title: '请输入交易密码',
icon: 'none',
})
}
await showModal('确认提现?')
await submitWithdrawalAPI(form.value)
await showModal('提交成功')
onWithdrawalDetail()
}
</script>