<template>
  <div class="page_noJoinedGroup">
    <div class="noJoinedGroupTitle">
      <i class="iconfont icon-zuojiantou jiantou" @click="$router.go(-1)"></i>
    </div>
    <div class="noJoinedGroupTxt">你还没有加入任何医院/组织/团队</div>
    <div class="nojoinBox">
      <div class="nojoinImgBox">
        <img class="nojoinImg" src="../../../assets/images/nojoin.png" alt />
        <p class="nojoinTxt">为了更好的体验酷医云系统</p>
        <p class="nojoinTxt">请先创建你的医院/组织/团队</p>
      </div>
    </div>
    <div class="know" @click="goCreateOrg()">创建</div>
    <div class="wantCreate" @click="goHome()">我已了解，进入酷医云 ></div>
  </div>
</template>
<script>
import "@/styles/newStyle.scss";
import { login } from "@/api/login";

export default {
  data() {
    return {};
  },
  methods: {
    goCreateOrg() {
      this.$router.push("/createorg");
    },
    goHome() {
      login().then(response => {
        if (response.data.state === 1) {
          var user = response.data.data.user;
          var admin = response.data.data.admin;
          var org = response.data.data.org;
          var subscibe = response.data.data.subscibe;
          var config_list = response.data.data.config_list;
          var dict_config_list = response.data.data.dict_config_list;
          var token = response.data.data.token;
          localStorage.setItem("token",token);

          var template_info = response.data.data.template_info;
          var filed_list = response.data.data.filed_list;
          this.$store.dispatch("InitUserInfo", {
            admin: admin,
            user: user,
            org: org,
            subscibe: subscibe,
            template_info: template_info,
            filed_list: filed_list
          });
          this.$store.dispatch("SetConfigList", config_list);
          this.$store.dispatch("SetDictConfigList", dict_config_list);

          this.$router.replace("/homeIndex");

        } else {
          this.$toast({
            message: response.data.msg
          });
        }
      });
    }
  }
};
</script>

<style lang="scss" scoped>
.page_noJoinedGroup {
  height: 100%;
  overflow: hidden;
  .noJoinedGroupTitle {
    height: 3.125rem;
    line-height: 3.125rem;
    display: flex;
    align-items: center;
  }
  .jiantou {
    margin-left: 1rem;
    font-size: 1.5rem;
    font-weight: 600;
  }
  .noJoinedGroupTxt {
    font-size: 1.0625rem;
    font-family: PingFangSC;
    font-weight: bold;
    color: rgba(0, 0, 0, 1);
    line-height: 0.9375rem;
  }
  .noJoinedGroupTxt {
    padding: 1.25rem;
    font-size: 17px;
    font-family: PingFangSC;
    font-weight: bold;
    color: rgba(0, 0, 0, 1);
    line-height: 15px;
  }
  .nojoinBox {
    width: 21.125rem;
    height: 22.75rem;
    background: rgba(255, 255, 255, 1);
    box-shadow: 0px 1px 15px 0px rgba(91, 91, 91, 0.3);
    border-radius: 3px;
    margin: 0 auto;
    .nojoinImgBox {
      width: 10.5rem;
      margin: 0 auto;
      padding-top: 3rem;
    }
    .nojoinImg {
      width: 10.5rem;
      height: 10.5rem;
    }
    .nojoinTxt {
      font-size: 0.8125rem;
      text-align: center;
      color: #338afb;
      line-height: 1.125rem;
    }
  }
  .know {
    width: 19.25rem;
    height: 2.875rem;
    line-height: 2.875rem;
    background: rgba(51, 138, 251, 1);
    box-shadow: 0px 1px 12px 0px rgba(51, 138, 251, 1);
    border-radius: 23px;
    color: #fff;
    text-align: center;
    margin: 1.875rem auto 1.625rem;
    font-size: 1rem;
  }
  .wantCreate {
    text-align: center;
    text-decoration: underline;
    color: #338afb;
    font-size: 0.8125rem;
  }
}
</style>
