index.vue
2.75 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
<template>
<div class="person_cantainer">
<NafmHeader :title="$t('title.person')" navClass="nafmii-head-bg3" />
<div class="setting_list">
<van-cell :title="$t('person.photo')" center is-link value-class="right_content">
<template #default>
<img src="https://himg.bdimg.com/sys/portraitn/item/a0abbaacd0a6d2bbb9fd73756e6e798e8d" class="headerImg" alt="">
</template>
</van-cell>
<van-cell :title="$t('person.nickName')" center is-link @click="editUserName('设置用户名',userName)" value-class="right_content">
<template #default>
<span v-if="userName">{{userName}}</span>
<span v-else>{{$t('person.nickNamePlaceholder')}}</span>
</template>
</van-cell>
<van-cell :title="$t('person.phoneNumber')" center value-class="right_content">
<template #default>
183****8924
</template>
</van-cell>
<van-cell :title="$t('person.name')" center is-link @click="editUserName('设置姓名',name)" value-class="right_content">
<template #default>
<span v-if="name">{{name}}</span>
<span v-else>{{$t('person.namePlaceholder')}}</span>
</template>
</van-cell>
<van-cell :title="$t('person.nationality')" center is-link value-class="right_content">
<template #default>中国</template>
</van-cell>
<van-cell :title="$t('person.birthday')" center is-link value-class="right_content">
<template #default>
<span v-if="name">{{name}}</span>
<span v-else>请选择您的出生日期</span>
</template>
</van-cell>
<van-cell :title="$t('person.email')" center is-link @click="editUserName('设置邮箱',email)" value-class="right_content">
<template #default>
<span v-if="name">{{email}}</span>
<span v-else>请输入您的邮箱</span>
</template>
</van-cell>
<van-cell :title="$t('person.company')" center is-link @click="editUserName('设置单位',company)" value-class="right_content">
<template #default>
<span v-if="name">{{company}}</span>
<span v-else>请输入您的单位全称</span>
</template>
</van-cell>
</div>
</div>
</template>
<script>
export default {
name: 'Person',
data() {
return {
userName: '',
name: '',
email: '',
company: ''
}
},
methods: {
editUserName(title, value) {
this.$router.push({
path: '/user/commonEdit',
query: {
title,
value
}
})
}
}
}
</script>
<style lang="less" scoped>
.headerImg {
width: 55px;
height: 55px;
border-radius: 50%;
}
.right_content {
display: flex;
align-items: center;
justify-content: flex-end;
}
</style>