button.js 1.3KB

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