qsj 2 years ago
commit 21875f2c5e

@ -3,6 +3,8 @@ import dayjs from "dayjs";
import React from "react"; import React from "react";
import Taro, { Events } from "@tarojs/taro"; import Taro, { Events } from "@tarojs/taro";
import { throttle } from "lodash";
import { Swiper, SwiperItem, View, Image } from "@tarojs/components"; import { Swiper, SwiperItem, View, Image } from "@tarojs/components";
import { import {
BaseEventOrig, BaseEventOrig,
@ -429,7 +431,10 @@ export default class AtCalendarBody extends React.Component<any, any> {
<AtCalendarDateList list={temporaryCalendar} /> <AtCalendarDateList list={temporaryCalendar} />
</View> </View>
</View> </View>
<View className="arrow_box" onClick={this.onChangeFoldingCalendar}> <View
className="arrow_box"
onClick={throttle(this.onChangeFoldingCalendar.bind(this), 800)}
>
<Image <Image
className={classnames("arrow", { className={classnames("arrow", {
"arrow-rotate": isFolding, "arrow-rotate": isFolding,

@ -15,7 +15,7 @@ export default class Index extends Component {
isShowPrivacyPopup: true, isShowPrivacyPopup: true,
isMask: false, isMask: false,
isNotRegister: false, isNotRegister: false,
selected: 2, selected: 0,
color: "#999", color: "#999",
selectedColor: "#000", selectedColor: "#000",
backgroundColor: "#ffffff", backgroundColor: "#ffffff",

@ -175,20 +175,24 @@ class Index extends Component<any, any> {
componentDidShow() { componentDidShow() {
const tabbar = Taro.getTabBar<CustomTabBar>(this.$instance.page); const tabbar = Taro.getTabBar<CustomTabBar>(this.$instance.page);
tabbar?.setSelected(0); tabbar?.setSelected(0);
console.log(this.state.instrumentInfo, '查看', this.state.instrumentList, Taro.getStorageSync("skipRegister")); console.log(
this.state.instrumentInfo,
"查看",
this.state.instrumentList,
Taro.getStorageSync("skipRegister")
);
const handleAsyncLogic = async () => { const handleAsyncLogic = async () => {
// 判断是否跳过了注册 // 判断是否跳过了注册
if (Taro.getStorageSync("skipRegister")) { if (Taro.getStorageSync("skipRegister")) {
await this.EquipmentNo(); // 扫码序列号查询:注册后才调用,因为扫码未注册直接跳转注册页 await this.EquipmentNo(); // 扫码序列号查询:注册后才调用,因为扫码未注册直接跳转注册页
this.setState({ showEquipment: true }); this.setState({ showEquipment: true });
Taro.removeStorageSync("skipRegister"); Taro.removeStorageSync("skipRegister");
} else { } else {
// 已注册且非跳过,正常执行逻辑 // 已注册且非跳过,正常执行逻辑
this.showInit(); this.showInit();
} }
} };
handleAsyncLogic() handleAsyncLogic();
} }
componentDidHide() { componentDidHide() {
@ -216,7 +220,7 @@ class Index extends Component<any, any> {
} }
// 非扫码进入小程序,需判断是否跳转欢迎页;扫码进入小程序,先缓存序列号,再检测隐私弹窗 // 非扫码进入小程序,需判断是否跳转欢迎页;扫码进入小程序,先缓存序列号,再检测隐私弹窗
let serial = Taro.getStorageSync("serial"); let serial = Taro.getStorageSync("serial");
console.log(this.$instance, '2222', serial); console.log(this.$instance, "2222", serial);
let url = this.$instance.router?.params?.q || ""; let url = this.$instance.router?.params?.q || "";
if (!url) { if (!url) {
// 非扫码或扫码已跳转的返回进入 // 非扫码或扫码已跳转的返回进入
@ -231,8 +235,6 @@ class Index extends Component<any, any> {
// 是否可以运行扫码逻辑:每次扫码后设为真, // 是否可以运行扫码逻辑:每次扫码后设为真,
Taro.setStorageSync("isScanRun", true); Taro.setStorageSync("isScanRun", true);
if (url) { if (url) {
let _url = decodeURIComponent(url); let _url = decodeURIComponent(url);
if (_url.indexOf("?")) { if (_url.indexOf("?")) {
@ -331,7 +333,7 @@ class Index extends Component<any, any> {
// } // }
} }
// this.removeScanFun(); // this.removeScanFun();
} };
initPageData = async () => { initPageData = async () => {
const mobile = Taro.getStorageSync("mobile"); const mobile = Taro.getStorageSync("mobile");
const isToken = getStorageSync("token"); const isToken = getStorageSync("token");
@ -342,12 +344,10 @@ class Index extends Component<any, any> {
console.log("initPageData", Taro.getStorageSync("serial")); console.log("initPageData", Taro.getStorageSync("serial"));
// 如果是扫码且已有token则跳转 // 如果是扫码且已有token则跳转
if (Taro.getStorageSync("serial")) { if (Taro.getStorageSync("serial")) {
console.log(mobile, 'mobile'); console.log(mobile, "mobile");
// 如果已注册绑定手机号不用跳转 // 如果已注册绑定手机号不用跳转
if (!mobile) { if (!mobile) {
setTimeout(() => { setTimeout(() => {
go("/pages/register/register"); go("/pages/register/register");
}, 300); }, 300);
@ -651,7 +651,6 @@ class Index extends Component<any, any> {
}; };
// 根据扫码的序列号获取仪器信息 // 根据扫码的序列号获取仪器信息
getInstrumentInfoBySerial = async () => { getInstrumentInfoBySerial = async () => {
let url = this.$instance.router?.params?.q || ""; let url = this.$instance.router?.params?.q || "";
let isScan = Taro.getStorageSync("isScan"); // 判断是否扫码进入 let isScan = Taro.getStorageSync("isScan"); // 判断是否扫码进入
let serial = Taro.getStorageSync("serial"); // 扫码可能跳转注册页,所以先缓存 let serial = Taro.getStorageSync("serial"); // 扫码可能跳转注册页,所以先缓存
@ -659,7 +658,7 @@ class Index extends Component<any, any> {
let { data } = await InstrumentInfo.getInstrumentInfoBySerial({ let { data } = await InstrumentInfo.getInstrumentInfoBySerial({
serial: serial, serial: serial,
}); });
console.log(data, '查看赋值'); console.log(data, "查看赋值");
if (data.code === 200) { if (data.code === 200) {
let instrumentInfo = data.data; let instrumentInfo = data.data;
@ -1389,10 +1388,6 @@ class Index extends Component<any, any> {
)} )}
</View> </View>
<View style="margin: 20px">
<View onClick={this.goIot}></View>
</View>
<View className="infobox3"> <View className="infobox3">
<Swiper <Swiper
autoplay autoplay

Loading…
Cancel
Save