import { Reports, Research, Report, purchaserApi } from "@/config/api.js"; export default { data() { return {}; }, methods: { //收藏 async collectClick(item) { await this.$store.dispatch("showLoginModal"); const res = item.IsSpecial == 1 ? await purchaserApi.yanxuanSpecialCollect({ Id: item.ArticleId, Status: item.IsCollect ? 2 : 1, }) : await Report.collectRpt({ ArticleId: item.ArticleId, PageRouter: "月度收藏榜" }); if (res.Ret === 200) { item.IsCollect = !item.IsCollect; item.IsCollect ? (item.CollectNum += 1) && uni.showToast({ title: "收藏成功", icon: "none", duration: 2000, }) : (item.CollectNum -= 1); !item.IsCollect && uni.showToast({ title: "已取消收藏", icon: "none", duration: 2000, }); } }, //去往作者详情 authorDetails(item) { if (item.IsSpecial == 1) { uni.navigateTo({ url: "/pages-purchaser/columnDetail/columnDetail?id=" + item.UserId }); return; } uni.navigateTo({ url: "/reportPages/authorPages/authorPages?id=" + item.DepartmentId, }); }, //去往文章详情页面 goDetail(item) { if (item.IsSpecial == 1) { uni.navigateTo({ url: "/pages-purchaser/noteAndViewpoint/noteAndViewpoint?id=" + item.ArticleId }); return; } this.$store.commit("setRouterReport", "月度收藏榜"); uni.navigateTo({ url: "/pageMy/reportDetail/reportDetail?id=" + item.ArticleId }); }, //去往主题详情 themeDetails(item, source) { if (item.IsSpecial == 1) return; uni.navigateTo({ url: "/reportPages/researchTheme/researchTheme?id=" + item.IndustrialManagementId + "&pageRouter=" + source }); }, }, };