临时提交

master
blak-kong 2 years ago
parent 217d7255fa
commit 0db2feb267

@ -16,6 +16,7 @@ export default defineAppConfig({
"pages/instrument/intro",
"pages/instrument_manage/index",
"pages/instrument_detail/index",
"pages/instrument_clickin_upload/index",
'pages/privacyPolicy/privacyPolicy',
'pages/userPolicy/userPolicy',
'pages/about/about',

@ -24,6 +24,7 @@ class App extends Component<PropsWithChildren> {
return;
}
go("/pages/instrument_clickin_upload/index");
// go("/pages/instrument/intro");
// Taro.switchTab({
// url: "/pages/user/user",

@ -536,6 +536,8 @@ class Index extends Component<any, any> {
};
// 仪器绑定失败弹窗
onBindErrorClose = () => {
Taro.removeStorageSync("isScan"); // 扫码弹窗显示完后,不需要再判断是否扫码
Taro.removeStorageSync("serial"); // 扫码弹窗显示完后,删除缓存的扫码序列号
this.setState({ isBindingError: false });
};
onBindErrorConfirm = () => {
@ -543,6 +545,8 @@ class Index extends Component<any, any> {
go("/pages/consultant/consultant");
};
onBeforeBindClose = () => {
Taro.removeStorageSync("isScan"); // 扫码弹窗显示完后,不需要再判断是否扫码
Taro.removeStorageSync("serial"); // 扫码弹窗显示完后,删除缓存的扫码序列号
this.setState({ isBeforeBinding: false });
};
onBeforeBindConfirm = () => {
@ -553,7 +557,8 @@ class Index extends Component<any, any> {
goNursing = (item) => {
console.log("goNursing", item);
setStorageSync("instrument_item", JSON.stringify(item));
go("/pages/instrument/intro?id=" + item.id);
go("/pages/instrument_clickin_upload/index?id=" + item.id);
// go("/pages/instrument/intro?id=" + item.id);
};
/* 扫码进入逻辑 */

@ -17,20 +17,14 @@ import {
Canvas,
} from "@tarojs/components";
import { InstrumentInfo } from "../../utils/Interface";
import {
go,
back,
msg,
setStorageSync,
getStorageSync,
} from "../../utils/traoAPI";
import { InstrumentInfo } from "@/utils/Interface";
import { go, back, msg, setStorageSync, getStorageSync } from "@/utils/traoAPI";
import { getImgInfo, contraction } from "../../utils/compressImage";
import { getImgInfo, contraction } from "@/utils/compressImage";
/* 自定义组件 */
import Navbar from "../../components/navbar/navbar";
import PopupAlert from "../../components/popup/popup-alert";
import Navbar from "@/components/navbar/navbar";
import PopupAlert from "@/components/popup/popup-alert";
/* 组件 */
import "./instrument.less";
@ -50,7 +44,7 @@ export default class Instrument extends Component<any, any> {
channelInfo: {
id: "",
serialImage: "",
serial: "",
serialCode: "",
},
equipmentList: [
{
@ -86,22 +80,22 @@ export default class Instrument extends Component<any, any> {
onSerial = (event) => {
const { value } = event.detail;
let { channelInfo } = this.state;
channelInfo.serial = value;
channelInfo.serialCode = value;
this.setState({ channelInfo });
};
onScanCode() {
Taro.scanCode({
scanType: ["qrCode"],
success: (res) => {
let { channelInfo } = this.state;
channelInfo.serial = res.result;
// onScanCode() {
// Taro.scanCode({
// scanType: ["qrCode"],
// success: (res) => {
// let { channelInfo } = this.state;
// channelInfo.serialCode = res.result;
this.setState({ channelInfo });
},
});
}
// this.setState({ channelInfo });
// },
// });
// }
onTipShow = () => {
this.setState({ tipShow: true });
@ -131,7 +125,7 @@ export default class Instrument extends Component<any, any> {
const bindCode = result.split("?")[1];
console.log("bindCode", bindCode);
const { channelInfo } = this.state;
channelInfo.serial = bindCode;
channelInfo.serialCode = bindCode;
this.setState({
channelInfo,
});
@ -270,7 +264,7 @@ export default class Instrument extends Component<any, any> {
onSelectChange(item) {
const { channelInfo } = this.state;
if (channelInfo.id === item.id) return;
channelInfo.serial = "";
channelInfo.serialCode = "";
this.setState({
channelInfo: item,
isVideo: this.isVideo(item.banner),
@ -304,6 +298,7 @@ export default class Instrument extends Component<any, any> {
if (data.code === 200) {
if (data.data.length) {
let item = data.data[0];
item.serialCode = "";
this.setState({
equipmentList: data.data,
channelInfo: item,
@ -320,8 +315,9 @@ export default class Instrument extends Component<any, any> {
mask: true,
});
let { channelInfo } = this.state;
let res = await InstrumentInfo.manualCodeBinding({
serial: channelInfo.serial,
serial: channelInfo.serialCode,
serialImage: channelInfo.serialImage,
instrumentId: channelInfo.id,
});
@ -342,7 +338,7 @@ export default class Instrument extends Component<any, any> {
});
let { channelInfo } = this.state;
let res = await InstrumentInfo.scanCodeBinding({
serial: channelInfo.serial,
serial: channelInfo.serialCode,
instrumentId: channelInfo.id,
});
Taro.hideLoading();
@ -364,7 +360,7 @@ export default class Instrument extends Component<any, any> {
let { channelInfo } = this.state;
let res = await InstrumentInfo.binding({
serial: channelInfo.serial,
serial: channelInfo.serialCode,
});
Taro.hideLoading();
if (res.data.code === 200) {
@ -401,7 +397,7 @@ export default class Instrument extends Component<any, any> {
} = this.state;
return (
<Block>
<PopupAlert
{/* <PopupAlert
isShow={true}
isClose={true}
title="提示"
@ -410,7 +406,7 @@ export default class Instrument extends Component<any, any> {
textAlgin="center"
close={this.closeDev}
confirm={this.closeDev}
/>
/> */}
<Navbar titleSlot="仪器绑定" isBack={true} />
<PopupAlert
isShow={isBindingError}
@ -520,15 +516,17 @@ export default class Instrument extends Component<any, any> {
<Text></Text>
<View className="tab_active_line"></View>
</View>
<View
className={classnames("tab_item", {
"is-active": inputType === 2,
})}
onClick={this.onTabTap.bind(this, 2)}
>
<Text></Text>
<View className="tab_active_line"></View>
</View>
{channelInfo.isScanCode === 1 && (
<View
className={classnames("tab_item", {
"is-active": inputType === 2,
})}
onClick={this.onTabTap.bind(this, 2)}
>
<Text></Text>
<View className="tab_active_line"></View>
</View>
)}
</View>
</View>
@ -559,7 +557,7 @@ export default class Instrument extends Component<any, any> {
placeholder="例如FR10*********1"
placeholder-style={style}
onInput={this.onSerial}
value={channelInfo.serial}
value={channelInfo.serialCode}
></Input>
</View>
</View>

@ -0,0 +1,397 @@
page {
background: #f8f8f8;
}
.titlemain {
position: fixed;
z-index: 99;
width: 100%;
top: 0;
/* box-shadow: 0px 1.5px 6px rgba(0, 0, 0, 0.16) */
}
.titlemain .logoicon {
width: 223rpx;
}
.titlemain .title {
position: relative;
display: flex;
align-items: center;
justify-content: center;
}
.infobox1 {
/* background: #fff; */
margin: 20rpx 0rpx;
box-shadow: -2rpx 0 12rpx 0.5rpx rgba(129, 129, 129, 0.05);
#myVideo {
display: block;
margin: 0;
padding: 0;
}
}
.infobox1 .img {
position: relative;
width: calc(345rpx * 2);
height: calc(345rpx * 2);
overflow: hidden;
border-radius: 30rpx;
/* padding: 10rpx; */
/* box-shadow: -2rpx 0 12rpx .5rpx rgba(129, 129, 129, 0.05); */
margin: auto;
}
.video-cover {
position: absolute;
top: 300rpx;
left: 0;
width: 100%;
height: 160rpx;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
border-radius: 30rpx;
}
.video-cover-icon {
width: 90rpx;
height: 90rpx;
}
.video-cover-time {
margin-top: 26rpx;
font-size: 28rpx;
color: #fff;
text-align: center;
}
.infobox2 {
background: #fff;
overflow: hidden;
margin: 20rpx 0 0;
box-shadow: -2rpx 0 12rpx 0.5rpx rgba(129, 129, 129, 0.05);
}
.infobox2 .info4 {
/* margin: 0 30rpx; */
padding: 41rpx 32rpx 0 32rpx;
}
.infobox2 .info4 .imgbox {
position: relative;
}
.infobox2 .info4 .upload_header .upload_title {
font-size: 36rpx;
font-weight: bold;
color: #030000;
}
.infobox2 .info4 .upload_header .icon {
width: 36rpx;
height: 36rpx;
}
.infobox2 .info4 .imgbox .img {
width: 180rpx;
height: 180rpx;
/* background: #DCB585; */
border-radius: 20rpx;
margin: 43rpx 32rpx 0 0;
position: relative;
overflow: hidden;
}
.infobox2 .info4 .imgbox .img .close {
position: absolute;
background: rgba(27, 7, 7, 0.5);
width: 46rpx;
height: 42rpx;
border-radius: 0 20rpx 0 20rpx;
right: 0;
top: 0;
}
.infobox2 .info4 .imgbox .img .close image {
width: 20rpx;
}
.infobox2 .info4 .imgbox .img2 {
margin: 43rpx 32rpx 0 0;
width: 180rpx;
height: 180rpx;
background: #fff;
border-radius: 20rpx;
border: 2rpx solid #dddddd;
}
.infobox2 .info4 .imgbox .img2 image {
width: 40rpx;
height: 40rpx;
}
.infobox2 .info4 .content {
background: #fff;
border-radius: 3rpx;
padding: 28rpx;
width: calc(100% - 28rpx - 28rpx);
height: 186rpx;
margin: 37rpx 0 20rpx;
/*box-shadow: -2rpx 0 12rpx .5rpx rgba(129, 129, 129, 0.1);*/
border: 2rpx solid #dddddd;
position: relative;
}
.infobox2 .info4 .content .textarea {
width: 100%;
height: 100%;
color: #000;
font-size: 28rpx;
}
.infobox2 .info4 .content .contenttip {
color: #e1e1e1;
font-size: 20rpx;
position: absolute;
right: 24rpx;
bottom: 18rpx;
}
.infobox2 .info4 .content textarea {
width: 100%;
height: 100%;
font-size: 28rpx;
color: #000;
border-radius: 3rpx;
}
.placeholder {
font-size: 28rpx;
}
.confirm_btn {
position: fixed;
z-index: 999;
bottom: 0;
left: 0;
width: 100%;
height: 153rpx;
background: #ffffff;
box-shadow: 0rpx -3rpx 7rpx 1rpx rgba(173, 191, 207, 0.21);
padding: 0 30rpx 21rpx;
box-sizing: border-box;
}
.confirm_btn .btn {
width: 100%;
height: 90rpx;
line-height: 90rpx;
text-align: center;
background: #000000;
border-radius: 45rpx;
font-size: 32rpx;
font-weight: bold;
color: #ffffff;
}
.infobox3 {
display: block;
margin: 20rpx 31rpx;
height: 162rpx;
font-family: PingFang SC;
.info1 {
display: inline-block;
white-space: nowrap;
background: #fff;
flex-direction: column;
height: 100%;
border-radius: 20rpx;
overflow: hidden;
box-shadow: -2rpx 0 12rpx 0.5rpx rgba(129, 129, 129, 0.05);
margin-right: 23rpx;
}
.info2 {
width: calc(100% - 130rpx - 20rpx);
background: #fff;
height: 162rpx;
border-radius: 20rpx;
box-shadow: -2rpx 0 12rpx 0.5rpx rgba(129, 129, 129, 0.05);
}
.info1,
.info2 {
.block1 {
// width: 300rpx;
// height: 160rpx;
flex-direction: column;
display: inline-block;
height: 100%;
text-align: center;
.block1_1 {
height: 100%;
padding: 0 20rpx;
flex-direction: column;
}
}
.info1_img {
width: 140rpx;
height: 140rpx;
margin-right: 10rpx;
border-radius: 20rpx;
overflow: hidden;
image {
width: 100%;
height: 100%;
}
}
.tip1 {
margin-top: 33rpx;
font-size: 26rpx;
font-weight: bold;
color: #000000;
}
.tip2 {
font-size: 24rpx;
font-weight: 400;
color: #666666;
margin-top: 15rpx;
}
.quan1 {
border-radius: 50%;
border: 3rpx solid #f1f1f1;
width: 30rpx;
height: 30rpx;
margin-top: 21rpx;
&.is-select {
display: flex;
background-color: #fff;
border-color: #fff;
align-items: center;
justify-content: center;
}
.quan2 {
border-radius: 50%;
background: #000000;
width: 14rpx;
height: 14rpx;
}
}
}
.info2 .block1 {
padding: 0 16rpx;
}
}
.popbox {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
border-radius: 30rpx;
background: #fff;
position: relative;
padding-top: 52rpx;
padding-bottom: 40rpx;
}
.popbox > .closeicon1 {
position: absolute;
right: 20rpx;
top: 20rpx;
width: 24rpx;
height: 24rpx;
}
.popbox > .closeicon2 {
width: 130rpx;
margin: auto;
}
.popbox > .tip {
font-weight: bold;
font-size: 30rpx;
text-align: center;
margin-top: 27rpx;
color: #030000;
}
.popbox > .tip2 {
font-weight: bold;
font-size: 30rpx;
text-align: center;
margin-top: 20rpx;
}
.popbox2 {
}
.popbox2 > .title {
text-align: center;
font-weight: bold;
font-size: 32rpx;
padding: 20rpx 0;
color: #212121;
}
.popbox2 > .tipimg {
margin: 20rpx 28rpx 0;
}
.popbox2 > .tipvideo {
margin: 20rpx 28rpx 0;
width: calc(100% - 28rpx - 28rpx);
height: 630rpx;
}
.popbox2 > .tiptext {
text-align: center;
color: #666666;
margin-top: 30rpx;
padding: 0 20rpx;
font-size: 28rpx;
}
.popbox2 > .popbox2btn > .nextbtn {
background: #000;
width: 270rpx;
height: 90rpx;
/*padding: 0 74rpx;*/
text-align: center;
color: #fff;
font-size: 30rpx;
line-height: 90rpx;
/*margin: 50rpx auto 30rpx;*/
border-radius: 45rpx;
box-sizing: border-box;
}
.popbox2 > .popbox2btn > .prebtn {
width: 270rpx;
height: 90rpx;
/*padding: 0 74rpx;*/
text-align: center;
color: #000;
font-size: 30rpx;
line-height: 90rpx;
/*margin: 40rpx auto 30rpx;*/
border-radius: 45rpx;
border: 1px solid #000;
margin-right: 20rpx;
box-sizing: border-box;
}
.popbox2btn {
display: flex;
align-items: center;
justify-content: center;
padding: 73rpx 54rpx 44rpx;
}
.finish-tips {
margin-bottom: 80rpx;
font-size: 36rpx;
color: #030000;
text-align: center;
font-weight: bold;
}
.finish-icon {
width: 120rpx;
height: 120rpx;
}
.finish-btn {
background: #000;
width: 270rpx;
height: 90rpx;
text-align: center;
color: #fff;
font-size: 30rpx;
line-height: 90rpx;
margin: 40rpx auto 0;
border-radius: 45rpx;
}

@ -0,0 +1,333 @@
import Taro from "@tarojs/taro";
import classnames from "classnames";
import { Component, PropsWithChildren, useEffect, useState } from "react";
import {
Block,
View,
Video,
Text,
Image,
Input,
Button,
ScrollView,
Textarea,
Canvas,
} from "@tarojs/components";
import Navbar from "@/components/navbar/navbar";
import { InstrumentInfo } from "@/utils/Interface";
import "./index.less";
import { contraction, getImgInfo } from "@/utils/compressImage";
import PopupAlert from "@/components/popup/popup-alert";
export default class InstrumentClickInUpload extends Component<any, any> {
constructor(props) {
super(props);
this.state = {
name: "仪器打卡上传",
year: new Date().getFullYear(),
month: String(new Date().getMonth() + 1).padStart(2, "0"),
day: String(new Date().getDate()).padStart(2, "0"),
zkmoshiindex: 0,
moshiindex: null,
buzhouindex: null,
autoplay: false,
scrollleft: 0,
sysinfo: Taro.getSystemInfoSync(),
showVideoPlayBtn: true,
duration: 0,
punchInInfo: {
imageList: [],
content: "",
instrumentId: "84",
},
// 现在选中的数据
currentInfo: {
modeVideo: "",
},
modeInfo: [],
isModeLock: false,
};
}
async onLoad() {
this.initData();
}
componentDidMount() {}
componentWillUnmount() {}
componentDidShow() {}
componentDidHide() {}
async initData() {
this.firstNurseInfo();
this.modeInfoList();
}
firstNurseInfo = async () => {
let res = await InstrumentInfo.firstNurseInfo({
instrumentId: "84",
});
console.log("firstNurseInfo", res);
};
modeInfoList = async () => {
let res = await InstrumentInfo.modeInfoList({
instrumentId: "84",
});
console.log("modeInfo", res);
if (res.data.code === 200) {
if (res.data.data.length) {
this.setState({
currentInfo: res.data.data[0],
modeInfo: res.data.data,
});
}
}
};
bindMoshi = async (index) => {
let { currentInfo, modeInfo, punchInInfo } = this.state;
currentInfo = modeInfo[index];
this.setState({ zkmoshiindex: index, currentInfo });
};
// 选择图片上传
handleChooseImage = async () => {
let { punchInInfo } = this.state;
Taro.chooseMedia({
count: 1,
mediaType: ["image"],
sourceType: ["album", "camera"],
sizeType: ["compressed"],
camera: "back",
success: async (res) => {
const tempFilePath = res.tempFiles[0].tempFilePath;
let img = await getImgInfo(tempFilePath);
let compressImage = await contraction(img, "compressImage");
// 压缩后文件地址
let compressTempFilePath = compressImage.tempFilePath;
punchInInfo.imageList.push(compressTempFilePath);
this.setState({ punchInInfo });
},
});
};
handleDeleteImage = async (index) => {
let { punchInInfo } = this.state;
punchInInfo.imageList.splice(index, 1);
this.setState({ punchInInfo });
};
onModeLockOpen = async () => {
this.setState({ isModeLock: true });
};
onModeLockClose = async () => {
this.setState({ isModeLock: false });
};
onTipShow = async () => {};
handleSubmit = async () => {};
render() {
let {
name,
duration,
showVideoPlayBtn,
scrollleft,
zkmoshiindex,
punchInInfo,
tipshow,
currentInfo,
modeInfo,
isModeLock,
} = this.state;
return (
<Block>
<Navbar titleSlot="打卡上传" isBack={true} />
<Canvas
style="height: 0"
id="compressImage"
canvasId="compressImage"
type="2d"
></Canvas>
<PopupAlert
isShow={isModeLock}
title="提示"
content="该模式即将上线,敬请期待"
confirmButtonText="知道了"
textAlgin="center"
isClose={false}
close={this.onModeLockClose}
confirm={this.onModeLockClose}
></PopupAlert>
<View className="infobox1 flex aitems jcenter">
<View className="img">
<Video
src={currentInfo.modeVideo}
id="myVideo"
enableProgressGesture={false}
controls={true}
autoplay={false}
loop={false}
showMuteBtn={true}
onTimeUpdate={this.Videobindtimeupdate}
onEnded={this.videoEnded}
onPause={this.videoPause}
onPlay={this.videoPlay}
showCenterPlayBtn={false}
onLoadedMetaData={this.videoLoadedMetaData}
style="width: 100%; height: 100%;border-radius: 30rpx;"
/>
{showVideoPlayBtn && (
<View className="video-cover">
<Image
className="video-cover-icon"
src={require("../../img/fr200/play.png")}
onClick={this.onPlayTap}
></Image>
{duration && (
<View className="Video-cover-time">{duration}</View>
)}
</View>
)}
</View>
</View>
<View className="infobox3">
<ScrollView
style="white-space: nowrap; height: 100%;"
scroll-x={true}
scroll-left={scrollleft}
>
{modeInfo.map((item, index) => {
return (
<View
className="info1"
onClick={this.bindMoshi.bind(this, index)}
key={index}
>
<View
className="flex aitems"
style="height: 100%; {{zkmoshiindex == index ? 'background: linear-gradient(90deg, #EFDCC2, #FFF2DF)': ''}}"
>
<View className="block1">
<View
className="block1_1 flex aitems "
style="min-width: 80rpx"
>
<View className="tip1">{item.modeName}</View>
<View className="tip2">{item.modeDesc}</View>
{!item.lock && zkmoshiindex !== index && (
<View className="quan1"></View>
)}
{!item.lock && zkmoshiindex == index && (
<View className="quan1 is-select flex aitems jcenter">
<View className="quan2"></View>
</View>
)}
{item.lock && (
<View className="icon">
<Image
src="/img/fr200/suo.png"
mode="aspectFill"
></Image>
</View>
)}
</View>
</View>
{item.modeBanner && (
<View className="info1_img">
<Image src={item.modeBanner} mode="aspectFill" />
</View>
)}
</View>
</View>
);
})}
</ScrollView>
</View>
<View className="infobox2">
<View className="infobox2_info">
<View className="info4">
<View className="upload_header flex aitems sb">
<View className="upload_title"></View>
<View className="icon" onClick={this.onTipShow}>
<Image
src={require("../../img/clock_in_upload/info.png")}
mode="aspectFill"
></Image>
</View>
</View>
<View className="imgbox flex aitems">
{punchInInfo.imageList.length > 0 &&
punchInInfo.imageList.map((item, index) => {
return (
<View className="img" key={"clickin_" + index}>
<Image src={item}></Image>
<View
className="close flex aitems jcenter"
data-index="{{index}}"
onClick={this.handleDeleteImage}
>
<Image
src={require("../../img/fr200/close_white.png")}
mode="widthFix"
></Image>
</View>
</View>
);
})}
{punchInInfo.imageList.length < 3 && (
<View
className="img2 flex aitems jcenter"
onClick={this.handleChooseImage}
>
<Image
src={require("../../img/fr200/add-Image.png")}
mode="aspectFill"
></Image>
</View>
)}
</View>
<View className="content">
{!tipshow && (
<Textarea
placeholder-className="placeholder"
maxlength={120}
onInput={this.handleTextareaInput}
value={punchInInfo.content}
placeholder="请记录一下今天打卡的心得吧~"
></Textarea>
)}
{tipshow && (
<View className="Textarea">
{punchInInfo.content
? punchInInfo.content
: "请记录一下今天打卡的心得吧~"}
</View>
)}
</View>
</View>
</View>
</View>
<View className="confirm_btn flex aitems" onClick={this.handleSubmit}>
<View className="btn"></View>
</View>
</Block>
);
}
}

@ -8,6 +8,8 @@ import Navbar from "../../components/navbar/navbar";
import "./index.less";
import { getStorageSync } from "@/utils/traoAPI";
import { InstrumentInfo } from "@/utils/Interface";
export default class InstrumentDetail extends Component<any, any> {
constructor(props) {
super(props);
@ -32,21 +34,30 @@ export default class InstrumentDetail extends Component<any, any> {
let objStr = getStorageSync("instrument_detail");
if (objStr) {
let info = JSON.parse(objStr);
this.setState({ info: info });
this.bindingInstrumentInfo(info.id);
}
}
bindingInstrumentInfo = async (id: string | number = "") => {
let res = await InstrumentInfo.bindingInstrumentInfo({
instrumentId: id,
});
if (res.data.code === 200) {
this.setState({ info: res.data.data });
}
};
render() {
let { name, info } = this.state;
let { info } = this.state;
return (
<Block>
<Navbar titleSlot="设备信息" background="#fff" isBack={true} />
<Block>
<View className="list">
<View className="instrument_img">
<Image src={info.banner} />
<Image src={info.instrumentBanner} />
<View className="bind_status"></View>
<View className="titile">{info.name}</View>
<View className="titile">{info.instrumentName}</View>
{/* {info.iot == 2 && (
<View className="iot_versions">
{info.iot_versions}
@ -64,14 +75,18 @@ export default class InstrumentDetail extends Component<any, any> {
type="text"
disabled={true}
placeholder-style="color:#000000;font-size:28rpx;font-weight: 500;"
placeholder={info.serial}
placeholder={info.bindingSerial}
/>
</View>
</View>
<View className="box">
<View className="tip2"></View>
<Image className="serial_img" src={info.serial} mode="aspectFill" />
<Image
className="serial_img"
src={info.bindingSerialImage}
mode="aspectFill"
/>
</View>
<View className="box">
@ -93,7 +108,7 @@ export default class InstrumentDetail extends Component<any, any> {
type="text"
disabled={true}
placeholder-style="color:#000000;font-size:28rpx;font-weight: 500;"
// placeholder={info.info.warranty_name}
placeholder={info.instrumentGuarantee + "年"}
/>
</View>
</View>

@ -197,7 +197,7 @@ class User extends Component<any, any> {
return (
<Block>
<PopupAlert
{/* <PopupAlert
isShow={isDev}
isClose={true}
title="提示"
@ -206,7 +206,7 @@ class User extends Component<any, any> {
textAlgin="center"
close={this.closeDev}
confirm={this.closeDev}
/>
/> */}
<PopupAlert
isShow={isNotRegister}
isClose={true}
@ -270,8 +270,8 @@ class User extends Component<any, any> {
<View
className="block"
data-url="/pages/instrument_manage/index?isback=1"
// onClick={this.goUrlNoRegister}
onClick={this.devOpen}
onClick={this.goUrlNoRegister}
// onClick={this.devOpen}
>
<Image
className="bg_img"

@ -30,6 +30,7 @@ export default class WebViewPage extends Component<any, any> {
if (!url?.includes("https://") && !url?.includes("http://")) {
url = "https://" + url;
}
console.log("url", url);
this.setState({ url: url });
}

@ -231,9 +231,8 @@ export const GetSiteAddTag = (data) => {
// 仪器管理
export const InstrumentInfo = {
// serial 序列号
/**根据序列号获取仪器信息 serial 序列号*/
getInstrumentInfoBySerial: (data) => {
// 根据序列号获取仪器信息
return Ajax({
url:
"/instrument/getInstrumentInfoBySerial" + paramsToUrlQueryString(data),
@ -241,8 +240,8 @@ export const InstrumentInfo = {
method: "get",
});
},
/**根据序列号获取仪器信息*/
isBindingSerial: (data) => {
// 根据序列号获取仪器信息
return Ajax({
url: "/instrument/isBindingSerial" + paramsToUrlQueryString(data),
data,
@ -250,55 +249,48 @@ export const InstrumentInfo = {
});
},
/**绑定仪器*/
binding: (data) => {
// 绑定仪器
return Ajax({
url: "/instrument/binding" + paramsToUrlQueryString(data),
data,
method: "get",
});
},
/**更换绑定仪器*/
exchangeBinding: (data) => {
// 更换绑定仪器
return Ajax({
url: "/instrument/exchangeBinding" + paramsToUrlQueryString(data),
data,
method: "get",
});
},
/**获取当前用户:已绑定仪器列表*/
bindingInstrumentList: () => {
// 获取当前用户:已绑定仪器列表
return Ajax({
url: "/instrument/bindingInstrumentList",
method: "get",
});
},
/**获取当前用户:未绑定仪器列表*/
unbindingInstrumentInfoList: () => {
// 获取当前用户:未绑定仪器列表
return Ajax({
url: "/instrument/unbindingInstrumentInfoList",
method: "get",
});
},
bindingInstrumentInfo: () => {
// 获取当前用户:绑定记录 instrumentId
/**获取当前用户:绑定记录 instrumentId*/
bindingInstrumentInfo: (data) => {
return Ajax({
url: "/instrument/bindingInstrumentInfo" + paramsToUrlQueryString(data),
method: "get",
});
},
// manualCodeBinding: (data) => {
// // 用户手动绑定仪器
// return Ajax({
// url: "/instrument/manualCodeBinding",
// data,
// method: "post",
// });
// },
/**用户手动绑定仪器 file 图片文件*/
manualCodeBinding: (formData) => {
// 用户手动绑定仪器 file 图片文件
return AjaxUploadFile(
{
url: "/instrument/manualCodeBinding",
@ -309,37 +301,108 @@ export const InstrumentInfo = {
);
},
/**用户扫码绑定仪器 serial instrumentId*/
scanCodeBinding: (data) => {
// 用户扫码绑定仪器 serial instrumentId
return Ajax({
url: "/instrument/scanCodeBinding" + paramsToUrlQueryString(data),
method: "get",
});
},
/**根据仪器ID获取仪器介绍信息 instrumentId*/
instructionInfo: (data) => {
// 根据仪器ID获取仪器介绍信息 instrumentId
return Ajax({
url: "/instrument/instructionInfo" + paramsToUrlQueryString(data),
data,
method: "get",
});
},
/**根据仪器ID获取仪器的初次护理信息*/
firstNurseInfo: (data) => {
// 根据仪器ID获取仪器的初次护理信息
return Ajax({
url: "/instrument/firstNurseInfo" + paramsToUrlQueryString(data),
data,
method: "get",
});
},
modeInfo: (data) => {
// 根据仪器ID获取仪器模式
/**根据仪器ID获取仪器模式列表*/
modeInfoList: (data) => {
return Ajax({
url: "/instrument/modeInfo" + paramsToUrlQueryString(data),
data,
url: "/instrument/modeInfoList" + paramsToUrlQueryString(data),
method: "get",
});
},
/**获取设备升级数据 instrumentId*/
getUpgrade: (data) => {
return Ajax({
url: "/instrument/upgrade" + paramsToUrlQueryString(data),
method: "get",
});
},
/**打卡相关*/
clock: {
/**添加用户使用仪器记录 instrumentId*/
addClockInstrument: (data) => {
return Ajax({
url: "/clock/addClockInstrument" + paramsToUrlQueryString(data),
data,
method: "get",
});
},
/**用户打卡*/
postInsertClockLog: (data) => {
return Ajax({
url: "/clock/insertClockLog",
data,
method: "post",
});
},
/**查询用户当天最新的一条打卡记录*/
getLatestClockRecord: (data) => {
return Ajax({
url: "/clock/latestClockRecord",
method: "get",
});
},
/**分页获取用户的打卡记录 page size*/
getList: (data) => {
return Ajax({
url: "/clock/list" + paramsToUrlQueryString(data),
data,
method: "get",
});
},
/**分页获取打卡统计*/
getClockStatistics: (data) => {
return Ajax({
url: "/clock/clockStatistics",
method: "get",
});
},
},
/**护理相关*/
nursingLog: {
/**新增用户护理日志*/
addLog: (data) => {
return Ajax({
url: "/nursingLog/add",
data,
method: "post",
});
},
/**查询用户护理记录*/
getRecord: (data) => {
return Ajax({
url: "/nursingLog/record" + paramsToUrlQueryString(data),
method: "get",
});
},
/**查询用户护理记录的当月统计信息*/
getStatistics: (data) => {
return Ajax({
url: "/nursingLog/statistics" + paramsToUrlQueryString(data),
method: "get",
});
},
},
};
//localhost:9204/instrument/getInstrumentInfoBySerial

@ -51,7 +51,7 @@ export const Ajax = (params) => {
},
data: params.data,
success(res) {
// console.log("res", res);
console.log("res", res);
if (res.data.code == 401 || res.data.code == 403) {
// 自动重新登录
Taro.removeStorageSync("token");
@ -78,7 +78,12 @@ export const Ajax = (params) => {
return false;
}
reject(res);
Taro.showModal({
title: "提示",
content: String(res.data.msg),
showCancel: false,
});
// reject(res);
return false;
}

Loading…
Cancel
Save