张卓
2022-09-20 5aead44ba1be31db948dfd8362c2bfcbedbbce29
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<template>
  <div>
    <a-form layout="horizontal" class="stepForm" hideRequiredMark :autoFormCreate="(form)=>{this.form = form}">
          <a-form-item v-bind="formItemLayout" label="付款账户"
            fieldDecoratorId="payAccount"
              :fieldDecoratorOptions=" {
              initialValue: data.payAccount,
              rules: [{ required: true, message: '请选择付款账户' }],
            }"
          >
            <a-select placeholder="test@example.com">
                <a-select-option value="ant-design@alipay.com">ant-design@alipay.com</a-select-option>
              </a-select>
          </a-form-item>
          <a-form-item v-bind="formItemLayout" label="收款账户"
              fieldDecoratorId="receiverAccount"
              :fieldDecoratorOptions=" {
              initialValue: data.receiverAccount,
              rules: [
                  { required: true, message: '请输入收款人账户' },
                  { type: 'email', message: '账户名应为邮箱格式' },
              ],
            }"
          >
            <a-input-group compact>
              <a-select defaultValue="alipay" :style="{ width: 100 }">
                <a-select-option value="alipay">支付宝</a-select-option>
                <a-select-option value="bank">银行账户</a-select-option>
              </a-select>
              <a-input :style="{ width: 'calc(100% - 100px)' }" :value="data.receiverAccount" placeholder="test@example.com" />
            </a-input-group>
          </a-form-item>
          <a-form-item v-bind="formItemLayout" label="收款人姓名"
            fieldDecoratorId="receiverName"
              :fieldDecoratorOptions=" {
              initialValue: data.receiverName,
              rules: [{ required: true, message: '请输入收款人姓名' }],
            }"
          >
            <a-input placeholder="请输入收款人姓名" />
          </a-form-item>
          <a-form-item v-bind="formItemLayout" label="转账金额"
              fieldDecoratorId="amount"
              :fieldDecoratorOptions=" {
              initialValue: data.amount,
              rules: [
                { required: true, message: '请输入转账金额' },
                {
                  pattern: /^(\d+)((?:\.\d+)?)$/,
                  message: '请输入合法金额数字',
                },
              ],
            }"
          >
            <a-input prefix="¥" placeholder="请输入金额" />
          </a-form-item>
          <a-form-item
            :wrapperCol="{
              xs: { span: 24, offset: 0 },
              sm: {
                span: formItemLayout.wrapperCol.span,
                offset: formItemLayout.labelCol.span,
              },
            }"
            label=""
          >
            <a-button type="primary" @click="onValidateForm">
              下一步
            </a-button>
          </a-form-item>
        </a-form>
        <a-divider :style="{ margin: '40px 0 24px' }" />
        <div class="desc">
          <h3>说明</h3>
          <h4>转账到支付宝账户</h4>
          <p>
            如果需要,这里可以放一些关于产品的常见问题说明。如果需要,这里可以放一些关于产品的常见问题说明。如果需要,这里可以放一些关于产品的常见问题说明。
          </p>
          <h4>转账到银行卡</h4>
          <p>
            如果需要,这里可以放一些关于产品的常见问题说明。如果需要,这里可以放一些关于产品的常见问题说明。如果需要,这里可以放一些关于产品的常见问题说明。
          </p>
        </div>
  </div>
</template>
 
<script  lang="ts">
import { Component, Prop, Vue } from 'vue-property-decorator';
import { State, Mutation, namespace } from 'vuex-class';
 
@Component({})
export default class StepForm1 extends Vue {
  @Prop({ type: Object, default: (): any => {} })
  private value!: any;
 
  private formItemLayout = {
  labelCol: {
    span: 5,
  },
  wrapperCol: {
    span: 19,
  },
};
 
private form: any = null;
 
private data: any = {};
 
  constructor() {
    super();
  }
 
  private onValidateForm() {
      this.form.validateFields((err: any, values: any) => {
        if (!err) {
          this.value.step = 1;
        }
      });
    }
 
  private mounted(): void {
    this.data = this.value;
  }
 
}
</script>