临时提交

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

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

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

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

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

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