add-watch-people.vue
3.95 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
<script setup>
import { ElMessage } from "element-plus";
import { addViewPeople } from "./api/index.js";
import { languageFormat } from "./utils/language.js";
import { useStorage } from "@vueuse/core/index";
const language = useStorage("language", 0);
const router = useRouter();
const people = reactive({
form: {
name: "",
idCard: "",
},
type: language.value == 0 ? "身份证" : "Identity Card",
onConfirm() {
if (!people.form.name)
return ElMessage({
type: "warning",
message: languageFormat(language.value, "请输入姓名", "Name"),
});
if (!people.form.idCard)
return ElMessage({
type: "warning",
message: languageFormat(language.value, "请输入证件号", "ID Numbe"),
});
addViewPeople(people.form).then((res) => {
ElMessage({
type: "success",
message: languageFormat(language.value, "操作成功", "Operate successfully"),
});
router.go(-2);
});
},
});
</script>
<template>
<div class="container">
<div class="title">
{{ languageFormat(language, "新增观影人", "Companion") }}
</div>
<div class="content">
<div class="form-item">
<div>
<div class="label">
{{ languageFormat(language, "姓名", "Full Name") }}
</div>
<el-input
v-model="people.form.name"
style="width: 570px"
:placeholder="language == 0 ? '请输入姓名' : 'Name'"
/>
</div>
<!-- <div>
<div class="label">
{{ languageFormat(language, "证件类型", "Type of Document") }}
</div>
<el-input
v-model="people.type"
style="width: 570px"
placeholder="Please input"
readonly
/>
</div> -->
</div>
<div class="form-item">
<div>
<div class="label">
{{ languageFormat(language, "有效证件号", "Identity Card") }}
</div>
<el-input
v-model="people.form.idCard"
style="width: 570px"
:placeholder="language == 0 ? '请输入有效证件号' : 'ID Number'"
/>
</div>
</div>
</div>
<div class="footer">
<div class="can_pay" @click="$router.go(-1)">
{{ languageFormat(language, "取消", "Cancel") }}
</div>
<div class="pay" @click="people.onConfirm()">
{{ languageFormat(language, "确认", "Confirm") }}
</div>
</div>
</div>
</template>
<style scoped lang="scss">
div {
box-sizing: border-box;
}
.container {
padding: 20px 0;
width: 1200px;
margin: 0 auto;
.title {
padding: 11px;
text-align: center;
background: linear-gradient(270deg, #493ceb 0%, #8623fc 100%);
font-size: 18px;
color: #ffffff;
}
.content {
padding: 46px 20px 24px;
background-color: #fff;
:deep(.el-input) {
height: 48px;
border-radius: 24px !important;
}
.form-item {
display: flex;
gap: 20px;
margin-bottom: 36px;
&:last-child {
margin: 0;
}
.label {
font-size: 18px;
color: #333333;
margin-bottom: 16px;
}
}
}
.footer {
display: flex;
justify-content: center;
align-items: center;
gap: 20px;
height: 70px;
background-color: #fff;
margin-top: 12px;
user-select: none;
.pay {
width: 200px;
height: 40px;
background: linear-gradient(270deg, #493ceb 0%, #8623fc 100%);
border-radius: 20px;
font-weight: 500;
font-size: 16px;
color: #ffffff;
line-height: 40px;
text-align: center;
cursor: pointer;
}
.can_pay {
width: 200px;
height: 40px;
background: #f6f6f6;
border-radius: 20px;
font-weight: 500;
font-size: 16px;
color: #999;
line-height: 40px;
text-align: center;
box-sizing: border-box;
cursor: pointer;
}
}
}
</style>