import Vue from 'vue';
const Plugin = {
  install(vue, options) {
    vue.prototype.$turnTo = item => {
      if (item.info_type == 1) {
        window.open(item.url);
      } else {
        let router = window.vm.$router;
        let path = window.vm.$route.path;
        if (path.includes('member')) router.push({ path: '/memberDetail', query: { id: item.id } });
        // else if (path === '/index') window.open(`/detail?id=${item.id}`);
        else router.push({ path: `/detail?id=${item.id}` });
      }
    };
  },
};
Vue.use(Plugin);
