From ad39805b8365e7bec32f5bc48d00a493d3024537 Mon Sep 17 00:00:00 2001
From: zoujiandong <10130823232@qq.com>
Date: Fri, 5 Sep 2025 10:41:10 +0800
Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A411?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pages_app/hot/hot.vue | 2 +-
pages_app/search/search.vue | 52 +++++++++++++++++++++++++------------
2 files changed, 36 insertions(+), 18 deletions(-)
diff --git a/pages_app/hot/hot.vue b/pages_app/hot/hot.vue
index f4e71e9..a401db9 100644
--- a/pages_app/hot/hot.vue
+++ b/pages_app/hot/hot.vue
@@ -67,7 +67,7 @@
上拉加载更多
-
+
没有更多数据了
diff --git a/pages_app/search/search.vue b/pages_app/search/search.vue
index 16ca1e7..9a4a9e5 100644
--- a/pages_app/search/search.vue
+++ b/pages_app/search/search.vue
@@ -21,7 +21,7 @@
-
+
搜索
@@ -38,7 +38,7 @@
class="category-item"
v-for="(item, index) in categoryList"
:key="index"
- @click="onCategoryClick(Index,item.type)"
+ @click="onCategoryClick(index,item.type)"
>
@@ -78,7 +78,8 @@
import doctorOn from "@/static/item_doctor_yes.png"
import mall from "@/static/item_mall_no.png"
import mallOn from "@/static/item_mall_yes.png"
- const tab=ref(-1);
+ const tab=ref(0);
+ const type=ref('');
// 搜索关键词
const searchKeyword = ref('');
@@ -97,10 +98,10 @@
{ name: '指南', icon:zhinan, activeIcon:zhinanOn,type: 'zhinan' },
{ name: '精品课', icon:course,activeIcon:courseOn, type: 'course' },
{ name: '肝胆课件', icon:ppt,activeIcon:pptOn, type: 'ppt' },
- { name: '患者', icon:patient, patientIcon:patientOn,type: 'patient' },
- { name: '名院', icon:doctor,activeIcon:doctorOn, type: 'doctor' },
- { name: '名科', icon:department,activeIcon:departmentOn, type: 'department' },
- { name: '名医', icon:doctor, activeIcon:doctorOn,type: 'doctor' },
+ // { name: '患者', icon:patient, patientIcon:patientOn,type: 'patient' },
+ // { name: '名院', icon:doctor,activeIcon:doctorOn, type: 'doctor' },
+ // { name: '名科', icon:department,activeIcon:departmentOn, type: 'department' },
+ // { name: '名医', icon:doctor, activeIcon:doctorOn,type: 'doctor' },
{ name: '积分商城', icon:mall,activeIcon:mallOn, type: 'mall' }
]);
@@ -134,34 +135,51 @@
};
// 点击分类
- const onCategoryClick = (index,type) => {
- tab.value=index;
- if(type=='video'){
+ const goSearch = () => {
+ if(!searchKeyword.value){
+ uni.showToast({
+ title: `请输入搜索内容`,
+ icon: 'none'
+ });
+ return;
+ }
+ if(type.value=='video'){
uni.navigateTo({
url: `/pages_app/searchVideo/searchVideo?keywords=${searchKeyword.value}`
})
- }else if(type=='videoPatient'){
+ }else if(type.value=='videoPatient'){
uni.navigateTo({
url: `/pages_app/searchVideo/searchVideo?keywords=${searchKeyword.value}&from=hjsp`
})
- }else if(type=='news'){
+ }else if(type.value=='news'){
uni.navigateTo({
url: `/pages_app/searchNews/searchNews?keywords=${searchKeyword.value}`
})
- }else if(type=='kepu'){
+ }else if(type.value=='kepu'){
uni.navigateTo({
url: `/pages_app/searchNews/searchNews?keywords=${searchKeyword.value}&from=kp`
})
- }else if(type=='zhinan'){
+ }else if(type.value=='zhinan'){
uni.navigateTo({
url: `/pages_app/hot/hot?name=${searchKeyword.value}`
})
- }else if(type=='course'){
+ }else if(type.value=='course'){
uni.navigateTo({
- url: `/pages_app/searchNews/searchNews?keywords=${searchKeyword.value}&from=kp`
+ url: `/pages_course/index/index?keywords=${searchKeyword.value}`
+ })
+ }else if(type.value=='ppt'){
+ uni.navigateTo({
+ url: `/pages_app/hot/hot?name=${searchKeyword.value}`
+ })
+ }else if(type.value=='mall'){
+ uni.navigateTo({
+ url: `/pages_app/pointMall/pointMall?keywords=${searchKeyword.value}`
})
}
-
+ }
+ const onCategoryClick = (index,typeStr) => {
+ tab.value=index;
+ type.value=typeStr;
// 这里可以根据分类进行搜索
};