页面渲染 数据处理

This commit is contained in:
taoxu 2023-12-26 22:40:39 +08:00
parent cf5bd9045e
commit 804158fa14
7 changed files with 782 additions and 780 deletions

View File

@ -1,8 +1,8 @@
@font-face {
font-family: "iconfont"; /* Project id 3598721 */
src: url('//at.alicdn.com/t/c/font_3598721_fd8phfvkjv.woff2?t=1691978562796') format('woff2'),
url('//at.alicdn.com/t/c/font_3598721_fd8phfvkjv.woff?t=1691978562796') format('woff'),
url('//at.alicdn.com/t/c/font_3598721_fd8phfvkjv.ttf?t=1691978562796') format('truetype');
src: url('//at.alicdn.com/t/c/font_3598721_z5jk4kgjfv.woff2?t=1703600739909') format('woff2'),
url('//at.alicdn.com/t/c/font_3598721_z5jk4kgjfv.woff?t=1703600739909') format('woff'),
url('//at.alicdn.com/t/c/font_3598721_z5jk4kgjfv.ttf?t=1703600739909') format('truetype');
}
.iconfont {
@ -13,6 +13,14 @@
-moz-osx-font-smoothing: grayscale;
}
.icon-xiangxiajiantoucuxiao:before {
content: "\e8c8";
}
.icon-xiangshangjiantoucuxiao:before {
content: "\e8d8";
}
.icon-yiwancheng:before {
content: "\e630";
}

View File

@ -42,7 +42,7 @@ const install = (Vue, vm) => {
// 所以哪怕您重新登录修改了Storage下一次的请求将会是最新值
// const token = uni.getStorageSync('token');
const token = " Bearer 794bed8faaf14a00b07befd07b8402b2"
const token = " Bearer 5791a135fff342a4b7e70109b6936826"
// console.log("我是token", token)
config.header.Authorization = token;

View File

@ -228,6 +228,16 @@
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},
{
"path" : "teacher_class/class_members",
"style" :
{
"navigationBarTitleText": "",
"navigationBarBackgroundColor": "#4473f6",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
}
]

View File

