index.js 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /**
  2. * 芝麻go组件
  3. */
  4. // @ts-nocheck
  5. Component({
  6. data: {
  7. isReady: false,
  8. pluginAppId: '2021002191638959',
  9. pluginPageUrl: '',
  10. pluginVersion: '*',
  11. propsData: {
  12. alipayStoreId: undefined,
  13. // 支付宝店铺号
  14. storeId: undefined,
  15. // 门店编号
  16. returnUrl: '',
  17. // 开通失败 | 开通成功跳转地址,TIP:开通失败时,failedUrl优先级高
  18. failedUrl: '',
  19. // 开通失败跳转地址
  20. appId: '' // 非必填,活动appId
  21. }
  22. },
  23. props: {
  24. componentData: {
  25. componentExtInfo: {}
  26. }
  27. },
  28. didMount() {
  29. this.setData({
  30. propsData: this.props.componentData.componentExtInfo || {}
  31. });
  32. this.loadPlugin();
  33. },
  34. methods: {
  35. loadPlugin() {
  36. const {
  37. pluginAppId,
  38. pluginVersion
  39. } = this.data;
  40. const that = this;
  41. my.loadPlugin({
  42. plugin: `${pluginAppId}@${pluginVersion}`,
  43. success: () => {
  44. that.setData({
  45. isReady: true
  46. });
  47. }
  48. });
  49. }
  50. }
  51. });