<template>
  <div class="send">
    <div class="disabled" v-if="channelInfo.chatDisable">全员禁言中</div>
    <div class="disabled" v-else-if="userInfo.isDisableChat == 1">你已被禁言</div>
    <div class="text" v-else-if="allowChat" @click.stop="showSend = true">一起聊聊吧...</div>
    <div class="text" v-else @click="_login">点击登录，参与互动</div>
    <div class="send-mask" v-transfer-dom v-show="showSend">
      <send-chat v-model="showSend"></send-chat>
    </div>
  </div>
</template>
<script>
import { mapGetters } from 'vuex';
import sendChat from './sendChat';
export default {
  name: 'vertical-send-box',
  components: {
    sendChat
  },
  data() {
    return {
      showSend: false,
      sendDate: 0,
      content: ''
    };
  },
  computed: {
    ...mapGetters({
      userInfo: 'userInfo',
      channelInfo: 'channelInfo'
    }),
    allowChat() {
      if (!this.userInfo.id && this.channelInfo.chatLogin) {
        return false;
      } else {
        return true;
      }
    }
  },
  methods: {
    _login() {
      this.$Bus.$emit('bus-showLogin', true);
    }
  }
};
</script>
<style lang="less" scoped>
.send {
  .disabled {
    padding: 0 0.1rem;
    width: 100%;
    height: 0.36rem;
    line-height: 0.36rem;
    border-radius: 0.2rem;
    background: rgba(0, 0, 0, 0.3);
    font-size: 0.13rem;
    color: #eee;
  }
  .text {
    padding: 0 0.1rem;
    width: 100%;
    height: 0.36rem;
    line-height: 0.36rem;
    border-radius: 0.2rem;
    background: rgba(0, 0, 0, 0.3);
    font-size: 0.13rem;
    color: #fff;
  }
}
.send-mask {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 900;
  width: 100%;
  background: #fff;
  height: 0.5rem;
}
</style>
