bloc.vue 8.12 KB
<template>
  <div class="bloc-info-module">
    <div class="wrapper">
      <div class="wrap_left">
        <div class="out_box_wrap">
          <div class="fixed_widget">
            <div class="label_top">
              <div class="label_top-title">{{ bloc.merchantModelName || '--' }}</div>
              <div>
                <span class="label_top-text">有效期:</span>
                <span class="label_top-time">{{ bloc.effectiveTimeName || '--' }}</span>
              </div>
            </div>
          </div>
          <div class="dr_top">
            <div class="label_text label-top">
              <span class="label-bottom-title">开通门店数:</span>
              <span v-if="bloc.numberStores" class="label-bottom-title-text">{{ bloc.numberStores }}家</span>
              <!-- <span v-else class="num_text">--</span> -->
            </div>
            <div class="label-title">
              <span class="label-bottom-title">门店详情:</span>
              <span class="open-icon" @click="changeRightOpenStatus(isOpen)">
                <span>{{ isOpen ? '收起' : '展开' }}</span>
                <i :class="isOpen ? 'el-icon-arrow-up' : 'el-icon-arrow-down'"></i>
              </span>
            </div>
          </div>
          <div :class="isOpen ? 'table_wrapper_open' : 'table_wrapper_close'">
            <!-- <GLTable v-if="isOpen" :hasPage="false" :tableParams="tableParams" :tableData="list" :headerStyle="{ background: '#F4F6FC', color: '#333333', fontSize: '14px' }"></GLTable> -->
            <template v-if="isOpen">
              <div class="line_wrapper wrap_header">
                <div class="tittle text_w">序号</div>
                <div class="tittle1 text_w">门店名称</div>
                <div class="tittle2 text_w">有效期</div>
              </div>
              <div class="line_body" :style="{ height: tableHeight + 'px' }">
                <template v-if="list.length">
                  <div v-for="(item, index) in list" :key="index" class="line_wrapper">
                    <div class="tittle">{{ index + 1 }}</div>
                    <div class="tittle1">{{ item.merchantName }}</div>
                    <div class="tittle2">{{ item.date }}</div>
                  </div>
                </template>
                <template v-if="!list.length">
                  <div class="line_wrapper">暂无数据</div>
                </template>
              </div>
            </template>
          </div>
          <!-- <div class="fixed_footer" @click="changeRightOpenStatus(isOpen)">
            <i :class="isOpen ? 'el-icon-caret-top' : 'el-icon-caret-bottom'"></i>
            <span class="dr_left">{{ isOpen ? '隐藏门店详情' : '展开门店详情' }}</span>
          </div> -->
        </div>
      </div>
      <!-- <div class="wrap_right">
        <div v-for="(item, index) in rightData" :key="index" class="out_box_wrap">
          <div class="fixed_widget">
            <div class="label_text">版本:{{ item.name }}</div>
            <div class="label_text dr_top">
              开通门店数:
              <span class="num_text">{{ item.num }}家</span>
            </div>
            <div class="label_text dr_top">门店详情</div>
          </div>
          <div :class="item.open ? 'table_wrapper_open' : 'table_wrapper_close'">
            <glsx-table v-if="item.open" :hasPage="false" :tableParams="tableParams" :tableData="item.list" :headerStyle="{ background: '#F4F6FC', color: '#333333', fontSize: '14px' }"></glsx-table>
          </div>
          <div class="fixed_footer" @click="changeRightOpenStatus(item, index)">
            <i :class="item.open ? 'el-icon-caret-top' : 'el-icon-caret-bottom'"></i>
            <span class="dr_left">{{ item.open ? '隐藏门店详情' : '展开门店详情' }}</span>
          </div>
        </div>
      </div> -->
    </div>
  </div>
</template>

