1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- /**
- * 大转盘
- */
- // @ts-nocheck
- import qs from 'qs';
- Component({
- data: {
- isReady: false,
- pluginAppId: '2021002191638959',
- pluginPageUrl: '/wheel',
- pluginVersion: '*'
- },
- didMount() {
- this.loadPlugin();
- },
- methods: {
- loadPlugin() {
- const {
- pluginAppId,
- pluginPageUrl,
- pluginVersion
- } = this.data;
- let {
- query = {}
- } = my.getLaunchOptionsSync();
- const pageQuery = this.$page.data.query || {};
- const extInfo = this.props.componentData.componentExtInfo || {};
- const props = {
- alipayStoreId: extInfo.alipayStoreId
- };
- query = { ...props,
- ...query,
- ...pageQuery
- };
- const that = this;
- my.loadPlugin({
- plugin: `${pluginAppId}@${pluginVersion}`,
- success: () => {
- that.setData({
- isReady: true
- });
- const fmcg = query && qs.stringify(query) || '';
- my.reLaunch({
- url: `dynamic-plugin://${pluginAppId}${pluginPageUrl}${fmcg ? `?${fmcg}` : ''}`
- });
- }
- });
- }
- }
- });
|