wjt
2024-06-26 6dd9823b8495252e6d0ba35e6114799321453cbe
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
<template>
    <view class="page-mine-box">
        <view class="top-box">
            <view class="user-news">
                <!-- <u-avatar :src="src"></u-avatar> -->
                <image src="/static/policy/header.png" mode="widthFix"></image>
                <view class="user-info">
                    <view class="user-name">
                        <view class="inckname">{{userInfo.data.nickName}}</view>
                        <view class="direc"></view>
                        <view class="dept-per">执法人员</view>
                    </view>
                    <view class="dept-name u-line-1">
                        {{userInfo.data.dept.deptName}}
                    </view>
                </view>
            </view>
        </view>
        <view class="main-box">
            <view class="show-phone-number">
                <text class="label">联系电话</text>
                <text v-if="userInfo.data.phonenumber">{{userInfo.data.phonenumber.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2")}}</text>
                <text v-else>暂无手机号</text>
            </view>
            <view class="show-phone-number" @click="goChangePhone">
                <view class="set-flex">
                    <!-- <u-icon name="phone" size="22"></u-icon> -->
                    <image src="/static/policy/phone.png" mode="widthFix"></image>
                    <text class="change">修改手机号</text>
                </view>
                <u-icon name="arrow-right"></u-icon>
            </view>
        </view>
        <view class="logout" @click="logOut">
            退出登录
        </view>
    </view>
</template>
 
<script>
    export default {
        props: {
            userInfo: {
                type: Object,
                default: () => ({})
            },
        },
        data(){
            return {
                src: '/static/policy/header.png'
            }
        },
        methods: {
            goChangePhone() {
                uni.navigateTo({
                    url: `/policy/changePhone/changePhone?code=${this.userInfo.data.userType}`
                })
            },
            logOut() {
                uni.showModal({
                    title: '提示',
                    content: '确认退出登录?',
                    success: res => {
                        if(res.confirm) {
                            uni.clearStorageSync()
                            uni.redirectTo({
                                url: '/pages/index/index'
                            })
                        }
                    }
                })
            }
        }
    }
</script>
 
<style lang="scss" scoped>
    .page-mine-box{
        .top-box{
            height: 380rpx;
            width: 100%;
            background-color: #1171E0FF;
            padding-top: 204rpx;
            box-sizing: border-box;
            .user-news{
                margin: 0 48rpx;
                display: flex;
                justify-content: flex-start;
                align-items: center;
                image{
                    width: 108rpx;
                    height: 108rpx;
                    background-color: white;
                    border-radius: 50%;
                }
                .user-info{
                    margin-left: 24rpx;
                    color: white;
                    width: calc(100% - 108rpx);
                    .user-name{
                        display: flex;
                        justify-content: flex-start;
                        align-items: center;
                        margin-bottom: 24rpx;
                        .direc{
                            width: 2rpx ;
                            height: 20rpx;
                            background-color: white;
                            vertical-align: middle;
                            margin: 0 16rpx;
                        }
                    }
                    .dept-name{
                        font-size: 28rpx;
                        color: #FFFFFFB3;
                    }
                    .dept-per{
                        font-size: 24rpx;
                    }
                }
            }
        }
        .main-box{
            position: relative;
            top: -45rpx;
        }
        .show-phone-number{
            background-color: white;
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin: 0 40rpx;
            border-radius: 10rpx;
            padding: 28rpx 24rpx;
            font-size: 32rpx;
            color: #202D44FF;
            font-weight: normal;
            margin-bottom: 20rpx;
            .label{
                color: #7E8596FF;
            }
            .change{
                margin-left: 20rpx;
                color: #202D44FF;
            }
            image{
                width: 44rpx;
                height: 44rpx;
            }
        }
        .logout{
            text-align: center;
            padding: 20rpx 0;
            justify-content: center;
            align-items: center;
            border-radius: 38rpx;
            background: #FFF;
            font-size: 32rpx;
            color: #4a4e60ff;
            width: calc(100% - 64rpx);
            left: 32rpx;
            position: fixed;
            bottom: 220rpx;
        }
        .inckname{
            font-size: 36rpx;
        }
    }
</style>