index.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import { connect } from 'dva/index';
  2. import React, { Component } from 'react';
  3. import { Form, Tabs } from 'antd';
  4. import { sldLlineRtextAddGoodsAddMargin,sldComLanguage } from '@/utils/utils';
  5. import global from '@/global.less';
  6. import DiyLists from './diy_lists';
  7. import InstanceTemplateLists from './instance_template_lists';
  8. import BusinessStateSelector from "@/components/BusinessStateSelector"
  9. const TabPane = Tabs.TabPane;
  10. @connect(({ product }) => ({
  11. product,
  12. }))
  13. @Form.create()
  14. export default class StorePCDiyIndex extends Component {
  15. constructor(props) {
  16. super(props);
  17. this.state = {
  18. activeKey: '1',
  19. };
  20. }
  21. componentDidMount() {
  22. if(this.props.location.query.tab!=undefined&&this.props.location.query.tab){
  23. this.setState({activeKey:this.props.location.query.tab})
  24. }
  25. }
  26. onHandleTabClick = (e) => {
  27. this.setState({activeKey:e})
  28. }
  29. render() {
  30. const {activeKey} = this.state;
  31. return (
  32. <div className={global.common_page} style={{ flex: 1 }}>
  33. <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
  34. {sldLlineRtextAddGoodsAddMargin('#69A2F2', `${sldComLanguage('店铺装修')}`, 0, 0, 10)}
  35. <BusinessStateSelector />
  36. </div>
  37. <Tabs type="card" activeKey={activeKey} animated={false} onTabClick={this.onHandleTabClick}>
  38. <TabPane tab={`${sldComLanguage('实例化模板')}`} key="1">
  39. <InstanceTemplateLists/>
  40. </TabPane>
  41. <TabPane tab={`${sldComLanguage('首页装修')}`} key="2">
  42. <DiyLists/>
  43. </TabPane>
  44. </Tabs>
  45. </div>
  46. );
  47. }
  48. }