purchaser-report-list-mixins.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import { Reports, Research, Report } from "@/config/api.js";
  2. export default {
  3. data() {
  4. return {
  5. };
  6. },
  7. methods: {
  8. //收藏
  9. async collectClick(item) {
  10. await this.$store.dispatch("showLoginModal");
  11. const res = await Report.collectRpt({ ArticleId: item.ArticleId, PageRouter: "月度收藏榜" });
  12. if (res.Ret === 200) {
  13. item.IsCollect = !item.IsCollect;
  14. item.IsCollect
  15. ? (item.CollectNum += 1) &&
  16. uni.showToast({
  17. title: "收藏成功",
  18. icon: "none",
  19. duration: 2000,
  20. })
  21. : (item.CollectNum -= 1);
  22. !item.IsCollect &&
  23. uni.showToast({
  24. title: "已取消收藏",
  25. icon: "none",
  26. duration: 2000,
  27. });
  28. }
  29. },
  30. //去往作者详情
  31. authorDetails(item) {
  32. uni.navigateTo({
  33. url: "/reportPages/authorPages/authorPages?id=" + item.DepartmentId,
  34. });
  35. },
  36. //去往文章详情页面
  37. goDetail(item) {
  38. this.$store.commit("setRouterReport", "月度收藏榜");
  39. uni.navigateTo({ url: "/pageMy/reportDetail/reportDetail?id=" + item.ArticleId });
  40. },
  41. //去往主题详情
  42. themeDetails(item, source) {
  43. uni.navigateTo({ url: "/reportPages/researchTheme/researchTheme?id=" + item.IndustrialManagementId + "&pageRouter=" + source });
  44. },
  45. }
  46. };