From 91becf3a69aad2f4c3d4d2453994f95b5975cf29 Mon Sep 17 00:00:00 2001 From: blak-kong <546598185@qq.com> Date: Fri, 29 Mar 2024 17:56:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=B4=E6=97=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/calendar/controller/index.tsx | 32 +- src/{img => moduleIOT}/m01/custom.png | Bin src/{img => moduleIOT}/m01/electric.png | Bin src/{img => moduleIOT}/m01/m01-avatar.png | Bin src/{img => moduleIOT}/m01/selected.png | Bin src/{img => moduleIOT}/m01/unselected.png | Bin .../img/face-report/Head_lift_Pro.png | Bin .../img/face-report/Mandibular_Pro.png | Bin src/{ => recoding}/img/face-report/eye.png | Bin src/{ => recoding}/img/face-report/face.png | Bin .../img/face-report/nasolabial_Pro.png | Bin .../pages/face_report_one/face_report_one.tsx | 328 ++++++++++-------- 12 files changed, 192 insertions(+), 168 deletions(-) rename src/{img => moduleIOT}/m01/custom.png (100%) rename src/{img => moduleIOT}/m01/electric.png (100%) rename src/{img => moduleIOT}/m01/m01-avatar.png (100%) rename src/{img => moduleIOT}/m01/selected.png (100%) rename src/{img => moduleIOT}/m01/unselected.png (100%) rename src/{ => recoding}/img/face-report/Head_lift_Pro.png (100%) rename src/{ => recoding}/img/face-report/Mandibular_Pro.png (100%) rename src/{ => recoding}/img/face-report/eye.png (100%) rename src/{ => recoding}/img/face-report/face.png (100%) rename src/{ => recoding}/img/face-report/nasolabial_Pro.png (100%) diff --git a/src/components/calendar/controller/index.tsx b/src/components/calendar/controller/index.tsx index b89783d..5d7f787 100644 --- a/src/components/calendar/controller/index.tsx +++ b/src/components/calendar/controller/index.tsx @@ -91,7 +91,7 @@ export default class AtCalendarController extends React.Component { return ( - + {hideArrow ? null : ( { onClick={this.props.onPreMonth.bind(this, isMinMonth)} /> )} - + {/* */} @@ -113,10 +113,10 @@ export default class AtCalendarController extends React.Component { {dayjsDate.format("YYYY.MM.DD")} - + @@ -127,33 +127,33 @@ export default class AtCalendarController extends React.Component { - - + + 选择日期 - - 已选择日期 - {currentDate} + + 已选择日期 + {currentDate} - + 确定 diff --git a/src/img/m01/custom.png b/src/moduleIOT/m01/custom.png similarity index 100% rename from src/img/m01/custom.png rename to src/moduleIOT/m01/custom.png diff --git a/src/img/m01/electric.png b/src/moduleIOT/m01/electric.png similarity index 100% rename from src/img/m01/electric.png rename to src/moduleIOT/m01/electric.png diff --git a/src/img/m01/m01-avatar.png b/src/moduleIOT/m01/m01-avatar.png similarity index 100% rename from src/img/m01/m01-avatar.png rename to src/moduleIOT/m01/m01-avatar.png diff --git a/src/img/m01/selected.png b/src/moduleIOT/m01/selected.png similarity index 100% rename from src/img/m01/selected.png rename to src/moduleIOT/m01/selected.png diff --git a/src/img/m01/unselected.png b/src/moduleIOT/m01/unselected.png similarity index 100% rename from src/img/m01/unselected.png rename to src/moduleIOT/m01/unselected.png diff --git a/src/img/face-report/Head_lift_Pro.png b/src/recoding/img/face-report/Head_lift_Pro.png similarity index 100% rename from src/img/face-report/Head_lift_Pro.png rename to src/recoding/img/face-report/Head_lift_Pro.png diff --git a/src/img/face-report/Mandibular_Pro.png b/src/recoding/img/face-report/Mandibular_Pro.png similarity index 100% rename from src/img/face-report/Mandibular_Pro.png rename to src/recoding/img/face-report/Mandibular_Pro.png diff --git a/src/img/face-report/eye.png b/src/recoding/img/face-report/eye.png similarity index 100% rename from src/img/face-report/eye.png rename to src/recoding/img/face-report/eye.png diff --git a/src/img/face-report/face.png b/src/recoding/img/face-report/face.png similarity index 100% rename from src/img/face-report/face.png rename to src/recoding/img/face-report/face.png diff --git a/src/img/face-report/nasolabial_Pro.png b/src/recoding/img/face-report/nasolabial_Pro.png similarity index 100% rename from src/img/face-report/nasolabial_Pro.png rename to src/recoding/img/face-report/nasolabial_Pro.png diff --git a/src/recoding/pages/face_report_one/face_report_one.tsx b/src/recoding/pages/face_report_one/face_report_one.tsx index 7f8d8b6..9b4926d 100644 --- a/src/recoding/pages/face_report_one/face_report_one.tsx +++ b/src/recoding/pages/face_report_one/face_report_one.tsx @@ -1,11 +1,17 @@ import Taro from "@tarojs/taro"; import classnames from "classnames"; 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 { - Block, View, Text, Image, Input, Button, Textarea, + Block, + View, + Text, + Image, + Input, + Button, + Textarea, } from "@tarojs/components"; import { date, getdates, previewImage } from "@/utils/util"; @@ -16,8 +22,7 @@ import { InstrumentInfo } from "@/utils/Interface"; // 引入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 "./face_report_one.less"; @@ -26,19 +31,19 @@ export default class Index extends Component { constructor(props) { super(props); this.state = { - EchartsData:{}, + EchartsData: {}, reportShow: true, name: "template模板页", statistics: {}, recordList: [], - modeImage: require("@/img/face-report/face.png"), + modeImage: require("../../img/face-report/face.png"), recordData: { - modeName: '基础班脸部', - filtered:111, - faceEnergy:222, - average:2222, - max:33, - min:7 + modeName: "基础班脸部", + filtered: 111, + faceEnergy: 222, + average: 2222, + max: 33, + min: 7, }, year: new Date().getFullYear(), show: false, @@ -64,9 +69,9 @@ export default class Index extends Component { }; } - componentDidMount() { } + componentDidMount() {} - componentWillUnmount() { } + componentWillUnmount() {} // 打开/关闭弹窗 setShow(show: boolean) { @@ -74,14 +79,13 @@ export default class Index extends Component { } // 查询用户护理记录的当月统计信息 async getStatistics(id) { - - let ids = Number(id) + let ids = Number(id); let data = {}; if (ids != null) { data["nursingId"] = ids; } let res = await InstrumentInfo.apiNursingLog.getStatisticsFace(data); - + if (res.data.code === 200) { this.setState({ statistics: res.data.data }); } @@ -116,7 +120,9 @@ export default class Index extends Component { // 文本框输入文字 handleTextareaInput = (e) => { const punchInInfo = this.state.punchInInfo; - this.setState({ punchInInfo: { ...punchInInfo, clockContent: e.detail.value } }); + this.setState({ + punchInInfo: { ...punchInInfo, clockContent: e.detail.value }, + }); }; async submit() { let punchInInfo = this.state.punchInInfo || {}; @@ -139,33 +145,29 @@ export default class Index extends Component { t2: "您已完成今日打卡", btn1show: false, }).then(() => { - let data = new Date - Taro.setStorageSync('DayTime', data.toISOString()) + let data = new Date(); + Taro.setStorageSync("DayTime", data.toISOString()); this.setState({ - clockShow: true - }) + 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); + console.log(res, "查看返回", year); if (res.data.code === 200) { - res.data.data.reverse(); if (res.data.data.length > 0) { - let clockStatistics = this.state.clockStatistics - clockStatistics=res.data.data - - + let clockStatistics = this.state.clockStatistics; + clockStatistics = res.data.data; + this.setState({ clockStatistics }); - } - + } } } // 获取当月打卡记录 @@ -176,9 +178,7 @@ export default class Index extends Component { }; let res = await InstrumentInfo.apiClock.getList(data); if (res.data.code === 200) { - this.state.clockStatistics.map((item) => { - if (item.id === id) { item.detail = res.data.data; item.detail.map((obj) => { @@ -225,23 +225,18 @@ export default class Index extends Component { this.setState({ punchInInfo }); } async getRouteId() { - let punchInInfo =this.state.punchInInfo + let punchInInfo = this.state.punchInInfo; const searchParams = new URLSearchParams(window.location.search); const id = searchParams.get("id"); const recordId = searchParams.get("recordId"); this.getStatistics(id); let res1 = await InstrumentInfo.apiClock.getLatestClockRecord(); - punchInInfo.clockContent =res1.data.data.clockContent - punchInInfo.clockImageList =res1.data.data.clockImg - - + punchInInfo.clockContent = res1.data.data.clockContent; + punchInInfo.clockImageList = res1.data.data.clockImg; + this.setState({ punchInInfo }); - -setTimeout(function() { - -}, ) - - + + setTimeout(function () {}); } getTime(time) { const hour = time.slice(0, 2); @@ -254,198 +249,227 @@ setTimeout(function() { return minute + "分" + second + "秒"; } } - onLoad(options) { - - let Bool = JSON.parse(options?.report) + onLoad(options) { + let Bool = JSON.parse(options?.report); if (!Bool) { this.setState({ - reportShow: Bool - }) + reportShow: Bool, + }); } - this.init(options) + this.init(options); 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 - let modeImage =this.state.modeImage - - switch(obj.modeName) { - case '基础班脸部': - modeImage =require("@/img/face-report/face.png") - break; - case '基础版眼部': - modeImage =require("@/img/face-report/eye.png") - break; - case '法令纹Pro': - modeImage =require("@/img/face-report/nasolabial_Pro.png") - break; - case '下颌线Pro': - modeImage =require("@/img/face-report/Mandibular_Pro.png") - break; - case '抬头纹Pro': - modeImage =require("@/img/face-report/Head_lift_Pro.png") - break; + switch (obj.modeName) { + case "基础班脸部": + modeImage = require("../../img/face-report/face.png"); + break; + case "基础版眼部": + modeImage = require("../../img/face-report/eye.png"); + break; + case "法令纹Pro": + modeImage = require("../../img/face-report/nasolabial_Pro.png"); + break; + case "下颌线Pro": + modeImage = require("../../img/face-report/Mandibular_Pro.png"); + break; + case "抬头纹Pro": + modeImage = require("../../img/face-report/Head_lift_Pro.png"); + break; 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 = () => { Taro.switchTab({ url: "/pages/index/index" }); }; 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 ( - - - - + + + + {statistics.nursingNum} - + - 本月护理天数 + 本月护理天数 - - {statistics.nursingTime} - 本月护理时间 + + {statistics.nursingTime} + 本月护理时间 - - - - - + + + + - {recordData.modeName} + {recordData.modeName} - - - - - 能量发数{recordData.modeName === '下颌线Pro'?[1]:null}  :{recordData.filtered}发 - - 脸部能量{recordData.modeName === '下颌线Pro'?[2]:null}  :≈{recordData.faceEnergy}焦耳 + + + + + 能量发数 + {recordData.modeName === "下颌线Pro" ? ( + [1] + ) : null} +   :{recordData.filtered}发 - - 平均能量等级  [3]:{recordData.average} + + 脸部能量 + {recordData.modeName === "下颌线Pro" ? ( + [2] + ) : null} +   :≈{recordData.faceEnergy}焦耳 - - 最大等级  [4]:{recordData.max}级 最小等级  [5]:{recordData.min}级 + + 平均能量等级   + [3]: + {recordData.average} + + + 最大等级  [4] + :{recordData.max}级 最小等级   + [5]: + {recordData.min}级 - - 能量等级图谱-{recordData.modeName} - - - + 能量等级图谱-{recordData.modeName} + + - - - [1] 能量发数:指小程序每秒以1发能量呈现,当次使用仪器所呈现的能量总数量。“1发”指仪器1秒内仪器持续输出的平均能量。 + + + [1] + 能量发数:指小程序每秒以1发能量呈现,当次使用仪器所呈现的能量总数量。“1发”指仪器1秒内仪器持续输出的平均能量。 + + + [2]能量总值: + 指单次使用时长、仪器每秒输出的实际能量综合计算的能量总值 + + + [3]平均能量等级:指单次使用时长,根据花至精准能量算法根据不同皮肤所输出的平均能量等级。 +
+
+ + [4]最大能量:指根据花至精准能量算法根据不同皮肤所输出的能量最高等级 +
+
+ + [5]最小能量:指根据花至精准能量算法根据不同皮肤所输出的能量最低等级。 - [2]能量总值: 指单次使用时长、仪器每秒输出的实际能量综合计算的能量总值 - [3]平均能量等级:指单次使用时长,根据花至精准能量算法根据不同皮肤所输出的平均能量等级。
- [4]最大能量:指根据花至精准能量算法根据不同皮肤所输出的能量最高等级
- - [5]最小能量:指根据花至精准能量算法根据不同皮肤所输出的能量最低等级。
{reportShow ? ( - - 前往打卡 - + + + 前往打卡 + + 跳过 - + ) : null} this.setState({ show: false })}> - + - 今日打卡 - + 今日打卡 + 本月您已打卡 - {clockStatistics[0]?.clockNum}{" "} + {clockStatistics[0]?.clockNum}{" "} 天,超越 - + {(clockStatistics[0]?.percentage * 100).toFixed(1)}% 花至用户 - + {punchInInfo.clockImageList.map((item, index) => ( - - + + ))} {punchInInfo.clockImageList.length < 3 && ( )} - - + + - + {"(" + (punchInInfo.clockContent.length || 0) + "/120)"} - - + + 确认提交