<template>
  <div v-if="!isMobileTerminal" class="foot-mark-box">
    <div>
      <div>陕ICP备17000711号-1</div>
      <div>平台联系邮箱：operation@changan-inkasso.com</div>
      <div>客服联系电话：029-86689180</div>
      <div @click="aboutClick">关于我们</div>
      <!-- <div>安全合规</div> -->
      <div @click="userProtocol">用户协议</div>
      <!-- <div>平台教程</div> -->
    </div>

    <cy-dialog ref="dialog" title="用户协议" top="10vh">
      <div class="user-protocol-content">
        <register-protocal />
      </div>
    </cy-dialog>
  </div>
</template>

<script>
import { isMobileDevice } from '@/utils'

export default {
  components: {
    RegisterProtocal: () => import('@/views/login/components/RegisterProtocal')
  },
  data() {
    return {
      isMobileTerminal: false
    }
  },
  mounted() {
    this.isMobile()
    window.addEventListener('resize', this.isMobile)
  },
  beforeDestroy() {
    window.removeEventListener('resize', this.isMobile)
  },
  methods: {
    aboutClick() {
      window.open(`#/about`)
    },
    userProtocol() {
      this.$refs.dialog.show = true
    },
    // 是否是手机端
    isMobile() {
      if (isMobileDevice() && window.screen.width < 768) {
        this.isMobileTerminal = true
        this.$store.dispatch('app/closeSideBar', { withoutAnimation: false })
      } else {
        this.isMobileTerminal = false
        this.$store.dispatch('app/openSideBar')
      }
    }
  }
}
</script>

<style lang="scss" scoped>
.foot-mark-box {
  height: 50px;
  background: #000;
  position: fixed;
  width: 100%;
  left: 0px;
  bottom: 0px;
  color: #fff;
  z-index: 9999;
  & > div:first-child {
    display: flex;
    justify-content: center;
    margin-right: 40px;
    line-height: 50px;
    font-size: 14px;
    cursor: pointer;
    & > div {
      margin-right: 40px;
    }
  }
  .user-protocol-content {
    height: 80vh;
    overflow-y: auto;
    margin: -20px;
    margin-top: -60px;
  }
  .hamburger-container {
    line-height: 46px;
    height: 100%;
    float: left;
    cursor: pointer;
    transition: background .3s;
    -webkit-tap-highlight-color:transparent;
    background-color: #fff;

    &:hover {
      // background: rgba(0, 0, 0, .025)
      background: #fff;
    }
  }
}
</style>
