搜索栏添加扫码查询功能

feasure
lld 2026-02-16 11:39:12 +08:00
parent b88ebaeeee
commit 384112c81f
2 changed files with 13 additions and 3 deletions

View File

@ -18,9 +18,13 @@
v-model="searchValue"
cancelButton="always"
@input="input"
clearButton="always"
@cancel="cancel"
@clear="cancel"
placeholder="请输入搜索内容">
<template v-slot:searchIcon>
<yt-scanCode @getScanCode="getScanCode"></yt-scanCode>
</template>
</uni-search-bar>
</uni-col>
</uni-row>
@ -153,10 +157,15 @@ export default {
onShow() {
this.refresh();
},
onReady() {
},
methods: {
getScanCode(res){
this.searchValue = res;
this.value = 1;
},
handleAddAgri() {
this.$refs.addAgri.open();
//
@ -321,6 +330,7 @@ page {
margin-top: 10rpx;
/* 新增H5端避免滚动条样式不一致 */
scrollbar-width: thin;
height: 1220rpx;
}
/* H5端滚动条样式优化可选 */
.list-scroll::-webkit-scrollbar {
@ -512,9 +522,9 @@ page {
background: transparent !important;
}
/* 强制隐藏搜索图标容器 */
/deep/ .uni-searchbar__box-icon-search {
/*/deep/ .uni-searchbar__box-icon-search {
display: none !important;
}
}*/
/deep/ .uni-section .uni-section-header {
padding: 12rpx 10rpx;
}

View File

@ -37,7 +37,7 @@
}
},
fail: err => {
console.log(JSON.stringify(err))
console.log("当前环境不支持!")
}
})