index.js 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. Component({
  2. externalClasses: ['i-class'],
  3. properties: {
  4. // default, primary, ghost, info, success, warning, error
  5. type: {
  6. type: String,
  7. value: '',
  8. },
  9. inline: {
  10. type: Boolean,
  11. value: false
  12. },
  13. // default, large, small
  14. size: {
  15. type: String,
  16. value: '',
  17. },
  18. // circle, square
  19. shape: {
  20. type: String,
  21. value: 'square'
  22. },
  23. disabled: {
  24. type: Boolean,
  25. value: false,
  26. },
  27. loading: {
  28. type: Boolean,
  29. value: false,
  30. },
  31. long: {
  32. type: Boolean,
  33. value: false
  34. },
  35. openType: String,
  36. appParameter: String,
  37. hoverStopPropagation: Boolean,
  38. hoverStartTime: {
  39. type: Number,
  40. value: 20
  41. },
  42. hoverStayTime: {
  43. type: Number,
  44. value: 70
  45. },
  46. lang: {
  47. type: String,
  48. value: 'en'
  49. },
  50. sessionFrom: {
  51. type: String,
  52. value: ''
  53. },
  54. sendMessageTitle: String,
  55. sendMessagePath: String,
  56. sendMessageImg: String,
  57. showMessageCard: Boolean
  58. },
  59. methods: {
  60. handleTap () {
  61. if (this.data.disabled) return false;
  62. this.triggerEvent('click');
  63. },
  64. bindgetuserinfo({ detail = {} } = {}) {
  65. this.triggerEvent('getuserinfo', detail);
  66. },
  67. bindcontact({ detail = {} } = {}) {
  68. this.triggerEvent('contact', detail);
  69. },
  70. bindgetphonenumber({ detail = {} } = {}) {
  71. this.triggerEvent('getphonenumber', detail);
  72. },
  73. binderror({ detail = {} } = {}) {
  74. this.triggerEvent('error', detail);
  75. }
  76. }
  77. });