<style lang="less">
.overflow-wrap {
  box-sizing: border-box;
  position: relative;
  width: 100%;
  height: 100%;
  background-color: #ebf5fa;
  background-repeat: no-repeat;
  background-size: contain;
  padding-left: 40rpx;
  padding-right: 40rpx;
  padding-top: 166rpx;
  padding-bottom: 208rpx;
  overflow-y: auto;

  .bind-item {
    position: relative;
    width: 100%;
    box-sizing: border-box;
    padding: 40rpx 48rpx;
    margin: 0 auto;
    margin-top: 24rpx;
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    // &:nth-child(1) {
    //   margin-top: 34rpx;
    // }
    .checked-icon {
      position: absolute;
      right: 0;
      top: 0;
      width: 56rpx;
      height: 56rpx;
    }
    .tenant-name {
      font-family: PingFang SC;
      font-size: 36rpx;
      font-weight: 500;
      line-height: 50rpx;
      letter-spacing: 0px;
    }
    .tenant-identity {
      display: flex;
      padding-top: 8rpx;
      justify-content: space-between;
      font-family: PingFang SC;

      .info {
        font-size: 28rpx;
        font-weight: 400;
        padding: 8rpx;
        //styleName: 14/常规;
        font-family: PingFang SC;
        font-weight: 400;
        color: #8b949e;
      }
      image {
        width: 112rpx;
        height: 40rpx;
      }
    }
  }
  .check-item {
    background: #3dcbcc4d;
  }
  .bind-btn-box {
    position: fixed;
    z-index: 333;
    bottom: 0;
    left: 0;
    height: 208rpx;
    width: 100%;
    background: linear-gradient(
      180deg,
      rgba(235, 245, 250, 0) 0%,
      #ebf5fa 44.97%
    );
    button {
      margin-top: 20px;
      width: 670rpx;
      height: 100rpx;
      line-height: 100rpx;
      border: none;
      border-color: transparent;
      color: #fff;
      border-radius: 28px;
      background: #3dcbcc;
    }
  }
}
</style>
<template>
  <div class="overflow-wrap"  :style="{'background-image': 'url('+h5StaticPath+'/page-home/adminBack.png)'}">
    <navigationbar :ntitle="'选择登录身份'"></navigationbar>
   <div class="bind-item" >
      <div class="tenant-name">{{ companyName }}</div>
      <div class="tenant-identity">
        <div class="info">正式员工</div>
        <image class="logo-icon"  src="{{h5StaticPath+'/page-bind-tenant/logo_icon.svg'}}"/>
      </div>
      <image class="checked-icon"   src="{{h5StaticPath+'/page-bind-tenant/checked.svg'}}"/>
   </div>

   <div class="bind-btn-box">
    <button @click.stop="loginAdmin">确认</button>
   </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 { confirmLogin } from '@/api/home.js';

wepy.page({
  store,
  config: {},
  data: {
    h5StaticPath: config.h5StaticPath,
    qrCodeId: '',
  },
  computed: {
    ...mapState({
      userInfo: (state) => state.user.userInfo,
      projctId: (state) => state.user?.userInfo?.projctId,
      companyId: (state) => state.user?.userInfo?.companyId,
      companyName: (state) => {
        return state.user?.companyName;
      },
    }),
  },
  methods: {
    loginAdmin() {
      confirmLogin({ qrCodeId: '1792589efd114af5a1493f1b05a22378' })
        .then((res) => {
          if (res.result == 'success') {
            wx.navigateTo({
              url: `/packagesEnv/pages/administration/asuccess`,
            });
          }
        })
        .catch((err) => {});
    },
  },
  onLoad(options) {
    this.qrCodeId = options.qrCodeId;
  },
  onShow() {},
});
</script>
<config>
{
"navigationStyle":"custom",
usingComponents: {
  "van-icon": "module:@vant/weapp/dist/icon",
  "navigationbar":'./navigationbar',
}
}
</config>
