<template>
  <div class="app">
    <!-- 回到顶部按钮 -->
   
    <i class="i ihuidaodingbu topBox" @click="scrollToTop" ></i>
    <div class="totalTitleBox">
       <h2 class="totalTitle">{{ $t(`home.welcome`) }}</h2>
   </div>

    <div class="bottom"  >
      <!-- 左侧菜单栏 -->
    
    <div class="bottomLeft" id="bottomLeft" ref="menuItemBox" >  
           <!-- ------------搜索框----------------- -->
      <div   class="querySearch">
        <i class="el-icon-search searchIcon" @click="handleSelect"></i>
        <el-autocomplete        
          v-model="state"
          :fetch-suggestions="querySearchAsync"
          :placeholder="$t(`login.navigation`)"
          @select="handleSelect"
          @keydown.enter.native="handleSelect"
          value-key="label"
        
        >
        </el-autocomplete>
       
      </div>
          <el-menu        
          class="el-menu-vertical-demo" 
          :unique-opened="true"
          @close="menuClose"  
          ref="elMenuRef"
          @select="handleMenuSelect"  
          :default-active="activeMenuItem"
    >
          <el-submenu :index="item.id"  v-for="item in newMEnu" :key="item.id">
            <template slot="title">
              <i class="el-icon-location"></i>
              <span>{{ $t(item.label)  }}</span>
            </template>
            <!-- :ref="'menuItem' + subItem.id" -->
        
            <el-menu-item  :index="subItem1.id" v-for="subItem1 in item.children" :key="subItem1.id" :ref="'menuItem'+ subItem1.id" :title="$t(subItem1.label)">{{ $t(subItem1.label) }} </el-menu-item>      
            <!-- {{ subItem.id }} -->
          </el-submenu>      
        </el-menu>  
      </div>
      <!-- 左侧菜单栏对应的右侧的内容 -->
      <div class="bottomRight"  ref="wrapper"  @scroll="handleContentScroll">
        <div
          class="bottomRightContent"
          v-for="(item) in newMEnu"
          :key="item.id"        
          :id="item.label" 
        >       
        <!-- :ref="'menu' + subItem.id"  -->
          <section v-for="(subItem) in item.children" :key="subItem.id"  :ref="'menu' + subItem.id" >          
            <div>            
              <h3>{{$t(subItem.label)  }}</h3>
            </div>
          
            <!-- 公式组件 -->
            <formula :prop1="subItem.id" :prop2="newMEnu"></formula>
          <div class="bottomRightContentBody">           
            <el-col :span="24" style="display: flex;" >          
               <span class="word">
                 <!-- 处理换行 -->
                  <template v-if="Array.isArray(handelIntroduce(subItem.introduce))">
                    <p v-for="introduceItem in handelIntroduce(subItem.introduce)" :key="introduceItem"> 
                      {{ introduceItem }}
                    </p>    
                  </template>  
                     
                  <template v-if="!Array.isArray(handelIntroduce(subItem.introduce))">
                    <p > 
                      {{ handelIntroduce(subItem.introduce) }}
                    </p>    
                  </template>        
              </span>
            </el-col>
            
            <!-- 清除一下浮动 -->
            <div style="clear: both"></div>
          </div>
        </section>
          <div class="bottomRightContentFooter"></div>
        </div>
      
      </div>
    </div>

   
  </div>
</template>

<script>
import indexJs from "./index";
import formula from "../../components/formula.vue"
import i18n from '../../lang/index'
export default {
  components:{
    formula
  },
  metaInfo: {
    meta: [
      {
        name: 'keywords',
        content: 'Coinbus 指标解释、链上指标含义、地址、矿工、网络、长期持有者、短期持有者、盈亏、币龄、比率、持有者分布、市场指标、交易所数据、流通量、交易量、BTC(比特币)、ETH(以太坊)、稳定币,Metrics Explanation, On-Chain Metrics Meaning, Addresses, Miners, Networks, Long-Term Holders, Short-Term Holders, Profit/Loss, Coin Age, Ratios, Holder Distribution, Market Metrics, Exchange Data, Liquidity, Volume, BTC (Bitcoin), ETH (Ethereum), Stablecoins'
      },
      {
        name: 'description',
        content:i18n.t(`seo.IndexIntroduce`),
        // content:window.vm.$t(`seo.IndexIntroduce`)
      
      
      }
    ]
  },
  mixins: [indexJs],
};
</script>

