临时提交,给记录打卡测试

master
blak-kong 2 years ago
parent fa4a1bcecd
commit 51a77ece7f

@ -17,6 +17,7 @@ const config = {
defineConstants: {
},
alias: {
'@/img': path.resolve(__dirname, '..', 'src/img'),
'@/components': path.resolve(__dirname, '..', 'src/components'),
'@/utils': path.resolve(__dirname, '..', 'src/utils'),
'@/store': path.resolve(__dirname, '..', 'src/store'),

16
package-lock.json generated

@ -10,8 +10,8 @@
"dependencies": {
"@antmjs/vantui": "^3.2.2",
"@babel/runtime": "^7.7.7",
"@flossom-npm/iot-translater": "^1.0.8",
"@flossom-npm/iot-translater-we100": "^1.0.66",
"@flossom-npm/iot-translater": "^1.0.14",
"@flossom-npm/iot-translater-we100": "^1.0.74",
"@reduxjs/toolkit": "^2.0.1",
"@taroify/core": "^0.1.1-alpha.8",
"@tarojs/components": "3.6.19",
@ -4260,9 +4260,9 @@
"license": "ISC"
},
"node_modules/@flossom-npm/iot-translater-we100": {
"version": "1.0.73",
"resolved": "https://gitea.ecolite.co/api/packages/huangbangxin/npm/%40flossom-npm%2Fiot-translater-we100/-/1.0.73/iot-translater-we100-1.0.73.tgz",
"integrity": "sha512-F9lKXFGOlXg2H8hoDO5yVugAkcv/QYU6vTdchBYgtPIMA2pc4aUWYw5vpW7xPSPIpzfJM7C6UsWe3oTNk26nAA==",
"version": "1.0.74",
"resolved": "https://gitea.ecolite.co/api/packages/huangbangxin/npm/%40flossom-npm%2Fiot-translater-we100/-/1.0.74/iot-translater-we100-1.0.74.tgz",
"integrity": "sha512-6FgvU+YVjdLeiU96E5fhqXgcvT2rh0ZNkOpLK647abtezVYge/WcFotjZezkw9QHSBK8qrBpS8XbQFkRSt/nWw==",
"license": "ISC"
},
"node_modules/@gar/promisify": {
@ -38853,9 +38853,9 @@
"integrity": "sha512-rpqLLgYoX/vFVS8jGtk6AfTxyXtrSnX94LvMROUOslZBLC40PuzClLGWr4E9qXdCqeneOA9jssZrZbHysfd7yA=="
},
"@flossom-npm/iot-translater-we100": {
"version": "1.0.73",
"resolved": "https://gitea.ecolite.co/api/packages/huangbangxin/npm/%40flossom-npm%2Fiot-translater-we100/-/1.0.73/iot-translater-we100-1.0.73.tgz",
"integrity": "sha512-F9lKXFGOlXg2H8hoDO5yVugAkcv/QYU6vTdchBYgtPIMA2pc4aUWYw5vpW7xPSPIpzfJM7C6UsWe3oTNk26nAA=="
"version": "1.0.74",
"resolved": "https://gitea.ecolite.co/api/packages/huangbangxin/npm/%40flossom-npm%2Fiot-translater-we100/-/1.0.74/iot-translater-we100-1.0.74.tgz",
"integrity": "sha512-6FgvU+YVjdLeiU96E5fhqXgcvT2rh0ZNkOpLK647abtezVYge/WcFotjZezkw9QHSBK8qrBpS8XbQFkRSt/nWw=="
},
"@gar/promisify": {
"version": "1.1.3",

@ -36,7 +36,8 @@
"author": "",
"dependencies": {
"@antmjs/vantui": "^3.2.2",
"@babel/runtime": "^7.7.7",
"@flossom-npm/iot-translater": "^1.0.14",
"@flossom-npm/iot-translater-we100": "^1.0.74",
"@reduxjs/toolkit": "^2.0.1",
"@taroify/core": "^0.1.1-alpha.8",
"@tarojs/components": "3.6.19",
@ -60,10 +61,7 @@
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react-redux": "^9.0.3",
"taro-ui": "^3.2.0",
"terser-webpack-plugin": "^5.3.9",
"@flossom-npm/iot-translater": "^1.0.8",
"@flossom-npm/iot-translater-we100": "^1.0.66"
"taro-ui": "^3.2.0"
},
"devDependencies": {
"@babel/core": "^7.8.0",
@ -91,6 +89,8 @@
"thread-loader": "^4.0.2",
"ts-node": "^10.9.1",
"typescript": "^4.1.0",
"webpack": "^5.78.0"
"webpack": "^5.78.0",
"terser-webpack-plugin": "^5.3.9",
"@babel/runtime": "^7.7.7"
}
}

@ -26,6 +26,7 @@ export default defineAppConfig({
"pages/recording/recording",
"pages/webViewPage/webViewPage",
'pages/template/template',
"pages/connection_help/connection_help",
],
"tabBar": {
"custom": true,
@ -77,5 +78,6 @@ export default defineAppConfig({
navigationBarTitleText: 'WeChat',
navigationBarTextStyle: 'black',
// enablePullDownRefresh: true
}
},
requiredPrivateInfos: ["getLocation"]
})

@ -0,0 +1,10 @@
const InstrumentTypeEnum = {
//仪器类型
FR200: 1,
MATRIX: 2,
WL200: 3,
FR380: 4,
FR390: 5,
M01: 6,
};
export default InstrumentTypeEnum;

@ -0,0 +1,7 @@
const OtaDeviceTypeEnum = {
WL200: "WL200",
WE100: "WE100",
FACIALMASK: "FacialMask",
STAND: "Stand",
};
export default OtaDeviceTypeEnum;

File diff suppressed because it is too large Load Diff

@ -0,0 +1,66 @@
/**蓝牙命令合集*/
export const bleCommandSamples = {
/**发送配对码*/
match: {
commandType: "BleMatch",
bleCommandType: "SendMatchCode",
},
/**查询附属设备的配对状态*/
querySubDevice: {
commandType: "BleMatch",
bleCommandType: "QueryMatchStatus",
},
/**查询设备状态指令*/
queryDeviceStatus: {
commandType: "DeviceStatusSync",
deviceSyncCommandType: 'queryDeviceStatus'
},
/**查询版本指令*/
queryDeviceVersionStatus: {
commandType: "InfoQuery",
infoQueryType: 'versionInfo',
otaDeviceType: ''
},
/**查询当前记录*/
queryCurrentMaskReportInfo: {
commandType: "InfoQuery",
infoQueryType: 'currentMaskReportInfo'
}
};
/**控制设备命令合集*/
export const deviceCommandSamples = {
/**控制设备暂停 pause暂停 working启动 end关闭*/
pause:{
commandType: "DeviceControl",
workStatus: "pause",
},
standby:{
commandType: "DeviceControl",
workStatus: "standby",
},
end:{
commandType: "DeviceControl",
workStatus: "end",
},
/*
* powerfulSoothing 强效舒缓 01
* Stability 维稳维护 02
* Brighten 均色提亮 03
* FirmSkin 紧致淡纹 04
* Custom 自定义模式 05
* WaterLightEssence 水光精华模式 11
* ShapeBeautyEssence 塑颜精华模式 12
* DiyFacial DIY面膜模式 13
* FacialMaskCustom 面膜定制模式 1A
*/
work:{
commandType: "DeviceControl",
workStatus: "working",
workMode: "",
},
gear:{
commandType: "DeviceControl",
partitionStatus: [{gear: 1},{gear: 1},{gear: 1},{gear: 1},]
}
};

@ -0,0 +1,64 @@
.site-popup-content-box {
margin: 0;
}
// .van-popup {
// background-color: transparent;
// }
.site-close {
position: absolute;
right: 36rpx;
top: 36rpx;
color: #fff;
font-size: 36rpx;
z-index: 100009;
background-color: #ababab;
border-radius: 50%;
padding: 8rpx;
box-sizing: border-box;
}
.site-popup-btn {
position: absolute;
bottom: 100rpx;
left: calc(50% - 120rpx);
width: 240rpx;
height: 70rpx;
line-height: 70rpx;
font-size: 28rpx;
text-align: center;
border: 1rpx solid #000;
border-radius: 40rpx;
background-color: #000;
color: #fff;
box-sizing: border-box;
}
.upload-tips-common-box {
padding: 50rpx 20rpx 44rpx 20rpx;
.tips-message {
margin-top: 30rpx;
text-align: center;
font-size: 28rpx;
line-height: 45rpx;
color: #666;
}
}
.popup-btn-one {
display: flex;
margin-top: 60rpx;
justify-content: center;
.popup-btn {
width: 270rpx;
height: 90rpx;
line-height: 90rpx;
font-size: 32rpx;
font-weight: 500;
text-align: center;
border: 1rpx solid #000;
border-radius: 45rpx;
color: #fff;
background-color: #000;
font-family: PingFang SC;
}
}

@ -0,0 +1,157 @@
import classnames from "classnames";
import Taro from "@tarojs/taro";
import { Component } from "react";
import {
Block,
View,
Image,
Text,
Button,
PageMeta,
Video,
} from "@tarojs/components";
import { Popup } from "@antmjs/vantui";
import "../../popup/popup.less";
import "./device-connection-popup.less";
import { go } from "@/utils/traoAPI";
/*** props
* isLarge
* isShow
* data
* @confirm
* ***/
export default class DeviceConnectPopup extends Component<any, any> {
constructor(props) {
super(props);
this.state = {
name: "蓝牙提示弹窗",
current: 0,
toRight: false,
isClick: false,
};
}
async onLoad() {}
componentDidMount() {}
componentWillUnmount() {}
componentDidShow() {}
componentDidHide() {}
initData = () => {
if (this.props.siteData) {
let arr = JSON.parse(JSON.stringify(this.props.siteData));
this.setState({ siteList: arr });
}
};
onClose = () => {
this.props.close();
};
onConfirm = () => {
this.props.confirm();
};
onClickStop = (e) => {
e.stopPropagation();
};
render() {
let { isShow, data, isLarge, title, connectionStatus, isConnection } =
this.props;
let { current } = this.state;
return (
<Block>
<PageMeta pageStyle={isShow ? "overflow: hidden;" : ""} />
<Popup
style="background-color: #fff;"
show={isShow}
closeOnClickOverlay={false}
round
overlayStyle="width: 100vw;padding: 0;"
onClick={this.onClickStop}
>
<View
className="at-icon at-icon-close site-close"
onClick={this.onClose}
></View>
<View className={classnames("common-box upload-tips-common-box")}>
<View className={classnames("common-popup-title", "margin-samll")}>
{data.bluetoothConnectingTitle}
</View>
<View className="site-popup-content-box">
<Video src={data.bluetoothConnecting} />
<View className="block">
<View className="icon">
{connectionStatus ? (
<Image
className="images"
src={require("../../../img/selected_success.png")}
mode="aspectFill"
/>
) : (
<Image
className="images"
src={require("../../../img/select_success.png")}
mode="aspectFill"
/>
)}
</View>
{isConnection && <View></View>}
<View className="tip1">skinpilot</View>
</View>
</View>
<View className="common-popup-btns">
<Button className="common-popup-btn2" onClick={this.onClose}>
</Button>
<Button className="common-popup-btn2" onClick={this.onConfirm}>
</Button>
</View>
{/* <View>
{data.length === 1 && (
<View className="popup-btn-one">
<Button className="popup-btn" onClick={this.onClose}>
</Button>
</View>
)}
{data.length > 1 && current === 0 && (
<View className="popup-btn-one">
<Button className="popup-btn" onClick={this.onPrev}>
</Button>
</View>
)}
{data.length > 1 && (
<View className="common-popup-btns">
<Button className="common-popup-btn2" onClick={this.onPrev}>
{current > 0 && current < data.length - 1 && "上一步"}
</Button>
<Button className="common-popup-btn2" onClick={this.onNext}>
{current > 0 && current < data.length - 1 && "下一步"}
{current > 0 && current === data.length - 1 && "知道了"}
</Button>
</View>
)}
</View> */}
</View>
</Popup>
</Block>
);
}
}

@ -38,6 +38,10 @@
font-weight: bold;
color: #000000;
}
.logo-title {
width: 320rpx;
text-align: center;
}
.back {
width: 100rpx;
text-align: center;

@ -1,4 +1,5 @@
import { Component } from "react";
import classnames from "classnames";
import Taro from "@tarojs/taro";
import { Block, View, Image } from "@tarojs/components";
@ -92,7 +93,11 @@ export default class Navbar extends Component<any, any> {
)}
{leftSlot}
</View>
<View className="logo">
<View
className={classnames("logo", {
"logo-title": titleSlot,
})}
>
{titleSlot ? (
titleSlot
) : isWhite ? (
@ -109,7 +114,7 @@ export default class Navbar extends Component<any, any> {
/>
)}
</View>
<View className="back"/>
<View className="back" />
</View>
<View
className="nav_top_padding"

@ -10,7 +10,7 @@ import "./popup-alert.less";
import { go } from "../../utils/traoAPI";
/*** props
/** props
* isLarge
* isShow
* isClose
@ -20,7 +20,7 @@ import { go } from "../../utils/traoAPI";
* textAlgin left right center
* type: 1
* @confirm
* ***/
*/
export default class PopupAlert extends Component<any, any> {
constructor(props) {
super(props);

@ -0,0 +1,12 @@
.nodes {
padding: 30rpx;
word-break: break-all;
box-sizing: border-box;
table {
border-collapse: collapse; /* 边框合并 */
}
td {
text-align: center; /* 字体居中 */
border: 1px solid #ccc; /* 边框样式 */
}
}

@ -0,0 +1,105 @@
import { Component, PropsWithChildren, useEffect, useState } from "react";
import Taro from "@tarojs/taro";
import { Block, View, RichText } from "@tarojs/components";
import Navbar from "../../components/navbar/navbar";
import "./connection_help.less";
import {
GetBluetoothGuidance,
GetLocationGuidance,
} from "../../utils/Interface";
export default class ConnectionHelp extends Component<any, any> {
constructor(props) {
super(props);
this.state = {
name: "蓝牙连接帮助",
nodes: "",
type: "bluetoot", // bluetoot location
title: "蓝牙权限开启指引", // 定位授权开启指引
};
}
$instance = Taro.getCurrentInstance();
async onLoad() {
this.getType();
}
componentDidMount() {}
componentWillUnmount() {}
componentDidShow() {}
componentDidHide() {}
async getType() {
let type = this.$instance.router?.params?.type;
if (type) {
let title = type === "bluetoot" ? "蓝牙权限开启指引" : "定位授权开启指引";
this.setState({ type, title });
setTimeout(() => {
this.initData();
}, 0);
}
}
initData = async () => {
let { type } = this.state;
if (type === "bluetoot") {
this.GetBluetoothGuidance();
} else {
this.GetLocationGuidance();
}
};
GetBluetoothGuidance = async () => {
let res = await GetBluetoothGuidance();
if (res.data.code === 200) {
let nodes = decodeURIComponent(res.data.data.value || "");
nodes = nodes.replace(/\<img/gi, '<img style="width:100%;height:auto" ');
nodes = nodes.replace(
/\<table/gi,
'<table style="border-spacing: 0;border-collapse: collapse;border: 1px solid #000" '
);
nodes = nodes.replace(
/\<td/gi,
'<td style="border: 1px solid #000;text-align:center" '
);
this.setState({ nodes: nodes });
}
};
GetLocationGuidance = async () => {
let res = await GetLocationGuidance();
if (res.data.code === 200) {
let nodes = decodeURIComponent(res.data.data.value || "");
nodes = nodes.replace(/\<img/gi, '<img style="width:100%;height:auto" ');
nodes = nodes.replace(
/\<table/gi,
'<table style="border-spacing: 0;border-collapse: collapse;border: 1px solid #000" '
);
nodes = nodes.replace(
/\<td/gi,
'<td style="border: 1px solid #000;text-align:center" '
);
this.setState({ nodes: nodes });
}
};
render() {
let { nodes, title } = this.state;
return (
<Block>
<Navbar titleSlot={title} isBack={true} />
<View className="nodes">
<RichText nodes={nodes} />
</View>
</Block>
);
}
}

@ -13,20 +13,22 @@ import {
/*** redux ***/
import { connect } from "react-redux";
import { userRefresh, tokenRefresh } from "../../store/features/userInfo";
import { setIndexFlag } from "../../store/features/globalStore";
import { userRefresh, tokenRefresh } from "@/store/features/userInfo";
import { setIndexFlag } from "@/store/features/globalStore";
/*** redux end ***/
/** 自定义组件 **/
import AtCalendar from "../../components/calendar";
import PopupPrivacy from "../../components/popup/popup-privacy";
import PopupBinding from "../../components/popup/popup-binding";
import AtCalendar from "@/components/calendar";
import PopupPrivacy from "@/components/popup/popup-privacy";
import PopupBinding from "@/components/popup/popup-binding";
// import PopupPrivacyTest from "../../components/popup/popup-privacy-test";
import PopupSiteSwiper from "../../components/popup/popup-site-swiper";
import PopupAlert from "../../components/popup/popup-alert";
import type CustomTabBar from "../../custom-tab-bar";
import Navbar from "../../components/navbar/navbar";
import PopupSiteSwiper from "@/components/popup/popup-site-swiper";
import PopupAlert from "@/components/popup/popup-alert";
import type CustomTabBar from "@/custom-tab-bar";
import Navbar from "@/components/navbar/navbar";
import ConnectionBluetoot from "@/components/bluetoot/connection";
/** 自定义组件 **/
import {
@ -48,8 +50,15 @@ import {
msg,
getStorageSync,
setStorageSync,
showModal,
} from "@/utils/traoAPI";
const log = require("@/utils/log");
import commandMap from "@/utils/commandMap";
import InstrumentTypeEnum from "@/components/bluetoot/instrumentTypeEnum";
import OtaDeviceTypeEnum from "@/components/bluetoot/OtaDeviceTypeEnum";
class Index extends Component<any, any> {
// pageCtx = Taro.getCurrentInstance().page;
$instance = Taro.getCurrentInstance();
@ -63,12 +72,10 @@ class Index extends Component<any, any> {
isNotRegister: false, // 是否未注册
isDev: false, // 正在开发提示
sitePopupList: [], // 站点管理列表
// imgUrl: this.app.globalData.imgUrl,
userinfo: {
mobile: this.props.mobile,
mobile: Taro.getStorageSync("mobile"),
},
connectInstrument: {},
yiqiinfo: {},
list: [],
params: "",
messageCount: Taro.getStorageSync("messageCount") || 0,
@ -95,7 +102,6 @@ class Index extends Component<any, any> {
isVisibleBinding: false, // 绑定弹窗
isBindingError: false, // 绑定失败
isBeforeBinding: false, // 已绑定弹窗
typeBinding: 0,
instrumentList: [], // 仪器列表
instrumentInfo: {
// 扫码获得的序列号仪器
@ -118,6 +124,16 @@ class Index extends Component<any, any> {
validStatus: 1, // 1有效0无效
},
/** 绑定仪器 End */
/** 已绑定仪器 */
instrument_detail: {},
/* 已绑定仪器 END */
/** 蓝牙相关 */
isConnectShow: false,
connectInstrument: {},
yiqiinfo: {},
/* END */
};
}
@ -557,7 +573,12 @@ class Index extends Component<any, any> {
goNursing = (item) => {
console.log("goNursing", item);
setStorageSync("instrument_detail", JSON.stringify(item));
// setStorageSync("connectInstrument", JSON.stringify(item));
// this.setState({ instrument_detail: item });
// this.setState({ connectInstrument: item });
// setTimeout(() => this.bindBlockLeft());
// isConnectShow
setTimeout(() => {
go("/pages/instrumentClickinUpload/index?id=" + item.id);
}, 10);
@ -565,6 +586,441 @@ class Index extends Component<any, any> {
};
/* 扫码进入逻辑 */
/** 蓝牙逻辑 */
bindBlockLeft() {
console.log("this.state.userinfo", this.state.userinfo);
if (!this.state.userinfo.mobile) {
//未注册授权
this.alertRegister();
return false;
}
if (this.state.connectInstrument.type === 1) {
//非IOT
} else {
Taro.getSystemInfo({
success: (res) => {
console.log("getSystemInfo", res);
this.setState({ isConnectShow: true });
return;
let { locationEnabled, locationAuthorized, bluetoothEnabled } = res;
if (!locationEnabled || !locationAuthorized) {
showModal({
t2: "您的手机定位授权未开启,请前往手机设置,打开定位访问授权",
btn2text: "查看指引",
}).then(() => {
go("/pages/connection_help/connection_help?type=location");
});
} else if (!bluetoothEnabled) {
showModal({
t2: "您的手机蓝牙授权未开启,请前往手机设置,打开蓝牙访问授权",
btn2text: "查看指引",
}).then(() => {
go("/pages/connection_help/connection_help?type=bluetoot");
});
} else {
// 打开连接弹窗
this.setState({ isConnectShow: true });
}
},
});
}
}
/**
* WE100,WL200
*/
async pairingChange(e) {
console.log("epairingChange", e);
return;
const { connectInstrument } = this.state;
let latestVersionNo, isNeedToUpdateBl;
//当前版本号
const deviceVersionNo = e.detail.deviceVersionNo;
console.info("配对完成回调", e, deviceVersionNo);
//最新版本号
latestVersionNo = connectInstrument.iot_versions;
//TODO 这些信息需要放在WL200的接口里现在没有。 暂时的方案如果是WL200 需要查WE200的相关信息
if (connectInstrument.type == instrumentTypeEnum.WL200) {
this.pureData.mianmo_id = app.globalData.bindinfo.mianmo_id;
const { data: resData } = await InstrumentInfo({
id: this.pureData.mianmo_id,
});
// if (resData) {}
// const mianmo_item = this.data.instruments.find(item=>{
// return this.pureData.mianmo_id == item.id;
// })
// if (mianmo_item) {
// const {iot_versions,type} = mianmo_item
// this.pureData.mianmo_iot_versions = iot_versions;
// this.pureData.mianmo_type = type;
// latestVersionNo = iot_versions
// }
// const {data: resData} = await UserInstrumentInfo({id: this.pureData.mianmo_id});
if (resData.code == 200) {
const { data } = resData;
const { iot_versions, type } = data.info;
this.pureData.mianmo_iot_versions = iot_versions;
this.pureData.mianmo_type = type;
latestVersionNo = iot_versions;
}
isNeedToUpdateBl = isNeedToUpdate(deviceVersionNo, latestVersionNo);
console.log(
`设备版本号: ${deviceVersionNo}`,
`后台版本号: ${latestVersionNo}`,
`是否需要升级: ${isNeedToUpdateBl}`
);
// 2023.11.29 18:00 经与黄工讨论, 后续版本暂时都需要进行强更
// this.gotoOta();
// return
if (isNeedToUpdateBl) {
this.gotoOta();
return;
this.setData({
params: "offlineDialog",
offlineDialogType: 2,
otaDeviceName: "skinpilot",
});
return;
}
go(`/pages/MatrixWL200/pages/index/index?devId=${connectInstrument.id}`);
this.setData({
params: "",
});
} else if (connectInstrument.type == instrumentTypeEnum.M01) {
isNeedToUpdateBl = isNeedToUpdate(deviceVersionNo, latestVersionNo);
console.log(
`设备版本号: ${deviceVersionNo}`,
`后台版本号: ${latestVersionNo}`,
`是否需要升级: ${isNeedToUpdateBl}`
);
if (isNeedToUpdateBl) {
// 2023.11.17 22:00 经与黄工讨论, 后续版本暂时都需要进行强更
this.gotoOta();
return;
this.setData({
params: "offlineDialog",
offlineDialogType: 2,
otaDeviceName: "skinpilot",
offlineDialogForce: 1,
});
return;
}
go(
`/pages/MatrixM01/pages/index/index?devId=${this.data.connectInstrument.id}`
);
// this.setData({
// params: "",
// });
}
}
//连接完成时数据的回调
offlineChange = async (e) => {
const that = this;
log.info(
commandMap.versionInfoHome,
`offlineChange::e::${JSON.stringify(e)}`
);
//offlineDataList 离线数据
//versioninfo 版本号
let { offlineDataList, versionInfo } = e.detail;
this.setState({
versionInfo,
});
let offlinelist: any = [];
offlineDataList.map((item, index) => {
let obj: any = {
clock_day: "",
status: 3,
second: 120,
screne_id: "",
screne_name: "离线打卡",
model_face_ward: 0,
model_face_use: 0,
model_face_type: "",
model_eye_ward: 0,
model_eye_use: 0,
model_eye_type: "",
instrument_id: this.state.connectInstrument.id,
};
//判断日期是否正常,如果不正常不处理 --- 脸部
if (
item.faceyear > 0 &&
item.faceyear <= 99 &&
item.facemonth >= 1 &&
item.facemonth <= 12 &&
item.faceday >= 1 &&
item.faceday <= 31
) {
if (
item.facehour > 0 ||
(item.faceminutes > 0 && item.faceminutes < 60) ||
(item.faceseconds > 0 && item.faceseconds < 60)
) {
//脸部离线记录有值
obj.model_face_use =
Number(item.facehour) * 60 * 60 +
Number(item.faceminutes) * 60 +
Number(item.faceseconds);
obj.model_face_ward = item.faceposition1;
obj.clock_day = `20${String(item.faceyear).padStart(2, "0")}-${String(
item.facemonth
).padStart(2, "0")}-${String(item.faceday).padStart(2, "0")}`;
}
}
//判断日期是否正常,如果不正常不处理 --- 眼部
if (
item.eyeyear > 0 &&
item.eyeyear <= 99 &&
item.eyemonth >= 1 &&
item.eyemonth <= 12 &&
item.eyeday >= 1 &&
item.eyeday <= 31
) {
if (
item.eyehour > 0 ||
(item.eyeminutes > 0 && item.eyeminutes < 60) ||
(item.eyeseconds > 0 && item.eyeseconds < 60)
) {
//眼部离线记录有值
obj.model_eye_use =
Number(item.eyehour) * 60 * 60 +
Number(item.eyeminutes) * 60 +
Number(item.eyeseconds);
obj.model_eye_ward = item.eyeposition1;
obj.clock_day = `20${String(item.eyeyear).padStart(2, "0")}-${String(
item.eyemonth
).padStart(2, "0")}-${String(item.eyeday).padStart(2, "0")}`;
}
}
obj.second = obj.model_face_use + obj.model_eye_use;
if (
item.faceyear > 0 &&
item.faceyear <= 99 &&
(item.facemonth == 1 || item.facemonth <= 12) &&
(item.faceday == 1 || item.faceday <= 31)
) {
let dayTime = new Date(`${obj.clock_day.replace(/-/g, "/")}`).getTime(); //离线记录的日期
let now = new Date(
`${new Date().getFullYear()}/${String(
new Date().getMonth() + 1
).padStart(2, "0")}/${String(new Date().getDate()).padStart(2, "0")}`
).getTime(); //当前日期
/**
* 7线
*
*/
if (dayTime <= now && dayTime >= now - 24 * 60 * 60 * 1000 * 6) {
offlinelist.push(obj);
}
}
});
console.log(offlinelist);
let nowyear = new Date().getFullYear();
let nowmonth = String(new Date().getMonth() + 1).padStart(2, "0");
let nowday = String(new Date().getDate()).padStart(2, "0");
// await IOTHistorySynchronization({
// //把离线数据同步到后台
// instrument_id: app.globalData.bindid,
// clock_times: offlinelist,
// });
// offlinelist.map((item, index) => {
// // console.log(new Date(item.clock_day.replace(/-/g,'/')).getTime())
// if (item.clock_day == `${nowyear}-${nowmonth}-${nowday}`) {
// //今日有离线护理 弹出 检测到您今天已进行护理,是否跳过护理直接前往打卡,或选择继续进行护理
// if (item.second >= this.data.connectInstrument.times * 60) {
// console.log("今日有离线护理");
// let screneList2 = {
// lianbuobj: {
// fen: String(s_to_h(item.model_face_use)).padStart("2", 0),
// miao: String(s_to_s(item.model_face_use)).padStart("2", 0),
// total: item.model_face_use,
// },
// yanbuobj: {
// fen: String(s_to_h(item.model_eye_use)).padStart("2", 0),
// miao: String(s_to_s(item.model_eye_use)).padStart("2", 0),
// total: item.model_eye_use,
// },
// ledobj: {
// fen: 0,
// miao: 0,
// total: 0,
// },
// };
// this.setData({
// screneList2,
// });
// let screneList3 = {
// second: item.second, //总秒
// screne_id: "", //场景id
// screne_name: "离线记录", //场景名称
// model_face_ward: item.model_face_ward, //脸部场景档位
// model_face_use: item.model_face_use, //脸部场景使用时长
// model_face_type: "", //脸部模式类型
// model_eye_ward: item.model_eye_ward, //眼部场景档位
// model_eye_use: item.model_eye_use, //眼部场景使用时长
// model_eye_type: "", //眼部模式类型
// };
// /**
// * 如果今天有打过卡,需要累加
// */
// // if (this.data?.todayclockin?.id) {
// // screneList3.second += this.data.todayclockin.clock_info[0].second
// // screneList3.model_face_use += this.data.todayclockin.clock_info[0].model_face_use
// // screneList3.model_eye_use += this.data.todayclockin.clock_info[0].model_eye_use
// // }
// //
// // console.log(this.data.todayclockin)
// this.setData({
// screneList3,
// });
// console.log(this.data.screneList3, "2222222222222222222");
// this.setData({
// params: "offlineDialog",
// offlineDialogType: 1,
// todayofflineData: item,
// });
// }
// }
// });
// if (this.data.params == "connection_guide") {
// // this.setData({
// // params: 'offlineDialog',
// // offlineDialogType:2
// // })
// console.log("设备版本号" + versioninfo.version);
// console.log("后台版本号" + this.data.connectInstrument.iot_versions);
// log.info(
// commandMap.versionInfoHome,
// `设备版本号: ${versioninfo.version}`
// );
// log.info(
// commandMap.versionInfoHome,
// `后台版本号: ${that.data.connectInstrument.iot_versions}`
// );
// console.log(
// "后台版本号H" +
// Number(this.data.connectInstrument.iot_versions.substring(0, 2)) +
// "版本号H" +
// Number(String(versioninfo.v1).padStart("2", 0))
// );
// log.info(
// commandMap.versionInfoHome,
// `后台版本号H: ${Number(
// that.data.connectInstrument.iot_versions.substring(0, 2)
// )} ,版本号H: ${Number(String(versioninfo.v1).padStart("2", 0))}`
// );
// console.log(
// "后台版本号M" +
// Number(this.data.connectInstrument.iot_versions.substring(2, 4)) +
// "版本号M" +
// Number(String(versioninfo.v2).padStart("2", 0))
// );
// log.info(
// commandMap.versionInfoHome,
// "后台版本号M" +
// Number(this.data.connectInstrument.iot_versions.substring(2, 4)) +
// "版本号M" +
// Number(String(versioninfo.v2).padStart("2", 0))
// );
// console.log(
// "后台版本号L" +
// Number(this.data.connectInstrument.iot_versions.substring(4, 6)) +
// "版本号L" +
// Number(String(versioninfo.v3).padStart("2", 0))
// );
// log.info(
// commandMap.versionInfoHome,
// "后台版本号L" +
// Number(this.data.connectInstrument.iot_versions.substring(4, 6)) +
// "版本号L" +
// Number(String(versioninfo.v3).padStart("2", 0))
// );
// //这是有问题的固件,强制升级
// if (
// versioninfo.v1 == "01" &&
// versioninfo.v2 == "02" &&
// versioninfo.v3 == "00"
// ) {
// this.gotoOta();
// return;
// }
// if (
// this.data.connectInstrument.iot_versions.substring(0, 2) ==
// versioninfo.v1
// ) {
// if (
// Number(this.data.connectInstrument.iot_versions.substring(2, 4)) >
// Number(versioninfo.v2)
// ) {
// this.setData({
// params: "offlineDialog",
// offlineDialogType: 2,
// otaDeviceName: "设备",
// });
// } else if (
// Number(this.data.connectInstrument.iot_versions.substring(2, 4)) ==
// Number(versioninfo.v2)
// ) {
// if (
// Number(this.data.connectInstrument.iot_versions.substring(4, 6)) >
// Number(versioninfo.v3)
// ) {
// this.setData({
// params: "offlineDialog",
// offlineDialogType: 2,
// otaDeviceName: "设备",
// });
// } else {
// this.setData({
// params: "",
// });
// go(
// "/pages/nursing/nursing?id=&iid=" +
// app.globalData.bindid +
// `&type=fr200&version=${versioninfo?.version}`
// );
// }
// } else {
// this.setData({
// params: "",
// });
// go(
// "/pages/nursing/nursing?id=&iid=" +
// app.globalData.bindid +
// `&type=fr200&version=${versioninfo?.version}`
// );
// }
// } else {
// this.setData({
// params: "",
// });
// go(
// "/pages/nursing/nursing?id=&iid=" +
// app.globalData.bindid +
// `&type=fr200&version=${versioninfo?.version}`
// );
// }
// }
};
connectionClose = async (data) => {
console.log("connectionClose", data);
this.setState({ isConnectShow: false });
};
connectionConfirm = async (data) => {
console.log("connectionConfirm", data);
this.setState({ isConnectShow: false });
};
/*蓝牙 END*/
render() {
let {
calendarComplete,
@ -585,9 +1041,12 @@ class Index extends Component<any, any> {
isBeforeBinding,
isRegisterBoolean,
isExchangeBinding,
typeBinding,
instrumentInfo,
instrumentList,
// 蓝牙连接
isConnectShow,
connectInstrument,
} = this.state;
return (
@ -666,6 +1125,16 @@ class Index extends Component<any, any> {
close={this.closeSiteSwiper}
confirm={this.closeSiteSwiper}
/>
{isConnectShow && (
<ConnectionBluetoot
yiqiInfo={connectInstrument}
close={this.connectionClose}
confirm={this.connectionConfirm}
/>
)}
{/* <ConnectionBluetoot /> */}
<Navbar
leftSlot={
<Block>

@ -31,6 +31,7 @@ import {
GetIsAttentionOfficialAccount,
GetOfficialAccount,
GetCloseOfficialAccount,
RefreshWxUserInfo,
} from "../../utils/Interface";
import { msg } from "../../utils/traoAPI";
@ -75,10 +76,20 @@ class IntegralList extends Component<any, any> {
componentDidHide() {}
async initData() {
this.RefreshWxUserInfo();
this.GetObtainUserIntegral();
this.GetIsAttentionOfficialAccount();
}
// 刷新用户信息
RefreshWxUserInfo = async () => {
let res = await RefreshWxUserInfo();
if (res.data.code === 200) {
this.props.userRefresh(res.data.data);
this.setState({ userInfo: res.data.data });
}
};
openShop = () => {
let { otherSetting } = this.state;
if (otherSetting.skipAppid) {

@ -52,14 +52,7 @@ export default class PrivacyPolicy extends Component<any, any> {
<Navbar titleSlot="隐私政策" isBack={true} />
<View className="nodes">
<RichText
nodes={
nodes
// "<pre style=' white-space: pre-wrap;word-wrap: break-word;'>" +
// nodes +
// "</pre>"
}
/>
<RichText nodes={nodes} />
</View>
</Block>
);

@ -47,14 +47,13 @@ class User extends Component<any, any> {
};
}
async onLoad() {
this.initData();
}
async onLoad() {}
componentDidMount() {}
componentWillUnmount() {}
componentDidShow() {
this.initData();
this.setState({ userInfo: this.props.userInfo });
let messagecount = Taro.getStorageSync("messageCount");
@ -83,7 +82,6 @@ class User extends Component<any, any> {
// 刷新用户信息
RefreshWxUserInfo = async () => {
let res = await RefreshWxUserInfo();
console.log("res", res);
if (res.data.code === 200) {
this.props.userRefresh(res.data.data);
this.setState({ userInfo: res.data.data });

@ -6,7 +6,7 @@ const deviceInfoReducer = createSlice({
name: "deviceinfo", // store的名字
initialState: {
bluetoothInfo: {
deviceId: "",
deviceId: "5FF5FD4F-9EF9-3CB6-AD89-F915B55E5DE9", // 先测试一下
servicesuuid: "",
characteristicsuuid0: "",
characteristicsuuid1: "",
@ -15,11 +15,13 @@ const deviceInfoReducer = createSlice({
},
reducers: {
setDeviceInfo(state, { payload }) {
console.log("payload", payload);
state = JSON.parse(JSON.stringify(payload));
},
setBluetoothInfo(state, { payload }) {
state.bluetoothInfo = JSON.parse(JSON.stringify(payload));
},
},
});
export const { setDeviceInfo } = deviceInfoReducer.actions;
export const { setBluetoothInfo } = deviceInfoReducer.actions;
export default deviceInfoReducer.reducer;

@ -212,6 +212,21 @@ export const GetSiteAddTag = (data) => {
});
};
/**获取蓝牙指引权限引导*/
export const GetBluetoothGuidance = () => {
return Ajax({
url: "/setting/getBluetoothGuidance",
method: "get",
});
};
/**获取蓝牙定位权限引导*/
export const GetLocationGuidance = () => {
return Ajax({
url: "/setting/getLocationGuidance",
method: "get",
});
};
/**仪器管理*/
export const InstrumentInfo = {
/**根据序列号获取仪器信息 serial 序列号*/

@ -1,4 +1,5 @@
import Taro from "@tarojs/taro";
import store from "../store";
const deviceInfo = store.getState().deviceInfo;
import { msg, back, showModal, go, loading } from "./traoAPI";

Loading…
Cancel
Save