Houjie
2025-04-11 1bf977929dd324f3ac64b70debd8a79443c54392
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
<template>
    <view>
        <scroll-view scroll-y class="page">
              <!-- 头部logo-->
          <view class="UCenter-bg">
            <image :src="personalList.avatar" class="png round animation-slide-right margin-bottom-sm" mode="scaleToFill" :style="[{animationDelay: '0.1s'}]"></image>
            <image src="https://static.jeecg.com/upload/test/wave_1595818053612.gif" mode="scaleToFill" class="gif-wave"></image>
          </view>
          <view class="padding flex text-center text-grey bg-white shadow-warp">
            <view class="flex flex-sub flex-direction solid-right animation-slide-top" :style="[{animationDelay: '0.2s'}]">
              <view class="text-xl text-orange">{{personalList.username}}</view>
              <view class="margin-top-sm"><text class="cuIcon-people"></text> 用户</view>
            </view>
            
            <view class="flex flex-sub flex-direction animation-slide-top" :style="[{animationDelay: '0.2s'}]">
              <view class="text-xl text-green">{{personalList.post?personalList.post:'员工'}}</view>
              <view class="margin-top-sm"><text class="cuIcon-news"></text> 职务</view>
            </view>
          </view>
          <!-- 列表list-->
          <view class="cu-list menu card-menu margin-top-xl margin-bottom-xl shadow-lg radius">
            <view class="cu-item arrow animation-slide-bottom" :style="[{animationDelay: '0.1s'}]">
              <view class="content" >
                <text class="cuIcon-favorfill text-yellow"></text>
                <text class="text-grey">收藏</text>
              </view>
            </view>
            <view class="cu-item arrow animation-slide-bottom" :style="[{animationDelay: '0.2s'}]">
              <view class="content">
                <text class="cuIcon-redpacket_fill text-red"></text>
                <text class="text-grey">红包</text>
              </view>
            </view>
            <view class="cu-item arrow animation-slide-bottom" :style="[{animationDelay: '0.3s'}]" @tap="scan">
              <view class="content">
                <text class="cuIcon-scan text-red"></text>
                <text class="text-grey">扫码</text>
              </view>
            </view>
            <navigator class="cu-item arrow animation-slide-bottom" :style="[{animationDelay: '0.4s'}]" url="/pages/user/location" hover-class="none">
                <view class="content" >
                    <text class="cuIcon-location text-cyan"></text>
                    <text class="text-grey">定位</text>
                </view>
            </navigator>
            <navigator class="cu-item arrow animation-slide-bottom" url="/pages/user/userdetail" :style="[{animationDelay: '0.6s'}]">
                 <view class="content">
                    <text class="cuIcon-settingsfill text-cyan"></text>
                    <text class="text-grey">设置</text>
                </view>
            </navigator>
           
            <navigator class="cu-item arrow animation-slide-bottom" :style="[{animationDelay: '0.7s'}]" url="/pages/user/userexit" hover-class="none">
                <view class="content" >
                    <text class="cuIcon-exit text-cyan"></text>
                    <text class="text-grey">退出</text>
                </view>
            </navigator>
          </view>
          <view class="cu-tabbar-height"></view>
        </scroll-view>
    </view>
</template>
 
<script>
    import api from '@/api/api'
    export default {
        name: "people",
        data() {
            return {
                personalList:{
                  avatar:'',
                  realname:'',
                  username:'',
                  post:''
                },
                  positionUrl:'/sys/position/list',
                  departUrl:'/sys/user/userDepartList',
                  userUrl:'/sys/user/queryById',
                  postUrl:'/sys/position/queryByCode',
                  userId:'',
                  id:''
            };
        },
        watch: {
            cur: {
                immediate: true,
                handler() {
                    console.log('watch',this.cur)
                    this.userId=this.$store.getters.userid;
                    this.load()
                },
            },
        },
        methods: {
            scan(){
                 console.log("进来了")
                // #ifndef H5
                uni.scanCode({
                    success: function (res) {
                        console.log('条码res:' + res);
                        console.log('条码类型:' + res.scanType);
                        console.log('条码内容:' + res.result);
                    }
                });
                // #endif
                // #ifdef H5
                this.$tip.alert("暂不支持")
                // #endif
            },
            load(){
                if(!this.userId){
                    
                    return;
                }
                this.$http.get(this.userUrl,{params:{id:this.userId}}).then(res=>{
                    console.log("res",res)
                     if (res.data.success) {
                        let perArr = res.data.result
                        let avatar=(perArr.avatar && perArr.avatar.length > 0)? api.getFileAccessHttpUrl(perArr.avatar):'/static/avatar_boy.png'
                        this.personalList.avatar =avatar
                        this.personalList.realname = perArr.realname
                        this.personalList.username = perArr.username
                        this.personalList.depart = perArr.departIds
                        this.getpost(perArr.post)
                    }
                }).catch(err => {
                    console.log(err);
                });
                
            },
            getpost(code){
                if(!code||code.length==0){
                    this.personalList.post='员工'
                    return false;
                }
                this.$http.get(this.postUrl,{params:{code:code}}).then(res=>{
                    console.log("postUrl",res)
                     if (res.data.success) {
                        this.personalList.post=res.data.result.name
                    }
                }).catch(err => {
                    console.log(err);
                });
                
            }
        }
    }
</script>
 
<style>
.UCenter-bg {
    /* #ifdef MP-WEIXIN */
    background-image: url('https://static.jeecg.com/upload/test/blue_1595818030310.png');
    /* #endif */
    /* #ifndef MP-WEIXIN */
    background-image: url('/static/blue.png');
    /* #endif */
  background-size: cover;
  height: 400rpx;
  display: flex;
  justify-content: center;
  padding-top: 40rpx;
  overflow: hidden;
  position: relative;
  flex-direction: column;
  align-items: center;
  color: #fff;
  font-weight: 300;
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
}
 
.UCenter-bg text {
  opacity: 0.8;
}
 
.UCenter-bg image {
  width: 200rpx;
  height: 200rpx;
}
 
.UCenter-bg .gif-wave{
  position: absolute;
  width: 100%;
  bottom: 0;
  left: 0;
  z-index: 99;
  mix-blend-mode: screen;  
  height: 100rpx;   
}
 
map,.mapBox{
  left: 0;
  z-index: 99;
  mix-blend-mode: screen;  
  height: 100rpx;   
}
 
map,.mapBox{
  width: 750rpx;
  height: 300rpx;
}
</style>