KindergartenAppletUI/pages/prescription/prescription.vue

533 lines
11 KiB
Vue
Raw Normal View History

2023-04-19 11:28:12 +08:00
<template>
2023-04-19 16:20:12 +08:00
<view class="tops" v-if="!phone||StudentScore==0">
2023-04-19 11:28:12 +08:00
<view class="zanwuchengji">
<image src="../../static/zanwuchengji.png" mode=""></image>
<view class="words">
暂无内容
</view>
</view>
</view>
<view class="top" v-else>
<view class="" v-if="StudentScore.length==1">
<view class="content">
<view class="topitemm" 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-19 11:28:12 +08:00
</view>
</view>
<view class="name">
{{item.studentName}}
</view>
<view class="grade">
2023-04-19 14:25:28 +08:00
{{item.totalFraction}}
2023-04-19 11:28:12 +08:00
<span></span>
</view>
2023-04-19 15:00:55 +08:00
<view class="baogao" @tap='lookbook(item)'>
2023-04-19 11:28:12 +08:00
<view class="image">
</view>
2023-04-19 15:00:55 +08:00
<view class="look" v-if="item.existFlag==false">暂无报告</view>
<view class="lookreport" v-else>查看报告</view>
2023-04-19 11:28:12 +08:00
</view>
</view>
<view class="prescription" v-if="studentInfoList==0">
<view class="exerciseitem">
<view class="zanwu">
<image src="../../static/zanwu.png" mode=""></image>
</view>
</view>
</view>
<view class="prescription" v-for="item in studentInfoList" v-else>
<view class="sportsitem">
<view class="sports">
{{item.motionType}}
</view>
</view>
<view class="exerciseitem">
<view class="exercise">
运动程度
</view>
<view class="gradeitem">
{{item.degreeMovement}}
</view>
<view class="exercise">
测试分类
</view>
<view class="gradeitem">
{{item.physicalQualityName}}
</view>
</view>
<view class="Motion ">
<view class="sport">
<span>运动频率</span>
{{item.motionFrequency}}
</view>
<view class="sport">
<span>运动强度</span>
{{item.motionStrength}}
</view>
<view class="sport">
<span>运动时间</span>
{{item.motionTime}}
</view>
<view class="sport">
<span>运动量</span>
{{item.motionCapacity}}
</view>
</view>
<view class="Advanced">
<view class="Advancedtime">
<span>进阶时间可选择</span>
{{item.advancedTime}}
</view>
<view class="Advancedtime">
<span>进阶方案</span>
{{item.advancedScheme}}
</view>
<view class="videoitem">
<video v-for="uitem in item.motionPrescriptionVideoInfoVOList"
:src="uitem.prescriptionVideoUrl" :autoplay="false" @tap='look(uitem)'></video>
</view>
</view>
</view>
</view>
</view>
<view class="content" v-else>
<view class="topitemm" 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-19 11:28:12 +08:00
</view>
</view>
<view class="name">
{{item.studentName}}
</view>
<view class="grade">
2023-04-19 14:25:28 +08:00
{{item.totalFraction}}
2023-04-19 11:28:12 +08:00
<span></span>
</view>
2023-04-19 15:00:55 +08:00
<view class="baogao" @tap='lookbooklist(item)'>
2023-04-19 11:28:12 +08:00
<view class="image">
</view>
2023-04-19 15:00:55 +08:00
<view class="lookreport">查看处方</view>
2023-04-19 11:28:12 +08:00
</view>
</view>
</view>
<u-toast ref="uToast" />
</view>
</template>
<script>
import {
getStudentScore,
getChildrenResultScore,
getMotionPrescription,
getInfoByPhone,
prescriptionVideoLogging,
prescriptionLogging
} from '@/api/index/index.js'
import baseurl from '@/api/baseurl.js'
export default {
data() {
return {
motionPrescriptionVideoInfoVOList: [],
list: [],
show: false,
StudentScore: [],
studentInfoList: [],
studentIditem: [],
getchildlist: [],
batchCode: "",
phone: "",
studentList: [],
}
},
onShow() {
let that = this;
2023-04-20 10:46:23 +08:00
this.phone = uni.getStorageSync('phone');
2023-04-20 11:09:24 +08:00
if (this.phone) {
getInfoByPhone(this.phone).then(res => {
if (res.code == 200) {
var obj = {
studentIdList: []
}
res.data.studentInfoList.forEach(e => {
obj.studentIdList.push(e.studentId)
})
let items = JSON.stringify(res.data);
uni.setStorageSync("this.DATAList", items)
getChildrenResultScore(obj).then(res => {
this.StudentScore = res.data
if (this.StudentScore.length == 1) {
getMotionPrescription(res.data[0].studentId, res.data[0].batchCode).then(
res => {
this.studentInfoList = res.data
this.studentInfoList.forEach(e => {
e.motionPrescriptionVideoInfoVOList.forEach(el => {
el.count = 0
el.prescriptionVideoUrl = baseurl + el
.prescriptionVideoUrl
})
2023-04-20 10:46:23 +08:00
})
})
2023-04-20 11:09:24 +08:00
this.infolist();
}
})
} else {}
})
} else {
uni.navigateTo({
url: '/pages/index/index'
})
}
2023-04-19 11:28:12 +08:00
},
methods: {
look(uitem) {
2023-04-19 16:49:42 +08:00
if (uitem.count == 0) {
uitem.count++
const items = JSON.parse(uni.getStorageSync("this.DATAList"));
items["prescriptionVideoId"] = uitem.motionPrescriptionVideoId
prescriptionVideoLogging(items).then(res => {})
}
2023-04-19 11:28:12 +08:00
},
lookbook(item) {
2023-04-19 15:00:55 +08:00
if (item.existFlag == false) {
this.$refs.uToast.show({
2023-08-04 14:09:59 +08:00
message: "暂无报告",
2023-04-19 15:00:55 +08:00
type: 'error',
duration: 1000
})
} else {
uni.showLoading({
2023-08-04 14:09:59 +08:00
message: '获取报告中'
2023-04-19 15:00:55 +08:00
});
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-08-04 14:09:59 +08:00
message: '请求报告失败',
2023-04-19 15:00:55 +08:00
type: 'error'
})
}
});
}
2023-04-19 11:28:12 +08:00
},
infolist() {
const items = uni.getStorageSync("this.DATAList");
2023-04-19 15:00:55 +08:00
prescriptionLogging(items).then(res => {})
2023-04-19 11:28:12 +08:00
},
lookbooklist(item) {
getMotionPrescription(item.studentId, item.batchCode).then(res => {
this.studentInfoList = res.data
uni.navigateTo({
url: `/pages/Viewprescription/Viewprescription?studentId=${item.studentId}&batchCode=${item.batchCode}`
})
})
},
}
}
</script>
<style lang="scss">
2023-04-19 16:20:12 +08:00
.tops {
2023-04-19 11:28:12 +08:00
position: relative;
.zanwuchengji {
width: 374rpx;
2023-04-19 16:20:12 +08:00
height: 100vh;
2023-04-19 11:28:12 +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-19 11:28:12 +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-19 11:28:12 +08:00
}
}
}
.top {
background-image: linear-gradient(#D7EEE8, #fff);
width: 100%;
height: 600rpx;
.content {
width: 100%;
height: 376rpx;
background: #37A97B;
position: relative;
2023-04-19 16:49:42 +08:00
padding-top: 20rpx;
2023-04-19 11:28:12 +08:00
.prescription {
width: 90%;
background: #FFFFFF;
box-shadow: 0rpx 3rpx 18rpx 0rpx rgba(161, 220, 211, 0.43);
border-radius: 10rpx;
margin: 0 auto;
margin-top: 3%;
.Advanced {
line-height: 48rpx;
padding: 3%;
margin: 15rpx auto;
width: 90%;
// background-color: red;
background: #F9F9FA;
border-radius: 10rpx;
.videoitem {
display: flex;
width: 100%;
2023-04-19 11:51:54 +08:00
flex-wrap: wrap;
2023-04-19 11:28:12 +08:00
video {
2023-04-19 15:00:55 +08:00
width: 47%;
margin-left: 3%;
height: 194rpx;
2023-04-19 11:28:12 +08:00
}
}
.Advancedtime {
font-size: 26rpx;
span {
font-family: Source Han Sans CN;
font-weight: 500;
color: #000000;
}
}
}
.Motion {
// width: 665rpx;
height: 227rpx;
background: #F9F9FA;
border-radius: 10rpx;
width: 90%;
padding: 2%;
margin: 0 auto;
.sport {
width: 585rpx;
font-size: 26rpx;
line-height: 48rpx;
span {
font-family: Source Han Sans CN;
font-weight: 500;
}
}
}
.exerciseitem {
display: flex;
margin: 3%;
.zanwu {
margin: 0 auto;
image {
width: 200rpx;
height: 200rpx;
}
}
.exercise {
width: 130rpx;
height: 41rpx;
margin-left: 5%;
background: #35A97A;
border-radius: 5rpx;
color: white;
font-size: 26rpx;
text-align: center;
}
.gradeitem {
margin-left: 2%;
font-size: 26rpx;
color: #000000;
font-family: Source Han Sans CN;
font-weight: 500;
}
}
.sportsitem {
width: 90%;
2023-04-20 11:27:30 +08:00
height: 80rpx;
2023-04-19 11:28:12 +08:00
margin: 0 auto;
display: flex;
padding: 2%;
border-bottom: 1rpx solid #E6E6E6;
.sports {
font-size: 30rpx;
font-family: Source Han Sans CN;
font-weight: 500;
color: #000000;
margin-top: 2%;
margin-left: 3%;
}
.xuhao {
margin-top: 3%;
width: 34rpx;
height: 34rpx;
background: #35A97A;
border-radius: 50%;
color: #FFFFFF;
margin-left: 2%;
line-height: 34rpx;
text-align: center;
}
}
}
.topitemm {
background: #fff;
box-shadow: 0px 3px 18px 0px rgba(182, 218, 213, 0.43);
width: 90%;
2023-04-19 15:46:58 +08:00
margin: 0 auto 20rpx;
height: 320rpx;
2023-04-19 11:28:12 +08:00
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;
}
.lookreport {
left: 75%;
top: 65%;
position: absolute;
color: green;
}
}
.grade {
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 {
2023-08-17 16:22:33 +08:00
width: 470rpx;
2023-04-19 11:28:12 +08:00
height: 50rpx;
line-height: 70rpx;
font-size: 24rpx;
font-family: Source Han Sans CN;
font-weight: 400;
color: #9B9A9A;
}
}
}
}
}
</style>