smartmeter-app/pages/compoents/pages_home.vue

575 lines
11 KiB
Vue
Raw Normal View History

2023-12-05 16:45:28 +08:00
<template>
<!-- 头部代码 -->
<view class="view_by">
<view>
<u-navbar :is-back="false" title='首页' title-color="#000" :border-bottom="false" :background="true" id="navbar">
</u-navbar>
</view>
2023-12-19 18:12:29 +08:00
<view class="headert" >
<!-- 登录之后显示的头部 -->
<view class="view_body" v-if="flag">
2023-12-05 16:45:28 +08:00
<view class="content_box">
<view class="view_text">32</view>
2023-12-19 18:12:29 +08:00
<view class="content_wz"> 已完成人数 </view>
2023-12-05 16:45:28 +08:00
</view>
<view class="content_box">
<view class="view_text">90%</view>
2023-12-19 18:12:29 +08:00
<view class="content_wz"> 已完成作业正确率 </view>
2023-12-05 16:45:28 +08:00
</view>
</view>
2023-12-19 18:12:29 +08:00
<!-- 没有登录之后的头部 -->
<view v-if="!flag">
<view class="deer">
<view class="deer_images">
<image src="https://file.langsi.online/yasiimg/web/static/udGRdnpSfgV3LMD8Ksuv" mode=""></image>
2023-12-05 16:45:28 +08:00
</view>
2023-12-19 18:12:29 +08:00
<view class="deer_right">
2023-12-05 16:45:28 +08:00
<view class="deer_text">当前暂无学习数据快去布置作业吧</view>
<view class="deer_button">
2023-12-19 18:12:29 +08:00
<view>
去安排
<view class="deer_images" >
<image src="https://file.langsi.online/yasiimg/web/static/unXLZbc2dymxc1E4Cfui" mode=""></image>
</view>
</view>
</view>
</view>
<!-- 没有登录之后的echars图 -->
<view class= "echarts_bar bar_postion" >
<view>
<text>作业完成情况</text>
<view class="echarts_text">
<view class="weekend">本周</view>
<view class="echarts_text_images">
<image src="https://file.langsi.online/yasiimg/web/static/uNvIMlLMVTIDXq2uygtH" mode=""></image>
</view>
</view>
2023-12-05 16:45:28 +08:00
</view>
2023-12-19 18:12:29 +08:00
<!-- echarts图 -->
<view>
<l-echart ref="chart" @finished="initChart" class="iinsf"></l-echart>
</view>
</view>
2023-12-05 16:45:28 +08:00
</view>
</view>
2023-12-19 18:12:29 +08:00
<!-- 登录之后的echarts图 -->
<view class="echarts_bar" v-if="flag">
<view>
<text>作业完成情况</text>
<view class="echarts_text">
<view class="weekend">本周</view>
<view class="echarts_text_images">
<image src="https://file.langsi.online/yasiimg/web/static/uNvIMlLMVTIDXq2uygtH" mode=""></image>
</view>
</view>
</view>
<!-- echarts图 -->
<view>
2023-12-05 16:45:28 +08:00
</view>
</view>
2023-12-19 18:12:29 +08:00
2023-12-05 16:45:28 +08:00
</view>
<!-- 底部区域 -->
<view v-if="flag">
<view class="date">
2023-12-19 18:12:29 +08:00
<view class="date_rq">8月31日</view>
<u-icon name="arrow-down" color="#2E4975" size="20rpx"></u-icon>
2023-12-05 16:45:28 +08:00
</view>
2023-12-19 18:12:29 +08:00
2023-12-05 16:45:28 +08:00
<view class="box_rate">
<view class="rate_item">
<view class="number">
21
</view>
<view class="text">
完成人数
</view>
</view>
<view class="rate_item">
<view class="number">
6
</view>
<view class="text">
平均成绩/
</view>
</view>
<view class="rate_item">
<view class="number">
80%
</view>
<view class="text">
作业正确率
</view>
</view>
</view>
<view>
<view class="view_botton">
<view class="view_spoken">
<view>
<image src="https://file.langsi.online/yasiimg/web/static/u80EhqyvMfcOaaSyK09X" mode=""></image>
</view>
<view class="view_span">
<text>口语单科模考</text>
<text>李斯丹妮</text>
</view>
</view>
<view class="view_text2">
<view>正确率<text class="text2">80%</text></view>
<text>2023/02/23 12:00</text>
</view>
</view>
<view class="view_botton">
<view class="view_spoken">
<view>
<image src="https://file.langsi.online/yasiimg/web/static/u80EhqyvMfcOaaSyK09X" mode=""></image>
</view>
<view class="view_span">
<text>口语单科模考</text>
<text>李斯丹妮</text>
</view>
</view>
<view class="view_text2">
<view>正确率<text class="text2">80%</text></view>
<text>2023/02/23 12:00</text>
</view>
</view>
2023-12-19 18:12:29 +08:00
<view class="view_botton">
<view class="view_spoken">
<view>
<image src="https://file.langsi.online/yasiimg/web/static/u80EhqyvMfcOaaSyK09X" mode=""></image>
</view>
<view class="view_span">
<text>口语单科模考</text>
<text>李斯丹妮</text>
</view>
</view>
<view class="view_text2">
<view>正确率<text class="text2">80%</text></view>
<text>2023/02/23 12:00</text>
</view>
</view>
<view class="view_botton">
<view class="view_spoken">
<view>
<image src="https://file.langsi.online/yasiimg/web/static/u80EhqyvMfcOaaSyK09X" mode=""></image>
</view>
<view class="view_span">
<text>口语单科模考</text>
<text>李斯丹妮</text>
</view>
</view>
<view class="view_text2">
<view>正确率<text class="text2">80%</text></view>
<text>2023/02/23 12:00</text>
</view>
</view>
2023-12-05 16:45:28 +08:00
</view>
<!--底部导航栏 -->
</view>
<!-- 没有数据显示的区域 -->
2023-12-19 18:12:29 +08:00
<view class="not_logged " >
<view class="date">
<view class="date_rq">8月31日</view>
<u-icon name="arrow-down" color="#2E4975" size="20rpx"></u-icon>
</view>
<view class="zu_zp">
<view class="zu_image">
<image src="https://file.langsi.online/yasiimg/web/static/uFgs4acAUC68weaKB9Yi" mode=""></image>
2023-12-05 16:45:28 +08:00
</view>
2023-12-19 18:12:29 +08:00
<view class="zu_text">暂无学习记录快去安排作业吧</view>
</view>
2023-12-05 16:45:28 +08:00
</view>
</view>
</template>
<script>
import * as echarts from '@/uni_modules/lime-echart/static/echarts.min'
import LEchart from '@/uni_modules/lime-echart/components/l-echart/l-echart.vue';
export default {
components: {
LEchart
},
data() {
return {
2023-12-19 18:12:29 +08:00
flag: false
2023-12-05 16:45:28 +08:00
}
},
methods: {
async initChart() {
let _this = this
const option = {
xAxis: {
type: 'category',
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
},
yAxis: {
type: 'value',
2023-12-19 18:12:29 +08:00
boundaryGap: ['10%', '20%', ]
2023-12-05 16:45:28 +08:00
},
series: [{
data: [120, 200, 150, 80, 70, 110, 130],
type: 'bar'
}]
}
const chart = await this.$refs.chart.init(echarts);
chart.setOption(option)
//return chart
},
}
}
</script>
<style lang="scss" scoped>
.view_by {
2023-12-19 18:12:29 +08:00
height: 100%;
2023-12-05 16:45:28 +08:00
background: linear-gradient(180deg, #E1EEFF 0%, #FFFFFF 100%);
padding: 32rpx;
2023-12-19 18:12:29 +08:00
2023-12-05 16:45:28 +08:00
.header_button {
display: flex;
justify-content: space-evenly;
align-items: center;
.custom-style {
width: 180rpx;
height: 72rpx;
}
.active {
background: #2D7CE6;
color: #fff;
box-shadow: inset 0rpx 8rpx 16rpx 0rpx rgba(255, 255, 255, 0.35);
}
}
2023-12-19 18:12:29 +08:00
.headert{
position: relative;
.view_body {
position: relative;
2023-12-05 16:45:28 +08:00
display: flex;
2023-12-19 18:12:29 +08:00
justify-content: center;
2023-12-05 16:45:28 +08:00
align-items: center;
2023-12-19 18:12:29 +08:00
.content_box {
flex: 1;
.content_wz {
font-family: 'PingFang';
font-size: 28rpx;
font-weight: 500;
color: #2E4975;
}
}
.content_box:first-child {
border-right: 2rpx solid rgba(0, 0, 0, 0.11);
}
.view_text {
font-size: 76rpx;
font-family: 'PingFang';
font-weight: 500;
color: #2E4975;
}
view {
display: flex;
flex-direction: column;
align-items: center;
}
2023-12-05 16:45:28 +08:00
}
2023-12-19 18:12:29 +08:00
2023-12-05 16:45:28 +08:00
}
2023-12-19 18:12:29 +08:00
2023-12-05 16:45:28 +08:00
.echarts_bar {
width: 686rpx;
2023-12-19 18:12:29 +08:00
height: 229px;
2023-12-05 16:45:28 +08:00
background: #FFFFFF;
border-radius: 20rpx 20rpx 20rpx 20rpx;
opacity: 1;
margin-top: 32rpx;
padding: 32rpx;
view {
display: flex;
justify-content: space-between;
text {
font-size: 28rpx;
2023-12-19 18:12:29 +08:00
font-family: 'PingFang';
2023-12-05 16:45:28 +08:00
font-weight: 800;
color: #2E4975;
}
}
2023-12-19 18:12:29 +08:00
.echarts_text {
display: flex;
align-items: center;
.weekend {
font-size: 24rpx;
color: rgba(46, 73, 117, 0.65);
}
.echarts_text_images {
width: 18rpx;
height: 10rpx;
margin-left: 5rpx;
}
}
2023-12-05 16:45:28 +08:00
}
2023-12-19 18:12:29 +08:00
.bar_postion{
position: absolute;
bottom: -390rpx;
z-index: 99;
}
2023-12-05 16:45:28 +08:00
.box_rate {
display: flex;
justify-content: center;
align-items: center;
padding: 30rpx;
background: linear-gradient(179deg, rgba(255, 237, 223, 0.65) 0%, #FFFFFF 100%);
border-radius: 18rpx 18rpx 18rpx 18rpx;
.rate_item {
flex: 1;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.number {
font-size: 28rpx;
font-family: 'PingFang', 'PingFang';
2023-12-05 16:45:28 +08:00
font-weight: 800;
color: #2D7CE6;
}
.text {
font-size: 20rpx;
font-family: 'PingFang', 'PingFang';
2023-12-05 16:45:28 +08:00
font-weight: 500;
color: rgba(7, 47, 90, 0.5);
}
}
.date {
2023-12-19 18:12:29 +08:00
display: flex;
align-items: center;
margin: 32rpx 0 16rpx 0;
.date_rq {
font-size: 12px;
font-weight: 800;
color: #2E4975;
margin-right: 4rpx
}
2023-12-05 16:45:28 +08:00
}
.view_botton {
display: flex;
align-items: center;
justify-content: space-between;
height: 124rpx;
background: #fff;
border-radius: 20rpx 20rpx 20rpx 20rpx;
margin: 20rpx 0rpx;
padding: 24rpx;
.view_spoken {
display: flex;
align-items: center;
.view_span {
display: flex;
flex-direction: column;
margin-left: 16rpx;
}
.view_span text:nth-child(1) {
font-size: 28rpx;
font-family: 'PingFang', 'PingFang';
2023-12-05 16:45:28 +08:00
font-weight: bold;
color: #072F5A;
margin-bottom: 7rpx;
}
.view_span text:nth-child(2) {
font-size: 20rpx;
font-family: 'PingFang', 'PingFang';
2023-12-05 16:45:28 +08:00
font-weight: 500;
color: rgba(46, 73, 117, 0.5);
margin-bottom: 7rpx;
}
}
.view_text2 {
display: flex;
flex-direction: column;
text-align: right;
view .text2 {
color: #F18F21;
font-size: 27rpx;
font-weight: 800;
margin-left: 7rpx;
}
}
2023-12-19 18:12:29 +08:00
2023-12-05 16:45:28 +08:00
.view_text2 view {
font-size: 20rpx;
font-family: 'PingFang', 'PingFang';
2023-12-05 16:45:28 +08:00
font-weight: 500;
color: #F18F21;
}
.view_text2 text {
font-size: 20rpx;
font-family: 'PingFang', 'PingFang';
2023-12-05 16:45:28 +08:00
font-weight: 500;
color: rgba(7, 47, 90, 0.4);
}
image {
width: 76rpx;
height: 76rpx;
}
2023-12-19 18:12:29 +08:00
2023-12-05 16:45:28 +08:00
}
2023-12-19 18:12:29 +08:00
.echarts {
2023-12-05 16:45:28 +08:00
width: 300rpx;
height: 600rpx;
margin-top: -100rpx;
}
2023-12-19 18:12:29 +08:00
.deer {
position: relative;
2023-12-05 16:45:28 +08:00
display: flex;
align-items: center;
}
2023-12-19 18:12:29 +08:00
.deer_images {
2023-12-05 16:45:28 +08:00
width: 145rpx;
height: 245rpx;
}
2023-12-19 18:12:29 +08:00
.r_image {
2023-12-05 16:45:28 +08:00
width: 16rpx;
height: 16rpx;
line-height: 16rpx;
margin-left: 8rpx;
}
2023-12-19 18:12:29 +08:00
.deer_button {
2023-12-05 16:45:28 +08:00
display: flex;
justify-content: center;
align-items: center;
margin-top: 19rpx;
width: 160rpx;
font-size: 20rpx;
2023-12-19 18:12:29 +08:00
padding: 14rpx 0;
2023-12-05 16:45:28 +08:00
font-weight: 500;
color: #FFFFFF;
background: #2D7CE6;
border-radius: 86rpx 86rpx 86rpx 86rpx;
2023-12-19 18:12:29 +08:00
.deer_images{
width: 16rpx;
height: 16rpx;
line-height: 16rpx;
margin-left: 5rpx
}
>view {
display: flex;
align-items: center;
}
2023-12-05 16:45:28 +08:00
}
2023-12-19 18:12:29 +08:00
.deer_right {
2023-12-05 16:45:28 +08:00
margin-left: 20rpx;
2023-12-19 18:12:29 +08:00
margin-top: -50rpx;
2023-12-05 16:45:28 +08:00
}
2023-12-19 18:12:29 +08:00
.deer_text {
2023-12-05 16:45:28 +08:00
font-size: 28rpx;
2023-12-19 18:12:29 +08:00
2023-12-05 16:45:28 +08:00
font-weight: 500;
color: #627698;
}
2023-12-19 18:12:29 +08:00
.operation {
2023-12-05 16:45:28 +08:00
height: 459rpx;
background: #FFFFFF;
border-radius: 20rpx 20rpx 20rpx 20rpx;
}
2023-12-19 18:12:29 +08:00
.zu_image {
2023-12-05 16:45:28 +08:00
width: 172rpx;
height: 162rpx;
2023-12-19 18:12:29 +08:00
2023-12-05 16:45:28 +08:00
}
2023-12-19 18:12:29 +08:00
.zu_text {
2023-12-05 16:45:28 +08:00
font-size: 24rpx;
font-weight: 400;
color: #0E3B77;
margin: 20rpx 0rpx 50rpx 0rpx;
}
2023-12-19 18:12:29 +08:00
.zu_footer {
2023-12-05 16:45:28 +08:00
// padding: 32rpx 0rpx;
}
2023-12-19 18:12:29 +08:00
.zu_zp {
2023-12-05 16:45:28 +08:00
display: flex;
flex-direction: column;
align-items: center;
padding: 72rpx;
}
2023-12-19 18:12:29 +08:00
.not_logged{
margin-top: 423rpx
}
2023-12-05 16:45:28 +08:00
}
</style>