import TyComponent from '../common/component'

TyComponent({
  /**
   * 组件的属性列表
   */
  properties: {

    id: {
      type: String
    },
    type: {
      type: String,
      value: 'default'
    },
    size: {
      type: String,
      value: 'normal'
    },
    color: {
      type: String
    },
    icon: {
      type: String
    },
    plain: {
      type: Boolean,
      value: false
    },
    block: {
      type: Boolean,
      value: false
    },
    round: {
      type: Boolean,
      value: false
    },
    square: {
      type: Boolean,
      value: false
    },
    disabled: {
      type: Boolean,
      value: false
    },
    hairline: {
      type: Boolean,
      value: false
    },
    loading: {
      type: Boolean,
      value: false
    },
    loadingText: {
      type: String
    },
    loadingType: {
      type: String,
      value: 'circular'
    },
    loadingSize: {
      type: String,
      value: '20px'
    },
    customStyle: {
      type: String
    },
    openType: {
      type: String
    },
    appParameter: {
      type: String
    },
    lang: {
      type: String
    },
    sessionFrom: {
      type: String
    },
    businessId: {
      type: Number
    },
    sendMessageTitle: {
      type: String,
      value: '当前标题'
    },
    sendMessagePath: {
      type: String,
      value: '当前分享路径'
    },
    sendMessageImg: {
      type: String,
      value: '截图'
    },
    showMessageCard: {
      type: String,
      value: 'false'
    },
    customClass: {
      type: String
    },
    loadingClass: {
      type: String
    }

  },

  /**
   * 组件的初始数据
   */
  data: {

  },

  /**
   * 组件的方法列表
   */
  methods: {
    handleClick({detail}) {
      this.triggerEvent('click', detail)
    },
    handleGetuserinfo({detail}) {
      this.triggerEvent('getuserinfo', detail)
    },
    handleContact({detail}) {
      this.triggerEvent('contact', detail)
    },
    handleGetphonenumber({detail}) {
      this.triggerEvent('getphonenumber', detail)
    },
    handleError({detail}) {
      this.triggerEvent('error', detail)
    },
    handleOpensetting({detail}) {
      this.triggerEvent('opensetting', detail)
    },
  }
})
