index.js 772 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /**
  2. * 营销广告展位
  3. */
  4. // @ts-nocheck
  5. Component({
  6. data: {
  7. isReady: false,
  8. pluginAppId: '2021002191638959',
  9. pluginPageUrl: '',
  10. pluginVersion: '*',
  11. propsData: {
  12. shopId: '' // 当前shopId
  13. }
  14. },
  15. props: {
  16. componentData: {
  17. componentExtInfo: {}
  18. }
  19. },
  20. didMount() {
  21. this.setData({
  22. propsData: this.props.componentData.componentExtInfo || {}
  23. });
  24. this.loadPlugin();
  25. },
  26. methods: {
  27. loadPlugin() {
  28. const {
  29. pluginAppId,
  30. pluginVersion
  31. } = this.data;
  32. const that = this;
  33. my.loadPlugin({
  34. plugin: `${pluginAppId}@${pluginVersion}`,
  35. success: () => {
  36. that.setData({
  37. isReady: true
  38. });
  39. }
  40. });
  41. }
  42. }
  43. });