<style lang="less">
.aIndex {
  height: 100%;
  overflow: hidden;
  position: relative;
  background-color: #ebf5fa;
  background-repeat: no-repeat;
  background-size: contain;
  box-sizing: border-box;
  .top {
    position: relative;
    top: 18%;
  }
  .aTitle {
    text-align: center;
    color: #2e3742;
    font-size: 22px;
    font-weight: 600;
    line-height: 32px;
    margin-bottom: 72rpx;
  }
  .aImageDiv {
    position: relative;
    text-align: center;
    margin-bottom: 72rpx;
    .image {
      width: 204px;
    }
  }
  .aLink {
    text-align: center;
    color: #8b949e;
    font-size: 14px;
    line-height: 22px;
    margin-bottom: 16rpx;
    .copy {
      margin-left: 8px;
      color: #1db1b2;
    }
  }
  .aButton {
    text-align: center;
    color: #ffffff;
    font-size: 16px;
    line-height: 50px;
    background: #3dcbcc;
    width: 275px;
    height: 50px;
    border-radius: 28px;
    margin: 0 auto 32rpx;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .aInfo {
    text-align: center;
    color: #8b949e;
    font-size: 14px;
    line-height: 22px;
  }
  .bottom {
    position: absolute;
    bottom: 9%;
    left: 0;
    width: 100%;
  }
}
</style>
<template>
<div class="aIndex" :style="{'background-image': 'url('+h5StaticPath+'adminBack.png)'}">
  <navigationbar></navigationbar>
  <div class="top">
    <div class="aTitle">登录电脑行政端</div>
    <div class="aImageDiv">
      <image class="image" :src="h5StaticPath+'administration.png'" mode="widthFix" />
    </div>
    <div class="aLink">行政端：sagacare.tenants.link</div>
    <div class="aLink">用电脑打开上方行政端网址<span class="copy" @click="goto">复制网址</span></div>
  </div>
  <div class="bottom">
    <div class="aButton" @click="scanQrcode">
      <van-icon name="scan" style="margin-right:8px;"/>扫码登录
    </div>
  <div class="aInfo">扫一扫行政端二维码，登录行政端</div>
  </div>
</div>
</template>

<script>
import wepy from '@wepy/core';
import eventHub from '@/common/eventHub';
import { mapState } from '@wepy/x';
import store from '@/store';
import config from '@/config';
import {
  checkHasUserInfo,
} from '@/service/user.js';

wepy.page({
  store,
  config: {},
  data: {
    h5StaticPath: config.h5StaticPath + '/page-home/',
  },
  computed: {
    ...mapState({
      userInfo: (state) => state.user.userInfo,
      projctId: (state) => state.user?.userInfo?.projctId,
      companyId: (state) => state.user?.userInfo?.companyId,
    }),
  },
  methods: {
    goto:function(){
      wx.navigateTo({
            url: `/packagesEnv/pages/administration/chooseIdentity`,
          });
    },
    scanQrcode: function() {
      wx.scanCode({
        success: (res) => {
          console.log('scanQrcodescanQrcode', res);
          var qrCodeId = res.result;
          wx.navigateTo({
            url: `/packagesEnv/pages/administration/chooseIdentity?qrCodeId=${qrCodeId}`,
          });
        },
      });
    },
  },
  onLoad(options) {
    checkHasUserInfo();
  },
  onShow() {},
});
</script>
<config>
{
"navigationStyle":"custom",
usingComponents: {
  "van-icon": "module:@vant/weapp/dist/icon",
  "navigationbar":'./navigationbar',
}
}
</config>
