Merge branch 'dev' into lzwdev

master
blak-kong 2 years ago
commit 9d594fb0c2

@ -3,8 +3,8 @@
"description": "", "description": "",
"setting": { "setting": {
"urlCheck": true, "urlCheck": true,
"es6": false, "es6": true,
"enhance": false, "enhance": true,
"compileHotReLoad": false, "compileHotReLoad": false,
"postcss": false, "postcss": false,
"preloadBackgroundData": false, "preloadBackgroundData": false,
@ -37,5 +37,6 @@
"ignore": [], "ignore": [],
"include": [] "include": []
}, },
"appid": "wx92d11ea506995fa9" "appid": "wx92d11ea506995fa9",
"projectname": "IterationThree"
} }

@ -0,0 +1,7 @@
{
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"setting": {
"compileHotReLoad": true,
"bigPackageSizeSupport": true
}
}

@ -1608,7 +1608,7 @@ class IotCarePlan extends Component<any, any> {
/** 提交护理记录 */ /** 提交护理记录 */
PostNursingLogClock = async (data: any = null, isJump = true) => { PostNursingLogClock = async (data: any = null, isJump = true) => {
let { currentDevice, ActiveModeItem } = this.state; let { currentDevice, ActiveModeItem, } = this.state;
let params = {}; let params = {};
if (data) { if (data) {
@ -1627,6 +1627,13 @@ class IotCarePlan extends Component<any, any> {
console.log("PostNursingLogClock", res); console.log("PostNursingLogClock", res);
if (res.data.code === 200) { if (res.data.code === 200) {
let params = {
instrumentId: currentDevice.id,
};
// 上传护理完成的仪器ID
let res = await InstrumentInfo.apiClock.addClockInstrument(params);
console.log(res,'护理完成');
this.rmWL200NursingHistory(this.WL200NursingHistory); // 护理完成,删除记录 this.rmWL200NursingHistory(this.WL200NursingHistory); // 护理完成,删除记录
if (isJump) { if (isJump) {
this.setState({ this.setState({

@ -66,6 +66,114 @@ page {
margin: 48rpx 0 34rpx; margin: 48rpx 0 34rpx;
} }
.van-popup {
border-radius: 30rpx;
.popBox {
box-sizing: border-box;
width: 670rpx;
height: 840rpx;
background: #ffffff;
border-radius: 30rpx;
position: relative;
padding: 42rpx 30rpx 0;
.close_icon {
position: absolute;
width: 50rpx;
height: 50rpx;
top: 34rpx;
right: 34rpx;
}
.popTitle {
font-size: 36rpx;
text-align: center;
font-family: PingFang SC;
font-weight: bold;
}
.popSubtitle {
display: flex;
justify-content: center;
align-items: flex-end;
font-size: 28rpx;
text-align: center;
margin-top: 50rpx;
.bold {
font-size: 38rpx;
font-weight: bold;
}
}
.img_box {
margin: 58rpx 0 37rpx 0;
display: flex;
flex-wrap: wrap;
.img {
position: relative;
margin-right: 35rpx;
.closeImg {
position: absolute;
top: 10rpx;
right: 10rpx;
width: 30rpx;
}
}
.img:last-child {
margin-right: 0;
}
.addBox {
width: 180rpx;
height: 180rpx;
background: #ffffff;
border: 1px solid #dddddd;
border-radius: 20rpx;
display: flex;
justify-content: center;
align-items: center;
Image {
width: 40rpx;
}
}
.showImg {
width: 180rpx;
height: 180rpx;
border-radius: 20rpx;
}
}
.info4 {
position: relative;
textarea {
padding: 28rpx 30rpx;
width: 610rpx;
height: 186rpx;
background: #ffffff;
border: 1px solid #dddddd;
border-radius: 3rpx;
box-sizing: border-box;
}
.tip {
position: absolute;
right: 20rpx;
bottom: 22rpx;
font-size: 22rpx;
font-family: PingFang SC;
font-weight: 500;
color: #cccccc;
}
}
.btn1 {
font-style: normal;
width: 270rpx;
height: 90rpx;
line-height: 90rpx;
background: #000000;
text-align: center;
border-radius: 45rpx;
font-size: 32rpx;
font-weight: bold;
margin-top: 55rpx;
color: #ffffff;
}
}
}
.footer { .footer {
position: fixed; position: fixed;
z-index: 99; z-index: 99;

@ -2,8 +2,11 @@ import Taro from "@tarojs/taro";
import classnames from "classnames"; 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 { showModal } from "../../utils/traoAPI.js";
import { Block, View, Text, Image, Input, Button } from "@tarojs/components"; import { Tab, Tabs, Dialog, Popup } from "@antmjs/vantui";
import {
Block, View, Text, Image, Input, Button, Textarea,
} from "@tarojs/components";
import { date, getdates, previewImage } from "../../utils/util"; import { date, getdates, previewImage } from "../../utils/util";
/** 自定义组件 **/ /** 自定义组件 **/
@ -22,13 +25,38 @@ export default class Index extends Component<any, any> {
statistics: {}, statistics: {},
recordList: [], recordList: [],
recordData: {}, recordData: {},
year: new Date().getFullYear(),
show: false,
clockStatistics: [],
punchInInfo: {
clockImageList: [],
clockContent: "",
},
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 },
],
}; };
} }
componentDidMount() {} componentDidMount() { }
componentWillUnmount() {} componentWillUnmount() { }
// 打开/关闭弹窗
setShow(show: boolean) {
this.setState({ show });
}
// 查询用户护理记录的当月统计信息 // 查询用户护理记录的当月统计信息
async getStatistics(id) { async getStatistics(id) {
let data = {}; let data = {};
@ -67,7 +95,142 @@ export default class Index extends Component<any, any> {
}); });
} }
} }
// 文本框输入文字
handleTextareaInput = (e) => {
const punchInInfo = this.state.punchInInfo;
this.setState({ punchInInfo: { ...punchInInfo, clockContent: e.detail.value } });
};
async submit() {
let punchInInfo = this.state.punchInInfo || {};
if (!punchInInfo.clockImageList.length) {
Taro.showToast({
title: "请上传图片",
icon: "none",
});
return;
}
if (!punchInInfo.clockContent) {
Taro.showToast({
title: "请输入打卡心得",
icon: "none",
});
return;
}
InstrumentInfo.apiClock.postInsertClockLog(punchInInfo).then((res) => {
showModal({
t2: "您已完成今日打卡",
btn1show: false,
}).then(() => {
let data = new Date
Taro.setStorageSync('DayTime', data.toISOString())
this.setState({
clockShow: true
})
this.getClockStatistics();
this.setShow(false);
});
});
}
/**分页获取用户的打卡记录 page size*/
async getClockStatistics(year = this.state.year) {
let res = await InstrumentInfo.apiClock.getClockStatistics({ year });
console.log(res,'查看返回',year);
if (res.data.code === 200) {
res.data.data.reverse();
if (res.data.data.length > 0) {
res.data.data.map((item, index) => {
item.isMore = false;
item.detail = [];
if (index === 0) {
item.isMore = true;
this.getList(item.id, item.year, item.month);
}
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 });
}
}
// 获取当月打卡记录
async getList(id, year, month) {
let 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) => {
if (item.id === id) {
item.detail = res.data.data;
item.detail.map((obj) => {
obj.updateTime = getdates(obj.updateTime).replace(/-/g, ".");
});
}
});
this.setState({ clockStatistics: this.state.clockStatistics });
}
}
// 上传图片
handleChooseImage() {
Taro.chooseMedia({
count: 1,
mediaType: ["image"],
sourceType: ["album", "camera"],
success: (res) => {
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 });
});
});
},
fail: (err) => {
console.info("err", err);
},
});
}
// 删除打卡图片
delImg(i) {
const punchInInfo = this.state.punchInInfo;
punchInInfo.clockImageList.splice(i, 1);
this.setState({ punchInInfo });
}
getRouteId() { getRouteId() {
const searchParams = new URLSearchParams(window.location.search); const searchParams = new URLSearchParams(window.location.search);
const id = searchParams.get("id"); const id = searchParams.get("id");
@ -89,20 +252,21 @@ export default class Index extends Component<any, any> {
} }
async onLoad() { async onLoad() {
this.getRouteId(); this.getRouteId();
this.getClockStatistics()
} }
componentDidShow() {} componentDidShow() { }
componentDidHide() {} componentDidHide() { }
async initData() {} async initData() { }
GoIndex = () => { GoIndex = () => {
Taro.switchTab({ url: "/pages/index/index" }); Taro.switchTab({ url: "/pages/index/index" });
}; };
render() { render() {
let { name, statistics, recordList, recordData } = this.state; let { name, statistics, recordList, recordData, show,clockStatistics,punchInInfo,monthTime } = this.state;
return ( return (
<Block> <Block>
<Navbar isBack titleSlot="护理报告"></Navbar> <Navbar isBack titleSlot="护理报告"></Navbar>
@ -223,7 +387,7 @@ export default class Index extends Component<any, any> {
</View> </View>
<View className="footer flex aitems"> <View className="footer flex aitems">
<View className="btn"></View> <View className="btn" onClick={this.setShow.bind(this, true)}></View>
<View className="text flex aitems"> <View className="text flex aitems">
<View onClick={this.GoIndex}></View> <View onClick={this.GoIndex}></View>
<Image <Image
@ -232,6 +396,70 @@ export default class Index extends Component<any, any> {
></Image> ></Image>
</View> </View>
</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)}
></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"
></Image>
</View>
)}
</View>
<View className="info4">
<View className="content">
<Textarea
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>
</View>
<View className="popbtnbox flex aitems jcenter">
<View className="btn1" onClick={this.submit.bind(this)}>
</View>
</View>
</View>
</Popup>
</Block> </Block>
); );
} }

