|
|
|
|
@ -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>
|
|
|
|
|
|