|
|
|
|
@ -2,7 +2,17 @@ import Taro from "@tarojs/taro";
|
|
|
|
|
import classnames from "classnames";
|
|
|
|
|
import { Component, PropsWithChildren, useEffect, useState } from "react";
|
|
|
|
|
|
|
|
|
|
import { Block, View, Text, Image, Input, Button, ScrollView, Picker, Textarea } from "@tarojs/components";
|
|
|
|
|
import {
|
|
|
|
|
Block,
|
|
|
|
|
View,
|
|
|
|
|
Text,
|
|
|
|
|
Image,
|
|
|
|
|
Input,
|
|
|
|
|
Button,
|
|
|
|
|
ScrollView,
|
|
|
|
|
Picker,
|
|
|
|
|
Textarea,
|
|
|
|
|
} from "@tarojs/components";
|
|
|
|
|
import { go } from "@/utils/traoAPI";
|
|
|
|
|
import { Tab, Tabs, Dialog, Popup } from "@antmjs/vantui";
|
|
|
|
|
|
|
|
|
|
@ -10,9 +20,9 @@ import { Tab, Tabs, Dialog, Popup } from "@antmjs/vantui";
|
|
|
|
|
import Navbar from "../../components/navbar/navbar";
|
|
|
|
|
import PopupClock from "../../components/popup/popup-clock";
|
|
|
|
|
/** 自定义组件 **/
|
|
|
|
|
import { InstrumentInfo } from '../../utils/Interface'
|
|
|
|
|
import { InstrumentInfo } from "../../utils/Interface";
|
|
|
|
|
import { date, getdates, previewImage } from "../../utils/util";
|
|
|
|
|
import { showModal } from '../../utils/traoAPI.js'
|
|
|
|
|
import { showModal } from "../../utils/traoAPI.js";
|
|
|
|
|
|
|
|
|
|
import "./recording.less";
|
|
|
|
|
|
|
|
|
|
@ -47,14 +57,14 @@ export default class Recording extends Component<any, any> {
|
|
|
|
|
show: false,
|
|
|
|
|
punchInInfo: {
|
|
|
|
|
clockImageList: [],
|
|
|
|
|
clockContent: '',
|
|
|
|
|
clockContent: "",
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
componentDidMount() { }
|
|
|
|
|
componentDidMount() {}
|
|
|
|
|
|
|
|
|
|
componentWillUnmount() { }
|
|
|
|
|
componentWillUnmount() {}
|
|
|
|
|
// 格式化时间
|
|
|
|
|
getTime(time) {
|
|
|
|
|
const hour = time.slice(0, 2);
|
|
|
|
|
@ -62,46 +72,45 @@ export default class Recording extends Component<any, any> {
|
|
|
|
|
const second = time.slice(6, 8);
|
|
|
|
|
|
|
|
|
|
if (hour > 0) {
|
|
|
|
|
return hour + '时' + minute + '分' + second + '秒'
|
|
|
|
|
return hour + "时" + minute + "分" + second + "秒";
|
|
|
|
|
} else {
|
|
|
|
|
return minute + '分' + second + '秒'
|
|
|
|
|
return minute + "分" + second + "秒";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 获取仪器列表
|
|
|
|
|
async getBindingInstrumentList() {
|
|
|
|
|
let res = await InstrumentInfo.bindingInstrumentList()
|
|
|
|
|
let res = await InstrumentInfo.bindingInstrumentList();
|
|
|
|
|
if (res.data.code === 200) {
|
|
|
|
|
this.setState({ bindingInstrumentList: res.data.data })
|
|
|
|
|
this.setState({ bindingInstrumentList: res.data.data });
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 获取护理历程
|
|
|
|
|
async getRecord(id) {
|
|
|
|
|
let data = {}
|
|
|
|
|
let data = {};
|
|
|
|
|
if (id != null) {
|
|
|
|
|
data['instrumentId'] = id
|
|
|
|
|
data["instrumentId"] = id;
|
|
|
|
|
}
|
|
|
|
|
let res = await InstrumentInfo.apiNursingLog.getRecord(data)
|
|
|
|
|
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, '.')
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
this.setState({ recordList: res.data.rows })
|
|
|
|
|
res.data.rows.map((item) => {
|
|
|
|
|
item.nursingTime = this.getTime(item.nursingTime);
|
|
|
|
|
item.createTime = getdates(item.createTime).replace(/-/g, ".");
|
|
|
|
|
});
|
|
|
|
|
this.setState({ recordList: res.data.rows });
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 查询用户当天最新的一条打卡记录
|
|
|
|
|
async getLatestClockRecord() {
|
|
|
|
|
let res = await InstrumentInfo.apiClock.getLatestClockRecord()
|
|
|
|
|
let res = await InstrumentInfo.apiClock.getLatestClockRecord();
|
|
|
|
|
if (res.data.code === 200) {
|
|
|
|
|
if (!res.data.data) {
|
|
|
|
|
this.setShow(true)
|
|
|
|
|
this.setShow(true);
|
|
|
|
|
} else {
|
|
|
|
|
let punchInInfo = {
|
|
|
|
|
clockImageList: res.data.data.clockImg,
|
|
|
|
|
clockContent: res.data.data.clockContent,
|
|
|
|
|
}
|
|
|
|
|
this.setState({ punchInInfo })
|
|
|
|
|
};
|
|
|
|
|
this.setState({ punchInInfo });
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -113,34 +122,34 @@ export default class Recording extends Component<any, any> {
|
|
|
|
|
online: 1,
|
|
|
|
|
modeId: 100,
|
|
|
|
|
modeName: "护理记录测试",
|
|
|
|
|
nursingTime: "00:15:00"
|
|
|
|
|
}
|
|
|
|
|
nursingTime: "00:15:00",
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
let res = await InstrumentInfo.apiNursingLog.addLog(data)
|
|
|
|
|
let res = await InstrumentInfo.apiNursingLog.addLog(data);
|
|
|
|
|
if (res.data.code === 200) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**分页获取用户的打卡记录 page size*/
|
|
|
|
|
async getClockStatistics(year = this.state.year) {
|
|
|
|
|
let res = await InstrumentInfo.apiClock.getClockStatistics({ year })
|
|
|
|
|
let res = await InstrumentInfo.apiClock.getClockStatistics({ year });
|
|
|
|
|
if (res.data.code === 200) {
|
|
|
|
|
res.data.data.reverse()
|
|
|
|
|
res.data.data.reverse();
|
|
|
|
|
if (res.data.data.length > 0) {
|
|
|
|
|
res.data.data.map((item, index) => {
|
|
|
|
|
item.isMore = false
|
|
|
|
|
item.detail = []
|
|
|
|
|
item.isMore = false;
|
|
|
|
|
item.detail = [];
|
|
|
|
|
if (index === 0) {
|
|
|
|
|
item.isMore = true
|
|
|
|
|
this.getList(item.id, item.year, item.month)
|
|
|
|
|
item.isMore = true;
|
|
|
|
|
this.getList(item.id, item.year, item.month);
|
|
|
|
|
}
|
|
|
|
|
this.state.monthTime.map(monthItem => {
|
|
|
|
|
this.state.monthTime.map((monthItem) => {
|
|
|
|
|
if (monthItem.month == item.month) {
|
|
|
|
|
monthItem.time = item.clockNum
|
|
|
|
|
monthItem.time = item.clockNum;
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
this.setState({ monthTime: this.state.monthTime })
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
this.setState({ monthTime: this.state.monthTime });
|
|
|
|
|
} else {
|
|
|
|
|
let monthTime = [
|
|
|
|
|
{ month: 1, time: 0 },
|
|
|
|
|
@ -155,87 +164,86 @@ export default class Recording extends Component<any, any> {
|
|
|
|
|
{ month: 10, time: 0 },
|
|
|
|
|
{ month: 11, time: 0 },
|
|
|
|
|
{ month: 12, time: 0 },
|
|
|
|
|
]
|
|
|
|
|
this.setState({ monthTime })
|
|
|
|
|
];
|
|
|
|
|
this.setState({ monthTime });
|
|
|
|
|
}
|
|
|
|
|
this.setState({ clockStatistics: res.data.data })
|
|
|
|
|
|
|
|
|
|
this.setState({ clockStatistics: res.data.data });
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 文本框输入文字
|
|
|
|
|
handleTextareaInput(e) {
|
|
|
|
|
const punchInInfo = this.state.punchInInfo
|
|
|
|
|
punchInInfo.clockContent = e.detail.value
|
|
|
|
|
this.setState({ punchInInfo })
|
|
|
|
|
const punchInInfo = this.state.punchInInfo;
|
|
|
|
|
punchInInfo.clockContent = e.detail.value;
|
|
|
|
|
this.setState({ punchInInfo });
|
|
|
|
|
}
|
|
|
|
|
// 打开/关闭弹窗
|
|
|
|
|
setShow(show: boolean) {
|
|
|
|
|
this.setState({ show })
|
|
|
|
|
this.setState({ show });
|
|
|
|
|
}
|
|
|
|
|
// 选择仪器
|
|
|
|
|
onChangeProduct(id) {
|
|
|
|
|
this.setState({ curIndex: id })
|
|
|
|
|
this.getRecord(id)
|
|
|
|
|
this.addLog()
|
|
|
|
|
};
|
|
|
|
|
this.setState({ curIndex: id });
|
|
|
|
|
this.getRecord(id);
|
|
|
|
|
this.addLog();
|
|
|
|
|
}
|
|
|
|
|
// 展开收起
|
|
|
|
|
onChangeMore(id, year, month) {
|
|
|
|
|
this.state.clockStatistics.map(item => {
|
|
|
|
|
this.state.clockStatistics.map((item) => {
|
|
|
|
|
if (item.id === id) {
|
|
|
|
|
item.isMore = !item.isMore
|
|
|
|
|
item.isMore = !item.isMore;
|
|
|
|
|
if (item.isMore && item.detail.length === 0) {
|
|
|
|
|
this.getList(id, year, month)
|
|
|
|
|
this.getList(id, year, month);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
this.setState({ clockStatistics: this.state.clockStatistics })
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
this.setState({ clockStatistics: this.state.clockStatistics });
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 获取当月打卡记录
|
|
|
|
|
async getList(id, year, month) {
|
|
|
|
|
let data = {
|
|
|
|
|
year, month
|
|
|
|
|
}
|
|
|
|
|
let res = await InstrumentInfo.apiClock.getList(data)
|
|
|
|
|
year,
|
|
|
|
|
month,
|
|
|
|
|
};
|
|
|
|
|
let res = await InstrumentInfo.apiClock.getList(data);
|
|
|
|
|
if (res.data.code === 200) {
|
|
|
|
|
console.log(this.state.clockStatistics, 88888);
|
|
|
|
|
|
|
|
|
|
this.state.clockStatistics.map(item => {
|
|
|
|
|
this.state.clockStatistics.map((item) => {
|
|
|
|
|
if (item.id === id) {
|
|
|
|
|
item.detail = res.data.data
|
|
|
|
|
item.detail.map(obj => {
|
|
|
|
|
obj.updateTime = getdates(obj.updateTime).replace(/-/g, '.')
|
|
|
|
|
})
|
|
|
|
|
item.detail = res.data.data;
|
|
|
|
|
item.detail.map((obj) => {
|
|
|
|
|
obj.updateTime = getdates(obj.updateTime).replace(/-/g, ".");
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
this.setState({ clockStatistics: this.state.clockStatistics })
|
|
|
|
|
});
|
|
|
|
|
this.setState({ clockStatistics: this.state.clockStatistics });
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async onLoad() {
|
|
|
|
|
this.getRecord(null)
|
|
|
|
|
this.getBindingInstrumentList()
|
|
|
|
|
this.getLatestClockRecord()
|
|
|
|
|
this.getClockStatistics()
|
|
|
|
|
this.getRecord(null);
|
|
|
|
|
this.getBindingInstrumentList();
|
|
|
|
|
this.getLatestClockRecord();
|
|
|
|
|
this.getClockStatistics();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
componentDidShow() { }
|
|
|
|
|
componentDidShow() {}
|
|
|
|
|
|
|
|
|
|
componentDidHide() { }
|
|
|
|
|
componentDidHide() {}
|
|
|
|
|
|
|
|
|
|
async initData() { }
|
|
|
|
|
async initData() {}
|
|
|
|
|
// 选择年份
|
|
|
|
|
onChangeYear(event) {
|
|
|
|
|
this.setState({ year: event.detail.value })
|
|
|
|
|
this.getClockStatistics(event.detail.value)
|
|
|
|
|
this.setState({ year: event.detail.value });
|
|
|
|
|
this.getClockStatistics(event.detail.value);
|
|
|
|
|
}
|
|
|
|
|
// 点击tab栏
|
|
|
|
|
onTab = async (event) => {
|
|
|
|
|
const { current } = event.currentTarget.dataset;
|
|
|
|
|
this.setState({ current });
|
|
|
|
|
if (current === 1) {
|
|
|
|
|
this.getClockStatistics()
|
|
|
|
|
this.getClockStatistics();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
// 跳转到护理报告
|
|
|
|
|
@ -246,72 +254,87 @@ export default class Recording extends Component<any, any> {
|
|
|
|
|
handleChooseImage() {
|
|
|
|
|
Taro.chooseMedia({
|
|
|
|
|
count: 1,
|
|
|
|
|
mediaType: ['image'],
|
|
|
|
|
sourceType: ['album', 'camera'],
|
|
|
|
|
mediaType: ["image"],
|
|
|
|
|
sourceType: ["album", "camera"],
|
|
|
|
|
success: (res) => {
|
|
|
|
|
const tempFilePaths = res.tempFiles.map((item) => item.tempFilePath)
|
|
|
|
|
const tempFilePaths = res.tempFiles.map((item) => item.tempFilePath);
|
|
|
|
|
tempFilePaths?.forEach((item) => {
|
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
|
|
|
InstrumentInfo.apiClock.clockFileUpload({ clockImg: item }).then((res) => {
|
|
|
|
|
const currentImage = res.data.url
|
|
|
|
|
const newImageList =
|
|
|
|
|
this.state.punchInInfo.clockImageList.length >= 3
|
|
|
|
|
? this.state.punchInInfo.clockImageList
|
|
|
|
|
: [... this.state.punchInInfo.clockImageList, currentImage]
|
|
|
|
|
const punchInInfo = this.state.punchInInfo
|
|
|
|
|
punchInInfo.clockImageList = newImageList
|
|
|
|
|
this.setState({ punchInInfo })
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
InstrumentInfo.apiClock
|
|
|
|
|
.clockFileUpload({ clockImg: item })
|
|
|
|
|
.then((res) => {
|
|
|
|
|
const currentImage = res.data.url;
|
|
|
|
|
const newImageList =
|
|
|
|
|
this.state.punchInInfo.clockImageList.length >= 3
|
|
|
|
|
? this.state.punchInInfo.clockImageList
|
|
|
|
|
: [...this.state.punchInInfo.clockImageList, currentImage];
|
|
|
|
|
const punchInInfo = this.state.punchInInfo;
|
|
|
|
|
punchInInfo.clockImageList = newImageList;
|
|
|
|
|
this.setState({ punchInInfo });
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
fail: (err) => {
|
|
|
|
|
console.info('err', err)
|
|
|
|
|
console.info("err", err);
|
|
|
|
|
},
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
// 删除打卡图片
|
|
|
|
|
delImg(i) {
|
|
|
|
|
const punchInInfo = this.state.punchInInfo
|
|
|
|
|
punchInInfo.clockImageList.splice(i, 1)
|
|
|
|
|
this.setState({ punchInInfo })
|
|
|
|
|
const punchInInfo = this.state.punchInInfo;
|
|
|
|
|
punchInInfo.clockImageList.splice(i, 1);
|
|
|
|
|
this.setState({ punchInInfo });
|
|
|
|
|
}
|
|
|
|
|
async submit() {
|
|
|
|
|
let punchInInfo = this.state.punchInInfo || {}
|
|
|
|
|
let punchInInfo = this.state.punchInInfo || {};
|
|
|
|
|
if (!punchInInfo.clockImageList.length) {
|
|
|
|
|
Taro.showToast({
|
|
|
|
|
title: '请上传图片',
|
|
|
|
|
icon: 'none',
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
title: "请上传图片",
|
|
|
|
|
icon: "none",
|
|
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (!punchInInfo.clockContent) {
|
|
|
|
|
Taro.showToast({
|
|
|
|
|
title: '请输入打卡心得',
|
|
|
|
|
icon: 'none',
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
title: "请输入打卡心得",
|
|
|
|
|
icon: "none",
|
|
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
InstrumentInfo.apiClock.postInsertClockLog(punchInInfo).then((res) => {
|
|
|
|
|
showModal({
|
|
|
|
|
t2: '您已完成今日打卡',
|
|
|
|
|
t2: "您已完成今日打卡",
|
|
|
|
|
btn1show: false,
|
|
|
|
|
}).then(() => {
|
|
|
|
|
this.setShow(false)
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
this.setShow(false);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
back() {
|
|
|
|
|
Taro.navigateBack({
|
|
|
|
|
delta: 1,
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
render() {
|
|
|
|
|
let { current, array, name, recordList, bindingInstrumentList, curIndex, clockStatistics, statistics, year, today, monthTime, show, punchInInfo } = this.state;
|
|
|
|
|
let {
|
|
|
|
|
current,
|
|
|
|
|
array,
|
|
|
|
|
name,
|
|
|
|
|
recordList,
|
|
|
|
|
bindingInstrumentList,
|
|
|
|
|
curIndex,
|
|
|
|
|
clockStatistics,
|
|
|
|
|
statistics,
|
|
|
|
|
year,
|
|
|
|
|
today,
|
|
|
|
|
monthTime,
|
|
|
|
|
show,
|
|
|
|
|
punchInInfo,
|
|
|
|
|
} = this.state;
|
|
|
|
|
return (
|
|
|
|
|
<Block>
|
|
|
|
|
<Navbar isBack titleSlot='护理记录'></Navbar>
|
|
|
|
|
<View className='tabs'>
|
|
|
|
|
<Navbar isBack titleSlot="护理记录"></Navbar>
|
|
|
|
|
<View className="tabs">
|
|
|
|
|
<View
|
|
|
|
|
className={classnames("tab", {
|
|
|
|
|
tab_active: current === 0,
|
|
|
|
|
@ -331,42 +354,48 @@ export default class Recording extends Component<any, any> {
|
|
|
|
|
打卡统计
|
|
|
|
|
</View>
|
|
|
|
|
</View>
|
|
|
|
|
{current === 0 && <ScrollView className='products_list' scroll-x='true' >
|
|
|
|
|
<View className={classnames("all", {
|
|
|
|
|
products_item_active: !curIndex,
|
|
|
|
|
})} onClick={this.onChangeProduct.bind(this, null)}
|
|
|
|
|
>全部
|
|
|
|
|
</View>
|
|
|
|
|
{bindingInstrumentList.map((item: any, index: any) => (
|
|
|
|
|
<View key={item.id}
|
|
|
|
|
className={classnames("products_item", {
|
|
|
|
|
products_item_active: curIndex === item.id,
|
|
|
|
|
{current === 0 && (
|
|
|
|
|
<ScrollView className="products_list" scroll-x="true">
|
|
|
|
|
<View
|
|
|
|
|
className={classnames("all", {
|
|
|
|
|
products_item_active: !curIndex,
|
|
|
|
|
})}
|
|
|
|
|
onClick={this.onChangeProduct.bind(this, item.id)}
|
|
|
|
|
onClick={this.onChangeProduct.bind(this, null)}
|
|
|
|
|
>
|
|
|
|
|
<Image className='products_cover'
|
|
|
|
|
src={require("../../img/test/1706692819894.jpg")} mode='aspectFit'
|
|
|
|
|
></Image>
|
|
|
|
|
<View className='products_title'>画质抗老射频仪</View>
|
|
|
|
|
全部
|
|
|
|
|
</View>
|
|
|
|
|
))}
|
|
|
|
|
</ScrollView>}
|
|
|
|
|
|
|
|
|
|
{current === 0 &&
|
|
|
|
|
recordList.length ===
|
|
|
|
|
0 && (
|
|
|
|
|
<View>
|
|
|
|
|
<View className='nodata'>
|
|
|
|
|
{bindingInstrumentList.map((item: any, index: any) => (
|
|
|
|
|
<View
|
|
|
|
|
key={item.id}
|
|
|
|
|
className={classnames("products_item", {
|
|
|
|
|
products_item_active: curIndex === item.id,
|
|
|
|
|
})}
|
|
|
|
|
onClick={this.onChangeProduct.bind(this, item.id)}
|
|
|
|
|
>
|
|
|
|
|
<Image
|
|
|
|
|
className='nodata_img'
|
|
|
|
|
src={require("../../img/nodata.png")}
|
|
|
|
|
className="products_cover"
|
|
|
|
|
src={require("../../img/test/1706692819894.jpg")}
|
|
|
|
|
mode="aspectFit"
|
|
|
|
|
></Image>
|
|
|
|
|
<View className='nodata_text'>暂无数据</View>
|
|
|
|
|
<View className="products_title">画质抗老射频仪</View>
|
|
|
|
|
</View>
|
|
|
|
|
))}
|
|
|
|
|
</ScrollView>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{current === 0 && recordList.length === 0 && (
|
|
|
|
|
<View>
|
|
|
|
|
<View className="nodata">
|
|
|
|
|
<Image
|
|
|
|
|
className="nodata_img"
|
|
|
|
|
src={require("../../img/nodata.png")}
|
|
|
|
|
></Image>
|
|
|
|
|
<View className="nodata_text">暂无数据</View>
|
|
|
|
|
</View>
|
|
|
|
|
)}
|
|
|
|
|
</View>
|
|
|
|
|
)}
|
|
|
|
|
{current === 0 && (
|
|
|
|
|
<View style='padding-bottom:200px'>
|
|
|
|
|
<View style="padding-bottom:200px">
|
|
|
|
|
{/* <View className='instrument_item' >
|
|
|
|
|
<View className='instrument_top flex sb aitems'>
|
|
|
|
|
<View className='time_box flex aitems'>
|
|
|
|
|
@ -393,35 +422,50 @@ export default class Recording extends Component<any, any> {
|
|
|
|
|
</View>
|
|
|
|
|
</View> */}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<View className='instrument_list '>
|
|
|
|
|
<View className="instrument_list ">
|
|
|
|
|
{recordList.map((item: any, index: any) => (
|
|
|
|
|
<View className='recording-box' key={item.id}>
|
|
|
|
|
<View className='box-top'>
|
|
|
|
|
<View className='top-left'>
|
|
|
|
|
<View className='date'>{item.createTime}</View>
|
|
|
|
|
<View className={classnames("tip", {
|
|
|
|
|
tag_active: item.online === 2,
|
|
|
|
|
})}
|
|
|
|
|
>{item.online ? '在线' : '离线'}</View>
|
|
|
|
|
<View className="recording-box" key={item.id}>
|
|
|
|
|
<View className="box-top">
|
|
|
|
|
<View className="top-left">
|
|
|
|
|
<View className="date">{item.createTime}</View>
|
|
|
|
|
<View
|
|
|
|
|
className={classnames("tip", {
|
|
|
|
|
tag_active: item.online === 2,
|
|
|
|
|
})}
|
|
|
|
|
>
|
|
|
|
|
{item.online ? "在线" : "离线"}
|
|
|
|
|
</View>
|
|
|
|
|
</View>
|
|
|
|
|
{item.instrumentType === 2 &&
|
|
|
|
|
<View className='top-right' onClick={this.toReport.bind(this, item.instrumentId, item.id)}>
|
|
|
|
|
{item.instrumentType === 2 && (
|
|
|
|
|
<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>
|
|
|
|
|
<View className='box-bottom'>
|
|
|
|
|
<View className="box-bottom">
|
|
|
|
|
<Image
|
|
|
|
|
className='recording_img'
|
|
|
|
|
className="recording_img"
|
|
|
|
|
src={item.modeImage}
|
|
|
|
|
></Image>
|
|
|
|
|
<View className='bottom-right'>
|
|
|
|
|
<View className='title'>{item.instrumentName}</View>
|
|
|
|
|
<View className='subtitle-box'>
|
|
|
|
|
<View className='subtitle'>模式:{item.modeName}</View>
|
|
|
|
|
<View className='subtitle'>护理时间:{item.nursingTime}</View>
|
|
|
|
|
<View className="bottom-right">
|
|
|
|
|
<View className="title">{item.instrumentName}</View>
|
|
|
|
|
<View className="subtitle-box">
|
|
|
|
|
<View className="subtitle">模式:{item.modeName}</View>
|
|
|
|
|
<View className="subtitle">
|
|
|
|
|
护理时间:{item.nursingTime}
|
|
|
|
|
</View>
|
|
|
|
|
</View>
|
|
|
|
|
</View>
|
|
|
|
|
</View>
|
|
|
|
|
@ -431,7 +475,7 @@ export default class Recording extends Component<any, any> {
|
|
|
|
|
</View>
|
|
|
|
|
)}
|
|
|
|
|
{current === 1 && (
|
|
|
|
|
<View style='padding-bottom:200px'>
|
|
|
|
|
<View style="padding-bottom:200px">
|
|
|
|
|
{/* <View className='nodata'>
|
|
|
|
|
<Image
|
|
|
|
|
className='nodata_img'
|
|
|
|
|
@ -439,139 +483,198 @@ export default class Recording extends Component<any, any> {
|
|
|
|
|
></Image>
|
|
|
|
|
<View className='nodata_text'>暂无数据</View>
|
|
|
|
|
</View> */}
|
|
|
|
|
<View style='height: 30rpx; background: #F8F8F8'></View>
|
|
|
|
|
<View className='clock_in_statistics m-x-30 flex sb'>
|
|
|
|
|
<View className='flex sb ab'>
|
|
|
|
|
<View className='clock_in_statistics_title'>年度打卡统计</View>
|
|
|
|
|
<Picker mode='date' fields='year' onChange={this.onChangeYear.bind(this)} value='{{year}}' end='{{today}}'>
|
|
|
|
|
<View className='clock_in_statistics_date flex aitems'>
|
|
|
|
|
<View style="height: 30rpx; background: #F8F8F8"></View>
|
|
|
|
|
<View className="clock_in_statistics m-x-30 flex sb">
|
|
|
|
|
<View className="flex sb ab">
|
|
|
|
|
<View className="clock_in_statistics_title">年度打卡统计</View>
|
|
|
|
|
<Picker
|
|
|
|
|
mode="date"
|
|
|
|
|
fields="year"
|
|
|
|
|
onChange={this.onChangeYear.bind(this)}
|
|
|
|
|
value="{{year}}"
|
|
|
|
|
end="{{today}}"
|
|
|
|
|
>
|
|
|
|
|
<View className="clock_in_statistics_date flex aitems">
|
|
|
|
|
<View>{year}年</View>
|
|
|
|
|
<Image className='more_icon' src={require('../../img/arrow-down.png')} mode='widthFix'></Image>
|
|
|
|
|
<Image
|
|
|
|
|
className="more_icon"
|
|
|
|
|
src={require("../../img/arrow-down.png")}
|
|
|
|
|
mode="widthFix"
|
|
|
|
|
></Image>
|
|
|
|
|
</View>
|
|
|
|
|
</Picker>
|
|
|
|
|
</View>
|
|
|
|
|
<View className='chart flex sb'>
|
|
|
|
|
{
|
|
|
|
|
monthTime.map(item => (
|
|
|
|
|
<View className='flex fc aitems' key={item.month}>
|
|
|
|
|
{
|
|
|
|
|
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 className="chart flex sb">
|
|
|
|
|
{monthTime.map((item) => (
|
|
|
|
|
<View className="flex fc aitems" key={item.month}>
|
|
|
|
|
{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 style='padding-bottom: env(safe-area-inset-bottom)' >
|
|
|
|
|
<View className='month_box m-x-30'>
|
|
|
|
|
{clockStatistics.map(item => (
|
|
|
|
|
<View className='month_statistics' key={item.id}>
|
|
|
|
|
<View className='flex aitems sb'>
|
|
|
|
|
<View className='time'>{item.year}年{item.month}月</View>
|
|
|
|
|
<View className='more_box flex aitems' onClick={this.onChangeMore.bind(this, item.id, item.year, item.month)}>
|
|
|
|
|
<View className='more_text'> {!item.isMore ? '展开更多' : '收起更多'}</View>
|
|
|
|
|
<Image style={{ transform: (item.isMore) ? 'rotate(180deg)' : 'rotate(0deg)' }} className='more_icon'
|
|
|
|
|
src={require("../../img/arrow-down.png")} mode='widthFix'
|
|
|
|
|
<View style="padding-bottom: env(safe-area-inset-bottom)">
|
|
|
|
|
<View className="month_box m-x-30">
|
|
|
|
|
{clockStatistics.map((item) => (
|
|
|
|
|
<View className="month_statistics" key={item.id}>
|
|
|
|
|
<View className="flex aitems sb">
|
|
|
|
|
<View className="time">
|
|
|
|
|
{item.year}年{item.month}月
|
|
|
|
|
</View>
|
|
|
|
|
<View
|
|
|
|
|
className="more_box flex aitems"
|
|
|
|
|
onClick={this.onChangeMore.bind(
|
|
|
|
|
this,
|
|
|
|
|
item.id,
|
|
|
|
|
item.year,
|
|
|
|
|
item.month
|
|
|
|
|
)}
|
|
|
|
|
>
|
|
|
|
|
<View className="more_text">
|
|
|
|
|
{" "}
|
|
|
|
|
{!item.isMore ? "展开更多" : "收起更多"}
|
|
|
|
|
</View>
|
|
|
|
|
<Image
|
|
|
|
|
style={{
|
|
|
|
|
transform: item.isMore
|
|
|
|
|
? "rotate(180deg)"
|
|
|
|
|
: "rotate(0deg)",
|
|
|
|
|
}}
|
|
|
|
|
className="more_icon"
|
|
|
|
|
src={require("../../img/arrow-down.png")}
|
|
|
|
|
mode="widthFix"
|
|
|
|
|
></Image>
|
|
|
|
|
</View>
|
|
|
|
|
</View>
|
|
|
|
|
<View style='height: 59rpx'></View>
|
|
|
|
|
<View className='statistic'>
|
|
|
|
|
<View className='statistic_item'>
|
|
|
|
|
<View className='statistic_num'>{item.clockNum}</View>
|
|
|
|
|
<View className='statistic_desc'>本月打卡天数</View>
|
|
|
|
|
<View style="height: 59rpx"></View>
|
|
|
|
|
<View className="statistic">
|
|
|
|
|
<View className="statistic_item">
|
|
|
|
|
<View className="statistic_num">{item.clockNum}</View>
|
|
|
|
|
<View className="statistic_desc">本月打卡天数</View>
|
|
|
|
|
</View>
|
|
|
|
|
<View className='statistic_item'>
|
|
|
|
|
<View className='statistic_num'>{(item.percentage * 100).toFixed(2)}%</View>
|
|
|
|
|
<View className='statistic_desc'>超越花至用户</View>
|
|
|
|
|
<View className="statistic_item">
|
|
|
|
|
<View className="statistic_num">
|
|
|
|
|
{(item.percentage * 100).toFixed(2)}%
|
|
|
|
|
</View>
|
|
|
|
|
<View className="statistic_desc">超越花至用户</View>
|
|
|
|
|
</View>
|
|
|
|
|
<View className='border'></View>
|
|
|
|
|
<View className="border"></View>
|
|
|
|
|
</View>
|
|
|
|
|
{item.isMore && item.detail && <View>
|
|
|
|
|
{
|
|
|
|
|
item.detail.map(obj => (
|
|
|
|
|
{item.isMore && item.detail && (
|
|
|
|
|
<View>
|
|
|
|
|
{item.detail.map((obj) => (
|
|
|
|
|
<View key={obj}>
|
|
|
|
|
<View style='height: 57rpx' ></View>
|
|
|
|
|
<View className='month_item'>
|
|
|
|
|
<View className='month_item_date'>{obj.updateTime}</View>
|
|
|
|
|
<View className='month_image_box flex sb'>
|
|
|
|
|
{obj.clockImg.map(img => (<Image key={img} className='month_item_cover' src={img} ></Image>))}
|
|
|
|
|
<View style="height: 57rpx"></View>
|
|
|
|
|
<View className="month_item">
|
|
|
|
|
<View className="month_item_date">
|
|
|
|
|
{obj.updateTime}
|
|
|
|
|
</View>
|
|
|
|
|
<View className="month_image_box flex sb">
|
|
|
|
|
{obj.clockImg.map((img) => (
|
|
|
|
|
<Image
|
|
|
|
|
key={img}
|
|
|
|
|
className="month_item_cover"
|
|
|
|
|
src={img}
|
|
|
|
|
></Image>
|
|
|
|
|
))}
|
|
|
|
|
</View>
|
|
|
|
|
<View className="month_item_date">
|
|
|
|
|
小紫弹智能射频仪、花至抗老射频仪PRO{" "}
|
|
|
|
|
</View>
|
|
|
|
|
<View className="month_item_note">
|
|
|
|
|
{obj.clockContent}
|
|
|
|
|
</View>
|
|
|
|
|
<View className='month_item_date'>小紫弹智能射频仪、花至抗老射频仪PRO </View>
|
|
|
|
|
<View className='month_item_note'>{obj.clockContent}</View>
|
|
|
|
|
</View>
|
|
|
|
|
</View>))}
|
|
|
|
|
</View>
|
|
|
|
|
}
|
|
|
|
|
</View>
|
|
|
|
|
))}
|
|
|
|
|
</View>
|
|
|
|
|
)}
|
|
|
|
|
</View>
|
|
|
|
|
))
|
|
|
|
|
}
|
|
|
|
|
))}
|
|
|
|
|
</View>
|
|
|
|
|
</View>
|
|
|
|
|
</View>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
<View className='footer flex aitems' >
|
|
|
|
|
<View className='btn' onClick={this.setShow.bind(this, true)}>前往打卡</View>
|
|
|
|
|
)}
|
|
|
|
|
<View className="footer flex aitems">
|
|
|
|
|
<View className="btn" onClick={this.setShow.bind(this, true)}>
|
|
|
|
|
前往打卡
|
|
|
|
|
</View>
|
|
|
|
|
<View className="text" onClick={this.back}>
|
|
|
|
|
跳过 >
|
|
|
|
|
跳过 >
|
|
|
|
|
</View>
|
|
|
|
|
</View>
|
|
|
|
|
|
|
|
|
|
<Popup show={show} onClose={() => this.setState({ show: false })}>
|
|
|
|
|
<View className='popBox'>
|
|
|
|
|
<Image className='close_icon'
|
|
|
|
|
src={require("../../img/close.png")} mode='widthFix' onClick={this.setShow.bind(this, false)}
|
|
|
|
|
<View className="popBox">
|
|
|
|
|
<Image
|
|
|
|
|
className="close_icon"
|
|
|
|
|
src={require("../../img/close.png")}
|
|
|
|
|
mode="widthFix"
|
|
|
|
|
onClick={this.setShow.bind(this, false)}
|
|
|
|
|
></Image>
|
|
|
|
|
<View className='popTitle'>今日打卡</View>
|
|
|
|
|
<View className='popSubtitle'>本月您已打卡<View className='bold'>{clockStatistics[0]?.clockNum}</View> 天,超越<View className='bold'>{(clockStatistics[0]?.percentage * 100).toFixed(1)}%</View>花至用户</View>
|
|
|
|
|
<View className='img_box'>
|
|
|
|
|
{
|
|
|
|
|
punchInInfo.clockImageList.map((item, index) => (
|
|
|
|
|
<View key={item} className='img'>
|
|
|
|
|
<Image className='showImg'
|
|
|
|
|
src={item} mode='widthFix'
|
|
|
|
|
></Image>
|
|
|
|
|
<Image className='closeImg'
|
|
|
|
|
src={require('../../img/close1.png')}
|
|
|
|
|
mode='widthFix'
|
|
|
|
|
onClick={this.delImg.bind(this, index)}
|
|
|
|
|
></Image>
|
|
|
|
|
</View>
|
|
|
|
|
))
|
|
|
|
|
}
|
|
|
|
|
{punchInInfo.clockImageList.length < 3 &&
|
|
|
|
|
<View className='addBox' onClick={this.handleChooseImage.bind(this)}>
|
|
|
|
|
<Image className='showImg'
|
|
|
|
|
src={require("../../img/clock_in_upload/add-image.png")} mode='widthFix'
|
|
|
|
|
<View className="popTitle">今日打卡</View>
|
|
|
|
|
<View className="popSubtitle">
|
|
|
|
|
本月您已打卡
|
|
|
|
|
<View className="bold">{clockStatistics[0]?.clockNum}</View>{" "}
|
|
|
|
|
天,超越
|
|
|
|
|
<View className="bold">
|
|
|
|
|
{(clockStatistics[0]?.percentage * 100).toFixed(1)}%
|
|
|
|
|
</View>
|
|
|
|
|
花至用户
|
|
|
|
|
</View>
|
|
|
|
|
<View className="img_box">
|
|
|
|
|
{punchInInfo.clockImageList.map((item, index) => (
|
|
|
|
|
<View key={item} className="img">
|
|
|
|
|
<Image className="showImg" src={item} mode="widthFix"></Image>
|
|
|
|
|
<Image
|
|
|
|
|
className="closeImg"
|
|
|
|
|
src={require("../../img/close1.png")}
|
|
|
|
|
mode="widthFix"
|
|
|
|
|
onClick={this.delImg.bind(this, index)}
|
|
|
|
|
></Image>
|
|
|
|
|
</View>
|
|
|
|
|
))}
|
|
|
|
|
{punchInInfo.clockImageList.length < 3 && (
|
|
|
|
|
<View
|
|
|
|
|
className="addBox"
|
|
|
|
|
onClick={this.handleChooseImage.bind(this)}
|
|
|
|
|
>
|
|
|
|
|
<Image
|
|
|
|
|
className="showImg"
|
|
|
|
|
src={require("../../img/clock_in_upload/add-image.png")}
|
|
|
|
|
mode="widthFix"
|
|
|
|
|
></Image>
|
|
|
|
|
</View>
|
|
|
|
|
}
|
|
|
|
|
)}
|
|
|
|
|
</View>
|
|
|
|
|
<View className='info4'>
|
|
|
|
|
<View className='content'>
|
|
|
|
|
<View className="info4">
|
|
|
|
|
<View className="content">
|
|
|
|
|
<Textarea
|
|
|
|
|
placeholderStyle='color: #ccc; font-size: 26rpx;font-weight: 400;font-family: PingFang SC;'
|
|
|
|
|
placeholder='请记录一下今天的护理心得吧'
|
|
|
|
|
placeholderStyle="color: #ccc; font-size: 26rpx;font-weight: 400;font-family: PingFang SC;"
|
|
|
|
|
placeholder="请记录一下今天的护理心得吧"
|
|
|
|
|
maxlength={120}
|
|
|
|
|
onInput={this.handleTextareaInput.bind(this)}
|
|
|
|
|
value={punchInInfo.clockContent}
|
|
|
|
|
></Textarea>
|
|
|
|
|
</View>
|
|
|
|
|
<View className='tip'>
|
|
|
|
|
{'(' + (punchInInfo.clockContent.length || 0) + '/120)'}
|
|
|
|
|
<View className="tip">
|
|
|
|
|
{"(" + (punchInInfo.clockContent.length || 0) + "/120)"}
|
|
|
|
|
</View>
|
|
|
|
|
</View>
|
|
|
|
|
<View className='popbtnbox flex aitems jcenter'>
|
|
|
|
|
<View className='btn1' onClick={this.submit.bind(this)}>
|
|
|
|
|
<View className="popbtnbox flex aitems jcenter">
|
|
|
|
|
<View className="btn1" onClick={this.submit.bind(this)}>
|
|
|
|
|
确认提交
|
|
|
|
|
</View>
|
|
|
|
|
</View>
|
|
|
|
|
</View>
|
|
|
|
|
</Popup>
|
|
|
|
|
</Block >
|
|
|
|
|
</Block>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|