<template>
  <div class="container">
    <div class="kj">
      <div class="title">热门案例</div>
      <div class="ct" @click="handleDetail">
        <div class="ck">查看详情</div>
      </div>
    </div>
    <div class="kj" @click="handleDetail">
      <div class="title">技巧</div>
      <div class="ct">
        <div class="ck">查看详情</div>
      </div>
    </div>
    <div class="kj last" @click="handleDetail">
      <div class="title">服务</div>
      <div class="ct">
        <div class="ck">查看详情</div>
      </div>
    </div>
    <div class="main-menuBar">
      <div class="menuBar-menu" @click="menuBarClick('MainSale')">
        <img class="menuBar-icon" :src="menuBarInfo.icon.now['1']" />
        <div class="menuBar-title">活动</div>
      </div>
      <div class="menuBar-menu">
        <img class="menuBar-icon" :src="menuBarInfo.icon.now['2']" />
        <div class="menuBar-title menuBar-title-ac">案例</div>
      </div>
      <div class="menuBar-menu" @click="menuProfit()">
        <img class="menuBar-icon" :src="menuBarInfo.icon.now['3']" />
        <div class="menuBar-title">收益</div>
      </div>
      <div class="menuBar-menu" @click="menuTask()">
        <img class="menuBar-icon" :src="menuBarInfo.icon.now['4']" />
        <div class="menuBar-title">任务</div>
      </div>
      <div class="menuBar-menu" @click="menuBarClick('Me')">
        <img class="menuBar-icon" :src="menuBarInfo.icon.now['5']" />
        <div class="menuBar-title">我的</div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      // 图标
      menuBarInfo: {
        list: {
          main: [
            {
              name: "",
              iconUaUrl: "",
              iconAcUrl: ""
            }
          ]
        },
        icon: {
          now: {
            "1": "",
            "2": "",
            "3": "",
            "4": "",
            "5": ""
          },
          ua: {
            "1": "/mainSale/icon-menuBar-1-ua.png",
            "2": "/mainSale/icon-menuBar-2-ua.png",
            "3": "/mainSale/icon-menuBar-3-ua.png",
            "4": "/mainSale/icon-menuBar-4-ua.png",
            "5": "/mainSale/icon-menuBar-5-ua.png"
          },
          ac: {
            "1": "/mainSale/icon-menuBar-1-ac.png",
            "2": "/mainSale/icon-menuBar-2-ac.png",
            "3": "/mainSale/icon-menuBar-3-ac.png",
            "4": "/mainSale/icon-menuBar-4-ac.png",
            "5": "/mainSale/icon-menuBar-5-ac.png"
          }
        }
      }
    };
  },
  created() {
    this.checkNowMenuBar();
  },
  methods: {
    handleDetail() {
        this.$router.push({
            path:'caseDetail'
        })
    },
    // 导航
    checkNowMenuBar() {
      let inData = "2";
      this.menuBarInfo.icon.now = this.menuBarInfo.icon.ua;
      this.menuBarInfo.icon.now[inData] = this.menuBarInfo.icon.ac[inData];
    },
    menuBarClick(inData) {
      this.$router.push(inData);
    },
    listTaskClick() {
      this.$router.push("Task");
    },
    menuProfit() {
      this.$router.push({ path: "/profitList" });
    },
    menuTask() {
      this.$router.push({ path: "/taskList" });
    }
  }
};
</script>

<style scoped>
.kj {
  width: 344px;
  height: 229px;
  background: rgba(248, 248, 248, 1);
  padding: 12px;
  margin-bottom: 10px;
}
.container {
  padding: 16px;
}
.title {
  font-size: 14px;
  font-weight: bold;
  color: rgba(45, 71, 106, 1);
}
.ct {
  width: 320px;
  height: 180px;
  background: rgba(255, 255, 255, 1);
  box-shadow: 0px 2px 4px 0px rgba(221, 221, 221, 1);
  border-radius: 10px;
  margin-top: 12px;
  position: relative;
}
.ck {
  position: absolute;
  width: 100%;
  bottom: 0;
  height: 32px;
  line-height: 32px;
  text-align: center;
  background: rgba(117, 178, 253, 0.8);
  border-radius: 0px 0px 10px 10px;
  font-size: 12px;
  font-weight: 400;
  color: rgba(255, 255, 255, 1);
}
.main-menuBar {
  /*border: 1px solid darkviolet;*/
  box-shadow: inset 0px 1px 2px 0px rgba(221, 221, 221, 1);
  width: 100%;
  height: 82px;
  position: fixed;
  bottom: 0px;
  left: 0px;
  background-color: #fafafa;
  padding: 0px 14px;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
}
.menuBar-menu {
  /*background-color: greenyellow;*/
  width: 48px;
  height: 47px;

  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
}
.menuBar-icon {
  width: 24px;
  height: 24px;
  object-fit: cover;
}
.menuBar-title {
  width: auto;
  height: 12px;
  font-size: 10px;
  font-weight: bold;
  color: rgba(67, 119, 188, 0.4);
  text-align: center;
}
.menuBar-title-ac {
  color: rgba(67, 119, 188, 1);
}
.last {
  margin-bottom: 80px;
}
</style>