<style lang="scss" scoped>
// .side-menu{
//   position: fixed;
//   left: 0;
//   top: 100px;
// }
.app {
  width: 100%;
  // height: 100vh;
 height: 90vh;
  // background: #555;
  height: 100%;
  
  background: rgba(0, 0, 0, 0.9);
  color: #e9e9e9;
  // outline: 1px solid red;
  // overflow-y: auto;
  // overflow-y:hidden; 
  box-sizing: border-box;
  a{
    text-decoration: none;
  }
  // .totalTitleBox{
  //   background: #4677f6;
  // }
  // .bottom{
  //   background: #f7931a;
  // }

   /* 定义滚动条的样式 */
   ::-webkit-scrollbar {
    width: 5px; /* 设置滚动条的宽度 */
  }

  /* 定义滚动条滑轨的样式 */
  ::-webkit-scrollbar-track {
    background-color: #f1f1f1; /* 设置滑轨的背景色 */
  }

  /* 定义滚动条滑块的样式 */
  ::-webkit-scrollbar-thumb {
    background-color: #888; /* 设置滑块的背景色 */
    border-radius: 4px; /* 设置滑块的边框半径 */
  }

  /* 鼠标悬浮在滚动条上时的样式 */
  ::-webkit-scrollbar-thumb:hover {
    background-color: #555; /* 设置鼠标悬浮时滑块的背景色 */
  }


  .top {
    width: 100%;
    height: 80px;
    text-align: center;
    line-height: 80px;
    // background-color: #e9e9e9;
  }
  .totalTitleBox{
    width: 100%;
    // background: rgba(0, 0, 0, 0.9);
    // background: goldenrod !important;
    // z-index: 9999999;
    height: 50px;
    .totalTitle{
      width: 100%;
        color: rgba(0, 0, 0, 0.85);
        border-bottom: 1px solid rgba(255, 255, 255, 0.3);
        line-height: 20px;
        // outline: 1px solid red;
        height: 30px;
        text-align: center;
        color: #fff;
        position: fixed;
       
       
      }
      .jumpHome{
        position: absolute;
        right: 20px;
        top:70px;
        color: #fff;
        cursor: pointer;
      }
      .jumpHome:hover{
        color: #f7931a;
      }
      
  }
 
  .bottom {
    width: 100%;
    height: calc(100% - 50px);
    // height: 100%;
    display: flex;
    padding: 10px 0px; 
    // overflow-y: hidden;
    box-sizing: border-box;
    .bottomLeft {
      // outline: 1px solid red;
      width: 360px;
      min-width: 260px;
      height: 100%;
      // background-color: ghostwhite;
      // padding-top: 30px;
      overflow: hidden;
      overflow-y: auto;
      box-sizing: border-box;
      font-size: 14px;
      padding: 0px 5px;
   
      .leftItem {
        //  outline: 1px solid red;
        width: 100%;
        // height: 40px;
        line-height: 40px;
        text-align: center;
        cursor: pointer;
       
      }
      .leftItem:hover{
        background: rgba(0, 0, 0, 0.3);
        border: 1px solid rgba(255, 255, 255, 0.3);
        box-shadow: 1px 1px 1px 0.5px #ccc;

      }
      a:hover {
        color: #f7931a;
      }
      .noHighLight{
        color: #dfe3f1;
      }
      .highLight {
       color: #f7931a !important;
      
      }

     
    }
    .bottomRight {
      // width: calc(100% - 288px);
      width: 72%;
      height: 100%;
      box-sizing: border-box;
      padding: 36px 36px 0 36px;
      overflow-y: auto;
      background: #dfe3f1;
      margin-left: 10px;
      box-shadow: 5px 2px 5px 1px rgba(255, 255, 255, 0.7);
      // padding-top: 100px;
      .totalTitle{
        color: rgba(0, 0, 0, 0.85);
        border-bottom: 1px solid rgba(0, 0, 0, 0.3);
        line-height: 20px;
        outline: 1px solid red;
        height: 30px;
        text-align: center;
      }
      .bottomRightContent {
        width: 100%;
        box-sizing: border-box;
        padding-bottom: 36px;
        color:#000;
        .bottomRightContentHead {
          height: 25px;
          font-family: PingFang SC;
          font-style: normal;
          font-weight: 600;
          font-size: 20px;
          line-height: 25px;
          text-transform: capitalize;
          color: rgba(0, 0, 0, 0.85);
          margin-bottom: 32px;
        }
        .bottomRightContentBody {
          .el-col {
            position: relative;
            margin-bottom: 18px;
            .circle {
              display: inline-block;
              width: 6px;
              height: 6px;
              background: #f7931a;
              border-radius: 50%;
              position: absolute;
              top: 22px;
              left: 0;
            }
            .word {
              margin-left: 12px;
              font-family: PingFang SC;
              font-style: normal;
              font-weight: normal;
              font-size: 14px;
              // color: #4677f6;
              color: #000;
              // cursor: pointer;
              // outline: 1px solid red;
            }
            // .word:hover {
            //   text-decoration: underline;
            // }
            .topPlace {
              position: absolute;
              top: 1px;
              margin-left: 8px;
            }
          }
        }
        .bottomRightContentFooter {
          height: 1px;
          width: 100%;
          margin-top: 14px;
          background-color: #e9e9e9;
        }
      }
    }

     //搜索框
     .querySearch{
        // outline: 1px solid red;
        
        // background: #e7f8ff;
        position: fixed;
        width: 300px;
        // height: 50px;
        display: flex;
        justify-content: center;
        align-items: center;
        position: fixed;
        // left: 30px;
        top:59px;
        z-index: 99;
        padding-top: 10px;

        
        p
        // background: #000;
        ::v-deep .el-autocomplete{
          width: 90%;
        }
        ::v-deep .el-input__inner{
          border: 1px solid rgba(0, 0, 0, 0.2);
          padding-left: 50px;
          border-radius: 8px;
          // background: #e7f8ff;
          width: 115%;
          // outline: 1px solid red;
          background:#171919 ;
          border: 1px solid rgba(255, 255, 255, 0.3);
          color: #fff;


        }
        .searchIcon{
          // outline: 1px solid red;
          position: absolute; 
          top: 25px;
          left:18%;
          z-index: 99;
        

        }
      }
  }
}

// --------------
.topBox{
  position: fixed;
  bottom: 50px;
  right: 50px;
  font-size: 50px;
  cursor: pointer;
}
.topBox:hover{
  color: #f7931a;
}


.bottomLeft .el-menu{
  background: #171919;
  color: #f1f1f1 ;
}

.bottomLeft .el-menu-item{
  color: #f1f1f1;
  background: #171919;
  // outline: 1px solid red;
  overflow: hidden;
  overflow-x: auto;//横向滚动

}
::v-deep.el-menu-item::-webkit-scrollbar {//隐藏导航项的横向滚动条
  display: none;
}
.bottomLeft ::v-deep .el-submenu__title{
  color: #f1f1f1;
}
.bottomLeft ::v-deep.el-menu-item.is-active{
  background: #171919 !important;
  color: #f7931a;
}
.bottomLeft ::v-deep.el-menu-item:hover{
    background-color: rgba(0, 0, 0, 0.8)!important;
}

.bottomLeft ::v-deep.el-submenu__title:hover{
    background-color: rgba(0, 0, 0, 0.3)!important;
}


</style>