@ -1,21 +1,16 @@
<template>
<view class="pagebox">
<view class="topbox">
<u-navbar title="LILY"
:border-bottom="false"
:background="bgc"
title-color='#FFFFFF'
title-size='36'
<u-navbar title="LILY" :border-bottom="false" :background="bgc" title-color='#FFFFFF' title-size='36'
height='36'></u-navbar>
<view class="echarts">
<!-- <mpvue-echarts id="main" ref="pieChart" :echarts="echarts" @onInit="initChart" /> -->
<l-echart ref="chart"
@finished="initChart"></l-echart>
<l-echart ref="chart" @finished="initChart"></l-echart>
</view>
<view class="infobigbox">
<view class="logo">
<image src="https://file.langsi.online/yasiimg/web/static/ubtuFZZ3dgSoSc444qIg"
style="z-index: 0;"></image>
<image src="https://file.langsi.online/yasiimg/web/static/ubtuFZZ3dgSoSc444qIg" style="z-index: 0;">
</image>
</view>
<view class="infobox">
@ -25,15 +20,33 @@
今日学习
</view>
<view class="infobox_top_leftbot">
320
{{workinfo.todayStudyPoint}}
</view>
</view>
<view class="infobox_top_right">
<view class="infobox_top_righttop">
较昨日
</view>
<view class="infobox_top_rightbot">
20%
<view class="infobox_top_rightbot" style="color: #2D7CE6; " v-if="isup">
<view class="iconfont icon-xiangshangjiantoucuxiao">
</view>
<view class="text">
{{beforyes}}%
</view>
</view>
<view class="infobox_top_rightbot" v-if="beforyes==0" style="color: #2E4975;">
<view class="text">
{{beforyes}}%
</view>
</view>
<view class="infobox_top_rightbot" v-if="isup==false">
<view class="iconfont icon-xiangxiajiantoucuxiao">
</view>
<view class="text">
{{beforyes}}%
</view>
</view>
</view>
</view>
@ -59,7 +72,7 @@
今日问AI
</view>
<view class="infobox_bot_cont_bot">
43
{{workinfo.askAiNum}}
</view>
</view>
</view>
@ -71,84 +84,30 @@
<view class="study_info_top_left">
作业完成情况
</view>
<view class="study_info_top_right">
<!-- <view class="study_info_top_right">
本周
<view class="iconfont icon-arow_down"></view>
</view>
</view> -->
</view>
<view class="study_info_cont_box">
<view class="study_info_cont">
<view class="data">Mon</view>
<view class="study_info_cont" v-for="(item, index) in sdydata" :key="index">
<view class="data" v-if="index==1">Sun</view>
<view class="data" v-if="index==2">Mon</view>
<view class="data" v-if="index==3">Tus</view>
<view class="data" v-if="index==4">Wed</view>
<view class="data" v-if="index==5">Thu</view>
<view class="data" v-if="index==6">Fri</view>
<view class="data" v-if="index==7">Sat</view>
<view class="study_box">
<view class="study"
v-for="(item, index) in sdydata"
:key="index"
:style="{ backgroundColor: item.background }"></view>
<view class="study" v-for="(items,indexs) in item" :key="indexs"
:style="{ backgroundColor: items.background }"></view>
</view>
</view>
<view class="study_info_cont">
<view class="data">Tue</view>
<view class="study_box">
<view class="study"
v-for="(item, index) in sdydata"
:key="index"
:style="{ backgroundColor: item.background }"></view>
</view>
</view>
<view class="study_info_cont">
<view class="data">Wed</view>
<view class="study_box">
<view class="study"
v-for="(item, index) in sdydata"
:key="index"
:style="{ backgroundColor: item.background }"></view>
</view>
</view>
<view class="study_info_cont">
<view class="data">Thu</view>
<view class="study_box">
<view class="study"
v-for="(item, index) in sdydata"
:key="index"
:style="{ backgroundColor: item.background }"></view>
</view>
</view>
<view class="study_info_cont">
<view class="data">Fri</view>
<view class="study_box">
<view class="study"
v-for="(item, index) in sdydata"
:key="index"
:style="{ backgroundColor: item.background }"></view>
</view>
</view>
<view class="study_info_cont">
<view class="data">Sat</view>
<view class="study_box">
<view class="study"
v-for="(item, index) in sdydata"
:key="index"
:style="{ backgroundColor: item.background }"></view>
</view>
</view>
<view class="study_info_cont">
<view class="data">Sun</view>
<view class="study_box">
<view class="study"
v-for="(item, index) in sdydata"
:key="index"
:style="{ backgroundColor: item.background }"></view>
</view>
</view>
</view>
</view>
@ -231,8 +190,7 @@
</view>
</view>
</view>
<view class="work_card"
:class="isalready == true ? 'act1' : ''">
<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">
@ -240,8 +198,7 @@
</view>
课后作业
</view>
<view class="work_card_top_right"
:class="isalready == true ? 'act2' : ''">
<view class="work_card_top_right" :class="isalready == true ? 'act2' : ''">
进行中
</view>
</view>
@ -312,7 +269,8 @@ import mpvueEcharts from '@/components/mpvue-echarts/src/echarts.vue'
import LEchart from '@/uni_modules/lime-echart/components/l-echart/l-echart.vue';
export default {
components: {
mpvueEcharts, LEchart
mpvueEcharts,
LEchart
},
data() {
return {
@ -327,6 +285,11 @@ export default {
},
sdydata: [],
isalready: true,
id: 1523,
workinfo: {},
orgworkinfo: {},
beforyes: '',
isup: ''
// https://file.langsi.online/yasiimg/web/static/uBHiWpVS8LQdX241DdjX
}
},
@ -334,10 +297,37 @@ export default {
this.changedata()
// this.changedata()
this.getinfo()
},
methods: {
getinfo() {
this.$u.get(
`https://api.admin-v2.langsi.online/admin-api/classroom/work-record/statistics?memberId=${this.id}`
).then(res => {
if (res.code == 0) {
this.workinfo = res.data
this.sdydata = this.workinfo.weekWorkStatistics
this.orgworkinfo = JSON.parse(JSON.stringify(res.data));
const percentageChange = ((this.workinfo.todayStudyPoint - this.workinfo
.yesterdayStudyPoint) / Math.abs(this.workinfo.yesterdayStudyPoint)) * 100;
// Determine whether it's an improvement or decline
this.isup = percentageChange > 0;
// Assign the absolute percentage change to this.beforyes
this.beforyes = Math.abs(percentageChange);
this.changedata()
// this.classlist = res.data.list
// this.isloding = false
}
})
},
async initChart() {
let _this = this
@ -394,8 +384,7 @@ export default {
//
}
},
indicator: [
{ // ,data value
indicator: [{ // ,data value
name: '平均成绩/分' + ' ' + Number(_this.totalScore).toFixed(1),
//
max: 100,
@ -421,7 +410,8 @@ export default {
name: '听力' + ' ' + Number(_this.fluencyScore).toFixed(1),
max: 100,
color: '#FFFFFF' //
}]
}
]
}],
series: [{
name: '雷达图',
@ -501,7 +491,11 @@ export default {
// },
{
name: '',
value: [Number(_this.grammaticalScore).toFixed(1) * 10, Number(_this.grammaticalScore).toFixed(1) * 10, Number(_this.vocabularyScore).toFixed(1) * 10, Number(_this.pronounceScore).toFixed(1) * 10, Number(_this.fluencyScore).toFixed(1) * 10],
value: [Number(_this.grammaticalScore).toFixed(1) * 10, Number(_this
.grammaticalScore).toFixed(1) * 10, Number(_this
.vocabularyScore).toFixed(1) * 10, Number(_this
.pronounceScore).toFixed(1) * 10, Number(_this
.fluencyScore).toFixed(1) * 10],
symbol: 'circle',
symbolSize: 0,
// label: {
@ -539,9 +533,9 @@ export default {
color: '#2D7CE6'
}
}
}]
},
}
]
}, ]
};
const chart = await this.$refs.chart.init(echarts);
chart.setOption(option)
@ -549,37 +543,25 @@ export default {
},
changedata() {
this.sdydata = [];
this.sdydata[1][0].times = 10
for (const key in this.sdydata) {
if (this.sdydata.hasOwnProperty(key)) {
const items = this.sdydata[key];
for (let i = 0; i < 10; i++) {
const isStudy = Math.random() < 0.5;
let totalNum = "0";
let alreadyNum = "0";
// Loop through each item in the structure
for (const item of items) {
// Compare times with maxTimes and calculate the percentage
const percentage = (item.times / this.workinfo.maxTimes) * 100;
if (isStudy) {
totalNum = String(Math.floor(Math.random() * 100));
alreadyNum = String(Math.floor(Math.random() * (parseInt(totalNum) + 1)));
}
// Get the background color using the getColorByPercentage method
const backgroundColor = this.getColorByPercentage(percentage);
this.sdydata.push({
isStudy,
totalNum,
alreadyNum,
});
}
for (let i = 0; i < this.sdydata.length; i++) {
const item = this.sdydata[i];
if (item.isStudy) {
const percentage = (parseInt(item.alreadyNum) / parseInt(item.totalNum)) * 100;
const color = this.getColorByPercentage(percentage);
item.background = color;
} else {
item.background = '#F6F6F6';
// Add the background property to the item
item.background = backgroundColor;
}
}
console.log(this.sdydata, 'this.sdydata');
}
console.log(this.sdydata, 'sdydatasdydata');
},
getColorByPercentage(percentage) {
//
@ -686,11 +668,28 @@ page {
}
.infobox_top_rightbot {
display: flex;
flex-wrap: nowrap;
margin-top: 4rpx;
align-items: flex-end;
/* Align items at the bottom */
color: #F18F21;
.icon-xiangshangjiantoucuxiao {
font-size: 16rpx;
margin-bottom: 12rpx;
}
.icon-xiangxiajiantoucuxiao {
font-size: 16rpx;
margin-bottom: 12rpx;
}
.text {
font-size: 40rpx;
font-family: 'PingFang', 'PingFang';
font-weight: 800;
color: #F18F21;
}
}
}
}
@ -774,6 +773,7 @@ page {
}
.study_info_cont_box {
margin-top: 32rpx;
display: flex;
// flex-wrap: warp;
@ -977,4 +977,5 @@ page {
border-left: 8rpx solid #2D7CE6;
}
}
}</style>
}
</style>

