import { connect } from 'herculex';
import history from '../../utils/history';
Component(connect({
  mapStateToProps: {
    userInfo: state => state.$global.userInfo || {}
  }
})({
  props: {
    componentData: {},
    goodsItem: null,
    // 是否展示库存
    styleConfig: null,
    styleType: ''
  },
  data: {
    hasNum: false
  },

  didMount() {},

  didUpdate() {},

  methods: {
    handleGoToDetail() {
      const {
        goodsItem,
        componentData
      } = this.props;

      if (goodsItem.skuId) {
        history.push({
          title: '商品详情',
          pageType: 'goods-detail',
          query: {
            skuId: goodsItem.skuId
          },
          header: 'show',
          componentData: { ...componentData
          }
        });
      }
    }

  }
}));