<script>
export default {
  name: '',

  props: {
    list: Array,
    bloc: null
  },

  data() {
    return {
      curOpenIndex: 0,
      tableHeight: 0,
      dataList: [],
      leftData: [],
      rightData: [],
      tableParams: {
        listName: 'list',
        tableColumns: [
          {
            label: '门店名称',
            prop: 'merchantName'
          },
          {
            label: '有效期',
            prop: 'date'
          }
        ]
      },
      isOpen: false
    }
  },

  methods: {
    // changeLeftOpenStatus(item, index) {
    //   this.leftData[index].open = !item.open
    // },
    changeRightOpenStatus(isOpen) {
      this.isOpen = !isOpen
    }
    // handlerData() {
    //   let arr = this.dataList
    //   let left = []
    //   let right = []
    //   arr.forEach((item, index) => {
    //     if (index % 2 == 0) {
    //       left.push(item)
    //     } else {
    //       right.push(item)
    //     }
    //   })
    //   this.leftData = left
    //   this.rightData = right
    //   console.log(left)
    //   console.log(right)
    // }
  },

  mounted() {
    let clientHeight = document.documentElement.clientHeight
    this.tableHeight = clientHeight - 475
  }
}
</script>

<style lang="scss" scoped>
.bloc-info-module {
  box-sizing: border-box;
  padding: 20px 0 0 40px;
}
.wrapper {
  display: flex;
  flex-wrap: wrap;
  .wrap_left,
  .wrap_right {
    // min-width: 44.8%;
    min-width: 520px;
    min-height: 176px;
  }
  .wrap_left {
    margin-right: 40px;
  }
}
.out_box_wrap {
  width: 100%;
  min-height: 176px;
  // box-shadow: 0px 4px 16px 0px rgba(124, 119, 230, 0.1);
  border-radius: 12px;
  border: 1px solid #e5e4ff;
  margin: 0 40px 40px 0;
  .fixed_widget {
    width: 100%;
    box-sizing: border-box;
    background-image: url('../../assets/back-img.png');
    .label_top {
      padding: 20px 22px 24px 24px;
      &-title {
        font-size: 18px;
        font-family: PingFangSC-Semibold, PingFang SC;
        font-weight: 600;
        color: #333333;
        margin-bottom: 12px;
      }
      &-text {
        font-size: 14px;
        font-family: PingFangSC-Regular, PingFang SC;
        font-weight: 400;
        color: #333333;
      }
      &-time {
        font-size: 14px;
        font-family: PingFangSC-Semibold, PingFang SC;
        font-weight: 600;
        color: #5850ff;
      }
    }
    .label_text {
      color: #333333;
      font-size: 14px;
      font-weight: 400;
    }
    .num_text {
      font-size: 14px;
      font-weight: 400;
      color: #5850ff;
    }
  }
  .label-bottom-title {
    font-size: 14px;
    font-family: PingFangSC-Regular, PingFang SC;
    font-weight: 400;
    color: #666666;
    &-text {
      font-size: 14px;
      color: #333333;
    }
  }
  .open-icon {
    font-size: 14px;
    color: #5850ff;
  }
  .table_wrapper_close {
    height: 0;
    // transition: height 0.1s ease-in-out;
  }
  .line_wrapper {
    width: 100%;
    min-height: 54px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #909399;
    font-size: 14px;
    border-bottom: 1px solid #dcdfe6;
    .tittle {
      padding-left: 16px;
      width: 15%;
      text-align: left;
      color: #666666;
      font-size: 14px;
    }
    .tittle1 {
      width: 45%;
      text-align: left;
      color: #666666;
      font-size: 14px;
      word-wrap: break-word;
      word-break: break-all;
      overflow: hidden;
    }
    .tittle2 {
      width: 40%;
      text-align: left;
      color: #666666;
      font-size: 14px;
    }
  }
  .dr_top {
    padding: 20px;
  }
  .label-top {
    margin-bottom: 12px;
  }
  .wrap_header {
    background: #f4f6fc;
  }
  .text_w {
    font-weight: bold;
  }
  .line_body {
    width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    border: 1px solid #e8e8ea;
    border-top: none;
  }
  .line_body::-webkit-scrollbar {
    height: 1px;
    width: 8px;
  }
  .line_body::-webkit-scrollbar-thumb {
    background: #e9e8ff;
    border-radius: 7px;
  }
  .fixed_footer {
    width: 100%;
    height: 36px;
    background: #f4f6fc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 400;
    color: #b9b8c7;
    border-radius: 0px 0px 10px 10px;
    cursor: pointer;
  }
}
.table_wrapper_open {
  padding: 0 20px 20px;
}
</style>