一体机检测报告

This commit is contained in:
wuzhixi 2024-09-25 13:51:23 +08:00
parent 5cf71772ca
commit 2a38107320
5 changed files with 3267 additions and 1 deletions

View File

@ -3,7 +3,9 @@ import {
} from "/tool/index.js"
export default {
// baseUrl: 'https://syjk.yhy.ren/xcx-test/', // 测试
baseUrl: 'https://syjk.yhy.ren/xcx-api/', // 生产
//baseUrl: 'https://syjk.yhy.ren/xcx-api/', // 生产
baseUrl: 'https://health.lilinyiliao.com/xcx-api/', // 一体机报告
post(url, param) {
return this.ajax('post', url, param)

View File

@ -112,5 +112,13 @@ export default { // 所有接口
// getIntegralOrderDetailFlow: (param) => ajax.get(`order/integralOrderDetail/getIntegralOrderDetailFlow`, param), // 获取商品兑换记录
getCustomerInfoByUserId: (param) => ajax.get(`sysUser/customerWorkDept/getCustomerUserInfo`, param),
//一体机报告
//一体机
testReportList: (param) => ajax.get(`ytj-report/testReportList`, param),
//http://192.171.1.22:9206/ytj-report/testReportDetails?userId=15&familyId=1
testReportDetails: (param) => ajax.get(`ytj-report/testReportDetails`, param),
}

View File

@ -114,6 +114,20 @@
"style": {
"navigationBarTitleText": "基础评估报告"
}
},
{
"path" : "pages/machineReport/report/report",
"style" :
{
"navigationBarTitleText" : "一体机检测报告"
}
},
{
"path" : "pages/machineReport/reportDetail/reportDetail",
"style" :
{
"navigationBarTitleText" : "检测报告"
}
}
],
@ -355,6 +369,13 @@
"style": {
"navigationBarTitleText": "报告分析"
}
},
{
"path" : "reportDetail/reportDetail",
"style" :
{
"navigationBarTitleText" : ""
}
}]
}, {
"root": "pages/scanCodeEvaluation",

View File

@ -0,0 +1,316 @@
<template>
<view class="content">
<picker mode="date" fields="month" :value="endDate" :start="startDate" :end="endDate" @change="bindDateChange">
<view class="pickerView">
<view class="pickerViewTitle">{{ date }}</view>
<view class="pickerViewImg"></view>
</view>
</picker>
<!-- <view class="dd" v-for="(item,index) in week" :key="index">{{item}}</view> -->
<view v-for="(item,index) in tddrfList" :key="index" v-show="!isNoData">
<view class="itemClass" @click="itemClick(index)">
<view class="itemClassLeft">
<view class="itemClassLeftTitle">{{getTimeStr(item.dataTime,0)}}</view>
<view class="itemClassLeftValue">{{getTimeStr(item.dataTime,1)}}</view>
</view>
<view class="itemClassLine"></view>
<view class="itemClassMid">
<view class="itemClassMidTitle">体重</view>
<view class="itemClassMidValue">{{item.weight}}kg</view>
</view>
<view class="itemClassMid">
<view class="itemClassMidTitle">BMI</view>
<view class="itemClassMidValue1">
<view class="itemClassMidValue11">{{item.bmi}}</view>
<view class="itemClassMidValue1Status" :class="item.bmiResult == 1 ? 'stautsClass1' : item.bmiResult == 2 ? 'stautsClass2' : 'stautsClass3'">{{getStatusStr(item.bmiResult)}}</view>
</view>
</view>
</view>
</view>
<view class="nodataImgView" v-show="isNoData">
<image src="https://sharkbaby.yhy.ren/report/noData.png" class="nodataImg" ></image>
</view>
</view>
</template>
<script>
function getDate(type) {
const date = new Date();
let year = date.getFullYear();
let month = date.getMonth() + 1;
if (type === 'start') {
year = year - 1;
} else if (type === 'end') {
year = year;
}
month = month > 9 ? month : '0' + month;
let dateStr = year + '-' + month + '-01'
return dateStr;
}
function getDateStr() {
const date = new Date();
let year = date.getFullYear();
let month = date.getMonth() + 1;
month = month > 9 ? month : '0' + month;
let dateStr = year + '年' + month + '月';
return dateStr;
}
export default {
data() {
return {
isNoData:true,
date: getDateStr(),
startDate: getDate('start'),
endDate: getDate('end'),
userId:'15',
formeDate:[],//
tddrfList:[],
/*
tddrfList:[{
bmi:23.1,
bmiResult:1,
dataJson:'',
dataTime: "2024-09-09 13:55:41",
id: 14,
userId: 15,
weight: 45
},{
bmi:23.1,
bmiResult:1,
dataJson:'',
dataTime: "2024-09-09 13:55:41",
id: 14,
userId: 15,
weight: 45
}],//
*/
//https://sharkbaby.yhy.ren/report/noData.png
};
},
onLoad(options) {
var that = this;
that.userId = options.userId ? options.userId : '';
this.$API.testReportList({
data: {
userId: that.userId,
}
}).then(res => {
if(res.code == 200){
that.formeDate = res.data;
that.updateUI();
}
});
},
methods:{
itemClick(index){
console.log(index);
var item = this.tddrfList[index];
var userId = item.userId ? item.userId : '';
var familyId = item.id ? item.id : '';
//http://192.171.1.22:9206/ytj-report/testReportDetails?userId=15&familyId=1
var url = '/pages/yitiji/reportDetail/reportDetail?userId=' + userId + '&familyId=' + familyId;
console.log(url);
uni.navigateTo({
url: url
});
},
updateUI(){
var that = this;
var timeStr = that.date.substring(0,4) + '-' + this.date.substring(5,7);
var isData = false;
for (let i in that.formeDate) {
console.log(that.formeDate[i]);
if(that.formeDate[i].monthDate == timeStr){
isData = true;
that.tddrfList = that.formeDate[i].tddrfList;
}
}
if(!isData){
that.tddrfList = [];
that.isNoData = true;
}else{
that.isNoData = false;
}
},
getStatusStr(index){
var statusStr = '正常';
if(index == 1){
statusStr = '正常';
}
if(index == 2){
statusStr = '偏低';
}
if(index == 3){
statusStr = '偏高';
}
return statusStr;
},
bindDateChange: function(e) {
this.date = e.detail.value.substring(0,4) + '年' + e.detail.value.substring(5,7) + '月';
this.updateUI();
},
//01
getTimeStr(timeStr,index){
var time = '';
//"2024-09-09 13:55:41"
if(timeStr.length >= 19){
if(index == 0){
time = timeStr.substring(5,7) + '月' + timeStr.substring(8,10) + '日';
}
if(index == 1){
time = timeStr.substring(11,16);
}
}
return time;
},
},
}
</script>
<style lang="scss">
.stautsClass1{
background-color: #00D1A9;
}
.stautsClass2{
background-color: #00B2FF;
}
.stautsClass3{
background-color: #FFC300;
}
.content{
display: flex;
flex-direction: column;
width: 100%;
height: 100%;
background-color: #F4F5F7;
.pickerView{
margin-top: 0;
margin-left: 28rpx;
height: 80rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-items: center;
.pickerViewTitle{
color: #3F4040;
font-size: 28rpx;
line-height: 80rpx;
font-family: PingFangSC-Medium, sans-serif;
}
.pickerViewImg{
margin-left: 10rpx;
width:0;
height:0;
border-left:12rpx solid transparent;
border-right:12rpx solid transparent;
border-top:16rpx #909292 solid;
}
}
.nodataImgView{
justify-content: center;
align-items: center;
display: flex;
height: 100vh;
.nodataImg{
height: 515rpx;
width: 515rpx;
}
}
.itemClass{
margin-top: 20rpx;
margin-left: 24rpx;
margin-right: 24rpx;
width: auto;
height: 140rpx;
border-radius: 16rpx 16rpx 16rpx 16rpx;
background-color: #FFFFFF;
display: flex;
flex-direction: row;
.itemClassLeft{
display: flex;
flex-direction: column;
width: 33%;
height: 140rpx;
align-items: center;
justify-items: center;
.itemClassLeftTitle{
margin-top: 30rpx;
font-size: 28rpx;
color: #3F4040;
font-family: PingFangSC-Medium, sans-serif;
}
.itemClassLeftValue{
margin-top: 10rpx;
font-size: 26rpx;
color: #909292;
font-family: PingFangSC-Regular, sans-serif;
}
}
.itemClassLine{
margin-top: 34rpx;
height: 72rpx;
width: 1rpx;
background-color: #ECECEC;
}
.itemClassMid{
display: flex;
flex-direction: column;
width: 33%;
height: 140rpx;
align-items: center;
justify-items: center;
.itemClassMidTitle{
margin-top: 30rpx;
font-size: 22rpx;
color: #909292;
font-family: PingFangSC-Regular, sans-serif;
}
.itemClassMidValue{
margin-top: 10rpx;
font-size: 26rpx;
color: #3F4040;
font-family: PingFangSC-Medium, sans-serif;
}
.itemClassMidValue1{
margin-top: 10rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-items: center;
.itemClassMidValue11{
font-size: 26rpx;
color: #3F4040;
font-family: PingFangSC-Medium, sans-serif;
}
.itemClassMidValue1Status{
margin-top: 4rpx;
margin-left: 8rpx;
width: 54rpx;
height: 28rpx;
line-height: 28rpx;
align-content: center;
text-align: center;
border-radius: 14rpx 14rpx 14rpx 0;
font-size: 18rpx;
color: #FFFFFF;
}
}
}
}
}
</style>

File diff suppressed because it is too large Load Diff