rongweikang 2 years ago
commit 7ea3711ac6

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

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

@ -1,109 +1,122 @@
.footer {
position: fixed;
bottom: 0;
background: #fff;
flex-direction: column;
width: 100%;
padding-bottom: 30rpx;
// padding-bottom: env(safe-area-inset-bottom);
}
.intro {
.intro-main {
position: relative;
overflow: hidden;
}
.footer {
position: fixed;
bottom: 0;
background: #fff;
flex-direction: column;
width: 100%;
padding-bottom: 30rpx;
// padding-bottom: env(safe-area-inset-bottom);
}
.footer .btn {
width: 690rpx;
height: 90rpx;
background: #000;
border-radius: 45rpx;
text-align: center;
line-height: 90rpx;
font-size: 32rpx;
font-family: PingFang SC;
font-weight: bold;
color: #ffffff;
}
.footer .btn {
width: 690rpx;
height: 90rpx;
background: #000;
border-radius: 45rpx;
text-align: center;
line-height: 90rpx;
font-size: 32rpx;
font-family: PingFang SC;
font-weight: bold;
color: #ffffff;
}
.footer .text {
background: transparent;
font-size: 32rpx;
font-family: PingFang SC;
font-weight: bold;
color: #000000;
}
.footer .text {
background: transparent;
font-size: 32rpx;
font-family: PingFang SC;
font-weight: bold;
color: #000000;
}
.main {
height: 100vh;
text-align: center;
margin-top: 34rpx;
padding-bottom: calc(env(safe-area-inset-bottom) + 180rpx);
}
.main {
height: 100vh;
text-align: center;
margin-top: 34rpx;
// padding-bottom: calc(env(safe-area-inset-bottom) + 180rpx);
}
.cover {
display: block; // 消除默认间距
width: 660rpx;
height: 922rpx;
border-radius: 50rpx;
}
.cover {
display: block; // 消除默认间距
width: 660rpx;
height: 922rpx;
border-radius: 50rpx;
margin: 0 auto;
}
.content {
display: block; // 消除默认间距
width: 660rpx;
// height: 474rpx;
height: 488rpx;
background: linear-gradient(rgba(204, 204, 204, 0.4), #fff);
border-radius: 50rpx;
margin-top: 7rpx;
}
.content {
display: block; // 消除默认间距
width: 660rpx;
// height: 474rpx;
height: 488rpx;
background: linear-gradient(rgba(204, 204, 204, 0.4), #fff);
border-radius: 50rpx;
margin: 0 auto;
margin-top: 7rpx;
}
.title {
font-size: 48rpx;
font-family: PingFang SC;
font-weight: 500;
color: #000;
text-align: center;
padding-bottom: 30rpx;
padding-top: 84rpx;
}
.title {
font-size: 48rpx;
font-family: PingFang SC;
font-weight: 500;
color: #000;
text-align: center;
padding-bottom: 30rpx;
padding-top: 84rpx;
}
.text {
font-size: 26rpx;
font-weight: 500;
color: #666;
}
.text {
font-size: 26rpx;
font-weight: 500;
color: #666;
}
// .indicator {
// position: absolute;
// left: 50%;
// top: 960rpx;
// transform: translate(-50%, -50%);
// width: 120rpx;
// height: 1rpx;
// background: #ccc;
// }
// .indicator {
// position: absolute;
// left: 50%;
// top: 960rpx;
// transform: translate(-50%, -50%);
// width: 120rpx;
// height: 1rpx;
// background: #ccc;
// }
// .dot {
// height: 100%;
// background: #000;
// transition-property: all;
// transition-duration: 0.8s;
// }
.indicator {
position: absolute;
left: 50%;
top: 960rpx;
transform: translate(-50%, -50%);
display: inline-flex;
width: 360rpx;
height: 1px;
background: transparent;
.dot {
// .dot {
// height: 100%;
// background: #000;
// transition-property: all;
// transition-duration: 0.8s;
// }
.indicator {
position: absolute;
left: 50%;
// top: 960rpx;
top: 990rpx;
transform: translate(-50%, -50%);
display: inline-flex;
flex: 1;
height: 100%;
background: #f2f2f2;
transition-duration: 0.5s;
margin-right: 4rpx;
transition: all 0.6s ease-in-out 0.1s;
}
.bg-show {
background: #000;
width: 360rpx;
height: 1px;
background: transparent;
.dot {
display: inline-flex;
flex: 1;
height: 100%;
background: #f2f2f2;
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);
this.state = {
name: "仪器介绍页",
navHeight: 0,
current: 0,
instrument: {},
introList: [],
@ -61,7 +62,9 @@ class Intro extends Component<any, any> {
}
$instance = Taro.getCurrentInstance();
async onLoad() {}
async onLoad() {
this.setStatusBar();
}
componentDidMount() {
let strObj = getStorageSync("instrument_detail");
if (strObj) {
@ -82,13 +85,32 @@ class Intro extends Component<any, any> {
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() {}
onChange(event) {
onChange = (event) => {
console.info("onchange", event);
// const current = event.detail.current;
// this.setState({ current });
}
const current = event.detail.current;
this.setState({ current });
};
// 获取设备信息
getInstrumentInfo = async (id) => {
@ -152,7 +174,7 @@ class Intro extends Component<any, any> {
if (this.state.connectInstrument.type === 1) {
//非IOT
setTimeout(() => {
go("/pages/instrumentClickinUpload/index");
go("/instrument/pages/instrumentClickinUpload/index");
}, 10);
} else {
Taro.getSystemInfo({
@ -329,6 +351,7 @@ class Intro extends Component<any, any> {
isShowVersionUpgrading,
isShowVersionUpgradFinish,
versionUpgradFinishNodes,
navHeight,
} = this.state;
return (
<Block>
@ -425,62 +448,81 @@ class Intro extends Component<any, any> {
/>
{/* IOT相关弹窗 END */}
</View>
<View style="position: relative">
<Swiper
className="main"
current={current}
onChange={this.onChange}
duration={800}
indicatorDots={false}
indicatorColor="#999"
indicatorActiveColor="#333"
previousMargin="32rpx"
nextMargin="32rpx"
<View className="intro">
<View
className="intro-main"
style={{ height: "calc(100vh - " + navHeight + "rpx)" }}
>
{introList.map((item: any, index: number) => {
return (
<SwiperItem key={index}>
{item.fileType === "video" ? (
<Video className="cover" src={item.file} />
) : (
<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>
);
})}
</Swiper>
{introList.length && (
<View className="indicator">
{introList.map((_item, index) => {
<Swiper
className="main"
current={current}
onChange={this.onChange}
duration={800}
indicatorDots={false}
indicatorColor="#999"
indicatorActiveColor="#333"
previousMargin={introList.length > 1 ? "32rpx" : "0px"}
nextMargin={introList.length > 1 ? "32rpx" : "0px"}
>
{introList.map((item: any, index: number) => {
return (
<View
key={"indicator_" + index}
className={classnames("dot", {
"bg-show": current === index,
})}
/>
<SwiperItem key={index}>
{item.fileType === "video" ? (
<Video className="cover" src={item.file} />
) : (
<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>
)}
</View>
<View className="footer flex aitems jcenter">
<View className="btn" onClick={this.goNursing}>
</Swiper>
{introList.length > 1 && (
<View className="indicator">
{introList.map((_item, index) => {
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 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>
</Block>

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

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

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

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

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

@ -420,7 +420,7 @@ class Index extends Component<any, any> {
};
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);
if (res.data.code === 200) {
console.log("点击自动上报,不需要逻辑处理");
@ -840,14 +840,19 @@ class Index extends Component<any, any> {
// 跳转仪器介绍页
goNursing = (item) => {
console.log(item, "查看item");
// 仅开发者工具调试使用
const platform = Taro.getSystemInfoSync().platform;
if (platform === "devtools") {
setStorageSync("instrument_detail", 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;
}
@ -875,7 +880,7 @@ class Index extends Component<any, any> {
if (this.state.connectInstrument.type === 1) {
//非IOT
setTimeout(() => {
go("/pages/instrumentClickinUpload/index");
go("/instrument/pages/instrumentClickinUpload/index");
}, 10);
} else {
Taro.getSystemInfo({

@ -312,49 +312,7 @@ class User extends Component<any, any> {
<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>

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

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

Loading…
Cancel
Save