KindergartenAppletUI/pages/grade/grade.vue

277 lines
5.1 KiB
Vue
Raw Normal View History

2023-04-12 11:50:49 +08:00
<template>
2023-04-19 16:20:12 +08:00
<view class="tops" v-if="StudentScore==0">
2023-04-12 11:50:49 +08:00
<view class="zanwuchengji">
<image src="../../static/zanwuchengji.png" mode=""></image>
<view class="words">
暂无内容
</view>
</view>
</view>
<view class="content" v-else>
<view class="top" v-for="item in StudentScore">
<view class="itemback">
<view class="bindtitle">
批次编号{{item.batchCode}}
</view>
<view class="time">
2023-04-19 14:25:28 +08:00
{{item.batchDate}}
2023-04-12 11:50:49 +08:00
</view>
</view>
<view class="name">
2023-04-19 14:25:28 +08:00
{{item.studentName}}
2023-04-12 11:50:49 +08:00
</view>
<view class="grade">
{{item.totalFraction}}
<span></span>
</view>
2023-04-19 15:39:09 +08:00
<view class="baogao" @tap='lookbook(item)'>
2023-04-19 15:48:23 +08:00
<view class="image"></view>
2023-04-19 15:39:09 +08:00
<view class="look" v-if="item.existFlag==false">暂无报告</view>
<view class="lookreport" v-else>查看报告</view>
2023-04-12 11:50:49 +08:00
</view>
</view>
<u-toast ref="uToast" />
</view>
</template>
<script>
import {
getStudentScore,
2023-04-20 10:46:23 +08:00
getInfoByPhone,
2023-04-12 11:50:49 +08:00
} from '@/api/index/index.js'
import baseurl from '@/api/baseurl.js'
export default {
data() {
return {
StudentScore: [],
studentId: "",
// studentIdList:{},
}
},
onShow() {
2023-04-20 10:46:23 +08:00
const value = uni.getStorageSync('phone');
getInfoByPhone(value).then(res => {
if (res.code == 200) {
var obj = {
studentIdList: []
}
res.data.studentInfoList.forEach(e => {
obj.studentIdList.push(e.studentId)
})
getStudentScore(obj).then(res => {
this.StudentScore = res.data
})
} else {}
})
2023-04-12 11:50:49 +08:00
},
methods: {
lookbook(item) {
2023-04-19 15:39:09 +08:00
if (item.existFlag == false) {
this.$refs.uToast.show({
2023-04-20 09:44:56 +08:00
title: "暂无报告",
2023-04-19 15:39:09 +08:00
type: 'error',
duration: 1000
})
} else {
uni.showLoading({
title: '获取报告中'
});
var that = this
wx.downloadFile({
url: baseurl + item.downloadAddress,
success: function(res) {
var filePath = res.tempFilePath;
wx.openDocument({
filePath: filePath,
showMenu: true,
success: function(res) {
uni.hideLoading();
},
fail: function(err) {
uni.hideLoading();
}
});
},
fail: function(err) {
uni.hideLoading();
that.$refs.uToast.show({
2023-04-19 15:44:53 +08:00
message: '请求报告失败',
2023-04-19 15:39:09 +08:00
type: 'error'
})
}
});
}
2023-04-12 11:50:49 +08:00
},
getPhoneNumberp(val) {
wx.login({
provider: 'weixin',
2023-04-19 15:00:55 +08:00
success: function(loginRes) {}
2023-04-12 11:50:49 +08:00
});
},
wxGetUserInfo() {
let that = this;
uni.getUserProfile({
desc: "获取用户信息",
lang: "zh_CN",
success(res) {
that.yonghuwx = res.userInfo
},
fail(res) {
//失败则返回home页面
},
});
},
}
}
</script>
<style lang="scss">
2023-04-19 16:20:12 +08:00
.tops {
2023-04-12 11:50:49 +08:00
position: relative;
.zanwuchengji {
width: 374rpx;
2023-04-19 16:20:12 +08:00
height: 100vh;
2023-04-12 11:50:49 +08:00
line-height: 391rpx;
text-align: center;
.words {
position: absolute;
2023-04-19 16:20:12 +08:00
top: 42%;
width: 100%;
text-align: center;
2023-04-12 11:50:49 +08:00
font-size: 32rpx;
font-family: Source Han Sans CN;
font-weight: 400;
color: #666666;
line-height: 50rpx;
}
image {
vertical-align: middle;
width: 374rpx;
height: 391rpx;
position: absolute;
left: 25%;
2023-04-19 16:20:12 +08:00
top: 20%;
2023-04-12 11:50:49 +08:00
}
}
2023-04-19 16:20:12 +08:00
}
.content {
background: linear-gradient(#D7EEE8, #fff);
// background-color: red;
padding: 3%;
position: relative;
2023-04-12 11:50:49 +08:00
.top {
background: #fff;
box-shadow: 0px 3px 18px 0px rgba(182, 218, 213, 0.43);
width: 100%;
margin: 3% auto 0; // text-align: center;
height: 268rpx;
border-radius: 10rpx;
position: relative;
.name {
width: 250rpx;
height: 50rpx;
font-size: 28rpx;
font-family: Source Han Sans CN;
font-weight: 500;
color: #000000;
line-height: 48rpx;
top: 50%;
left: 20rpx;
position: absolute;
}
.baogao {
font-size: 26rpx;
font-family: Source Han Sans CN;
font-weight: 400;
color: #000;
.image {
width: 35rpx;
// background-size62rpx 50rpx;
height: 38rpx;
background: url(../../static/tijianbaogao.png) no-repeat center center;
background-size: 100% 100%;
left: 80%;
top: 50%;
position: absolute;
}
.look {
left: 75%;
top: 65%;
position: absolute;
}
2023-04-19 15:00:55 +08:00
.lookreport {
2023-04-12 11:50:49 +08:00
left: 75%;
top: 65%;
position: absolute;
color: green;
}
2023-04-19 15:00:55 +08:00
2023-04-12 11:50:49 +08:00
}
2023-04-19 15:44:53 +08:00
2023-04-12 11:50:49 +08:00
.grade {
// width: 82px;
// height: 78px;
font-size: 70rpx;
font-family: Source Han Sans CN;
font-weight: 500;
color: #35A97A;
line-height: 67rpx;
top: 50%;
left: 40%;
position: absolute;
span {
font-size: 30rpx;
}
}
.itemback {
width: 95%;
height: 70rpx;
margin: 0 auto;
display: flex;
border-bottom: 1rpx solid #CDC9C9;
.time {
float: right;
font-size: 24rpx;
font-family: Source Han Sans CN;
font-weight: 400;
color: #9B9A9A;
line-height: 70rpx;
}
.bindtitle {
width: 500rpx;
height: 50rpx;
line-height: 70rpx;
// background-color: red;
// height: 1rpx;
font-size: 24rpx;
font-family: Source Han Sans CN;
font-weight: 400;
color: #9B9A9A;
// line-height: 48rpx;
}
}
}
}
</style>