解决冲突

master
qsj 2 years ago
commit 9411acf843

@ -27,8 +27,8 @@ class App extends Component<PropsWithChildren> {
// 每次进入小程序,删除可能残留的同步状态 // 每次进入小程序,删除可能残留的同步状态
Taro.removeStorageSync("isSyncHistory"); Taro.removeStorageSync("isSyncHistory");
// go("/pages/instrument_clickin_upload/index"); // go("/instrument/pages/instrument_clickin_upload/index");
// go("/pages/instrument/intro"); // go("/instrument/pages/instrument/intro");
// Taro.switchTab({ // Taro.switchTab({
// url: "/pages/user/user", // url: "/pages/user/user",
// }); // });

@ -371,7 +371,7 @@ export default class Instrument extends Component<any, any> {
msg("绑定成功"); msg("绑定成功");
setTimeout(() => { setTimeout(() => {
setStorageSync("instrument_detail", JSON.stringify(channelInfo)); setStorageSync("instrument_detail", JSON.stringify(channelInfo));
go("/pages/instrument/intro?id=" + channelInfo.id); go("/instrument/pages/instrument/intro?id=" + channelInfo.id);
}, 1000); }, 1000);
} else if (res.data.code === 202) { } else if (res.data.code === 202) {
this.changeBindBox(); this.changeBindBox();
@ -403,7 +403,7 @@ export default class Instrument extends Component<any, any> {
msg("绑定成功"); msg("绑定成功");
setStorageSync("instrument_detail", JSON.stringify(channelInfo)); setStorageSync("instrument_detail", JSON.stringify(channelInfo));
setTimeout(() => { setTimeout(() => {
go("/pages/instrument/intro?id=" + channelInfo.id); go("/instrument/pages/instrument/intro?id=" + channelInfo.id);
}, 1000); }, 1000);
} else if (res.data.code === 202) { } else if (res.data.code === 202) {
this.changeBindBox(); this.changeBindBox();
@ -529,7 +529,7 @@ export default class Instrument extends Component<any, any> {
confirm={this.closeDev} confirm={this.closeDev}
/> */} /> */}
<Navbar <Navbar
titleSlot='仪器绑定' titleSlot="仪器绑定"
isBack isBack
isCustomBack isCustomBack
customBack={this.customBack} customBack={this.customBack}
@ -546,74 +546,74 @@ export default class Instrument extends Component<any, any> {
/> />
<PopupAlert <PopupAlert
isShow={isBindingError} isShow={isBindingError}
title='提示' title="提示"
content='序列号库仍在更新,请联系微信助手' content="序列号库仍在更新,请联系微信助手"
confirmButtonText='知道了' confirmButtonText="知道了"
textAlgin='center' textAlgin="center"
close={this.onBindErrorClose} close={this.onBindErrorClose}
confirm={this.onBindErrorConfirm} confirm={this.onBindErrorConfirm}
></PopupAlert> ></PopupAlert>
<PopupAlert <PopupAlert
isShow={isBindingError203} isShow={isBindingError203}
title='提示' title="提示"
content='序列码已被别人绑定,请联系微信助手' content="序列码已被别人绑定,请联系微信助手"
confirmButtonText='知道了' confirmButtonText="知道了"
textAlgin='center' textAlgin="center"
close={this.onBindErrorClose203} close={this.onBindErrorClose203}
confirm={this.onBindErrorConfirm203} confirm={this.onBindErrorConfirm203}
></PopupAlert> ></PopupAlert>
<PopupAlert <PopupAlert
isShow={isBindingCheckError} isShow={isBindingCheckError}
title='提示' title="提示"
content='您选择的仪器有误,请重新选择确认' content="您选择的仪器有误,请重新选择确认"
confirmButtonText='知道了' confirmButtonText="知道了"
textAlgin='center' textAlgin="center"
close={this.onBindCheckErrorClose} close={this.onBindCheckErrorClose}
confirm={this.onBindCheckErrorClose} confirm={this.onBindCheckErrorClose}
></PopupAlert> ></PopupAlert>
</View> </View>
<Canvas <Canvas
style='position: fixed;left:-10000px;max-width: 1024px;max-height: 768px;' style="position: fixed;left:-10000px;max-width: 1024px;max-height: 768px;"
id='compressImage' id="compressImage"
canvasId='compressImage' canvasId="compressImage"
type='2d' type="2d"
></Canvas> ></Canvas>
<View></View> <View></View>
<View className='main'> <View className="main">
<View className='top'> <View className="top">
<View className='top_title'></View> <View className="top_title"></View>
<View className='top_tips'> <View className="top_tips">
</View> </View>
<View className='top_tips'></View> <View className="top_tips"></View>
</View> </View>
<View className='banner_list'> <View className="banner_list">
{inputType === 1 ? ( {inputType === 1 ? (
<Video <Video
className='banner_item' className="banner_item"
autoplay autoplay
loop loop
objectFit='cover' objectFit="cover"
enablePlayGesture enablePlayGesture
showFullscreenBtn={false} showFullscreenBtn={false}
playBtnPosition='center' playBtnPosition="center"
src={channelInfo.manualCodeBinding} src={channelInfo.manualCodeBinding}
/> />
) : ( ) : (
<Image <Image
className='banner_item' className="banner_item"
src={channelInfo.scanCodeBinding} src={channelInfo.scanCodeBinding}
mode='aspectFill' mode="aspectFill"
></Image> ></Image>
)} )}
</View> </View>
<View className='form'> <View className="form">
<View className='form_item is-instrument'> <View className="form_item is-instrument">
<View className='label_box'> <View className="label_box">
<View <View
className='label' className="label"
style='font-size: 32rpx; margin: 0 0 0rpx 2rpx' style="font-size: 32rpx; margin: 0 0 0rpx 2rpx"
> >
<Text style={{ color: "#EB5858", marginLeft: "20rpx" }}> <Text style={{ color: "#EB5858", marginLeft: "20rpx" }}>
@ -624,10 +624,10 @@ export default class Instrument extends Component<any, any> {
<ScrollView <ScrollView
scrollX scrollX
className='instrument_list' className="instrument_list"
style='width: 100%; white-space: nowrap;' style="width: 100%; white-space: nowrap;"
scrollIntoView={"scroll" + channelInfo.id} scrollIntoView={"scroll" + channelInfo.id}
scrollIntoViewAlignment='center' scrollIntoViewAlignment="center"
> >
{equipmentList.length > 0 && {equipmentList.length > 0 &&
equipmentList.map((item, index) => { equipmentList.map((item, index) => {
@ -641,11 +641,11 @@ export default class Instrument extends Component<any, any> {
onClick={this.onSelectChange.bind(this, item)} onClick={this.onSelectChange.bind(this, item)}
> >
<Image <Image
className='instrument_img' className="instrument_img"
src={item.banner} src={item.banner}
mode='aspectFill' mode="aspectFill"
></Image> ></Image>
<View className='desc'>{item.name}</View> <View className="desc">{item.name}</View>
</View> </View>
); );
})} })}
@ -659,8 +659,8 @@ export default class Instrument extends Component<any, any> {
)} )}
</ScrollView> </ScrollView>
</View> </View>
<View className='form_item is-tab'> <View className="form_item is-tab">
<View className='tab_list'> <View className="tab_list">
<View <View
className={classnames("tab_item", { className={classnames("tab_item", {
"is-active": inputType === 1, "is-active": inputType === 1,
@ -668,7 +668,7 @@ export default class Instrument extends Component<any, any> {
onClick={this.onTabTap.bind(this, 1)} onClick={this.onTabTap.bind(this, 1)}
> >
<Text></Text> <Text></Text>
<View className='tab_active_line'></View> <View className="tab_active_line"></View>
</View> </View>
{channelInfo.isScanCode === 1 && ( {channelInfo.isScanCode === 1 && (
<View <View
@ -678,7 +678,7 @@ export default class Instrument extends Component<any, any> {
onClick={this.onTabTap.bind(this, 2)} onClick={this.onTabTap.bind(this, 2)}
> >
<Text></Text> <Text></Text>
<View className='tab_active_line'></View> <View className="tab_active_line"></View>
</View> </View>
)} )}
</View> </View>
@ -686,38 +686,38 @@ export default class Instrument extends Component<any, any> {
{inputType == 1 && ( {inputType == 1 && (
<Block> <Block>
<View className='inputCode_box'> <View className="inputCode_box">
<View className='form_item is-inputCode'> <View className="form_item is-inputCode">
<View className='label_box'> <View className="label_box">
<View className='label'> <View className="label">
<Text style={{ color: "#EB5858", marginLeft: "20rpx" }}> <Text style={{ color: "#EB5858", marginLeft: "20rpx" }}>
* *
</Text> </Text>
</View> </View>
<View className='label_text' onClick={this.onTipShow}> <View className="label_text" onClick={this.onTipShow}>
<Text className='label-tips'></Text> <Text className="label-tips"></Text>
<Image <Image
className='right_icon' className="right_icon"
src={require("@/img/index-right.png")} src={require("@/img/index-right.png")}
mode='aspectFill' mode="aspectFill"
/> />
</View> </View>
</View> </View>
<View className='ipt_box'> <View className="ipt_box">
<Input <Input
maxlength={50} maxlength={50}
className='ipt' className="ipt"
placeholder='例如FR10*********1' placeholder="例如FR10*********1"
placeholder-style={style} placeholder-style={style}
onInput={this.onSerial} onInput={this.onSerial}
value={channelInfo.serialCode} value={channelInfo.serialCode}
></Input> ></Input>
</View> </View>
</View> </View>
<View className='form_item'> <View className="form_item">
<View className='label_box'> <View className="label_box">
<View className='label'> <View className="label">
<Text style={{ color: "#EB5858", marginLeft: "20rpx" }}> <Text style={{ color: "#EB5858", marginLeft: "20rpx" }}>
* *
@ -725,20 +725,20 @@ export default class Instrument extends Component<any, any> {
</View> </View>
</View> </View>
<View <View
className='photo_box' className="photo_box"
onClick={this.onChangeImg.bind(this)} onClick={this.onChangeImg.bind(this)}
> >
{channelInfo.serialImage && ( {channelInfo.serialImage && (
<Image <Image
src={channelInfo.serialImage} src={channelInfo.serialImage}
mode='aspectFill' mode="aspectFill"
></Image> ></Image>
)} )}
{!channelInfo.serialImage && ( {!channelInfo.serialImage && (
<Image <Image
className='add' className="add"
src={require("@/img/welcome/add.png")} src={require("@/img/welcome/add.png")}
mode='aspectFit' mode="aspectFit"
></Image> ></Image>
)} )}
</View> </View>
@ -748,10 +748,10 @@ export default class Instrument extends Component<any, any> {
)} )}
</View> </View>
</View> </View>
<View className='footer'> <View className="footer">
{inputType == 1 && ( {inputType == 1 && (
<View <View
className='btn' className="btn"
onClick={throttle(this.onSubmit.bind(this), 300)} onClick={throttle(this.onSubmit.bind(this), 300)}
> >
@ -759,9 +759,9 @@ export default class Instrument extends Component<any, any> {
)} )}
{inputType == 2 && ( {inputType == 2 && (
<View className='btn footer-btn-scan' onClick={this.onScanTap}> <View className="btn footer-btn-scan" onClick={this.onScanTap}>
<Image <Image
className='footer-btn-scan-img' className="footer-btn-scan-img"
src={require("@/img/icon-scan.png")} src={require("@/img/icon-scan.png")}
></Image> ></Image>

@ -1,109 +1,122 @@
.footer { .intro {
position: fixed; .intro-main {
bottom: 0; position: relative;
background: #fff; overflow: hidden;
flex-direction: column; }
width: 100%; .footer {
padding-bottom: 30rpx; position: fixed;
// padding-bottom: env(safe-area-inset-bottom); bottom: 0;
} background: #fff;
flex-direction: column;
width: 100%;
padding-bottom: 30rpx;
// padding-bottom: env(safe-area-inset-bottom);
}
.footer .btn { .footer .btn {
width: 690rpx; width: 690rpx;
height: 90rpx; height: 90rpx;
background: #000; background: #000;
border-radius: 45rpx; border-radius: 45rpx;
text-align: center; text-align: center;
line-height: 90rpx; line-height: 90rpx;
font-size: 32rpx; font-size: 32rpx;
font-family: PingFang SC; font-family: PingFang SC;
font-weight: bold; font-weight: bold;
color: #ffffff; color: #ffffff;
} }
.footer .text { .footer .text {
background: transparent; background: transparent;
font-size: 32rpx; font-size: 32rpx;
font-family: PingFang SC; font-family: PingFang SC;
font-weight: bold; font-weight: bold;
color: #000000; color: #000000;
} }
.main { .main {
height: 100vh; height: 100vh;
text-align: center; text-align: center;
margin-top: 34rpx; margin-top: 34rpx;
padding-bottom: calc(env(safe-area-inset-bottom) + 180rpx); // padding-bottom: calc(env(safe-area-inset-bottom) + 180rpx);
} }
.cover { .cover {
display: block; // 消除默认间距 display: block; // 消除默认间距
width: 660rpx; width: 660rpx;
height: 922rpx; height: 922rpx;
border-radius: 50rpx; border-radius: 50rpx;
} margin: 0 auto;
}
.content { .content {
display: block; // 消除默认间距 display: block; // 消除默认间距
width: 660rpx; width: 660rpx;
// height: 474rpx; // height: 474rpx;
height: 488rpx; height: 488rpx;
background: linear-gradient(rgba(204, 204, 204, 0.4), #fff); background: linear-gradient(rgba(204, 204, 204, 0.4), #fff);
border-radius: 50rpx; border-radius: 50rpx;
margin-top: 7rpx; margin: 0 auto;
} margin-top: 7rpx;
}
.title { .title {
font-size: 48rpx; font-size: 48rpx;
font-family: PingFang SC; font-family: PingFang SC;
font-weight: 500; font-weight: 500;
color: #000; color: #000;
text-align: center; text-align: center;
padding-bottom: 30rpx; padding-bottom: 30rpx;
padding-top: 84rpx; padding-top: 84rpx;
} }
.text { .text {
font-size: 26rpx; font-size: 26rpx;
font-weight: 500; font-weight: 500;
color: #666; color: #666;
} }
// .indicator { // .indicator {
// position: absolute; // position: absolute;
// left: 50%; // left: 50%;
// top: 960rpx; // top: 960rpx;
// transform: translate(-50%, -50%); // transform: translate(-50%, -50%);
// width: 120rpx; // width: 120rpx;
// height: 1rpx; // height: 1rpx;
// background: #ccc; // background: #ccc;
// } // }
// .dot { // .dot {
// height: 100%; // height: 100%;
// background: #000; // background: #000;
// transition-property: all; // transition-property: all;
// transition-duration: 0.8s; // transition-duration: 0.8s;
// } // }
.indicator { .indicator {
position: absolute; position: absolute;
left: 50%; left: 50%;
top: 960rpx; // top: 960rpx;
transform: translate(-50%, -50%); top: 990rpx;
display: inline-flex; transform: translate(-50%, -50%);
width: 360rpx;
height: 1px;
background: transparent;
.dot {
display: inline-flex; display: inline-flex;
flex: 1; width: 360rpx;
height: 100%; height: 1px;
background: #f2f2f2; background: transparent;
transition-duration: 0.5s; .dot {
margin-right: 4rpx; display: inline-flex;
transition: all 0.6s ease-in-out 0.1s; flex: 1;
} height: 100%;
.bg-show { background: #f2f2f2;
background: #000; transition-duration: 0.5s;
margin-right: 4rpx;
transition: all 0.6s ease-in-out 0.1s;
}
.only-dot {
width: 120rpx;
margin: 0 auto;
}
.bg-show {
background: #000;
}
} }
} }

@ -37,6 +37,7 @@ class Intro extends Component<any, any> {
super(props); super(props);
this.state = { this.state = {
name: "仪器介绍页", name: "仪器介绍页",
navHeight: 0,
current: 0, current: 0,
instrument: {}, instrument: {},
introList: [], introList: [],
@ -61,7 +62,9 @@ class Intro extends Component<any, any> {
} }
$instance = Taro.getCurrentInstance(); $instance = Taro.getCurrentInstance();
async onLoad() {} async onLoad() {
this.setStatusBar();
}
componentDidMount() { componentDidMount() {
let strObj = getStorageSync("instrument_detail"); let strObj = getStorageSync("instrument_detail");
if (strObj) { if (strObj) {
@ -82,13 +85,32 @@ class Intro extends Component<any, any> {
componentDidHide() {} componentDidHide() {}
setStatusBar() {
Taro.getSystemInfoAsync({
success: (res) => {
const statusBarHeight = res.statusBarHeight || 0;
// 获取微信胶囊的位置信息 width,height,top,right,left,bottom
const custom = Taro.getMenuButtonBoundingClientRect();
// 导航栏高度(标题栏高度) = 胶囊高度 + (顶部距离 - 状态栏高度) * 2
const navigationBarHeight =
custom.height + (custom.top - statusBarHeight) * 2;
// 总体高度 = 状态栏高度 + 导航栏高度
const navHeight = (navigationBarHeight + statusBarHeight) * 2;
this.setState({
navHeight,
});
},
});
}
async initData() {} async initData() {}
onChange(event) { onChange = (event) => {
console.info("onchange", event); console.info("onchange", event);
// const current = event.detail.current; const current = event.detail.current;
// this.setState({ current }); this.setState({ current });
} };
// 获取设备信息 // 获取设备信息
getInstrumentInfo = async (id) => { getInstrumentInfo = async (id) => {
@ -152,7 +174,7 @@ class Intro extends Component<any, any> {
if (this.state.connectInstrument.type === 1) { if (this.state.connectInstrument.type === 1) {
//非IOT //非IOT
setTimeout(() => { setTimeout(() => {
go("/pages/instrumentClickinUpload/index"); go("/instrument/pages/instrumentClickinUpload/index");
}, 10); }, 10);
} else { } else {
Taro.getSystemInfo({ Taro.getSystemInfo({
@ -329,6 +351,7 @@ class Intro extends Component<any, any> {
isShowVersionUpgrading, isShowVersionUpgrading,
isShowVersionUpgradFinish, isShowVersionUpgradFinish,
versionUpgradFinishNodes, versionUpgradFinishNodes,
navHeight,
} = this.state; } = this.state;
return ( return (
<Block> <Block>
@ -425,62 +448,81 @@ class Intro extends Component<any, any> {
/> />
{/* IOT相关弹窗 END */} {/* IOT相关弹窗 END */}
</View> </View>
<View style="position: relative"> <View className="intro">
<Swiper <View
className="main" className="intro-main"
current={current} style={{ height: "calc(100vh - " + navHeight + "rpx)" }}
onChange={this.onChange}
duration={800}
indicatorDots={false}
indicatorColor="#999"
indicatorActiveColor="#333"
previousMargin="32rpx"
nextMargin="32rpx"
> >
{introList.map((item: any, index: number) => { <Swiper
return ( className="main"
<SwiperItem key={index}> current={current}
{item.fileType === "video" ? ( onChange={this.onChange}
<Video className="cover" src={item.file} /> duration={800}
) : ( indicatorDots={false}
<Image indicatorColor="#999"
className="cover" indicatorActiveColor="#333"
src={item.file} previousMargin={introList.length > 1 ? "32rpx" : "0px"}
mode="aspectFill" nextMargin={introList.length > 1 ? "32rpx" : "0px"}
></Image> >
)} {introList.map((item: any, index: number) => {
<View className="content">
<View className="title">{instrument.name}</View>
<View className="text">{item.message}</View>
</View>
</SwiperItem>
);
})}
</Swiper>
{introList.length && (
<View className="indicator">
{introList.map((_item, index) => {
return ( return (
<View <SwiperItem key={index}>
key={"indicator_" + index} {item.fileType === "video" ? (
className={classnames("dot", { <Video className="cover" src={item.file} />
"bg-show": current === index, ) : (
})} <Image
/> className="cover"
src={item.file}
mode="aspectFill"
></Image>
)}
<View className="content">
<View className="title">{instrument.name}</View>
<View className="text">{item.message}</View>
</View>
</SwiperItem>
); );
})} })}
</View> </Swiper>
)}
</View> {introList.length > 1 && (
<View className="indicator">
<View className="footer flex aitems jcenter"> {introList.map((_item, index) => {
<View className="btn" onClick={this.goNursing}> return (
<View
key={"indicator_" + index}
className={classnames("dot", {
"bg-show": current === index,
})}
/>
);
})}
</View>
)}
{introList.length === 1 && (
<View className="indicator">
{introList.map((_item, index) => {
return (
<View
key={"indicator_" + index}
className={classnames("only-dot", {
"bg-show": current === index,
})}
/>
);
})}
</View>
)}
</View> </View>
<View className="btn text" onClick={this.toHomePage}>
<View className="footer flex aitems jcenter">
<View className="btn" onClick={this.goNursing}>
</View>
<View className="btn text" onClick={this.toHomePage}>
</View>
</View> </View>
</View> </View>
</Block> </Block>

@ -15,6 +15,7 @@ page {
.un_bind_list { .un_bind_list {
width: 100%; width: 100%;
white-space: nowrap; white-space: nowrap;
box-sizing: border-box;
// margin-left: 37rpx; // margin-left: 37rpx;
} }
@ -24,6 +25,7 @@ page {
.bind_list { .bind_list {
height: 650rpx; height: 650rpx;
.wrapper { .wrapper {
display: inline-block; display: inline-block;
position: relative; position: relative;
@ -83,13 +85,16 @@ page {
} }
} }
} }
.backColer{ .backColer {
background: linear-gradient(to bottom, #e3e3e3, #f8f8f8); background: linear-gradient(to bottom, #e3e3e3, #f8f8f8);
height: 211rpx; height: 211rpx;
padding: 0rpx 0rpx; padding: 0rpx 0rpx;
border-radius: 50px; border-radius: 50px;
box-sizing: border-box;
} }
.bind_cont { .bind_cont {
box-sizing: border-box;
overflow: hidden;
.title { .title {
text-align: center; text-align: center;
font-size: 36rpx; font-size: 36rpx;

@ -92,17 +92,17 @@ export default class InstrumentManage extends Component<any, any> {
setStorageSync("instrument_detail", item); setStorageSync("instrument_detail", item);
let bindid = item.id; let bindid = item.id;
go("/pages/instrument/intro?id=" + bindid); go("/instrument/pages/instrument/intro?id=" + bindid);
}; };
goBind = (item) => { goBind = (item) => {
let bindid = item.id; let bindid = item.id;
go("/pages/instrument/instrument?isOnly=true&id=" + bindid); // 只显示当前仪器内容 go("/instrument/pages/instrument/instrument?isOnly=true&id=" + bindid); // 只显示当前仪器内容
}; };
goBindInfo = (item) => { goBindInfo = (item) => {
// let bindid = item.id; // let bindid = item.id;
setStorageSync("instrument_detail", item); setStorageSync("instrument_detail", item);
go("/pages/instrument_detail/index"); go("/instrument/pages/instrument_detail/index");
}; };
lesgobuy = (item) => { lesgobuy = (item) => {

@ -707,13 +707,17 @@ class IotCarePlanFR200 extends Component<any, any> {
/** FR200模式类型名称 */ /** FR200模式类型名称 */
ModeTypeArray: string[] = [ ModeTypeArray: string[] = [
"all", "all",
"Base", "base",
"Zone", "eyes",
"Permeation", "zone",
"Sensitive", "permeation",
"Intelligence", "sensitive",
"intelligence",
]; ];
/** 基础版:脸部/眼部 */
BaseModeType: string[] = ["face", "eyes"];
async onLoad() { async onLoad() {
// 保持屏幕常亮 // 保持屏幕常亮
Taro.setKeepScreenOn({ Taro.setKeepScreenOn({
@ -969,7 +973,7 @@ class IotCarePlanFR200 extends Component<any, any> {
return false; return false;
} }
if (this.isRuning === true && this.state.DeviceConnectStatus == 1) { if (this.isRuning && this.state.DeviceConnectStatus == 1) {
// 提示切换护理模式 // 提示切换护理模式
if (this.isCheckNurseTime()) { if (this.isCheckNurseTime()) {
// 满足时间条件,提示是否保存部分护理记录 // 满足时间条件,提示是否保存部分护理记录
@ -1229,13 +1233,15 @@ class IotCarePlanFR200 extends Component<any, any> {
this.state.DeviceConnectStatus === 1 && this.state.DeviceConnectStatus === 1 &&
jsonStatus.workStatus !== MODE_WORKING_ENUM.END jsonStatus.workStatus !== MODE_WORKING_ENUM.END
) { ) {
this.updateDeviceSyncData( // 水分测试手动检测时间,不自动计算倒计时
{ if (jsonStatus?.workMode !== "moistureTest")
totalWorkingMinutes: jsonStatus.totalWorkingMinutes, this.updateDeviceSyncData(
totalWorkingSeconds: jsonStatus.totalWorkingSeconds, {
}, totalWorkingMinutes: jsonStatus.totalWorkingMinutes,
jsonStatus totalWorkingSeconds: jsonStatus.totalWorkingSeconds,
); },
jsonStatus
);
} }
} }
} }
@ -1276,7 +1282,7 @@ class IotCarePlanFR200 extends Component<any, any> {
// 仅当设备模式与小程序是否一致,才允许更改设备运行时间 // 仅当设备模式与小程序是否一致,才允许更改设备运行时间
if ( if (
this.state.DeviceConnectStatus === 1 && this.state.DeviceConnectStatus === 1 &&
this.isRuning == 2 && this.isRuning &&
jsonStatus.workStatus !== MODE_WORKING_ENUM.END jsonStatus.workStatus !== MODE_WORKING_ENUM.END
) { ) {
this.updateDeviceSyncData( this.updateDeviceSyncData(
@ -1403,7 +1409,7 @@ class IotCarePlanFR200 extends Component<any, any> {
if ( if (
sceneTime > totalTime && sceneTime > totalTime &&
this.isRuning === true && this.isRuning &&
this.state.DeviceConnectStatus == 1 this.state.DeviceConnectStatus == 1
) { ) {
// 界面倒计时同步设备时间 // 界面倒计时同步设备时间
@ -1448,7 +1454,7 @@ class IotCarePlanFR200 extends Component<any, any> {
* params * params
*/ */
judgementWorkStatus(nWorkStatus, nWorkMode) { judgementWorkStatus(nWorkStatus, nWorkMode) {
const { workMode, ActiveModeItem, ModeList } = this.state; const { ActiveModeItem, ModeList } = this.state;
const opts: any = {}; const opts: any = {};
// ActiveModeItem // ActiveModeItem
let nowModeItem; let nowModeItem;
@ -1475,25 +1481,18 @@ class IotCarePlanFR200 extends Component<any, any> {
this.setState({ this.setState({
isShowCountdown: false, isShowCountdown: false,
}); });
if (nowModeItem?.isCabinMode && this.isRuning === true) {
opts.currentTime = nowCurrentTime;
} else if (!nowModeItem?.isCabinMode && this.isRuning === true) {
// fix: 启动非支架模式倒计时时连上支架仪器的状态变为standby
this.isRuning === false;
}
}, },
setting: () => { setting: () => {
// that.data.hadShowBreakTips = false;
this.setState({ this.setState({
hadShowBreakTips: false, hadShowBreakTips: false,
}); });
if (this.isRuning === false && !ActiveModeItem.isCabinMode) { if (!this.isRuning && !ActiveModeItem.isCabinMode) {
this.isRuning = true; this.isRuning = true;
this.setState({ this.setState({
title: "正在护理", title: "正在护理",
isStopNurse: false, isStopNurse: false,
}); });
} else if (this.isRuning === false && ActiveModeItem.isCabinMode) { } else if (!this.isRuning && ActiveModeItem.isCabinMode) {
this.isRuning = true; this.isRuning = true;
// this.setState({ // this.setState({
// title: "正在护理", // title: "正在护理",
@ -1672,11 +1671,20 @@ class IotCarePlanFR200 extends Component<any, any> {
} }
} }
const sendParams = { let sendParams: any = {
...deviceCommandSamples.pause, ...deviceCommandSamples.pause,
workMode: ActiveModeItem.modeType, // 使用模式 workMode: ActiveModeItem.modeType, // 使用模式
workStatus: newWorkStatus, workStatus: newWorkStatus,
}; };
// 水分测试需要特殊处理
if (ActiveModeItem.modeType === "moistureTest") {
sendParams.testStatus = "standby"; // 切换为准备
if (isBtnClick) {
sendParams.testStatus = "start"; // 点击开始再开始
}
}
console.log("准备发送自定义或工作指令", ActiveModeItem, sendParams); console.log("准备发送自定义或工作指令", ActiveModeItem, sendParams);
const pauseArrayBuffer = deviceToolKitInstance.toBleCommand( const pauseArrayBuffer = deviceToolKitInstance.toBleCommand(
sendParams as any sendParams as any
@ -2037,6 +2045,7 @@ class IotCarePlanFR200 extends Component<any, any> {
this.setFR200NursingHistory(jsonStatus); this.setFR200NursingHistory(jsonStatus);
} }
}; };
// 改变模式时清空dataArray防止数据无限叠加
changeItemUpdateFR200NursingHistory() { changeItemUpdateFR200NursingHistory() {
this.FR200NursingHistory = Taro.getStorageSync("FR200NursingHistory"); this.FR200NursingHistory = Taro.getStorageSync("FR200NursingHistory");
if (this.FR200NursingHistory) { if (this.FR200NursingHistory) {
@ -2052,15 +2061,11 @@ class IotCarePlanFR200 extends Component<any, any> {
*/ */
rmFR200NursingHistory = (FR200NursingHistory, hard = false) => { rmFR200NursingHistory = (FR200NursingHistory, hard = false) => {
const nowFR200NursingHistory = Taro.getStorageSync("FR200NursingHistory"); const nowFR200NursingHistory = Taro.getStorageSync("FR200NursingHistory");
if (nowFR200NursingHistory) {
Taro.setStorageSync("FR200Echart", nowFR200NursingHistory); // 临时保存用于观看和调试 Taro.setStorageSync("FR200Echart", nowFR200NursingHistory); // 临时保存用于观看和调试
if (nowFR200NursingHistory.id == FR200NursingHistory.id) {
Taro.removeStorageSync("FR200NursingHistory");
this.FR200NursingHistory.id = "";
} else if (hard) {
Taro.removeStorageSync("FR200NursingHistory");
this.FR200NursingHistory.id = "";
} }
Taro.removeStorageSync("FR200NursingHistory");
}; };
// todoPromise = () => { // todoPromise = () => {

@ -14,10 +14,13 @@ interface Props {
facialMaskConnectStatus: any; facialMaskConnectStatus: any;
} }
function Index() { function Index() {
const echartsRef = useRef<EchartsHandle>(null); const echartsRef = useRef<EchartsHandle>(null);
const option: EChartOption = { const option: EChartOption = {
grid: { grid: {
// 让图表占满容器 // 让图表占满容器
top: "28rpx", top: "28rpx",
@ -25,6 +28,13 @@ function Index() {
right: "28rpx", right: "28rpx",
bottom: "17rpx", bottom: "17rpx",
}, },
// legend: {
// itemStyle: {
// decal: {
// rotation: 90
// }
// }
// },
xAxis: { xAxis: {
// name: '', // name: '',
// nameGap: 5, // nameGap: 5,
@ -251,12 +261,28 @@ function Index() {
}; };
const level = [8, 7, 6, 5, 4, 3, 2]; const level = [8, 7, 6, 5, 4, 3, 2];
const full = () => {
let box = document.getElementById("box");
box?.classList.add('fullscreen')
}
// const quanping = () => {
// T.setPageOrientation({
// orientation: "portrait",
// });
// // taro.setPageOrientation({
// // orientation: "landscape",
// // });
// },
return ( return (
<Block> <Block>
<View className='box'> <View id='box' className='box'>
<Echarts <Echarts
force-use-old-canvas="false" force-use-old-canvas='false'
echarts={echarts} echarts={echarts}
option={option} option={option}
ref={echartsRef} ref={echartsRef}
@ -265,7 +291,7 @@ function Index() {
style={{ width: "630rpx", height: "260rpx", zIndex: 1 }} style={{ width: "630rpx", height: "260rpx", zIndex: 1 }}
/> />
<View className='box_background'> <View className='box_background'>
<Image className='full' src={require("@/img/full-scran.png")}></Image> <Image className='full' src={require("@/img/full-scran.png")} onClick={full}></Image>
<View className='power'></View> <View className='power'></View>
{level.map((item) => ( {level.map((item) => (
<View className='line' key={item}> <View className='line' key={item}>
@ -279,7 +305,7 @@ function Index() {
<View className='time'></View> <View className='time'></View>
</View> </View>
</View> </View>
</Block> </Block >
); );
} }

@ -9,48 +9,48 @@ import echarts from "@/utils/echarts.min.js";
import "./index.less"; import "./index.less";
interface Props { interface Props {
Electricity: any; Electricity: any;
matrixElectricity: any; matrixElectricity: any;
facialMaskConnectStatus: any; facialMaskConnectStatus: any;
} }
function Index() { function Index() {
const echartsRef = useRef<EchartsHandle>(null); const echartsRef = useRef<EchartsHandle>(null);
function generateColorArray(startColor, endColor, steps) { function generateColorArray(startColor, endColor, steps) {
var startRGB = hexToRgb(startColor); var startRGB = hexToRgb(startColor);
var endRGB = hexToRgb(endColor); var endRGB = hexToRgb(endColor);
var colors = []; var colors = [];
for (var i = 0; i < steps; i++) { for (var i = 0; i < steps; i++) {
var r = interpolate(startRGB.r, endRGB.r, steps, i); var r = interpolate(startRGB.r, endRGB.r, steps, i);
var g = interpolate(startRGB.g, endRGB.g, steps, i); var g = interpolate(startRGB.g, endRGB.g, steps, i);
var b = interpolate(startRGB.b, endRGB.b, steps, i); var b = interpolate(startRGB.b, endRGB.b, steps, i);
colors.push(rgbToHex(r, g, b)); colors.push(rgbToHex(r, g, b));
}
return colors;
} }
return colors;
}
function hexToRgb(hex) { function hexToRgb(hex) {
var bigint = parseInt(hex.slice(1), 16); var bigint = parseInt(hex.slice(1), 16);
var r = (bigint >> 16) & 255; var r = (bigint >> 16) & 255;
var g = (bigint >> 8) & 255; var g = (bigint >> 8) & 255;
var b = bigint & 255; var b = bigint & 255;
return { r: r, g: g, b: b }; return { r: r, g: g, b: b };
} }
function rgbToHex(r, g, b) { function rgbToHex(r, g, b) {
return ( return (
"#" + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1) "#" + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1)
); );
} }
function interpolate(start, end, steps, count) { function interpolate(start, end, steps, count) {
return start + ((end - start) / steps) * count; return start + ((end - start) / steps) * count;
} }
const startColor = "#FFFF00"; // 黄色 const startColor = "#FFFF00"; // 黄色
const endColor = "#FF0000"; // 红色 const endColor = "#FF0000"; // 红色
const steps = 80; // 80个颜色 const steps = 80; // 80个颜色
const colors = generateColorArray(startColor, endColor, steps); const colors = generateColorArray(startColor, endColor, steps);
@ -98,274 +98,82 @@ const seriesData = [
color: '#999999', // 文字颜色 color: '#999999', // 文字颜色
fontSize: 8 // 文字大小 fontSize: 8 // 文字大小
}, },
}, },
axisTick: { axisTick: {
// alignWithLabel: true, // alignWithLabel: true,
show: false, show: false,
interval: 9, interval: 9,
}, },
// axisLine: { // axisLine: {
// show: false, // show: false,
// }, // },
}, },
yAxis: [ yAxis: [
{ {
min: 0, min: 0,
max: 80, max: 80,
splitNumber: 10, splitNumber: 10,
axisLabel: { axisLabel: {
formatter: function (value, index) { formatter: function (value, index) {
const num = value / 10 + 1 const num = value / 10 + 1
return num === 9 ? '' : num + '级'; return num === 9 ? '' : num + '级';
}, },
textStyle: { textStyle: {
color: '#999999', // 文字颜色 color: '#999999', // 文字颜色
fontSize: 8 // 文字大小 fontSize: 8 // 文字大小
}, },
}, },
type: "value", type: "value",
splitLine: { splitLine: {
lineStyle: { lineStyle: {
color: ["#ccc", "#ccc", "#ccc", "#ccc", "#ccc", "#ccc", "#ccc", "#ccc", "#fff"], color: ["#ccc", "#ccc", "#ccc", "#ccc", "#ccc", "#ccc", "#ccc", "#ccc", "#fff"],
type:'dashed' type: 'dashed'
}, },
} }
}, },
], ],
series: [ series: [
{ {
barCategoryGap:'0%', barCategoryGap: '0%',
data: seriesData, data: seriesData,
type: "bar", type: "bar",
// barWidth: 15, // barWidth: 15,
gapWidth: "0%", gapWidth: "0%",
itemStyle: { itemStyle: {
normal: { normal: {
color: function (params) { color: function (params) {
var value = params.data; var value = params.data;
return new echarts.graphic.LinearGradient(0, 0, 0, 1, [ return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ {
offset: 0, offset: 0,
color: colors[parseInt(value)], // 红色 color: colors[parseInt(value)], // 红色
}, },
{ {
offset: 1, offset: 1,
color: colors[0], // 黄色 color: colors[0], // 黄色
}, },
]);; ]);;
}, },
}, },
}, },
}, },
], ],
}; };
// const option: EChartOption = { let arr = [2, 3, 4, 5, 6, 7]
// grid: { return (
// // 让图表占满容器 <Block>
// top: "28rpx", <Echarts
// left: "18rpx", echarts={echarts}
// right: "28rpx", option={option}
// bottom: "17rpx", ref={echartsRef}
// }, // isPage={false}
// xAxis: [ // style自定义设置echarts宽高
// { // style={{ width: "100%", height: "100%" }}
// type: 'category', style={{ width: "630rpx", height: "260rpx" }}
// axisTick: { show: false }, />
// data: ['2012', '2013', '2014', '2015', '2016'],
// axisLine: {
// show: false,
// },
// axisLabel: {
// show: false,
// },
// }
// ],
// 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,
// },
// },
// series: [
// { barCategoryGap:'0%',
// name: 'Forest',
// type: 'bar',
// barGap: 0,
// // label: labelOption,
// // emphasis: {
// // focus: 'series'
// // },
// data: [2, 4, 4, 5, 7]
// },
// { barCategoryGap:'0%',
// name: 'Steppe',
// type: 'bar',
// // label: labelOption,
// emphasis: {
// focus: 'series'
// },
// data: [2, 4, 4, 5, 7]
// },
// { barCategoryGap:'0%',
// name: 'Desert',
// type: 'bar',
// // label: labelOption,
// // emphasis: {
// // focus: 'series'
// // },
// data: [2, 4, 4, 5, 7]
// },
// { barCategoryGap:'0%',
// name: 'Wetland',
// type: 'bar',
// // label: labelOption,
// // emphasis: {
// // focus: 'series'
// // },
// data: [2, 4, 4, 5, 7]
// },
// { barCategoryGap:'0%',
// name: 'demo1',
// type: 'bar',
// // label: labelOption,
// // emphasis: {
// // focus: 'series'
// // },
// data: [2, 4, 4, 5, 7]
// },
// { barCategoryGap:'0%',
// name: 'demo2',
// type: 'bar',
// // label: labelOption,
// // emphasis: {
// // focus: 'series'
// // },
// data: [2, 4, 4, 5, 7]
// },
// { barCategoryGap:'0%',
// name: 'demo3',
// type: 'bar',
// // label: labelOption,
// // emphasis: {
// // focus: 'series'
// // },
// data: [2, 4, 4, 5, 7]
// },
// { barCategoryGap:'0%',
// name: 'demo4',
// type: 'bar',
// // label: labelOption,
// // emphasis: {
// // focus: 'series'
// // },
// data: [2, 4, 4, 5, 7]
// },
// { barCategoryGap:'0%',
// name: 'demo5',
// type: 'bar',
// // label: labelOption,
// // emphasis: {
// // focus: 'series'
// // },
// data: [2, 4, 4, 5, 7]
// },
// {
// color:'red',
// barCategoryGap:'0%',
// name: 'demo6',
// type: 'bar',
// // label: labelOption,
// // emphasis: {
// // focus: 'series'
// // },
// data: [2, 4, 4, 5, 7]
// }
// ]
// // grid: {
// // // 让图表占满容器
// // top: "28rpx",
// // left: "18rpx",
// // right: "28rpx",
// // bottom: "17rpx",
// // },
// // xAxis: {
// // type: 'category',
// // // data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
// // show: false,
// // // axisLine: {
// // // show: false,
// // // },
// // },
// // yAxis: {
// // type: "value",
// // min: 0,
// // max: 50,
// // splitNumber: 10,
// // splitLine: {
// // show: false,
// // // lineStyle: {
// // // color: "#cccccc",
// // // type: [4, 2],
// // // dashOffset: 4,
// // // },
// // },
// // axisLine: {
// // show: false,
// // },
// // axisLabel: {
// // show: false,
// // },
// // axisTick: {
// // show: false,
// // },
// // },
// // series: [
// // {
// // data: [1, 6, 3, 4, 7, 6, 0,8, 0, 10, 11, 12, 13, 14,15, 16, 17, 18, 19, 20, 21,22, 23, 24, 25, 26, 27, 28,29, 30, 31, 32, 33, 34, 35,36],
// // type: 'bar',
// // barWidth:30, //设置柱子的宽度
// // barGap:'100%',
// // barCategoryGap:'0%',
// // }
// // ]
// };
const level = [8, 7, 6, 5, 4, 3, 2]; {/* <View className="box">
let arr =[2,3,4,5,6,7]
return (
<Block>
<Echarts
echarts={echarts}
option={option}
ref={echartsRef}
// isPage={false}
// style自定义设置echarts宽高
// style={{ width: "100%", height: "100%" }}
style={{ width: "630rpx", height: "260rpx" }}
/>
{/* <View className="box">
<Echarts <Echarts
echarts={echarts} echarts={echarts}
option={option} option={option}
@ -377,9 +185,9 @@ const seriesData = [
</View> */} </View> */}
</Block> </Block>
); );
} }
export default Index; export default Index;

@ -57,7 +57,7 @@ function Index({
</View> </View>
)} )}
{BaseList.length > 0 && {BaseList.length > 0 &&
(ModeType === "all" || ModeType === "Base" || isPop) && ( (ModeType === "all" || ModeType === "base" || isPop) && (
<ScrollView <ScrollView
className="mode-list-box" className="mode-list-box"
scroll-x="true" scroll-x="true"
@ -68,8 +68,8 @@ function Index({
{BaseList.map((item: any, index: any) => { {BaseList.map((item: any, index: any) => {
return ( return (
<View <View
key={"Base_" + index} key={"base_" + index}
id={"Base_" + item.id} id={"base_" + item.id}
className={classnames("mode-item", { className={classnames("mode-item", {
"mode-item-active": activeModeID === item.id, "mode-item-active": activeModeID === item.id,
})} })}
@ -115,7 +115,7 @@ function Index({
</ScrollView> </ScrollView>
)} )}
{ZoneList.length > 0 && {ZoneList.length > 0 &&
(ModeType === "all" || ModeType === "Zone" || isPop) && ( (ModeType === "all" || ModeType === "zone" || isPop) && (
<ScrollView <ScrollView
className="mode-list-box" className="mode-list-box"
scrollX={true} scrollX={true}
@ -126,8 +126,8 @@ function Index({
{ZoneList.map((item: any, index: any) => { {ZoneList.map((item: any, index: any) => {
return ( return (
<View <View
key={"Zone_" + index} key={"zone_" + index}
id={"Zone_" + item.id} id={"zone_" + item.id}
onClick={onItemClick.bind(this, item)} onClick={onItemClick.bind(this, item)}
className={classnames("mode-item", { className={classnames("mode-item", {
"mode-item-active": activeModeID === item.id, "mode-item-active": activeModeID === item.id,
@ -173,7 +173,7 @@ function Index({
)} )}
{PermeationList.length > 0 && {PermeationList.length > 0 &&
(ModeType === "all" || ModeType === "Permeation" || isPop) && ( (ModeType === "all" || ModeType === "permeation" || isPop) && (
<ScrollView <ScrollView
className="mode-list-box" className="mode-list-box"
scrollX={true} scrollX={true}
@ -184,8 +184,8 @@ function Index({
{PermeationList.map((item: any, index: any) => { {PermeationList.map((item: any, index: any) => {
return ( return (
<View <View
key={"Permeation_" + index} key={"permeation_" + index}
id={"Permeation_" + item.id} id={"permeation_" + item.id}
onClick={onItemClick.bind(this, item)} onClick={onItemClick.bind(this, item)}
className={classnames("mode-item", { className={classnames("mode-item", {
"mode-item-active": activeModeID === item.id, "mode-item-active": activeModeID === item.id,
@ -231,7 +231,7 @@ function Index({
)} )}
{SensitiveList.length > 0 && {SensitiveList.length > 0 &&
(ModeType === "all" || ModeType === "Sensitive" || isPop) && ( (ModeType === "all" || ModeType === "sensitive" || isPop) && (
<ScrollView <ScrollView
className="mode-list-box" className="mode-list-box"
scrollX={true} scrollX={true}
@ -242,8 +242,8 @@ function Index({
{PermeationList.map((item: any, index: any) => { {PermeationList.map((item: any, index: any) => {
return ( return (
<View <View
key={"Sensitive_" + index} key={"sensitive_" + index}
id={"Sensitive_" + item.id} id={"sensitive_" + item.id}
onClick={onItemClick.bind(this, item)} onClick={onItemClick.bind(this, item)}
className={classnames("mode-item", { className={classnames("mode-item", {
"mode-item-active": activeModeID === item.id, "mode-item-active": activeModeID === item.id,
@ -289,7 +289,7 @@ function Index({
)} )}
{IntelligenceList.length > 0 && {IntelligenceList.length > 0 &&
(ModeType === "all" || ModeType === "Intelligence" || isPop) && ( (ModeType === "all" || ModeType === "intelligence" || isPop) && (
<ScrollView <ScrollView
className="mode-list-box" className="mode-list-box"
scrollX={true} scrollX={true}
@ -300,8 +300,8 @@ function Index({
{IntelligenceList.map((item: any, index: any) => { {IntelligenceList.map((item: any, index: any) => {
return ( return (
<View <View
key={"Intelligence_" + index} key={"intelligence_" + index}
id={"Intelligence_" + item.id} id={"intelligence_" + item.id}
onClick={onItemClick.bind(this, item)} onClick={onItemClick.bind(this, item)}
className={classnames("mode-item", { className={classnames("mode-item", {
"mode-item-active": activeModeID === item.id, "mode-item-active": activeModeID === item.id,

@ -44,7 +44,7 @@ export default class Activity extends Component<any, any> {
return ( return (
<Block> <Block>
<View>{name}</View> <View>{name}</View>
<View className="main"></View> <View className="main"></View>
</Block> </Block>
); );
} }

@ -44,7 +44,7 @@ export default class Detect extends Component<any, any> {
return ( return (
<Block> <Block>
<View>{name}</View> <View>{name}</View>
<View className="main"></View> <View className="main"></View>
</Block> </Block>
); );
} }

@ -420,7 +420,7 @@ class Index extends Component<any, any> {
}; };
GetSiteAddTag = async (id) => { GetSiteAddTag = async (id) => {
go("/recoding/pages/moisture_test_report/moisture_test_report") go("/recoding/pages/moisture_test_report/moisture_test_report");
let res = await GetSiteAddTag(id); let res = await GetSiteAddTag(id);
if (res.data.code === 200) { if (res.data.code === 200) {
console.log("点击自动上报,不需要逻辑处理"); console.log("点击自动上报,不需要逻辑处理");
@ -441,7 +441,7 @@ class Index extends Component<any, any> {
msg("您已绑定所有设备"); msg("您已绑定所有设备");
return; return;
} }
go("/pages/instrument/instrument"); go("/instrument/pages/instrument/instrument");
} }
}; };
@ -493,7 +493,7 @@ class Index extends Component<any, any> {
const { url } = e.currentTarget.dataset; const { url } = e.currentTarget.dataset;
if (this.isRegister()) { if (this.isRegister()) {
if (url === "/pages/instrument/instrument") { if (url === "/instrument/pages/instrument/instrument") {
let { data } = await InstrumentInfo.unbindingInstrumentInfoList(); let { data } = await InstrumentInfo.unbindingInstrumentInfoList();
console.log(data, "查看未绑定设备"); console.log(data, "查看未绑定设备");
if (data.data.length === 0) { if (data.data.length === 0) {
@ -781,7 +781,7 @@ class Index extends Component<any, any> {
if (res.data.code === 200) { if (res.data.code === 200) {
console.log("res.data.data", res.data.data); console.log("res.data.data", res.data.data);
if (res.data.data.length > 0) { if (res.data.data.length > 0) {
go("/pages/instrument/intro??customBack=true&id=" + id); go("/instrument/pages/instrument/intro??customBack=true&id=" + id);
} else { } else {
this.bindingInstrumentList(); this.bindingInstrumentList();
} }
@ -840,8 +840,6 @@ class Index extends Component<any, any> {
// 跳转仪器介绍页 // 跳转仪器介绍页
goNursing = (item) => { goNursing = (item) => {
console.log(item, "查看item");
// 仅开发者工具调试使用 // 仅开发者工具调试使用
const platform = Taro.getSystemInfoSync().platform; const platform = Taro.getSystemInfoSync().platform;
setStorageSync("instrument_detail", item); setStorageSync("instrument_detail", item);
@ -851,7 +849,14 @@ class Index extends Component<any, any> {
if (platform === "devtools") { if (platform === "devtools") {
setStorageSync("instrument_detail", item); setStorageSync("instrument_detail", item);
this.setState({ connectInstrument: item }); this.setState({ connectInstrument: item });
setTimeout(() => this.goIot()); if (item.type === 1) {
//非IOT
setTimeout(() => {
go("/instrument/pages/instrumentClickinUpload/index");
}, 10);
} else {
setTimeout(() => this.goIot());
}
return; return;
} }
@ -879,7 +884,7 @@ class Index extends Component<any, any> {
if (this.state.connectInstrument.type === 1) { if (this.state.connectInstrument.type === 1) {
//非IOT //非IOT
setTimeout(() => { setTimeout(() => {
go("/pages/instrumentClickinUpload/index"); go("/instrument/pages/instrumentClickinUpload/index");
}, 10); }, 10);
} else { } else {
Taro.getSystemInfo({ Taro.getSystemInfo({
@ -1353,7 +1358,7 @@ class Index extends Component<any, any> {
<View className="title"></View> <View className="title"></View>
<View <View
className="txt_box flex jcenter aitems" className="txt_box flex jcenter aitems"
data-url="/pages/instrument/instrument" data-url="/instrument/pages/instrument/instrument"
onClick={this.gourl} onClick={this.gourl}
> >
<Image <Image

@ -271,7 +271,7 @@ class User extends Component<any, any> {
<View <View
style="margin-top:0" style="margin-top:0"
className="block" className="block"
data-url="/pages/instrument_manage/index?isback=1" data-url="/instrument/pages/instrument_manage/index?isback=1"
onClick={this.goUrlNoRegister} onClick={this.goUrlNoRegister}
> >
<Image <Image
@ -312,49 +312,7 @@ class User extends Component<any, any> {
<View className="txt"></View> <View className="txt"></View>
</View> </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"> <View className="info3">
{lastDay} : {userInfo.expireCredit} {lastDay} : {userInfo.expireCredit}
</View> </View>

@ -267,7 +267,7 @@ class UserInfo extends Component<any, any> {
} }
let isInstrumentJump = Taro.getStorageSync("isInstrumentJump"); let isInstrumentJump = Taro.getStorageSync("isInstrumentJump");
if (isInstrumentJump === "true") { if (isInstrumentJump === "true") {
go("/pages/instrument/instrument"); go("/instrument/pages/instrument/instrument");
} else { } else {
Taro.switchTab({ Taro.switchTab({
url: "/pages/user/user", url: "/pages/user/user",

@ -32,7 +32,7 @@ export default class Recording extends Component<any, any> {
this.state = { this.state = {
name: "护理历程", name: "护理历程",
current: 0, current: 0,
ViewAddInstrument: false, //用来记录有没有添加设备 ViewAddInstrument: false, //用来记录有没有添加设备
array: [1, 2, 3, 4, 5], array: [1, 2, 3, 4, 5],
recordList: [], recordList: [],
bindingInstrumentList: [], bindingInstrumentList: [],
@ -64,9 +64,9 @@ export default class Recording extends Component<any, any> {
}; };
} }
componentDidMount() { } componentDidMount() {}
componentWillUnmount() { } componentWillUnmount() {}
// 格式化时间 // 格式化时间
getTime(time) { getTime(time) {
const hour = time.slice(0, 2); const hour = time.slice(0, 2);
@ -88,20 +88,17 @@ export default class Recording extends Component<any, any> {
} }
// 获取护理历程 // 获取护理历程
async getRecord(id) { async getRecord(id) {
let data = {}; let data = {};
if (id != null) { if (id != null) {
data["instrumentId"] = id; data["instrumentId"] = id;
} }
let res = await InstrumentInfo.apiNursingLog.getRecord(data); let res = await InstrumentInfo.apiNursingLog.getRecord(data);
console.log(res, '查看你获取护理历程'); console.log(res, "查看你获取护理历程");
if (res.data.code === 200) { if (res.data.code === 200) {
res.data.rows.map((item) => { res.data.rows.map((item) => {
item.nursingTime = this.getTime(item.nursingTime); item.nursingTime = this.getTime(item.nursingTime);
let createTime = getdates(item.createTime) let createTime = getdates(item.createTime);
item.createTime = createTime && createTime.replace(/-/g, "."); item.createTime = createTime && createTime.replace(/-/g, ".");
}); });
@ -144,7 +141,6 @@ export default class Recording extends Component<any, any> {
let res = await InstrumentInfo.apiClock.getClockStatistics({ year }); let res = await InstrumentInfo.apiClock.getClockStatistics({ year });
if (res.data.code === 200) { if (res.data.code === 200) {
res.data.data.reverse(); res.data.data.reverse();
if (res.data.data.length > 0) { if (res.data.data.length > 0) {
res.data.data.map((item, index) => { res.data.data.map((item, index) => {
@ -184,7 +180,9 @@ export default class Recording extends Component<any, any> {
// 文本框输入文字 // 文本框输入文字
handleTextareaInput = (e) => { handleTextareaInput = (e) => {
const punchInInfo = this.state.punchInInfo; const punchInInfo = this.state.punchInInfo;
this.setState({ punchInInfo: { ...punchInInfo, clockContent: e.detail.value } }); this.setState({
punchInInfo: { ...punchInInfo, clockContent: e.detail.value },
});
}; };
// 打开/关闭弹窗 // 打开/关闭弹窗
setShow(show: boolean) { setShow(show: boolean) {
@ -194,7 +192,7 @@ export default class Recording extends Component<any, any> {
onChangeProduct(id) { onChangeProduct(id) {
this.setState({ curIndex: id }); this.setState({ curIndex: id });
this.getRecord(id); this.getRecord(id);
this.addLog(); // this.addLog();
} }
// 展开收起 // 展开收起
onChangeMore(id, year, month) { onChangeMore(id, year, month) {
@ -223,8 +221,9 @@ export default class Recording extends Component<any, any> {
if (item.id === id) { if (item.id === id) {
item.detail = res.data.data; item.detail = res.data.data;
item.detail.map((obj) => { item.detail.map((obj) => {
let updateTime = obj.updateTime
let updateTime = getdates(obj.updateTime) ? getdates(obj.updateTime)
: getdates(obj.createTime);
obj.updateTime = updateTime && updateTime.replace(/-/g, "."); obj.updateTime = updateTime && updateTime.replace(/-/g, ".");
}); });
@ -234,51 +233,47 @@ export default class Recording extends Component<any, any> {
} }
} }
async DayTime() { async DayTime() {
let storedData = Taro.getStorageSync('DayTime') let storedData = Taro.getStorageSync("DayTime");
const day = new Date(); const day = new Date();
if (storedData === undefined || storedData === "") { if (storedData === undefined || storedData === "") {
this.setState({ this.setState({
clockShow: false clockShow: false,
}) });
} else { } else {
const storedDate = new Date(storedData); const storedDate = new Date(storedData);
const currentDate = new Date(day.toISOString()); const currentDate = new Date(day.toISOString());
const isSameDate = storedDate.toDateString() === currentDate.toDateString(); const isSameDate =
storedDate.toDateString() === currentDate.toDateString();
if (isSameDate) { if (isSameDate) {
this.setState({ this.setState({
clockShow: true clockShow: true,
}) });
} else { } else {
this.setState({ this.setState({
clockShow: false clockShow: false,
}) });
} }
} }
} }
async onLoad(options) { async onLoad(options) {
const ViewAddInstrument = options.param; const ViewAddInstrument = options.param;
this.setState({ this.setState({
ViewAddInstrument: ViewAddInstrument ViewAddInstrument: ViewAddInstrument,
}) });
this.getRecord(null); this.getRecord(null);
this.getBindingInstrumentList(); this.getBindingInstrumentList();
this.getLatestClockRecord(); this.getLatestClockRecord();
this.getClockStatistics(); this.getClockStatistics();
this.DayTime() this.DayTime();
} }
componentDidShow() { } componentDidShow() {}
componentDidHide() { } componentDidHide() {}
async initData() { } async initData() {}
// 选择年份 // 选择年份
onChangeYear(event) { onChangeYear(event) {
this.setState({ year: event.detail.value }); this.setState({ year: event.detail.value });
@ -294,18 +289,18 @@ export default class Recording extends Component<any, any> {
}; };
// 跳转到护理报告 // 跳转到护理报告
toReport(id, recordId, item) { toReport(id, recordId, item) {
console.log(item, '查看类型', item.jumpType); console.log(item, "查看类型", item.jumpType);
item.jumpType = 1 item.jumpType = 1;
switch (item.jumpType) { switch (item.jumpType) {
case 1: case 1:
this.One(item); this.One(item);
break; break;
case 2: case 2:
this.two(item);
this.two(item); break; break;
case 3: case 6:
this.three(item);
this.three(item); break; break;
default: default:
this.AllDevice(item); this.AllDevice(item);
} }
@ -314,26 +309,30 @@ export default class Recording extends Component<any, any> {
} }
// 打开第一种类型 // 打开第一种类型
One = async (item) => { One = async (item) => {
console.log('打开第一种类型', item); console.log("打开第一种类型", item);
let report = false let report = false;
go("/recoding/pages/face_report_one/face_report_one?id=" + item.id + "&recordId=" + item.recordId + "&report=" + report); go(
} "/recoding/pages/face_report_one/face_report_one?id=" +
item.id +
"&recordId=" +
item.recordId +
"&report=" +
report
);
};
// 打开第二种类型 // 打开第二种类型
two = async (item) => { two = async (item) => {
console.log('打开第二种类型', item); console.log("打开第二种类型", item);
};
} // 打开第三种类型
// 打开第二种类型
three = async (item) => { three = async (item) => {
console.log('打开第二种类型', item); go("/recoding/pages/moisture_test_report/moisture_test_report");
};
}
// 打开其他类型 // 打开其他类型
AllDevice = async (item) => { AllDevice = async (item) => {
console.log('打开其他类型', item); console.log("打开其他类型", item);
go("/pages/face_report_AllDevice/face_report_AllDevice"); go("/pages/face_report_AllDevice/face_report_AllDevice");
};
}
// 上传图片 // 上传图片
handleChooseImage() { handleChooseImage() {
Taro.chooseMedia({ Taro.chooseMedia({
@ -390,14 +389,13 @@ export default class Recording extends Component<any, any> {
t2: "您已完成今日打卡", t2: "您已完成今日打卡",
btn1show: false, btn1show: false,
}).then(() => { }).then(() => {
let data = new Date let data = new Date();
Taro.setStorageSync('DayTime', data.toISOString()) Taro.setStorageSync("DayTime", data.toISOString());
this.setState({ this.setState({
clockShow: true clockShow: true,
}) });
this.getClockStatistics(); this.getClockStatistics();
this.setShow(false); this.setShow(false);
}); });
}); });
} }
@ -427,8 +425,8 @@ export default class Recording extends Component<any, any> {
return ( return (
<Block> <Block>
<Navbar isBack titleSlot='护理记录'></Navbar> <Navbar isBack titleSlot="护理记录"></Navbar>
<View className='tabs'> <View className="tabs">
<View <View
className={classnames("tab", { className={classnames("tab", {
tab_active: current === 0, tab_active: current === 0,
@ -449,7 +447,7 @@ export default class Recording extends Component<any, any> {
</View> </View>
</View> </View>
{current === 0 && ( {current === 0 && (
<ScrollView className='products_list' scroll-x='true'> <ScrollView className="products_list" scroll-x="true">
<View <View
className={classnames("all", { className={classnames("all", {
products_item_active: !curIndex, products_item_active: !curIndex,
@ -467,11 +465,11 @@ export default class Recording extends Component<any, any> {
onClick={this.onChangeProduct.bind(this, item.id)} onClick={this.onChangeProduct.bind(this, item.id)}
> >
<Image <Image
className='products_cover' className="products_cover"
src={require("@/img/test/1706692819894.jpg")} src={item.logo}
mode='aspectFit' mode="aspectFill"
></Image> ></Image>
<View className='products_title'></View> <View className="products_title">{item.name}</View>
</View> </View>
))} ))}
</ScrollView> </ScrollView>
@ -479,17 +477,17 @@ export default class Recording extends Component<any, any> {
{current === 0 && recordList.length === 0 && ( {current === 0 && recordList.length === 0 && (
<View> <View>
<View className='nodata'> <View className="nodata">
<Image <Image
className='nodata_img' className="nodata_img"
src={require("@/img/nodata.png")} src={require("@/img/nodata.png")}
></Image> ></Image>
<View className='nodata_text'></View> <View className="nodata_text"></View>
</View> </View>
</View> </View>
)} )}
{current === 0 && ( {current === 0 && (
<View style='padding-bottom:200px'> <View style="padding-bottom:200px">
{/* <View className='instrument_item' > {/* <View className='instrument_item' >
<View className='instrument_top flex sb aitems'> <View className='instrument_top flex sb aitems'>
<View className='time_box flex aitems'> <View className='time_box flex aitems'>
@ -516,12 +514,12 @@ export default class Recording extends Component<any, any> {
</View> </View>
</View> */} </View> */}
<View className='instrument_list '> <View className="instrument_list ">
{recordList.map((item: any, index: any) => ( {recordList.map((item: any, index: any) => (
<View className='recording-box' key={item.id}> <View className="recording-box" key={item.id}>
<View className='box-top'> <View className="box-top">
<View className='top-left'> <View className="top-left">
<View className='date'>{item.createTime}</View> <View className="date">{item.createTime}</View>
<View <View
className={classnames("tip", { className={classnames("tip", {
tag_active: item.online === 2, tag_active: item.online === 2,
@ -532,33 +530,33 @@ export default class Recording extends Component<any, any> {
</View> </View>
{item.instrumentType === 2 && ( {item.instrumentType === 2 && (
<View <View
className='top-right' className="top-right"
onClick={this.toReport.bind( onClick={this.toReport.bind(
this, this,
item.instrumentId, item.instrumentId,
item.id, item.id,
item, item
)} )}
> >
<Image <Image
className='arrow_icon' className="arrow_icon"
src={require("@/img/index/right.png")} src={require("@/img/index/right.png")}
mode='aspectFill' mode="aspectFill"
></Image> ></Image>
</View> </View>
)} )}
</View> </View>
<View className='box-bottom'> <View className="box-bottom">
<Image <Image
className='recording_img' className="recording_img"
src={item.modeImage} src={item.modeImage}
></Image> ></Image>
<View className='bottom-right'> <View className="bottom-right">
<View className='title'>{item.instrumentName}</View> <View className="title">{item.instrumentName}</View>
<View className='subtitle-box'> <View className="subtitle-box">
<View className='subtitle'>{item.modeName}</View> <View className="subtitle">{item.modeName}</View>
<View className='subtitle'> <View className="subtitle">
{item.nursingTime} {item.nursingTime}
</View> </View>
</View> </View>
@ -570,7 +568,7 @@ export default class Recording extends Component<any, any> {
</View> </View>
)} )}
{current === 1 && ( {current === 1 && (
<View style='padding-bottom:200px'> <View style="padding-bottom:200px">
{/* <View className='nodata'> {/* <View className='nodata'>
<Image <Image
className='nodata_img' className='nodata_img'
@ -578,52 +576,52 @@ export default class Recording extends Component<any, any> {
></Image> ></Image>
<View className='nodata_text'></View> <View className='nodata_text'></View>
</View> */} </View> */}
<View style='height: 30rpx; background: #F8F8F8'></View> <View style="height: 30rpx; background: #F8F8F8"></View>
<View className='clock_in_statistics m-x-30 flex sb'> <View className="clock_in_statistics m-x-30 flex sb">
<View className='flex sb ab'> <View className="flex sb ab">
<View className='clock_in_statistics_title'></View> <View className="clock_in_statistics_title"></View>
<Picker <Picker
mode='date' mode="date"
fields='year' fields="year"
onChange={this.onChangeYear.bind(this)} onChange={this.onChangeYear.bind(this)}
value='{{year}}' value="{{year}}"
end='{{today}}' end="{{today}}"
> >
<View className='clock_in_statistics_date flex aitems'> <View className="clock_in_statistics_date flex aitems">
<View>{year}</View> <View>{year}</View>
<Image <Image
className='more_icon' className="more_icon"
src={require("@/img/arrow-down.png")} src={require("@/img/arrow-down.png")}
mode='widthFix' mode="widthFix"
></Image> ></Image>
</View> </View>
</Picker> </Picker>
</View> </View>
<View className='chart flex sb'> <View className="chart flex sb">
{monthTime.map((item) => ( {monthTime.map((item) => (
<View className='flex fc aitems' key={item.month}> <View className="flex fc aitems" key={item.month}>
{item.time > 0 && ( {item.time > 0 && (
<View className='buoy'>{item.time}</View> <View className="buoy">{item.time}</View>
)} )}
<View <View
className='column' className="column"
style={{ height: `calc(186/31*${item.time}rpx)` }} style={{ height: `calc(186/31*${item.time}rpx)` }}
></View> ></View>
<View className='month'>{item.month}</View> <View className="month">{item.month}</View>
</View> </View>
))} ))}
</View> </View>
</View> </View>
<View style='padding-bottom: env(safe-area-inset-bottom)'> <View style="padding-bottom: env(safe-area-inset-bottom)">
<View className='month_box m-x-30'> <View className="month_box m-x-30">
{clockStatistics.map((item) => ( {clockStatistics.map((item) => (
<View className='month_statistics' key={item.id}> <View className="month_statistics" key={item.id}>
<View className='flex aitems sb'> <View className="flex aitems sb">
<View className='time'> <View className="time">
{item.year}{item.month} {item.year}{item.month}
</View> </View>
<View <View
className='more_box flex aitems' className="more_box flex aitems"
onClick={this.onChangeMore.bind( onClick={this.onChangeMore.bind(
this, this,
item.id, item.id,
@ -631,7 +629,7 @@ export default class Recording extends Component<any, any> {
item.month item.month
)} )}
> >
<View className='more_text'> <View className="more_text">
{" "} {" "}
{!item.isMore ? "展开更多" : "收起更多"} {!item.isMore ? "展开更多" : "收起更多"}
</View> </View>
@ -641,49 +639,51 @@ export default class Recording extends Component<any, any> {
? "rotate(180deg)" ? "rotate(180deg)"
: "rotate(0deg)", : "rotate(0deg)",
}} }}
className='more_icon' className="more_icon"
src={require("@/img/arrow-down.png")} src={require("@/img/arrow-down.png")}
mode='widthFix' mode="widthFix"
></Image> ></Image>
</View> </View>
</View> </View>
<View style='height: 59rpx'></View> <View style="height: 59rpx"></View>
<View className='statistic'> <View className="statistic">
<View className='statistic_item'> <View className="statistic_item">
<View className='statistic_num'>{item.clockNum}</View> <View className="statistic_num">{item.clockNum}</View>
<View className='statistic_desc'></View> <View className="statistic_desc"></View>
</View> </View>
<View className='statistic_item'> <View className="statistic_item">
<View className='statistic_num'> <View className="statistic_num">
{(item.percentage * 100).toFixed(2)}% {(item.percentage * 100).toFixed(2)}%
</View> </View>
<View className='statistic_desc'></View> <View className="statistic_desc"></View>
</View> </View>
<View className='border'></View> <View className="border"></View>
</View> </View>
{item.isMore && item.detail && ( {item.isMore && item.detail && (
<View> <View>
{item.detail.map((obj) => ( {item.detail.map((obj) => (
<View key={obj}> <View key={obj.id}>
<View style='height: 57rpx'></View> <View style="height: 57rpx"></View>
<View className='month_item'> <View className="month_item">
<View className='month_item_date'> <View className="month_item_date">
{obj.updateTime} {obj.updateTime}
</View> </View>
<View className='month_image_box flex sb'> <View className="month_image_box flex sb">
{obj.clockImg.map((img) => ( {obj.clockImg.map((img) => (
<Image <Image
key={img} key={img}
className='month_item_cover' className="month_item_cover"
src={img} src={img}
></Image> ></Image>
))} ))}
</View> </View>
<View className='month_item_date'> <View className="month_item_date">
{/* 小紫弹智能射频仪、花至抗老射频仪PRO{" "} */} {/* 小紫弹智能射频仪、花至抗老射频仪PRO{" "} */}
{obj.instrumentName === null ? "" : obj.instrumentName} {obj.instrumentName === null
? ""
: obj.instrumentName}
</View> </View>
<View className='month_item_note'> <View className="month_item_note">
{obj.clockContent} {obj.clockContent}
</View> </View>
</View> </View>
@ -697,79 +697,76 @@ export default class Recording extends Component<any, any> {
</View> </View>
</View> </View>
)} )}
{ {!clockShow && ViewAddInstrument === "true" && (
!clockShow && ViewAddInstrument === "true" && ( <View className="footer flex aitems">
<View className='footer flex aitems'> <View className="btn" onClick={this.setShow.bind(this, true)}>
<View className='btn' onClick={this.setShow.bind(this, true)}>
</View>
</View> {/* <View className="text" onClick={this.back}>
{/* <View className="text" onClick={this.back}>
&gt; &gt;
</View> */} </View> */}
</View> </View>
) )}
}
<Popup show={show} onClose={() => this.setState({ show: false })}> <Popup show={show} onClose={() => this.setState({ show: false })}>
<View className='popBox'> <View className="popBox">
<Image <Image
className='close_icon' className="close_icon"
src={require("@/img/close.png")} src={require("@/img/close.png")}
mode='widthFix' mode="widthFix"
onClick={this.setShow.bind(this, false)} onClick={this.setShow.bind(this, false)}
></Image> ></Image>
<View className='popTitle'></View> <View className="popTitle"></View>
<View className='popSubtitle'> <View className="popSubtitle">
<View className='bold'>{clockStatistics[0]?.clockNum}</View>{" "} <View className="bold">{clockStatistics[0]?.clockNum}</View>{" "}
<View className='bold'> <View className="bold">
{(clockStatistics[0]?.percentage * 100).toFixed(1)}% {(clockStatistics[0]?.percentage * 100).toFixed(1)}%
</View> </View>
</View> </View>
<View className='img_box'> <View className="img_box">
{punchInInfo.clockImageList.map((item, index) => ( {punchInInfo.clockImageList.map((item, index) => (
<View key={item} className='img'> <View key={item} className="img">
<Image className='showImg' src={item} mode='widthFix'></Image> <Image className="showImg" src={item} mode="widthFix"></Image>
<Image <Image
className='closeImg' className="closeImg"
src={require("@/img/close1.png")} src={require("@/img/close1.png")}
mode='widthFix' mode="widthFix"
onClick={this.delImg.bind(this, index)} onClick={this.delImg.bind(this, index)}
></Image> ></Image>
</View> </View>
))} ))}
{punchInInfo.clockImageList.length < 3 && ( {punchInInfo.clockImageList.length < 3 && (
<View <View
className='addBox' className="addBox"
onClick={this.handleChooseImage.bind(this)} onClick={this.handleChooseImage.bind(this)}
> >
<Image <Image
className='showImg' className="showImg"
src={require("@/img/clock_in_upload/add-image.png")} src={require("@/img/clock_in_upload/add-image.png")}
mode='widthFix' mode="widthFix"
></Image> ></Image>
</View> </View>
)} )}
</View> </View>
<View className='info4'> <View className="info4">
<View className='content'> <View className="content">
<Textarea <Textarea
placeholderStyle='color: #ccc; font-size: 26rpx;font-weight: 400;font-family: PingFang SC;' placeholderStyle="color: #ccc; font-size: 26rpx;font-weight: 400;font-family: PingFang SC;"
placeholder='请记录一下今天的护理心得吧' placeholder="请记录一下今天的护理心得吧"
maxlength={120} maxlength={120}
onInput={this.handleTextareaInput.bind(this)} onInput={this.handleTextareaInput.bind(this)}
value={punchInInfo.clockContent} value={punchInInfo.clockContent}
></Textarea> ></Textarea>
</View> </View>
<View className='tip'> <View className="tip">
{"" + (punchInInfo.clockContent.length || 0) + "/120"} {"" + (punchInInfo.clockContent.length || 0) + "/120"}
</View> </View>
</View> </View>
<View className='popbtnbox flex aitems jcenter'> <View className="popbtnbox flex aitems jcenter">
<View className='btn1' onClick={this.submit.bind(this)}> <View className="btn1" onClick={this.submit.bind(this)}>
</View> </View>
</View> </View>

@ -42,6 +42,14 @@ export const Ajax = (params) => {
} }
return new Promise((reslove, reject) => { return new Promise((reslove, reject) => {
let token = getStorageSync("token"); let token = getStorageSync("token");
if (!token) {
// 如果不存在token且请求的接口不是登录则重新登录
console.log("params", params);
if (params.url.indexOf("/user/login") === -1) {
loginReload(params);
return;
}
}
Taro.request({ Taro.request({
url: domain + params.url, url: domain + params.url,
method: params.method || "GET", method: params.method || "GET",

Loading…
Cancel
Save