临时提交

master
blak-kong 2 years ago
parent 6305f2c66a
commit 1e5da4f48f

@ -57,21 +57,27 @@ export const fr200DeviceControlCommand = {
},
/**
* '脸部' = 'workFace',
* '眼部' = 'workEye',
* '颈纹' = 'workNeck',
* '进入水分测试模式' = 'switchTestMode',
* '启动水分测试模式' = 'startTestMode',
* face
* eyes
* neck
* moistureTest
* face: "01", 面部
* eyes: "02", 脸部
* nasolabialFold: "03", 法令纹
* mandibularLine: "04", 下颌线
* led: "05", led
* moistureTest: "06", 水分测试
* maskPenetration: "07",面膜促渗
* essence: "08", 精华模式
* headLiftingPro: "09", 抬头纹Pro
* neck: "0A", 颈纹
* partition: "11", 分区模式 废弃VM1001
* ignore: "255", 不改变/无模式
*/
// 普通工作模式
work: {
commandType: "DeviceControl",
workStatus: "working",
workMode: "", // face
workMode: "ignore", // face
},
// 切换/进入水分测试
switchTestMode: {

@ -459,7 +459,7 @@ class ConnectionBluetoot extends Component<any, any> {
return jsonStatus;
}
/** 7.通知BLE特征值更改 */
/** 7.通知BLE特征值更改 连接成功需拿到响应判断是否需要升级,然后跳转详情页 */
notifyBLECharacteristicValueChange() {
console.log("7.通知BLE特征值更改");
const { deviceInfo } = this.props;

@ -10,8 +10,8 @@ import React, {
useState,
} from "react";
import Echarts from "./components/Echart/index";
import Gears from "./components/Gears/index"
// import Echarts from "./components/Echart/index";
import Gears from "./components/Gears/index";
import {
Block,
View,
@ -41,7 +41,7 @@ import ConnectionBluetoot from "@/components/bluetoot/connection";
import ElectricityView from "./components/ElectricityView/index";
import ModeListView from "./components/ModeList/FR200";
import ModeContent from "./components/ModeContent/FR200";
import Footer from "./components/Footer";
import Footer from "./components/Footer/FR200";
/* 本页组件 END */
import { go, getStorageSync, setStorageSync, msg } from "@/utils/traoAPI";
@ -129,10 +129,10 @@ class IotCarePlanFR200 extends Component<any, any> {
workMode: "", //当前模式
// 挡位调节组件参数
GearData:[
{name:'额头',forehead:5,Total:10},
{name:'左脸颊',forehead:6,Total:10},
{name:'右脸颊',forehead:2,Total:10},
GearData: [
{ name: "额头", forehead: 5, Total: 10 },
{ name: "左脸颊", forehead: 6, Total: 10 },
{ name: "右脸颊", forehead: 2, Total: 10 },
],
gear: { gear: 1 },
@ -334,19 +334,17 @@ class IotCarePlanFR200 extends Component<any, any> {
}
async init() {
// 查询自定义设备指令
// 查询离线记录汇总
const queryInstructionParams = {
commandType: "InfoQuery",
infoQueryType: "customModeInfo",
infoQueryType: "offlineClockInInfo",
dataType: "summary",
};
let commandBuffer = deviceToolKitInstance.toBleCommand(
queryInstructionParams as any
);
sendCommand({ value: commandBuffer }).then((res) => {
console.log(
"查询自定义组合模式指令发送成功 参数为=>",
queryInstructionParams
);
console.log("查询查询离线记录汇总 参数为=>", queryInstructionParams);
});
// 监听蓝牙连接状态改变
@ -370,7 +368,7 @@ class IotCarePlanFR200 extends Component<any, any> {
this.setState({
isConnectShow: true, // 打开蓝牙链接弹窗
isConnectionBlutoot: false, // 断开蓝牙
isShowCountdown: false, // 关闭倒计时,防止倒计时还在运行
// isShowCountdown: false, // 关闭倒计时,防止倒计时还在运行
});
this.footerIsDisabled();
};
@ -515,21 +513,21 @@ class IotCarePlanFR200 extends Component<any, any> {
return false;
}
// 加减组件- 减号操作
handleMinus = async (data,inde) => {
let GearData =this.state.GearData
if(GearData[inde].forehead !== 1){
GearData[inde].forehead = GearData[inde].forehead - 1
this.setState({GearData})
}
};
// 加减组件- 加号操作
handleAdd = async (data,inde) => {
let GearData =this.state.GearData
if(GearData[inde].forehead !== GearData[inde].Total){
GearData[inde].forehead = GearData[inde].forehead + 1
this.setState({GearData})
}
};
handleMinus = async (data, inde) => {
let GearData = this.state.GearData;
if (GearData[inde].forehead !== 1) {
GearData[inde].forehead = GearData[inde].forehead - 1;
this.setState({ GearData });
}
};
// 加减组件- 加号操作
handleAdd = async (data, inde) => {
let GearData = this.state.GearData;
if (GearData[inde].forehead !== GearData[inde].Total) {
GearData[inde].forehead = GearData[inde].forehead + 1;
this.setState({ GearData });
}
};
/** 切换护理模式 */
switchModeCurrentFun = async (data) => {
@ -1248,10 +1246,10 @@ handleAdd = async (data,inde) => {
}
// 仅在切换模式的时候,弹窗倒计时.
if (type === "switch") {
let downNum = CountDownTime[ActiveModeItem.modeType] || 3;
this.showCountdownFun(downNum, () => {}); // 倒计时弹窗
}
// if (type === "switch") {
// let downNum = CountDownTime[ActiveModeItem.modeType] || 3;
// this.showCountdownFun(downNum, () => {}); // 倒计时弹窗
// }
// 开始执行护理
this.workStatus = MODE_WORKING_ENUM.WORKING; // 不管当前什么状态,直接设为工作状态
@ -2158,11 +2156,12 @@ handleAdd = async (data,inde) => {
/>
)}
<Echarts></Echarts>
<Gears
onEmitMinus={this.handleMinus}
onEmitAdd={this.handleAdd}
GearData={GearData}></Gears>
{/* <Echarts></Echarts> */}
<Gears
onEmitMinus={this.handleMinus}
onEmitAdd={this.handleAdd}
GearData={GearData}
></Gears>
</View>
<Footer

@ -11,7 +11,7 @@ import React, {
useRef,
} from "react";
import Echarts from "./components/Echart/index";
// import Echarts from "./components/Echart/index";
import {
Block,
View,
@ -41,7 +41,7 @@ import ConnectionBluetoot from "@/components/bluetoot/connection";
import ElectricityView from "./components/ElectricityView/index";
import ModeListView from "./components/ModeList/WL200";
import ModeContent from "./components/ModeContent/WL200";
import Footer from "./components/Footer";
import Footer from "./components/Footer/WL200";
/* 本页组件 END */
import { go, getStorageSync, setStorageSync, msg } from "@/utils/traoAPI";
@ -240,9 +240,9 @@ class IotCarePlanWL200 extends Component<any, any> {
this.getWL200NursingHistory();
this.initData();
}
componentDidMount() { }
componentDidMount() {}
componentWillUnmount() { }
componentWillUnmount() {}
componentDidShow() {
console.log("页面显示了");
@ -572,7 +572,7 @@ class IotCarePlanWL200 extends Component<any, any> {
this.onNursingTap();
// 倒计时弹窗: 倒计时完成后,自动开始,并判断弹窗
let downNum = CountDownTime[this.state.ActiveModeItem.modeType] || 3;
this.showCountdownFun(downNum, () => { });
this.showCountdownFun(downNum, () => {});
}, 500);
return;
@ -604,7 +604,7 @@ class IotCarePlanWL200 extends Component<any, any> {
};
// 绘制能量图
drawProwerPicture() { }
drawProwerPicture() {}
/** 切换光照 */
onSwitchChange = async () => {
@ -1369,7 +1369,7 @@ class IotCarePlanWL200 extends Component<any, any> {
// 仅在切换模式的时候,弹窗倒计时.
if (type === "switch") {
let downNum = CountDownTime[ActiveModeItem.modeType] || 3;
this.showCountdownFun(downNum, () => { }); // 倒计时弹窗
this.showCountdownFun(downNum, () => {}); // 倒计时弹窗
}
// 开始执行护理
@ -2024,22 +2024,21 @@ class IotCarePlanWL200 extends Component<any, any> {
};
handleClickVideo = () => {
let videoRef = Taro.createVideoContext('myVideo')
let videoRef = Taro.createVideoContext("myVideo");
// 开始播放
videoRef.play()
videoRef.play();
// 暂停播放
videoRef.pause()
console.log('暂停播放', videoRef);
videoRef.pause();
console.log("暂停播放", videoRef);
};
handleClicksound = () => {
let isMuted = this.state.isMuted
isMuted = !isMuted
this.setState({ isMuted })
}
let isMuted = this.state.isMuted;
isMuted = !isMuted;
this.setState({ isMuted });
};
onPlay = (e) => {
console.log('出发', e);
}
console.log("出发", e);
};
customBack = () => {
Taro.reLaunch({ url: "/pages/index/index" });
};
@ -2117,8 +2116,8 @@ class IotCarePlanWL200 extends Component<any, any> {
<PopupInstrumentUploadTips
isShow={isFirstTipShow}
zIndex={10020}
myClassName='level-up'
title='打卡介绍'
myClassName="level-up"
title="打卡介绍"
data={nurseInfo}
close={this.onTipShowClose}
confirm={this.onTipShowClose}
@ -2130,11 +2129,11 @@ class IotCarePlanWL200 extends Component<any, any> {
isLarge
isClose
isShow={isEndCarePlan}
title='提示'
content='是否结束护理'
textAlgin='center'
cancelButtonText='取消'
confirmButtonText='确定'
title="提示"
content="是否结束护理"
textAlgin="center"
cancelButtonText="取消"
confirmButtonText="确定"
close={this.cancelEndBtn}
confirm={this.confirmEndBtn}
/>
@ -2142,7 +2141,7 @@ class IotCarePlanWL200 extends Component<any, any> {
isLarge
isClose
isShow={isSwitchActiveMode}
title='护理模式切换'
title="护理模式切换"
content={
<ModeListView
ModeID={ModeID}
@ -2156,9 +2155,9 @@ class IotCarePlanWL200 extends Component<any, any> {
onModeLockOpen={this.onModeLockOpen}
/>
}
textAlgin='center'
cancelButtonText='取消'
confirmButtonText='确定'
textAlgin="center"
cancelButtonText="取消"
confirmButtonText="确定"
close={this.cancelModeSwitchBtn}
confirm={this.confirmModeSwitchBtn}
/>
@ -2168,7 +2167,7 @@ class IotCarePlanWL200 extends Component<any, any> {
isShow={isShowStepTips}
isLarge
isFirstEntry={false}
confirmButtonText='知道了'
confirmButtonText="知道了"
data={ActiveModeItem.openSourceData}
close={this.closeStepTips}
/>
@ -2177,10 +2176,10 @@ class IotCarePlanWL200 extends Component<any, any> {
<PopupAlert
isShow={isNotEnoughTime}
isClose
title='提示'
content='您的本次护理时间不足,请重新护理'
confirmButtonText='确认'
textAlgin='center'
title="提示"
content="您的本次护理时间不足,请重新护理"
confirmButtonText="确认"
textAlgin="center"
close={this.closeNotEnoughTime}
confirm={this.closeNotEnoughTime}
/>
@ -2189,11 +2188,11 @@ class IotCarePlanWL200 extends Component<any, any> {
isShow={isShowErrorTipsText}
isClose
zIndex={10020}
myClassName='level-up'
title='提示'
myClassName="level-up"
title="提示"
content={errorTipsText}
confirmButtonText='知道了'
textAlgin='center'
confirmButtonText="知道了"
textAlgin="center"
close={this.closeErrorTipsText}
confirm={this.closeErrorTipsText}
/>
@ -2202,17 +2201,17 @@ class IotCarePlanWL200 extends Component<any, any> {
isShow={isShowTipsSave}
isClose
zIndex={10020}
myClassName='level-up'
title='提示'
myClassName="level-up"
title="提示"
content={
<Block>
<View></View>
<View></View>
</Block>
}
cancelButtonText='取消'
confirmButtonText='确认'
textAlgin='center'
cancelButtonText="取消"
confirmButtonText="确认"
textAlgin="center"
close={this.closeTipsSave}
cancel={this.cancelTipsSave}
confirm={this.confirmTipsSave}
@ -2221,11 +2220,11 @@ class IotCarePlanWL200 extends Component<any, any> {
<PopupStatus
isShow={isShowNursingSuccess}
isClose
title='您已结束本次护理'
type='success'
content='正在上传护理记录……'
confirmButtonText='知道了'
textAlgin='center'
title="您已结束本次护理"
type="success"
content="正在上传护理记录……"
confirmButtonText="知道了"
textAlgin="center"
close={() => {
/*不需要做处理*/
}}
@ -2236,52 +2235,51 @@ class IotCarePlanWL200 extends Component<any, any> {
deviceInfo={currentDevice}
close={this.connectionClose}
isDisconnect={!isConnectionBlutoot}
offlineChange={() => { }}
offlineChange={() => {}}
pairingChange={this.pairingChange}
upgradeFun={() => { }}
upgradeFun={() => {}}
/>
)}
<Popup
show={isShowHistoryMsg}
className='custom-popup'
className="custom-popup"
overlay={false}
>
<View className='sync-history-msg'>...</View>
<View className="sync-history-msg">...</View>
</Popup>
</View>
<View>
<View className='iot-main'>
<View className='banner-box'>
<View className="iot-main">
<View className="banner-box">
<View>
{!isShowNurse && (
<Video
className='video-or-image'
className="video-or-image"
src={ActiveModeItem.modeVideo}
loop
id="myVideo"
// ref={videoRef}
onPlay={this.onPlay}
muted={isMuted}
/>
)}
<button onClick={this.handleClicksound}>/</button>
<button onClick={this.handleClicksound}>
/
</button>
{/* <button onClick={this.handleClickVideo}>播放/暂停</button> */}
{isShowNurse && (
<Block>
{isStopNurse ? (
<Image
className='video-or-image'
className="video-or-image"
src={currentServiceData.stopSource}
/>
) : (
<Image
className='video-or-image'
className="video-or-image"
src={currentServiceData.startSource}
/>
)}
@ -2289,25 +2287,25 @@ class IotCarePlanWL200 extends Component<any, any> {
)}
{errorTips && (
<Block>
<View className='msg-tips'>
<View className="msg-tips">
<Image
className='msg-tips-img'
className="msg-tips-img"
src={require("@/img/tips.png")}
/>
<View className='msg-tips-content'>{errorTips}</View>
<View className="msg-tips-content">{errorTips}</View>
</View>
</Block>
)}
</View>
<View className='iot-device'>
<View className='item'>
<Text className='device-time'>
<View className="iot-device">
<View className="item">
<Text className="device-time">
<Text className='time'>{currentTime}</Text>
<Text className="time">{currentTime}</Text>
</Text>
</View>
<View className='line' />
<View className="line" />
<ElectricityView
Electricity={Electricity}
matrixElectricity={matrixElectricity}
@ -2338,7 +2336,7 @@ class IotCarePlanWL200 extends Component<any, any> {
/>
)}
<Echarts></Echarts>
{/* <Echarts></Echarts> */}
</View>
<Footer

@ -1,8 +1,5 @@
import Taro from "@tarojs/taro";
import classnames from "classnames";
import { Block, View, Image, Text, CoverView } from "@tarojs/components";
import { useState, useEffect } from "react";
import "./index.less";
import "./FR200.less";
interface Props {
isShowNurse: boolean;
@ -56,6 +53,7 @@ function Index({
)}
</Block>
)}
{isShowNurse && (
<View className="switch-btn-box">
{!isDisabled && (

@ -0,0 +1,74 @@
.iot-footer {
position: fixed;
bottom: 0;
z-index: 99;
display: flex;
align-items: baseline;
width: 100%;
height: 153rpx;
background: #ffffff;
box-shadow: 0rpx -3rpx 7rpx 1rpx rgba(173, 191, 207, 0.21);
// padding-bottom: env(safe-area-inset-bottom);
box-sizing: border-box;
.btn {
width: 690rpx;
height: 90rpx;
background: #000;
border-radius: 45rpx;
color: #fff;
line-height: 90rpx;
text-align: center;
margin: 21rpx 49rpx 42rpx 30rpx;
font-size: 32rpx;
}
.text {
display: flex;
align-items: center;
font-size: 32rpx;
font-weight: bold;
color: #000;
}
.btn-disable {
background-color: #ccc !important; /* 设置按钮背景颜色为灰色 */
color: #fff !important; /* 设置按钮文字颜色为白色 */
border-color: #ccc !important; /* 设置按钮边框颜色为灰色 */
}
.switch-btn-box {
width: 100vw;
display: flex;
align-items: center;
margin-top: 34rpx;
.btn-item {
height: 70rpx;
display: flex;
flex: 1;
align-items: center;
justify-content: center;
.btn-icon {
width: 36rpx;
height: 36rpx;
margin-right: 18rpx;
}
.btn-text {
font-size: 32rpx;
font-family: PingFang SC;
font-weight: bold;
color: #000000;
}
}
.border-right {
border-right: 1px solid #ddd;
}
.btn-disable {
color: #fff !important; /* 设置按钮文字颜色为白色 */
border-color: #ccc !important; /* 设置按钮边框颜色为灰色 */
background-color: #fff !important; /* 设置按钮背景颜色为灰色 */
.btn-text {
color: #ccc !important; /* 设置按钮文字颜色为白色 */
border-color: #ccc !important; /* 设置按钮边框颜色为灰色 */
background-color: #fff !important; /* 设置按钮背景颜色为灰色 */
}
}
}
}

@ -0,0 +1,130 @@
import { Block, View, Image, Text, CoverView } from "@tarojs/components";
import "./WL200.less";
interface Props {
isShowNurse: boolean;
isStopNurse: boolean;
isDisabled: boolean; // 是否禁用开始暂停按钮:模式与连接设备是否一致
onEmitStartNurse: Function; // 每次点击item回调事件和数据给父组件
onEmitSwitchChange: Function;
onEmitEndPlan: Function;
onEmitErrorTips: Function; // 不可点击,提示错误
}
function Index({
isShowNurse,
isStopNurse,
isDisabled,
onEmitStartNurse,
onEmitSwitchChange,
onEmitEndPlan,
onEmitErrorTips,
}: Props) {
const onStartNurse = () => {
onEmitStartNurse();
};
const onSwitchChange = () => {
if (!isDisabled) {
onEmitSwitchChange();
}
};
const onEndPlan = () => {
onEmitEndPlan();
};
const onErrorTips = () => {
onEmitErrorTips();
};
return (
<Block>
<View className="iot-footer">
{!isShowNurse && (
<Block>
{isDisabled ? (
<View className="btn btn-disable" onClick={onStartNurse}>
</View>
) : (
<View className="btn" onClick={onStartNurse}>
</View>
)}
</Block>
)}
{isShowNurse && (
<View className="switch-btn-box">
{!isDisabled && (
<View className="btn-item border-right" onClick={onSwitchChange}>
{isStopNurse ? (
<Block>
<Image
className="btn-icon"
src={require("@/img/iot/start_nurse.png")}
mode="aspectFill"
/>
<Text className="btn-text"></Text>
</Block>
) : (
<Block>
<Image
className="btn-icon"
src={require("@/img/iot/pause_nurse.png")}
mode="aspectFill"
/>
<Text className="btn-text"></Text>
</Block>
)}
</View>
)}
{isDisabled && (
<View
className="btn-item border-right btn-disable"
onClick={onErrorTips}
>
{isStopNurse ? (
<Block>
<Image
className="btn-icon"
style="color: #ccc"
src={require("@/img/iot/start_nurse.png")}
mode="aspectFill"
/>
<Text className="btn-text" style="color: #ccc">
</Text>
</Block>
) : (
<Block>
<Image
className="btn-icon"
style="color: #ccc"
src={require("@/img/iot/pause_nurse.png")}
mode="aspectFill"
/>
<Text className="btn-text" style="color: #ccc">
</Text>
</Block>
)}
</View>
)}
<View className="btn-item" onClick={onEndPlan}>
<Image
className="btn-icon"
src={require("@/img/iot/over_nurse.png")}
mode="aspectFill"
/>
<Text className="btn-text"></Text>
</View>
</View>
)}
</View>
</Block>
);
}
export default Index;
Loading…
Cancel
Save