From 5c6bbd27938f39fca9dc2836ec5d1709b5cb7081 Mon Sep 17 00:00:00 2001 From: Xwen <929716663@qq.com> Date: Mon, 25 Dec 2023 22:50:04 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=8E=A5=E5=85=A5=E6=8E=A8=E8=8D=90?= =?UTF-8?q?=E5=A5=BD=E5=8F=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Yi.Bbs.Vue3/src/views/home/Index.vue | 11 +- .../home/components/PointsRanking/index.vue | 10 +- .../home/components/RecommendFriend/index.vue | 131 ++++++++++++++++++ 3 files changed, 144 insertions(+), 8 deletions(-) create mode 100644 Yi.Bbs.Vue3/src/views/home/components/RecommendFriend/index.vue diff --git a/Yi.Bbs.Vue3/src/views/home/Index.vue b/Yi.Bbs.Vue3/src/views/home/Index.vue index 831a8efa..6d515fcf 100644 --- a/Yi.Bbs.Vue3/src/views/home/Index.vue +++ b/Yi.Bbs.Vue3/src/views/home/Index.vue @@ -75,18 +75,15 @@ - + @@ -116,12 +113,14 @@ import { getHomeDiscuss } from "@/apis/discussApi.js"; import { getWeek } from "@/apis/accessApi.js"; import { getRecommendedFriend, getRankingPoints } from "@/apis/analyseApi.js"; import PointsRanking from "./components/PointsRanking/index.vue"; +import RecommendFriend from "./components/RecommendFriend/index.vue"; const plateList = ref([]); const discussList = ref([]); const bannerList = ref([]); const weekList = ref([]); const pointList = ref([]); +const friendList = ref([]); const items = [{ user: "用户1" }, { user: "用户2" }, { user: "用户3" }]; //主题查询参数 @@ -144,6 +143,8 @@ onMounted(async () => { weekList.value = weekData; const { data: pointData } = await getRankingPoints(); pointList.value = pointData; + const { data: friendData } = await getRecommendedFriend(); + friendList.value = friendData; }); const weekXAxis = ["周一", "周二", "周三", "周四", "周五", "周六", "周日"]; diff --git a/Yi.Bbs.Vue3/src/views/home/components/PointsRanking/index.vue b/Yi.Bbs.Vue3/src/views/home/components/PointsRanking/index.vue index 79398bcc..0787a030 100644 --- a/Yi.Bbs.Vue3/src/views/home/components/PointsRanking/index.vue +++ b/Yi.Bbs.Vue3/src/views/home/components/PointsRanking/index.vue @@ -56,9 +56,13 @@ const getStatusInfo = (type) => { }; const userLimit = computed(() => getStatusInfo(props.pointsData.userLimit)); -const userImageSrc = computed( - () => import.meta.env.VITE_APP_BASEAPI + "/file/" + props.pointsData.icon -); +const userImageSrc = computed(() => { + if (props.pointsData.icon) { + return import.meta.env.VITE_APP_BASEAPI + "/file/" + props.pointsData.icon; + } else { + return "favicon.ico"; + } +});