rongweikang 2 years ago
commit dd73d2af34

@ -91,7 +91,7 @@ export default class AtCalendarController extends React.Component<any, any> {
return ( return (
<Block> <Block>
<View className='at-calendar__controller controller flex-justify-sb'> <View className="at-calendar__controller controller flex-justify-sb">
{hideArrow ? null : ( {hideArrow ? null : (
<View <View
className={classnames( className={classnames(
@ -103,9 +103,9 @@ export default class AtCalendarController extends React.Component<any, any> {
onClick={this.props.onPreMonth.bind(this, isMinMonth)} onClick={this.props.onPreMonth.bind(this, isMinMonth)}
/> />
)} )}
<View className='calendar-top-date-btn'> <View className="calendar-top-date-btn">
<View <View
style='display: flex;align-items: center;' style="display: flex;align-items: center;"
onClick={this.openDate} onClick={this.openDate}
> >
{/* <Text className="controller__info"></Text> */} {/* <Text className="controller__info"></Text> */}
@ -113,10 +113,10 @@ export default class AtCalendarController extends React.Component<any, any> {
<Text style={{ fontSize: "32rpx", fontWeight: "600" }}> <Text style={{ fontSize: "32rpx", fontWeight: "600" }}>
{dayjsDate.format("YYYY.MM.DD")} {dayjsDate.format("YYYY.MM.DD")}
</Text> </Text>
<View style='margin-left: 34rpx;'> <View style="margin-left: 34rpx;">
<Image <Image
src={require("../img/calendar.png")} src={require("../img/calendar.png")}
style='width:28rpx;height:28rpx;' style="width:28rpx;height:28rpx;"
/> />
</View> </View>
</View> </View>
@ -127,33 +127,33 @@ export default class AtCalendarController extends React.Component<any, any> {
<Popup <Popup
show={showDatePicker} show={showDatePicker}
position='bottom' position="bottom"
// close-icon="/img/fr200/close.png" // close-icon="/img/fr200/close.png"
round round
onClick={this.onClickStop} onClick={this.onClickStop}
// onClose={this.onPopupClose} onClose={this.onPopupClose}
> >
<View className='toolbar'> <View className="toolbar">
<View className='toolbar_title'> <View className="toolbar_title">
<Text></Text> <Text></Text>
<View <View
style='margin-left: 20rpx;color:#666;font-size: 34rpx' style="margin-left: 20rpx;color:#666;font-size: 34rpx"
className='at-icon at-icon-close popup-date-close' className="at-icon at-icon-close popup-date-close"
onClick={this.onPopupClose} onClick={this.onPopupClose}
></View> ></View>
</View> </View>
<View className='select_box'> <View className="select_box">
<View className='text'></View> <View className="text"></View>
<View className='date'>{currentDate}</View> <View className="date">{currentDate}</View>
</View> </View>
</View> </View>
<DatetimePicker <DatetimePicker
type='date' type="date"
value={curDate} value={curDate}
maxDate={maxDate} maxDate={maxDate}
onInput={_.throttle(this.onInput.bind(this), 500)} onInput={_.throttle(this.onInput.bind(this), 500)}
/> />
<View className='btn_confirm' onClick={this.onSelectDate}> <View className="btn_confirm" onClick={this.onSelectDate}>
</View> </View>
</Popup> </Popup>

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Before

Width:  |  Height:  |  Size: 130 KiB

After

Width:  |  Height:  |  Size: 130 KiB

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 78 KiB

Before

Width:  |  Height:  |  Size: 73 KiB

After

Width:  |  Height:  |  Size: 73 KiB

Before

Width:  |  Height:  |  Size: 77 KiB

After

Width:  |  Height:  |  Size: 77 KiB

Before

Width:  |  Height:  |  Size: 80 KiB

After

Width:  |  Height:  |  Size: 80 KiB

Before

Width:  |  Height:  |  Size: 81 KiB

After

Width:  |  Height:  |  Size: 81 KiB

@ -1,11 +1,17 @@
import Taro from "@tarojs/taro"; 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 , Tab, Tabs, Dialog, Popup } from "@antmjs/vantui"; import { Progress, Tab, Tabs, Dialog, Popup } from "@antmjs/vantui";
import { showModal } from "@/utils/traoAPI"; import { showModal } from "@/utils/traoAPI";
import { import {
Block, View, Text, Image, Input, Button, Textarea, Block,
View,
Text,
Image,
Input,
Button,
Textarea,
} from "@tarojs/components"; } from "@tarojs/components";
import { date, getdates, previewImage } from "@/utils/util"; import { date, getdates, previewImage } from "@/utils/util";
@ -16,8 +22,7 @@ import { InstrumentInfo } from "@/utils/Interface";
// 引入ecahrts图表 // 引入ecahrts图表
// import EchartsForm from '@/moduleIOT/pages/iotCarePlan/components/Echart_face' // import EchartsForm from '@/moduleIOT/pages/iotCarePlan/components/Echart_face'
import EchartsForm from '../../../moduleIOT/pages/iotCarePlan/components/Echart_face' import EchartsForm from "../../../moduleIOT/pages/iotCarePlan/components/Echart_face";
/** 自定义组件 **/ /** 自定义组件 **/
import "./face_report_one.less"; import "./face_report_one.less";
@ -26,19 +31,19 @@ export default class Index extends Component<any, any> {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
EchartsData:{}, EchartsData: {},
reportShow: true, reportShow: true,
name: "template模板页", name: "template模板页",
statistics: {}, statistics: {},
recordList: [], recordList: [],
modeImage: require("@/img/face-report/face.png"), modeImage: require("../../img/face-report/face.png"),
recordData: { recordData: {
modeName: '基础班脸部', modeName: "基础班脸部",
filtered:111, filtered: 111,
faceEnergy:222, faceEnergy: 222,
average:2222, average: 2222,
max:33, max: 33,
min:7 min: 7,
}, },
year: new Date().getFullYear(), year: new Date().getFullYear(),
show: false, show: false,
@ -64,9 +69,9 @@ export default class Index extends Component<any, any> {
}; };
} }
componentDidMount() { } componentDidMount() {}
componentWillUnmount() { } componentWillUnmount() {}
// 打开/关闭弹窗 // 打开/关闭弹窗
setShow(show: boolean) { setShow(show: boolean) {
@ -74,14 +79,13 @@ export default class Index extends Component<any, any> {
} }
// 查询用户护理记录的当月统计信息 // 查询用户护理记录的当月统计信息
async getStatistics(id) { async getStatistics(id) {
let ids = Number(id);
let ids = Number(id)
let data = {}; let data = {};
if (ids != null) { if (ids != null) {
data["nursingId"] = ids; data["nursingId"] = ids;
} }
let res = await InstrumentInfo.apiNursingLog.getStatisticsFace(data); let res = await InstrumentInfo.apiNursingLog.getStatisticsFace(data);
if (res.data.code === 200) { if (res.data.code === 200) {
this.setState({ statistics: res.data.data }); this.setState({ statistics: res.data.data });
} }
@ -116,7 +120,9 @@ export default class Index extends Component<any, any> {
// 文本框输入文字 // 文本框输入文字
handleTextareaInput = (e) => { handleTextareaInput = (e) => {
const punchInInfo = this.state.punchInInfo; const punchInInfo = this.state.punchInInfo;
this.setState({ punchInInfo: { ...punchInInfo, clockContent: e.detail.value } }); this.setState({
punchInInfo: { ...punchInInfo, clockContent: e.detail.value },
});
}; };
async submit() { async submit() {
let punchInInfo = this.state.punchInInfo || {}; let punchInInfo = this.state.punchInInfo || {};
@ -139,33 +145,29 @@ export default class Index extends Component<any, any> {
t2: "您已完成今日打卡", t2: "您已完成今日打卡",
btn1show: false, btn1show: false,
}).then(() => { }).then(() => {
let data = new Date let data = new Date();
Taro.setStorageSync('DayTime', data.toISOString()) Taro.setStorageSync("DayTime", data.toISOString());
this.setState({ this.setState({
clockShow: true clockShow: true,
}) });
this.getClockStatistics(); this.getClockStatistics();
this.setShow(false); this.setShow(false);
}); });
}); });
} }
/**分页获取用户的打卡记录 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 });
console.log(res, '查看返回', year); console.log(res, "查看返回", 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) {
let clockStatistics = this.state.clockStatistics let clockStatistics = this.state.clockStatistics;
clockStatistics=res.data.data clockStatistics = res.data.data;
this.setState({ clockStatistics }); this.setState({ clockStatistics });
} }
} }
} }
// 获取当月打卡记录 // 获取当月打卡记录
@ -176,9 +178,7 @@ export default class Index 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) {
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) => {
@ -225,23 +225,18 @@ export default class Index extends Component<any, any> {
this.setState({ punchInInfo }); this.setState({ punchInInfo });
} }
async getRouteId() { async getRouteId() {
let punchInInfo =this.state.punchInInfo let punchInInfo = this.state.punchInInfo;
const searchParams = new URLSearchParams(window.location.search); const searchParams = new URLSearchParams(window.location.search);
const id = searchParams.get("id"); const id = searchParams.get("id");
const recordId = searchParams.get("recordId"); const recordId = searchParams.get("recordId");
this.getStatistics(id); this.getStatistics(id);
let res1 = await InstrumentInfo.apiClock.getLatestClockRecord(); let res1 = await InstrumentInfo.apiClock.getLatestClockRecord();
punchInInfo.clockContent =res1.data.data.clockContent punchInInfo.clockContent = res1.data.data.clockContent;
punchInInfo.clockImageList =res1.data.data.clockImg punchInInfo.clockImageList = res1.data.data.clockImg;
this.setState({ punchInInfo }); this.setState({ punchInInfo });
setTimeout(function() { setTimeout(function () {});
}, )
} }
getTime(time) { getTime(time) {
const hour = time.slice(0, 2); const hour = time.slice(0, 2);
@ -254,198 +249,227 @@ setTimeout(function() {
return minute + "分" + second + "秒"; return minute + "分" + second + "秒";
} }
} }
onLoad(options) { onLoad(options) {
let Bool = JSON.parse(options?.report);
let Bool = JSON.parse(options?.report)
if (!Bool) { if (!Bool) {
this.setState({ this.setState({
reportShow: Bool reportShow: Bool,
}) });
} }
this.init(options) this.init(options);
this.getRouteId(); this.getRouteId();
this.getClockStatistics() this.getClockStatistics();
} }
init(options){ init(options) {
let obj = JSON.parse(options.obj);
let obj =JSON.parse(options.obj) let recordData = this.state.recordData;
let modeImage = this.state.modeImage;
let recordData =this.state.recordData switch (obj.modeName) {
let modeImage =this.state.modeImage case "基础班脸部":
modeImage = require("../../img/face-report/face.png");
switch(obj.modeName) { break;
case '基础班脸部': case "基础版眼部":
modeImage =require("@/img/face-report/face.png") modeImage = require("../../img/face-report/eye.png");
break; break;
case '基础版眼部': case "法令纹Pro":
modeImage =require("@/img/face-report/eye.png") modeImage = require("../../img/face-report/nasolabial_Pro.png");
break; break;
case '法令纹Pro': case "下颌线Pro":
modeImage =require("@/img/face-report/nasolabial_Pro.png") modeImage = require("../../img/face-report/Mandibular_Pro.png");
break; break;
case '下颌线Pro': case "抬头纹Pro":
modeImage =require("@/img/face-report/Mandibular_Pro.png") modeImage = require("../../img/face-report/Head_lift_Pro.png");
break; break;
case '抬头纹Pro':
modeImage =require("@/img/face-report/Head_lift_Pro.png")
break;
default: default:
}
recordData ={
...obj,
...obj.data
} }
this.setState({recordData,modeImage,EchartsData:{...obj}}) recordData = {
...obj,
...obj.data,
};
this.setState({ recordData, modeImage, EchartsData: { ...obj } });
} }
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, modeImage, recordData, show, clockStatistics, punchInInfo, monthTime, reportShow,EchartsData } = this.state; let {
name,
statistics,
modeImage,
recordData,
show,
clockStatistics,
punchInInfo,
monthTime,
reportShow,
EchartsData,
} = this.state;
return ( return (
<Block> <Block>
<Navbar isBack titleSlot='护理报告'></Navbar> <Navbar isBack titleSlot="护理报告"></Navbar>
<View className='statistic m-x-30 flex aitems'> <View className="statistic m-x-30 flex aitems">
<View className='statistic_item'> <View className="statistic_item">
<View className='statistic_title'> <View className="statistic_title">
<text>{statistics.nursingNum}</text> <text>{statistics.nursingNum}</text>
<text className='num'></text> <text className="num"></text>
</View> </View>
<View className='statistic_desc'></View> <View className="statistic_desc"></View>
</View> </View>
<View className='statistic_item'> <View className="statistic_item">
<View className='statistic_title'>{statistics.nursingTime}</View> <View className="statistic_title">{statistics.nursingTime}</View>
<View className='statistic_desc'></View> <View className="statistic_desc"></View>
</View> </View>
</View> </View>
<View className='main m-x-30'> <View className="main m-x-30">
<View className='products_item' style='border: none'> <View className="products_item" style="border: none">
<View className='products_middle flex'> <View className="products_middle flex">
<View className='left'> <View className="left">
<Image <Image
className='cover' className="cover"
src={modeImage} src={modeImage}
mode='aspectFill' mode="aspectFill"
></Image> ></Image>
<View className='face_type'>{recordData.modeName}</View> <View className="face_type">{recordData.modeName}</View>
</View> </View>
<View className='content'> <View className="content">
<View className='content_top'> <View className="content_top">
<View className="desc_box">
<View className='desc_box'> <View className="desc">
<View className='desc'>{recordData.modeName === '下颌线Pro'?<View className="itemStyel">[1]</View>:null}&nbsp;&nbsp;{recordData.filtered}</View>
<View className='desc'> {recordData.modeName === "下颌线Pro" ? (
{recordData.modeName === '下颌线Pro'?<View className="itemStyel">[2]</View>:null}&nbsp;&nbsp;{recordData.faceEnergy} <View className="itemStyel">[1]</View>
) : null}
&nbsp;&nbsp;{recordData.filtered}
</View> </View>
<View className='desc'> <View className="desc">
&nbsp;&nbsp;<View className="itemStyelone">[3]</View>{recordData.average}
{recordData.modeName === "下颌线Pro" ? (
<View className="itemStyel">[2]</View>
) : null}
&nbsp;&nbsp;{recordData.faceEnergy}
</View> </View>
<View className='desc'> <View className="desc">
&nbsp;&nbsp;<View className="itemStyel">[4]</View>{recordData.max} &nbsp;&nbsp;<View className="itemStyeltwo">[5]</View>{recordData.min} &nbsp;&nbsp;
<View className="itemStyelone">[3]</View>
{recordData.average}
</View>
<View className="desc">
&nbsp;&nbsp;<View className="itemStyel">[4]</View>
{recordData.max} &nbsp;&nbsp;
<View className="itemStyeltwo">[5]</View>
{recordData.min}
</View> </View>
</View> </View>
</View> </View>
</View> </View>
</View> </View>
</View> </View>
<View className='main_title'>-{recordData.modeName}</View> <View className="main_title">-{recordData.modeName}</View>
<View className='eacharts'> <View className="eacharts">
<EchartsForm EchartsData={EchartsData}></EchartsForm> <EchartsForm EchartsData={EchartsData}></EchartsForm>
</View> </View>
</View> </View>
<View className='bottom-title'> <View className="bottom-title">
<View className='text-title'>[1] :1,使11 <View className="text-title">
[1]
:1,使11
</View>
<View className="text-title">
[2]:
使
</View>
<View className="text-title">
[3]:使
<br />
</View>
<View className="text-title">
[4]:
<br />
</View>
<View className="text-title">
[5]:
</View> </View>
<View className='text-title'>[2]: 使</View>
<View className='text-title'>[3]:使<br /></View>
<View className='text-title'>[4]:<br /></View>
<View className='text-title'>
[5]:</View>
</View> </View>
{reportShow ? ( {reportShow ? (
<View className='footer flex aitems'> <View className="footer flex aitems">
<View className='btn' onClick={this.setShow.bind(this, true)}></View> <View className="btn" onClick={this.setShow.bind(this, true)}>
<View className='text flex aitems'>
</View>
<View className="text flex aitems">
<View onClick={this.GoIndex}></View> <View onClick={this.GoIndex}></View>
<Image <Image src={require("@/img/right.png")} mode="aspectFill"></Image>
src={require("@/img/right.png")}
mode='aspectFill'
></Image>
</View> </View>
</View> </View>
) : null} ) : null}
<Popup show={show} onClose={() => this.setState({ show: false })}> <Popup show={show} onClose={() => this.setState({ show: false })}>
<View className='popBox'> <View className="popBox">
<Image <Image
className='close_icon' className="close_icon"
src={require("@/img/close.png")} src={require("@/img/close.png")}
mode='widthFix' mode="widthFix"
onClick={this.setShow.bind(this, false)} onClick={this.setShow.bind(this, false)}
></Image> ></Image>
<View className='popTitle'></View> <View className="popTitle"></View>
<View className='popSubtitle'> <View className="popSubtitle">
<View className='bold'>{clockStatistics[0]?.clockNum}</View>{" "} <View className="bold">{clockStatistics[0]?.clockNum}</View>{" "}
<View className='bold'> <View className="bold">
{(clockStatistics[0]?.percentage * 100).toFixed(1)}% {(clockStatistics[0]?.percentage * 100).toFixed(1)}%
</View> </View>
</View> </View>
<View className='img_box'> <View className="img_box">
{punchInInfo.clockImageList.map((item, index) => ( {punchInInfo.clockImageList.map((item, index) => (
<View key={item} className='img'> <View key={item} className="img">
<Image className='showImg' src={item} mode='widthFix'></Image> <Image className="showImg" src={item} mode="widthFix"></Image>
<Image <Image
className='closeImg' className="closeImg"
src={require("@/img/close1.png")} src={require("@/img/close1.png")}
mode='widthFix' mode="widthFix"
onClick={this.delImg.bind(this, index)} onClick={this.delImg.bind(this, index)}
></Image> ></Image>
</View> </View>
))} ))}
{punchInInfo.clockImageList.length < 3 && ( {punchInInfo.clockImageList.length < 3 && (
<View <View
className='addBox' className="addBox"
onClick={this.handleChooseImage.bind(this)} onClick={this.handleChooseImage.bind(this)}
> >
<Image <Image
className='showImg' className="showImg"
src={require("@/img/clock_in_upload/add-image.png")} src={require("@/img/clock_in_upload/add-image.png")}
mode='widthFix' mode="widthFix"
></Image> ></Image>
</View> </View>
)} )}
</View> </View>
<View className='info4'> <View className="info4">
<View className='content'> <View className="content">
<Textarea <Textarea
placeholderStyle='color: #ccc; font-size: 26rpx;font-weight: 400;font-family: PingFang SC;' placeholderStyle="color: #ccc; font-size: 26rpx;font-weight: 400;font-family: PingFang SC;"
placeholder='请记录一下今天的护理心得吧' placeholder="请记录一下今天的护理心得吧"
maxlength={120} maxlength={120}
onInput={this.handleTextareaInput.bind(this)} onInput={this.handleTextareaInput.bind(this)}
value={punchInInfo.clockContent} value={punchInInfo.clockContent}
></Textarea> ></Textarea>
</View> </View>
<View className='tip'> <View className="tip">
{"" + (punchInInfo.clockContent.length || 0) + "/120"} {"" + (punchInInfo.clockContent.length || 0) + "/120"}
</View> </View>
</View> </View>
<View className='popbtnbox flex aitems jcenter'> <View className="popbtnbox flex aitems jcenter">
<View className='btn1' onClick={this.submit.bind(this)}> <View className="btn1" onClick={this.submit.bind(this)}>
</View> </View>
</View> </View>

Loading…
Cancel
Save