button.js 1.5 KB

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