result.js 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
  2. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  3. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  4. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  5. return c > 3 && r && Object.defineProperty(target, key, r), r;
  6. };
  7. import { SuperComponent, wxComponent } from '../common/src/index';
  8. import props from './props';
  9. import config from '../common/config';
  10. const { prefix } = config;
  11. const name = `${prefix}-result`;
  12. let default_1 = class extends SuperComponent {
  13. constructor() {
  14. super(...arguments);
  15. this.options = {
  16. multipleSlots: true,
  17. };
  18. this.externalClasses = [
  19. `${prefix}-class`,
  20. `${prefix}-class-image`,
  21. `${prefix}-class-title`,
  22. `${prefix}-class-description`,
  23. ];
  24. this.properties = props;
  25. this.data = {
  26. prefix,
  27. classPrefix: name,
  28. };
  29. this.lifetimes = {
  30. ready() {
  31. this.setIcon();
  32. },
  33. };
  34. this.methods = {
  35. setIcon() {
  36. const { icon, theme } = this.properties;
  37. if (icon) {
  38. this.setData({
  39. iconName: icon !== 'null' ? `${icon}` : '',
  40. });
  41. }
  42. else {
  43. const themeResult = {
  44. default: 'error-circle',
  45. success: 'check-circle',
  46. warning: 'error-circle',
  47. error: 'close-circle',
  48. };
  49. this.setData({ iconName: themeResult[theme] });
  50. }
  51. },
  52. };
  53. }
  54. };
  55. default_1 = __decorate([
  56. wxComponent()
  57. ], default_1);
  58. export default default_1;