12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- /**
- * 单次抽发奖活动
- */
- // @ts-nocheck
- import qs from 'qs';
- Component({
- data: {
- pluginAppId: '2021002191638959',
- pluginPageUrl: '/lucky-draw',
- pluginVersion: '*'
- },
- didMount() {
- this.loadPlugin();
- },
- methods: {
- loadPlugin() {
- const {
- pluginAppId,
- pluginPageUrl,
- pluginVersion
- } = this.data;
- let {
- query = {}
- } = my.getLaunchOptionsSync();
- const pageQuery = this.$page.data.query || {};
- query = { ...{
- activityId: this.props.componentData.componentExtInfo.activityId
- },
- ...query,
- ...pageQuery
- };
- my.loadPlugin({
- plugin: `${pluginAppId}@${pluginVersion}`,
- success: () => {
- const fmcg = query && qs.stringify(query) || '';
- my.reLaunch({
- url: `dynamic-plugin://${pluginAppId}${pluginPageUrl}${fmcg ? `?${fmcg}` : ''}`
- });
- }
- });
- }
- }
- });
|