From 0d40fc6e57bd872343c3c8ef53193eddf449fd26 Mon Sep 17 00:00:00 2001 From: rongweikang <1174906669@qq.com> Date: Tue, 19 Mar 2024 14:24:10 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=B7=B3=E8=BD=AC?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/instrument/pages/instrument/instrument.tsx | 4 ++-- src/instrument/pages/instrument_manage/index.tsx | 6 +++--- src/pages/index/index.tsx | 8 ++++---- src/pages/userInfo/userInfo.tsx | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/instrument/pages/instrument/instrument.tsx b/src/instrument/pages/instrument/instrument.tsx index b9fb4de..9b4eb79 100644 --- a/src/instrument/pages/instrument/instrument.tsx +++ b/src/instrument/pages/instrument/instrument.tsx @@ -371,7 +371,7 @@ export default class Instrument extends Component { msg("绑定成功"); setTimeout(() => { setStorageSync("instrument_detail", JSON.stringify(channelInfo)); - go("/pages/instrument/intro?id=" + channelInfo.id); + go("/instrument/pages/instrument/intro?id=" + channelInfo.id); }, 1000); } else if (res.data.code === 202) { this.changeBindBox(); @@ -403,7 +403,7 @@ export default class Instrument extends Component { msg("绑定成功"); setStorageSync("instrument_detail", JSON.stringify(channelInfo)); setTimeout(() => { - go("/pages/instrument/intro?id=" + channelInfo.id); + go("/instrument/pages/instrument/intro?id=" + channelInfo.id); }, 1000); } else if (res.data.code === 202) { this.changeBindBox(); diff --git a/src/instrument/pages/instrument_manage/index.tsx b/src/instrument/pages/instrument_manage/index.tsx index b48b52c..1586ece 100644 --- a/src/instrument/pages/instrument_manage/index.tsx +++ b/src/instrument/pages/instrument_manage/index.tsx @@ -92,17 +92,17 @@ export default class InstrumentManage extends Component { setStorageSync("instrument_detail", item); let bindid = item.id; - go("/pages/instrument/intro?id=" + bindid); + go("/instrument/pages/instrument/intro?id=" + bindid); }; goBind = (item) => { let bindid = item.id; - go("/pages/instrument/instrument?isOnly=true&id=" + bindid); // 只显示当前仪器内容 + go("/instrument/pages/instrument/instrument?isOnly=true&id=" + bindid); // 只显示当前仪器内容 }; goBindInfo = (item) => { // let bindid = item.id; setStorageSync("instrument_detail", item); - go("/pages/instrument_detail/index"); + go("/instrument/pages/instrument_detail/index"); }; lesgobuy = (item) => { diff --git a/src/pages/index/index.tsx b/src/pages/index/index.tsx index f36d4f7..e6d82b5 100644 --- a/src/pages/index/index.tsx +++ b/src/pages/index/index.tsx @@ -441,7 +441,7 @@ class Index extends Component { msg("您已绑定所有设备"); return; } - go("/pages/instrument/instrument"); + go("/instrument/pages/instrument/instrument"); } }; @@ -493,7 +493,7 @@ class Index extends Component { const { url } = e.currentTarget.dataset; if (this.isRegister()) { - if (url === "/pages/instrument/instrument") { + if (url === "/instrument/pages/instrument/instrument") { let { data } = await InstrumentInfo.unbindingInstrumentInfoList(); console.log(data, "查看未绑定设备"); if (data.data.length === 0) { @@ -781,7 +781,7 @@ class Index extends Component { if (res.data.code === 200) { console.log("res.data.data", res.data.data); if (res.data.data.length > 0) { - go("/pages/instrument/intro??customBack=true&id=" + id); + go("/instrument/pages/instrument/intro??customBack=true&id=" + id); } else { this.bindingInstrumentList(); } @@ -1349,7 +1349,7 @@ class Index extends Component { 前往护理 { } let isInstrumentJump = Taro.getStorageSync("isInstrumentJump"); if (isInstrumentJump === "true") { - go("/pages/instrument/instrument"); + go("/instrument/pages/instrument/instrument"); } else { Taro.switchTab({ url: "/pages/user/user", From 99fe6178a186c263203a9ede649b8ec3f5d68180 Mon Sep 17 00:00:00 2001 From: rongweikang <1174906669@qq.com> Date: Tue, 19 Mar 2024 14:24:31 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=B7=B3=E8=BD=AC?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/user/user.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/user/user.tsx b/src/pages/user/user.tsx index 64a9cef..220659d 100644 --- a/src/pages/user/user.tsx +++ b/src/pages/user/user.tsx @@ -271,7 +271,7 @@ class User extends Component { Date: Tue, 19 Mar 2024 20:06:54 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/calendar/controller/index.tsx | 30 +++++++++---------- .../pages/instrumentClickinUpload/index.less | 2 +- .../pages/instrumentClickinUpload/index.tsx | 2 +- src/recoding/pages/recording/recording.tsx | 23 +++++++------- 4 files changed, 28 insertions(+), 29 deletions(-) diff --git a/src/components/calendar/controller/index.tsx b/src/components/calendar/controller/index.tsx index 308b1d3..b89783d 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/instrument/pages/instrumentClickinUpload/index.less b/src/instrument/pages/instrumentClickinUpload/index.less index 90237a7..f5a3f96 100644 --- a/src/instrument/pages/instrumentClickinUpload/index.less +++ b/src/instrument/pages/instrumentClickinUpload/index.less @@ -193,7 +193,7 @@ page { background: #fff; flex-direction: column; height: 100%; - border-radius: 20rpx; + border-radius: 30rpx; overflow: hidden; box-shadow: -2rpx 0 12rpx 0.5rpx rgba(129, 129, 129, 0.05); margin-right: 23rpx; diff --git a/src/instrument/pages/instrumentClickinUpload/index.tsx b/src/instrument/pages/instrumentClickinUpload/index.tsx index 005c239..1cd9ba3 100644 --- a/src/instrument/pages/instrumentClickinUpload/index.tsx +++ b/src/instrument/pages/instrumentClickinUpload/index.tsx @@ -479,7 +479,7 @@ export default class InstrumentClickInUpload extends Component { onClick={this.handleChooseImage} > diff --git a/src/recoding/pages/recording/recording.tsx b/src/recoding/pages/recording/recording.tsx index 246bb8c..3da46f5 100644 --- a/src/recoding/pages/recording/recording.tsx +++ b/src/recoding/pages/recording/recording.tsx @@ -64,9 +64,9 @@ export default class Recording extends Component { }; } - componentDidMount() {} + componentDidMount() { } - componentWillUnmount() {} + componentWillUnmount() { } // 格式化时间 getTime(time) { const hour = time.slice(0, 2); @@ -269,11 +269,11 @@ export default class Recording extends Component { this.DayTime(); } - componentDidShow() {} + componentDidShow() { } - componentDidHide() {} + componentDidHide() { } - async initData() {} + async initData() { } // 选择年份 onChangeYear(event) { this.setState({ year: event.detail.value }); @@ -290,7 +290,6 @@ export default class Recording extends Component { // 跳转到护理报告 toReport(id, recordId, item) { console.log(item, "查看类型", item.jumpType); - item.jumpType = 1; switch (item.jumpType) { case 1: this.One(item); @@ -313,11 +312,11 @@ export default class Recording extends Component { let report = false; go( "/recoding/pages/face_report_one/face_report_one?id=" + - item.id + - "&recordId=" + - item.recordId + - "&report=" + - report + item.id + + "&recordId=" + + item.recordId + + "&report=" + + report ); }; // 打开第二种类型 @@ -326,7 +325,7 @@ export default class Recording extends Component { }; // 打开第三种类型 three = async (item) => { - go("/recoding/pages/moisture_test_report/moisture_test_report"); + go(`/recoding/pages/moisture_test_report/moisture_test_report?data=${item.nursingData}&date=${item.createTime}`); }; // 打开其他类型 AllDevice = async (item) => { From 2f0ce40830e2542ded987c03768fe41998cc3a13 Mon Sep 17 00:00:00 2001 From: rongweikang <1174906669@qq.com> Date: Tue, 19 Mar 2024 20:07:09 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E5=AF=B9=E6=8E=A5=E6=B0=B4=E5=88=86?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E6=8A=A5=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../moisture_test_report.tsx | 197 ++++++++++-------- 1 file changed, 113 insertions(+), 84 deletions(-) diff --git a/src/recoding/pages/moisture_test_report/moisture_test_report.tsx b/src/recoding/pages/moisture_test_report/moisture_test_report.tsx index 2d94767..c23639c 100644 --- a/src/recoding/pages/moisture_test_report/moisture_test_report.tsx +++ b/src/recoding/pages/moisture_test_report/moisture_test_report.tsx @@ -12,6 +12,7 @@ import { setMobile } from "@/store/features/userInfo"; import Navbar from "@/components/navbar/navbar"; import Echarts from "./Echarts/index"; import "./moisture_test_report.less"; +import { go } from "@/utils/traoAPI"; class MoistureTestReport extends Component { constructor(props) { @@ -33,13 +34,6 @@ class MoistureTestReport extends Component { rightFace: 0 } }, - bgCssData: { - serious: 'background: #FFE3E3', - moderate: 'background: #FFEBDC', - slight: 'background: #F6FCFF', - normal: 'background: #F8F8F8', - sufficient: 'background: #F8F8F8' - }, isClock: false, xinde: '', imglist: [], @@ -57,107 +51,141 @@ class MoistureTestReport extends Component { componentDidHide() { } - async onLoad() { + onLoad(option) { + let data = JSON.parse(option.data) + let { reportData } = this.state + reportData.curDate = option.date + data.GearData.map(item => { + if (item.name == '额头') { + reportData.shuifenLevel.head = item.forehead + let gear = Math.ceil((11 - reportData.shuifenLevel.head) / 2) + reportData.shuifenGear.head = gear + + } else if (item.name == '左脸颊') { + reportData.shuifenLevel.leftFace = item.forehead + let gear = Math.ceil((11 - reportData.shuifenLevel.leftFace) / 2) + reportData.shuifenGear.leftFace = gear + } else if (item.name == '右脸颊') { + reportData.shuifenLevel.rightFace = item.forehead + let gear = Math.ceil((11 - reportData.shuifenLevel.rightFace) / 2) + reportData.shuifenGear.rightFace = gear + } + }) + this.setState({ reportData }); + setTimeout(() => { + console.log(this.state.reportData); + }, 50); } async initData() { } + toIndex() { + Taro.reLaunch({ url: "/pages/index/index" }); + } - getStatusData(level) { - var bgCssData = { - serious: 'background: #FFE3E3', - moderate: 'background: #FFEBDC', - slight: 'background: #F6FCFF', - normal: 'background: #F8F8F8', - sufficient: 'background: #F8F8F8' - } - var progressBgData = { - serious: 'background: #FF9393', - moderate: 'background: #FFC58C', - slight: 'background: #E5F3F9', - normal: 'background: #C2E5F3', - sufficient: 'background: #9FDBF3' - } - if (level >= 1 && level <= 2) { - return { - bg: bgCssData.serious, - title: '严重缺水', - gear: 1, - img: 'serious', - progressBg: progressBgData.serious - } - } else if (level >= 3 && level <= 4) { - return { - bg: bgCssData.moderate, - title: '中度缺水', - gear: 2, - img: 'moderate', - progressBg: progressBgData.moderate - } - } else if (level >= 5 && level <= 6) { - return { - bg: bgCssData.slight, - title: '轻微缺水', - gear: 3, - img: 'slight', - progressBg: progressBgData.slight + + render() { + let { name, imgUrl, reportData, reportData1, isClock, xinde, imglist, id, show } = this.state + + const getStatusData = (level) => { + var bgCssData = { + serious: 'background: #FFE3E3', + moderate: 'background: #FFEBDC', + slight: 'background: #F6FCFF', + normal: 'background: #F8F8F8', + sufficient: 'background: #F8F8F8' } - } else if (level >= 7 && level <= 8) { - return { - bg: bgCssData.normal, - title: '水分正常', - gear: 4, - img: 'normal', - progressBg: progressBgData.normal + // var progressBgData = { + // serious: 'background: #FF9393', + // moderate: 'background: #FFC58C', + // slight: 'background: #E5F3F9', + // normal: 'background: #C2E5F3', + // sufficient: 'background: #9FDBF3' + // } + var progressBgData = { + serious: '#FF9393', + moderate: '#FFC58C', + slight: '#E5F3F9', + normal: '#C2E5F3', + sufficient: '#9FDBF3' } - } else if (level >= 9 && level <= 10) { - return { - bg: bgCssData.sufficient, - title: '水分充足', - gear: 5, - img: 'sufficient', - progressBg: progressBgData.sufficient + if (level >= 1 && level <= 2) { + return { + bg: bgCssData.serious, + title: '严重缺水', + gear: 5, + img: 'serious', + progressBg: progressBgData.serious + } + } else if (level >= 3 && level <= 4) { + return { + bg: bgCssData.moderate, + title: '中度缺水', + gear: 4, + img: 'moderate', + progressBg: progressBgData.moderate + } + } else if (level >= 5 && level <= 6) { + return { + bg: bgCssData.slight, + title: '轻微缺水', + gear: 3, + img: 'slight', + progressBg: progressBgData.slight + } + } else if (level >= 7 && level <= 8) { + return { + bg: bgCssData.normal, + title: '水分正常', + gear: 2, + img: 'normal', + progressBg: progressBgData.normal + } + } else if (level >= 9 && level <= 10) { + return { + bg: bgCssData.sufficient, + title: '水分充足', + gear: 1, + img: 'sufficient', + progressBg: progressBgData.sufficient + } } } - } - - render() { - let { name, imgUrl, reportData, bgCssData, isClock, xinde, imglist, id, show } = this.state return ( - 2023.6.23 + {reportData.curDate} - - + + 额头 - {this.getStatusData(7).title} + {getStatusData(reportData.shuifenLevel.head)!.title} - - + + 左脸颊 - {/* {this.getStatusData(reportData.shuifenLevel.leftFace).title} */} + {getStatusData(reportData.shuifenLevel.leftFace)!.title} - - + + 右脸颊 - {/* {this.getStatusData(reportData.shuifenLevel.rightFace).title} */} + {getStatusData(reportData.shuifenLevel.rightFace)!.title} - + @@ -167,21 +195,22 @@ class MoistureTestReport extends Component { 额头 - + + {/* style='{width: {reportData.shuifenLevel.head * 10}%;{util.getStatusData(reportData.shuifenLevel.head).progressBg}}' */} {reportData.shuifenLevel.head}级 左脸颊 - + {reportData.shuifenLevel.leftFace}级 右脸颊 - + {reportData.shuifenLevel.rightFace}级 @@ -232,23 +261,23 @@ class MoistureTestReport extends Component { - + 面膜促渗 - + 额头 {reportData.shuifenGear.head}档 - + 左脸颊 {reportData.shuifenGear.leftFace}档 - + 右脸颊 {reportData.shuifenGear.rightFace}档 @@ -260,9 +289,9 @@ class MoistureTestReport extends Component { 继续护理 - + 主页 - + From dba48d95ade5f4cebb7dace1e9940eba2c4126bb Mon Sep 17 00:00:00 2001 From: blak-kong <546598185@qq.com> Date: Tue, 19 Mar 2024 20:08:58 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E5=87=86=E5=A4=87=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app.tsx | 5 + src/components/bluetoot/connection/fr200.js | 5 +- .../device-connection-popup.tsx | 34 ++++- src/custom-tab-bar/index.tsx | 11 +- .../pages/instrument/instrument.tsx | 74 ++++++++-- src/instrument/pages/instrument/intro.tsx | 2 +- src/moduleIOT/pages/iotCarePlan/FR200.tsx | 129 ++++++----------- src/moduleIOT/pages/iotCarePlan/WL200.tsx | 4 +- .../iotCarePlan/components/Footer/FR200.tsx | 109 +++++--------- src/pages/consultant/consultant.tsx | 2 +- src/pages/entry/entry.tsx | 6 +- src/pages/index/index.tsx | 134 ++++++++++-------- src/pages/register/register.tsx | 4 +- src/store/features/instrument.js | 30 +++- src/store/index.js | 2 + src/utils/request.js | 2 +- 16 files changed, 293 insertions(+), 260 deletions(-) diff --git a/src/app.tsx b/src/app.tsx index 0e4335e..3302307 100644 --- a/src/app.tsx +++ b/src/app.tsx @@ -37,6 +37,11 @@ class App extends Component { onError(error) { console.log("error 错误捕获", error); } + onUnload() { + console.log("App onUnload"); + Taro.removeStorageSync("isScan"); // 扫码弹窗显示完后,不需要再判断是否扫码 + Taro.removeStorageSync("serial"); // 扫码弹窗显示完后,删除缓存的扫码序列号 + } // 对应 onShow componentDidShow() {} diff --git a/src/components/bluetoot/connection/fr200.js b/src/components/bluetoot/connection/fr200.js index 52fa2a5..981801f 100644 --- a/src/components/bluetoot/connection/fr200.js +++ b/src/components/bluetoot/connection/fr200.js @@ -59,8 +59,10 @@ export const fr200DeviceControlCommand = { /** * '进入水分测试模式' = 'switchTestMode', * '启动水分测试模式' = 'startTestMode', + * * face: "01", 面部 - * eyes: "02", 脸部 + * eyes: "02", 眼部 + * * nasolabialFold: "03", 法令纹 * mandibularLine: "04", 下颌线 * led: "05", led @@ -68,6 +70,7 @@ export const fr200DeviceControlCommand = { * maskPenetration: "07",面膜促渗 * essence: "08", 精华模式 * headLiftingPro: "09", 抬头纹Pro + * * neck: "0A", 颈纹 * partition: "11", 分区模式 废弃VM1001 * ignore: "255", 不改变/无模式 diff --git a/src/components/bluetoot/device-connection-popup/device-connection-popup.tsx b/src/components/bluetoot/device-connection-popup/device-connection-popup.tsx index 2eab03c..76be28a 100644 --- a/src/components/bluetoot/device-connection-popup/device-connection-popup.tsx +++ b/src/components/bluetoot/device-connection-popup/device-connection-popup.tsx @@ -86,6 +86,7 @@ export default class DeviceConnectPopup extends Component { error, isDisconnect, } = this.props; + console.log("data connection", data, data.bluetoothConnecting); return ( @@ -113,7 +114,16 @@ export default class DeviceConnectPopup extends Component { {!this.isImage(data.bluetoothConnecting) ? ( - {!this.isImage(data.bluetoothClosed) ? ( - {!this.isImage(data.bluetoothConnectFail) ? ( -