quanyawei
2024-09-06 60e16bd5406c4cbdf61bf20a50e8e1b49a45b2aa
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
<template>
  <div>
    <a-form layout="horizontal" class="stepForm" :autoFormCreate="(form)=>{this.form = form}">
        <a-alert
          closable
          showIcon
          message="确认转账后,资金将直接打入对方账户,无法退回。"
          :style="{ marginBottom: 24 }"
        />
        <a-form-item v-bind="formItemLayout" class="stepFormText" label="付款账户">
          {{data.payAccount}}
        </a-form-item>
        <a-form-item v-bind="formItemLayout" class="stepFormText" label="收款账户">
          {{data.receiverAccount}}
        </a-form-item>
        <a-form-item v-bind="formItemLayout" class="stepFormText" label="收款人姓名">
          {{data.receiverName}}
        </a-form-item>
        <a-form-item v-bind="formItemLayout" class="stepFormText" label="转账金额">
          <span class="money">{{data.amount}}</span>
          <span class="uppercase">({{data.amount}})</span>
        </a-form-item>
        <a-divider :style="{ margin: '24px 0' }" />
        <a-form-item v-bind="formItemLayout" label="支付密码" :required="false"
          fieldDecoratorId="password"
              :fieldDecoratorOptions=" {
              initialValue: '123456',
              rules: [{ required: true, message: '需要支付密码才能进行支付' }],
            }"
        >
          <a-input type="password" autoComplete="off" :style="{ width: '80%' }" />
        </a-form-item>
        <a-form-item
          :style="{ marginBottom: 8 }"
          :wrapperCol="{
            xs: { span: 24, offset: 0 },
            sm: {
              span: formItemLayout.wrapperCol.span,
              offset: formItemLayout.labelCol.span,
            },
          }"
          label=""
        >
          <a-button type="primary" @click="onValidateForm" :loading="submitting">
            提交
          </a-button>
          <a-button @click="onPrev" :style="{ marginLeft: 8 }">
            上一步
          </a-button>
        </a-form-item>
      </a-form>
  </div>
</template>
 
<script  lang="ts">
import { Component, Prop, Vue } from 'vue-property-decorator';
import { State, Mutation, namespace } from 'vuex-class';
import { setTimeout } from 'timers';
 
@Component({})
export default class StepForm2 extends Vue {
 
  @Prop({ type: Object, default: () => {} })
  private value!: any;
 
  private form: any = null;
 
  private data: any = {};
 
  private formItemLayout = {
    labelCol: {
      span: 5,
    },
    wrapperCol: {
      span: 19,
    },
  };
 
  private submitting: boolean = false;
 
 
  constructor() {
    super();
  }
 
  private onValidateForm(e: any) {
      e.preventDefault();
      this.form.validateFields((err: any, values: any) => {
        if (!err) {
          this.submitting = true;
          setTimeout(() => {
            this.value.step = 2;
            this.submitting = false;
          }, 1000);
        }
      });
    }
 
    private onPrev() {
      this.value.step = 0;
    }
 
    private mounted(): void {
    this.data = this.value;
  }
 
}
</script>