import { DEFAULT_GOODS, DEFAULT_SHOP } from '../../../utils/const';
Component({
  props: {
    className: 'img',
    src: '',
    // type: goods | shop
    type: 'goods',
    height: '136rpx',
    width: '136rpx',
    borderRadius: '8rpx'
  },
  data: {
    imgSrc: ''
  },

  didMount() {},

  methods: {
    onImageErr() {
      const {
        type
      } = this.props;
      this.setData({
        imgSrc: type === 'goods' ? DEFAULT_GOODS : DEFAULT_SHOP
      });
    }

  }
});