View File

@ -19,51 +19,28 @@
</view> -->
<view class="check_card_cls">
<view class="check_card_cls " v-for="(item,index) in workinfo" :key="index">
<view class="check_card_cls_info_left">
<view class="class_card_left">
<image src=" https://file.langsi.online/yasiimg/web/static/udWNTRG6GulmTtgPRQ49"></image>
<image :src="item.avatar"></image>
</view>
<view class="class_card_right">
<view class="class_card_right_top">
雅思1班
</view>
<view class="class_card_right_bot">
共21人
</view>
</view>
</view>
<view class="check_card_cls_info_right">
<view class="class_info">
<view class="class_info_top">
平均成绩/
</view>
<view class="class_info_bot">
6
</view>
</view>
<view class="class_info">
<view class="class_info_top">
作业完成度
</view>
<view class="class_info_bot">
80%
</view>
{{item.name}}
</view>
<view class="class_card_right_bot" v-show="item.classify == 1">
听力
</view>
<view class="class_card_right_bot" v-show="item.classify == 2">
阅读
</view>
<view class="check_card_cls ">
<view class="check_card_cls_info_left">
<view class="class_card_left">
<image src=" https://file.langsi.online/yasiimg/web/static/udWNTRG6GulmTtgPRQ49"></image>
<view class="class_card_right_bot" v-show="item.classify == 3">
写作
</view>
<view class="class_card_right">
<view class="class_card_right_top">
雅思1班
</view>
<view class="class_card_right_bot">
共21人
<view class="class_card_right_bot" v-show="item.classify == 4">
口语
</view>
</view>
</view>
@ -103,19 +80,23 @@
backgroundColor: "#F6F9FC",
},
checkindex: 0,
id:13,
id:12,
workinfo:[],
orgworkinfo:[]
}
},
onLoad() {
onLoad(option) {
console.log(option);
this.id = option.id
// this.classid=15
this.getworklist()
},
methods: {
getworklist() {
this.$u.get(`https://api.admin-v2.langsi.online//admin-api/classroom/work-record/classrooms?workId=${this.id}`).then(res => {
this.$u.get(`https://api.admin-v2.langsi.online/admin-api/classroom/work-record/classrooms?workId=${this.id}`).then(res => {
if (res.code == 0) {

View File

@ -19,21 +19,21 @@
</view> -->
<view class="check_card_cls">
<view class="check_card_cls_info_left">
<view class="check_card_stu" v-for="(item,index) in workinfo" :key="index">
<view class="check_card_stu_info_left">
<view class="class_card_left">
<image src=" https://file.langsi.online/yasiimg/web/static/udWNTRG6GulmTtgPRQ49"></image>
<image :src="item.avatar"></image>
</view>
<view class="class_card_right">
<view class="class_card_right_top">
雅思1班
{{item.name}}
</view>
<view class="class_card_right_bot">
共21人
ID{{item.id}}
</view>
</view>
</view>
<view class="check_card_cls_info_right">
<view class="check_card_stu_info_right">
<view class="class_info">
<view class="class_info_top">
平均成绩/
@ -53,40 +53,8 @@
</view>
</view>
<view class="check_card_cls ">
<view class="check_card_cls_info_left">
<view class="class_card_left">
<image src=" https://file.langsi.online/yasiimg/web/static/udWNTRG6GulmTtgPRQ49"></image>
</view>
<view class="class_card_right">
<view class="class_card_right_top">
雅思1班
</view>
<view class="class_card_right_bot">
共21人
</view>
</view>
</view>
<view class="check_card_cls_info_right">
<view class="class_info">
<view class="class_info_top">
平均成绩/
</view>
<view class="class_info_bot">
6
</view>
</view>
<view class="class_info">
<view class="class_info_top">
作业完成度
</view>
<view class="class_info_bot">
80%
</view>
</view>
</view>
</view>
</view>
</view>
@ -96,7 +64,7 @@
export default {
data() {
return {
title: '班级安排',
title: '学生安排',
//
bgc: {
@ -110,12 +78,16 @@
}
},
onLoad() {
onLoad(option) {
console.log(option);
this.id = option.id
// this.classid=15
this.getworklist()
},
methods: {
getworklist() {
this.$u.get(`https://api.admin-v2.langsi.online//admin-api/classroom/work-record/classrooms?workId=${this.id}`).then(res => {
this.$u.get(`https://api.admin-v2.langsi.online/admin-api/classroom/work-record/members?workId=${this.id}`).then(res => {
if (res.code == 0) {

View File

@ -53,7 +53,7 @@
<!-- 班级 -->
<view class="ap_class">
<!-- 安排班级 -->
<view class="ap_classes">
<view class="ap_classes" @click="toclass()">
<view class="ad_organization">
<view class="ad_ap">班级安排</view>
<view class="ad_icon">
@ -70,7 +70,7 @@
</view>
</view>
<!-- 成员安排 -->
<view class="ap_classes">
<view class="ap_classes" @click="tostu()">
<view class="ad_organization">
<view class="ad_ap">成员安排</view>
<view class="ad_icon">
@ -96,17 +96,20 @@
<view class="view_timeline" style="margin-top: 20rpx;">
<u-time-line>
<!-- 时间线1 -->
<u-time-line-item nodeTop="2" node-color="red" v-for="(itemsx,indexx) in item.items" :key="indexx">
<u-time-line-item nodeTop="2" node-color="red" v-for="(itemsx,indexx) in item.items"
:key="indexx">
<template v-slot:content>
<view>
<view class="u-order-title">
<view class="fickle">
<view class="view_first_wz" v-if="itemsx.classify==1||itemsx.classify==2">
{{itemsx.testName}}</view>
{{itemsx.testName}}
</view>
<view class="view_first_wz" v-if="itemsx.classify==3">{{itemsx.testName}}
</view>
<view class="view_first_wz" v-if="itemsx.classify==4">
{{itemsx.moduleName}}-{{itemsx.partName}}</view>
{{itemsx.moduleName}}-{{itemsx.partName}}
</view>
<view class="changeable greenish" v-if="itemsx.classify==1">听力</view>
<view class="changeable yellow" v-if="itemsx.classify==2">阅读</view>
<view class="changeable blur" v-if="itemsx.classify==3">写作</view>
@ -117,19 +120,25 @@
</view>
<veiw class="blue-green">
<view class="blue_qs" :style="'width:' + itemsx.speedwidth + '%;'" v-if="itemsx.classify==1">
<view class="blue_qs" :style="'width:' + itemsx.speedwidth + '%;'"
v-if="itemsx.classify==1">
</view>
<view class="blue_qs2" :style="'width:' + itemsx.speedwidth + '%;'" v-if="itemsx.classify==2">
<view class="blue_qs2" :style="'width:' + itemsx.speedwidth + '%;'"
v-if="itemsx.classify==2">
</view>
<view class="blue_qs3" :style="'width:' + itemsx.speedwidth + '%;'" v-if="itemsx.classify==3">
<view class="blue_qs3" :style="'width:' + itemsx.speedwidth + '%;'"
v-if="itemsx.classify==3">
</view>
<view class="blue_qs4" :style="'width:' + itemsx.speedwidth + '%;'" v-if="itemsx.classify==4">
<view class="blue_qs4" :style="'width:' + itemsx.speedwidth + '%;'"
v-if="itemsx.classify==4">
</view>
<view class="text" style="z-index: 2;" v-if="itemsx.classify==1||itemsx.classify==2" >
<view class="text" style="z-index: 2;"
v-if="itemsx.classify==1||itemsx.classify==2">
{{itemsx.partName}}
</view>
<view class="word" style="z-index: 2;" v-if="itemsx.classify==1||itemsx.classify==2">
<view class="word" style="z-index: 2;"
v-if="itemsx.classify==1||itemsx.classify==2">
:{{itemsx.questionType}}
</view>
<view class="text" style="z-index: 2;" v-if="itemsx.classify==3">
@ -191,6 +200,26 @@
return '其他类型';
}
},
toclass(){
uni.navigateTo({
url: "/pages_teacher/pages_add/add_class?id=" +this.workinfo.id
}).then(res => {
}).catch(err => {
});
},
tostu(){
uni.navigateTo({
url: "/pages_teacher/teacher_class/class_members?id=" + this.workinfo.id
}).then(res => {
}).catch(err => {
});
},
getworklist() {
this.$u.get(`https://api.admin-v2.langsi.online/admin-api/classroom/work-record/detail?workId=${this.id}`)
.then(res => {
@ -444,6 +473,7 @@
white-space: nowrap;
text-overflow: ellipsis;
}
.word {
z-index: 2;
font-size: 24rpx;