<template>
  <div>
    <el-container>
      <el-aside width="180px">
        <service-shop-menu></service-shop-menu>
      </el-aside>
      <el-main>
        <service-list :filterNmaes="filterNmaes" :name="name" :url="url" :urlFilter="urlFilter"></service-list>
      </el-main>
    </el-container>
  </div>
</template>

<script>
import ServiceShopMenu from "@/components/service_shop_menu";
import ServiceList from "@/components/service-list/service_list";
export default {
  components: {
    ServiceShopMenu,
    ServiceList
  },
  data: () => ({
    urlFilter: "",
    url: "",
    name: "",
    filterNmaes: []
  }),
  mounted() {
    this.getVal(this.$route.path);
  },
  methods: {
    getVal(val) {
      let uri = val.substring(6);
      uri = uri.substring(0, uri.indexOf("/"));
      console.log(uri);
      switch (uri) {
        case "data_service_list":
          this.name = "数据服务";
          this.urlFilter = "5";
          this.url = "/shop/sjfwDetail";
          this.filterNmaes = ["数据服务类型", "数据领域", "数据来源机构"];
          break;
        case "space_time_service_list":
          this.name = "时空服务";
          this.urlFilter = "6";
          this.url = "/shop/skfwDetail";
          this.filterNmaes = ["数据服务类型", "数据领域", "数据来源机构"];
          break;
        case "video_service_list":
          this.name = "视频服务";
          this.urlFilter = "7";
          this.url = "";
          this.filterNmaes = [];
          break;
        case "perception_service_list":
          this.name = "感知服务";
          this.urlFilter = "10";
          this.url = "";
          this.filterNmaes = [];
          break;
        case "comprehensive_app_list":
          this.name = "综合服务";
          this.urlFilter = "21";
          this.url = "/shop/zhfwDetail";
          this.filterNmaes = ["数据服务类型", "数据领域", "数据来源机构"];
          break;
        case "app_store_list":
          this.name = "应用商店";
          this.urlFilter = "app";
          this.url = "/shop/yysdDetail";
          this.filterNmaes = ["应用类型", "应用领域", "应用来源机构"];
          break;
        default:
          this.name = "";
          this.urlFilter = "";
          this.url = "";
          this.filterNmaes = [];
          break;
      }
    }
  },
  watch: {
    "$route.path": {
      handler(val) {
        this.getVal(val);
      }
    }
  }
};
</script>
<style scoped>
</style>