index.vue 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <!-- 会员中心-会员信息-解约 -->
  2. <template>
  3. <app-drawer title="解约" v-model:show="show" :loading="loading" :refresh="refresh">
  4. <div style="font-size:16px;text-align:center">是否解约银行?</div>
  5. <template #footer>
  6. <el-button @click="onCancel(false)" plain>取消</el-button>
  7. <el-button type="primary" @click="onSubmit">确认</el-button>
  8. </template>
  9. </app-drawer>
  10. </template>
  11. <script lang="ts" setup>
  12. import { shallowRef, PropType } from 'vue'
  13. import { ElMessage } from 'element-plus'
  14. import { useBankCancelSign } from '@/business/bank'
  15. import AppDrawer from '@pc/components/base/drawer/index.vue'
  16. const props = defineProps({
  17. bankInfo: {
  18. type: Object as PropType<Ermcp.BankAccountSignRsp>,
  19. required: true
  20. },
  21. })
  22. const { loading, formSubmit } = useBankCancelSign(props.bankInfo)
  23. const show = shallowRef(true)
  24. const refresh = shallowRef(false)
  25. const onCancel = (isRefresh = false) => {
  26. show.value = false
  27. refresh.value = isRefresh
  28. }
  29. const onSubmit = () => {
  30. formSubmit().then(() => {
  31. ElMessage.success('提交成功')
  32. onCancel(true)
  33. }).catch((err) => {
  34. ElMessage.error('提交失败:' + err)
  35. })
  36. }
  37. </script>