diff --git a/src/pages/base/home/index.vue b/src/pages/base/home/index.vue index 6e0c937..771e4d0 100644 --- a/src/pages/base/home/index.vue +++ b/src/pages/base/home/index.vue @@ -10,7 +10,7 @@ - + @@ -108,7 +108,7 @@ @click="switchXs(xs)" > - + {{ xs.xm }} @@ -204,12 +204,12 @@ const xsList = ref([ bjmc: "01班", njmcId: "", xstx: "/static/base/home/11222.png", + xstxUrl: '' } ]); // 当前选中的学生 let curXs = ref(xsList.value[0]); -const xsTx = ref(imagUrl(curXs.value.xstx)); // 控制选择器显示状态 const showSelector = ref(false); @@ -238,7 +238,6 @@ function showXsSelector() { // 切换学生 function switchXs(xs: any) { curXs.value = xs; - xsTx.value = imagUrl(xs.xstx); showSelector.value = false; getArticleList(); // 记录存储切换 @@ -260,7 +259,7 @@ function goToDetail(notice: any) { const getArticleList = async () => { const params = Object.assign({}, pageParams.value, { njmcId: curXs.value.njmcId }); - cmsArticlePageApi(pageParams.value).then(res => { + cmsArticlePageApi(params).then(res => { announcements.value = res.rows; }) .catch((error) => { @@ -271,9 +270,12 @@ const getArticleList = async () => { onMounted(async () => { xsList.value = getUser.xsList; + for (let i = 0; i < xsList.value.length; i++) { + const xs = xsList.value[i]; + xs.xstxUrl = imagUrl(xs.xstx) || ""; + } curXs.value = getCurXs; - xsTx.value = imagUrl(getCurXs.xstx); - console.log(xsTx.value, getCurXs.xstx) + curXs.value.xstxUrl = imagUrl(getCurXs.xstx) || ""; getArticleList(); });