修改样式

master
qsj 2 years ago
parent b0f96cce8f
commit 8221a2bfe3

@ -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;
}
}
}

@ -11,7 +11,7 @@ import {
SwiperItem, SwiperItem,
RichText, RichText,
} from "@tarojs/components"; } from "@tarojs/components";
import { Popup } from "@antmjs/vantui";
/*** redux ***/ /*** redux ***/
import { connect } from "react-redux"; import { connect } from "react-redux";
import { userRefresh, tokenRefresh } from "@/store/features/userInfo"; import { userRefresh, tokenRefresh } from "@/store/features/userInfo";
@ -134,6 +134,7 @@ class Index extends Component<any, any> {
/** 已绑定仪器 */ /** 已绑定仪器 */
instrument_detail: {}, instrument_detail: {},
show: false,
/* 已绑定仪器 END */ /* 已绑定仪器 END */
/** 蓝牙相关 */ /** 蓝牙相关 */
@ -162,11 +163,11 @@ class Index extends Component<any, any> {
} }
} }
componentDidMount() {} componentDidMount() { }
componentWillUnmount() { componentWillUnmount() {
// 页面卸载监听 // 页面卸载监听
Taro.offAppHide((res) => {}); Taro.offAppHide((res) => { });
this.$instance = null; this.$instance = null;
} }
@ -248,7 +249,7 @@ class Index extends Component<any, any> {
this.isSancQrcodeEnter(); this.isSancQrcodeEnter();
} }
}, },
fail: () => {}, fail: () => { },
complete: () => { complete: () => {
// 授权完成运行页面初始化 // 授权完成运行页面初始化
}, },
@ -360,10 +361,16 @@ class Index extends Component<any, any> {
goRegister() { goRegister() {
go("/pages/register/register"); go("/pages/register/register");
} }
// 查看所有设备是否绑定完
Alldevice = () => {
console.log(this.state.isDisabledClickAddDevic, '查看');
}
// 新增设备 // 新增设备
addNewDevice = () => { addNewDevice = () => {
if (this.isRegister("addNewDevice")) { if (this.isRegister("addNewDevice")) {
if (this.state.isDisabledClickAddDevice) { if (this.state.isDisabledClickAddDevice) {
msg("您已绑定所有设备"); msg("您已绑定所有设备");
return; return;
@ -415,12 +422,32 @@ class Index extends Component<any, any> {
go(`/pages/recording/recording?param=${ViewAddInstrument}`); go(`/pages/recording/recording?param=${ViewAddInstrument}`);
}; };
gourl = (e) => { gourl = async (e) => {
console.log('添加新设备', e);
const { url } = e.currentTarget.dataset; const { url } = e.currentTarget.dataset;
if (this.isRegister()) { 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);
}
} }
}; };
@ -432,7 +459,7 @@ class Index extends Component<any, any> {
this.setState({ isShowSiteSwiper: false }); this.setState({ isShowSiteSwiper: false });
}; };
bannerSwiperchange() {} bannerSwiperchange() { }
gobanner(item) { gobanner(item) {
// 跳转类型0无跳转、1跳转内部链接、3跳转外部链接、4跳转小程序、5导向视频号、6导向视频号直播间', // 跳转类型0无跳转、1跳转内部链接、3跳转外部链接、4跳转小程序、5导向视频号、6导向视频号直播间',
@ -480,11 +507,11 @@ class Index extends Component<any, any> {
mask: true, mask: true,
}); });
let { data: res } = await InstrumentInfo.bindingInstrumentList(); let { data: res } = await InstrumentInfo.bindingInstrumentList();
console.log(res,'查看绑定的设备'); console.log(res, '查看绑定的设备');
// Taro.hideLoading(); // Taro.hideLoading();
if (res.code === 200) { if (res.code === 200) {
if(res.data.length === 0){ if (res.data.length === 0) {
this.setState({ ViewAddInstrument: false }); this.setState({ ViewAddInstrument: false });
} }
this.setState({ instrumentList: res.data }); this.setState({ instrumentList: res.data });
@ -739,7 +766,7 @@ class Index extends Component<any, any> {
// 跳转仪器介绍页 // 跳转仪器介绍页
goNursing = (item) => { goNursing = (item) => {
if (item.status === 0) { if (item.status === 0) {
setStorageSync("instrument_detail", item); setStorageSync("instrument_detail", item);
this.setState({ connectInstrument: item }); this.setState({ connectInstrument: item });
@ -755,7 +782,7 @@ class Index extends Component<any, any> {
/** 蓝牙逻辑 */ /** 蓝牙逻辑 */
bindBlockLeft() { bindBlockLeft() {
if (!this.state.isRegisterBoolean) { if (!this.state.isRegisterBoolean) {
//未注册授权 //未注册授权
this.alertRegister(); this.alertRegister();
@ -944,6 +971,7 @@ class Index extends Component<any, any> {
}; };
render() { render() {
let { let {
show,
isCommonError, isCommonError,
commonErrorText, commonErrorText,
calendarComplete, calendarComplete,
@ -1227,7 +1255,7 @@ class Index extends Component<any, any> {
src={require("../../img/black-add.png")} src={require("../../img/black-add.png")}
mode="aspectFill" mode="aspectFill"
/> />
<View className="txt"></View> <View className="txt" ></View>
</View> </View>
</View> </View>
@ -1301,6 +1329,9 @@ class Index extends Component<any, any> {
</Swiper> </Swiper>
</View> </View>
<View style="height:200rpx"></View> <View style="height:200rpx"></View>
<Popup show={show} className="custom-popup" overlay={false}>
<View className="popBox"></View>
</Popup>
</Block> </Block>
); );
} }

@ -393,3 +393,4 @@ margin-right: 60rpx;
border-radius: 45rpx; border-radius: 45rpx;
color: #fff; color: #fff;
} }

@ -16,7 +16,7 @@ import {
ScrollView, ScrollView,
Canvas, Canvas,
} from "@tarojs/components"; } from "@tarojs/components";
import { InstrumentInfo } from "@/utils/Interface"; import { InstrumentInfo } from "@/utils/Interface";
import { go, msg, setStorageSync } from "@/utils/traoAPI"; import { go, msg, setStorageSync } from "@/utils/traoAPI";
@ -49,6 +49,7 @@ export default class Instrument extends Component<any, any> {
serialImage: "", serialImage: "",
serialCode: "", serialCode: "",
}, },
show:true,
equipmentList: [ equipmentList: [
{ {
id: 1, id: 1,
@ -243,6 +244,8 @@ export default class Instrument extends Component<any, any> {
// 未绑定列表 // 未绑定列表
unbindingInstrumentInfoList = async () => { unbindingInstrumentInfoList = async () => {
let { data } = await InstrumentInfo.unbindingInstrumentInfoList(); let { data } = await InstrumentInfo.unbindingInstrumentInfoList();
console.log(data,'查看未绑定设备');
if (data.code === 200) { if (data.code === 200) {
if (data.data.length) { if (data.data.length) {
if (!this.isOnly) { if (!this.isOnly) {
@ -316,7 +319,7 @@ export default class Instrument extends Component<any, any> {
instrumentId: channelInfo.id, instrumentId: channelInfo.id,
}); });
Taro.hideLoading(); Taro.hideLoading();
if (res.data.code === 200) { if (res.code === 200) {
// this.bindingInstrument(); // this.bindingInstrument();
this.openBindingVisible(); this.openBindingVisible();
} else if (res.data.code === 204 || res.data.code === 205) { } else if (res.data.code === 204 || res.data.code === 205) {
@ -414,6 +417,7 @@ export default class Instrument extends Component<any, any> {
isBindingError, isBindingError,
isBindingError203, isBindingError203,
isBindingCheckError, isBindingCheckError,
show,
channelInfo, channelInfo,
inputType, inputType,
style, style,
@ -672,6 +676,7 @@ export default class Instrument extends Component<any, any> {
</View> </View>
)} )}
</View> </View>
</Block> </Block>
); );
} }

@ -83,7 +83,12 @@ page {
} }
} }
} }
.backColer{
background: linear-gradient(to bottom, #e3e3e3, #f8f8f8);
height: 211rpx;
padding: 0rpx 0rpx;
border-radius: 50px;
}
.bind_cont { .bind_cont {
.title { .title {
text-align: center; text-align: center;

@ -184,7 +184,7 @@ export default class InstrumentManage extends Component<any, any> {
</View> </View>
</View> </View>
</View> </View>
<View className="bind_cont"> <View className="bind_cont backColer">
<View className="title">{item.name}</View> <View className="title">{item.name}</View>
<View <View
className="bindinfo" className="bindinfo"

Loading…
Cancel
Save