<template>
  <div class="footer">
    <div class="send-box" v-show="!isInput">
      <send-box></send-box>
    </div>
    <div class="shop-box" v-show="!isInput" v-if="isShop || (caseInfo && !!caseInfo.status)" >
      <shop-box></shop-box>
    </div>
    <div class="more-box" v-show="!isInput">
      <more-box></more-box>
    </div>
    <suspension-box class="suspension-box" :style="{left: isInput ? 'calc(100% - 0.46rem)' : '' }"></suspension-box>
  </div>
</template>

<script>
import { mapGetters } from 'vuex';
import sendBox from '@/components/modules-vertical/sendBox';
const shopBox = resolve => require(['@/components/modules-vertical/shopBox'], resolve);
import moreBox from '@/components/modules-vertical/moreBox';
const suspensionBox = resolve => require(['@/components/modules-vertical/suspensionBox'], resolve);

export default {
  name: 'vertical-footer-box',
  components: {
    sendBox,
    shopBox,
    moreBox,
    suspensionBox
  },
  data() {
    return {
      isInput: false
    };
  },
  computed: {
    ...mapGetters({
      caseInfo: 'caseInfo',
      channelInfo: 'channelInfo',
      channelConfig: 'channelConfig'
    }),
    isShop() {
      const info = this.channelConfig.shop || {};
      return info.isShow === 1;
    }
  },
  mounted() {
    this.$Bus.$on('bus-footerInput', this.footerInput);
  },
  methods: {
    footerInput(value) {
      this.isInput = value
    }
  }
};
</script>
<style lang="less" scoped>
.footer {
  padding: 0 0.1rem;
  height: 100%;
  display: flex;
  align-items: center;
  .send-box {
    flex: 1;
  }
  .shop-box {
    margin-left: 0.1rem;
    flex: 0 0 auto;
  }
  .more-box {
    margin-left: 0.1rem;
    flex: 0 0 auto;
  }
  .suspension-box {
    margin-left: 0.1rem;
    flex: 0 0 auto;
  }
}
</style>
