index.js 800 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import { connect } from 'herculex';
  2. import history from '../../utils/history';
  3. Component(connect({
  4. mapStateToProps: {
  5. userInfo: state => state.$global.userInfo || {}
  6. }
  7. })({
  8. props: {
  9. componentData: {},
  10. goodsItem: null,
  11. // 是否展示库存
  12. styleConfig: null,
  13. styleType: ''
  14. },
  15. data: {
  16. hasNum: false
  17. },
  18. didMount() {},
  19. didUpdate() {},
  20. methods: {
  21. handleGoToDetail() {
  22. const {
  23. goodsItem,
  24. componentData
  25. } = this.props;
  26. if (goodsItem.skuId) {
  27. history.push({
  28. title: '商品详情',
  29. pageType: 'goods-detail',
  30. query: {
  31. skuId: goodsItem.skuId
  32. },
  33. header: 'show',
  34. componentData: { ...componentData
  35. }
  36. });
  37. }
  38. }
  39. }
  40. }));