<template>
    <div>
        <SearchHeader @search="search"/>
        <SplitLine />
        <HisttoryLabels :allLabels="allLabels" :hasResult="hasResult"/>
        <HotLabels title="热门搜索" :showDelete="false" :allLabels="allLabels" :hasResult="hasResult"/>
    </div>
</template>

<script>
import SearchHeader from '../components/business/search-header';
import SplitLine from '../components/business/split-line';
import HisttoryLabels from '../components/business/history-labels';
import HotLabels from '../components/business/hot-labels';

export default {
  data() {
    return {
        showDelete: false,
        hasResult: true,
        allLabels: [{"doctorId":452,"doctorName":"刘飞刘","doctorImg":"https://file.yunqueyi.com/File/course_doctor/2018-11/19/452.png","doctorAvatarImg":"https://file.yunqueyi.com/image/jpeg/2018/10/12/20181012134114808-5339c711.jpg","doctorHospital":"沈阳市第四人民医院","joinNum":818,"resourceNum":1,"structureId":132},{"doctorId":424,"doctorName":"阮园阮园阮园","doctorImg":"https://file.yunqueyi.com/File/course_doctor/2018-11/19/424.png","doctorAvatarImg":"https://file.yunqueyi.com/image/jpeg/2018/08/30/20180830111232896-de2f9015.jpg","doctorHospital":"浙江医院","joinNum":533,"resourceNum":2,"structureId":132},{"doctorId":351,"doctorName":"李翔李翔李翔","doctorImg":"https://file.yunqueyi.com/File/course_doctor/2018-11/19/351.png","doctorAvatarImg":"https://file.yunqueyi.com/File/course_doctor/2017-04/06/lixiang.jpg","doctorHospital":"解放军306医院全军糖尿病中心","joinNum":503,"resourceNum":2,"structureId":132},{"doctorId":360,"doctorName":"高蕾莉","doctorImg":"https://file.yunqueyi.com/File/course_doctor/2018-11/20/360.png","doctorAvatarImg":"https://file.yunqueyi.com/File/course_doctor/2018-11/20/web_360.png","doctorHospital":"北京大学人民医院","joinNum":376,"resourceNum":1,"structureId":132}]
    }
  },
  components: {
    SearchHeader,
    SplitLine,
    HisttoryLabels,
    HotLabels
  },
  created(){
    
  },

  mounted(){
    
  },
  methods: {
    // 跳转到结果页面，并
    search(searchText) {
      console.log(searchText)
      if(!searchText) return;
      this.$router.push({
        path: '/result',
        query: {
          searchText: searchText
        }
      })
    }
  },
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss" scoped>
@import '../style/mixin.scss';
@import '../style/global.scss';

</style>
