Step1.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <template>
  2. <div class="step1">
  3. <div class="step1-form">
  4. <BasicForm @register="register">
  5. <template #fac="{ model, field }">
  6. <a-input-group compact>
  7. <a-select v-model:value="model['pay']" class="pay-select">
  8. <a-select-option value="zfb"> 支付宝 </a-select-option>
  9. <a-select-option value="yl"> 银联 </a-select-option>
  10. </a-select>
  11. <a-input class="pay-input" v-model:value="model[field]" />
  12. </a-input-group>
  13. </template>
  14. </BasicForm>
  15. </div>
  16. <a-divider />
  17. <h3>说明</h3>
  18. <h4>转账到支付宝账户</h4>
  19. <p>
  20. 如果需要,这里可以放一些关于产品的常见问题说明。如果需要,这里可以放一些关于产品的常见问题说明。如果需要,这里可以放一些关于产品的常见问题说明。
  21. </p>
  22. <h4>转账到银行卡</h4>
  23. <p>
  24. 如果需要,这里可以放一些关于产品的常见问题说明。如果需要,这里可以放一些关于产品的常见问题说明。如果需要,这里可以放一些关于产品的常见问题说明。
  25. </p>
  26. </div>
  27. </template>
  28. <script lang="ts">
  29. import { defineComponent } from 'vue';
  30. import { BasicForm, useForm } from '/@/components/Form';
  31. import { step1Schemas } from './data';
  32. import { Select, Input, Divider } from 'ant-design-vue';
  33. export default defineComponent({
  34. components: {
  35. BasicForm,
  36. [Select.name]: Select,
  37. ASelectOption: Select.Option,
  38. [Input.name]: Input,
  39. [Input.Group.name]: Input.Group,
  40. [Divider.name]: Divider,
  41. },
  42. emits: ['next'],
  43. setup(_, { emit }) {
  44. const [register, { validate }] = useForm({
  45. labelWidth: 100,
  46. schemas: step1Schemas,
  47. actionColOptions: {
  48. span: 14,
  49. },
  50. showResetButton: false,
  51. submitButtonOptions: {
  52. text: '下一步',
  53. },
  54. submitFunc: customSubmitFunc,
  55. });
  56. async function customSubmitFunc() {
  57. try {
  58. const values = await validate();
  59. emit('next', values);
  60. } catch (error) {
  61. //
  62. }
  63. }
  64. return { register };
  65. },
  66. });
  67. </script>
  68. <style lang="less" scoped>
  69. .step1 {
  70. &-form {
  71. width: 450px;
  72. margin: 0 auto;
  73. }
  74. h3 {
  75. margin: 0 0 12px;
  76. color: @text-color-base;
  77. font-size: 16px;
  78. line-height: 32px;
  79. }
  80. h4 {
  81. margin: 0 0 4px;
  82. color: @text-color-base;
  83. font-size: 14px;
  84. line-height: 22px;
  85. }
  86. p {
  87. color: @text-color-base;
  88. }
  89. }
  90. .pay-select {
  91. width: 20%;
  92. }
  93. .pay-input {
  94. width: 70%;
  95. }
  96. </style>