Browse Source

feat(student): 学生端首页数据展示优化

- 添加体测信息和课程预告数据获取及展示
- 优化作业列表显示逻辑,仅展示有附件的作业- 调整页面样式,提升用户体验
master
liutong 12 months ago
parent
commit
3cfb842e2b
  1. 4
      components/AQ/AQTabber.vue
  2. 65
      pages/student/index/index.vue

4
components/AQ/AQTabber.vue

@ -44,7 +44,7 @@
},
created() {
console.log(123)
// console.log(123)
this.init()
},
@ -146,7 +146,7 @@
]
break;
}
console.log(111,this.tabBar)
// console.log(111,this.tabBar)
},
openView(e) {
console.log('点击跳转', e)

65
pages/student/index/index.vue

@ -29,18 +29,18 @@
<view class="card-con-txt1">
<view class="card-con-txt1-left">
<image src="@/static/images/index/score.png" class="overlay-image"></image>
<view class="card-con-txt1-left-txt top">90</view>
<view class="card-con-txt1-left-txt top">{{memberIndexData.tx.score}}</view>
<view class="card-con-txt1-left-txt top1">综合评分</view>
</view>
<view class="card-con-txt1-right">
<view style="color: #AAAAAA;padding: 5rpx;">数据测评时间2020.03.12</view>
<view style="color: #AAAAAA;padding: 5rpx;">数据测评时间{{$util.formatToDateTime(memberIndexData.tx.create_time,'Y-m-d')}}</view>
<view style="display: flex;justify-content: space-around;margin-top: 20rpx;">
<view>
<view style="font-size: 48rpx;color: #29d3b4;">123</view>
<view style="font-size: 48rpx;color: #29d3b4;">{{memberIndexData.tx.height * 100}}</view>
<view style="color: #AAAAAA;font-size: 30rpx;">身高CM</view>
</view>
<view>
<view style="font-size: 48rpx;color: #29d3b4;">45</view>
<view style="font-size: 48rpx;color: #29d3b4;">{{memberIndexData.tx.weight}}</view>
<view style="color: #AAAAAA;font-size: 30rpx;">体重KG</view>
</view>
</view>
@ -56,10 +56,10 @@
<view class="upcomin-classes-div-con-centre"
style="width: 2rpx;height: 60rpx;background-color: #fff;margin-left: 25rpx;"></view>
<view style="margin-left: 25rpx;">
<view>5/28 周五 15:30 - 17:30</view>
<view>301 篮球少儿课程</view>
<view>{{$util.formatToDateTime(memberIndexData.kcyg.date_time,'m-d')}} {{memberIndexData.kcyg.weekday}} {{memberIndexData.kcyg.time_slot[0]}}-{{memberIndexData.kcyg.time_slot[1]}}</view>
<view>{{memberIndexData.kcyg.address}} {{memberIndexData.kcyg.courses_name}}</view>
</view>
<view class="upcomin-classes-div-con-right" @click="openViewWorkDetails({id:1})">
<view class="upcomin-classes-div-con-right" @click="openViewWorkDetails(memberIndexData.kcyg)">
详情
</view>
</view>
@ -101,7 +101,7 @@
<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;">
<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>
@ -139,10 +139,28 @@
member_info: [],
assignmentsList: [],//
jobAssignmentsInfo: [],//
memberIndexData:{
tx:{//
height: '', //
weight: '', //
score: '', //
create_time: '' //
},
kcyg: { //
id: '', // ID
date_time: "", //
time_slot: "", //
address: "", //
courses_name: "", //
date_md: "", // /
weekday: "" //
}
},//
}
},
onLoad() {
this.member_init()
},
onShow(){
this.init()
@ -150,10 +168,30 @@
methods: {
//
async init(){
this.member_init()
this.getMemberIndex()
this.getList()
this.getJobAssignmentsInfo()
},
async getMemberIndex(){
let res = await memberApi.memberIndex({})
if(res.code != 1){
uni.showToast({
title: res.msg,
icon: 'none'
})
return
}
// console.log('',res)
if(res.data.kcyg.time_slot){
res.data.kcyg.time_slot = res.data.kcyg.time_slot.split(',');
}
this.memberIndexData = res.data
},
//
async getList(){
let data = {
@ -170,6 +208,7 @@
return
}
this.assignmentsList = res.data.data
// console.log('',this.assignmentsList)
},
//
@ -189,7 +228,7 @@
}
this.jobAssignmentsInfo = res.data.data
console.log('待提交的作业',this.jobAssignmentsInfo)
// console.log('',this.jobAssignmentsInfo)
},
//
@ -226,7 +265,7 @@
try {
//
let uploadRes = await this.uploadFile(type)
console.log('上传结果', uploadRes)
// console.log('', uploadRes)
//
if (!uploadRes.data.path) {
@ -279,7 +318,7 @@
// sizeType: ['compressed'],
sourceType: ['album', 'camera'],
success: async (res) => {
console.log('文件选择结果:', res); // res tempFilePaths
// console.log(':', res); // res tempFilePaths
const tempFilePath = res.tempFilePath; //
// console.log('',tempFilePath)
@ -312,7 +351,7 @@
},
success: (e) => {
let res = JSON.parse(e.data.replace(/\ufeff/g, "") || "{}")
console.log('上传成功2', res)
// console.log('2', res)
if (res.code == 1) {
resolve({
code: 1,

Loading…
Cancel
Save