临时提交

master
blak-kong 2 years ago
parent 4cebc23867
commit 30a84112b7

@ -1,5 +1,6 @@
import classnames from "classnames"; import classnames from "classnames";
import { Component } from "react"; import { Component } from "react";
import Taro from "@tarojs/taro";
import { Block, View, Button, PageMeta } from "@tarojs/components"; import { Block, View, Button, PageMeta } from "@tarojs/components";
@ -78,6 +79,9 @@ export default class PopupBinding extends Component<any, any> {
isLarge, isLarge,
type, type,
} = this.props; } = this.props;
let serial = Taro.getStorageSync("serial");
let isSerial = String(serial) === String(data.serial) ? true : false;
return ( return (
<Block> <Block>
<PageMeta pageStyle={isShow ? "overflow: hidden;" : ""} /> <PageMeta pageStyle={isShow ? "overflow: hidden;" : ""} />
@ -103,7 +107,7 @@ export default class PopupBinding extends Component<any, any> {
></PopupAlert> ></PopupAlert>
)} )}
{isRegisterBoolean && type === 0 && ( {isRegisterBoolean && (type === 1 || type === 2) && (
<PopupConfirm <PopupConfirm
isShow={isShow} isShow={isShow}
isClose={false} isClose={false}

@ -70,9 +70,8 @@ export default class PopupConfirm extends Component<any, any> {
isShow, isShow,
isClose, isClose,
isLarge, isLarge,
type = 0, type,
} = this.props; } = this.props;
console.log("type", type);
return ( return (
<Block> <Block>
<PageMeta pageStyle={isShow ? "overflow: hidden;" : ""} /> <PageMeta pageStyle={isShow ? "overflow: hidden;" : ""} />

@ -202,7 +202,6 @@ class Index extends Component<any, any> {
initPageData() { initPageData() {
const mobile = Taro.getStorageSync("mobile"); const mobile = Taro.getStorageSync("mobile");
this.GetSiteCarousel(); this.GetSiteCarousel();
if (mobile) { if (mobile) {
@ -269,10 +268,8 @@ class Index extends Component<any, any> {
GetSiteAddTag = async (id) => { GetSiteAddTag = async (id) => {
let res = await GetSiteAddTag(id); let res = await GetSiteAddTag(id);
console.log("tag", res.data);
if (res.data.code === 200) { if (res.data.code === 200) {
if (res.data.data) { console.log("点击自动上报,不需要逻辑处理");
}
} }
}; };
@ -369,9 +366,9 @@ class Index extends Component<any, any> {
title: "请求中...", title: "请求中...",
mask: true, mask: true,
}); });
let { instrumentInfo } = this.state; // let { instrumentInfo } = this.state;
let { data } = await InstrumentInfo.bindingInstrumentList(); let { data } = await InstrumentInfo.bindingInstrumentList();
console.log("bindingInstrument", data); console.log("bindingInstrumentList", data);
Taro.hideLoading(); Taro.hideLoading();
if (data.code === 200) { if (data.code === 200) {
this.setState({ instrumentList: data.data }); this.setState({ instrumentList: data.data });
@ -386,7 +383,7 @@ class Index extends Component<any, any> {
// 扫码进入强制重新登录 // 扫码进入强制重新登录
this.WCUserLogin(); this.WCUserLogin();
} else { } else {
this.initPageData(); this.initData();
} }
}; };
async WCUserLogin() { async WCUserLogin() {
@ -413,11 +410,8 @@ class Index extends Component<any, any> {
this.setState({ isVisibleBinding: false }); this.setState({ isVisibleBinding: false });
}; };
confirmBinding = () => { confirmBinding = () => {
let { instrumentInfo } = this.state; // let { instrumentInfo } = this.state;
// 0未绑定 1 2 this.bindingInstrument();
if (instrumentInfo.bindingStatus === 0) {
this.bindingInstrument();
}
}; };
// 根据扫码的序列号获取仪器信息 // 根据扫码的序列号获取仪器信息
getInstrumentInfoBySerial = async () => { getInstrumentInfoBySerial = async () => {
@ -432,14 +426,23 @@ class Index extends Component<any, any> {
Taro.removeStorageSync("isScan"); Taro.removeStorageSync("isScan");
Taro.removeStorageSync("serial"); // 获取成功,以后删除缓存的扫码序列号 Taro.removeStorageSync("serial"); // 获取成功,以后删除缓存的扫码序列号
let isVisibleBinding = false; let isVisibleBinding = false;
if (data.data.bindingStatus === 0) { let instrumentInfo = data.data;
// 1有效 0无效
if (instrumentInfo.validStatus === 0) {
this.setState({ isBindingError: true });
}
// 0已绑定 1未绑定 2已解绑
if (
instrumentInfo.bindingStatus === 1 ||
instrumentInfo.bindingStatus === 2
) {
isVisibleBinding = true; isVisibleBinding = true;
} }
// 更新扫码进入仪器信息 // 更新扫码进入仪器信息
this.setState({ this.setState({
isVisibleBinding, isVisibleBinding,
instrumentInfo: data.data, instrumentInfo: instrumentInfo,
}); });
} else { } else {
// 获取失败和绑定失败一个弹窗 // 获取失败和绑定失败一个弹窗

@ -21,7 +21,6 @@ import { InstrumentInfo } from "../../utils/Interface";
import { go, back, loading, msg, showModal } from "../../utils/traoAPI"; import { go, back, loading, msg, showModal } from "../../utils/traoAPI";
import { isVideo } from "../../utils/util"; import { isVideo } from "../../utils/util";
import utilHtml from "../../utils/utilhtml"; import utilHtml from "../../utils/utilhtml";
// const log = require("../../utils/log");
import { getImgInfo, contraction } from "../../utils/compressImage"; import { getImgInfo, contraction } from "../../utils/compressImage";
@ -350,7 +349,7 @@ export default class Instrument extends Component<any, any> {
} = this.state; } = this.state;
return ( return (
<Block> <Block>
{/* <PopupAlert <PopupAlert
isShow={true} isShow={true}
isClose={true} isClose={true}
title="提示" title="提示"
@ -359,7 +358,7 @@ export default class Instrument extends Component<any, any> {
textAlgin="center" textAlgin="center"
close={this.closeDev} close={this.closeDev}
confirm={this.closeDev} confirm={this.closeDev}
/> */} />
<Navbar titleSlot="仪器绑定" isBack={true} /> <Navbar titleSlot="仪器绑定" isBack={true} />
<PopupAlert <PopupAlert
isShow={isBindingError} isShow={isBindingError}

@ -0,0 +1,3 @@
export default definePageConfig({
navigationBarTitleText: "仪器介绍",
});
Loading…
Cancel
Save