useArticleUtil.js 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. import router from '@/router'
  2. // 打开标讯详情页
  3. export function doOpenArticlePage({ id }) {
  4. const link = router.resolve({
  5. name: 'article_detail',
  6. params: {
  7. id,
  8. content: 'content'
  9. }
  10. })
  11. window.open(
  12. `${link.href.replace('/swordfish/page_big_pc', '')}.html`,
  13. '_blank'
  14. )
  15. }
  16. // 打开采购单位详情页
  17. export function doOpenBuyerPage({ name, query = {} }) {
  18. const link = router.resolve({
  19. path: `/unit_portrayal/${name}`,
  20. query
  21. })
  22. window.open(link.href, '_blank')
  23. }
  24. // 打开SEO版本 采购单位详情页
  25. export function doOpenBuyerPageSEO({ seoId }) {
  26. if (!seoId) {
  27. return
  28. }
  29. window.open(`/dw/${seoId}.html`, '_blank')
  30. }
  31. // 打开采购单位监控列表页
  32. export function doOpenBuyerListPage() {
  33. window.open('/swordfish/page_big_pc/my_client', '_blank')
  34. }
  35. // 打开中标企业详情页
  36. export function doOpenWinnerPage({ id, query = {} }) {
  37. const link = router.resolve({
  38. path: `/ent_portrait/${id}`,
  39. query
  40. })
  41. window.open(link.href, '_blank')
  42. }
  43. // 打开企业监控列表页
  44. export function doOpenWinnerListPage() {
  45. window.open('/swordfish/page_big_pc/free/ent_follow', '_blank')
  46. }
  47. // 打开更多客户监控列表
  48. export function doOpenCorListPage(query = {}) {
  49. const link = router.resolve({
  50. path: '/potential_cor_list/c',
  51. query
  52. })
  53. window.open(link.href, '_blank')
  54. }
  55. // 打开项目监控详情页
  56. export function doOpenProjectDetailPage({ id, mark }) {
  57. window.open(
  58. `/swordfish/page_big_pc/pro_follow_detail?sid=${id}${
  59. mark ? `&mark=${mark}` : ''
  60. }`,
  61. '_blank'
  62. )
  63. }
  64. // 打开项目监控列表页
  65. export function doOpenProjectProgressListPage() {
  66. window.open('/swordfish/page_big_pc/free/project_progress', '_blank')
  67. }
  68. // 打开推送提醒设置
  69. export function doOpenPushSettingPage() {
  70. window.open('/page_workDesktop/work-bench/app/big/push_setting')
  71. }
  72. /**
  73. * 判断在哪个容器
  74. * @returns {string} - in-web (iframe 中) in-app
  75. */
  76. export function GetInWhichContainer() {
  77. const InWhichContainer = window.parent !== window ? 'in-app' : 'in-web'
  78. return InWhichContainer
  79. }
  80. // 打开企业信用报告购买页
  81. export function doOpenCreditReportPage(event, buyer = '') {
  82. const btnName = event.target.textContent.trim() || '投标企业信用报告'
  83. const infoType = event.target.dataset.infoType || event.currentTarget.dataset.infoType || ''
  84. const breakName = `${btnName}_${infoType}`
  85. // 自定义埋点上报事件(数据统计需求:点击信用报告按钮要求统计到当前标讯的信息类型)
  86. const openURL = '/swordfish/page_big_pc/free/report/preview?source=bidCreditReportPreview&buyer' + buyer
  87. try {
  88. window.__EasyJTrack.addTrack(breakName)
  89. window.open(openURL, '_blank')
  90. } catch (error) {
  91. window.open(openURL, '_blank')
  92. }
  93. }