Browse Source

refactor(student): 重构学生端作业界面

- 更新作业列表展示样式
- 优化作业详情展示,支持多种作业类型
-调整作业提交和查看逻辑
- 优化页面样式和布局
master
liutong 10 months ago
parent
commit
d6c74ce91c
  1. 8
      api/apiRoute.js
  2. 89
      pages/student/index/index.vue

8
api/apiRoute.js

@ -555,6 +555,14 @@ export default {
})
},
//学生端--
xy_assignment(data = {}) {
let url = '/xy/assignment'
return http.get(url, data).then(res => {
return res;
})
},

89
pages/student/index/index.vue

@ -76,37 +76,48 @@
<view class="after-class-con" v-for="(v,k) in jobAssignmentsInfo" :key="k" @click="openViewWorkDetails(v)">
<view class="after-class-con-txt">
<view style="width: 25%;margin-top: 5%;">
<view style="font-size: 55rpx;color: #fff;"><span style="color: #29d3b4;">12</span>/23
</view>
<view style="font-size: 35rpx;color: #ccc;padding-left: 10rpx;">已完成</view>
</view>
<view style="width: 70%;">
<!-- <view style="width: 25%;margin-top: 5%;">-->
<!-- <view style="font-size: 55rpx;color: #fff;"><span style="color: #29d3b4;">12</span>/23-->
<!-- </view>-->
<!-- <view style="font-size: 35rpx;color: #ccc;padding-left: 10rpx;">已完成</view>-->
<!-- </view>-->
<view style="width: 100%;">
<view style="color: #fff;display: flex;justify-content: space-between;align-items: center;">
<view style="display: flex;align-items: center;">
<image :src="$util.img(v.coach_pic)" style="width: 50rpx;height: 50rpx;">
<image :src="v.student.customerResources.member.headimg ? v.student.customerResources.member.headimg : $util.img('/uniapp_src/static/images/common/yong_hu.png')" style="width: 50rpx;height: 50rpx;">
</image>
<span style="padding-left: 10rpx;font-size: 35rpx;">{{v.coach_name}}</span>
<span style="padding-left: 10rpx;font-size: 35rpx;">{{v.student.name}}</span>
</view>
<view>
<fui-button background="#404045" color="#F59A23" borderColor="#F59A23"
btnSize="mini" @click="submitJob(v)">上传</fui-button>
</view>
</view>
<view style="color: #fff;padding: 10rpx;">时间{{v.create_time}}</view>
<view class="multi-line-ellipsis" v-html="v.content_text">
<view style="color: #fff;padding: 10rpx;">时间{{$util.formatToDateTime(v.created_at, "Y-m-d H:i")}}</view>
<view style="color: #fff;padding: 10rpx;">类型{{v.content_type == 1 ? '图片' : (v.content_type == 2 ? '视频':'文本')}}</view>
<view class="description">
{{v.description}}
</view>
</view>
</view>
</view>
<!-- 已提交的作业列表-->
<view class="item" v-for="(v,k) in assignmentsList" :key="k" @click="openViewWorkDetails(v)">
<view class="multi-line-ellipsis text-style" v-html="v.content_text"></view>
<view style="width: 92%;margin: auto;border-radius: 15rpx;" v-if="v.student_file">
<video v-if="v.student_file_type == 2" style="width: 100%;border-radius: 15rpx;" :src="$util.img(v.student_file)"></video>
<image v-else style="width: 100%;border-radius: 15rpx;" :src="$util.img(v.student_file)" mode="aspectFit"></image>
</view>
<view class="box">
<view class="description">
描述:{{v.description}}
</view>
<view class="content_box" v-if="v.content_text">
<video class="video" v-if="v.content_type == 2" :src="v.content_text"></video>
<image class="image" v-else-if="v.content_type == 1" :src="v.content_text" mode="aspectFit"></image>
<view class="text" v-else-if="v.content_type == 3" >作业内容{{ v.content_text }}</view>
</view>
</view>
</view>
<!-- <view class="multi-line-ellipsis text-style">-->
@ -303,9 +314,10 @@
let data = {
page: 1,
limit: 10,
status: '2',//1=,2=,3=
resources_id: this.member_info.id,
status: '3',//1 2 3
}
let res = await memberApi.assignmentsList(data)
let res = await apiRoute.xy_assignment(data)
if(res.code != 1){
uni.showToast({
title: res.msg,
@ -322,9 +334,10 @@
let data = {
page: 1,
limit: 1,
status: '1',//1=,2=,3=
resources_id: this.member_info.id,
status: '2',// 1 2 3
}
let res = await memberApi.assignmentsList(data)
let res = await apiRoute.xy_assignment(data)
if(res.code != 1){
uni.showToast({
title: res.msg,
@ -569,6 +582,7 @@
}
.multi-line-ellipsis {
width: 100%;
color: #fff;
padding: 5rpx 10rpx;
display: -webkit-box;
@ -779,7 +793,7 @@
.after-class-con {
width: 92%;
height: 246rpx;
//height: 246rpx;
background-color: #404045;
border-radius: 20rpx;
margin: 15rpx auto;
@ -791,9 +805,11 @@
display: flex;
justify-content: space-between;
padding: 20rpx;
height: 95%;
width: 100%;
align-content: space-around;
.description{
color: #fff;
}
}
.pic {
@ -801,4 +817,33 @@
height: 144rpx;
border-radius: 50%;
}
.item{
padding: 40rpx;
.box{
color: #fff;
display: flex;
flex-direction: column;
.description{
}
.content_box{
width: 100%;
margin: auto;
margin-top: 20rpx;
border-radius: 15rpx;
.video{
border: 1px solid red;
width: 100%;
border-radius: 15rpx;
}
.image{
width: 100%;
border-radius: 15rpx;
}
.text{
color: #fff;
}
}
}
}
</style>
Loading…
Cancel
Save