完成发现,个人中心
This commit is contained in:
@@ -8,12 +8,14 @@
|
||||
getUserBankList,
|
||||
getUserWithdrawConfig,
|
||||
getUserIntegral,
|
||||
addUserWithdraw
|
||||
} from '/api/my-index'
|
||||
addUserWithdraw,
|
||||
getUserPayPwd
|
||||
} from '@/api/my-index'
|
||||
import { useUI } from '@/utils/use-ui'
|
||||
|
||||
const { showToast, showDialog } = useUI()
|
||||
|
||||
const tixian = ref(null)
|
||||
const popup = ref(null)
|
||||
const topData = ref({})
|
||||
const formData = reactive({
|
||||
@@ -99,14 +101,36 @@
|
||||
return
|
||||
}
|
||||
|
||||
const data = {
|
||||
amount: formData.nuber,
|
||||
withdrawalType: topData.value.withdrawalType,
|
||||
paymentAccountId: formData.paymentAccountId
|
||||
const res = await getUserPayPwd()
|
||||
if (res?.data) {
|
||||
tixian.value.open()
|
||||
} else {
|
||||
const show = await showDialog('提示', '请先设置支付密码')
|
||||
if (show) {
|
||||
navigateTo('/pages/my-index/wallet/edit-password', { type: 0 })
|
||||
}
|
||||
}
|
||||
// await addUserWithdraw(data)
|
||||
// await showToast(`提现成功`, 'success')
|
||||
// navigateBack()
|
||||
}
|
||||
|
||||
const submit = async e => {
|
||||
try {
|
||||
const data = {
|
||||
payPassword: e.join(''),
|
||||
amount: formData.nuber,
|
||||
withdrawalType: topData.value.withdrawalType,
|
||||
paymentAccountId: formData.paymentAccountId
|
||||
}
|
||||
tixian.value.close()
|
||||
await addUserWithdraw(data)
|
||||
await showToast(`提现成功`, 'success')
|
||||
navigateBack()
|
||||
} catch (error) {
|
||||
tixian.value.close()
|
||||
console.log(error)
|
||||
}
|
||||
await addUserWithdraw(data)
|
||||
await showToast(`提现成功`, 'success')
|
||||
navigateBack()
|
||||
}
|
||||
|
||||
onShow(() => {
|
||||
@@ -119,6 +143,8 @@
|
||||
<view class="withdraw-box">
|
||||
<nav-bar isTopBg isPlaceholder title="提现"></nav-bar>
|
||||
|
||||
<uu-pwdModal ref="tixian" @success="submit"></uu-pwdModal>
|
||||
|
||||
<view class="view-box">
|
||||
<!-- 选择提现方式 -->
|
||||
<view class="withdraw-way">
|
||||
|
||||
Reference in New Issue
Block a user