button.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. buttonId: String,
  10. lang: String,
  11. businessId: Number,
  12. sessionFrom: String,
  13. sendMessageTitle: String,
  14. sendMessagePath: String,
  15. sendMessageImg: String,
  16. showMessageCard: Boolean,
  17. appParameter: String,
  18. ariaLabel: String,
  19. openType: String,
  20. getUserProfileDesc: String,
  21. },
  22. data: {
  23. canIUseGetUserProfile: (0, version_1.canIUseGetUserProfile)(),
  24. },
  25. methods: {
  26. onGetUserInfo: function (event) {
  27. this.triggerEvent('getuserinfo', event.detail);
  28. },
  29. onContact: function (event) {
  30. this.triggerEvent('contact', event.detail);
  31. },
  32. onGetPhoneNumber: function (event) {
  33. this.triggerEvent('getphonenumber', event.detail);
  34. },
  35. onGetRealTimePhoneNumber: function (event) {
  36. this.triggerEvent('getrealtimephonenumber', event.detail);
  37. },
  38. onError: function (event) {
  39. this.triggerEvent('error', event.detail);
  40. },
  41. onLaunchApp: function (event) {
  42. this.triggerEvent('launchapp', event.detail);
  43. },
  44. onOpenSetting: function (event) {
  45. this.triggerEvent('opensetting', event.detail);
  46. },
  47. onAgreePrivacyAuthorization: function (event) {
  48. this.triggerEvent('agreeprivacyauthorization', event.detail);
  49. },
  50. onChooseAvatar: function (event) {
  51. this.triggerEvent('chooseavatar', event.detail);
  52. },
  53. },
  54. });