<template>
  <div class="home">
    <div class="container">
      <nav-bar />
      <van-search
        v-model="name"
        shape="round"
        placeholder="请输入搜索关键词"
        @search="getData"
      >
      </van-search>
      <ul class="list">
        <li v-for="item in list.ks" :key="item.id">
          <van-cell :title="item.name" is-link :to="'Hospital_ksjs_detail?id=' + item.id" />
        </li>
      </ul>
      <ul class="list">
        <li v-for="item in list.ys" :key="item.id">
          <van-cell :title="item.name" is-link :to="'Hospital_zjjs_detail?id=' + item.id" />
        </li>
      </ul>
    </div>
  </div>
</template>


<script>
// @ is an alias to /src
import { apiSearch } from "@/request/api.js";
import { Toast } from "vant"; 
export default {
  components: {},
  mounted() {
    this.title = this.$route.meta.title;
  },
  data() {
    return {
      active: 0,
      title: "",
      flag: false,
      value: "",
      name: "",
      list: [],
    };
  },
  methods: {
    // 获取列表
    getData() {
      apiSearch({
        name: this.name
      }).then((res) => {
        this.loading = false;
        this.list = res.data;
      });
    },
  },
};
</script>


<style scoped lang="scss">
.list li {
	border-bottom: 1px solid #f5f5f5;
}
</style>
