commonEdit.vue
1.54 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
<!-- 设置用户名 设置姓名 设置邮箱 设置单位 -->
<template>
<div class="common_container">
<NafmHeader :title="title" class="header" navClass="nafmii-head-bg3">
<template slot="right">
<span class="finish" @click="handleFinish">{{$t('button.finish')}}</span>
</template>
</NafmHeader>
<div class="search">
<van-field v-model="value" :placeholder="placeholder" clearable />
</div>
</div>
</template>
<script>
export default {
name: 'CommonEdit',
data() {
return {
title: '',
value: '',
placeholder: ''
}
},
mounted() {
const { title, value } = this.$route.query
this.value = value
if (title == '设置昵称') {
this.title = this.$t('title.nickName')
this.placeholder = this.$t('person.nickNamePlaceholder')
} else if (title == '设置姓名') {
this.title = this.$t('title.name')
this.placeholder = this.$t('person.namePlaceholder')
} else if (title == '设置邮箱') {
this.title = this.$t('title.email')
this.placeholder = this.$t('person.emailPlaceholder')
} else if (title == '设置单位') {
this.title = this.$t('title.company')
this.placeholder = this.$t('person.companyPlaceholder')
}
},
methods: {
handleFinish() {
// 调用设置接口
this.$router.back()
},
}
}
</script>
<style lang="less" scoped>
.header .finish {
font-size: 14px;
}
.search {
margin: 15px;
position: relative;
}
/deep/ .van-cell {
background: #efefef;
border-radius: 8px;
}
</style>