fix:仪器管理、仪器介绍样式修复

master
blak-kong 2 years ago
parent fdf863b105
commit 6f952823a4

@ -1,3 +1,8 @@
.intro {
.intro-main {
position: relative;
overflow: hidden;
}
.footer { .footer {
position: fixed; position: fixed;
bottom: 0; bottom: 0;
@ -33,7 +38,7 @@
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 {
@ -41,6 +46,7 @@
width: 660rpx; width: 660rpx;
height: 922rpx; height: 922rpx;
border-radius: 50rpx; border-radius: 50rpx;
margin: 0 auto;
} }
.content { .content {
@ -50,6 +56,7 @@
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: 0 auto;
margin-top: 7rpx; margin-top: 7rpx;
} }
@ -88,7 +95,8 @@
.indicator { .indicator {
position: absolute; position: absolute;
left: 50%; left: 50%;
top: 960rpx; // top: 960rpx;
top: 990rpx;
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
display: inline-flex; display: inline-flex;
width: 360rpx; width: 360rpx;
@ -103,7 +111,12 @@
margin-right: 4rpx; margin-right: 4rpx;
transition: all 0.6s ease-in-out 0.1s; transition: all 0.6s ease-in-out 0.1s;
} }
.only-dot {
width: 120rpx;
margin: 0 auto;
}
.bg-show { .bg-show {
background: #000; 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) => {
@ -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,7 +448,11 @@ class Intro extends Component<any, any> {
/> />
{/* IOT相关弹窗 END */} {/* IOT相关弹窗 END */}
</View> </View>
<View style="position: relative"> <View className="intro">
<View
className="intro-main"
style={{ height: "calc(100vh - " + navHeight + "rpx)" }}
>
<Swiper <Swiper
className="main" className="main"
current={current} current={current}
@ -434,8 +461,8 @@ class Intro extends Component<any, any> {
indicatorDots={false} indicatorDots={false}
indicatorColor="#999" indicatorColor="#999"
indicatorActiveColor="#333" indicatorActiveColor="#333"
previousMargin="32rpx" previousMargin={introList.length > 1 ? "32rpx" : "0px"}
nextMargin="32rpx" nextMargin={introList.length > 1 ? "32rpx" : "0px"}
> >
{introList.map((item: any, index: number) => { {introList.map((item: any, index: number) => {
return ( return (
@ -459,7 +486,7 @@ class Intro extends Component<any, any> {
})} })}
</Swiper> </Swiper>
{introList.length && ( {introList.length > 1 && (
<View className="indicator"> <View className="indicator">
{introList.map((_item, index) => { {introList.map((_item, index) => {
return ( return (
@ -473,6 +500,20 @@ class Intro extends Component<any, any> {
})} })}
</View> </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="footer flex aitems jcenter"> <View className="footer flex aitems jcenter">
@ -483,6 +524,7 @@ class Intro extends Component<any, any> {
</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;
@ -88,8 +90,11 @@ page {
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;

@ -231,13 +231,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({
@ -493,7 +497,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()) {
// 满足时间条件,提示是否保存部分护理记录 // 满足时间条件,提示是否保存部分护理记录
@ -753,6 +757,8 @@ 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
) { ) {
// 水分测试手动检测时间,不自动计算倒计时
if (jsonStatus?.workMode !== "moistureTest")
this.updateDeviceSyncData( this.updateDeviceSyncData(
{ {
totalWorkingMinutes: jsonStatus.totalWorkingMinutes, totalWorkingMinutes: jsonStatus.totalWorkingMinutes,
@ -800,7 +806,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(
@ -927,7 +933,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
) { ) {
// 界面倒计时同步设备时间 // 界面倒计时同步设备时间
@ -972,7 +978,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;
@ -999,25 +1005,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: "正在护理",
@ -1196,11 +1195,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

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

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

@ -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,7 @@ 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 = getdates(obj.updateTime);
let updateTime = getdates(obj.updateTime)
obj.updateTime = updateTime && updateTime.replace(/-/g, "."); obj.updateTime = updateTime && updateTime.replace(/-/g, ".");
}); });
@ -234,44 +231,40 @@ 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() {}
@ -294,18 +287,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 3:
this.three(item);
this.three(item); break; break;
default: default:
this.AllDevice(item); this.AllDevice(item);
} }
@ -314,26 +307,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); console.log("打开第二种类型", item);
};
}
// 打开其他类型 // 打开其他类型
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 +387,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 +423,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 +445,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 +463,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={require("@/img/test/1706692819894.jpg")}
mode='aspectFit' mode="aspectFit"
></Image> ></Image>
<View className='products_title'></View> <View className="products_title"></View>
</View> </View>
))} ))}
</ScrollView> </ScrollView>
@ -479,17 +475,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 +512,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 +528,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 +566,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 +574,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 +627,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 +637,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}>
<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 +695,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