DirectPayDialog.vue 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <template>
  2. <CommonDialog v-model:show="show" title="升级付款" :showDivider="false">
  3. <FlexCol gap="gap.lg" padding="padding.md" width="600rpx">
  4. <template v-if="uploadStep === 'form'">
  5. <Text textAlign="center" text="选择支付方式" fontConfig="contentSpeicalText" />
  6. <Height :height="10" />
  7. <FlexCol gap="gap.md">
  8. <BoxMid justify="space-between">
  9. <Text text="微信支付" fontConfig="lightImportantTitle" :fontSize="42" />
  10. <CheckBox :modelValue="payMethod == 'wechat'" @update="payMethod = 'wechat'" />
  11. </BoxMid>
  12. </FlexCol>
  13. <FlexRow justify="space-around" gap="gap.md">
  14. <FrameButton text="取消" @click="show = false" width="220rpx" />
  15. <FrameButton primary text="支付" @click="handleSubmitPay" width="220rpx" />
  16. </FlexRow>
  17. </template>
  18. <template v-else-if="uploadStep === 'finished'">
  19. <Result
  20. status="success"
  21. title="感谢您的贡献!"
  22. description="村社升级已经生效啦"
  23. />
  24. <FlexRow justify="space-around" gap="gap.md">
  25. <FrameButton primary text="完成" @click="handleFinish" width="220rpx" />
  26. </FlexRow>
  27. </template>
  28. </FlexCol>
  29. </CommonDialog>
  30. </template>
  31. <script setup lang="ts">
  32. import { ref } from "vue";
  33. import { toast } from "@/components/dialog/CommonRoot";
  34. import { useAliOssUploadCo } from "@/common/components/upload/AliOssUploadCo";
  35. import { showError } from "@/common/composeabe/ErrorDisplay";
  36. import type { IDynamicFormOptions, IDynamicFormRef } from "@/components/dynamic";
  37. import type { UploaderFieldProps } from "@/components/form/UploaderField.vue";
  38. import CommonDialog from "@/common/components/CommonDialog.vue";
  39. import FrameButton from "@/common/components/FrameButton.vue";
  40. import FlexCol from "@/components/layout/FlexCol.vue";
  41. import FlexRow from "@/components/layout/FlexRow.vue";
  42. import Height from "@/components/layout/space/Height.vue";
  43. import Text from "@/components/basic/Text.vue";
  44. import DynamicForm from "@/components/dynamic/DynamicForm.vue";
  45. import Result from "@/components/feedback/Result.vue";
  46. import ProvideVar from "@/components/theme/ProvideVar.vue";
  47. import BoxMid from "@/common/components/box/BoxMid.vue";
  48. import TreeApi from "@/api/light/TreeApi";
  49. import CheckBox from "@/components/form/CheckBox.vue";
  50. const emit = defineEmits(['success']);
  51. const show = ref(false);
  52. const uploadStep = ref<'form' | 'finished'>('form');
  53. const payMethod = ref('wechat');
  54. const orderId = ref<number>(0);
  55. function handleSubmitPay() {
  56. if (!orderId.value) {
  57. showError('缺少必要参数');
  58. return;
  59. }
  60. switch (payMethod.value) {
  61. case 'wechat':
  62. // 微信支付
  63. break;
  64. default:
  65. break;
  66. }
  67. }
  68. function handleFinish() {
  69. emit('success');
  70. }
  71. defineExpose({
  72. open(id: number) {
  73. orderId.value = id;
  74. uploadStep.value = 'form';
  75. show.value = true;
  76. },
  77. });
  78. </script>