master
rongweikang 2 years ago
parent f1105a54db
commit 91de12d009

@ -47,16 +47,7 @@ export default class PopupClock extends Component<any, any> {
onConfirm = () => { onConfirm = () => {
let { type } = this.props; let { type } = this.props;
switch (type) {
case "1": // 未注册
go("/pages/register/register");
break;
case "2": // 登录过期
go("/pages/login/login");
break;
case "3": // 前端提示-关注公众号
break;
}
this.props.confirm(); this.props.confirm();
}; };

@ -1,10 +1,11 @@
import Taro from "@tarojs/taro"; import Taro from "@tarojs/taro";
import classNamenames from "classNamenames"; import classnames from "classnames";
import { Component, PropsWithChildren, useEffect, useState } from "react"; import { Component, PropsWithChildren, useEffect, useState } from "react";
import { Progress } from '@antmjs/vantui' import { Progress } from '@antmjs/vantui'
import { Block, View, Text, Image, Input, Button } from "@tarojs/components"; import { Block, View, Text, Image, Input, Button } from "@tarojs/components";
import { date, getdates, previewImage } from "../../utils/util";
/** 自定义组件 **/ /** 自定义组件 **/
import Navbar from "../../components/navbar/navbar"; import Navbar from "../../components/navbar/navbar";
import PopupAlert from "../../components/popup/popup-alert"; import PopupAlert from "../../components/popup/popup-alert";
@ -18,7 +19,9 @@ export default class Index extends Component<any, any> {
super(props); super(props);
this.state = { this.state = {
name: "template模板页", name: "template模板页",
statistics: {},
recordList: [],
recordData: {}
}; };
} }
@ -26,10 +29,60 @@ export default class Index extends Component<any, any> {
componentWillUnmount() { } componentWillUnmount() { }
// 查询用户护理记录的当月统计信息
async getStatistics(id) {
let data = {}
if (id != null) {
data['instrumentId'] = id
}
let res = await InstrumentInfo.apiNursingLog.getStatistics(data)
if (res.data.code === 200) {
this.setState({ statistics: res.data.data })
}
}
async getRecord(id, recordId) {
let data = {}
if (id != null) {
data['instrumentId'] = id
}
let res = await InstrumentInfo.apiNursingLog.getRecord(data)
if (res.data.code === 200) {
res.data.rows.map(item => {
item.nursingTime = this.getTime(item.nursingTime)
item.createTime = getdates(item.createTime).replace(/-/g, '.')
if (item.id == recordId) {
this.setState({ recordData: item })
}
})
this.setState({ recordList: res.data.rows.filter(item => item.id != recordId) })
}
}
getRouteId() {
const searchParams = new URLSearchParams(window.location.search);
const id = searchParams.get('id');
const recordId = searchParams.get('recordId');
this.getStatistics(id)
this.getRecord(id, recordId)
console.log(recordId);
}
getTime(time) {
const hour = time.slice(0, 2);
const minute = time.slice(3, 5);
const second = time.slice(6, 8);
if (hour > 0) {
return hour + '时' + minute + '分' + second + '秒'
} else {
return minute + '分' + second + '秒'
}
}
async onLoad() { async onLoad() {
this.getClockStatistics() this.getRouteId()
} }
componentDidShow() { } componentDidShow() { }
@ -39,7 +92,7 @@ export default class Index extends Component<any, any> {
async initData() { } async initData() { }
render() { render() {
let { name } = this.state; let { name, statistics, recordList, recordData } = this.state;
return ( return (
<Block> <Block>
<Navbar isBack titleSlot='护理报告'></Navbar> <Navbar isBack titleSlot='护理报告'></Navbar>
@ -71,7 +124,7 @@ export default class Index extends Component<any, any> {
{/* <block wx:if="{{ reportData.instrument_type == 4 || reportData.instrument_type == 5 }}"> */} {/* <block wx:if="{{ reportData.instrument_type == 4 || reportData.instrument_type == 5 }}"> */}
<View className='statistic_item'> <View className='statistic_item'>
<View className='statistic_title'> <View className='statistic_title'>
<text>8</text> <text>{statistics.nursingNum}</text>
<text className='num'></text> <text className='num'></text>
</View> </View>
<View className='statistic_desc'> <View className='statistic_desc'>
@ -79,7 +132,7 @@ export default class Index extends Component<any, any> {
</View> </View>
</View> </View>
<View className='statistic_item'> <View className='statistic_item'>
<View className='statistic_title'>28:00</View> <View className='statistic_title'>{statistics.nursingTime}</View>
<View className='statistic_desc'></View> <View className='statistic_desc'></View>
</View> </View>
{/* </block> */} {/* </block> */}
@ -88,55 +141,63 @@ export default class Index extends Component<any, any> {
{/* <block wx:if="{{ reportData.instrument_type !== 4 && reportData.instrument_type !== 5 }}"> */} {/* <block wx:if="{{ reportData.instrument_type !== 4 && reportData.instrument_type !== 5 }}"> */}
<View className='products_item' style='border: none'> <View className='products_item' style='border: none'>
<View className='products_top flex aitems'> <View className='products_top flex aitems'>
<View className='add_time'>2024.01.15</View> <View className='add_time'>{recordData.createTime}</View>
<View className="{{reportData.nurseLog.online === 2 ? 'tag tag_active' : 'tag'}}">线</View> <View className={classnames("tag", {
tag_active: recordData.online === 2,
})}
>{recordData.online == 1 ? '在线' : '离线'}</View>
</View> </View>
<View className='products_middle flex'> <View className='products_middle flex'>
<Image className='cover' src={require('../../img/test/1706667011027.jpg')} mode='aspectFill'></Image> <Image className='cover' src={recordData.modeImage} mode='aspectFill'></Image>
<View className='content'> <View className='content'>
<View className='content_top'> <View className='content_top'>
<View className='title'></View> <View className='title'>{recordData.instrumentName}</View>
<View className='desc_box'> <View className='desc_box'>
<View className='desc'></View> <View className='desc'>{recordData.modeName}</View>
<View className='desc'>10:00</View> <View className='desc'>{recordData.nursingTime}</View>
</View> </View>
</View> </View>
<View className='progress'> <View className='progress'>
<Progress percentage='80' strokeWidth='12' pivotText='' color='linearGradient(to right, #eecda1, #ffe9c7) !important' /> <Progress percentage={recordData.completionPercentage * 100} strokeWidth='12' color='linearGradient(to right, #eecda1, #ffe9c7) !important' />
<View className='percent'> 80%</View> <View className='percent'> {recordData.completionPercentage * 100}%</View>
</View> </View>
</View> </View>
</View> </View>
</View> </View>
<View className='main_title' ></View> <View className='main_title' ></View>
<View className='products_item'> {recordList.map(item => (
<View className='products_item' style='border: none' key={item.id}>
<View className='products_top flex aitems'> <View className='products_top flex aitems'>
<View className='add_time'>2024.01.01</View> <View className='add_time'>{item.createTime}</View>
<View className="{{item.online === 2 ? 'tag tag_active' : 'tag'}}">线</View> <View className={classnames("tag", {
tag_active: item.online === 2,
})}
>{item.online == 1 ? '在线' : '离线'}</View>
</View> </View>
<View className='products_middle flex'> <View className='products_middle flex'>
<Image className='cover' src={require('../../img/test/1706667011027.jpg')} mode='aspectFill'></Image> <Image className='cover' src={item.modeImage} mode='aspectFill'></Image>
<View className='content'> <View className='content'>
<View className='content_top'> <View className='content_top'>
<View className='title'></View> <View className='title'>{item.instrumentName}</View>
<View className='desc_box'> <View className='desc_box'>
<View className='desc'></View> <View className='desc'>{item.modeName}</View>
<View className='desc'>10:00</View> <View className='desc'>{item.nursingTime}</View>
</View> </View>
</View> </View>
<View className='progress'> <View className='progress'>
<Progress percentage='80' strokeWidth='12' pivotText='' color='linearGradient(to right, #eecda1, #ffe9c7) !important' /> <Progress percentage={item.completionPercentage * 100} strokeWidth='12' color='linearGradient(to right, #eecda1, #ffe9c7) !important' />
<View className='percent'> 80%</View> <View className='percent'> {item.completionPercentage * 100}%</View>
</View> </View>
</View> </View>
</View> </View>
</View> </View>
))}
{/* </block> */} {/* </block> */}
{/* <block wx:if="{{ reportData.instrument_type == 4 || reportData.instrument_type == 5 }}"> */} {/* <block wx:if="{{ reportData.instrument_type == 4 || reportData.instrument_type == 5 }}"> */}
<View className='products_item' style='border: none'> {/* <View className='products_item' style='border: none'>
<View className='products_top flex aitems'> <View className='products_top flex aitems'>
<View className='add_time'>2024.01.01</View> <View className='add_time'>2024.01.01</View>
<View className="{{reportData.online === 2 ? 'tag tag_active' : 'tag'}}">线</View> <View className="{{reportData.online === 2 ? 'tag tag_active' : 'tag'}}">线</View>
@ -159,8 +220,8 @@ export default class Index extends Component<any, any> {
</View> </View>
</View> </View>
</View> </View> */}
<View className='main_title' ></View> {/* <View className='main_title' ></View>
<View className='products_item' > <View className='products_item' >
<View className='products_top flex aitems'> <View className='products_top flex aitems'>
<View className='add_time'>2024.01.01</View> <View className='add_time'>2024.01.01</View>
@ -183,7 +244,7 @@ export default class Index extends Component<any, any> {
</View> </View>
</View> </View>
</View> </View>
</View> </View> */}
{/* </block> */} {/* </block> */}
</View> </View>
@ -191,7 +252,7 @@ export default class Index extends Component<any, any> {
<View className='btn'></View> <View className='btn'></View>
<View className='text flex aitems'> <View className='text flex aitems'>
<View></View> <View></View>
<Image src='/img/right.png' mode='aspectFill'></Image> <Image src='../../img/right.png' mode='aspectFill'></Image>
</View> </View>
</View> </View>

@ -209,31 +209,29 @@ page {
.info1, .info1,
.info2 { .info2 {
.block1 { .block1 {
// width: 300rpx;
// height: 160rpx;
flex-direction: column; flex-direction: column;
display: inline-block; display: inline-block;
height: 100%; height: 100%;
text-align: center; text-align: center;
.block1_1 { .block1_1 {
height: 100%; height: 100%;
padding: 0 20rpx;
flex-direction: column; flex-direction: column;
width: 134rpx;
} }
} }
.info1_img { .info1_img {
width: 140rpx; width: 140rpx;
height: 140rpx; height: 140rpx;
margin-right: 10rpx;
border-radius: 20rpx; border-radius: 20rpx;
overflow: hidden; overflow: hidden;
margin-left: 6rpx;
image { image {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
} }
.tip1 { .tip1 {
margin-top: 33rpx; margin-top: 20rpx;
font-size: 26rpx; font-size: 26rpx;
font-weight: bold; font-weight: bold;
color: #000000; color: #000000;
@ -242,14 +240,14 @@ page {
font-size: 24rpx; font-size: 24rpx;
font-weight: 400; font-weight: 400;
color: #666666; color: #666666;
margin-top: 15rpx; margin-top: 8rpx;
} }
.quan1 { .quan1 {
border-radius: 50%; border-radius: 50%;
border: 3rpx solid #f1f1f1; border: 3rpx solid #f1f1f1;
width: 30rpx; width: 30rpx;
height: 30rpx; height: 30rpx;
margin-top: 21rpx; margin-top: 15rpx;
&.is-select { &.is-select {
display: flex; display: flex;
background-color: #fff; background-color: #fff;
@ -270,6 +268,13 @@ page {
} }
} }
.modebox {
height: 160rpx;
border-radius: 30rpx;
padding: 10rpx;
box-sizing: border-box;
}
.popbox { .popbox {
display: flex; display: flex;
flex-direction: column; flex-direction: column;

@ -20,11 +20,13 @@ import PopupInstrumentUploadTips from "@/components/popup/popup-instrument-uploa
import { InstrumentInfo } from "@/utils/Interface"; import { InstrumentInfo } from "@/utils/Interface";
import "./index.less";
import { contraction, getImgInfo } from "@/utils/compressImage"; import { contraction, getImgInfo } from "@/utils/compressImage";
import PopupAlert from "@/components/popup/popup-alert"; import PopupAlert from "@/components/popup/popup-alert";
import { setStorageSync, getStorageSync, msg } from "@/utils/traoAPI"; import { setStorageSync, getStorageSync, msg } from "@/utils/traoAPI";
import "./index.less";
export default class InstrumentClickInUpload extends Component<any, any> { export default class InstrumentClickInUpload extends Component<any, any> {
constructor(props) { constructor(props) {
super(props); super(props);
@ -34,11 +36,11 @@ export default class InstrumentClickInUpload extends Component<any, any> {
month: String(new Date().getMonth() + 1).padStart(2, "0"), month: String(new Date().getMonth() + 1).padStart(2, "0"),
day: String(new Date().getDate()).padStart(2, "0"), day: String(new Date().getDate()).padStart(2, "0"),
zkmoshiindex: 0, zkmoshiindex: 0,
moshiindex: null, modeIndex: null,
buzhouindex: null, stepIndex: null,
autoplay: false, autoPlay: false,
scrollleft: 0, scrollleft: 0,
sysinfo: Taro.getSystemInfoSync(), sysInfo: Taro.getSystemInfoSync(),
showVideoPlayBtn: true, showVideoPlayBtn: true,
duration: 0, duration: 0,
@ -87,10 +89,13 @@ export default class InstrumentClickInUpload extends Component<any, any> {
this.setState({ instrumentDetail }); this.setState({ instrumentDetail });
} }
const searchParams = new URLSearchParams(window.location.search);
const id = searchParams.get('id');
setTimeout(() => { setTimeout(() => {
this.firstNurseInfo(); this.firstNurseInfo();
this.getLatestClockRecord(); this.getLatestClockRecord();
this.modeInfoList(); this.modeInfoList(id);
}, 10); }, 10);
} }
@ -121,7 +126,7 @@ export default class InstrumentClickInUpload extends Component<any, any> {
this.setState({ punchInInfo }); this.setState({ punchInInfo });
}; };
// 获取仪器模式列表 // 获取仪器模式列表
modeInfoList = async () => { modeInfoList = async (id) => {
let res = await InstrumentInfo.modeInfoList({ let res = await InstrumentInfo.modeInfoList({
instrumentId: "84", instrumentId: "84",
}); });
@ -287,116 +292,124 @@ export default class InstrumentClickInUpload extends Component<any, any> {
nurseInfo, nurseInfo,
isModeLock, isModeLock,
isSubmit, isSubmit,
year,
month,
day,
modeIndex,
stepIndex,
autoPlay,
sysInfo,
clockContent,
} = this.state; } = this.state;
return ( return (
<Block> <Block>
<Navbar titleSlot="打卡上传" isBack={true} /> <Navbar titleSlot='打卡上传' isBack />
<Canvas <Canvas
style="height: 0" style='height: 0'
id="compressImage" id='compressImage'
canvasId="compressImage" canvasId='compressImage'
type="2d" type='2d'
></Canvas> ></Canvas>
<PopupAlert <PopupAlert
isShow={isModeLock} isShow={isModeLock}
title="提示" title='提示'
content="该模式即将上线,敬请期待" content='该模式即将上线,敬请期待'
confirmButtonText="知道了" confirmButtonText='知道了'
textAlgin="center" textAlgin='center'
isClose={false} isClose={false}
close={this.onModeLockClose} close={this.onModeLockClose}
confirm={this.onModeLockClose} confirm={this.onModeLockClose}
/> />
<PopupInstrumentUploadTips <PopupInstrumentUploadTips
isShow={isTipShow} isShow={isTipShow}
title="打卡介绍" title='打卡介绍'
data={nurseInfo} data={nurseInfo}
close={this.onTipShowClose} close={this.onTipShowClose}
confirm={this.onTipShowClose} confirm={this.onTipShowClose}
/> />
<View className="infobox1 flex aitems jcenter"> <View className='infobox1 flex aitems jcenter'>
<View className="img"> <View className='img'>
<Video <Video
src={currentInfo.modeVideo} src={currentInfo.modeVideo}
id="myVideo" id='myVideo'
enableProgressGesture={false} enableProgressGesture={false}
controls={true} controls
// autoplay={false} // autoplay={false}
direction={0} direction={0}
loop={false} loop={false}
showMuteBtn={true} showMuteBtn
referrerPolicy="origin" referrerPolicy='origin'
onTimeUpdate={this.videoBindTimeUpdate} onTimeUpdate={this.videoBindTimeUpdate}
onEnded={this.videoEnded} onEnded={this.videoEnded}
onPause={this.videoPause} onPause={this.videoPause}
onPlay={this.videoPlay} onPlay={this.videoPlay}
showCenterPlayBtn={false} showCenterPlayBtn={false}
onLoadedMetaData={this.videoLoadedMetaData} onLoadedMetaData={this.videoLoadedMetaData}
style="width: 100%; height: 100%;border-radius: 30rpx;" style='width: 100%; height: 100%;border-radius: 30rpx;'
/> />
{showVideoPlayBtn && ( {showVideoPlayBtn && (
<View className="video-cover"> <View className='video-cover'>
<Image <Image
className="video-cover-icon" className='video-cover-icon'
src={require("../../img/fr200/play.png")} src={require("../../img/fr200/play.png")}
onClick={this.onPlayTap} onClick={this.onPlayTap}
></Image> ></Image>
{duration && ( {duration && (
<View className="video-cover-time">{duration}</View> <View className='video-cover-time'>{duration}</View>
)} )}
</View> </View>
)} )}
</View> </View>
</View> </View>
<View className="infobox3"> <View className='infobox3'>
<ScrollView <ScrollView
style="white-space: nowrap; height: 100%;" style='white-space: nowrap; height: 100%;'
scroll-x={true} scroll-x
scroll-left={scrollleft} scroll-left={scrollleft}
> >
{modeInfo.map((item, index) => { {modeInfo.map((item, index) => {
return ( return (
<View <View
className="info1" className='info1'
onClick={this.bindMoshi.bind(this, index)} onClick={this.bindMoshi.bind(this, index)}
key={index} key={index}
> >
<View <View
className="flex aitems" className='flex aitems modebox'
style="height: 100%; {{zkmoshiindex == index ? 'background: linear-gradient(90deg, #EFDCC2, #FFF2DF)': ''}}" style={{height: '100%', background: zkmoshiindex == index ?'linear-gradient(90deg, #EFDCC2, #FFF2DF)': ''}}
> >
<View className="block1"> <View className='block1'>
<View <View
className="block1_1 flex aitems " className='block1_1 flex aitems '
style="min-width: 80rpx" style='min-width: 80rpx'
> >
<View className="tip1">{item.modeName}</View> <View className='tip1'>{item.modeName}</View>
<View className="tip2">{item.modeDesc}</View> <View className='tip2'>{item.modeDesc}</View>
{!item.lock && zkmoshiindex !== index && ( {!item.lock && zkmoshiindex !== index && (
<View className="quan1"></View> <View className='quan1'></View>
)} )}
{!item.lock && zkmoshiindex == index && ( {!item.lock && zkmoshiindex == index && (
<View className="quan1 is-select flex aitems jcenter"> <View className='quan1 is-select flex aitems jcenter'>
<View className="quan2"></View> <View className='quan2'></View>
</View> </View>
)} )}
{item.lock && ( {item.lock && (
<View className="icon"> <View className='icon'>
<Image <Image
src="/img/fr200/suo.png" src='/img/fr200/suo.png'
mode="aspectFill" mode='aspectFill'
></Image> ></Image>
</View> </View>
)} )}
</View> </View>
</View> </View>
{item.modeBanner && ( {item.modeBanner && index == zkmoshiindex &&(
<View className="info1_img"> <View className='info1_img'>
<Image src={item.modeBanner} mode="aspectFill" /> <Image src={item.modeBanner} mode='aspectFill' />
</View> </View>
)} )}
</View> </View>
@ -406,32 +419,32 @@ export default class InstrumentClickInUpload extends Component<any, any> {
</ScrollView> </ScrollView>
</View> </View>
<View className="infobox2"> <View className='infobox2'>
<View className="infobox2_info"> <View className='infobox2_info'>
<View className="info4"> <View className='info4'>
<View className="upload_header flex aitems sb"> <View className='upload_header flex aitems sb'>
<View className="upload_title"></View> <View className='upload_title'></View>
<View className="icon" onClick={this.onTipShowOpen}> <View className='icon' onClick={this.onTipShowOpen}>
<Image <Image
src={require("../../img/clock_in_upload/info.png")} src={require("../../img/clock_in_upload/info.png")}
mode="aspectFill" mode='aspectFill'
></Image> ></Image>
</View> </View>
</View> </View>
<View className="imgbox flex aitems"> <View className='imgbox flex aitems'>
{punchInInfo.clockImageList.length > 0 && {punchInInfo.clockImageList.length > 0 &&
punchInInfo.clockImageList.map((item, index) => { punchInInfo.clockImageList.map((item, index) => {
return ( return (
<View className="img" key={"clickin_" + index}> <View className='img' key={"clickin_" + index}>
<Image src={item}></Image> <Image src={item}></Image>
<View <View
className="close flex aitems jcenter" className='close flex aitems jcenter'
data-index="{{index}}" data-index='{{index}}'
onClick={this.handleDeleteImage} onClick={this.handleDeleteImage}
> >
<Image <Image
src={require("../../img/fr200/close_white.png")} src={require("../../img/fr200/close_white.png")}
mode="widthFix" mode='widthFix'
></Image> ></Image>
</View> </View>
</View> </View>
@ -440,23 +453,23 @@ export default class InstrumentClickInUpload extends Component<any, any> {
{punchInInfo.clockImageList.length < 3 && ( {punchInInfo.clockImageList.length < 3 && (
<View <View
className="img2 flex aitems jcenter" className='img2 flex aitems jcenter'
onClick={this.handleChooseImage} onClick={this.handleChooseImage}
> >
<Image <Image
src={require("../../img/fr200/add-Image.png")} src={require("../../img/fr200/add-Image.png")}
mode="aspectFill" mode='aspectFill'
></Image> ></Image>
</View> </View>
)} )}
</View> </View>
<View className="content"> <View className='content'>
<Textarea <Textarea
placeholder-className="placeholder" placeholder-className='placeholder'
maxlength={100} maxlength={100}
onInput={this.handleTextareaInput} onInput={this.handleTextareaInput}
value={punchInInfo.clockContent} value={punchInInfo.clockContent}
placeholder="请记录一下今天打卡的心得吧~" placeholder='请记录一下今天打卡的心得吧~'
></Textarea> ></Textarea>
{/* {tipshow && ( {/* {tipshow && (
<View className="Textarea"> <View className="Textarea">
@ -465,7 +478,7 @@ export default class InstrumentClickInUpload extends Component<any, any> {
: "请记录一下今天打卡的心得吧~"} : "请记录一下今天打卡的心得吧~"}
</View> </View>
)} */} )} */}
<View className="tips-num"> <View className='tips-num'>
{punchInInfo.clockContent.length}/100 {punchInInfo.clockContent.length}/100
</View> </View>
</View> </View>
@ -473,16 +486,16 @@ export default class InstrumentClickInUpload extends Component<any, any> {
</View> </View>
</View> </View>
<View style="height: 150rpx"></View> <View style='height: 150rpx'></View>
{!isSubmit && ( {!isSubmit && (
<View className="confirm_btn flex aitems" onClick={this.handleSubmit}> <View className='confirm_btn flex aitems' onClick={this.handleSubmit}>
<View className="btn"></View> <View className='btn'></View>
</View> </View>
)} )}
{isSubmit && ( {isSubmit && (
<View className="confirm_btn flex aitems"> <View className='confirm_btn flex aitems'>
<View className="btn"></View> <View className='btn'></View>
</View> </View>
)} )}
</Block> </Block>

@ -18,7 +18,6 @@ page {
position: sticky; position: sticky;
top: 174rpx; top: 174rpx;
z-index: 9; z-index: 9;
} }
.tab { .tab {
@ -176,7 +175,6 @@ page {
color: #999; color: #999;
} }
// .instrument_item { // .instrument_item {
// margin-top: 20rpx; // margin-top: 20rpx;
// background: #ffffff; // background: #ffffff;
@ -472,6 +470,28 @@ page {
border-radius: 45rpx; border-radius: 45rpx;
} }
.footer {
position: fixed;
z-index: 99;
bottom: 0;
width: 100%;
height: 153rpx;
box-shadow: 0rpx -3rpx 7rpx 1rpx rgba(173, 191, 207, 0.21);
background: #ffffff;
}
.btn {
width: 690rpx;
height: 90rpx;
background: #000000;
border-radius: 45rpx;
color: #fff;
text-align: center;
line-height: 90rpx;
font-weight: bold;
font-size: 32rpx;
margin: 0 auto;
}
// .empty { // .empty {
// display: flex; // display: flex;
// flex-direction: column; // flex-direction: column;

@ -4,11 +4,11 @@ import { Component, PropsWithChildren, useEffect, useState } from "react";
import { Block, View, Text, Image, Input, Button, ScrollView, Picker } from "@tarojs/components"; import { Block, View, Text, Image, Input, Button, ScrollView, Picker } from "@tarojs/components";
import { go } from "@/utils/traoAPI"; import { go } from "@/utils/traoAPI";
import { Tab, Tabs } from "@antmjs/vantui"; import { Tab, Tabs, Dialog } from "@antmjs/vantui";
/** 自定义组件 **/ /** 自定义组件 **/
import Navbar from "../../components/navbar/navbar"; import Navbar from "../../components/navbar/navbar";
import PopupAlert from "../../components/popup/popup-alert"; import PopupClock from "../../components/popup/popup-clock";
/** 自定义组件 **/ /** 自定义组件 **/
import { InstrumentInfo } from '../../utils/Interface' import { InstrumentInfo } from '../../utils/Interface'
@ -29,13 +29,25 @@ export default class Recording extends Component<any, any> {
clockStatistics: [], clockStatistics: [],
statistics: [], statistics: [],
year: new Date().getFullYear(), year: new Date().getFullYear(),
today: new Date() today: new Date(),
monthTime: [
{ month: 1, time: 0 },
{ month: 2, time: 0 },
{ month: 3, time: 0 },
{ month: 4, time: 0 },
{ month: 5, time: 0 },
{ month: 6, time: 0 },
{ month: 7, time: 0 },
{ month: 8, time: 0 },
{ month: 9, time: 0 },
{ month: 10, time: 0 },
{ month: 11, time: 0 },
{ month: 12, time: 0 },
],
show:true
}; };
} }
componentDidMount() { } componentDidMount() { }
componentWillUnmount() { } componentWillUnmount() { }
@ -64,43 +76,84 @@ export default class Recording extends Component<any, any> {
if (id != null) { if (id != null) {
data['instrumentId'] = id data['instrumentId'] = id
} }
let res = await InstrumentInfo.nursingLog.getRecord(data) let res = await InstrumentInfo.apiNursingLog.getRecord(data)
if (res.data.code === 200) { if (res.data.code === 200) {
res.data.rows.map(item => { res.data.rows.map(item => {
item.nursingTime = this.getTime(item.nursingTime) item.nursingTime = this.getTime(item.nursingTime)
item.createTime = getdates(item.createTime).replace(/-/g, '.') item.createTime = getdates(item.createTime).replace(/-/g, '.')
}) })
this.setState({ recordList: res.data.rows }) this.setState({ recordList: res.data.rows })
} }
} }
async addLog() {
let data = {
instrumentId: 57,
instrumentName: "0130验收FR100",
online: 1,
modeId: 100,
modeName: "护理记录测试",
nursingTime: "00:15:00"
}
let res = await InstrumentInfo.apiNursingLog.addLog(data)
if (res.data.code === 200) {
}
}
/**分页获取用户的打卡记录 page size*/ /**分页获取用户的打卡记录 page size*/
async getClockStatistics(year = this.state.year) { async getClockStatistics(year = this.state.year) {
let res = await InstrumentInfo.clock.getClockStatistics({year}) let res = await InstrumentInfo.apiClock.getClockStatistics({ year })
if (res.data.code === 200) { if (res.data.code === 200) {
res.data.data.reverse() res.data.data.reverse()
res.data.data.map(item=>{ if (res.data.data.length > 0) {
res.data.data.map((item, index) => {
item.isMore = false item.isMore = false
if (index === 0) {
item.isMore = true
}
this.state.monthTime.map(monthItem => {
if (monthItem.month == item.month) {
monthItem.time = item.clockNum
}
}) })
})
this.setState({ monthTime: this.state.monthTime })
} else {
let monthTime = [
{ month: 1, time: 0 },
{ month: 2, time: 0 },
{ month: 3, time: 0 },
{ month: 4, time: 0 },
{ month: 5, time: 0 },
{ month: 6, time: 0 },
{ month: 7, time: 0 },
{ month: 8, time: 0 },
{ month: 9, time: 0 },
{ month: 10, time: 0 },
{ month: 11, time: 0 },
{ month: 12, time: 0 },
]
this.setState({ monthTime })
}
this.setState({ clockStatistics: res.data.data }) this.setState({ clockStatistics: res.data.data })
} }
} }
// 查询用户护理记录的当月统计信息
async getStatistics(id) { setShow(show: boolean){
let data = {} this.setState({show})
if (id != null) {
data['instrumentId'] = id
} }
let res = await InstrumentInfo.nursingLog.getStatistics(data)
// if (res.data.code === 200) {
// this.setState({ statistics: res.data.rows }) closeAlert(){
// } this.setShow(false)
} }
onChangeProduct(id) { onChangeProduct(id) {
this.setState({ curIndex: id }) this.setState({ curIndex: id })
this.getRecord(id) this.getRecord(id)
// this.addLog()
}; };
onChangeMore(id) { onChangeMore(id) {
@ -136,12 +189,12 @@ export default class Recording extends Component<any, any> {
} }
}; };
toReport() { toReport(id, recordId) {
go("/pages/face_report/face_report"); go("/pages/face_report/face_report?id=" + id + "&recordId=" + recordId);
} }
render() { render() {
let { current, array, name, recordList, bindingInstrumentList, curIndex, clockStatistics,statistics,year,today } = this.state; let { current, array, name, recordList, bindingInstrumentList, curIndex, clockStatistics, statistics, year, today, monthTime,show } = this.state;
return ( return (
<Block> <Block>
<Navbar isBack titleSlot='护理记录'></Navbar> <Navbar isBack titleSlot='护理记录'></Navbar>
@ -235,11 +288,11 @@ export default class Recording extends Component<any, any> {
<View className='top-left'> <View className='top-left'>
<View className='date'>{item.createTime}</View> <View className='date'>{item.createTime}</View>
<View className={classnames("tip", { <View className={classnames("tip", {
tag_active: item.online === 0, tag_active: item.online === 2,
})} })}
>{item.online ? '在线' : '离线'}</View> >{item.online ? '在线' : '离线'}</View>
</View> </View>
<View className='top-right' onClick={this.toReport}> <View className='top-right' onClick={this.toReport.bind(this, item.instrumentId, item.id)}>
<Image className='arrow_icon' src={require("../../img/index/right.png")} mode='aspectFill'></Image> <Image className='arrow_icon' src={require("../../img/index/right.png")} mode='aspectFill'></Image>
</View> </View>
@ -283,11 +336,18 @@ export default class Recording extends Component<any, any> {
</Picker> </Picker>
</View> </View>
<View className='chart flex sb'> <View className='chart flex sb'>
<View className='flex fc aitems' > {
<View className='buoy' >5</View> monthTime.map(item => (
<View className='column' style='height: calc(186/31*{{item.total}}rpx)'></View> <View className='flex fc aitems' key={item.month}>
<View className='month'>1</View> {
item.time > 0 && <View className='buoy' >{item.time}</View>
}
<View className='column' style={{ height: `calc(186/31*${item.time}rpx)` }}></View>
<View className='month'>{item.month}</View>
</View> </View>
))
}
</View> </View>
</View> </View>
<View style='padding-bottom: env(safe-area-inset-bottom)' > <View style='padding-bottom: env(safe-area-inset-bottom)' >
@ -336,7 +396,25 @@ export default class Recording extends Component<any, any> {
</View> </View>
</View> </View>
)} )}
<View className='footer flex aitems' >
<View className='btn' onClick={this.setShow.bind(this,true)}></View>
</View>
<PopupClock
isShow={show}
isClose
title='今日打卡'
content='暂未授权注册,请点击注册'
confirmButtonText='确认提交'
textAlgin='center'
type='1'
close={this.closeAlert}
confirm={this.closeAlert}
/>
</Block> </Block>
); );
} }
} }

Loading…
Cancel
Save