import { connect } from 'herculex';
import { dynamicPageName, prefixPagePath } from "../../../../../core/utils";
import parseToQueryString from '../../../utils/parseToQueryString';
const app = getApp();
Component(connect({
  mapStateToProps: {}
})({
  data: {
    extInfo: {},
    imgSrcPrefix: app.globalData.imgSrcPrefix
  },
  props: {
    item: {},
    count: 0
  },

  didMount() {
    const {
      extInfo
    } = this.props.item;
    this.setData({
      extInfo: extInfo || {}
    });
  },

  methods: {
    toMyCertDetail({
      target
    }) {
      const pageCode = 'certDetailPage';
      const {
        certType
      } = target.dataset;
      const {
        serviceCode
      } = this.props.item;
      const queryStr = parseToQueryString({
        certType,
        pageCode,
        serviceCode
      });
      my.navigateTo({
        url: `${prefixPagePath}/${dynamicPageName}/index${queryStr}`
      });
    }

  }
}));