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 1. 电脑需要安装 node ,开发版本为 16.18.0
2. 下载项目依赖 2. 下载项目依赖
```javascript ```javascript
npm i -f // 强制下载安装依赖 注意请使用npm源taobao源可能下载失败 npm i -f // 强制下载安装依赖 注意请使用npm源taobao源可能下载失败
``` ```

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

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

@ -29,7 +29,7 @@ export default class Index extends Component {
}, },
{ {
pagePath: "pages/activity/activity", pagePath: "pages/activity/activity",
text: "活动", text: "护理计划",
iconPath: "/img/tabar/2.png", iconPath: "/img/tabar/2.png",
selectedIconPath: "/img/tabar/22.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 { .membrane_Select {
background-color: #fff; background-color: #fff;
border-radius: 30rpx 30rpx 0rpx 0rpx; border-radius: 30rpx 30rpx 0rpx 0rpx;
@ -41,10 +49,10 @@
.iot-main-membrane { .iot-main-membrane {
background: #fff; background: #fff;
// margin-top: 23rpx; padding: 25rpx 21rpx;
height: 34vh; height: 34vh;
// height: 31vh;
overflow: auto; overflow: auto;
border-radius: 0rpx 30rpx 30rpx 30rpx;
} }
} }
.MembranePopup { .MembranePopup {

File diff suppressed because it is too large Load Diff

@ -39,9 +39,13 @@ export default class BluetoothContainer {
...WE200DeviceControlCommand.workByPatitionSet, ...WE200DeviceControlCommand.workByPatitionSet,
workMode: workMode, // 使用模式 workMode: workMode, // 使用模式
gearTakeEffectOffline: gearTakeEffectOffline, // 是否离线生效 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 sendParams as any
); );
@ -60,6 +64,11 @@ export default class BluetoothContainer {
let sendParams: any = { let sendParams: any = {
...WE200DeviceControlCommand.pause, ...WE200DeviceControlCommand.pause,
workMode: workMode, // 使用模式 workMode: workMode, // 使用模式
workStatus: 'standby',
deviceSyncCommandType: 'onlySyncStatusToDevice',
totalWorkingMinutes: 0,
totalWorkingSeconds: 0,
// deviceSyncCommandType: "onlySyncStatusToDevice",
}; };
const pauseArrayBuffer = this.deviceToolKitInstance?.toBleCommand( const pauseArrayBuffer = this.deviceToolKitInstance?.toBleCommand(
sendParams as any sendParams as any
@ -100,14 +109,14 @@ export default class BluetoothContainer {
partitionStatus partitionStatus
}; };
// 根据不同模式进行控制传参处理 // 根据不同模式进行控制传参处理
switch (workMode) { // switch (workMode) {
case "private_custom_current": // case "private_custom_current":
break; // break;
case "official_specific_effective": // case "official_specific_effective":
break; // break;
case 'DiyFacial_Custom': // case 'DiyFacial_Custom':
break; // break;
} // }
const pauseArrayBuffer = this.deviceToolKitInstance?.toBleCommand( const pauseArrayBuffer = this.deviceToolKitInstance?.toBleCommand(
sendParams as any sendParams as any
@ -124,8 +133,9 @@ export default class BluetoothContainer {
}, },
/** @name 设备控制:结束 */ /** @name 设备控制:结束 */
end: (workMode = '') => { end: (workMode = '') => {
setTimeout(() => {
let sendParams: any = { let sendParams: any = {
...WE200DeviceControlCommand.pause, ...WE200DeviceControlCommand.end,
workMode: workMode, // 使用模式 workMode: workMode, // 使用模式
}; };
const pauseArrayBuffer = this.deviceToolKitInstance?.toBleCommand( const pauseArrayBuffer = this.deviceToolKitInstance?.toBleCommand(
@ -138,7 +148,25 @@ export default class BluetoothContainer {
this.that.resetTimer(); this.that.resetTimer();
console.info(`发送结束指令成功 参数为 =>`, sendParams); console.info(`发送结束指令成功 参数为 =>`, sendParams);
}); });
}, 2000)
},
// 查询设备护理报告
getCurrentFacialReportInfo:(workMode = '') => {
const infoQueryComment = {
commandType: 'InfoQuery',
infoQueryType: 'currentFacialReportInfo',
workMode: workMode,
}
const value = this.deviceToolKitInstance?.toBleCommand(infoQueryComment);
sendCommand({
value: value
}).then(() => {
console.info('下发指令查询护理报告==》', JSON.stringify(infoQueryComment));
})
}, },
/** 离线记录汇总 */
syncOfflineSummary: () => { syncOfflineSummary: () => {
const queryOfflineSummary = this.deviceToolKitInstance?.toBleCommand({ const queryOfflineSummary = this.deviceToolKitInstance?.toBleCommand({
...WE200BleCommand.InfoQuery.offlineSummary ...WE200BleCommand.InfoQuery.offlineSummary
@ -147,6 +175,7 @@ export default class BluetoothContainer {
value: queryOfflineSummary, value: queryOfflineSummary,
}); });
}, },
/** 最新一条离线记录详情 */
syncOfflineDetail: () => { syncOfflineDetail: () => {
const queryOfflineDetail = this.deviceToolKitInstance?.toBleCommand({ const queryOfflineDetail = this.deviceToolKitInstance?.toBleCommand({
...WE200BleCommand.InfoQuery.offlineDetail ...WE200BleCommand.InfoQuery.offlineDetail
@ -154,6 +183,18 @@ export default class BluetoothContainer {
sendCommand({ sendCommand({
value: queryOfflineDetail, value: queryOfflineDetail,
}); });
},
// 同步设备状态
sendOnlySyncStatusToDevice() {
console.log('主动查询设备状态指令发送');
const queryM01DeviceArrayBuffer = this.deviceToolKitInstance?.toBleCommand({
commandType: "DeviceStatusSync",
deviceSyncCommandType: 'onlySyncStatusToDevice'
})
sendCommand({
value: queryM01DeviceArrayBuffer
})
} }
} }
@ -168,7 +209,13 @@ export default class BluetoothContainer {
} }
/** @name 设备响应:暂停 */ /** @name 设备响应:暂停 */
private syncPause(jsonStatus) { 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; let isDisconnect = false;
// true代表暂停 // true代表暂停
if (isDisconnect) { if (isDisconnect) {
@ -182,6 +229,7 @@ export default class BluetoothContainer {
isError: false isError: false
}); });
} }
} }
@ -227,20 +275,13 @@ export default class BluetoothContainer {
/** @name 设备响应:通用状态响应 */ /** @name 设备响应:通用状态响应 */
private syncCommonStatus(jsonStatus) { 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) { if (jsonStatus.battery) {
this.that.setState({ this.that.setState({
Electricity: jsonStatus.battery, Electricity: jsonStatus.matrixBattery,
}); });
} }
@ -292,6 +333,15 @@ export default class BluetoothContainer {
} }
} }
} }
/** @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) { if (!jsonStatus || jsonStatus == null) {
return; return;
} }
this.that.workStatus = jsonStatus.workStatus; // 记录工作状态 // this.that.workStatus = jsonStatus.workStatus; // 记录工作状态
// end 和 endWork 都是护理结束, endWork不关机, end 关机, 对小程序而言处理流程都一样 // end 和 endWork 都是护理结束, endWork不关机, end 关机, 对小程序而言处理流程都一样
if (jsonStatus.workStatus && jsonStatus.workStatus == "endWork") { if (jsonStatus.workStatus && jsonStatus.workStatus == "endWork") {
@ -346,7 +396,7 @@ export default class BluetoothContainer {
if (jsonStatus.battery) { if (jsonStatus.battery) {
// 防止抖动 // 防止抖动
this.that.setState({ this.that.setState({
Electricity: jsonStatus.battery, Electricity: jsonStatus.matrixBattery,
}); });
} }
@ -370,6 +420,7 @@ export default class BluetoothContainer {
//设备对控制指令的响应 //设备对控制指令的响应
case "DeviceControl": case "DeviceControl":
this.syncDeviceControl(jsonStatus); this.syncDeviceControl(jsonStatus);
this.syncCommonStatus(jsonStatus);
break; break;
// 设备对信息查询指令的响应 // 设备对信息查询指令的响应
case "InfoQuery": case "InfoQuery":
@ -451,6 +502,11 @@ export default class BluetoothContainer {
// }); // });
// }, 20000); // }, 20000);
} }
setTimeout(() => {
this.DeviceControl.sendOnlySyncStatusToDevice()
}, 1000)
}); });
} }
} }

@ -1,287 +1,253 @@
import { Block, View, Image } from "@tarojs/components";
import { Block, View, Image, Text, Input } from "@tarojs/components"; import { useEffect, useRef, useState, useCallback } from "react";
import { useRef } from "react";
import Echarts, { EChartOption, EchartsHandle } from "taro-react-echarts"; import Echarts, { EChartOption, EchartsHandle } from "taro-react-echarts";
// import echarts from "@/utils/echarts.min.js"; import echarts from "../echarts.min.js";
import * as echarts from "echarts";
import "./index.less"; import "./index.less";
interface Props { 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:
} }
function Index({ series, full, time }: Props) {
const echartsRef = useRef<EchartsHandle>(null); const echartsRef = useRef<EchartsHandle>(null);
const [options, setOptions] = useState({
function generateColorArray(startColor, endColor, steps) { animation: false,
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 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;
}
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: { grid: {
// 让图表占满容器 // 让图表占满容器
top: "10rpx", // containLabel: true,
left: "45rpx", top: "28rpx",
left: "18rpx",
right: "28rpx", right: "28rpx",
bottom: "17rpx", bottom: "17rpx",
}, },
xAxis: { xAxis: {
type: "category", type: "category",
data: [...xList], axisLine: {
axisLabel: { //坐标轴轴线相关设置。数学上的x轴
interval: 5, show: true,
formatter: function (value, index) { lineStyle: {
return value * 10 + 's'; color: "#cccccc",
}, },
textStyle: {
color: '#999999', // 文字颜色
fontSize: 8 // 文字大小
}, },
axisLabel: {
//坐标轴刻度标签的相关设置
color: "#fff",
fontSize: 1,
}, },
axisTick: { axisTick: {
// alignWithLabel: true,
show: false, show: false,
interval: 9,
}, },
// axisLine: {
// show: false,
// },
}, },
yAxis: [ yAxis: {
{ type: "value",
min: 0, min: 0,
max: 80, max: 8,
splitNumber: 10, splitNumber: 8,
axisLabel: { splitLine: {
formatter: function (value, index) { show: true,
const num = value / 10 + 1 lineStyle: {
return num === 9 ? '' : num + '级'; color: "#cccccc",
type: [4, 2],
dashOffset: 4,
}, },
textStyle: {
color: '#999999', // 文字颜色
fontSize: 8 // 文字大小
}, },
axisLine: {
show: false,
}, },
type: "value", axisLabel: {
splitLine: { show: false,
lineStyle: {
color: ["#ccc", "#ccc", "#ccc", "#ccc", "#ccc", "#ccc", "#ccc", "#ccc", "#fff"],
type: 'dashed'
}, },
} axisTick: {
show: false,
}, },
], },
series: [ visualMap: {
z: 1,
top: 0,
right: 0,
seriesIndex: 0,
show: false,
pieces: [
{ {
barCategoryGap: '0%', gt: 0,
data: seriesData, lte: 1,
type: "bar", color: "#f8f4f9",
// barWidth: 15, },
gapWidth: "0%",
itemStyle: {
normal: {
color: function (params) {
var value = params.data;
return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ {
offset: 0, gt: 1,
color: colors[parseInt(value)], // 红色 lte: 2,
color: "#f5f1f8",
}, },
{ {
offset: 1, gt: 2,
color: colors[0], // 黄色 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
} }
// 基于 EchartsData 生成 ECharts 配置
// const option: EChartOption ={
// grid: { // let option
// // 让图表占满容器 // if (data) {
// top: "10rpx", // option = JSON.parse(JSON.stringify(newParams))
// left: "45rpx", // } else {
// right: "28rpx", // option = JSON.parse(JSON.stringify(options))
// 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'
// },
// } // }
// }, let option = JSON.parse(JSON.stringify(options))
// ], let datas = JSON.parse(JSON.stringify(data))
// series: [ 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]);
// {
// 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()}`;
}
const cancelFull = useCallback(
(res) => {
full();
setIsfull(!isFull);
},
[isFull]
);
useEffect(() => {
setOptions(newOptions);
}, [newOptions]);
useEffect(() => {
updata(series, time);
}, [series]);
return ( return (
<Block> <Block>
<View className={isFull ? "echart-component-full" : "echart-component"}>
<Echarts <Echarts
force-use-old-canvas="false"
echarts={echarts} echarts={echarts}
option={option} option={options}
ref={echartsRef} ref={echartsRef}
// isPage={false} // isPage={false}
// style自定义设置echarts宽高 // style自定义设置echarts宽高
// style={{ width: "100%", height: "100%" }} style={{ width: "630rpx", height: "260rpx", zIndex: 1 }}
style={{ width: "670rpx", height: "260rpx" }}
/> />
<View className="box_background">
{/* <View className="box"> <Image
<Echarts className={isFull ? "part" : "full"}
echarts={echarts} src={require(`@/img/${isFull ? "part-scran" : "full-scran"}.png`)}
option={option} onClick={cancelFull}
ref={echartsRef} ></Image>
// isPage={false}
// style自定义设置echarts宽高 <View className="power"></View>
style={{ width: "630rpx", height: "240rpx" }} {level.map((item) => (
/> <View className="line" key={item}>
<View className="number">{item}</View>
</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> </Block>
); );
} }

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

@ -12,62 +12,15 @@ import "./index.less";
interface Props { interface Props {
cancelFull:Function cancelFull:Function
height:any, 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); const echartsRef = useRef<EchartsHandle>(null);
console.log(echartsRef,'echartsRef'); console.log(max,'maxmaxmax');
// 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
// }
// }
// ]
// })
let options :EChartOption={ let options :EChartOption={
animation: true, animation: true,
grid: { grid: {
@ -84,14 +37,14 @@ function Index({cancelFull,height,series}:Props) {
fontSize: 10, fontSize: 10,
}, },
indicator: [ indicator: [
{ name: '垂', max: 5, color: '#000' }, { name: '垂', max: max, color: '#000' },
{ name: '肿', max: 5, color: '#000' }, { name: '肿', max:max, color: '#000' },
{ name: '疲', max: 5, color: '#000' }, { name: '疲', max: max, color: '#000' },
{ name: '黑', max: 5, color: '#000' }, { name: '黑', max: max, color: '#000' },
{ name: '凹', max: 5, color: '#000' }, { name: '凹', max: max, color: '#000' },
{ name: '松', max: 5, color: '#000' }, { name: '松', max: max, color: '#000' },
{ name: '纹', max: 5, color: '#000' }, { name: '纹', max: max, color: '#000' },
{ name: '垮', max: 5, color: '#000' } { name: '垮', max: max, color: '#000' }
] ]
}, },
series: [ series: [

@ -7,7 +7,6 @@
// font-size: 30rpx; // font-size: 30rpx;
// } // }
.message { .message {
position: relative; position: relative;
width: 40rpx; width: 40rpx;
@ -47,7 +46,7 @@
.main { .main {
position: relative; position: relative;
top: -130rpx; top: -130rpx;
background: #F7F8FA; background: #f7f8fa;
border-top-left-radius: 50rpx; border-top-left-radius: 50rpx;
border-top-right-radius: 50rpx; border-top-right-radius: 50rpx;
padding: 50rpx 30rpx; padding: 50rpx 30rpx;
@ -127,13 +126,11 @@
.container { .container {
width: 100%; width: 100%;
display: flex;
justify-content: space-between;
margin-top: 50rpx; margin-top: 50rpx;
} }
.column { .column {
width: calc(50% - 10rpx); width: 100%;
overflow: hidden; overflow: hidden;
} }
@ -141,7 +138,6 @@
width: 100%; width: 100%;
background-color: #fff; background-color: #fff;
border-radius: 30rpx; border-radius: 30rpx;
margin-bottom: 23rpx;
} }
.item_image { .item_image {
@ -180,6 +176,47 @@
font-size: 32rpx; font-size: 32rpx;
font-weight: bold; font-weight: bold;
text-align: center; text-align: center;
color: #FFFFFF; color: #ffffff;
margin: 19rpx auto 44rpx; 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, Video,
Swiper, Swiper,
SwiperItem, SwiperItem,
Textarea,
} from "@tarojs/components"; } from "@tarojs/components";
import Navbar from "@/components/navbar/navbar"; import Navbar from "@/components/navbar/navbar";
import { go } from "@/utils/traoAPI"; import { go, msg } from "@/utils/traoAPI";
import { import {
InstrumentInfo, InstrumentInfo,SaveMessage
} from "../../utils/Interface"; } from "../../utils/Interface";
import { WaterfallFlow, Popup } from '@antmjs/vantui'
import PopupAlert from "@/components/popup/popup-alert"; import PopupAlert from "@/components/popup/popup-alert";
import "taro-ui/dist/style/components/button.scss"; // 按需引入 import "taro-ui/dist/style/components/button.scss"; // 按需引入
import "./detect.less"; import "./detect.less";
import type CustomTabBar from "../../custom-tab-bar"; import type CustomTabBar from "../../custom-tab-bar";
import PopupDrawer from "@/components/popup/popup-drawer";
export default class Detect extends Component<any, any> { export default class Detect extends Component<any, any> {
pageCtx = Taro.getCurrentInstance().page; pageCtx = Taro.getCurrentInstance().page;
@ -32,11 +35,17 @@ export default class Detect extends Component<any, any> {
isNotRegister: false, // 是否未注册 isNotRegister: false, // 是否未注册
show: false, show: false,
messageCount: Taro.getStorageSync("messageCount") || 0, messageCount: Taro.getStorageSync("messageCount") || 0,
isRegisterBoolean: false isRegisterBoolean: false,
carouselList: [],
strategyList: [],
isShow: false,
messageInfo: ''
}; };
} }
async onLoad() { this.showInit() } async onLoad() {
}
showInit = async () => { showInit = async () => {
// 判断是否登录 // 判断是否登录
@ -52,6 +61,9 @@ export default class Detect extends Component<any, any> {
componentDidShow() { componentDidShow() {
const tabbar = Taro.getTabBar<CustomTabBar>(this.pageCtx); const tabbar = Taro.getTabBar<CustomTabBar>(this.pageCtx);
tabbar?.setSelected(2); tabbar?.setSelected(2);
this.showInit()
this.getCarouselList()
this.getStrategyList()
} }
componentDidHide() { } componentDidHide() { }
@ -71,6 +83,16 @@ export default class Detect extends Component<any, any> {
} }
return true; 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 = () => { public alertRegister = () => {
this.setState({ isNotRegister: true }); // 打开弹窗 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 = () => { closeAlert = () => {
this.setState({ isNotRegister: false }); this.setState({ isNotRegister: false });
}; };
onInputTextarea = (e) => {
this.setState({ messageInfo: e.detail.value });
};
render() { render() {
let { name, show, isNotRegister, messageCount } = this.state; let { isNotRegister, messageCount, carouselList, strategyList, isShow } = this.state;
return ( return (
<Block> <Block>
<PopupAlert <PopupAlert
@ -124,6 +180,7 @@ export default class Detect extends Component<any, any> {
confirm={this.closeAlert} confirm={this.closeAlert}
/> />
<Navbar <Navbar
titleSlot=' '
leftSlot={ leftSlot={
<Block> <Block>
<View <View
@ -143,12 +200,17 @@ export default class Detect extends Component<any, any> {
transparent transparent
/> />
<Swiper className='banner_list' autoplay circular > <Swiper className='banner_list' autoplay circular >
<SwiperItem className='banner_item' > {
<Image className='banner_img' src='{{util.getHttpsUrl(item.banner)}}' mode='aspectFill'></Image> carouselList.map(item => (
<SwiperItem className='banner_item' key={item.id} >
<Image className='banner_img' src={item.fileUrl} mode='aspectFill'></Image>
</SwiperItem> </SwiperItem>
))
}
</Swiper> </Swiper>
<View className='main'> <View className='main'>
<View className='creation_box'> {/* <View className='creation_box'>
<View className='flex sb aitems'> <View className='flex sb aitems'>
<View className='creation_title'></View> <View className='creation_title'></View>
<View className='creation_more flex aitems' > <View className='creation_more flex aitems' >
@ -157,38 +219,97 @@ export default class Detect extends Component<any, any> {
</View> </View>
</View> </View>
<Swiper className='creation_content'> <Swiper className='creation_content'>
<SwiperItem className='creation_item' > {
<Image className='creation_cover' mode='aspectFill' src='{{util.getHttpsUrl(item.mian_banner)}}'></Image> 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> <View className='creation_text ellipsis1'></View>
</SwiperItem> </SwiperItem>
))
}
</Swiper> </Swiper>
<View className='indicator'> <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> */}
<View className='heart_box'> <View className='heart_box'>
<View className='heart_title'></View> <View className='heart_title'></View>
<View className='container'> <View className='container'>
<WaterfallFlow
dataSource={strategyList}
columnNum={2}
gutter={12}
renderItem={(item) => {
return (
<View className='column'> <View className='column'>
<View className='waterfall_item'> <View className='waterfall_item'>
<Image className='item_image' mode='widthFix' src='{{util.getHttpsUrl(pics.banner)}}'></Image> <Image className='item_image' mode='widthFix' src={item.fileUrl}></Image>
<View className='item_text'> <View className='item_text'>
<View className='ellipsis2'> <View className='ellipsis2'>
{item.title}
</View> </View>
</View> </View>
</View> </View>
</View> </View>
)
}}
/>
</View> </View>
<View style='display: none'> <View style='display: none'>
<Image src='{{util.getHttpsUrl(item.banner)}}' /> <Image src='{{util.getHttpsUrl(item.banner)}}' />
</View> </View>
</View> </View>
<View className='feed_back'> <View className='feed_back'>
<View className='title'></View> <View className='title'></View>
<View className='btn' ></View> <View className='ui-feedBack__text'></View>
<View className='btn' onClick={this.onChange.bind(this)}></View>
</View> </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> </Block>
); );
} }

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

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

