This commit is contained in:
zoujiandong 2025-09-05 10:41:10 +08:00
parent b8f6257bf1
commit ad39805b83
2 changed files with 36 additions and 18 deletions

View File

@ -67,7 +67,7 @@
<view v-else-if="loadMoreStatus === 'more'" class="more"> <view v-else-if="loadMoreStatus === 'more'" class="more">
<text>上拉加载更多</text> <text>上拉加载更多</text>
</view> </view>
<view v-else-if="loadMoreStatus === 'noMore'" class="no-more"> <view v-else-if="loadMoreStatus === 'noMore' && guidelinesList.length > 0" class="no-more">
<text>没有更多数据了</text> <text>没有更多数据了</text>
</view> </view>
</view> </view>

View File

@ -21,7 +21,7 @@
<uni-icons type="clear" size="20" color="#999"></uni-icons> <uni-icons type="clear" size="20" color="#999"></uni-icons>
</view> </view>
</view> </view>
<view class="cancel-btn" @click="goBack"> <view class="cancel-btn" @click="goSearch">
<text class="cancel-text">搜索</text> <text class="cancel-text">搜索</text>
</view> </view>
</view> </view>
@ -38,7 +38,7 @@
class="category-item" class="category-item"
v-for="(item, index) in categoryList" v-for="(item, index) in categoryList"
:key="index" :key="index"
@click="onCategoryClick(Index,item.type)" @click="onCategoryClick(index,item.type)"
> >
<view class="category-icon"> <view class="category-icon">
<up-image :src="item.icon" width="60rpx" height="60rpx" v-if="tab!=index"></up-image> <up-image :src="item.icon" width="60rpx" height="60rpx" v-if="tab!=index"></up-image>
@ -78,7 +78,8 @@
import doctorOn from "@/static/item_doctor_yes.png" import doctorOn from "@/static/item_doctor_yes.png"
import mall from "@/static/item_mall_no.png" import mall from "@/static/item_mall_no.png"
import mallOn from "@/static/item_mall_yes.png" import mallOn from "@/static/item_mall_yes.png"
const tab=ref(-1); const tab=ref(0);
const type=ref('');
// //
const searchKeyword = ref(''); const searchKeyword = ref('');
@ -97,10 +98,10 @@
{ name: '指南', icon:zhinan, activeIcon:zhinanOn,type: 'zhinan' }, { name: '指南', icon:zhinan, activeIcon:zhinanOn,type: 'zhinan' },
{ name: '精品课', icon:course,activeIcon:courseOn, type: 'course' }, { name: '精品课', icon:course,activeIcon:courseOn, type: 'course' },
{ name: '肝胆课件', icon:ppt,activeIcon:pptOn, type: 'ppt' }, { name: '肝胆课件', icon:ppt,activeIcon:pptOn, type: 'ppt' },
{ name: '患者', icon:patient, patientIcon:patientOn,type: 'patient' }, // { name: '', icon:patient, patientIcon:patientOn,type: 'patient' },
{ name: '名院', icon:doctor,activeIcon:doctorOn, type: 'doctor' }, // { name: '', icon:doctor,activeIcon:doctorOn, type: 'doctor' },
{ name: '名科', icon:department,activeIcon:departmentOn, type: 'department' }, // { name: '', icon:department,activeIcon:departmentOn, type: 'department' },
{ name: '名医', icon:doctor, activeIcon:doctorOn,type: 'doctor' }, // { name: '', icon:doctor, activeIcon:doctorOn,type: 'doctor' },
{ name: '积分商城', icon:mall,activeIcon:mallOn, type: 'mall' } { name: '积分商城', icon:mall,activeIcon:mallOn, type: 'mall' }
]); ]);
@ -134,34 +135,51 @@
}; };
// //
const onCategoryClick = (index,type) => { const goSearch = () => {
tab.value=index; if(!searchKeyword.value){
if(type=='video'){ uni.showToast({
title: `请输入搜索内容`,
icon: 'none'
});
return;
}
if(type.value=='video'){
uni.navigateTo({ uni.navigateTo({
url: `/pages_app/searchVideo/searchVideo?keywords=${searchKeyword.value}` url: `/pages_app/searchVideo/searchVideo?keywords=${searchKeyword.value}`
}) })
}else if(type=='videoPatient'){ }else if(type.value=='videoPatient'){
uni.navigateTo({ uni.navigateTo({
url: `/pages_app/searchVideo/searchVideo?keywords=${searchKeyword.value}&from=hjsp` url: `/pages_app/searchVideo/searchVideo?keywords=${searchKeyword.value}&from=hjsp`
}) })
}else if(type=='news'){ }else if(type.value=='news'){
uni.navigateTo({ uni.navigateTo({
url: `/pages_app/searchNews/searchNews?keywords=${searchKeyword.value}` url: `/pages_app/searchNews/searchNews?keywords=${searchKeyword.value}`
}) })
}else if(type=='kepu'){ }else if(type.value=='kepu'){
uni.navigateTo({ uni.navigateTo({
url: `/pages_app/searchNews/searchNews?keywords=${searchKeyword.value}&from=kp` url: `/pages_app/searchNews/searchNews?keywords=${searchKeyword.value}&from=kp`
}) })
}else if(type=='zhinan'){ }else if(type.value=='zhinan'){
uni.navigateTo({ uni.navigateTo({
url: `/pages_app/hot/hot?name=${searchKeyword.value}` url: `/pages_app/hot/hot?name=${searchKeyword.value}`
}) })
}else if(type=='course'){ }else if(type.value=='course'){
uni.navigateTo({ 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;
// //
}; };