1
0
forked from dyf/APP

蓝牙搜索页面修改,添加名称筛选,从设备详情进入时自动带上蓝牙名筛选

This commit is contained in:
liub
2025-11-27 10:53:22 +08:00
parent d01abf267e
commit 052a7116c5

View File

@ -51,9 +51,13 @@
<text>搜索设备</text>
<view @click="refreshBleList()">刷新</view>
</view>
<view class="lblTitle">
<uni-easyinput :styles="{color:'#ffffff'}" :clearable="true" class="uni-mt-5" :trim="'both'"
prefixIcon="search" v-model="search" placeholder="名称筛选"></uni-easyinput>
</view>
<view class="list searchList">
<view class="item" v-on:click="Link(item,index)" v-for="item, index in EquipMents"
v-show="!item['linkStatu']">
v-show="item.name.indexOf(search)>-1">
<view class="before" v-if="item.isTarget"></view>
<view class="leftImg ">
<image src="/static/images/BLEAdd/bluetooth.png" class="titleIco" mode="heightFix">
@ -148,6 +152,7 @@
}
},
search:'',//筛选
PairEquip: [], //已配对设备
EquipMents: [], //搜索出来的设备
device: null,
@ -171,6 +176,7 @@
}
},
onLoad(option) {
debugger;
let search = option.search;
these = this;
eventChannel = this.getOpenerEventChannel();
@ -367,6 +373,10 @@
eventChannel.on('detailData', function(rec) {
console.log("接收到父页面的参数:", rec);
these.device = rec.data;
if(rec.data.bluetoothName){
these.search=rec.data.bluetoothName.replace('JQZM-','');
}
startValidDevice();
these.refreshBleList();
});
@ -805,10 +815,10 @@
padding: 30rpx;
box-sizing: border-box;
width: 100%;
height: calc(100% - 300rpx);
height: calc(100% - 240rpx);
overflow-y: scroll;
position: absolute;
top: 300rpx;
top: 240rpx;
left: 0rpx;
}
@ -830,16 +840,17 @@
align-content: center;
align-items: center;
justify-content: space-between;
margin-bottom: 20rpx;
margin-bottom:30rpx;
}
.list {
min-height: 120rpx;
}
.searchList {
width: 100%;
height: calc(100% - 186rpx);
height: calc(100% - 260rpx);
overflow-y: scroll;
}
@ -1010,4 +1021,12 @@
filter: none !important;
-webkit-filter: none !important;
}
.uni-mt-5 {
background-color: #000000;
}
.uni-easyinput__content {
background-color: #121212 !important;
}
</style>