KindergartenAppletUI/pages/home/home.vue

192 lines
4.0 KiB
Vue
Raw Normal View History

2022-08-24 15:01:04 +08:00
<template>
<view class="content">
<view class="test">幼儿体质检测记录</view>
<view class="score" v-for="item in StudentScore">
2022-08-29 17:11:09 +08:00
<view class="">
<view class="itemName">批次名称{{item.batchName}}</view>
2022-08-24 15:01:04 +08:00
</view>
<view class="th">
<view class="overallScore">综合得分{{item.totalFraction}}</view>
2022-10-08 16:52:26 +08:00
<view class="time">时间{{item.createTime}}</view>
2022-08-24 15:01:04 +08:00
</view>
2022-10-08 16:52:26 +08:00
<view class="report" v-show="item.existFlag==false">查看报告</view>
<view class="report" style="color: #4486e8;" @tap='lookbook(item)' v-show="item.existFlag">查看报告</view>
<u-loading-page :loading="loading" loading-text="正在打开报告" loading-mode="semicircle"></u-loading-page>
2022-08-24 15:01:04 +08:00
</view>
</view>
</template>
<script>
import {
2022-10-08 16:52:26 +08:00
getStudentScore,
getReportDownAddress
2022-08-24 15:01:04 +08:00
} from '@/api/index/index.js'
2022-10-08 16:52:26 +08:00
import baseurl from '@/api/baseurl.js'
2022-08-24 15:01:04 +08:00
export default {
data() {
return {
2022-10-08 16:52:26 +08:00
show: false,
loading: false,
2022-08-24 15:01:04 +08:00
yonghuwx: [],
studentId: '',
StudentScore: [],
}
},
onLoad(options) {
console.log(options)
2022-08-26 17:51:21 +08:00
this.studentId = options.studentId
2022-08-24 15:01:04 +08:00
this.getStudentScore()
},
methods: {
2022-10-08 16:52:26 +08:00
lookbook(item) {
console.log(item)
this.loading = true
var that = this
uni.downloadFile({
url: baseurl + item.downloadAddress,
success: function(res) {
var filePath = res.tempFilePath;
uni.openDocument({
filePath: filePath,
showMenu: true,
success: function(res) {
that.loading = false
},
fail: function(err) {
that.loading = false
}
});
}
});
// getReportDownAddress(this.studentId, item.batchCode).then(res => {
// console.log(res)
// if (res.data.downloadAddress != null) {
// }
// })
},
2022-08-24 15:01:04 +08:00
getStudentScore() {
getStudentScore(this.studentId).then(res => {
console.log((res))
this.StudentScore = res.data;
})
},
getPhoneNumberp(val) {
wx.login({
provider: 'weixin',
success: function(loginRes) {
console.log(loginRes)
}
});
},
wxGetUserInfo() {
let that = this;
uni.getUserProfile({
desc: "获取用户信息",
lang: "zh_CN",
success(res) {
console.log(res)
that.yonghuwx = res.userInfo
},
fail(res) {
//失败则返回home页面
},
});
},
},
}
</script>
<style>
.content {
display: flex;
flex-direction: column;
align-items: center;
background-color: #ffffff;
min-height: 100vh;
2022-08-26 17:51:21 +08:00
background-image: linear-gradient(#55C5E3, #fff);
2022-08-24 15:01:04 +08:00
}
/* 测试成绩 */
.test {
width: 380rpx;
height: 104rpx;
line-height: 104rpx;
font-size: 40rpx;
/* background-color: #ffffff; */
color: #4486e8;
border-radius: 30%;
margin-top: 80rpx;
text-align: center;
margin-bottom: 50rpx;
2022-08-25 09:57:30 +08:00
2022-08-24 15:01:04 +08:00
}
.score {
/* position: absolute; */
width: 700rpx;
2022-08-29 17:11:09 +08:00
height: 306rpx;
2022-08-24 15:01:04 +08:00
background-color: #eef9fc;
2022-08-29 17:11:09 +08:00
/* background-color: red; */
2022-08-24 15:01:04 +08:00
color: #707374;
2022-08-29 17:11:09 +08:00
margin-bottom: 70rpx;
2022-08-24 15:01:04 +08:00
border-radius: 20rpx;
2022-08-29 17:11:09 +08:00
font-size: 33rpx;
2022-08-24 15:01:04 +08:00
}
2022-08-26 17:51:21 +08:00
2022-08-24 15:01:04 +08:00
.itemName {
height: 100rpx;
2022-08-29 17:11:09 +08:00
/* width: 50%; */
/* border-right: lightsteelblue 2rpx solid; */
line-height: 55px;
2022-08-24 15:01:04 +08:00
/* padding-bottom: 15px; */
border-bottom: lightsteelblue 2rpx solid;
text-align: center;
2022-08-29 17:11:09 +08:00
/* padding-left: 40rpx; */
2022-08-24 15:01:04 +08:00
}
2022-08-29 17:11:09 +08:00
.overallScore {
2022-08-24 15:01:04 +08:00
height: 100rpx;
width: 50%;
2022-08-29 17:11:09 +08:00
border-right: lightsteelblue 2rpx solid;
2022-08-24 15:01:04 +08:00
line-height: 100rpx;
/* padding-bottom: 15px; */
border-bottom: lightsteelblue 2rpx solid;
text-align: center;
2022-08-29 17:11:09 +08:00
padding-left: 40rpx;
2022-10-08 16:52:26 +08:00
2022-08-24 15:01:04 +08:00
}
2022-10-08 16:52:26 +08:00
2022-08-29 17:11:09 +08:00
.time {
2022-08-24 15:01:04 +08:00
height: 100rpx;
width: 50%;
line-height: 100rpx;
2022-08-29 17:11:09 +08:00
border-bottom: lightsteelblue 2rpx solid;
2022-08-24 15:01:04 +08:00
text-align: center;
2022-08-29 17:11:09 +08:00
/* border-right: lightsteelblue 2rpx solid; */
/* background-color: #4486e8; */
/* float: left; */
2022-08-24 15:01:04 +08:00
}
2022-10-08 16:52:26 +08:00
2022-08-24 15:01:04 +08:00
.report {
height: 100rpx;
2022-08-29 17:11:09 +08:00
/* width: 50%; */
2022-08-24 15:01:04 +08:00
line-height: 100rpx;
text-align: center;
2022-08-29 17:11:09 +08:00
/* border-bottom: lightsteelblue 2rpx solid; */
/* margin-top: 100rpx; */
2022-08-24 15:01:04 +08:00
}
2022-10-08 16:52:26 +08:00
2022-08-29 17:11:09 +08:00
2022-08-24 15:01:04 +08:00
.th {
/* background-color: orange; */
display: flex;
justify-content: flex-start;
/* border-top:lightsteelblue 1px solid; */
}
</style>