BorrowUsage.vue
4.04 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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
<template>
<transition name="picker-fade">
<v-layout v-show="componentDisplay" column justify-center align-center id="BorrowUsage">
<v-flex>
<div class="label">借款用途</div>
<v-card flat class="ButtonBlock">
<div class="ButtonContainer">
<v-btn
depressed
v-for="(item, index) in buttons"
:key="index"
:class="chosenBtnIndex === index ? 'isChosen' : ''"
@click="usageChosen(item, index)"
class="BorrowUsageBtn">
{{item.text}}
</v-btn>
</div>
</v-card>
<div class="label">补充说明(不超过300字)</div>
<v-card flat class="ExplanationBlock" >
<textarea
v-model="form.explanation"
name="ExplanationTextarea"
placeholder="具体说明您的借贷用途或者证明您的还款能力"
maxlength="300"
id="ExplanationTextarea" cols="30" rows="5"></textarea>
</v-card>
<div class="label">图片说明(不超过20张)</div>
<v-card flat class="ImgBlock">
<ImgUploader :limit="9"/>
</v-card>
<div class="ConfirmButtonBlock">
<v-btn depressed id="ConfirmButton" @click="confirm">确 定</v-btn>
</div>
</v-flex>
</v-layout>
</transition>
</template>
<script>
import ImgUploader from "@/components/ImgUploader"
export default {
name: 'BorrowUsage',
data: () => ({
componentDisplay: false,
buttons: [{text: '个体经营'}, {text: '消费'},{text: '助学'},
{text: '创业'},{text: '租房'},{text: '旅游'},
{text: '装修'},{text: '医疗'},{text: '其他'},
],
chosenBtnIndex: 8,
form: {
type: '其他',
explanation: ''
}
}),
watch: {
display: function (val, oldVal) {
if (val) {
this.componentDisplay = true
}
},
componentDisplay: function (val, oldVal) {
if (!val) {
this.$emit('close')
}
}
},
props: {
display: {
type: Boolean,
default: true
}
},
components: {
ImgUploader
},
methods: {
usageChosen(item, index) {
this.chosenBtnIndex = index
this.form.type = item.text
},
confirm() {
this.$emit('change', this.form)
this.componentDisplay = false
}
}
}
</script>
<style lang="scss" scoped>
#BorrowUsage {
position: fixed;
top: 0;
left: 0;
right: 0;
height: 100%;
background-color: $light-background-grey;
z-index: 1000;
.label {
width: 100vw;
height: 2.3rem;
line-height: 2.3rem;
font-size: 0.75rem;
color: #B9B9BA;
padding-left: 0.9rem;
box-sizing: border-box;
}
.ButtonBlock {
width: 100vw;
background-color: #fff;
padding: 0 1.3rem;
.ButtonContainer {
display: flex;
width: 100%;
justify-content: space-around;
align-items: center;
flex-direction: row;
flex-wrap: wrap;
.BorrowUsageBtn {
width: 6.2rem;
height: 2rem;
margin: 0.6rem 0;
color: #fff;
background-color: #ccc;
&.isChosen {
background-image: linear-gradient(-229deg, #DAB269 37%, #E7C78C 87%);
}
}
}
}
.ExplanationBlock {
width: 100vw;
#ExplanationTextarea {
width: 100%;
outline: none;
padding: 1rem;
}
}
.ImgBlock {
min-height: 7rem;
padding: 1rem 0.8rem;
}
.ConfirmButtonBlock {
width: 90vw;
margin: 2.5rem auto;
#ConfirmButton {
color: #484646;
background-image: linear-gradient(-213deg, #DAB269 0%, #E7C78C 92%);
border-radius: 2px;
width: 100%;
height: 2.8rem;
font-size: 18px;
margin: auto;
}
}
}
.picker-fade-enter, .picker-fade-leave-active {
opacity: 0;
}
.picker-fade-enter-active, .picker-fade-leave-active {
transition: all .3s ease-in-out;
}
</style>