修复首页选学生头像都一样的问题
This commit is contained in:
parent
3762f9232d
commit
98d18a15aa
@ -10,7 +10,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="user-content">
|
<view class="user-content">
|
||||||
<view class="user-avatar">
|
<view class="user-avatar">
|
||||||
<image :src="xsTx || '/static/base/home/11222.png'" class="avatar-img"></image>
|
<image :src="curXs.xstxUrl || '/static/base/home/11222.png'" class="avatar-img"></image>
|
||||||
<view class="avatar-ring"></view>
|
<view class="avatar-ring"></view>
|
||||||
</view>
|
</view>
|
||||||
<view class="user-details">
|
<view class="user-details">
|
||||||
@ -108,7 +108,7 @@
|
|||||||
@click="switchXs(xs)"
|
@click="switchXs(xs)"
|
||||||
>
|
>
|
||||||
<view class="student-avatar">
|
<view class="student-avatar">
|
||||||
<image :src="xsTx || '/static/base/home/11222.png'" class="avatar-img"></image>
|
<image :src="xs.xstxUrl || '/static/base/home/11222.png'" class="avatar-img"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="student-info">
|
<view class="student-info">
|
||||||
<text class="student-name">{{ xs.xm }}</text>
|
<text class="student-name">{{ xs.xm }}</text>
|
||||||
@ -204,12 +204,12 @@ const xsList = ref([
|
|||||||
bjmc: "01班",
|
bjmc: "01班",
|
||||||
njmcId: "",
|
njmcId: "",
|
||||||
xstx: "/static/base/home/11222.png",
|
xstx: "/static/base/home/11222.png",
|
||||||
|
xstxUrl: ''
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// 当前选中的学生
|
// 当前选中的学生
|
||||||
let curXs = ref(xsList.value[0]);
|
let curXs = ref(xsList.value[0]);
|
||||||
const xsTx = ref(imagUrl(curXs.value.xstx));
|
|
||||||
|
|
||||||
// 控制选择器显示状态
|
// 控制选择器显示状态
|
||||||
const showSelector = ref(false);
|
const showSelector = ref(false);
|
||||||
@ -238,7 +238,6 @@ function showXsSelector() {
|
|||||||
// 切换学生
|
// 切换学生
|
||||||
function switchXs(xs: any) {
|
function switchXs(xs: any) {
|
||||||
curXs.value = xs;
|
curXs.value = xs;
|
||||||
xsTx.value = imagUrl(xs.xstx);
|
|
||||||
showSelector.value = false;
|
showSelector.value = false;
|
||||||
getArticleList();
|
getArticleList();
|
||||||
// 记录存储切换
|
// 记录存储切换
|
||||||
@ -260,7 +259,7 @@ function goToDetail(notice: any) {
|
|||||||
|
|
||||||
const getArticleList = async () => {
|
const getArticleList = async () => {
|
||||||
const params = Object.assign({}, pageParams.value, { njmcId: curXs.value.njmcId });
|
const params = Object.assign({}, pageParams.value, { njmcId: curXs.value.njmcId });
|
||||||
cmsArticlePageApi(pageParams.value).then(res => {
|
cmsArticlePageApi(params).then(res => {
|
||||||
announcements.value = res.rows;
|
announcements.value = res.rows;
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
@ -271,9 +270,12 @@ const getArticleList = async () => {
|
|||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
xsList.value = getUser.xsList;
|
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;
|
curXs.value = getCurXs;
|
||||||
xsTx.value = imagUrl(getCurXs.xstx);
|
curXs.value.xstxUrl = imagUrl(getCurXs.xstx) || "";
|
||||||
console.log(xsTx.value, getCurXs.xstx)
|
|
||||||
getArticleList();
|
getArticleList();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user