hookehuyr

新增我的信息页面

1 <!-- 1 <!--
2 - * @Date: 2024-10-18 17:57:33 2 + * @Date: 2024-10-18 18:00:47
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2024-10-18 17:59:36 4 + * @LastEditTime: 2024-10-20 12:56:26
5 - * @FilePath: /hager/src/views/login/info.vue 5 + * @FilePath: /hager/src/views/user/info.vue
6 * @Description: 文件描述 6 * @Description: 文件描述
7 --> 7 -->
8 <template> 8 <template>
9 - <div class="hager-info-page"></div> 9 + <div class="hager-info-page">
10 + <div class="input-title">我的信息</div>
11 + <div style="padding: 1rem;">
12 + <hagerInput type="email" :disable="status !== 'edit'" required v-model="email" placeholder="请输入注册邮箱地址" />
13 + <hagerInput type="pwd" :disable="status !== 'edit'" required v-model="pwd" placeholder="请输入登录密码" />
14 + <hagerInput type="username" :disable="status !== 'edit'" v-model="username" placeholder="请输入姓名" />
15 + <hagerInput type="tel" :disable="status !== 'edit'" v-model="tel" placeholder="请输入联系电话" />
16 + <hagerInput type="corp" :disable="status !== 'edit'" v-model="corp" placeholder="请输入公司名称" />
17 + <hagerInput type="department" :disable="status !== 'edit'" v-model="department" placeholder="请输入所属部门和职位" />
18 + </div>
19 + <div class="info-footer">
20 + <div v-if="status !== 'edit'" class="submit-btn" @click="onHandle">修改信息</div>
21 + <div v-else class="edit-box">
22 + <div class="cancel btn" @click="status=''">取消</div>
23 + <div class="confirm btn" @click="onSubmit">确定</div>
24 + </div>
25 + <div class="info-subsidiary">
26 + <div class="privacy"><span>隐私政策</span></div>
27 + </div>
28 + </div>
29 + </div>
10 </template> 30 </template>
11 31
12 <script> 32 <script>
13 import mixin from 'common/mixin'; 33 import mixin from 'common/mixin';
34 +import hagerInput from '@/components/common/hagerInput.vue';
14 35
15 export default { 36 export default {
16 mixins: [mixin.init], 37 mixins: [mixin.init],
17 data () { 38 data () {
18 return { 39 return {
19 - 40 + email: 'hr.communication@hager.com',
41 + pwd: 'hager123',
42 + username: '王二虎',
43 + tel: '15650569910',
44 + corp: '海格电气集团',
45 + department: '研发部产品经理',
46 + status: ''
20 } 47 }
21 }, 48 },
22 mounted () { 49 mounted () {
23 50
24 }, 51 },
25 methods: { 52 methods: {
26 - 53 + onHandle () {
54 + this.status = 'edit';
55 + },
56 + onSubmit () {
57 + console.log('提交');
58 + setTimeout(() => {
59 + this.status = '';
60 + }, 1000);
61 + }
27 } 62 }
28 } 63 }
29 </script> 64 </script>
30 65
31 <style lang="less" scoped> 66 <style lang="less" scoped>
32 .hager-info-page { 67 .hager-info-page {
68 + padding: 2rem 0.5rem 0;
69 + box-sizing: border-box;
70 + .input-title {
71 + color: @secondary-color;
72 + font-weight: bold;
73 + font-size: 1.25rem;
74 + text-align: center;
75 + }
76 + .submit-btn {
77 + background-color: #FFF;
78 + color: @secondary-color;
79 + padding: 0.5rem 1rem;
80 + text-align: center;
81 + border-radius: 5px;
82 + border: 1px solid @secondary-color;
83 + &:hover {
84 + cursor: pointer;
85 + }
86 + }
87 + .edit-box {
88 + display: flex;
89 + justify-content: space-between;
90 + .cancel {
91 + margin-right: 1%;
92 + color: @secondary-color;
93 + }
94 + .confirm {
95 + margin-left: 1%;
96 + background-color: @secondary-color;
97 + color: #FFF;
98 + }
99 + .btn {
100 + width: 48%;
101 + text-align: center;
102 + padding: 0.5rem 1rem;
103 + border-radius: 5px;
104 + border: 1px solid @secondary-color;
105 + &:hover {
106 + cursor: pointer;
107 + }
108 + }
109 + }
110 + .info-footer {
111 + padding: 0 1rem 1rem 2rem;
112 + .info-subsidiary {
113 + display: flex;
114 + justify-content: space-between;
115 + font-size: 0.85rem;
116 + margin-top: 1rem;
117 + span {
118 + color: @primary-color;
119 + text-decoration: underline;
120 + font-weight: bold;
121 + &:hover {
122 + cursor: pointer;
123 + }
124 + }
125 + .privacy {
33 126
34 } 127 }
128 + .login {
129 +
130 + }
131 + }
132 + }
133 + }
35 </style> 134 </style>
......