04.26推送代码

master
c'g'l 2 years ago
parent a5bed953a1
commit ac85563603

@ -15,7 +15,6 @@ Gitee 是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN
1. 电脑需要安装 node ,开发版本为 16.18.0
2. 下载项目依赖
```javascript
npm i -f // 强制下载安装依赖 注意请使用npm源taobao源可能下载失败
```

@ -7,6 +7,8 @@ module.exports = {
mini: {
debugReact: true,
webpackChain: (chain, webpack) => {
// chain.plugin('analyzer')
// .use(require('webpack-bundle-analyzer').BundleAnalyzerPlugin, [])
chain.merge({
plugin: {
install: {

@ -37,16 +37,16 @@ export default class PopupMembraneList extends Component<any, any> {
};
}
async onLoad() {}
componentDidMount() {}
async onLoad() { }
componentDidMount() { }
componentWillUnmount() {}
componentWillUnmount() { }
componentDidShow() {}
componentDidShow() { }
componentDidHide() {}
componentDidHide() { }
async initData() {}
async initData() { }
onClose = () => {
this.props.onClose();
@ -70,10 +70,11 @@ export default class PopupMembraneList extends Component<any, any> {
<PageMeta pageStyle={isShow ? "overflow: hidden;" : ""} />
<Popup show={isShow}>
<View className="MembraneCloth">
<View
className="at-icon at-icon-close site-close site-close-MembraneCloth"
<Image
className="site-close-MembraneCloth"
src={require('@/img/close.png')}
onClick={this.onClose}
></View>
></Image>
<View className="title"></View>
<MembraneList
MembraneClothList={MembraneClothList}

@ -29,7 +29,7 @@ export default class Index extends Component {
},
{
pagePath: "pages/activity/activity",
text: "活动",
text: "护理计划",
iconPath: "/img/tabar/2.png",
selectedIconPath: "/img/tabar/22.png",
},

@ -30,7 +30,15 @@
}
}
}
.workImg{
height:575rpx;position:absolute;top:0px;left:0px;width:100%;z-index: 999;
}
.gearImg{
height:575rpx;position:absolute;z-index:99999999;top:0rpx;left:0rpx;width:100%;opacity: 0.5;
}
.errorImg{
height:575rpx;position:absolute;top:0px;left:0px;width:100%;z-index: 1099;
}
.membrane_Select {
background-color: #fff;
border-radius: 30rpx 30rpx 0rpx 0rpx;
@ -41,10 +49,10 @@
.iot-main-membrane {
background: #fff;
// margin-top: 23rpx;
padding: 25rpx 21rpx;
height: 34vh;
// height: 31vh;
overflow: auto;
border-radius: 0rpx 30rpx 30rpx 30rpx;
}
}
.MembranePopup {

File diff suppressed because it is too large Load Diff

@ -34,14 +34,18 @@ export default class BluetoothContainer {
public DeviceControl = {
/** @name 设置模式 */
workByPatitionSet: (workMode = '', gearTakeEffectOffline = false, partitionStatus = [{ gear: 0 }, { gear: 3 }, { gear: 2 }, { gear: 5 }]) => {
console.log(workMode,'查看模式');
console.log(workMode, '查看模式');
let sendParams: any = {
...WE200DeviceControlCommand.workByPatitionSet,
workMode: workMode, // 使用模式
gearTakeEffectOffline: gearTakeEffectOffline, // 是否离线生效
partitionStatus: partitionStatus // 默认用官配模式
partitionStatus: partitionStatus, // 默认用官配模式
deviceSyncCommandType: 'onlySyncStatusToDevice',
totalWorkingMinutes: 0,
totalWorkingSeconds: 0,
// deviceSyncCommandType: "onlySyncStatusToDevice",
};
const pauseArrayBuffer = this.deviceToolKitInstance.toBleCommand(
const pauseArrayBuffer = this.deviceToolKitInstance?.toBleCommand(
sendParams as any
);
@ -60,6 +64,11 @@ export default class BluetoothContainer {
let sendParams: any = {
...WE200DeviceControlCommand.pause,
workMode: workMode, // 使用模式
workStatus: 'standby',
deviceSyncCommandType: 'onlySyncStatusToDevice',
totalWorkingMinutes: 0,
totalWorkingSeconds: 0,
// deviceSyncCommandType: "onlySyncStatusToDevice",
};
const pauseArrayBuffer = this.deviceToolKitInstance?.toBleCommand(
sendParams as any
@ -91,8 +100,8 @@ export default class BluetoothContainer {
},
/** @name 设备控制:工作 */
working: (workMode = '', gearTakeEffectOffline = false, partitionStatus = [{ gear: 0 }, { gear: 3 }, { gear: 2 }, { gear: 5 }]) => {
console.log(workMode,'工作中模式',WE200DeviceControlCommand);
console.log(workMode, '工作中模式', WE200DeviceControlCommand);
let sendParams: any = {
...WE200DeviceControlCommand.work,
workMode: workMode, // 使用模式
@ -100,14 +109,14 @@ export default class BluetoothContainer {
partitionStatus
};
// 根据不同模式进行控制传参处理
switch (workMode) {
case "private_custom_current":
break;
case "official_specific_effective":
break;
case 'DiyFacial_Custom':
break;
}
// switch (workMode) {
// case "private_custom_current":
// break;
// case "official_specific_effective":
// break;
// case 'DiyFacial_Custom':
// break;
// }
const pauseArrayBuffer = this.deviceToolKitInstance?.toBleCommand(
sendParams as any
@ -124,21 +133,40 @@ export default class BluetoothContainer {
},
/** @name 设备控制:结束 */
end: (workMode = '') => {
let sendParams: any = {
...WE200DeviceControlCommand.pause,
workMode: workMode, // 使用模式
};
const pauseArrayBuffer = this.deviceToolKitInstance?.toBleCommand(
sendParams as any
);
setTimeout(() => {
let sendParams: any = {
...WE200DeviceControlCommand.end,
workMode: workMode, // 使用模式
};
const pauseArrayBuffer = this.deviceToolKitInstance?.toBleCommand(
sendParams as any
);
sendCommand({
value: pauseArrayBuffer,
}).then(() => {
this.that.workStatus = 'end';
this.that.resetTimer();
console.info(`发送结束指令成功 参数为 =>`, sendParams);
});
}, 2000)
},
// 查询设备护理报告
getCurrentFacialReportInfo:(workMode = '') => {
const infoQueryComment = {
commandType: 'InfoQuery',
infoQueryType: 'currentFacialReportInfo',
workMode: workMode,
}
const value = this.deviceToolKitInstance?.toBleCommand(infoQueryComment);
sendCommand({
value: pauseArrayBuffer,
value: value
}).then(() => {
this.that.workStatus = 'end';
this.that.resetTimer();
console.info(`发送结束指令成功 参数为 =>`, sendParams);
});
console.info('下发指令查询护理报告==》', JSON.stringify(infoQueryComment));
})
},
/** 离线记录汇总 */
syncOfflineSummary: () => {
const queryOfflineSummary = this.deviceToolKitInstance?.toBleCommand({
...WE200BleCommand.InfoQuery.offlineSummary
@ -147,6 +175,7 @@ export default class BluetoothContainer {
value: queryOfflineSummary,
});
},
/** 最新一条离线记录详情 */
syncOfflineDetail: () => {
const queryOfflineDetail = this.deviceToolKitInstance?.toBleCommand({
...WE200BleCommand.InfoQuery.offlineDetail
@ -154,6 +183,18 @@ export default class BluetoothContainer {
sendCommand({
value: queryOfflineDetail,
});
},
// 同步设备状态
sendOnlySyncStatusToDevice() {
console.log('主动查询设备状态指令发送');
const queryM01DeviceArrayBuffer = this.deviceToolKitInstance?.toBleCommand({
commandType: "DeviceStatusSync",
deviceSyncCommandType: 'onlySyncStatusToDevice'
})
sendCommand({
value: queryM01DeviceArrayBuffer
})
}
}
@ -168,20 +209,27 @@ export default class BluetoothContainer {
}
/** @name 设备响应:暂停 */
private syncPause(jsonStatus) {
console.log("上报暂停", jsonStatus)
console.log("上报暂停", jsonStatus,this.that.state)
let {ishandPause,checkedMembraneCloth} =this.that.state
// isHand为true的时候代表他正在运行中正在运行中的时候如果他自己暂停的情况下需要我自己在次发送
if(ishandPause){
this.DeviceControl.working(checkedMembraneCloth)
}
let isDisconnect = false;
// true代表暂停
if (isDisconnect) {
// 发现蓝牙未连接时候打开有误图片
this.that.setState({
isError:true
isError: true
});
}else{
// 发现蓝牙链接成功后,关闭有误图片
} else {
// 发现蓝牙链接成功后,关闭有误图片
this.that.setState({
isError:false
isError: false
});
}
}
@ -227,73 +275,75 @@ export default class BluetoothContainer {
/** @name 设备响应:通用状态响应 */
private syncCommonStatus(jsonStatus) {
if (jsonStatus?.workMode) {
this.that.jsonStatus = jsonStatus;
}
}
/** @name 设备响应:控制指令响应 */
private syncDeviceControl(jsonStatus) {
console.log("设备控制响应", jsonStatus);
if (jsonStatus.responseStatus == "OK") {
console.log("发送控制指令成功");
this.that.workJsonStatus = jsonStatus;
this.that.workStatus = jsonStatus.workStatus;
if (jsonStatus.battery) {
this.that.setState({
Electricity: jsonStatus.matrixBattery,
});
}
if (jsonStatus.battery) {
this.that.setState({
Electricity: jsonStatus.battery,
});
// 判断设备主动上报的关机事件
if (jsonStatus.workStatus === 'end') {
// 判断id是否一致, 一致的话则生成护理报表, 并提示
if (jsonStatus.id == this.that.WE200NursingHistory.id) {
debounce(
this.that.checkInstrumentRecord.bind(this, jsonStatus),
500
);
}
return;
}
// 判断设备主动上报的关机事件
if (jsonStatus.workStatus === 'end') {
// 判断id是否一致, 一致的话则生成护理报表, 并提示
if (jsonStatus.id == this.that.WE200NursingHistory.id) {
debounce(
this.that.checkInstrumentRecord.bind(this, jsonStatus),
500
);
}
return;
if (jsonStatus?.workMode === this.that.state.ActiveModeItem?.modeType) {
this.that.setState({
workMode: jsonStatus?.workMode, // 仅当设备上报模式与小程序一致时,才允许改变小程序变量缓存
});
// 判断是否在isRuning(护理中)
// 仅当设备模式与小程序是否一致,才允许更改设备运行时间
if (
this.that.state.DeviceConnectStatus === 1 &&
this.that.isRuning &&
jsonStatus.workStatus !== 'end'
) {
this.that.updateDeviceSyncData(
{
totalWorkingMinutes: jsonStatus.totalWorkingMinutes,
totalWorkingSeconds: jsonStatus.totalWorkingSeconds,
},
jsonStatus
);
}
}
if (jsonStatus?.workMode === this.that.state.ActiveModeItem?.modeType) {
if (
jsonStatus.workMode === 'working' &&
this.that.isRuning
) {
const { ActiveModeItem } = this.that.state;
const item = ActiveModeItem;
if (jsonStatus.workMode !== item?.modeType) {
// clearTimeout(loadingTipsTimer);
this.that.setState({
workMode: jsonStatus?.workMode, // 仅当设备上报模式与小程序一致时,才允许改变小程序变量缓存
isShowCountdown: false,
});
// 判断是否在isRuning(护理中)
// 仅当设备模式与小程序是否一致,才允许更改设备运行时间
if (
this.that.state.DeviceConnectStatus === 1 &&
this.that.isRuning &&
jsonStatus.workStatus !== 'end'
) {
this.that.updateDeviceSyncData(
{
totalWorkingMinutes: jsonStatus.totalWorkingMinutes,
totalWorkingSeconds: jsonStatus.totalWorkingSeconds,
},
jsonStatus
);
}
}
if (
jsonStatus.workMode === 'working' &&
this.that.isRuning
) {
const { ActiveModeItem } = this.that.state;
const item = ActiveModeItem;
if (jsonStatus.workMode !== item?.modeType) {
// clearTimeout(loadingTipsTimer);
this.that.setState({
isShowCountdown: false,
});
}
}
}
}
/** @name 设备响应:控制指令响应 */
private syncDeviceControl(jsonStatus) {
console.log("设备控制响应", jsonStatus);
// if (jsonStatus.responseStatus == "OK") {
// console.log("发送控制指令成功");
// // this.that.workJsonStatus = jsonStatus;
// // this.that.workStatus = jsonStatus.workStatus;
// }
}
@ -313,7 +363,7 @@ export default class BluetoothContainer {
if (!jsonStatus || jsonStatus == null) {
return;
}
this.that.workStatus = jsonStatus.workStatus; // 记录工作状态
// this.that.workStatus = jsonStatus.workStatus; // 记录工作状态
// end 和 endWork 都是护理结束, endWork不关机, end 关机, 对小程序而言处理流程都一样
if (jsonStatus.workStatus && jsonStatus.workStatus == "endWork") {
@ -346,7 +396,7 @@ export default class BluetoothContainer {
if (jsonStatus.battery) {
// 防止抖动
this.that.setState({
Electricity: jsonStatus.battery,
Electricity: jsonStatus.matrixBattery,
});
}
@ -370,6 +420,7 @@ export default class BluetoothContainer {
//设备对控制指令的响应
case "DeviceControl":
this.syncDeviceControl(jsonStatus);
this.syncCommonStatus(jsonStatus);
break;
// 设备对信息查询指令的响应
case "InfoQuery":
@ -451,6 +502,11 @@ export default class BluetoothContainer {
// });
// }, 20000);
}
setTimeout(() => {
this.DeviceControl.sendOnlySyncStatusToDevice()
}, 1000)
});
}
}

@ -1,289 +1,255 @@
import { Block, View, Image, Text, Input } from "@tarojs/components";
import { useRef } from "react";
import { Block, View, Image } from "@tarojs/components";
import { useEffect, useRef, useState, useCallback } from "react";
import Echarts, { EChartOption, EchartsHandle } from "taro-react-echarts";
// import echarts from "@/utils/echarts.min.js";
import * as echarts from "echarts";
import echarts from "../echarts.min.js";
import "./index.less";
interface Props {
EchartsData: any
series: any;
full: any;
time: any;
}
function Index({
EchartsData
}: Props) {
let type = 0
switch (EchartsData?.data?.workMode) {
case 'face':
type = 37
break;
case 'eyes':
type = 25
break;
case 'nasolabialFold':
type = 25
break;
case 'mandibularLine':
type = 19
break;
case 'headLiftingPro':
type = 13
break;
default:
}
const echartsRef = useRef<EchartsHandle>(null);
function generateColorArray(startColor, endColor, steps) {
var startRGB = hexToRgb(startColor);
var endRGB = hexToRgb(endColor);
var colors = [];
for (var i = 0; i < steps; i++) {
var r = interpolate(startRGB.r, endRGB.r, steps, i);
var g = interpolate(startRGB.g, endRGB.g, steps, i);
var b = interpolate(startRGB.b, endRGB.b, steps, i);
colors.push(rgbToHex(r, g, b));
}
return colors;
function Index({ series, full, time }: Props) {
const echartsRef = useRef<EchartsHandle>(null);
const [options, setOptions] = useState({
animation: false,
grid: {
// 让图表占满容器
// containLabel: true,
top: "28rpx",
left: "18rpx",
right: "28rpx",
bottom: "17rpx",
},
xAxis: {
type: "category",
axisLine: {
//坐标轴轴线相关设置。数学上的x轴
show: true,
lineStyle: {
color: "#cccccc",
},
},
axisLabel: {
//坐标轴刻度标签的相关设置
color: "#fff",
fontSize: 1,
},
axisTick: {
show: false,
},
},
yAxis: {
type: "value",
min: 0,
max: 8,
splitNumber: 8,
splitLine: {
show: true,
lineStyle: {
color: "#cccccc",
type: [4, 2],
dashOffset: 4,
},
},
axisLine: {
show: false,
},
axisLabel: {
show: false,
},
axisTick: {
show: false,
},
},
visualMap: {
z: 1,
top: 0,
right: 0,
seriesIndex: 0,
show: false,
pieces: [
{
gt: 0,
lte: 1,
color: "#f8f4f9",
},
{
gt: 1,
lte: 2,
color: "#f5f1f8",
},
{
gt: 2,
lte: 3,
color: "#f1edf6",
},
{
gt: 3,
lte: 4,
color: "#ece9f5",
},
{
gt: 4,
lte: 5,
color: "#e8e4f3",
},
{
gt: 5,
lte: 6,
color: "#e3e0f1",
},
{
gt: 6,
lte: 7,
color: "#e1ddf0",
},
{
gt: 7,
lte: 8,
color: "#dedaef",
},
],
outOfRange: {
color: "#ff8410",
},
},
// series: []
});
const level = [8, 7, 6, 5, 4, 3, 2];
const [isFull, setIsfull] = useState(false);
const [data, setData] = useState([
"00:01",
"00:02",
"00:03",
"00:04",
"00:05",
"00:06",
"00:07",
"00:08",
"00:09",
"00:10",
]);
const [newOptions, setNewOptions] = useState(options);
const updata = useCallback((res, times) => {
if (times.second == 0) {
return
}
function hexToRgb(hex) {
var bigint = parseInt(hex.slice(1), 16);
var r = (bigint >> 16) & 255;
var g = (bigint >> 8) & 255;
var b = bigint & 255;
return { r: r, g: g, b: b };
}
function rgbToHex(r, g, b) {
return (
"#" + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1)
);
}
function interpolate(start, end, steps, count) {
return start + ((end - start) / steps) * count;
// let option
// if (data) {
// option = JSON.parse(JSON.stringify(newParams))
// } else {
// option = JSON.parse(JSON.stringify(options))
// }
let option = JSON.parse(JSON.stringify(options))
let datas = JSON.parse(JSON.stringify(data))
if (series[0].data.length == 1) {
datas = [
"00:01",
"00:02",
"00:03",
"00:04",
"00:05",
"00:06",
"00:07",
"00:08",
"00:09",
"00:10",
]
} else {
if (times.min > 0 || times.second > 10) {
datas.splice(0, 1)
datas.push(formatTime(times))
}
}
setData(JSON.parse(JSON.stringify(datas)))
// option.xAxis.data = data
option.series = JSON.parse(JSON.stringify(res))
// 更新图表数据
setNewOptions(option);
}, [data]);
const startColor = "#FFFF00"; // 黄色
const endColor = "#FF0000"; // 红色
const steps = 81; // 80个颜色
const colors = generateColorArray(startColor, endColor, steps);
// const xList = [...new Array(type).fill(0).map((item, key) => key)];
let seriesData: any = []
seriesData = EchartsData?.data?.groupedAa
const xList = [...new Array(type).fill(0).map((item, key) => key)];
// const seriesData = [
// ...xList.map((item) => {
// return Math.random() * 80;
// }),
// ];
const option: EChartOption = {
grid: {
// 让图表占满容器
top: "10rpx",
left: "45rpx",
right: "28rpx",
bottom: "17rpx",
},
xAxis: {
type: "category",
data: [...xList],
axisLabel: {
interval: 5,
formatter: function (value, index) {
return value * 10 + 's';
},
textStyle: {
color: '#999999', // 文字颜色
fontSize: 8 // 文字大小
},
},
axisTick: {
// alignWithLabel: true,
show: false,
interval: 9,
},
// axisLine: {
// show: false,
// },
},
yAxis: [
{
min: 0,
max: 80,
splitNumber: 10,
axisLabel: {
formatter: function (value, index) {
const num = value / 10 + 1
return num === 9 ? '' : num + '级';
},
textStyle: {
color: '#999999', // 文字颜色
fontSize: 8 // 文字大小
},
},
type: "value",
splitLine: {
lineStyle: {
color: ["#ccc", "#ccc", "#ccc", "#ccc", "#ccc", "#ccc", "#ccc", "#ccc", "#fff"],
type: 'dashed'
},
}
},
],
series: [
{
barCategoryGap: '0%',
data: seriesData,
type: "bar",
// barWidth: 15,
gapWidth: "0%",
itemStyle: {
normal: {
color: function (params) {
var value = params.data;
return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: colors[parseInt(value)], // 红色
},
{
offset: 1,
color: colors[0], // 黄色
},
]);;
},
},
},
},
],
function formatTime(times: any) {
let mins;
if (times.min < 10) {
mins = "0" + times.min;
} else {
mins = times.min;
}
let secs;
if (times.second < 10) {
secs = "0" + times.second;
} else {
secs = times.second;
}
return `${mins.toString()}:${secs.toString()}`;
}
// 基于 EchartsData 生成 ECharts 配置
// const option: EChartOption ={
// grid: {
// // 让图表占满容器
// top: "10rpx",
// left: "45rpx",
// right: "28rpx",
// bottom: "17rpx",
// },
// xAxis: {
// type: "category",
// data: [...xList],
// axisLabel: {
// interval: 5,
// formatter: function (value, index) {
// return value * 10 + 's';
// },
// textStyle: {
// color: '#999999', // 文字颜色
// fontSize: 8 // 文字大小
// },
// },
// axisTick: {
// // alignWithLabel: true,
// show: false,
// interval: 9,
// },
// // axisLine: {
// // show: false,
// // },
// },
// yAxis: [
// {
// min: 0,
// max: 80,
// splitNumber: 10,
// axisLabel: {
// formatter: function (value, index) {
// const num = value / 10 + 1
// return num === 9 ? '' : num + '级';
// },
// textStyle: {
// color: '#999999', // 文字颜色
// fontSize: 8 // 文字大小
// },
// },
// type: "value",
// splitLine: {
// lineStyle: {
// color: ["#ccc", "#ccc", "#ccc", "#ccc", "#ccc", "#ccc", "#ccc", "#ccc", "#fff"],
// type: 'dashed'
// },
// }
// },
// ],
// series: [
const cancelFull = useCallback(
(res) => {
full();
setIsfull(!isFull);
},
[isFull]
);
// {
// barCategoryGap: '0%',
// data: seriesData,
// type: "bar",
// // barWidth: 15,
// gapWidth: "0%",
// itemStyle: {
// normal: {
// color: function (params) {
// var value = params.data;
// return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
// {
// offset: 0,
// color: colors[parseInt(value)], // 红色
// },
// {
// offset: 1,
// color: colors[0], // 黄色
// },
// ]);;
// },
// },
// },
// },
// ],
// };
useEffect(() => {
setOptions(newOptions);
}, [newOptions]);
useEffect(() => {
return (
<Block>
<Echarts
echarts={echarts}
option={option}
ref={echartsRef}
// isPage={false}
// style自定义设置echarts宽高
// style={{ width: "100%", height: "100%" }}
style={{ width: "670rpx", height: "260rpx" }}
/>
updata(series, time);
}, [series]);
{/* <View className="box">
return (
<Block>
<View className={isFull ? "echart-component-full" : "echart-component"}>
<Echarts
force-use-old-canvas="false"
echarts={echarts}
option={option}
option={options}
ref={echartsRef}
// isPage={false}
// style自定义设置echarts宽高
style={{ width: "630rpx", height: "240rpx" }}
style={{ width: "630rpx", height: "260rpx", zIndex: 1 }}
/>
</View> */}
</Block>
);
<View className="box_background">
<Image
className={isFull ? "part" : "full"}
src={require(`@/img/${isFull ? "part-scran" : "full-scran"}.png`)}
onClick={cancelFull}
></Image>
<View className="power"></View>
{level.map((item) => (
<View className="line" key={item}>
<View className="number">{item}</View>
<View className="bottom_line"></View>
</View>
))}
<View className="line">
<View className="number">1</View>
</View>
<View className="time_list flex">
{data.map((times, index) => (
<View key={index}>{times}</View>
))}
</View>
<View className="time"></View>
</View>
</View>
</Block>
);
}
export default Index;

@ -1,6 +1,7 @@
.center_MembraneList {
margin-bottom: 44rpx;
padding: 0 9px;
padding: 0rpx 9rpx;
box-sizing: border-box;
.grey_item{
background: #f8f8f8;
// position: relative;

@ -12,62 +12,15 @@ import "./index.less";
interface Props {
cancelFull:Function
height:any,
series:any
series:any,
max:any
}
function Index({cancelFull,height,series}:Props) {
function Index({cancelFull,height,series,max}:Props) {
const echartsRef = useRef<EchartsHandle>(null);
console.log(echartsRef,'echartsRef');
// const [options, setOptions] = useState({
// animation: true,
// grid: {
// // 让图表占满容器
// // containLabel: true,
// top: "20rpx",
// left: "20rpx",
// right: "20rpx",
// bottom: "20rpx",
// },
// radar: {
// // shape: 'circle',
// axisName: {
// fontSize: 15,
// },
// indicator: [
// { name: '垂', max: 5, color: '#000' },
// { name: '肿', max: 5, color: '#000' },
// { name: '疲', max: 5, color: '#000' },
// { name: '黑', max: 5, color: '#000' },
// { name: '凹', max: 5, color: '#000' },
// { name: '松', max: 5, color: '#000' },
// { name: '纹', max: 5, color: '#000' },
// { name: '垮', max: 5, color: '#000' }
// ]
// },
// series: [
// {
// type: 'radar',
// data: [
// {
// value: series,
// itemStyle: {
// color: '#d8bb91',
// borderWidth: 1,
// },
// symbolSize: 8,
// }
// ],
// areaStyle: {
// color: 'rgba(218, 190, 150, 0.2)' // 这里设置你想要的颜色
// },
// lineStyle: {
// color: '#d8bb91',
// width: 2
// }
// }
// ]
// })
console.log(max,'maxmaxmax');
let options :EChartOption={
animation: true,
grid: {
@ -84,14 +37,14 @@ function Index({cancelFull,height,series}:Props) {
fontSize: 10,
},
indicator: [
{ name: '垂', max: 5, color: '#000' },
{ name: '肿', max: 5, color: '#000' },
{ name: '疲', max: 5, color: '#000' },
{ name: '黑', max: 5, color: '#000' },
{ name: '凹', max: 5, color: '#000' },
{ name: '松', max: 5, color: '#000' },
{ name: '纹', max: 5, color: '#000' },
{ name: '垮', max: 5, color: '#000' }
{ name: '垂', max: max, color: '#000' },
{ name: '肿', max:max, color: '#000' },
{ name: '疲', max: max, color: '#000' },
{ name: '黑', max: max, color: '#000' },
{ name: '凹', max: max, color: '#000' },
{ name: '松', max: max, color: '#000' },
{ name: '纹', max: max, color: '#000' },
{ name: '垮', max: max, color: '#000' }
]
},
series: [

@ -7,7 +7,6 @@
// font-size: 30rpx;
// }
.message {
position: relative;
width: 40rpx;
@ -47,7 +46,7 @@
.main {
position: relative;
top: -130rpx;
background: #F7F8FA;
background: #f7f8fa;
border-top-left-radius: 50rpx;
border-top-right-radius: 50rpx;
padding: 50rpx 30rpx;
@ -127,13 +126,11 @@
.container {
width: 100%;
display: flex;
justify-content: space-between;
margin-top: 50rpx;
}
.column {
width: calc(50% - 10rpx);
width: 100%;
overflow: hidden;
}
@ -141,7 +138,6 @@
width: 100%;
background-color: #fff;
border-radius: 30rpx;
margin-bottom: 23rpx;
}
.item_image {
@ -180,6 +176,47 @@
font-size: 32rpx;
font-weight: bold;
text-align: center;
color: #FFFFFF;
color: #ffffff;
margin: 19rpx auto 44rpx;
}
.popup-box {
padding-bottom: env(safe-area-inset-bottom);
}
.popup_title {
height: 34rpx;
font-size: 36rpx;
font-weight: bold;
text-align: center;
color: #030000;
margin: 49rpx auto 0;
}
.popup_btn {
width: 690rpx;
height: 90rpx;
background: #000000;
border-radius: 45rpx;
color: #fff;
font-size: 32rpx;
font-weight: bold;
text-align: center;
line-height: 90rpx;
margin: 0 auto;
}
.service-textarea {
// width: 690rpx;
display: flex;
height: 330rpx;
background: #ffffff;
border: 1px solid #dddddd;
border-radius: 3rpx;
padding: 30rpx 30rpx;
width: auto;
font-size: 28rpx;
font-weight: 400;
color: #030000;
box-sizing: border-box;
}

@ -10,18 +10,21 @@ import {
Video,
Swiper,
SwiperItem,
Textarea,
} from "@tarojs/components";
import Navbar from "@/components/navbar/navbar";
import { go } from "@/utils/traoAPI";
import { go, msg } from "@/utils/traoAPI";
import {
InstrumentInfo,
InstrumentInfo,SaveMessage
} from "../../utils/Interface";
import { WaterfallFlow, Popup } from '@antmjs/vantui'
import PopupAlert from "@/components/popup/popup-alert";
import "taro-ui/dist/style/components/button.scss"; // 按需引入
import "./detect.less";
import type CustomTabBar from "../../custom-tab-bar";
import PopupDrawer from "@/components/popup/popup-drawer";
export default class Detect extends Component<any, any> {
pageCtx = Taro.getCurrentInstance().page;
@ -32,11 +35,17 @@ export default class Detect extends Component<any, any> {
isNotRegister: false, // 是否未注册
show: false,
messageCount: Taro.getStorageSync("messageCount") || 0,
isRegisterBoolean: false
isRegisterBoolean: false,
carouselList: [],
strategyList: [],
isShow: false,
messageInfo: ''
};
}
async onLoad() { this.showInit() }
async onLoad() {
}
showInit = async () => {
// 判断是否登录
@ -52,6 +61,9 @@ export default class Detect extends Component<any, any> {
componentDidShow() {
const tabbar = Taro.getTabBar<CustomTabBar>(this.pageCtx);
tabbar?.setSelected(2);
this.showInit()
this.getCarouselList()
this.getStrategyList()
}
componentDidHide() { }
@ -71,6 +83,16 @@ export default class Detect extends Component<any, any> {
}
return true;
}
async getCarouselList() {
let res = await InstrumentInfo.find.CarouselList();
this.setState({ carouselList: res.data.rows })
}
async getStrategyList() {
let res = await InstrumentInfo.find.StrategyList();
this.setState({ strategyList: res.data.rows })
}
public alertRegister = () => {
this.setState({ isNotRegister: true }); // 打开弹窗
@ -103,13 +125,47 @@ export default class Detect extends Component<any, any> {
}
}
};
close() {
this.setState({ isShow: false })
}
onChange() {
this.setState({ isShow: true })
}
submit = () => {
let { messageInfo } = this.state;
if (messageInfo.length) {
this.postSaveMessage();
this.close();
} else {
msg("留言内容不能为空!");
// Toast_.fail({
// message: "留言内容不能为空!",
// });
}
};
postSaveMessage = async () => {
let { messageInfo } = this.state;
let params = {
source: 1,
messageInfo: messageInfo,
};
let res = await SaveMessage(params);
if (res.data.code === 200) {
msg("提交成功!");
} else {
msg("提交失败!");
}
};
closeAlert = () => {
this.setState({ isNotRegister: false });
};
onInputTextarea = (e) => {
this.setState({ messageInfo: e.detail.value });
};
render() {
let { name, show, isNotRegister, messageCount } = this.state;
let { isNotRegister, messageCount, carouselList, strategyList, isShow } = this.state;
return (
<Block>
<PopupAlert
@ -124,6 +180,7 @@ export default class Detect extends Component<any, any> {
confirm={this.closeAlert}
/>
<Navbar
titleSlot=' '
leftSlot={
<Block>
<View
@ -143,12 +200,17 @@ export default class Detect extends Component<any, any> {
transparent
/>
<Swiper className='banner_list' autoplay circular >
<SwiperItem className='banner_item' >
<Image className='banner_img' src='{{util.getHttpsUrl(item.banner)}}' mode='aspectFill'></Image>
</SwiperItem>
{
carouselList.map(item => (
<SwiperItem className='banner_item' key={item.id} >
<Image className='banner_img' src={item.fileUrl} mode='aspectFill'></Image>
</SwiperItem>
))
}
</Swiper>
<View className='main'>
<View className='creation_box'>
{/* <View className='creation_box'>
<View className='flex sb aitems'>
<View className='creation_title'></View>
<View className='creation_more flex aitems' >
@ -157,38 +219,97 @@ export default class Detect extends Component<any, any> {
</View>
</View>
<Swiper className='creation_content'>
<SwiperItem className='creation_item' >
<Image className='creation_cover' mode='aspectFill' src='{{util.getHttpsUrl(item.mian_banner)}}'></Image>
<View className='creation_text ellipsis1'></View>
</SwiperItem>
{
carouselList.map(item => (
<SwiperItem className='creation_item' key={item.id}>
<Image className='creation_cover' mode='aspectFill' src={item.fileUrl}></Image>
<View className='creation_text ellipsis1'></View>
</SwiperItem>
))
}
</Swiper>
<View className='indicator'>
<View className='dot' style='width: {{180 / activeList.length}}rpx; transform: translateX({{100 * current}}%)'></View>
<View className='dot' style='width: {{180 / carouselList.length}}rpx; transform: translateX({{100 * current}}%)'></View>
</View>
</View>
</View> */}
<View className='heart_box'>
<View className='heart_title'></View>
<View className='heart_title'></View>
<View className='container'>
<View className='column' >
<View className='waterfall_item' >
<Image className='item_image' mode='widthFix' src='{{util.getHttpsUrl(pics.banner)}}'></Image>
<View className='item_text'>
<View className='ellipsis2'>
<WaterfallFlow
dataSource={strategyList}
columnNum={2}
gutter={12}
renderItem={(item) => {
return (
<View className='column'>
<View className='waterfall_item'>
<Image className='item_image' mode='widthFix' src={item.fileUrl}></Image>
<View className='item_text'>
<View className='ellipsis2'>
{item.title}
</View>
</View>
</View>
</View>
</View>
</View>
</View>
)
}}
/>
</View>
<View style='display: none'>
<Image src='{{util.getHttpsUrl(item.banner)}}' />
</View>
</View>
<View className='feed_back'>
<View className='title'></View>
<View className='btn' ></View>
<View className='title'></View>
<View className='ui-feedBack__text'></View>
<View className='btn' onClick={this.onChange.bind(this)}></View>
</View>
</View>
{/* <Popup
show={isShow}
position='bottom'
closeable
root-portal
custom-style='height: 625rpx; border-radius: 30rpx 30rpx 0 0'
onClose={this.close.bind(this)}
>
<View className='popup-box'>
<View className='popup_title'></View>
<Textarea
className='service-textarea'
maxlength={100}
showCount
placeholder='请在此处写下您的意见与反馈'
placeholderStyle='font-weight: 400;font-size:28rpx;'
onInput={this.onInputTextarea}
></Textarea>
<View className='popup_btn' onClick={this.submit.bind(this)}></View>
</View>
</Popup> */}
<PopupDrawer
isShow={isShow}
isClose
title='留言反馈'
content={
<Block>
<Textarea
className='service-textarea'
maxlength={100}
showCount
placeholder='请在此处写下您的意见与反馈'
placeholderStyle='font-weight: 400;font-size:28rpx;'
onInput={this.onInputTextarea}
></Textarea>
</Block>
}
confirmButtonText='提交'
textAlgin='left'
close={this.close}
confirm={this.submit.bind(this)}
/>
</Block>
);
}

@ -525,8 +525,11 @@ page {
padding: 52rpx 20rpx 46rpx;
box-sizing: border-box;
.site-close-MembraneCloth{
right: 7px;
top: 24px;
right: 29rpx;
top: 34rpx;
width: 48rpx;
height: 48rpx;
position: absolute;
}
.title {

@ -4,11 +4,12 @@ import { Block, View, Image, Text, Input } from "@tarojs/components";
import { Popup, Progress, Slider } from "@antmjs/vantui";
import { useEffect, useRef } from "react";
import Echarts, { EChartOption, EchartsHandle } from "taro-react-echarts";
import * as echarts from "echarts";
// import * as echarts from "echarts";
import "../../../../moduleIOT/pages/iotCarePlan/components/echarts.min.js";
import "./index.less";
interface Props {
echartsData: any
echartsData: any;
}
function Index(echartsData: Props) {
@ -23,66 +24,65 @@ function Index(echartsData: Props) {
bottom: "38rpx",
},
title: {
left: 'center',
left: "center",
},
xAxis: {
type: 'category',
type: "category",
boundaryGap: false,
splitLine: {
show: true,
},
data:eDate,
data: eDate,
axisTick: {
show: false
show: false,
},
axisLine: {
lineStyle: {
color: '#ccc'
}
color: "#ccc",
},
},
axisLabel: {
fontSize: 9
}
fontSize: 9,
},
},
yAxis: {
type: 'value',
show: false
type: "value",
show: false,
},
series: [
{
type: 'line',
type: "line",
itemStyle: {
color: 'rgb(168, 222, 244)'
color: "rgb(168, 222, 244)",
},
symbolSize: 0,
label: {
show: true,
distance: 8,
formatter: function (params) {
return params.value + '级';
}
return params.value + "级";
},
},
areaStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: 'rgb(220, 240, 248)'
color: "rgb(220, 240, 248)",
},
{
offset: 1,
color: 'rgb(248, 253, 255)'
}
])
color: "rgb(248, 253, 255)",
},
]),
},
data: gears,
}
]
},
],
};
return (
<Block>
<View className='box'>
<View className="box">
<Echarts
echarts={echarts}
option={option}

@ -15,7 +15,7 @@ import {
Textarea,
} from "@tarojs/components";
import { go } from "@/utils/traoAPI";
import { Tab, Tabs, Dialog, Popup } from "@antmjs/vantui";
import { Popup } from "@antmjs/vantui";
/** 自定义组件 **/
import Navbar from "@/components/navbar/navbar";
@ -70,9 +70,9 @@ export default class Recording extends Component<any, any> {
};
}
componentDidMount() { }
componentDidMount() {}
componentWillUnmount() { }
componentWillUnmount() {}
// 格式化时间
getTime(time) {
const hour = time.slice(0, 2);
@ -271,9 +271,9 @@ export default class Recording extends Component<any, any> {
this.initData();
}
componentDidShow() { }
componentDidShow() {}
componentDidHide() { }
componentDidHide() {}
initData = async () => {
this.getRecord(null);
@ -340,11 +340,11 @@ export default class Recording extends Component<any, any> {
go(
"/recoding/pages/face_report_one/face_report_one?id=" +
item.id +
"&report=" +
report +
"&obj=" +
JSON.stringify(obj)
item.id +
"&report=" +
report +
"&obj=" +
JSON.stringify(obj)
);
};
// 打开第二种类型
@ -353,11 +353,11 @@ export default class Recording extends Component<any, any> {
let report = false;
go(
"/recoding/pages/face_report/face_report?id=" +
item.id +
"&recordId=" +
item.instrumentId +
"&report=" +
report
item.id +
"&recordId=" +
item.instrumentId +
"&report=" +
report
);
};
// 打开第三种类型
@ -409,8 +409,10 @@ export default class Recording extends Component<any, any> {
setStorageSync("moistureEachtsData", JSON.stringify(echartsData));
let report = false;
go(
`/recoding/pages/moisture_test_report/moisture_test_report?data=${allData.nursingData
}&date=${allData.createTime}&modeId=${allData.modeId}&id=${allData.instrumentId
`/recoding/pages/moisture_test_report/moisture_test_report?data=${
allData.nursingData
}&date=${allData.createTime}&modeId=${allData.modeId}&id=${
allData.instrumentId
}&echartsData=${JSON.stringify(echartsData)}&report=${report}`
);
}
@ -673,9 +675,10 @@ export default class Recording extends Component<any, any> {
{item.modeName}
</View>
<View className="subtitle">
{item.instrumentType === 2 && item.modeId !== 155 && (
<Text>{item.nursingTime}</Text>
)}
{item.instrumentType === 2 &&
item.modeId !== 155 && (
<Text>{item.nursingTime}</Text>
)}
</View>
</View>
</View>

@ -5,8 +5,8 @@ import { createSlice } from "@reduxjs/toolkit";
const globalStoreReducer = createSlice({
name: "globalStore", // store的名字
initialState: {
domain: "https://flossom.yq-h5.cn/prod-api/hzwx", // 请求地址
// domain: "http://192.168.10.147:8080/hzwx", // 请求地址
// domain: "https://flossom.yq-h5.cn/prod-api/hzwx", // 请求地址
domain: "http://127.0.0.1:8080/hzwx", // 请求地址
// 是否首次进入首页
isShowIndexFlag: false,
},

@ -454,7 +454,7 @@ export const InstrumentInfo = {
});
},
},
// 根据定制电流返回配方和频率
// 根据定制电流返回配方和频率
// WE200:{
// CustomizedCurrentFrequency: (data) => {
// return Ajax({
@ -477,22 +477,37 @@ export const InstrumentInfo = {
// 电流定制护理频率与时间
CustomizedCurrentFrequency: (data) => {
return Ajax({
url: "/lining/electric/formula",
data,
method: "post",
});
},
// 眼雕大师雷达图
RadarChart: (data) => {
// 眼雕大师雷达图
RadarChart: (data) => {
return Ajax({
url: "/instrument/answerResult" ,
url: "/instrument/answerResult",
data,
method: "post",
});
},
},
// 发现页
find: {
// 顶部轮播图
CarouselList: () => {
return Ajax({
url: "/carousel/list",
method: "get",
});
},
StrategyList: () => {
console.log('进来了');
return Ajax({
url: "/strategy/list",
method: "get",
});
},
},
};
//localhost:9204/instrument/getInstrumentInfoBySerial

Loading…
Cancel
Save