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