user-info.vue 1.4 KB
<template>
  <view class="user-info">
    <image :src="avatar" mode=""></image>
    <view class="info-desc">
      <view class="name-wrap">
        <text class="name">{{name}}</text>
        <text class="work-or-off">{{status}}</text>
      </view>
      <view style="color: #ffffffff;font-size: 28rpx;margin-top: 20rpx;">{{mobile}}</view>
    </view>
  </view>
</template>

<script>
  export default {
    data() {
      return {
        avatar: '',
        mobile: '',
        status: '',
        name: '',
      }
    },
    mounted() {
      this.avatar = uni.getStorageSync('avatar')
      this.name = uni.getStorageSync('name')
      this.mobile = uni.getStorageSync('mobile')
      this.status = uni.getStorageSync('status') === 1 ? '上班' : '休息'
    }
  }
</script>

<style lang="scss">
  .user-info {
    position: relative;
    @include flexcenter();
    margin-top: 60rpx;
    margin-left: 40rpx;

    image {
      @include commonIconWh(120rpx);
      margin-right: 24rpx;
    }

    .info-desc {
      color: #ffffffff;

      .name-wrap {
        @include flexcenter();

        .name {
          font-size: 32rpx;
          font-weight: 700;
          margin-right: 12rpx
        }
      }

      .work-or-off {
        @include flexCj(center);
        color: #ed3f24ff;
        font-size: 24rpx;
        width: 96rpx;
        height: 32rpx;
        border-radius: 96rpx;
        background: #ffffffff;
      }
    }
  }
</style>