作业渲染

This commit is contained in:
taoxu 2024-01-03 18:02:54 +08:00
parent 9b8f9207a1
commit 6eb78d1025

View File

@ -123,45 +123,58 @@
<view class="iconfont icon-arow_down"></view> <view class="iconfont icon-arow_down"></view>
</view> </view>
</view> </view>
<view class="work_card"> <view class="card_bigbox">
<view class="work_card" v-for="(item,index ) in works" :key="index" @click="toworkdetail(item.id)"
:class="item.status === 1 ? 'act1' : (item.status === '2' ? 'act3' : 'default')">
<view class="work_card_top"> <view class="work_card_top">
<view class="work_card_top_left"> <view class="work_card_top_left">
<view class="work_card_top_left_img"> <view class="work_card_top_left_img">
<image src="https://file.langsi.online/yasiimg/web/static/u07sCQb6mW6OSamVr1Va"></image> <image src="https://file.langsi.online/yasiimg/web/static/u07sCQb6mW6OSamVr1Va"></image>
</view> </view>
课后作业 <view class="txt" v-html="highlightSearch(item.name)">
</view> </view>
<view class="work_card_top_right">
</view>
<view class="work_card_top_right" :class="item.status == 1 ? 'act2' : ''">
进行中 进行中
</view> </view>
</view> </view>
<view class="work_card_cont_box"> <view class="work_card_cont_box">
<view class="work_card_cont"> <!-- v-if="indexs<3" -->
<view class="work_card_cont" v-for="(items,indexs ) in item.infos" :key="indexs" v-if="indexs<3">
<view class="work_card_cont_point"></view> <view class="work_card_cont_point"></view>
<view class="work_card_cont_text"> <view class="work_card_cont_text" v-if="items.classify==1||items.classify==2">
IELTS 18-Test 2-Part 1 {{items.paperName}}-{{items.testName}}-{{items.partName}}
</view> </view>
<view class="work_card_cont_tag"> <view class="work_card_cont_text" v-if="items.classify==4" style="display: inline-flex;flex-wrap: nowrap;">
{{items.moduleName}}-{{items.partName}}-<view style="width:140rpx; overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">{{items.questionName}}</view>-跟读
</view>
<view class="work_card_cont_text" v-if="items.classify==3">
{{items.paperName}}-{{items.testName}}-{{items.partName}}
</view>
<view class="work_card_cont_tag" v-if="items.classify==1"
style="background: rgba(27,225,178,0.1);color: #1BE1B2;">
听力 听力
</view> </view>
<view class="work_card_cont_tag" v-if="items.classify==2"
style="background: rgba(242,182,42,0.2);color: #F2AA02 ;">
阅读
</view> </view>
<view class="work_card_cont"> <view class="work_card_cont_tag" v-if="items.classify==3"
style="background:rgba(63,122,242,0.2);color: #3F7AF2 ;">
写作
</view>
<view class="work_card_cont_tag" v-if="items.classify==4"
style="background: rgba(242,63,235,0.1);color: #F23FEB ;">
口语
</view>
</view>
<view class="work_card_cont" v-if="item.infos.length>3">
<view class="work_card_cont_point" style="margin-right: 10rpx;"></view>
<view class="work_card_cont_point" style="margin-right: 10rpx;"></view>
<view class="work_card_cont_point"></view> <view class="work_card_cont_point"></view>
<view class="work_card_cont_text">
IELTS 18-Test 2-Part 1
</view>
<view class="work_card_cont_tag">
听力
</view>
</view>
<view class="work_card_cont">
<view class="work_card_cont_point"></view>
<view class="work_card_cont_text">
IELTS 18-Test 2-Part 1
</view>
<view class="work_card_cont_tag">
听力
</view>
</view> </view>
</view> </view>
<view class="work_card_info_box"> <view class="work_card_info_box">
@ -172,7 +185,7 @@
描述 描述
</view> </view>
<view class="work_card_info_bot"> <view class="work_card_info_bot">
最好在中午十二点之前完成交上作业过期不候 {{item.des}}
</view> </view>
</view> </view>
<view class="work_card_info_box"> <view class="work_card_info_box">
@ -186,76 +199,11 @@
</view> </view>
<view class="work_card_info_bot"> <view class="work_card_info_bot">
02-12 12:00 {{item.doneTime}}
<!-- {{ formatTimestamp(item.createTime) }} -->
</view> </view>
</view> </view>
</view> </view>
<view class="work_card" :class="isalready == true ? 'act1' : ''">
<view class="work_card_top">
<view class="work_card_top_left">
<view class="work_card_top_left_img">
<image src="https://file.langsi.online/yasiimg/web/static/u07sCQb6mW6OSamVr1Va"></image>
</view>
课后作业
</view>
<view class="work_card_top_right" :class="isalready == true ? 'act2' : ''">
进行中
</view>
</view>
<view class="work_card_cont_box">
<view class="work_card_cont">
<view class="work_card_cont_point"></view>
<view class="work_card_cont_text">
IELTS 18-Test 2-Part 1
</view>
<view class="work_card_cont_tag">
听力
</view>
</view>
<view class="work_card_cont">
<view class="work_card_cont_point"></view>
<view class="work_card_cont_text">
IELTS 18-Test 2-Part 1
</view>
<view class="work_card_cont_tag">
听力
</view>
</view>
<view class="work_card_cont">
<view class="work_card_cont_point"></view>
<view class="work_card_cont_text">
IELTS 18-Test 2-Part 1
</view>
<view class="work_card_cont_tag">
听力
</view>
</view>
</view>
<view class="work_card_info_box">
<view class="work_card_info_top">
<view class="work_card_info_topimg">
<image src="https://file.langsi.online/yasiimg/web/static/uw2jJ5BraHhwDDaIZ0MC"></image>
</view>
描述
</view>
<view class="work_card_info_bot">
最好在中午十二点之前完成交上作业过期不候
</view>
</view>
<view class="work_card_info_box">
<view class="work_card_info_top">
<view class="work_card_info_topimg">
<image src="https://file.langsi.online/yasiimg/web/static/uhApaomh5maFP29oecp3">
</image>
</view>
时间
</view>
<view class="work_card_info_bot">
02-12 12:00
</view>
</view>
</view> </view>
</view> </view>
</view> </view>
@ -289,7 +237,8 @@
workinfo: {}, workinfo: {},
orgworkinfo: {}, orgworkinfo: {},
beforyes: '', beforyes: '',
isup: '' isup: '',
works:{}
// https://file.langsi.online/yasiimg/web/static/uBHiWpVS8LQdX241DdjX // https://file.langsi.online/yasiimg/web/static/uBHiWpVS8LQdX241DdjX
} }
}, },
@ -302,6 +251,14 @@
}, },
methods: { methods: {
highlightSearch(name) {
// 使 searchKeyword
if (this.searchKeyword) {
const regex = new RegExp(this.searchKeyword, 'gi');
return name.replace(regex, match => `<span style="color: #2D7CE6 ;">${match}</span>`);
}
return name;
},
getinfo() { getinfo() {
this.$u.get( this.$u.get(
`https://api.admin-v2.langsi.online/admin-api/classroom/work-record/statistics?memberId=${this.id}` `https://api.admin-v2.langsi.online/admin-api/classroom/work-record/statistics?memberId=${this.id}`
@ -322,6 +279,20 @@
this.beforyes = Math.abs(percentageChange); this.beforyes = Math.abs(percentageChange);
this.changedata() this.changedata()
// this.classlist = res.data.list
// this.isloding = false
}
})
this.$u.get(
`https://api.admin-v2.langsi.online/admin-api/classroom/work-member/list?memberId=${501}`
).then(res => {
if (res.code == 0) {
this.works = res.data
// this.classlist = res.data.list // this.classlist = res.data.list
// this.isloding = false // this.isloding = false
@ -851,6 +822,7 @@
} }
} }
.card_bigbox {
.work_card { .work_card {
margin-top: 20rpx; margin-top: 20rpx;
display: flex; display: flex;
@ -883,6 +855,12 @@
width: 38rpx; width: 38rpx;
height: 32rpx; height: 32rpx;
} }
.txt{
font-size: 28rpx;
font-family: 'PingFang', 'PingFang';
font-weight: 800;
color: #2E4975;
}
} }
.work_card_top_right { .work_card_top_right {
@ -947,6 +925,7 @@
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
margin-top: 22rpx; margin-top: 22rpx;
width: 100%;
.work_card_info_top { .work_card_info_top {
display: flex; display: flex;
@ -978,6 +957,15 @@
.act1 { .act1 {
border-left: 8rpx solid #2D7CE6; border-left: 8rpx solid #2D7CE6;
} }
.act3 {
border-left: 8rpx solid #DFDFDF;
}
}
.act1 {
border-left: 8rpx solid #2D7CE6;
}
} }
} }
</style> </style>