Compare commits

...

17 Commits

@ -55,12 +55,13 @@
"@tarojs/runtime": "3.6.19",
"@tarojs/shared": "3.6.19",
"@tarojs/taro": "3.6.19",
"@visactor/taro-vchart": "^1.9.0",
"dayjs": "^1.11.10",
"echarts": "^5.5.0",
"lodash": "^4.17.15",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react-redux": "^9.0.3",
"taro-react-echarts": "^1.2.2",
"taro-ui": "^3.2.0"
},
"devDependencies": {

@ -0,0 +1,53 @@
import Taro from "@tarojs/taro";
import { Component, PropsWithChildren } from "react";
import "./app.less";
// // html4
// import "@tarojs/taro/html.css";
// // html5
// import "@tarojs/taro/html5.css";
import { Provider } from "react-redux";
import store from "./store";
import "./iconfont/iconfont.css";
import "taro-ui/rn/style/components/icon.scss";
import { go } from "./utils/traoAPI";
class App extends Component {
// 可以使用所有的 React 生命周期方法
componentDidMount() {}
// 对应 onLaunch
onLaunch(options) {
// console.log("onLaunch", options);
if (options.scene == 1007 || options.scene == 1008) {
return;
}
// go("/pages/iotCarePlan/iotCarePlan");
// go("/pages/instrument_clickin_upload/index");
// go("/pages/instrument/intro");
// Taro.switchTab({
// url: "/pages/user/user",
// });
go("/pages/index/index");
}
onError(error) {
console.log("error 错误捕获", error);
}
// 对应 onShow
componentDidShow() {}
// 对应 onHide
componentDidHide() {}
// this.props.children 是将要会渲染的页面
render() {
// return this.props.children
return <Provider store={store} children={this.props.children}></Provider>;
}
}
export default App;

@ -0,0 +1,19 @@
.nodata {
width: 200rpx;
height: 300rpx;
margin: 0 auto;
// margin-top: 310rpx;
text-align: center;
.nodata_img {
display: inline-block;
width: 160rpx;
height: 160rpx;
margin-bottom: 34rpx;
}
.nodata_text {
font-size: 30rpx;
font-family: PingFang SC;
font-weight: 400;
color: #666666;
}
}

@ -0,0 +1,45 @@
import classnames from "classnames";
import Taro from "@tarojs/taro";
import { Component } from "react";
import { Block, View, Image } from "@tarojs/components";
import "./nodata.less";
export default class NoDataComponent extends Component<any, any> {
constructor(props) {
super(props);
this.state = {
name: "无数据组件",
};
}
async onLoad() {}
componentDidMount() {}
componentWillUnmount() {}
componentDidShow() {}
componentDidHide() {}
async initData() {}
showInit() {}
render() {
return (
<Block>
<View>
<View className="nodata">
<Image
className="nodata_img"
src={require("../../img/nodata.png")}
></Image>
<View className="nodata_text"></View>
</View>
</View>
</Block>
);
}
}

@ -34,7 +34,7 @@ import {
getTimeCode,
isNeedToUpdate,
} from "@/utils/util";
const log = require("@/utils/log");
// const log = require("@/utils/log");
import commandMap from "@/utils/commandMap";
import { bleCommandSamples } from "./test";
@ -129,7 +129,15 @@ class ConnectionBluetoot extends Component<any, any> {
async onLoad() {}
componentDidMount() {
// 只有非断开状态的弹窗才自动连接蓝牙
if (!this.props.isDisconnect) {
this.connection();
} else {
// 断开状态弹窗:自动设置为错误模式
this.setState({
error: true,
});
}
}
componentWillUnmount() {}
@ -944,7 +952,7 @@ class ConnectionBluetoot extends Component<any, any> {
// 超时未返回版本号
if (isGetVersionTimer) clearTimeout(isGetVersionTimer);
console.log("超时未返回版本号 this.pairingChange", this.state);
// this.pairingChange(this.state);
this.pairingChange(this.state);
} else {
this.sendGetVersion();
}
@ -993,6 +1001,15 @@ class ConnectionBluetoot extends Component<any, any> {
onReconnect = () => {
console.log("onReconnect");
// 重置信息并重连
this.setState({
error: false,
searchError: false,
errorText: "",
});
setTimeout(() => {
this.connection();
});
// this.props.confirm("confirm");
};
@ -1005,8 +1022,8 @@ class ConnectionBluetoot extends Component<any, any> {
};
render() {
let { name, isConnection, connectionSuccess, error } = this.state;
let { deviceInfo } = this.props;
let { isConnection, connectionSuccess, error } = this.state;
let { deviceInfo, isDisconnect } = this.props;
return (
<Block>
<DeviceConnectPopup
@ -1020,7 +1037,6 @@ class ConnectionBluetoot extends Component<any, any> {
error={error}
title="面罩模式启动中"
/>
<View>{name}</View>
</Block>
);
}

@ -13,12 +13,12 @@
// }
.site-close {
position: absolute;
right: 36rpx;
top: 36rpx;
color: #fff;
right: 16rpx;
top: 16rpx;
color: #000;
font-size: 36rpx;
z-index: 100009;
background-color: #ababab;
background-color: transparent;
border-radius: 50%;
padding: 8rpx;
box-sizing: border-box;
@ -64,7 +64,7 @@
display: flex;
align-items: center;
position: relative;
width: 100%;
width: 84%;
box-sizing: border-box;
display: flex;
// column-gap: 30rpx;
@ -76,6 +76,7 @@
width: 36rpx;
min-width: 36rpx;
height: 36rpx;
margin-right: 36rpx;
image {
width: 100%;
height: 100%;

@ -149,7 +149,7 @@ export default class DeviceConnectPopup extends Component<any, any> {
</Block>
)}
</View>
<View className="block2">
{/* <View className="block2">
{connectionSuccess ? (
<Block>
<View className="icon">
@ -175,15 +175,16 @@ export default class DeviceConnectPopup extends Component<any, any> {
</View>
</Block>
)}
</View>
</View> */}
</View>
<View className="common-popup-btns">
<Button className="common-popup-btn2" onClick={this.onClose}>
<Button
className="common-popup-btn"
style="background-color: #fff;color: #000"
onClick={this.onClose}
>
</Button>
<Button className="common-popup-btn2" onClick={this.onConfirm}>
</Button>
</View>
</View>
)}
@ -201,7 +202,8 @@ export default class DeviceConnectPopup extends Component<any, any> {
<View className="error-block">
<View className="tip1"></View>
<View className="tip2">
{data.bluetoothConnectFailContent}
{data.bluetoothConnectFailContent ||
"请重启设备后点击重新连接"}
</View>
</View>
</View>

@ -104,10 +104,8 @@ class UpdateIotWL200 extends Component<any, any> {
let objStr = getStorageSync("instrument_detail");
if (objStr) {
let info = JSON.parse(objStr);
this.setState({
currentDevice: info,
currentDevice: objStr,
});
}
setTimeout(() => {

@ -36,7 +36,12 @@ export default class Navbar extends Component<any, any> {
}
back = () => {
//判断是否自定义跳转
if (!this.props.isCustomBack) {
back();
} else {
this.props.customBack(); // 具体页面自定义返回逻辑
}
};
setStatusBar() {

@ -62,3 +62,9 @@
font-family: PingFang SC;
}
}
.instrument-swiper-step {
width: 600rpx;
height: 720rpx;
margin: 0 auto;
}

@ -71,9 +71,7 @@ export default class PopupInstrumentUploadTips extends Component<any, any> {
}
this.setState({ current });
}
onClickSwiperItem(item) {
goJump(item);
}
onFinish(event) {
const { current } = event.detail;
const { toRight, isClick } = this.state;
@ -94,7 +92,7 @@ export default class PopupInstrumentUploadTips extends Component<any, any> {
onNext = async () => {
let { current } = this.state;
if (current === this.props.data.length) {
if (current === this.props.data.length - 1) {
this.onClose();
} else {
this.setState({ current: current + 1 });
@ -122,25 +120,11 @@ export default class PopupInstrumentUploadTips extends Component<any, any> {
></View>
<View className={classnames("common-box upload-tips-common-box")}>
<View className="site-popup-content-box">
<Swiper
className="absolutely"
style="width: 600rpx;height: 720rpx"
current={current}
onChange={this.onChange.bind(this)}
onAnimationFinish={this.onFinish.bind(this)}
duration={800}
indicatorDots={false}
indicatorColor="#999"
indicatorActiveColor="#333"
disableTouch={true} // 禁止滑动
>
<View className="absolutely instrument-swiper-step">
{data.map((item, index) => {
return (
<SwiperItem
className="absolutely"
onClick={this.onClickSwiperItem.bind(this, item)}
key={"swiper_" + index}
>
current === index && (
<View className="absolutely" key={"swiper_" + index}>
<View
style={{
width: "100%",
@ -154,10 +138,11 @@ export default class PopupInstrumentUploadTips extends Component<any, any> {
></Image>
</View>
<View className="tips-message">{item.message}</View>
</SwiperItem>
</View>
)
);
})}
</Swiper>
</View>
</View>
<View>
@ -170,15 +155,19 @@ export default class PopupInstrumentUploadTips extends Component<any, any> {
)}
{data.length > 1 && current === 0 && (
<View className="popup-btn-one">
<Button className="popup-btn" onClick={this.onPrev}>
<Button className="popup-btn" onClick={this.onNext}>
</Button>
</View>
)}
{data.length > 1 && (
{data.length > 1 && current > 0 && (
<View className="common-popup-btns">
<Button className="common-popup-btn2" onClick={this.onPrev}>
{current > 0 && current < data.length - 1 && "上一步"}
<Button
className="common-popup-btn2"
style="color:#000"
onClick={this.onPrev}
>
</Button>
<Button className="common-popup-btn2" onClick={this.onNext}>
{current > 0 && current < data.length - 1 && "下一步"}

@ -18,12 +18,12 @@
// }
.site-close {
position: absolute;
right: 36rpx;
top: 36rpx;
color: #fff;
right: 16rpx;
top: 16rpx;
color: #000;
font-size: 36rpx;
z-index: 100009;
background-color: #ababab;
background-color: transparent;
border-radius: 50%;
padding: 8rpx;
box-sizing: border-box;

@ -24,6 +24,7 @@ import { go } from "../../utils/traoAPI";
/** props
* isLarge
* isShow
* isFirstEntry
* data
* title
* confirmButtonText
@ -59,6 +60,9 @@ export default class PopupStepTips extends Component<any, any> {
let { isLocal } = this.state;
this.props.close({ isLocal });
};
onConfirm = () => {
this.props.close({ isLocal: true });
};
onClickStop = (e) => {
e.stopPropagation();
@ -81,7 +85,7 @@ export default class PopupStepTips extends Component<any, any> {
onNext = async () => {
let { current } = this.state;
if (current === this.props.data.length) {
if (current === this.props.data.length - 1) {
this.onClose();
} else {
this.setState({ current: current + 1 });
@ -94,8 +98,15 @@ export default class PopupStepTips extends Component<any, any> {
};
render() {
let { isShow, data, isLarge, title, content, confirmButtonText } =
this.props;
let {
isShow,
data,
isLarge,
isFirstEntry,
title,
content,
confirmButtonText,
} = this.props;
let { current, isLocal } = this.state;
return (
@ -123,7 +134,7 @@ export default class PopupStepTips extends Component<any, any> {
"margin-samll": isLarge,
})}
>
{data.length > 0 ? data[current].openTitle : "暂无数据"}
{data.length > 0 ? data[current].openTitle : "使用教程"}
</View>
{/* {title && (
<View
@ -135,19 +146,17 @@ export default class PopupStepTips extends Component<any, any> {
</View>
)} */}
<View className="step-popup-content-box">
<Swiper
className="step-absolutely"
current={current}
duration={800}
indicatorDots={false}
indicatorColor="#999"
indicatorActiveColor="#333"
disableTouch={true} // 禁止滑动
>
<View className="absolutely instrument-swiper-step">
{data.map((item, index) => {
return (
<SwiperItem className="absolutely" key={"swiper_" + index}>
<View className="step-img">
current === index && (
<View className="absolutely" key={"swiper_" + index}>
<View
style={{
width: "100%",
height: "600rpx",
}}
>
<Image
className="cover"
src={item.openSourceUrl}
@ -155,31 +164,36 @@ export default class PopupStepTips extends Component<any, any> {
></Image>
</View>
<View className="tips-message">{item.openContent}</View>
</SwiperItem>
</View>
)
);
})}
</Swiper>
</View>
</View>
<View>
{data.length === 1 && (
<View className="popup-btn-one">
<Button className="popup-btn" onClick={this.onClose}>
{confirmButtonText}
</Button>
</View>
)}
{data.length > 1 && current === 0 && (
<View className="popup-btn-one">
<Button className="popup-btn" onClick={this.onPrev}>
<Button className="popup-btn" onClick={this.onNext}>
</Button>
</View>
)}
{data.length > 1 && (
{data.length > 1 && current > 0 && (
<View className="common-popup-btns">
<Button className="common-popup-btn2" onClick={this.onPrev}>
{current > 0 && current < data.length - 1 && "上一步"}
<Button
className="common-popup-btn2"
style="color:#000"
onClick={this.onPrev}
>
</Button>
<Button className="common-popup-btn2" onClick={this.onNext}>
{current > 0 && current < data.length - 1 && "下一步"}
@ -191,6 +205,7 @@ export default class PopupStepTips extends Component<any, any> {
)}
</View>
{!isFirstEntry && (
<View className="setp-footer-btn" onClick={this.onChangeLocal}>
{isLocal ? (
<Image
@ -206,6 +221,7 @@ export default class PopupStepTips extends Component<any, any> {
<Text className="text"></Text>
</View>
)}
</View>
</Popup>
</Block>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 KiB

After

Width:  |  Height:  |  Size: 22 KiB

@ -7,6 +7,7 @@ import Navbar from "../../components/navbar/navbar";
import "./consultant.less";
import { getContactWorker } from "../../utils/Interface";
import { back } from "@/utils/traoAPI";
export default class Consultant extends Component<any, any> {
constructor(props) {
@ -16,6 +17,7 @@ export default class Consultant extends Component<any, any> {
pictureUrl: "",
};
}
$instance = Taro.getCurrentInstance();
async onLoad() {
this.initData();
@ -36,11 +38,25 @@ export default class Consultant extends Component<any, any> {
}
}
customBack = () => {
let customBack = this.$instance.router?.params?.customBack;
if (customBack) {
Taro.switchTab({ url: "/pages/index/index" });
return;
}
back();
};
render() {
const { pictureUrl } = this.state;
return (
<Block>
<Navbar titleSlot="联系客服" isBack={true} />
<Navbar
titleSlot="联系客服"
isBack={true}
isCustomBack
customBack={this.customBack}
/>
<View className="img">
<Image
src={pictureUrl}

@ -97,6 +97,10 @@ export default class Index extends Component<any, any> {
async initData() {}
GoIndex = () => {
Taro.switchTab({ url: "/pages/index/index" });
};
render() {
let { name, statistics, recordList, recordData } = this.state;
return (
@ -221,7 +225,7 @@ export default class Index extends Component<any, any> {
<View className="footer flex aitems">
<View className="btn"></View>
<View className="text flex aitems">
<View></View>
<View onClick={this.GoIndex}></View>
<Image
src={require("../../img/right.png")}
mode="aspectFill"

@ -55,20 +55,19 @@ import {
setStorageSync,
showModal,
} from "@/utils/traoAPI";
import commandMap from "@/utils/commandMap";
import InstrumentTypeEnum from "@/components/bluetoot/InstrumentTypeEnum";
import OtaDeviceTypeEnum from "@/components/bluetoot/OtaDeviceTypeEnum";
const log = require("@/utils/log");
// const log = require("@/utils/log");
class Index extends Component<any, any> {
// pageCtx = Taro.getCurrentInstance().page;
$instance = Taro.getCurrentInstance();
constructor(props) {
super(props);
this.state = {
isCommonError: false, // 是否显示通用错误提示
commonErrorText: [], // 通用错误提示
showEquipment: false, // 扫码绑定设备弹窗
isRegisterBoolean: false, // 是否已登录
isShowPrivacyPopup: false,
isShowSiteSwiper: false,
@ -142,12 +141,13 @@ class Index extends Component<any, any> {
isShowVersionUpgrading: false, // 升级中
isShowVersionUpgradFinish: false, // 升级完成:升级内容公告
versionUpgradFinishNodes: "", // 公告内容
// 设备是否重连弹窗
isShowReConnectDeviceRecordWL200: false,
};
}
async onLoad() {
console.log(1123131233);
// 仅非扫码进入页面时,校验跳转欢迎页
if (!this.$instance.router?.params?.q) {
const isFirst = Taro.getStorageSync("isWelcome");
@ -155,17 +155,16 @@ class Index extends Component<any, any> {
go("/pages/initiate/initiate");
}
}
if (Taro.getStorageSync("skip")) {
this.setState({ showEquipment: true })
Taro.removeStorageSync('skip');
// 判断是否跳过了注册
if (Taro.getStorageSync("skipRegister")) {
this.setState({ showEquipment: true });
Taro.removeStorageSync("skipRegister");
}
}
componentDidMount() {
componentDidMount() {}
}
componentWillUnmount() { }
componentWillUnmount() {}
componentDidShow() {
const tabbar = Taro.getTabBar<CustomTabBar>(this.$instance.page);
@ -174,9 +173,9 @@ class Index extends Component<any, any> {
this.showInit();
}
componentDidHide() { }
componentDidHide() {}
showInit() {
showInit = async () => {
// 判断是否登录
let mobile = Taro.getStorageSync("mobile");
if (mobile) {
@ -202,6 +201,7 @@ class Index extends Component<any, any> {
let serial = ids[1];
Taro.setStorageSync("serial", serial);
if (!Taro.getStorageSync("mobile")) {
await this.onlyLogin();
go("/pages/register/register");
}
}
@ -209,7 +209,7 @@ class Index extends Component<any, any> {
}
this.checkShowPrivacyPopup();
}
}
};
// 检测是否弹出隐私协议
checkShowPrivacyPopup() {
@ -224,7 +224,7 @@ class Index extends Component<any, any> {
this.isSancQrcodeEnter();
}
},
fail: () => { },
fail: () => {},
complete: () => {
// 授权完成运行页面初始化
},
@ -382,7 +382,7 @@ class Index extends Component<any, any> {
this.setState({ isShowSiteSwiper: false });
};
bannerSwiperchange() { }
bannerSwiperchange() {}
gobanner(item) {
// 跳转类型0无跳转、1跳转内部链接、3跳转外部链接、4跳转小程序、5导向视频号、6导向视频号直播间',
@ -445,12 +445,32 @@ class Index extends Component<any, any> {
}, 300);
} else {
msg("请求失败,尝试重新请求");
setTimeout(() => {
this.WCUserLogin();
}, 2000);
}
}
// 只登陆,不做其他操作
async onlyLogin() {
Taro.showLoading({
title: "请求中...",
mask: true,
});
const { code } = await Taro.login();
const { data } = await WCUserLogin({ code });
Taro.hideLoading();
if (data.code === 200) {
Taro.setStorageSync("isWelcome", true);
Taro.setStorageSync("mobile", data.data.mobile);
this.props.tokenRefresh(data.data);
} else {
msg("请求失败,尝试重新请求");
}
}
closeBinding = () => {
Taro.removeStorageSync("isScan"); // 扫码弹窗显示完后,不需要再判断是否扫码
Taro.removeStorageSync("serial"); // 扫码弹窗显示完后,删除缓存的扫码序列号
this.setState({ isVisibleBinding: false });
};
confirmBinding = () => {
@ -494,6 +514,10 @@ class Index extends Component<any, any> {
instrumentInfo.bindingStatus === 1 ||
instrumentInfo.bindingStatus === 2
) {
// 判断是否已绑定同名仪器,如果已绑定,判断序列号是否一致
// 如果自己已绑定,判断扫码序列号和已绑定序列号是否一致,如果一致:忽略
// 如果自己已绑定,判断扫码序列号和已绑定序列号是否一致,如果不一致:提示换绑
// 以上逻辑交给后端处理,直接查询是否绑定或换绑
setTimeout(() => {
this.isBindingSerial();
}, 100);
@ -502,6 +526,8 @@ class Index extends Component<any, any> {
// 获取失败和绑定失败一个弹窗
this.setState({ isBindingError: true });
}
this.removeScanFun();
}
};
@ -537,10 +563,11 @@ class Index extends Component<any, any> {
});
Taro.hideLoading();
this.closeBinding();
this.removeScanFun();
if (data.code === 200) {
msg("绑定成功");
setTimeout(() => {
go("/pages/instrument/intro?id=" + instrumentInfo.id);
go("/pages/instrument/intro??customBack=true&id=" + instrumentInfo.id);
}, 2000);
return;
} else if (data.code === 202) {
@ -554,6 +581,7 @@ class Index extends Component<any, any> {
}
};
// 换绑仪器
exchangeBinding = async () => {
Taro.showLoading({
title: "请求中...",
@ -566,37 +594,46 @@ class Index extends Component<any, any> {
console.log("exchangeBinding", data);
Taro.hideLoading();
this.closeBinding();
if (data.code === 200) {
} else {
this.closeBinding();
this.setState({ isBindingError: true });
if (data.code !== 200) {
//todo
}
};
// 仪器绑定失败弹窗
onBindErrorClose = () => {
Taro.removeStorageSync("isScan"); // 扫码弹窗显示完后,不需要再判断是否扫码
Taro.removeStorageSync("serial"); // 扫码弹窗显示完后,删除缓存的扫码序列号
this.setState({ isBindingError: false });
this.removeScanFun();
};
onBindErrorConfirm = () => {
this.onBindErrorClose();
go("/pages/consultant/consultant");
go("/pages/consultant/consultant?customBack=true");
};
onBeforeBindClose = () => {
Taro.removeStorageSync("isScan"); // 扫码弹窗显示完后,不需要再判断是否扫码
Taro.removeStorageSync("serial"); // 扫码弹窗显示完后,删除缓存的扫码序列号
this.setState({ isBeforeBinding: false });
this.removeScanFun();
};
onBeforeBindConfirm = () => {
this.setState({ isBeforeBinding: false });
this.removeScanFun();
};
/**删除扫码缓存*/
removeScanFun = () => {
Taro.removeStorageSync("isScan"); // 扫码弹窗显示完后,不需要再判断是否扫码
Taro.removeStorageSync("serial"); // 扫码弹窗显示完后,删除缓存的扫码序列号
};
// 跳转仪器介绍页
goNursing = (item) => {
console.log("goNursing", item);
setStorageSync("instrument_detail", JSON.stringify(item));
if (item.status === 0) {
setStorageSync("instrument_detail", item);
this.setState({ connectInstrument: item });
setTimeout(() => this.bindBlockLeft());
} else {
// todo
this.openCommonError([
"该仪器暂时无法进行在线护理,",
"请联系微信小助理",
]);
}
};
/* 扫码进入逻辑 */
@ -655,27 +692,15 @@ class Index extends Component<any, any> {
// return;
}
onUnloginConfirm() {
this.setState({ showEquipment: false })
this.setState({ showEquipment: false });
}
onUnloginClose() {
this.setState({ showEquipment: false })
this.setState({ showEquipment: false });
}
//连接完成时数据的回调
offlineChange = async (e) => {
console.log("offlineChange", e);
// log.info(
// commandMap.versionInfoHome,
// `offlineChange::e::${JSON.stringify(e)}`
// );
//offlineDataList 离线数据
//versioninfo 版本号
let { offlineDataList, versionInfo } = e.detail;
this.setState({
versionInfo,
});
let offlinelist: any = [];
console.log(offlinelist);
this.pairingChange("offlineChange");
};
connectionOpen = async () => {
@ -728,6 +753,7 @@ class Index extends Component<any, any> {
);
this.setState({
isShowVersionUpgrading: false,
isShowVersionUpgradFinish: true, // 升级介绍
versionUpgradFinishNodes: nodes,
});
};
@ -745,8 +771,55 @@ class Index extends Component<any, any> {
};
/** iot版本升级 END */
/**
* @name WL200
* @description
*/
initDeviceNursingHistory = async () => {
let WL200NursingHistory = Taro.getStorageSync("WL200NursingHistory");
if (WL200NursingHistory) {
this.setState({
isShowReConnectDeviceRecordWL200: true,
});
}
};
closeReConnectDeviceRecordWL200 = () => {
Taro.removeStorageSync("WL200NursingHistory");
this.setState({
isShowReConnectDeviceRecordWL200: false,
});
};
confirmReConnectDeviceRecordWL200 = () => {
let WL200NursingHistory = Taro.getStorageSync("WL200NursingHistory");
console.log("WL200NursingHistory", WL200NursingHistory);
this.setState({
isShowReConnectDeviceRecordWL200: false,
});
// this.goNursing()
};
/**
* @name
* @description
* @params
*/
openCommonError = (text) => {
this.setState({
commonErrorText: text,
isCommonError: true,
});
};
onCommonErrorFun = () => {
this.setState({
isCommonError: false,
});
};
render() {
let {
isCommonError,
commonErrorText,
calendarComplete,
calendarInComplete,
currentDate,
@ -778,11 +851,46 @@ class Index extends Component<any, any> {
// 蓝牙连接
isConnectShow,
connectInstrument,
// 设备存在记录,是否重连
isShowReConnectDeviceRecordWL200,
} = this.state;
return (
<Block>
<View catchMove>
<PopupAlert
isShow={isCommonError}
title="提示"
content={
<Block>
{commonErrorText.map((item) => {
return <View>{item}</View>;
})}
</Block>
}
confirmButtonText="知道了"
textAlgin="center"
close={this.onCommonErrorFun}
confirm={this.onCommonErrorFun}
/>
<PopupConfirm
isShow={isShowReConnectDeviceRecordWL200}
isClose
title="提示"
zIndex={10020}
myClassName="level-up"
content={
<Block>
<View></View>
<View></View>
</Block>
}
cancelButtonText="暂不绑定"
confirmButtonText="确认"
textAlgin="center"
close={this.closeReConnectDeviceRecordWL200}
confirm={this.confirmReConnectDeviceRecordWL200}
/>
<PopupAlert
isShow={isBindingError}
title="提示"
@ -794,27 +902,26 @@ class Index extends Component<any, any> {
}
confirmButtonText="知道了"
textAlgin="center"
isClose={false}
close={this.onBindErrorClose}
confirm={this.onBindErrorConfirm}
/>
<PopupAlert
isShow={isNotRegister}
isClose
title='提示'
content='暂未授权注册,请点击注册'
confirmButtonText='确定'
textAlgin='center'
type='1'
title="提示"
content="暂未授权注册,请点击注册"
confirmButtonText="确定"
textAlgin="center"
type="1"
close={this.closeAlert}
confirm={this.closeAlert}
/>
<PopupAlert
isShow={isDev}
title='提示'
content='页面正在开发中'
confirmButtonText='确定'
textAlgin='center'
title="提示"
content="页面正在开发中"
confirmButtonText="确定"
textAlgin="center"
close={this.closeDev}
confirm={this.closeDev}
/>
@ -834,43 +941,42 @@ class Index extends Component<any, any> {
/>
<PopupAlert
isShow={isBindingError}
title='提示'
title="提示"
content={
<Block>
<View></View>
<View></View>
</Block>
}
confirmButtonText='知道了'
textAlgin='center'
isClose={false}
confirmButtonText="知道了"
textAlgin="center"
close={this.onBindErrorClose}
confirm={this.onBindErrorConfirm}
/>
<PopupAlert
isShow={isBeforeBinding}
title='提示'
content='您选择的仪器有误,请重新确认选择'
confirmButtonText='知道了'
textAlgin='center'
isClose={false}
title="提示"
content="您选择的仪器有误,请重新确认选择"
confirmButtonText="知道了"
textAlgin="center"
close={this.onBeforeBindClose}
confirm={this.onBeforeBindConfirm}
/>
<PopupAlert
isShow={showEquipment}
title='提示'
title="提示"
content={
<Block>
<View className='mb10'></View>
<View className='mb10'>uniquie14231</View>
<View className='mb10'></View>
<View className="mb10">
{instrumentInfo.instrumentName}
</View>
<View className="mb10">{instrumentInfo.serial}</View>
<View className="mb10"></View>
</Block>
}
confirmButtonText='知道了'
textAlgin='center'
isClose={false}
confirmButtonText="知道了"
textAlgin="center"
close={this.onUnloginClose.bind(this)}
confirm={this.onUnloginConfirm.bind(this)}
></PopupAlert>
@ -883,9 +989,9 @@ class Index extends Component<any, any> {
<PopupSiteSwiper
isShow={isShowSiteSwiper}
siteData={sitePopupList}
size='middle'
confirmButtonText='确定'
textAlgin='center'
size="middle"
confirmButtonText="确定"
textAlgin="center"
close={this.closeSiteSwiper}
confirm={this.closeSiteSwiper}
/>
@ -901,7 +1007,7 @@ class Index extends Component<any, any> {
upgradeFun={this.upgradeFun}
/>
)}
<PopupConfirm
<PopupAlert
isLarge
isClose
isShow={isShowUpdateVersionTip}
@ -913,7 +1019,6 @@ class Index extends Component<any, any> {
</Block>
}
textAlgin="center"
cancelButtonText="取消"
confirmButtonText="确定"
close={this.cancelUpdateVersionTip}
confirm={this.confirmUpdateVersionTip}
@ -948,29 +1053,29 @@ class Index extends Component<any, any> {
leftSlot={
<Block>
<View
className='message'
className="message"
onClick={this.gourl}
data-url='/pages/message/message'
data-url="/pages/message/message"
>
<Image
className='message-img'
className="message-img"
src={require("../../img/index/message.png")}
mode='aspectFill'
mode="aspectFill"
/>
{messagecount ? <View className='tip' /> : ""}
{messagecount ? <View className="tip" /> : ""}
</View>
</Block>
}
/>
<View className='index'>
<View className='date-title' onClick={this.toNursingRecords}>
<Text className='text'></Text>
<View className="index">
<View className="date-title" onClick={this.toNursingRecords}>
<Text className="text"></Text>
<Image
src={require("../../img/index/right.png")}
style='width: 20rpx;height: 20rpx;'
style="width: 20rpx;height: 20rpx;"
/>
</View>
<View className='bg-while'>
<View className="bg-while">
<AtCalendar
hideArrow
isSwiper={false}
@ -982,46 +1087,44 @@ class Index extends Component<any, any> {
/>
</View>
</View>
<View className='infobox5'>
<View className="infobox5">
{instrumentList.length > 0 && (
<Block>
<View className='nurse_plan_box flex aitems sb'>
<View className='title'></View>
<View className="nurse_plan_box flex aitems sb">
<View className="title"></View>
<View
className='txt_box flex jcenter aitems'
data-url='/pages/instrument/instrument'
className="txt_box flex jcenter aitems"
data-url="/pages/instrument/instrument"
onClick={this.gourl}
>
<Image
className='right_icon'
className="right_icon"
src={require("../../img/black-add.png")}
mode='aspectFill'
mode="aspectFill"
/>
<View className='txt'></View>
<View className="txt"></View>
</View>
</View>
<View style='overflow-x: auto;'>
<View className='device_list flex'>
<View style="overflow-x: auto;">
<View className="device_list flex">
{instrumentList.map((item, index) => {
if (item.status === 0) {
return (
<View
key={"instrumentList" + index}
className='device_item'
className="device_item"
onClick={this.goNursing.bind(this, item)}
>
<Image
className='banner_img'
className="banner_img"
src={item.banner}
mode='aspectFill'
mode="aspectFill"
/>
<View className='device_name ellipsis1'>
<View className="device_name ellipsis1">
{item.name}
</View>
</View>
);
}
})}
</View>
</View>
@ -1029,32 +1132,32 @@ class Index extends Component<any, any> {
)}
{instrumentList.length === 0 && (
<Block>
<View className='nurse_plan_box flex aitems sb'>
<View className='title'></View>
<View className="nurse_plan_box flex aitems sb">
<View className="title"></View>
</View>
<View className='add_device flex jcenter aitems bg-while'>
<View className='add_device_btn'>
<View className='txt_box flex jcenter aitems'>
<View className="add_device flex jcenter aitems bg-while">
<View className="add_device_btn">
<View className="txt_box flex jcenter aitems">
<View
className='at-icon at-icon-add'
style='color: #fff;font-size: 30rpx;'
className="at-icon at-icon-add"
style="color: #fff;font-size: 30rpx;"
></View>
<View className='txt' onClick={this.addNewDevice}>
<View className="txt" onClick={this.addNewDevice}>
</View>
</View>
</View>
<View className='tips'></View>
<View className="tips"></View>
</View>
</Block>
)}
</View>
<View style='margin: 20px'>
<View style="margin: 20px">
<View onClick={this.goIot}></View>
</View>
<View className='infobox3'>
<View className="infobox3">
<Swiper
autoplay
onAnimationFinish={this.bannerSwiperchange.bind(this)}
@ -1066,13 +1169,13 @@ class Index extends Component<any, any> {
key={"banner_" + index}
onClick={this.gobanner.bind(this, item)}
>
<Image style='width:100%;height:100%' src={item.fileUrl} />
<Image style="width:100%;height:100%" src={item.fileUrl} />
</SwiperItem>
);
})}
</Swiper>
</View>
<View style='height:200rpx'></View>
<View style="height:200rpx"></View>
</Block>
);
}
@ -1095,3 +1198,4 @@ const mapDispatchToProps = (dispatch) => ({
},
});
export default connect(mapStateToProps, mapDispatchToProps)(Index);
// instrumentId

@ -127,7 +127,10 @@ class Initiate extends Component<any, any> {
}, 300);
} else {
msg("请求失败,尝试重新请求");
// 防止快速请求
setTimeout(() => {
this.WCUserLogin();
}, 2000);
}
}

@ -18,13 +18,15 @@ import {
} from "@tarojs/components";
import { InstrumentInfo } from "@/utils/Interface";
import { go, back, msg, setStorageSync, getStorageSync } from "@/utils/traoAPI";
import { go, msg, setStorageSync } from "@/utils/traoAPI";
import { getImgInfo, contraction } from "@/utils/compressImage";
/* 自定义组件 */
import Navbar from "@/components/navbar/navbar";
import PopupAlert from "@/components/popup/popup-alert";
import PopupBinding from "@/components/popup/popup-binding";
import NoDataComponent from "@/components/base/nodata";
/* 组件 */
import "./instrument.less";
@ -61,17 +63,43 @@ export default class Instrument extends Component<any, any> {
userinfo: null,
showLoginPopup: "",
fromUrl: "",
isVisibleBinding: false,
isRegisterBoolean: false,
isExchangeBinding: false,
/** INPUT序列号拎出来防止上传图片被清空bug */
serialCodeValue: "",
};
}
$instance = Taro.getCurrentInstance();
isOnly: boolean = false;
currentDevice: any = null;
id: any = "";
async onLoad() {
this.unbindingInstrumentInfoList();
}
async onLoad() {}
componentDidMount() {}
componentWillUnmount() {}
componentDidShow() {}
componentDidShow() {
// 进入页面判断是否注册,用于扫码登录
let mobile = Taro.getStorageSync("mobile");
if (mobile) {
this.setState({ isRegisterBoolean: true });
}
// 用于判断是否只显示一个设备
let params: any = this.$instance.router?.params;
if (params?.isOnly && params?.id) {
if (params?.isOnly === "true") {
this.isOnly = true;
this.id = params?.id;
}
}
console.log("params", params);
this.unbindingInstrumentInfoList();
}
componentDidHide() {}
@ -79,24 +107,9 @@ export default class Instrument extends Component<any, any> {
onSerial = (event) => {
const { value } = event.detail;
let { channelInfo } = this.state;
channelInfo.serialCode = value;
this.setState({ channelInfo });
this.setState({ serialCodeValue: value });
};
// onScanCode() {
// Taro.scanCode({
// scanType: ["qrCode"],
// success: (res) => {
// let { channelInfo } = this.state;
// channelInfo.serialCode = res.result;
// this.setState({ channelInfo });
// },
// });
// }
onTipShow = () => {
this.setState({ tipShow: true });
};
@ -140,88 +153,6 @@ export default class Instrument extends Component<any, any> {
});
};
// getBindCodeInfo = async () => {
// const { bindCode, instrumentList, channelInfo } = this.state;
// // // 1.查询资料
// // try {
// // const { data } = await InstrumentCodeCheck({
// // code: bindCode,
// // });
// // const bindCodeInfo = { ...data.data.bindCodeInfo };
// // // 2.判断是否是选中的仪器, 如果不是, 直接弹出scanErrorPopup
// // if (channelInfo.id != bindCodeInfo.instrument_id) {
// // this.setState({
// // bindPopup: "scanErrorPopup",
// // });
// // return;
// // }
// // const match = instrumentList.find((item) => {
// // if (item.id == bindCodeInfo.instrument_id && item.serial) {
// // // 找到同一个仪器
// // bindCodeInfo.hadBindSame = true;
// // if (item.serial == bindCodeInfo.antifakeCode) {
// // // 找到同一个序列号
// // bindCodeInfo.hadBindSameCode = true;
// // } else {
// // bindCodeInfo.hadBindSameCode = false;
// // }
// // return item;
// // }
// // if (item.id == bindCodeInfo.instrument_id) {
// // const { channelInfo } = this.state;
// // if (channelInfo.id === item.id) return;
// // this.setState({
// // channelInfo: item,
// // isVideo: isVideo(item.bind_intro_video),
// // });
// // }
// // });
// // if (match) {
// // bindCodeInfo.hadBind = true;
// // } else {
// // bindCodeInfo.hadBindSame = false;
// // }
// // this.setState({
// // bindCodeInfo,
// // });
// // this.judgeBindCode();
// // } catch (e) {
// // this.judgeBindCode();
// // }
// };
// judgeBindCode = () => {
// const { bindCode, bindCodeInfo } = this.state;
// const opts: any = {};
// if (bindCode && !bindCodeInfo) {
// // 有仪器码, 但是没有找到信息时
// opts.bindPopup = "noFoundPopup";
// } else if (bindCode && bindCodeInfo && bindCodeInfo.isLabelCode) {
// opts.bindPopup = "labelPopup";
// } else if (
// bindCode &&
// bindCodeInfo.hadBindSame &&
// bindCodeInfo.hadBindSameCode
// ) {
// // 有仪器码, 如果有登录, 判断是绑定了同样的仪器和仪器的序列号是一致 -- 不弹弹窗, 回到首页
// opts.bindCode = ""; // 重置bindCode
// opts.bindPopup = ""; // 隐藏bindPopup
// } else if (
// bindCode &&
// bindCodeInfo.hadBindSame &&
// !bindCodeInfo.hadBindSameCode
// ) {
// // 有仪器码, 如果有登录, 判断是绑定了同样的仪器, 但仪器的序列号不一致 -- 判断换绑
// opts.bindPopup = "switchBindCodePopup";
// } else if (bindCode && !bindCodeInfo.hadBindSame) {
// // 有仪器码, 如果有登录, 判断不是绑定了同样的仪器 -- 绑定
// opts.bindPopup = "toBindPopup";
// }
// if (Object.keys(opts).length) {
// this.setState(opts);
// }
// };
onCustomerTap = () => {
this.onCancelBind2Tap();
go("/pages/consultant/consultant");
@ -247,16 +178,20 @@ export default class Instrument extends Component<any, any> {
let compressImage = await contraction(img, "compressImage");
// 压缩后文件地址
let compressTempFilePath = compressImage.tempFilePath;
setTimeout(() => {
let { channelInfo } = this.state;
channelInfo.serialImage = compressTempFilePath;
this.setState({ channelInfo });
});
},
});
};
onSubmit = () => {
const { serialCode, serialImage, id } = this.state.channelInfo;
if (!serialCode?.trim()) return msg("请填写序列号");
const { serialImage } = this.state.channelInfo;
if (!this.state.serialCodeValue?.trim()) return msg("请填写序列号");
if (!serialImage) return msg("请上传序列号照片");
this.manualCodeBinding();
};
@ -265,15 +200,21 @@ export default class Instrument extends Component<any, any> {
const { channelInfo } = this.state;
if (channelInfo.id === item.id) return;
channelInfo.serialCode = "";
channelInfo.manualCodeBinding = "";
channelInfo.scanCodeBinding = "";
this.setState({
channelInfo: item,
channelInfo: channelInfo,
isVideo: this.isVideo(item.banner),
serialCodeValue: "",
});
}
public back = () => {
back();
};
setTimeout(() => {
this.setState({
channelInfo: item,
});
}, 10);
}
closeDev = () => {
// go("/pages/user/user");
@ -297,18 +238,35 @@ export default class Instrument extends Component<any, any> {
let { data } = await InstrumentInfo.unbindingInstrumentInfoList();
if (data.code === 200) {
if (data.data.length) {
let item = data.data[0];
if (!this.isOnly) {
let equipmentList = data.data.filter((item) => item.status === 0);
if (equipmentList.length === 0) {
return;
}
let item = equipmentList[0];
item.serialCode = "";
this.setState({
equipmentList: equipmentList,
channelInfo: item,
isVideo: this.isVideo(item.banner),
});
} else {
let item = data.data.find((item) => String(item.id) === this.id);
if (item) {
item.serialCode = "";
this.setState({
equipmentList: data.data,
equipmentList: [item],
channelInfo: item,
isVideo: this.isVideo(item.banner),
});
}
}
}
}
};
// 绑定仪器
// 手写绑定仪器
manualCodeBinding = async () => {
Taro.showLoading({
title: "请求中...",
@ -317,14 +275,14 @@ export default class Instrument extends Component<any, any> {
let { channelInfo } = this.state;
let res = await InstrumentInfo.manualCodeBinding({
serial: channelInfo.serialCode,
serial: this.state.serialCodeValue,
serialImage: channelInfo.serialImage,
instrumentId: channelInfo.id,
});
console.log("bindingInstrument", res);
Taro.hideLoading();
// 文件上传接口返回格式不需要加data
if (res.code === 200) {
this.binding();
this.openBindingVisible();
} else if (res.code === 204) {
this.setState({ isBindingCheckError: false });
} else {
@ -343,7 +301,8 @@ export default class Instrument extends Component<any, any> {
});
Taro.hideLoading();
if (res.data.code === 200) {
this.binding();
// this.bindingInstrument();
this.openBindingVisible();
} else if (res.data.code === 204) {
this.setState({ isBindingCheckError: true });
} else {
@ -351,7 +310,8 @@ export default class Instrument extends Component<any, any> {
}
};
binding = async () => {
// 调用绑定接口
bindingInstrument = async () => {
Taro.showLoading({
title: "请求中...",
mask: true,
@ -373,6 +333,24 @@ export default class Instrument extends Component<any, any> {
this.setState({ isBindingError: true });
}
};
// 换绑仪器
exchangeBinding = async () => {
Taro.showLoading({
title: "请求中...",
mask: true,
});
let { channelInfo } = this.state;
let { data } = await InstrumentInfo.exchangeBinding({
serial: channelInfo.serialCode,
});
console.log("exchangeBinding", data);
Taro.hideLoading();
this.closeBinding();
if (data.code === 200) {
msg("换绑成功");
}
};
onBindErrorClose = () => {
this.setState({ isBindingError: false });
};
@ -385,6 +363,29 @@ export default class Instrument extends Component<any, any> {
this.setState({ isBindingCheckError: false });
};
customBack = () => {
Taro.switchTab({ url: "/pages/index/index" });
};
// 打开绑定弹窗
openBindingVisible = () => {
this.setState({ isVisibleBinding: true });
};
closeBinding = () => {
this.setState({ isVisibleBinding: false });
};
confirmBinding = () => {
let { isExchangeBinding } = this.state;
if (!isExchangeBinding) {
// 绑定仪器
this.bindingInstrument();
} else {
// 换绑仪器
this.exchangeBinding();
}
};
render() {
let {
isBindingError,
@ -393,6 +394,10 @@ export default class Instrument extends Component<any, any> {
inputType,
style,
equipmentList,
isVisibleBinding,
isRegisterBoolean,
isExchangeBinding,
serialCodeValue,
} = this.state;
return (
<Block>
@ -406,16 +411,30 @@ export default class Instrument extends Component<any, any> {
close={this.closeDev}
confirm={this.closeDev}
/> */}
<Navbar titleSlot="仪器绑定" isBack={true} />
<Navbar
titleSlot="仪器绑定"
isBack
isCustomBack
customBack={this.customBack}
/>
<PopupBinding
type={channelInfo.bindingStatus}
isShow={isVisibleBinding}
isRegisterBoolean={isRegisterBoolean}
isExchangeBinding={isExchangeBinding}
data={channelInfo}
close={this.closeBinding}
confirm={this.confirmBinding}
/>
<PopupAlert
isShow={isBindingError}
title="提示"
content="序列号库仍在更新,请联系微信助手"
confirmButtonText="知道了"
textAlgin="center"
isClose={false}
close={this.onBindErrorClose}
confirm={this.onBindErrorClose}
confirm={this.onBindErrorConfirm}
></PopupAlert>
<PopupAlert
isShow={isBindingCheckError}
@ -423,7 +442,6 @@ export default class Instrument extends Component<any, any> {
content="您选择的仪器有误,请重新选择确认"
confirmButtonText="知道了"
textAlgin="center"
isClose={false}
close={this.onBindCheckErrorClose}
confirm={this.onBindCheckErrorClose}
></PopupAlert>
@ -482,7 +500,8 @@ export default class Instrument extends Component<any, any> {
style="width: 100%; white-space: nowrap;"
scrollIntoView={"scroll" + channelInfo.id}
>
{equipmentList.map((item, index) => {
{equipmentList.length > 0 &&
equipmentList.map((item, index) => {
return (
<View
className={classnames("cover", {
@ -502,6 +521,14 @@ export default class Instrument extends Component<any, any> {
</View>
);
})}
{equipmentList.length === 0 && (
<Block>
<View>
<NoDataComponent />
</View>
</Block>
)}
</ScrollView>
</View>
<View className="form_item is-tab">
@ -556,7 +583,7 @@ export default class Instrument extends Component<any, any> {
placeholder="例如FR10*********1"
placeholder-style={style}
onInput={this.onSerial}
value={channelInfo.serialCode}
value={serialCodeValue}
></Input>
</View>
</View>

@ -12,12 +12,12 @@ import {
} from "@tarojs/components";
/* 自定义组件 */
import Navbar from "../../components/navbar/navbar";
import Navbar from "@/components/navbar/navbar";
// import PopupAlert from "../../components/popup/popup-alert";
/* 组件 */
import { InstrumentInfo } from "../../utils/Interface";
import { setStorageSync, getStorageSync, go } from "../../utils/traoAPI";
import { InstrumentInfo } from "@/utils/Interface";
import { setStorageSync, getStorageSync, go, back } from "@/utils/traoAPI";
import "./intro.less";
@ -25,28 +25,28 @@ class Intro extends Component<any, any> {
constructor(props) {
super(props);
this.state = {
name: "template模板页",
name: "仪器介绍页",
current: 0,
instrument: {},
introList: [],
isNursing: false,
};
}
$instance = Taro.getCurrentInstance();
async onLoad() {}
componentDidMount() {}
componentDidMount() {
let strObj = getStorageSync("instrument_detail");
if (strObj) {
let instrument = strObj;
this.getInstrumentInfo(instrument.id);
this.setState({ instrument });
}
}
componentWillMount() {
// let params = Taro.Current?.router?.params;
// if (params) {
// this.getInstrumentInfo(params.id);
// }
let strObj = getStorageSync("instrument_item");
if (strObj) {
let instrument = JSON.parse(strObj);
this.getInstrumentInfo(instrument.id);
this.setState({ instrument });
}
}
componentWillUnmount() {}
@ -63,41 +63,53 @@ class Intro extends Component<any, any> {
}
// 获取设备信息
async getInstrumentInfo(id) {
getInstrumentInfo = async (id) => {
let res = await InstrumentInfo.instructionInfo({
instrumentId: id,
});
if (res.data.code === 200) {
this.setState({ introList: res.data.data });
}
}
};
toNursing() {
// if (this.state.info.iot === 2) {
// this.setState({ isNursing: true }, () => {
// this.toHomePage();
// });
// } else {
// go("/pages/clock_in2/clock_in2?iid=" + this.state.info.id);
// }
/** 跳转至打卡页或护理页 */
toNursing = () => {
const { instrument } = this.state;
console.log("instrument", instrument);
if (instrument.type === 1) {
go("/pages/instrumentClickinUpload/index");
} else {
go("/pages/iotCarePlan/iotCarePlan");
}
};
toHomePage() {
// const { isNursing, info } = this.state;
// if (isNursing) {
// setStorageSync("introduceId", info.id);
// }
toHomePage = () => {
const url = "/pages/index/index";
Taro.switchTab({
url,
});
};
customBack = () => {
let customBack = this.$instance.router?.params?.customBack;
if (customBack) {
Taro.switchTab({ url: "/pages/index/index" });
return;
}
back();
};
render() {
let { current, introList, instrument } = this.state;
return (
<Block>
<Navbar titleSlot="仪器绑定" isBack={true} />
<Navbar
titleSlot="仪器绑定"
isBack
isCustomBack
customBack={this.customBack}
/>
<View style="position: relative">
<Swiper
className="main"

@ -216,7 +216,8 @@ page {
.block1_1 {
height: 100%;
flex-direction: column;
width: 134rpx;
// width: 134rpx;
min-width: 80rpx;
.icon {
width: 30rpx;
height: 30rpx;

@ -70,42 +70,41 @@ export default class InstrumentClickInUpload extends Component<any, any> {
async onLoad() {
this.initData();
}
componentDidMount() { }
componentDidMount() {}
componentWillUnmount() { }
componentWillUnmount() {}
componentDidShow() {
let videoContext = Taro.createVideoContext("myVideo");
this.setState({ videoContext });
}
componentDidHide() { }
componentDidHide() {}
async initData() {
let objStr = getStorageSync("instrument_detail");
if (objStr) {
let instrumentDetail = JSON.parse(objStr);
this.setState({ instrumentDetail });
let obj = getStorageSync("instrument_detail");
if (obj) {
this.setState({ instrumentDetail: obj });
}
const searchParams = new URLSearchParams(window.location.search);
const id = searchParams.get("id");
setTimeout(() => {
this.firstNurseInfo();
this.getLatestClockRecord();
this.modeInfoList(id);
this.modeInfoList(this.state.instrumentDetail.id);
}, 10);
}
// 打卡介绍
// 首次护理弹窗
firstNurseInfo = async () => {
let { instrumentDetail } = this.state;
let res = await InstrumentInfo.firstNurseInfo({
instrumentId: instrumentDetail.id,
});
if (res.data.code === 200) {
let isTipShow = getStorageSync("first_instrument_" + instrumentDetail.id);
// 仅在有数据的时候执行
if (res.data.length) {
let isTipShow = getStorageSync(
"first_instrument_" + instrumentDetail.id
);
if (!isTipShow) {
// 首次进入页面:自动打开打卡介绍弹窗
this.setState({ nurseInfo: res.data.data, isTipShow: true });
@ -113,21 +112,24 @@ export default class InstrumentClickInUpload extends Component<any, any> {
this.setState({ nurseInfo: res.data.data });
}
}
}
};
// 获取最新一条打卡记录
getLatestClockRecord = async () => {
let { punchInInfo } = this.state;
let res = await InstrumentInfo.apiClock.getLatestClockRecord();
if (res.data.code === 200) {
if (res.data.data) {
punchInInfo.clockContent = res.data.data.clockContent;
punchInInfo.clockImageList = res.data.data.clockImg;
}
}
this.setState({ punchInInfo });
};
// 获取仪器模式列表
modeInfoList = async (id) => {
let res = await InstrumentInfo.modeInfoList({
instrumentId: "84",
instrumentId: id,
});
if (res.data.code === 200) {
if (res.data.data.length) {
@ -242,15 +244,15 @@ export default class InstrumentClickInUpload extends Component<any, any> {
});
};
videoBindTimeUpdate = async () => { };
videoBindTimeUpdate = async () => {};
videoEnded = async () => { };
videoEnded = async () => {};
videoPause = async () => { };
videoPause = async () => {};
videoPlay = async () => { };
videoPlay = async () => {};
videoLoadedMetaData = async () => { };
videoLoadedMetaData = async () => {};
handleTextareaInput = async (e) => {
let { punchInInfo } = this.state;
@ -267,7 +269,11 @@ export default class InstrumentClickInUpload extends Component<any, any> {
};
onTipShowOpen = async () => {
if (this.state.nurseInfo.length) {
this.setState({ isTipShow: true });
} else {
msg("暂无数据");
}
};
onTipShowClose = async () => {
setStorageSync(
@ -386,10 +392,7 @@ export default class InstrumentClickInUpload extends Component<any, any> {
}}
>
<View className="block1">
<View
className="block1_1 flex aitems "
style="min-width: 80rpx"
>
<View className="block1_1 flex aitems ">
<View className="tip1">{item.modeName}</View>
<View className="tip2">{item.modeDesc}</View>

@ -33,10 +33,9 @@ export default class InstrumentDetail extends Component<any, any> {
componentDidHide() {}
async initData() {
let objStr = getStorageSync("instrument_detail");
if (objStr) {
let info = JSON.parse(objStr);
this.bindingInstrumentInfo(info.id);
let obj = getStorageSync("instrument_detail");
if (obj) {
this.bindingInstrumentInfo(obj.id);
}
}

@ -45,13 +45,13 @@ export default class InstrumentManage extends Component<any, any> {
async onLoad() {
this.initData();
}
componentDidMount() { }
componentDidMount() {}
componentWillUnmount() { }
componentWillUnmount() {}
componentDidShow() { }
componentDidShow() {}
componentDidHide() { }
componentDidHide() {}
async initData() {
this.bindingInstrumentList();
@ -87,39 +87,46 @@ export default class InstrumentManage extends Component<any, any> {
}
};
goIntro(item) {
goIntro = (item) => {
console.log("item", item);
setStorageSync("instrument_detail", item);
let bindid = item.id;
go("/pages/introduce/introduce?id=" + bindid);
}
goBind(item) {
go("/pages/instrument/intro?id=" + bindid);
};
goBind = (item) => {
let bindid = item.id;
go("/pages/instrument/instrument?id=" + bindid);
}
go("/pages/instrument/instrument?isOnly=true&id=" + bindid); // 只显示当前仪器内容
};
goBindInfo(item) {
goBindInfo = (item) => {
// let bindid = item.id;
setStorageSync("instrument_detail", JSON.stringify(item));
setStorageSync("instrument_detail", item);
go("/pages/instrument_detail/index");
}
};
async lesgobuy(item) {
lesgobuy = (item) => {
console.log(item);
// if (item.programs_json) {
// item.programs_json = JSON.parse(item.programs_json);
// // console.log(item.programs_json)
// Taro.navigateToMiniProgram({
// appId: item.programs_json.buylink,
// path: item.programs_json.buypath,
// envVersion: "release",
// success(res) {
// // 打开成功
// },
// fail() {},
// });
// } else {
// msg("暂无购买链接");
// }
if (item.isPurchase === 1) {
if (item.programs_json) {
item.programs_json = JSON.parse(item.programs_json);
// console.log(item.programs_json)
Taro.navigateToMiniProgram({
appId: item.programs_json.buylink,
path: item.programs_json.buypath,
envVersion: "release",
success(res) {
// 打开成功
},
fail() {},
});
} else {
msg("暂无购买链接");
}
} else {
msg("暂无购买链接");
}
};
render() {
let { bindList, unBindList, current } = this.state;
@ -127,10 +134,11 @@ export default class InstrumentManage extends Component<any, any> {
<Block>
<Navbar titleSlot="设备管理" background="#fff" isBack={true} />
<View className="instrument_box">
{bindList.length > 0 &&
{bindList.length > 0 && (
<Block>
<View className="title"></View>
<View className="scroll">
{bindList.length > 0 && (
<Swiper
className="bind_list"
current={current}
@ -145,46 +153,10 @@ export default class InstrumentManage extends Component<any, any> {
return (
<SwiperItem key={index}>
<View className="wrapper" key={"bind_" + index}>
<View className="cover" onClick={this.goIntro}>
<Image
className="Image"
src={item.banner}
mode="aspectFill"
></Image>
<View className="bind_status"></View>
<View className="intro">
<View className="tips" onClick={this.goIntro}>
</View>
<View className="right">
<Image
src={require("../../img/index/right.png")}
mode="widthFix"
style="height: 20rpx;"
/>
</View>
</View>
</View>
<View className="bind_cont">
<View className="title">{item.name}</View>
<View
className="bindinfo"
onClick={this.goBindInfo.bind(this, item)}
className="cover"
onClick={this.goIntro.bind(this, item)}
>
</View>
</View>
</View>
</SwiperItem>
);
})}
</Swiper>
{/* <ScrollView scroll-x="true" className="bind_list">
{bindList.map((item, index) => {
if (item.status === 0) {
return (
<View className="wrapper" key={"bind_" + index}>
<View className="cover" onClick={this.goIntro}>
<Image
className="Image"
src={item.banner}
@ -192,7 +164,10 @@ export default class InstrumentManage extends Component<any, any> {
></Image>
<View className="bind_status"></View>
<View className="intro">
<View className="tips" onClick={this.goIntro}>
<View
className="tips"
onClick={this.goIntro.bind(this, item)}
>
</View>
<View className="right">
@ -214,13 +189,18 @@ export default class InstrumentManage extends Component<any, any> {
</View>
</View>
</View>
</SwiperItem>
);
}
})}
</ScrollView> */}
</Swiper>
)}
</View>
</Block>
}
)}
{/* 当且仅当未绑定仪器存在时显示 */}
{unBindList.length > 0 && (
<Block>
<View className="title"></View>
<View className="scroll">
<ScrollView scroll-x="true" className="un_bind_list">
@ -228,16 +208,15 @@ export default class InstrumentManage extends Component<any, any> {
if (item.status === 0) {
return (
<View className="wrapper" key={index}>
<View
className="cover"
onClick={this.lesgobuy.bind(this, item)}
>
<View className="cover">
<Image
className="image"
src={item.banner}
mode="aspectFill"
></Image>
<View className="name">{item.name}</View>
{item.isPurchase === 1 && (
<View
className="buy"
onClick={this.lesgobuy.bind(this, item)}
@ -251,6 +230,7 @@ export default class InstrumentManage extends Component<any, any> {
/>
</View>
</View>
)}
</View>
<View className="bind_cont">
<View
@ -266,6 +246,8 @@ export default class InstrumentManage extends Component<any, any> {
})}
</ScrollView>
</View>
</Block>
)}
</View>
</Block>
);

@ -0,0 +1,62 @@
.box {
width: 690rpx;
height: 320rpx;
margin: 28rpx auto;
background-color: #fff;
border-radius: 30rpx;
padding: 35rpx 25rpx 25rpx 35rpx;
box-sizing: border-box;
position: relative;
}
.box_background {
position: absolute;
top: 0;
left: 0;
width: 690rpx;
height: 320rpx;
border-radius: 30rpx;
background-color: #fff;
.power {
margin: 34rpx 0 28rpx 28rpx;
font-family: PingFang-SC;
font-weight: 500;
font-size: 18rpx;
color: #cccccc;
}
.full{
width: 24rpx;
height: 24rpx;
position: absolute;
top: 32rpx;
right: 26rpx;
}
.line {
margin: 0 0 6rpx 35rpx;
font-family: PingFang-SC;
font-size: 14rpx;
color: #cccccc;
display: flex;
position: relative;
height: 18rpx;
.bottom_line {
border-bottom: 1rpx #ccc dashed;
width: 550rpx;
margin-left: 20rpx;
position: absolute;
bottom: -6rpx;
right: 74rpx;
height: 4rpx;
color: #fff;
}
}
.time {
position: absolute;
bottom: 22rpx;
right: 24rpx;
font-family: PingFang-SC;
font-size: 18rpx;
color: #cccccc;
}
}

@ -0,0 +1,284 @@
import Taro from "@tarojs/taro";
import classnames from "classnames";
import { Block, View, Image, Text } from "@tarojs/components";
import { useRef } from 'react'
import Echarts, { EChartOption, EchartsHandle } from 'taro-react-echarts'
import echarts from '@/utils/echarts.min.js'
import "./index.less";
interface Props {
Electricity: any;
matrixElectricity: any;
facialMaskConnectStatus: any;
}
function Index() {
const echartsRef = useRef<EchartsHandle>(null)
const option: EChartOption = {
grid: { // 让图表占满容器
top: "28rpx",
left: "18rpx",
right: "28rpx",
bottom: "17rpx"
},
xAxis: {
// name: '',
// nameGap: 5,
// nameTextStyle: {
// color: '#e4e4e4',
// fontSize:7
// },
type: 'category',
axisLine: {
//坐标轴轴线相关设置。数学上的x轴
show: true,
lineStyle: {
color: '#cccccc'
}
},
axisLabel: {
//坐标轴刻度标签的相关设置
color: '#cccccc',
fontSize: 8
},
axisTick: {
show: false
},
data: [
'00:01',
'00:02',
'00:03',
'00:04',
'00:05',
'00:06',
'00:07',
'00:08',
'00:09',
'00:10'
]
},
yAxis: {
type: 'value',
min: 0,
max: 8,
splitNumber: 8,
splitLine: {
show: false,
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: '#fff8c9'
},
{
gt: 1,
lte: 2,
color: '#fff0c6'
},
{
gt: 2,
lte: 3,
color: '#ffe5c3'
},
{
gt: 3,
lte: 4,
color: '#ffdbbf'
},
{
gt: 4,
lte: 5,
color: '#ffcfbb'
},
{
gt: 5,
lte: 6,
color: '#ffbab5'
},
{
gt: 6,
lte: 7,
color: '#ffb4b3'
},
{
gt: 7,
lte: 8,
color: '#ffb4b3'
}
],
outOfRange: {
color: '#ff8410'
}
},
series: [
{
data: [2, 3, 5, 3, 5, 6, 8, 5, 6, 4],
type: 'line',
smooth: true,
z: 1,
areaStyle: {},
color: 'red'
},
{
data: [2, 3, 5, 3, 5, 6, 8, 5, 6, 4],
type: 'line',
smooth: true,
symbolSize: 5,
lineStyle: {
color: '#ff8410',
width: 1
},
itemStyle: {
color: '#ff8410'
}
},
{
name: 'a',
data: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
type: 'bar',
barWidth: 12,
z: 2,
stack: 'x',
visualMap: false,
itemStyle: {
color: '#ffcf56'
}
},
{
name: 'b',
data: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
type: 'bar',
z: 2,
stack: 'x',
visualMap: false,
itemStyle: {
color: '#febb22'
}
},
{
name: 'c',
data: [0, 1, 1, 1, 1, 1, 1, 1, 1, 1],
type: 'bar',
z: 2,
stack: 'x',
visualMap: false,
itemStyle: {
color: '#ffac28'
}
},
{
name: 'd',
data: [0, 0, 1, 0, 1, 1, 1, 1, 1, 1],
type: 'bar',
z: 2,
stack: 'x',
visualMap: false,
itemStyle: {
color: '#ff8410'
}
},
{
name: 'e',
data: [0, 0, 1, 0, 1, 1, 1, 1, 1, 0],
type: 'bar',
z: 2,
stack: 'x',
visualMap: false,
itemStyle: {
color: '#f85804'
}
},
{
name: 'f',
data: [0, 0, 0, 0, 0, 1, 1, 0, 1, 0],
type: 'bar',
z: 2,
stack: 'x',
visualMap: false,
itemStyle: {
color: '#e02e14'
}
},
{
name: 'h',
data: [0, 0, 0, 0, 0, 0, 1, 0, 0, 0],
type: 'bar',
z: 2,
stack: 'x',
visualMap: false,
itemStyle: {
color: '#b30016'
}
},
{
name: 'i',
data: [0, 0, 0, 0, 0, 0, 1, 0, 0, 0],
type: 'bar',
z: 2,
stack: 'x',
visualMap: false,
itemStyle: {
color: '#750010'
}
}
]
}
const level = [8, 7, 6, 5, 4, 3, 2]
return (
<View className='box' >
<Echarts
echarts={echarts}
option={option}
ref={echartsRef}
// isPage={false}
// style自定义设置echarts宽高
style={{ width: '630rpx', height: '260rpx' }}
/>
<View className='box_background'>
<Image className='full' src={require('@/img/full-scran.png')}></Image>
<View className='power'></View>
{
level.map(item => (
<View className='line' key={item}>
<View className='number'>{item}</View><View className='bottom_line'>8</View>
</View>)
)
}
<View className='line' >
<View className='number'>1</View>
</View>
<View className='time'></View>
</View>
</View>
);
}
export default Index;

@ -91,15 +91,7 @@ function Index({
<View className="v2 battery_icon"></View>
</Block>
)}
{Electricity === 1 && (
<Block>
<View className="v1 battery_icon"></View>
<View className="v2 battery_icon"></View>
<View className="v2 battery_icon"></View>
<View className="v2 battery_icon"></View>
</Block>
)}
{Electricity === 0 && (
{Electricity <= 1 && (
<Block>
<View className="v3 battery_icon"></View>
<View className="v2 battery_icon"></View>

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

@ -5,44 +5,52 @@ import { useState, useEffect } from "react";
import "./index.less";
interface Props {
isCanClick: boolean;
isShowNurse: boolean;
isStopNurse: boolean;
isDisabled: boolean; // 是否禁用开始暂停按钮:模式与连接设备是否一致
onEmitStartNurse: Function; // 每次点击item回调事件和数据给父组件
onEmitSwitchChange: Function;
onEmitEndPlan: Function;
onEmitErrorTips: Function; // 不可点击,提示错误
}
function Index({
isCanClick,
isShowNurse,
isStopNurse,
isDisabled,
onEmitStartNurse,
onEmitSwitchChange,
onEmitEndPlan,
onEmitErrorTips,
}: Props) {
const onStartNurse = () => {
onEmitStartNurse();
};
const onSwitchChange = () => {
if (!isDisabled) {
onEmitSwitchChange();
}
};
const onEndPlan = () => {
onEmitEndPlan();
};
const onErrorTips = () => {
onEmitErrorTips();
};
return (
<Block>
<View className="footer">
<View className="iot-footer">
{!isShowNurse && (
<Block>
{isCanClick ? (
<View className="btn" onClick={onStartNurse}>
{isDisabled ? (
<View className="btn btn-disable" onClick={onStartNurse}>
</View>
) : (
<View className="btn btn-disable" onClick={onStartNurse}>
<View className="btn" onClick={onStartNurse}>
</View>
)}
@ -50,6 +58,7 @@ function Index({
)}
{isShowNurse && (
<View className="switch-btn-box">
{!isDisabled && (
<View className="btn-item border-right" onClick={onSwitchChange}>
{isStopNurse ? (
<Block>
@ -58,7 +67,7 @@ function Index({
src={require("../../../../img/iot/start_nurse.png")}
mode="aspectFill"
/>
<Text className="btn-text"></Text>
<Text className="btn-text"></Text>
</Block>
) : (
<Block>
@ -71,6 +80,39 @@ function Index({
</Block>
)}
</View>
)}
{isDisabled && (
<View
className="btn-item border-right btn-disable"
onClick={onErrorTips}
>
{isStopNurse ? (
<Block>
<Image
className="btn-icon"
style="color: #ccc"
src={require("../../../../img/iot/start_nurse.png")}
mode="aspectFill"
/>
<Text className="btn-text" style="color: #ccc">
</Text>
</Block>
) : (
<Block>
<Image
className="btn-icon"
style="color: #ccc"
src={require("../../../../img/iot/pause_nurse.png")}
mode="aspectFill"
/>
<Text className="btn-text" style="color: #ccc">
</Text>
</Block>
)}
</View>
)}
<View className="btn-item" onClick={onEndPlan}>
<Image

@ -9,7 +9,6 @@ interface Props {
activeModeID: any;
ModeList: any;
ModeType: string; // all visor cabin yimeish
ActiveModeItem: any;
isShowNurse: boolean; // 是否已进入护理详情页
isPop: boolean; // 是否弹窗
onEmit: Function; // 每次点击item回调事件和数据给父组件
@ -20,7 +19,6 @@ function Index({
isPop,
ModeList,
ModeType,
ActiveModeItem,
ModeID,
activeModeID,
onEmit,
@ -30,9 +28,7 @@ function Index({
let CabinList = ModeList.filter((item) => item.modeClass === 2); // 舱体模式
let YimeishList = ModeList.filter((item) => item.modeClass === 3); // 医美术后
// const [ModeID, setModeID] = useState<any>("mode_" + ActiveModeItem.id);
// const [activeModeID, setactiveModeID] = useState<any>(ActiveModeItem.id);
console.log("ModeType", ModeType);
const yimeishClick = (item) => {
onEmit(item);
};
@ -105,7 +101,11 @@ function Index({
{activeModeID === item.id && (
<View className="mode-pic">
<Image src={item.modeBanner} mode="aspectFill" />
<Image
src={item.modeBanner}
mode="aspectFill"
style="animation-iteration-count:1;"
/>
</View>
)}
</View>
@ -159,7 +159,11 @@ function Index({
{activeModeID === item.id && (
<View className="mode-pic">
<Image src={item.modeBanner} mode="aspectFill" />
<Image
src={item.modeBanner}
mode="aspectFill"
style="animation-iteration-count:1;"
/>
</View>
)}
</View>
@ -213,7 +217,11 @@ function Index({
{activeModeID === item.id && (
<View className="mode-pic">
<Image src={item.modeBanner} mode="aspectFill" />
<Image
src={item.modeBanner}
mode="aspectFill"
style="animation-iteration-count:1;"
/>
</View>
)}
</View>

@ -32,6 +32,7 @@
width: 690rpx;
height: 640rpx;
border-radius: 30rpx;
animation-iteration-count: 1; // gif只播放一次
}
.iot-device {
width: 690rpx;
@ -74,10 +75,10 @@
}
.msg-tips {
position: absolute;
top: 50%;
top: 40%;
left: 0;
right: 0;
transform: translateY(-50%);
transform: translateY(-40%);
display: flex;
align-items: center;
max-width: 635rpx;
@ -86,6 +87,7 @@
background-color: rgba(0, 0, 0, 0.5);
box-sizing: border-box;
border-radius: 30rpx;
z-index: 10100 !important; // 提升层级,防止被其他元素遮挡
.msg-tips-img {
width: 30rpx;
height: 30rpx;
@ -119,73 +121,6 @@
}
}
.footer {
position: fixed;
bottom: 0;
z-index: 99;
display: flex;
align-items: baseline;
width: 100%;
height: 153rpx;
background: #ffffff;
box-shadow: 0rpx -3rpx 7rpx 1rpx rgba(173, 191, 207, 0.21);
padding-bottom: env(safe-area-inset-bottom);
box-sizing: border-box;
.btn {
width: 690rpx;
height: 90rpx;
background: #000;
border-radius: 45rpx;
color: #fff;
line-height: 90rpx;
text-align: center;
margin: 21rpx 49rpx 42rpx 30rpx;
font-size: 32rpx;
}
.text {
display: flex;
align-items: center;
font-size: 32rpx;
font-weight: bold;
color: #000;
}
.btn-disable {
background-color: #ccc !important; /* 设置按钮背景颜色为灰色 */
color: #fff !important; /* 设置按钮文字颜色为白色 */
border-color: #ccc !important; /* 设置按钮边框颜色为灰色 */
}
.switch-btn-box {
width: 100vw;
display: flex;
align-items: center;
margin-top: 34rpx;
.btn-item {
height: 70rpx;
display: flex;
flex: 1;
align-items: center;
justify-content: center;
.btn-icon {
width: 36rpx;
height: 36rpx;
margin-right: 18rpx;
}
.btn-text {
font-size: 32rpx;
font-family: PingFang SC;
font-weight: bold;
color: #000000;
}
}
.border-right {
border-right: 1px solid #ddd;
}
}
}
.battery_icon {
width: 8rpx;
height: 20rpx;
@ -206,3 +141,8 @@
.v3 {
background: linear-gradient(0deg, #ff4646, #ff6b6b, #f86f6f, #ff9494);
}
#chart {
width: 690rpx;
height: 320rpx;
}

File diff suppressed because it is too large Load Diff

@ -104,7 +104,7 @@ export default class Recording extends Component<any, any> {
let res = await InstrumentInfo.apiClock.getLatestClockRecord();
if (res.data.code === 200) {
if (!res.data.data) {
this.setShow(true);
// this.setShow(true);
} else {
let punchInInfo = {
clockImageList: res.data.data.clockImg,

@ -55,7 +55,9 @@ class Register extends Component<any, any> {
url: "/pages/index/index",
});
};
back() {
skipRegister() {
// 跳过注册
Taro.setStorageSync("skipRegister", true);
Taro.navigateBack({
delta: 1,
});
@ -161,6 +163,7 @@ class Register extends Component<any, any> {
componentDidHide() {}
async initData() {
console.log("MpSplashDetail Register");
const { data } = await MpSplashDetail({
pageNum: 1,
pageSize: 5,
@ -210,7 +213,7 @@ class Register extends Component<any, any> {
>
</Button>
<View className="text" onClick={this.back}>
<View className="text" onClick={this.skipRegister}>
&gt;
</View>
</View>

@ -77,10 +77,13 @@ page {
.infobox1 .info2 {
border-radius: 20rpx;
height: 200rpx;
margin: 40rpx 28rpx 0;
display: flex;
justify-content: space-between;
margin: 40rpx 28rpx 0 28rpx;
}
.infobox1 .info3 {
margin: 22rpx 30rpx 0;
margin: 0 30rpx;
margin-top: 22rpx;
font-size: 24rpx;
font-weight: 400;
color: #999999;
@ -98,8 +101,10 @@ page {
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: flex-start;
padding: 36rpx 0 26rpx 36rpx;
box-sizing: border-box;
margin-top: 0;
}
.infobox1 .info2 .block .bg_img {
@ -166,6 +171,7 @@ page {
width: 25%;
flex-direction: column;
position: relative;
margin-top: 0;
.img image {
width: 40rpx;
height: 40rpx;

@ -267,12 +267,12 @@ class User extends Component<any, any> {
)}
</View>
</View>
<View className="info2 flex aitems sa">
<View className="info2">
<View
style="margin-top:0"
className="block"
data-url="/pages/instrument_manage/index?isback=1"
onClick={this.goUrlNoRegister}
// onClick={this.devOpen}
>
<Image
className="bg_img"
@ -289,6 +289,7 @@ class User extends Component<any, any> {
<View className="txt"></View>
</View>
<View
style="margin-top:0"
className="block"
onClick={this.goUrlNoRegister}
data-url="/pages/integral_list/integral_list"
@ -308,10 +309,52 @@ class User extends Component<any, any> {
</View>
</View>
<View className="num">{userInfo.credit}</View>
{/* <View className="txt"></View> */}
<View className="txt"></View>
</View>
</View>
{/* <View className="info2 flex aitems sa">
<View
className="block"
data-url="/pages/instrument_manage/index?isback=1"
onClick={this.goUrlNoRegister}
>
<Image
className="bg_img"
src={require("../../img/device_bg.png")}
mode="aspectFill"
></Image>
<View className="tip flex aitems">
<View className="tip1"></View>
<View className="right">
<Image src="/img/my_right.png" mode="aspectFill" />
</View>
</View>
<View className="num">{userInfo.devicesNum}</View>
<View className="txt"></View>
</View>
<View
className="block"
onClick={this.goUrlNoRegister}
data-url="/pages/integral_list/integral_list"
>
<Image
className="bg_img"
src={require("../../img/point_bg.png")}
mode="aspectFill"
></Image>
<View className="tip flex aitems">
<View className="tip1"></View>
<View className="right">
<Image
src={require("../../img/my_right.png")}
mode="aspectFill"
/>
</View>
</View>
<View className="num">{userInfo.credit}</View>
<View className="txt"></View>
</View>
</View> */}
<View className="info3">
{lastDay} : {userInfo.expireCredit}
</View>
@ -358,7 +401,7 @@ class User extends Component<any, any> {
<View className="tip1"></View>
</View>
</View>
<View className="title2"></View>
<View className="title2"></View>
<View className="info flex aitems">
<View
className="block flex aitems"
@ -389,6 +432,7 @@ class User extends Component<any, any> {
</View>
<View className="tip1"></View>
</View>
<View className="block flex aitems">{/* 样式留空 */}</View>
{/* <View
className="block flex aitems"
data-url="/pages/privacyPolicy/privacyPolicy"

File diff suppressed because one or more lines are too long

@ -1,7 +1,8 @@
import Taro from "@tarojs/taro";
// var logger = Taro.getRealtimeLogManager ? Taro.getRealtimeLogManager() : null;
var logger = Taro.getRealtimeLogManager();
// var logger = Taro.getRealtimeLogManager();
var logger = console;
const log = {
debug() {

@ -51,7 +51,6 @@ export const Ajax = (params) => {
},
data: params.data,
success(res) {
// console.log("res", res);
if (res.data.code == 401 || res.data.code == 403) {
// 自动重新登录
Taro.removeStorageSync("token");
@ -59,14 +58,6 @@ export const Ajax = (params) => {
return;
}
// if (res.statusCode !== 200) {
// Taro.showModal({
// title: "提示",
// content: String("错误码:" + res.statusCode),
// showCancel: false,
// });
// return false;
// }
if (res.data.code === 500) {
let msg = "系统异常,请联系管理人员";
@ -148,7 +139,7 @@ export const AjaxUploadFile = (params, formData) => {
});
return false;
}
if (o.code !== 200) {
if (o.code !== 200 && o.code !== 204 && o.code !== 205) {
let msg =
typeof o.msg == "string" ? o.msg : "系统异常,请联系管理人员";
Taro.showModal({
@ -217,7 +208,7 @@ export const AjaxFormData = (params) => {
});
return false;
}
if (res.data.code !== 200) {
if (res.data.code !== 200 && o.code !== 204 && o.code !== 205) {
let msg =
typeof res.data.msg == "string"
? res.data.msg

Loading…
Cancel
Save