搜索栏实现跳转查询

往生殿页面详细重定向到hall
This commit is contained in:
minimaxagent1 2025-08-12 09:23:23 +08:00
parent 87d8b28193
commit d8bb3953ba
6 changed files with 65 additions and 20 deletions

View File

@ -43,13 +43,17 @@ export default {
},
methods: {
onInput(e) {
//
this.$emit('input', e.detail.value)
},
onSearch() {
//
if (this.value.trim()) {
this.$emit('search', this.value)
}
}
}
}
</script>
<style lang="scss" scoped>

View File

@ -67,13 +67,14 @@ export default {
}
},
watch: {
searchKeyword: {
handler(newVal) {
this.resetList()
this.loadData()
},
immediate: false
}
// searchKeyword
// searchKeyword: {
// handler(newVal) {
// this.resetList()
// this.loadData()
// },
// immediate: false
// }
},
mounted() {
this.loadData()

View File

@ -67,13 +67,14 @@ export default {
}
},
watch: {
searchKeyword: {
handler(newVal) {
this.resetList()
this.loadData()
},
immediate: false
}
// searchKeyword
// searchKeyword: {
// handler(newVal) {
// this.resetList()
// this.loadData()
// },
// immediate: false
// }
},
mounted() {
this.loadData()

View File

@ -96,6 +96,20 @@ export default {
hasSearched: false
}
},
onLoad(options) {
console.log('deceasedSearch页面接收到的参数:', options)
//
if (options.keyword) {
this.searchName = decodeURIComponent(options.keyword)
console.log('接收到搜索关键词:', this.searchName)
//
this.$nextTick(() => {
this.handleSearch(this.searchName)
})
}
},
methods: {
//
async handleSearch(value) {

View File

@ -125,7 +125,21 @@ export default {
handleSearch(value) {
console.log('搜索内容:', value)
this.searchName = value
// enshrinedList
//
uni.navigateTo({
url: `/pages/memorial/deceasedSearch?keyword=${encodeURIComponent(value)}`,
success: () => {
console.log('跳转到搜索页面成功')
},
fail: (error) => {
console.error('跳转失败:', error)
uni.showToast({
title: '页面跳转失败',
icon: 'none'
})
}
})
},
//

View File

@ -271,10 +271,21 @@ export default {
async handleSearch(value) {
console.log('搜索内容:', value)
this.searchName = value
//
this.pageParams.pageNum = 1
//
await this.getDeceasedList()
//
uni.navigateTo({
url: `/pages/memorial/deceasedSearch?keyword=${encodeURIComponent(value)}`,
success: () => {
console.log('跳转到搜索页面成功')
},
fail: (error) => {
console.error('跳转失败:', error)
uni.showToast({
title: '页面跳转失败',
icon: 'none'
})
}
})
},
//