import { connect } from 'herculex'; Component(connect({ mapStateToProps: { cityCode: state => state.$global.cityCode } })({ props: { componentData: {} }, data: { isReady: false, pluginAppId: '', pluginComponent: '', pluginVersion: '' }, didMount() { const { componentData: { componentExtInfo } } = this.props; const { pluginAppId, pluginComponent, pluginVersion } = componentExtInfo; this.setData({ pluginAppId, pluginComponent, pluginVersion }); this.loadPlugin(); }, methods: { onHeadHeight(height) { this.commitGlobal && this.commitGlobal({ headB2bHight: height }); }, onChangeStore(e) { const { cityCode, storeId } = e; this.commitGlobal && this.commitGlobal({ cityCode, globalShopId: storeId, globalShop: { ...e } }); }, loadPlugin() { const { pluginAppId, pluginVersion } = this.data; const that = this; my.loadPlugin({ plugin: `${pluginAppId}@${pluginVersion}`, success: () => { that.setData({ isReady: true }); } }); } } }));