index.js 685 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /**
  2. * 刮刮乐活动
  3. */
  4. // @ts-nocheck
  5. Component({
  6. data: {
  7. isReady: false,
  8. pluginAppId: '2021002191638959',
  9. pluginPageUrl: '/scratch',
  10. pluginVersion: '*'
  11. },
  12. didMount() {
  13. this.loadPlugin();
  14. },
  15. methods: {
  16. loadPlugin() {
  17. const {
  18. pluginAppId,
  19. pluginPageUrl,
  20. pluginVersion
  21. } = this.data;
  22. const that = this;
  23. my.loadPlugin({
  24. plugin: `${pluginAppId}@${pluginVersion}`,
  25. success: () => {
  26. that.setData({
  27. isReady: true
  28. });
  29. my.reLaunch({
  30. url: `dynamic-plugin://${pluginAppId}${pluginPageUrl}`
  31. });
  32. }
  33. });
  34. }
  35. }
  36. });