Newer
Older
KaiFengH5 / src / views / home / home_my.vue
@鲁yixuan 鲁yixuan on 9 Jul 5 KB update
<template>
  <div id="home_my">
    <!-- 顶部天气数据与定位数据 -->
    <div id="HeaderBG">
      <div id="HeaderTop">
        <div id="PhotoBox">
          <van-image id="PhotoID" round :src="AllData.userPhoto" />
        </div>
        <div id="InfoBox">
          <p id="userinfo1">
            <span id="userName">{{ AllData.userNo }}</span>
            <span id="roleName">{{ AllData.realName }}</span>
          </p>
          <p id="userinfo2">{{ AllData.mobile }}</p>
        </div>
        <div id="MessagesBox">
          <img id="MessageImg" src="@/assets/images/my/tz_btn@.png" alt="" />
        </div>
      </div>
    </div>
    <div id="CentBox">
      <van-cell-group inset>
        <van-cell is-link to="editPassword">
          <!-- 使用 title 插槽来自定义标题 -->
          <template #title>
            <van-image round class="CellImg" :src="ListImg1" />
            <span class="custom-title">修改密码</span>
          </template>
        </van-cell>
        <van-cell is-link to="codeQR">
          <!-- 使用 title 插槽来自定义标题 -->
          <template #title>
            <van-image round class="CellImg" :src="ListImg2" />
            <span class="custom-title">检查更新</span>
          </template>
        </van-cell>
        <van-cell is-link to="helpInfo">
          <!-- 使用 title 插槽来自定义标题 -->
          <template #title>
            <van-image round class="CellImg" :src="ListImg3" />
            <span class="custom-title">帮助</span>
          </template>
        </van-cell>
      </van-cell-group>
    </div>
    <div id="BtmBox">
      <van-button type="danger" block @click="logOut">退出登录</van-button>
    </div>
  </div>
</template>

<script setup name="home_my">
import typeImg1 from '@/assets/images/xxtz.png';
import ListImg1 from '@/assets/images/my/xgmm_icon.png';
import ListImg2 from '@/assets/images/my/APPewm_icon.png';
import ListImg3 from '@/assets/images/my/bz_icon.png';
const { proxy } = getCurrentInstance();
import { useRouter } from 'vue-router';
const router = useRouter();
const AllData = reactive({
  userPhoto: typeImg1,
  userNo: localStorage.getItem('userNo'),
  realName: localStorage.getItem('realName'),
  mobile: localStorage.getItem('mobile'),
});

// 退出登录
function logOut() {
  localStorage.removeItem('NFAppToken');
  document.cookie = 'NFAppToken=' + '';
  proxy.showSuccessToast('退出成功');
  router.push('/login');
}
onMounted(() => {});
</script>

<style lang="less" scoped>
#home_my {
  width: 100%;
  height: 100%;
  background: #f2f1f6;
  #HeaderBG {
    width: 100%;
    height: 380px;
    background: linear-gradient(90deg, #3d84ff 0%, #53c0fe 100%);

    #HeaderTop {
      width: 100%;
      height: 300px;
      display: flex;
      flex-direction: column;
      flex-wrap: wrap;
      padding: 100px 60px 0 60px;
      box-sizing: border-box;
      #PhotoBox {
        height: 100%;
        width: 150px;
        box-sizing: border-box;
        padding: 15px;
        text-align: right;
        #PhotoID {
          width: 120px;
          height: 120px;
          border-radius: 60px;
        }
      }
      #InfoBox {
        height: 100%;
        width: calc(100% - 250px);
        box-sizing: border-box;
        padding-top: 25px;
        #userinfo1 {
          width: 100%;
          height: 60px;
          line-height: 60px;
          margin: 0;
          #userName {
            font-family: PingFang SC;
            font-weight: bold;
            font-size: 34px;
            color: #ffffff;
            line-height: 60px;
            box-sizing: border-box;
            padding: 0 20px;
            height: 60px;
            float: left;
          }
          #roleName {
            font-family: PingFang SC;
            font-weight: 500;
            font-size: 24px;
            color: #0080ff;
            box-sizing: border-box;
            float: left;
            background: url('@/assets/images/my/bq_img.png');
            background-size: cover;
            width: 150px;
            height: 40px;
            line-height: 40px;
            text-align: center;
            margin-top: 10px;
          }
        }
        #userinfo2 {
          width: 100%;
          height: 60px;
          line-height: 60px;
          margin: 0;
          font-family: PingFang SC;
          font-weight: 500;
          font-size: 24px;
          color: #ffffff;
          line-height: 27px;
          box-sizing: border-box;
          padding-left: 20px;
        }
      }
      #MessagesBox {
        // background: #fe8953;
        height: 100%;
        width: 100px;
        text-align: right;
        box-sizing: border-box;
        padding-top: 20px;
        #MessageImg {
          width: 33px;
          height: 40px;
        }
      }
    }
  }

  #CentBox {
    width: calc(100% - 60px);
    height: calc(100% - 500px);
    position: relative;
    top: -80px;
    left: 30px;
    border-radius: 10px;

    :deep(.van-cell) {
      padding: 30px;
    }

    .CellImg {
      width: 40px;
      height: 40px;
      float: left;
    }
    .custom-title {
      font-family: PingFang SC;
      font-weight: 500;
      font-size: 26px;
      color: #666666;
      line-height: 40px;
      float: left;
      box-sizing: border-box;
      padding-left: 10px;
    }
  }
  #BtmBox {
    width: 100%;
    height: 200px;
    box-sizing: border-box;
    padding: 0 50px;
  }
}
</style>