button.js 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import { canIUseGetUserProfile } from '../common/version';
  2. export const button = Behavior({
  3. externalClasses: ['hover-class'],
  4. properties: {
  5. id: String,
  6. lang: String,
  7. businessId: Number,
  8. sessionFrom: String,
  9. sendMessageTitle: String,
  10. sendMessagePath: String,
  11. sendMessageImg: String,
  12. showMessageCard: Boolean,
  13. appParameter: String,
  14. ariaLabel: String,
  15. openType: String,
  16. getUserProfileDesc: String,
  17. },
  18. data: {
  19. canIUseGetUserProfile: canIUseGetUserProfile(),
  20. },
  21. methods: {
  22. onGetUserInfo(event) {
  23. this.triggerEvent('getuserinfo', event.detail);
  24. },
  25. onContact(event) {
  26. this.triggerEvent('contact', event.detail);
  27. },
  28. onGetPhoneNumber(event) {
  29. this.triggerEvent('getphonenumber', event.detail);
  30. },
  31. onError(event) {
  32. this.triggerEvent('error', event.detail);
  33. },
  34. onLaunchApp(event) {
  35. this.triggerEvent('launchapp', event.detail);
  36. },
  37. onOpenSetting(event) {
  38. this.triggerEvent('opensetting', event.detail);
  39. },
  40. },
  41. });