index.vue 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <template>
  2. <app-view class="bank-sign g-form">
  3. <template #header>
  4. <app-navbar title="签约账户管理" />
  5. </template>
  6. <div class="bank-sign__container" v-if="bankInfo">
  7. <CellGroup>
  8. <Cell title="开户银行" :value="bankInfo.bankname" />
  9. <Cell title="银行卡号" :value="bankInfo.bankaccountno" />
  10. <Cell title="姓名" :value="bankInfo.bankaccountname" />
  11. <Cell title="支行名称" :value="bankInfo.branchbankname" />
  12. <Cell title="状态" :value="getSignStatusName(bankInfo.signstatus)" />
  13. </CellGroup>
  14. </div>
  15. <div class="bank-sign__empty" v-else>
  16. <Empty description="您还未添加签约账户" />
  17. <Button type="primary" @click="$router.push({ name: 'add-banksign' })" round>添加签约账户</Button>
  18. </div>
  19. <template #footer>
  20. <div class="g-form__footer" v-if="bankInfo">
  21. <Button type="warning" round block @click="formSubmit">解约</Button>
  22. <Button type="primary" round block @click="routerTo('add-banksign')">修改</Button>
  23. </div>
  24. </template>
  25. </app-view>
  26. </template>
  27. <script lang="ts" setup>
  28. import { CellGroup, Cell, Button, Empty, Toast } from 'vant'
  29. import { fullloading, dialog } from '@/utils/vant'
  30. import { getSignStatusName } from '@/constants/bank'
  31. import { useDoCancelBankSign } from '@/business/bank'
  32. import { useNavigation } from '@/hooks/navigation'
  33. const { cancelSubmit, bankInfo } = useDoCancelBankSign()
  34. const { router, routerTo } = useNavigation()
  35. const formSubmit = () => {
  36. dialog('确认解约?', {
  37. showCancelButton: true
  38. }).then(() => {
  39. fullloading((hideLoading) => {
  40. cancelSubmit().then(() => {
  41. hideLoading()
  42. dialog('签约提交成功,请耐心等待审核。').then(() => {
  43. router.back()
  44. })
  45. }).catch((err) => {
  46. Toast.fail(err)
  47. })
  48. })
  49. })
  50. }
  51. </script>
  52. <style lang="less">
  53. @import './index.less';
  54. </style>