commonEdit.vue
1.76 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
<!-- 设置用户名 设置姓名 设置邮箱 设置单位 -->
<template>
<div class="common_container">
<NafmHeader :title="title" class="header">
<template slot="right">
<span class="finish" @click="handleFinish">完成</span>
</template>
</NafmHeader>
<div class="search">
<input type="text" v-model="value" :placeholder="placeholder" class="input">
<span class="close" @click="handleClear">×</span>
</div>
</div>
</template>
<script>
export default {
name: 'CommonEdit',
data() {
return {
title: '',
value: '',
placeholder: ''
}
},
mounted() {
const { title, value } = this.$route.query
this.title = title
this.userName = value
console.log('title', title)
if (title == '设置用户名') {
this.placeholder = '请输入用户名'
} else if (title == '设置姓名') {
this.placeholder = '请输入您的姓名'
} else if (title == '设置邮箱') {
this.placeholder = '请输入您的邮箱'
} else if (title == '设置单位') {
this.placeholder = '请输入您的单位全称'
}
},
methods: {
handleFinish() {
// 调用设置接口
this.$router.back()
},
handleClear() {
this.value = ''
}
}
}
</script>
<style lang="less" scoped>
.header .finish {
font-size: 28px;
}
.search {
margin: 15px;
position: relative;
}
.input {
height: 100px;
line-height: 100px;
background-color: #f6f6f6;
width: 100%;
border-radius: 16px;
color: #333;
font-size: 32px;
padding: 0 100px 0 25px;
}
.close {
position: absolute;
right: 30px;
top: 35px;
width: 35px;
height: 35px;
line-height: 35px;
text-align: center;
color: #fff;
background-color: #c4c4c4;
border-radius: 50%;
}
</style>