KindergartenAppletUI/pages/home/home.vue

246 lines
5.0 KiB
Vue
Raw Normal View History

2022-08-24 15:01:04 +08:00
<template>
<view class="content">
<view class="test">幼儿体质检测记录</view>
2022-10-17 16:00:25 +08:00
<view class="title" v-if="StudentScore==0">
暂无体质检测记录
</view>
<view class="score" v-for="item in StudentScore" v-else>
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-14 17:47:45 +08:00
<!-- <view class="report" v-show="item.existFlag==false" @tap='showToast'>查看报告</view> -->
2022-10-17 16:00:25 +08:00
<!-- <u-cell class='report' v-if="item.existFlag==false" :title="aitem.title" v-for="(aitem, index) in list"
:key="index" :icon="aitem.iconUrl" @click="showToast(aitem)">
</u-cell> -->
<view class="report" style="color: #4486e8;" @tap='lookbook(item)' v-if="item.existFlag">查看报告</view>
<view class="report" @tap='showToast(item)' v-else>查看报告</view>
2022-08-24 15:01:04 +08:00
</view>
2022-10-17 16:00:25 +08:00
<u-toast ref="uToast" />
<!-- <u-cell-group title-bg-color="rgb(243, 244, 246)">
</u-cell-group> -->
2022-08-24 15:01:04 +08:00
</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,
2022-08-24 15:01:04 +08:00
yonghuwx: [],
studentId: '',
StudentScore: [],
2022-10-14 17:47:45 +08:00
show: false,
list: [{
type: 'error',
icon: false,
title: '查看报告',
message: "暂无报告",
}],
2022-08-24 15:01:04 +08:00
}
},
onLoad(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-17 16:00:25 +08:00
showToast() {
2022-10-14 17:47:45 +08:00
this.$refs.uToast.show({
2023-04-19 15:32:39 +08:00
message: '暂无报告',
2022-10-17 16:00:25 +08:00
type: 'error'
2022-10-14 17:47:45 +08:00
})
},
2022-10-08 16:52:26 +08:00
lookbook(item) {
2022-10-17 16:00:25 +08:00
uni.showLoading({
title: '获取报告中'
});
2022-10-08 16:52:26 +08:00
var that = this
2023-04-03 15:16:06 +08:00
wx.downloadFile({
2022-10-08 16:52:26 +08:00
url: baseurl + item.downloadAddress,
success: function(res) {
var filePath = res.tempFilePath;
2023-04-03 15:16:06 +08:00
wx.openDocument({
2022-10-08 16:52:26 +08:00
filePath: filePath,
showMenu: true,
success: function(res) {
2022-10-17 16:00:25 +08:00
uni.hideLoading();
2022-10-08 16:52:26 +08:00
},
fail: function(err) {
2022-10-17 16:00:25 +08:00
uni.hideLoading();
2022-10-08 16:52:26 +08:00
}
});
2023-04-03 15:16:06 +08:00
},
fail: function(err) {
uni.hideLoading();
that.$refs.uToast.show({
2023-04-19 15:32:39 +08:00
message: '请求报告失败',
2023-04-03 15:16:06 +08:00
type: 'error'
})
2022-10-08 16:52:26 +08:00
}
});
// getReportDownAddress(this.studentId, item.batchCode).then(res => {
// if (res.data.downloadAddress != null) {
// }
// })
},
2022-08-24 15:01:04 +08:00
getStudentScore() {
getStudentScore(this.studentId).then(res => {
this.StudentScore = res.data;
})
},
getPhoneNumberp(val) {
wx.login({
provider: 'weixin',
2023-04-19 15:00:55 +08:00
success: function(loginRes) {}
2022-08-24 15:01:04 +08:00
});
},
wxGetUserInfo() {
let that = this;
uni.getUserProfile({
desc: "获取用户信息",
lang: "zh_CN",
success(res) {
that.yonghuwx = res.userInfo
},
fail(res) {
//失败则返回home页面
},
});
},
},
}
</script>
2022-10-14 17:47:45 +08:00
<style lang="scss">
2022-10-17 16:00:25 +08:00
.title {
width: 80%;
margin: 0 auto;
text-align: center;
font-size: 40rpx;
color: #707374;
}
2022-10-14 17:47:45 +08:00
.u-page {
padding: 0;
}
.u-cell-group__title__text {
font-weight: bold;
height: 100rpx;
/* width: 50%; */
line-height: 100rpx;
text-align: center;
font-size: 36rpx;
}
2022-10-17 16:00:25 +08:00
2022-10-14 17:47:45 +08:00
::v-deep .u-cell__title-text {
text-align: center;
}
2022-08-24 15:01:04 +08:00
.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>