|
|
|
|
@ -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 {
|
|
|
|
|
// 获取失败和绑定失败一个弹窗
|
|
|
|
|
|