@ -15,7 +15,7 @@ import {
Textarea, Textarea,
} from "@tarojs/components"; } from "@tarojs/components";
import { go } from "@/utils/traoAPI"; import { go } from "@/utils/traoAPI";
import { Tab, Tabs, Dialog, Popup } from "@antmjs/vantui"; import { Popup } from "@antmjs/vantui";
/** 自定义组件 **/ /** 自定义组件 **/
import Navbar from "@/components/navbar/navbar"; import Navbar from "@/components/navbar/navbar";
@ -409,8 +409,10 @@ export default class Recording extends Component<any, any> {
setStorageSync("moistureEachtsData", JSON.stringify(echartsData)); setStorageSync("moistureEachtsData", JSON.stringify(echartsData));
let report = false; let report = false;
go( go(
`/recoding/pages/moisture_test_report/moisture_test_report?data=${allData.nursingData `/recoding/pages/moisture_test_report/moisture_test_report?data=${
}&date=${allData.createTime}&modeId=${allData.modeId}&id=${allData.instrumentId allData.nursingData
}&date=${allData.createTime}&modeId=${allData.modeId}&id=${
allData.instrumentId
}&echartsData=${JSON.stringify(echartsData)}&report=${report}` }&echartsData=${JSON.stringify(echartsData)}&report=${report}`
); );
} }
@ -673,7 +675,8 @@ export default class Recording extends Component<any, any> {
{item.modeName} {item.modeName}
</View> </View>
<View className="subtitle"> <View className="subtitle">
{item.instrumentType === 2 && item.modeId !== 155 && ( {item.instrumentType === 2 &&
item.modeId !== 155 && (
<Text>{item.nursingTime}</Text> <Text>{item.nursingTime}</Text>
)} )}
</View> </View>

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

@ -477,7 +477,6 @@ export const InstrumentInfo = {
// 电流定制护理频率与时间 // 电流定制护理频率与时间
CustomizedCurrentFrequency: (data) => { CustomizedCurrentFrequency: (data) => {
return Ajax({ return Ajax({
url: "/lining/electric/formula", url: "/lining/electric/formula",
data, data,
method: "post", method: "post",
@ -486,13 +485,29 @@ export const InstrumentInfo = {
// 眼雕大师雷达图 // 眼雕大师雷达图
RadarChart: (data) => { RadarChart: (data) => {
return Ajax({ return Ajax({
url: "/instrument/answerResult", url: "/instrument/answerResult",
data, data,
method: "post", 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 //localhost:9204/instrument/getInstrumentInfoBySerial

Loading…
Cancel
Save