bindAccount.vue
3.14 KB
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
127
128
129
130
131
132
133
134
135
136
137
138
139
<template>
<LayoutApp :show-back="true" title="绑定支付宝">
<div class="body" ref="body">
<div class="account-form">
<p class="form-title">账号</p>
<div class="form-input-block">
<CubeInput class="account-input" v-model="account" placeholder="请输入您的支付宝账号"></CubeInput>
</div>
<p class="form-title">姓名</p>
<div class="form-input-block">
<CubeInput class="account-input" v-model="name" placeholder="请输入支付宝实名认证的姓名"></CubeInput>
</div>
</div>
<div class="account-footer">
<CubeButton class="submit-btn" :disabled="canSubmit" @click="submitBind">提交</CubeButton>
</div>
</div>
<myDialog :isShow="dialogShow" :data="{name,account}" @cancel-click="cancel" @confirm-click="confirm"></myDialog>
</LayoutApp>
</template>
<script>
import { createNamespacedHelpers } from 'vuex';
import {Input, Button, Style} from 'cube-ui';
import myDialog from './components/bindModel';
const {mapState, mapActions} = createNamespacedHelpers('home/bindAccount');
export default {
data() {
return {
account: '',
name: '',
dialogShow: false
}
},
computed:{
...mapState({
incomeData: (state) => state.assetData
}),
canSubmit() {
return !(this.name && this.account);
}
},
created() {
},
methods: {
...mapActions(['bindAliPayAccount']),
submitBind() {
this.dialogShow = true
},
cancel() {
this.dialogShow = false
},
confirm() {
this.bindAliPayAccount({account: this.account, name: this.name}).then((data) => {
this.dialogShow = false;
if (data.code === 200) {
this.$router.back()
} else {
this.$createToast({
txt: data.message,
time: 1500,
type: 'txt'
}).show();
}
})
},
},
components: {
Style,
CubeInput: Input,
CubeButton: Button,
myDialog
}
};
</script>
<style lang="scss" scoped>
.body {
position: relative;
height: 100%;
overflow-y: auto;
background-color: white;
padding: 0 40px;
}
.account-form {
margin-top: 40px;
}
.form-title {
font-size: 36px;
padding-top: 40px;
line-height: 1.6;
font-weight: 500;
}
.form-input-block {
padding-bottom: 16px;
border-bottom: 1px solid #eee;
position: relative;
}
.account-input {
&:after {
border: 0;
}
/deep/ .cube-input-field {
font-size: 14px;
height: 40px;
border: none;
padding: 0;
}
}
.account-footer {
position: absolute;
padding: 28px 0;
left: 40px;
right: 40px;
bottom: 40px;
.submit-btn {
height: 88px;
line-height: 88px;
padding: 0;
background: #022c46;
border-radius: 44px;
&:after {
border: 0;
}
&.cube-btn_disabled {
background: #ccc;
}
}
}
</style>