UserLayout.vue 4.59 KB
<template>
  <div id="userLayout" :class="['user-layout-wrapper', device]">
    <div id="canvasWrap" ref="canvasWrap">
      <canvas class="J_codeimg" id="myCanvas">对不起,您的浏览器不支持canvas,请下载最新版浏览器!</canvas>
    </div>
    <div class="container">
      <div class="top">
        <div class="header">
          <a href="/">
<!--            <img src="~@/assets/logos.png" class="logo" alt="logo">-->
          </a>
        </div>
        <!-- <div class="desc">

        </div> -->
      </div>
      <route-view></route-view>
      <div class="footer">
        <!-- <div class="links">
          <a href="http://jeecg-boot.mydoc.io" target="_blank">帮助</a>
          <a href="https://github.com/zhangdaiscott/jeecg-boot" target="_blank">隐私</a>
          <a href="https://github.com/zhangdaiscott/jeecg-boot" target="_blank">条款</a>
        </div> -->
        <div class="copyright">
          <img class="huipu" src="~@/assets/pingjia.png" alt="">
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import RouteView from "@/components/layouts/RouteView"
import { mixinDevice } from '@/utils/mixin.js'
import '@/utils/particles/Particleground.js'
export default {
  name: "UserLayout",
  components: { RouteView },
  mixins: [mixinDevice],
  data () {
    return {}
  },
  created () {
    this.$nextTick(() => {
      // $(this.$refs.canvasWrap).particleground({
      //   dotColor: '#E8DFE8',
      //   lineColor: '#133b88'
      // });
      var fullscreen = function () {
        elem = document.body;
        if (elem.webkitRequestFullScreen) {
          elem.webkitRequestFullScreen();
        } else if (elem.mozRequestFullScreen) {
          elem.mozRequestFullScreen();
        } else if (elem.requestFullScreen) {
          elem.requestFullscreen();
        } else {
          //浏览器不支持全屏API或已被禁用
        }
      }
    })
  },
  mounted () {
    document.body.classList.add('userLayout')
  },
  beforeDestroy () {
    document.body.classList.remove('userLayout')
  },
}
</script>

<style lang="scss" scoped>
#userLayout.user-layout-wrapper {
  overflow: hidden;
  height: 100%;
  position: relative;
  &.mobile {
    .container {
      .main {
        max-width: 368px;
        width: 98%;
      }
    }
  }

  .container {
    width: 100%;
    min-height: 100%;
    // background: #f0f2f5 url(~@/assets/background.svg) no-repeat 50%;
    background-size: 100%;
    padding: 180px 0 144px;
    position: absolute;
    top: 0;
    left: 0;

    a {
      text-decoration: none;
    }

    .top {
      text-align: center;

      .header {
        height: 44px;
        line-height: 44px;

        .badge {
          position: absolute;
          display: inline-block;
          line-height: 1;
          vertical-align: middle;
          margin-left: -12px;
          margin-top: -10px;
          opacity: 0.8;
        }

        .logo {
          height: 44px;
          vertical-align: top;
          margin-right: 16px;
          border-style: none;
        }

        .title {
          font-size: 33px;
          color: rgba(255, 255, 255, 0.85);
          font-family: 'Chinese Quote', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
            'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
            'Segoe UI Symbol';
          font-weight: 600;
          position: relative;
          top: 2px;
        }
      }
      .desc {
        font-size: 14px;
        color: rgba(0, 0, 0, 0.45);
        margin-top: 12px;
        margin-bottom: 40px;
      }
    }

    .main {
      min-width: 260px;
      width: 388px;
      margin: 0 auto;
      background: rgba(0, 0, 0, 0.45);
      padding: 25px;
      border-radius: 5px;
    }

    .footer {
      position: absolute;
      width: 100%;
      bottom: 0;
      padding: 0 16px;
      margin: 48px 0 24px;
      text-align: center;

      .links {
        margin-bottom: 8px;
        font-size: 14px;
        a {
          color: rgba(255, 255, 255, 0.85);
          transition: all 0.3s;
          &:not(:last-child) {
            margin-right: 40px;
          }
        }
      }
      .copyright {
        color: rgba(255, 255, 255, 0.85);
        font-size: 14px;
      }
    }
  }
}
#canvasWrap {
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
 // background-image: url(~@/assets/Starry.jpg);
  background-image: url(~@/assets/loginBackground.jpg);
  background-repeat: no-repeat;
  background-size: cover;
}

.J_codeimg {
  width: 85px;
  height: 36px;
  padding: 3px;
  z-index: 0;
  color: #fff;
}
.huipu{
  height: 45px;
}
</style>