import { API } from './../../../utils/network/api'
const api = new API()
// const app = getApp()
Page({
  data: {
    navbarData: {
      showCapsule: 1, //是否显示左上角图标   1表示显示    0表示不显示
      title: '添加诊断', //导航栏 中间的标题
    },
    disease_class_name: "",
    data_list: []
  },
  onChange(e){
    console.log(e)
    let name = e.detail;
    this.setData({
      data_list: []
    })
    if(name){
      this.search();
    }
  },
  search(){
    //获取评价列表
    let params = {};
    params.disease_class_name = this.data.disease_class_name;
    api.getBasicDiseaseSearch(params).then(response => {
      console.log(response);
      this.setData({
        data_list: response.data
      })
    }).catch(errors => {
      console.error(errors);
    })
  },
  addZhenDuan(e){
    let disease_class_name = e.currentTarget.dataset.disease_class_name;
    let disease_class_id = e.currentTarget.dataset.disease_class_id;
    console.log("disease_class_name: ", disease_class_name);
    console.log("disease_class_id: ", disease_class_id);
    
  }
})