@ -109,6 +109,7 @@ class Index extends Component<any, any> {
isBindingError203: false, // 绑定失败弹窗:已被别人绑定 isBindingError203: false, // 绑定失败弹窗:已被别人绑定
instrumentList: [], // 仪器列表 instrumentList: [], // 仪器列表
ViewAddInstrument: true, // 查看是否添加有仪器
unbindingInstrumentList: [], // 未绑定仪器列表 unbindingInstrumentList: [], // 未绑定仪器列表
instrumentInfo: { instrumentInfo: {
// 扫码获得的序列号仪器 // 扫码获得的序列号仪器
@ -410,10 +411,14 @@ class Index extends Component<any, any> {
// 护理记录 // 护理记录
toNursingRecords = () => { toNursingRecords = () => {
go("/pages/recording/recording"); let { ViewAddInstrument } = this.state;
// go(`/pages/recording/recording?param1=${param1Value}`);
go(`/pages/recording/recording?param=${ViewAddInstrument}`);
}; };
gourl = (e) => { gourl = (e) => {
const { url } = e.currentTarget.dataset; const { url } = e.currentTarget.dataset;
if (this.isRegister()) { if (this.isRegister()) {
go(url); go(url);
@ -476,8 +481,13 @@ class Index extends Component<any, any> {
mask: true, mask: true,
}); });
let { data: res } = await InstrumentInfo.bindingInstrumentList(); let { data: res } = await InstrumentInfo.bindingInstrumentList();
Taro.hideLoading(); console.log(res,'查看绑定的设备');
// Taro.hideLoading();
if (res.code === 200) { if (res.code === 200) {
if(res.data.length === 0){
this.setState({ ViewAddInstrument: false });
}
this.setState({ instrumentList: res.data }); this.setState({ instrumentList: res.data });
} else { } else {
// 仪器列表失败todo // 仪器列表失败todo
@ -742,6 +752,7 @@ class Index extends Component<any, any> {
// 跳转仪器介绍页 // 跳转仪器介绍页
goNursing = (item) => { goNursing = (item) => {
if (item.status === 0) { if (item.status === 0) {
setStorageSync("instrument_detail", item); setStorageSync("instrument_detail", item);
this.setState({ connectInstrument: item }); this.setState({ connectInstrument: item });
@ -757,6 +768,7 @@ class Index extends Component<any, any> {
/** 蓝牙逻辑 */ /** 蓝牙逻辑 */
bindBlockLeft() { bindBlockLeft() {
if (!this.state.isRegisterBoolean) { if (!this.state.isRegisterBoolean) {
//未注册授权 //未注册授权
this.alertRegister(); this.alertRegister();
@ -969,6 +981,7 @@ class Index extends Component<any, any> {
isExchangeBinding, isExchangeBinding,
instrumentInfo, instrumentInfo,
instrumentList, instrumentList,
ViewAddInstrument,
showEquipment, showEquipment,
// 升级弹窗 // 升级弹窗

@ -55,7 +55,7 @@ export default class InstrumentClickInUpload extends Component<any, any> {
secondClockImg: null, secondClockImg: null,
thirdClockImg: null, thirdClockImg: null,
}, },
clockcontents: "",
// 现在选中的数据 // 现在选中的数据
currentInfo: { currentInfo: {
modeVideo: "", modeVideo: "",
@ -122,6 +122,7 @@ export default class InstrumentClickInUpload extends Component<any, any> {
}; };
// 获取最新一条打卡记录 // 获取最新一条打卡记录
getLatestClockRecord = async () => { getLatestClockRecord = async () => {
let { punchInInfo } = this.state; let { punchInInfo } = this.state;
let res = await InstrumentInfo.apiClock.getLatestClockRecord(); let res = await InstrumentInfo.apiClock.getLatestClockRecord();
if (res.data.code === 200) { if (res.data.code === 200) {
@ -189,7 +190,7 @@ export default class InstrumentClickInUpload extends Component<any, any> {
// 提交打卡 // 提交打卡
handleSubmit = async () => { handleSubmit = async () => {
let { punchInInfo } = this.state; let { punchInInfo,instrumentDetail } = this.state;
let obj = punchInInfo; let obj = punchInInfo;
if (obj.clockImageList.length === 0) { if (obj.clockImageList.length === 0) {
msg("至少上传一张图片"); msg("至少上传一张图片");
@ -231,6 +232,13 @@ export default class InstrumentClickInUpload extends Component<any, any> {
clockImageList: imgList, clockImageList: imgList,
clockContent: obj.clockContent, clockContent: obj.clockContent,
}; };
let params = {
instrumentId: instrumentDetail.id,
};
// 上传护理完成的仪器ID
let instrumentRes = await InstrumentInfo.apiClock.addClockInstrument(params);
console.log(instrumentRes,'添加仪器成功');
let res = await InstrumentInfo.apiClock.postInsertClockLog(clockParmas); let res = await InstrumentInfo.apiClock.postInsertClockLog(clockParmas);
if (res.data.code === 200) { if (res.data.code === 200) {
msg("打卡成功"); msg("打卡成功");
@ -260,8 +268,10 @@ export default class InstrumentClickInUpload extends Component<any, any> {
videoLoadedMetaData = async () => {}; videoLoadedMetaData = async () => {};
handleTextareaInput = async (e) => { handleTextareaInput = (e) => {
this.setState({ punchInInfo: { clockContent: e.detail.value } }); const punchInInfo = this.state.punchInInfo;
this.setState({ punchInInfo: { ...punchInInfo,clockContent: e.detail.value } });
}; };
onModeLockOpen = async () => { onModeLockOpen = async () => {
@ -292,7 +302,7 @@ export default class InstrumentClickInUpload extends Component<any, any> {
punchInInfo, punchInInfo,
isTipShow, isTipShow,
currentInfo, currentInfo,
clockcontents, clockcontent,
modeInfo, modeInfo,
nurseInfo, nurseInfo,
isModeLock, isModeLock,
@ -304,7 +314,6 @@ export default class InstrumentClickInUpload extends Component<any, any> {
stepIndex, stepIndex,
autoPlay, autoPlay,
sysInfo, sysInfo,
clockContent,
} = this.state; } = this.state;
return ( return (
<Block> <Block>
@ -476,7 +485,7 @@ export default class InstrumentClickInUpload extends Component<any, any> {
placeholder-className="placeh和给g'holder" placeholder-className="placeh和给g'holder"
maxlength={100} maxlength={100}
onInput={this.handleTextareaInput} onInput={this.handleTextareaInput}
value={clockcontents} value={punchInInfo.clockContent}
placeholder="请记录一下今天打卡的心得吧~" placeholder="请记录一下今天打卡的心得吧~"
></Textarea> ></Textarea>
{/* {tipshow && ( {/* {tipshow && (
@ -488,6 +497,7 @@ export default class InstrumentClickInUpload extends Component<any, any> {
)} */} )} */}
<View className="tips-num"> <View className="tips-num">
{punchInInfo.clockContent.length}/100 {punchInInfo.clockContent.length}/100
{/* {punchInInfo.clockContent.length}/100 */}
</View> </View>
</View> </View>
</View> </View>

@ -32,9 +32,11 @@ export default class Recording extends Component<any, any> {
this.state = { this.state = {
name: "护理历程", name: "护理历程",
current: 0, current: 0,
ViewAddInstrument:false, //用来记录有没有添加设备
array: [1, 2, 3, 4, 5], array: [1, 2, 3, 4, 5],
recordList: [], recordList: [],
bindingInstrumentList: [], bindingInstrumentList: [],
clockShow: false,
curIndex: null, curIndex: null,
clockStatistics: [], clockStatistics: [],
statistics: [], statistics: [],
@ -62,9 +64,9 @@ export default class Recording extends Component<any, any> {
}; };
} }
componentDidMount() {} componentDidMount() { }
componentWillUnmount() {} componentWillUnmount() { }
// 格式化时间 // 格式化时间
getTime(time) { getTime(time) {
const hour = time.slice(0, 2); const hour = time.slice(0, 2);
@ -86,15 +88,21 @@ export default class Recording extends Component<any, any> {
} }
// 获取护理历程 // 获取护理历程
async getRecord(id) { async getRecord(id) {
let data = {}; let data = {};
if (id != null) { 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) { 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, "."); let createTime = getdates(item.createTime)
item.createTime = createTime&& createTime.replace(/-/g, ".");
}); });
this.setState({ recordList: res.data.rows }); this.setState({ recordList: res.data.rows });
} }
@ -133,7 +141,9 @@ export default class Recording extends Component<any, any> {
/**分页获取用户的打卡记录 page size*/ /**分页获取用户的打卡记录 page size*/
async getClockStatistics(year = this.state.year) { 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) { if (res.data.code === 200) {
res.data.data.reverse(); res.data.data.reverse();
if (res.data.data.length > 0) { if (res.data.data.length > 0) {
res.data.data.map((item, index) => { res.data.data.map((item, index) => {
@ -172,7 +182,8 @@ export default class Recording extends Component<any, any> {
} }
// 文本框输入文字 // 文本框输入文字
handleTextareaInput = (e) => { handleTextareaInput = (e) => {
this.setState({ punchInInfo: { clockContent: e.detail.value } }); const punchInInfo = this.state.punchInInfo;
this.setState({ punchInInfo: { ...punchInInfo, clockContent: e.detail.value } });
}; };
// 打开/关闭弹窗 // 打开/关闭弹窗
setShow(show: boolean) { setShow(show: boolean) {
@ -205,32 +216,68 @@ export default class Recording extends Component<any, any> {
}; };
let res = await InstrumentInfo.apiClock.getList(data); let res = await InstrumentInfo.apiClock.getList(data);
if (res.data.code === 200) { if (res.data.code === 200) {
console.log(this.state.clockStatistics, 88888); console.log(res, 88888,this.state.clockStatistics,id);
this.state.clockStatistics.map((item) => { this.state.clockStatistics.map((item) => {
if (item.id === id) { if (item.id === id) {
item.detail = res.data.data; item.detail = res.data.data;
item.detail.map((obj) => { item.detail.map((obj) => {
obj.updateTime = getdates(obj.updateTime).replace(/-/g, ".");
let updateTime =getdates(obj.updateTime)
obj.updateTime = updateTime && updateTime.replace(/-/g, ".");
}); });
} }
}); });
this.setState({ clockStatistics: this.state.clockStatistics }); this.setState({ clockStatistics: this.state.clockStatistics });
} }
} }
async DayTime() {
let storedData = Taro.getStorageSync('DayTime')
const day = new Date();
if (storedData === undefined || storedData === "") {
this.setState({
clockShow: false
})
} else {
const storedDate = new Date(storedData);
const currentDate = new Date(day.toISOString());
const isSameDate = storedDate.toDateString() === currentDate.toDateString();
if (isSameDate) {
this.setState({
clockShow: true
})
} else {
this.setState({
clockShow: false
})
}
}
}
async onLoad(options) {
const ViewAddInstrument = options.param;
this.setState({
ViewAddInstrument: ViewAddInstrument
})
async onLoad() {
this.getRecord(null); this.getRecord(null);
this.getBindingInstrumentList(); this.getBindingInstrumentList();
this.getLatestClockRecord(); this.getLatestClockRecord();
this.getClockStatistics(); this.getClockStatistics();
this.DayTime()
} }
componentDidShow() {} componentDidShow() { }
componentDidHide() {} componentDidHide() { }
async initData() {} async initData() { }
// 选择年份 // 选择年份
onChangeYear(event) { onChangeYear(event) {
this.setState({ year: event.detail.value }); this.setState({ year: event.detail.value });
@ -304,7 +351,14 @@ export default class Recording extends Component<any, any> {
t2: "您已完成今日打卡", t2: "您已完成今日打卡",
btn1show: false, btn1show: false,
}).then(() => { }).then(() => {
let data = new Date
Taro.setStorageSync('DayTime', data.toISOString())
this.setState({
clockShow: true
})
this.getClockStatistics();
this.setShow(false); this.setShow(false);
}); });
}); });
} }
@ -319,7 +373,9 @@ export default class Recording extends Component<any, any> {
array, array,
name, name,
recordList, recordList,
ViewAddInstrument,
bindingInstrumentList, bindingInstrumentList,
clockShow,
curIndex, curIndex,
clockStatistics, clockStatistics,
statistics, statistics,
@ -328,7 +384,6 @@ export default class Recording extends Component<any, any> {
monthTime, monthTime,
show, show,
punchInInfo, punchInInfo,
clockContent,
} = this.state; } = this.state;
return ( return (
@ -433,10 +488,10 @@ export default class Recording extends Component<any, any> {
tag_active: item.online === 2, tag_active: item.online === 2,
})} })}
> >
{item.online ? "在线" : "离线"} {item.online === 1 ? "在线" : "离线"}
</View> </View>
</View> </View>
{item.instrumentType === 2 && ( {item.instrumentType === 1 && (
<View <View
className="top-right" className="top-right"
onClick={this.toReport.bind( onClick={this.toReport.bind(
@ -585,7 +640,8 @@ export default class Recording extends Component<any, any> {
))} ))}
</View> </View>
<View className="month_item_date"> <View className="month_item_date">
PRO{" "} {/* 小紫弹智能射频仪、花至抗老射频仪PRO{" "} */}
{obj.instrumentName === null ? "" : obj.instrumentName}
</View> </View>
<View className="month_item_note"> <View className="month_item_note">
{obj.clockContent} {obj.clockContent}
@ -601,14 +657,18 @@ 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)}> !clockShow && ViewAddInstrument === "true" && (
<View className="footer flex aitems">
</View> <View className="btn" onClick={this.setShow.bind(this, true)}>
<View className="text" onClick={this.back}>
</View>
{/* <View className="text" onClick={this.back}>
&gt; &gt;
</View> </View> */}
</View> </View>
)
}
<Popup show={show} onClose={() => this.setState({ show: false })}> <Popup show={show} onClose={() => this.setState({ show: false })}>
<View className="popBox"> <View className="popBox">

@ -94,14 +94,13 @@ const date = () => {
}; };
const getdates = (date) => { const getdates = (date) => {
date = date.replace(/-/g, "/"); // 部分iphone new Date不兼容[2023-01-01]格式,需要转换 date = date && date.replace(/-/g, "/"); // 部分iphone new Date不兼容[2023-01-01]格式,需要转换
const year = new Date(date).getFullYear(); const year = new Date(date).getFullYear();
const month = new Date(date).getMonth() + 1; const month = new Date(date).getMonth() + 1;
const day = new Date(date).getDate(); const day = new Date(date).getDate();
const hour = new Date(date).getHours(); const hour = new Date(date).getHours();
const minute = new Date(date).getMinutes(); const minute = new Date(date).getMinutes();
const second = new Date(date).getSeconds(); const second = new Date(date).getSeconds();
// return `${[year, month, day].map(formatNumber).join('-')} ${[hour, minute, second].map(formatNumber).join(':')}` // return `${[year, month, day].map(formatNumber).join('-')} ${[hour, minute, second].map(formatNumber).join(':')}`
return `${[year, month, day].map(formatNumber).join("-")}`; return `${[year, month, day].map(formatNumber).join("-")}`;
}; };

Loading…
Cancel
Save