import history from '../../utils/history';
Component({
  props: {
    isShowModal: false,
    position: 'bottom',
    title: '请选择科室',
    departmentList: [],
    onClose: null,
    docId: ''
  },
  data: {},
  methods: {
    onTopBtnTap() {
      this.setData({
        isShowModal: true
      });
    },

    onPopupClose() {
      if (Object.prototype.toString.call(this.props.onClose) === '[object Function]') {
        this.props.onClose();
      }
    },

    /**
     * 选择科室
     */
    chooseBtn(e) {
      const {
        currentTarget: {
          dataset: {
            item: {
              departmentId
            }
          }
        }
      } = e;
      history.push({
        query: {
          depId: departmentId,
          // 科室id
          doctorId: this.props.docId // 医生唯一识别号

        },
        title: '医生主页',
        pageType: 'doctor-page'
      });
    }

  }
});