| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242 |
- <template>
- <view class="content">
- <view class="banner custom_status_bar">
- <div class="custom-nav">个人中心</div>
- <div class="user-container">
- <view class="avatar">
- <image v-if="user.userAvatar" class="photo" :src="user.userAvatar" mode="widthFix" @error="userAvatar=defaultAvatar"></image>
- <image v-else class="photo" :src="defaultAvatar" mode="widthFix"></image>
- </view>
- <view class="bottom">
- <view class="name">
- <text>{{user.userName}}</text>
- </view>
- <div class="phone">{{user.userPhone}}</div>
- </view>
- </div>
- </view>
- <view class="handle-container">
- <view class="list">
- <view class="item">
- <div class="lf">
- <image class="icon" src="/static/center/dollar-circle.png" mode="widthFix"></image>
- <text class="name">联系电话</text>
- </div>
- <view class="rt">
- <text class="cont">{{user.userPhone}}</text>
- <uni-icons type="right" size="20" color="#B3B3B3"></uni-icons>
- </view>
- </view>
- <view class="item">
- <div class="lf">
- <image class="icon" src="/static/center/timer.png" mode="widthFix"></image>
- <text class="name">部门</text>
- </div>
- <view class="rt">
- <text class="cont">{{user.groupName}}</text>
- <uni-icons type="right" size="20" color="#B3B3B3"></uni-icons>
- </view>
- </view>
- <view class="item">
- <div class="lf">
- <image class="icon" src="/static/center/heart.png" mode="widthFix"></image>
- <text class="name">企业通讯录</text>
- </div>
- <view class="rt">
- <text class="cont"></text>
- <uni-icons type="right" size="20" color="#B3B3B3"></uni-icons>
- </view>
- </view>
- <view class="item">
- <div class="lf">
- <image class="icon" src="/static/center/archive-tick.png" mode="widthFix"></image>
- <text class="name">修改密码</text>
- </div>
- <view class="rt">
- <text class="cont"></text>
- <uni-icons type="right" size="20" color="#B3B3B3"></uni-icons>
- </view>
- </view>
- <view class="item">
- <div class="lf">
- <image class="icon" src="/static/center/setting.png" mode="widthFix"></image>
- <text class="name">版本升级</text>
- </div>
- <view class="rt">
- <text class="cont">1.0.0</text>
- <uni-icons type="right" size="20" color="#B3B3B3"></uni-icons>
- </view>
- </view>
- </view>
- <div class="logoutBt" @click="logout">退出登录</div>
- </view>
- </view>
- </template>
- <script>
- import {logout} from '@/api/system/user.js'
- export default{
- data(){
- return{
- defaultAvatar:"/static/components/avatar.png",
- user:{
- groupName: "",
- ocName: "",
- positionName: "",
- roleName: "",
- userAvatar: "",
- userIntro: "",
- userName: "",
- userPhone: "",
- userPhoto: "",
- userRealName: ""
- }
- }
- },
- onShow() {
- this.init();
- },
- methods:{
- init(){
- let user=uni.getStorageSync('accountInfo');
- if(user){
- user=JSON.parse(user)
- this.user=user
- }
- },
- logout(){
- uni.showModal({
- title:'提示!',
- content:"是否要退出登录",
- success(res) {
- if (res.confirm) {
- logout().then(()=>{
- uni.clearStorageSync()
- uni.reLaunch({
- url:'/pages/login/index'
- })
- })
- }
- }
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .content{
- background-color: rgba(243, 244, 247, 1);
- min-height: 100vh;
- box-sizing: border-box;
- .banner{
- height: 422rpx;
- background-image: url('/static/center/bg.png');
- background-repeat: no-repeat;
- background-size: 100% 100%;
- .custom-nav{
- font-size: 40rpx;
- color: #fff;
- padding-top: 24rpx;
- text-indent: 32rpx;
- /* #ifdef MP-WEIXIN */
- margin-top: 28px;
- /* #endif */
- }
- .user-container{
- &{
- display: flex;
- justify-content: flex-start;
- align-items: center;
- padding: 46rpx 0 0 32rpx;
- }
- .avatar{
- width: 120rpx;
- height: 120rpx;
- border-radius: 50%;
- display: block;
- overflow: hidden;
- background: rgba(255,255,255,0.39);
- border: 2rpx solid #707070;
- .photo{
- width: 120rpx;
- height: 120rpx;
- border-radius: 50%;
- }
- }
- .bottom{
- &{
- padding-left: 20rpx;
- }
- .name{
- font-size: 36rpx;
- font-family: PingFang SC;
- font-weight: bold;
- line-height: 50rpx;
- color: #FFFFFF;
- }
- .phone{
- font-size: 28rpx;
- font-family: PingFang SC;
- font-weight: 400;
- line-height: 40rpx;
- color: #FFFFFF;
- padding-top: 14rpx;
- }
- }
- }
- }
- .handle-container{
- padding: 30rpx 24rpx;
- .logoutBt{
- width: 700rpx;
- height: 72rpx;
- line-height: 72rpx;
- text-align: center;
- background:#fff;
- font-size: 32rpx;
- font-family: PingFang SC;
- font-weight: 400;
- color:rgba(110, 116, 128, 1);
- margin-top: 30rpx;
- }
- .list{
- .item{
- height: 98rpx;
- display: flex;
- justify-content: space-between;
- align-items: center;
- background-color: #fff;
- padding: 0 24rpx;
- border-bottom: 1px solid rgba(238, 238, 238, 1);
- .lf{
- display: flex;
- align-items: center;
- .icon{
- width: 48rpx;
- height: 48rpx;
- }
- .name{
- padding-left: 20rpx;
- font-size: 32rpx;
- font-family: PingFang SC;
- color: rgba(45, 49, 51, 1);
- }
- }
- .rt{
- flex: 1;
- display: flex;
- align-items: center;
- justify-content: flex-end;
- .cont{
- padding-right: 30rpx;
- font-size: 32rpx;
- font-family: PingFang SC;
- color: rgba(45, 49, 51, 1);
- }
- }
- }
- }
- }
- }
- </style>
|