import { API } from './../../../utils/network/api'
const api = new API()
const app = getApp()
Page({
  data: {
  // 组件所需的参数
    navbarData: {
      showCapsule: 1, //是否显示左上角图标   1表示显示    0表示不显示
      title: '患者病历', //导航栏 中间的标题
    },
    // 此页面 页面内容距最顶部的距离
    height: app.globalData.height,
    order_inquiry_id: "",
    order_prescription_id: "",
    case_detail: {},
    from: ""
  },
  onLoad(options) {
    let order_inquiry_id = options.order_inquiry_id;
    let order_prescription_id = options.order_prescription_id;
    let from = options.from;
    console.log("order_inquiry_id: ", order_inquiry_id);
    this.setData({
      order_inquiry_id: order_inquiry_id,
      order_prescription_id: order_prescription_id,
      from: from,
    })
  },
  onShow(){
    
    api.getCase({order_inquiry_id: this.data.order_inquiry_id}).then(response => {
      console.log(response.data);
      this.setData({
        case_detail: response.data
      })
    }).catch(errors => {
      console.error(errors);
    })
  },
  go(e){
    let url = e.currentTarget.dataset.url;
    app.go(url)
  },
})
