import { connect } from 'herculex';
Component(connect({
  mapStateToProps: {
    userInfo: state => state.$global.userInfo || {}
  }
})({
  props: {
    onTagClick: () => null,
    text: '',
    url: '',
    clickTip: '',
    // MP:小程序，TEXT：文本
    linkType: '',
    fontSize: '16rpx',
    padding: '4rpx',
    isbespeak: false
  },
  data: {},

  didMount() {},

  didUpdate() {},

  methods: {
    tagClick() {
      const {
        isbespeak
      } = this.props;

      if (isbespeak) {
        return;
      }

      const {
        url,
        clickTip,
        linkType
      } = this.props;

      if (!linkType) {
        return;
      }

      if (linkType === 'TEXT') {
        return my.alert({
          content: clickTip || '活动文本提示'
        });
      }

      return my.navigateTo({
        url
      });
    }

  }
}));