Popup.js 926 Bytes
// tabWorkOrder/pages/createOrder/createOrderComponents/Popup/Popup.js
Component({
  externalClasses: ['popup-slot-class'],
  /**
   * 组件的属性列表
   */
  properties: {
    show: {
      type: Boolean,
      value: false,
      observer: function (n, o) {
        n && wx.hideKeyboard()
        this.setData({
          showPopup: n
        })
      }
    },
    title: String,
    height: {
      type: String,
      value: '85%'
    },
    slotStyle: String
  },

  /**
   * 组件的初始数据
   */
  data: {
    showPopup: false,
  },

  /**
   * 组件的方法列表
   */
  methods: {
    noScroll() { },
    hidePopup() {
      this.setData({ showPopup: false })
      this.triggerEvent('cancel')
    },
    confirm() {
      this.triggerEvent('confirm')
    }
  },
  attached() {
    this.setData({
      isFullSucreen: wx.$util.isFullSucreen(true),
      showPopup: !!this.properties.show,
    })
  }
})