index.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /**
  2. * 芝麻go活动签约详情页
  3. */
  4. // @ts-nocheck
  5. import qs from 'qs';
  6. Component({
  7. data: {
  8. pluginAppId: '2021002191638959',
  9. pluginPageUrl: '/sesame-aoi',
  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. let {
  23. query = {}
  24. } = my.getLaunchOptionsSync();
  25. const pageQuery = this.$page.data.query || {};
  26. const extInfo = this.props.componentData.componentExtInfo || {};
  27. const props = {
  28. alipayStoreId: extInfo.alipayStoreId,
  29. storeId: extInfo.storeId,
  30. returnUrl: extInfo.returnUrl,
  31. failedUrl: extInfo.failedUrl,
  32. appId: extInfo.appId
  33. };
  34. query = { ...props,
  35. ...query,
  36. ...pageQuery
  37. };
  38. my.loadPlugin({
  39. plugin: `${pluginAppId}@${pluginVersion}`,
  40. success: () => {
  41. const fmcg = query && qs.stringify(query) || '';
  42. my.reLaunch({
  43. url: `dynamic-plugin://${pluginAppId}${pluginPageUrl}${fmcg ? `?${fmcg}` : ''}`
  44. });
  45. }
  46. });
  47. }
  48. }
  49. });