diff --git a/src/pages/index/index.less b/src/pages/index/index.less index 12513f1..cf1dd32 100644 --- a/src/pages/index/index.less +++ b/src/pages/index/index.less @@ -1015,3 +1015,37 @@ page { } } } + .custom-popup{ + background: none !important; +} +.van-popup { + border-radius: 30rpx; + .popBox { + // box-sizing: border-box; + // width: 670rpx; + // height: 840rpx; + // background: #ffffff; + // border-radius: 30rpx; + // position: relative; + // padding: 42rpx 30rpx 0; + -webkit-box-sizing: border-box; + box-sizing: border-box; + width: 670rpx; + height: 250rpx; + background: rgba(0,0,0,0.6); + border-radius: 30rpx; + position: relative; + text-align: center; + color: #ffff; + line-height: 250rpx; + opacity: 0.8; + .close_icon { + position: absolute; + width: 50rpx; + height: 50rpx; + top: 34rpx; + right: 34rpx; + } + + } +} \ No newline at end of file diff --git a/src/pages/index/index.tsx b/src/pages/index/index.tsx index 333fe79..43a4495 100644 --- a/src/pages/index/index.tsx +++ b/src/pages/index/index.tsx @@ -11,7 +11,7 @@ import { SwiperItem, RichText, } from "@tarojs/components"; - +import { Popup } from "@antmjs/vantui"; /*** redux ***/ import { connect } from "react-redux"; import { userRefresh, tokenRefresh } from "@/store/features/userInfo"; @@ -135,6 +135,7 @@ class Index extends Component { /** 已绑定仪器 */ instrument_detail: {}, + show: false, /* 已绑定仪器 END */ /** 蓝牙相关 */ @@ -361,7 +362,10 @@ class Index extends Component { goRegister() { go("/pages/register/register"); } - + // 查看所有设备是否绑定完 + Alldevice = () => { + console.log(this.state.isDisabledClickAddDevic, "查看"); + }; // 新增设备 addNewDevice = () => { if (this.isRegister("addNewDevice")) { @@ -416,10 +420,27 @@ class Index extends Component { go(`/pages/recording/recording?param=${ViewAddInstrument}`); }; - gourl = (e) => { + gourl = async (e) => { + console.log("添加新设备", e); + const { url } = e.currentTarget.dataset; if (this.isRegister()) { - go(url); + if (url === "/pages/instrument/instrument") { + let { data } = await InstrumentInfo.unbindingInstrumentInfoList(); + console.log(data, "查看未绑定设备"); + if (data.data.length === 0) { + this.setState({ + show: true, + }); + setTimeout(() => { + this.setState({ show: false }); + }, 1000); // 2秒后将 show 变量置为 false + } else { + go(url); + } + } else { + go(url); + } } }; @@ -954,6 +975,7 @@ class Index extends Component { }; render() { let { + show, isCommonError, commonErrorText, calendarComplete, @@ -1322,6 +1344,9 @@ class Index extends Component { + + 你已绑定所有设备 + ); } diff --git a/src/pages/instrument/instrument.less b/src/pages/instrument/instrument.less index cdda653..5755a25 100644 --- a/src/pages/instrument/instrument.less +++ b/src/pages/instrument/instrument.less @@ -393,3 +393,4 @@ margin-right: 60rpx; border-radius: 45rpx; color: #fff; } + \ No newline at end of file diff --git a/src/pages/instrument/instrument.tsx b/src/pages/instrument/instrument.tsx index 94ca1aa..26f8e63 100644 --- a/src/pages/instrument/instrument.tsx +++ b/src/pages/instrument/instrument.tsx @@ -50,6 +50,7 @@ export default class Instrument extends Component { serialImage: "", serialCode: "", }, + show: true, equipmentList: [ { id: 1, @@ -241,6 +242,8 @@ export default class Instrument extends Component { // 未绑定列表 unbindingInstrumentInfoList = async () => { let { data } = await InstrumentInfo.unbindingInstrumentInfoList(); + console.log(data, "查看未绑定设备"); + if (data.code === 200) { if (data.data.length) { if (!this.isOnly) { @@ -455,6 +458,7 @@ export default class Instrument extends Component { isBindingError, isBindingError203, isBindingCheckError, + show, channelInfo, inputType, style, diff --git a/src/pages/instrument_manage/index.less b/src/pages/instrument_manage/index.less index 966e9bc..0eb86ad 100644 --- a/src/pages/instrument_manage/index.less +++ b/src/pages/instrument_manage/index.less @@ -83,7 +83,12 @@ page { } } } - + .backColer{ + background: linear-gradient(to bottom, #e3e3e3, #f8f8f8); + height: 211rpx; + padding: 0rpx 0rpx; + border-radius: 50px; + } .bind_cont { .title { text-align: center; diff --git a/src/pages/instrument_manage/index.tsx b/src/pages/instrument_manage/index.tsx index 4cc8bf2..9ee030b 100644 --- a/src/pages/instrument_manage/index.tsx +++ b/src/pages/instrument_manage/index.tsx @@ -184,7 +184,7 @@ export default class InstrumentManage extends Component { - + {item.name} { className="showImg" src={require("../../img/clock_in_upload/add-image.png")} mode="widthFix" + > )}