<template>
  <div>
    <mt-popup
      v-model="show"
      popup-transition="popup-fade"
      :closeOnClickModal="false"
    >
      <img src="../../assets/gotologin.png" alt="" class="gotologin" />
      <div class="login_success">您还尚未登录</div>
      <div class="login_message">登录后账号信息不丢失，阅读更顺畅</div>
      <div class="go_back_btn" @click="goBind">立即登录</div>
      <div class="close_icon" @click="closePop" v-if="showCloseIcon">
        <img src="../../assets/cancellogin.png" alt="" />
      </div>
    </mt-popup>
  </div>
</template>
<script>
import { Popup } from "mint-ui";
import router from "../../router";
export default {
  name: "GoLogin",
  data() {
    return {
      popupVisible: false
    };
  },
  components: {
    mtPopup: Popup
  },
  props: {
    show: {
      required: false,
      type: Boolean,
      default: true
    },
    showCloseIcon: {
      required: false,
      type: Boolean,
      default: true
    },
    close: {
      required: false,
      type: Function
    },
    callback: {
      required: false,
      type: Function
    }
  },
  methods: {
    goBind() {
      //router.push("/login");
      //this.close();
      this.callback("success");
    },
    closePop() {
      this.close && this.close();
    }
  }
};
</script>
<style lang="scss" scoped>
/deep/.mint-popup {
  .gotologin {
    width: 202px;
    height: 144px;
  }
  padding: 1rem;
  border-radius: 0.2rem;
  position: fixed;
  background: #fff;
  top: 40%;
  left: 50%;
  z-index: 8000;
  -webkit-transform: translate3d(-50%, -50%, 0);
  transform: translate3d(-50%, -50%, 0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-transition: 0.2s ease-out;
  transition: 0.2s ease-out;
  .login_success {
    margin-top: 10px;
    text-align: center;
    font-size: 18px;
    color: #333;
    font-weight: 600;
    margin-bottom: 5px;
  }
  .go_back_btn {
    height: 0.7rem;
    line-height: 0.7rem;
    background: #3ba3fc;
    text-align: center;
    color: white;
    border-radius: 0.2rem;
    margin: 0 auto;
  }
  .login_message {
    font-size: 15px;
    color: #666666;
    font-weight: 400;
    text-align: center;
    margin-bottom: 10px;
  }
  .close_icon {
    position: absolute;
    left: 45%;
    bottom: -1rem;
    color: white;
    margin-top: 0.2rem;
  }
}
</style>
