huangxiaoqiang
2025-05-19 051aa9a0e7f58af6665fb4526e42cf8060fbaa05
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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
<template>
    <view class="page">
        <view class="top">
            <view class="background"></view>
        </view>
        <view class="user-card">
            <view class="card">
                <view class="top">
                    <view class="userImage">
                        <!-- <open-data type="userAvatarUrl"></open-data> -->
                        <u-avatar :src="src" size="146"></u-avatar>
                    </view>
                </view>
                <view class="bottom" @tap.native="Login">
                    <view class="left">
                        <view class="user-text">
                            <!-- <open-data type="userNickName"></open-data> -->
                            <text style="text-align: center;">{{userNickName}}</text>
                        </view>
                        <!-- <view class="user-phone"> 171****4133 </view> -->
                    </view>
                    <view class="right flex-center">
                        <u-icon class="icon" name="arrow-right"></u-icon>
                    </view>
                </view>
                <view class="settings" @click="settings">
                    <view class="left">
                        <view class="settings-text">
                            <!-- <open-data type="userNickName"></open-data> -->
                            <text style="text-align: center;">设置</text>
                        </view>
                        <!-- <view class="user-phone"> 171****4133 </view> -->
                    </view>
                    <view class="right flex-center">
                        <u-icon class="icon" name="arrow-right"></u-icon>
                    </view>
                </view>
            </view>
        </view>
        <view class="list-card">
        </view>
        <view class="quit flex-center">
            <!-- <view class="btn flex-center" @click="LastLogin">
                更新程序
            </view> -->
            <view class="btn flex-center" @click="LastLogin">
                退出登录
            </view>
        </view>
    </view>
</template>
<style lang="scss" scoped>
    .top {
        height: 250rpx;
        position: relative;
 
        .background {
            background-color: #5199ff;
            border-bottom-left-radius: 22px;
            border-bottom-right-radius: 22px;
            position: absolute;
            height: 180rpx;
            width: 100%;
        }
    }
 
    .icon {
        color: #96a1ae;
        font-size: 20rpx;
    }
 
    .user-card {
        height: 170rpx;
        padding: 0 15px;
 
        .card {
            position: relative;
            bottom: 62px;
            height: 250rpx;
            background-color: white;
            border-radius: 5px;
 
            .top {
                height: 30%;
                position: relative;
 
                .userImage {
                    position: absolute;
                    bottom: 24%;
                    left: 10%;
                    width: 150rpx;
                    height: 150rpx;
                    overflow: hidden;
                    border-radius: 50%;
                    border: 2px solid white;
                }
            }
 
            .bottom {
                display: flex;
                height: 70%;
 
                .left {
                    width: 80%;
                    height: 100%;
                    position: relative;
 
                    .user-text {
                        width: 100%;
                        font-size: 1.6em;
                        padding-left: 80rpx;
                        height: 50%;
                    }
 
                    .user-phone {
                        width: 100%;
                        font-size: 1.3em;
                        padding-left: 80rpx;
                        height: 50%;
                    }
                }
 
                .right {
                    width: 20%;
                    height: 50%;
                }
 
                .right2 {
                    width: 10%;
                    height: 10%;
                }
            }
 
            .settings {
                display: flex;
                height: 70%;
                
                .left {
                    width: 80%;
                    height: 50%;
                    position: relative;
                    margin-left: 5%;
 
                    .settings-text {
                        width: 100%;
                        font-size: 1.2em;
                        padding-left: 80rpx;
                        height: 50%;
                        align-items: center;
                        padding-top: 10px;
                    }
                }
 
                .right {
                    width: 20%;
                    height: 50%;
                }
 
            }
        }
    }
 
    .list-card {
        padding: 0 15px;
 
        .card {
            border-radius: 5px;
            position: relative;
            background-color: white;
            border-radius: 5px;
            padding: 5px 30px;
 
            .item {
                display: flex;
                height: 120rpx;
 
                .left {
                    width: 15%;
 
                    image {
                        width: 70rpx;
                        height: 70rpx;
                    }
                }
 
                .center {
                    width: 65%;
                    display: flex;
                    justify-content: start;
                    align-items: center;
                    font-size: 1.1em;
                }
 
                .right {
                    width: 20%;
                    justify-content: flex-end;
                }
            }
        }
    }
 
    .item-bottom-solid {
        border-bottom: 1px solid #d4d6da;
    }
 
    .quit {
        height: 100rpx;
        margin-top: 50px;
 
        .btn {
            background-color: #4f99ff;
            border-radius: 30px;
            width: 80%;
            color: white;
            font-size: 1.2em;
            height: 100%;
        }
    }
 
    .flex-center {
        display: flex;
        justify-content: center;
        align-items: center;
    }
</style>
 
<script>
    //import {  } from "@/common/api/{$}.js";
    import httpInterceptor from '@/common/http.interceptor.js'
    export default {
        data() {
            return {
                src: "",
                userNickName: '请登录',
            };
        },
        //监听页面初始化,其参数同 onLoad 参数,为上个页面传递的数据,参数类型为 Object(用于页面传参),触发时机早于 onLoad
        onInit() {},
        //监听页面加载,其参数为上个页面传递的数据,参数类型为 Object(用于页面传参)
        onLoad() {
            let isLogin = this.hasLogin();
            if (isLogin) {
                let haslogin = uni.getStorageSync('jo_user')
                this.userNickName = haslogin.userName;
                this.src = httpInterceptor.baseUrl + "/" + haslogin.img;
            }
        },
        //监听页面初次渲染完成。注意如果渲染速度快,会在页面进入动画完成前触发
        onReady() {},
        //监听页面显示。页面每次出现在屏幕上都触发,包括从下级页面点返回露出当前页面
        beforeDestroy() {},
        //页面滚动到底部的事件(不是scroll-view滚到底),常用于下拉下一页数据。
        onReachBottom() {},
        onShareAppMessage(res) {},
        created() {},
        methods: {
            hasLogin() {
                let haslogin = uni.getStorageSync('jo_user')
                if (haslogin == null || haslogin == "") {
                    return false
                } else {
                    return true
                }
            },
 
            LastLogin() {
                //uni.clearStorage();
                uni.removeStorageSync('jo_id_token');
                uni.removeStorageSync('jo_user');
                uni.removeStorageSync('jo_userImg');
                this.$u.route('/pages/login/login');
            },
 
            Login() {
                this.$u.route('/pages/login/login');
            },
            settings(){
                this.$u.route('/pages/index/settings');
            }
        },
    };
</script>