This commit is contained in:
zoujiandong
2025-06-10 17:40:29 +08:00
parent db955ff4f3
commit e25eb25063
11 changed files with 1341 additions and 675 deletions
+106
View File
@@ -0,0 +1,106 @@
<template>
<view class="navbox">
<view class="bg"></view>
<view class="namebox">
<view class="back" @click="goBack">
<u-icon name="arrow-left" color="#000" size="24"></u-icon>
</view>
<view class="logo">
<up--image
:src="logoImg"
width="62rpx"
height="62rpx"
radius="50%"
></up--image>
</view>
<view class="name">{{ navName }}</view>
</view>
</view>
</template>
<script setup>
import logoImg from "@/static/logo.png";
const props = defineProps({
navName: {
type: String,
default: "我的",
}
});
const goBack = () => {
uni.navigateBack({
delta: 1,
});
};
</script>
<style lang="scss" scoped>
.navbox {
padding-bottom: 20rpx;
background-color: #f9fafb;
position: relative;
height:200rpx;
background: radial-gradient(
60% 90% at 4% 2%,
#43c9c3 0%,
rgba(255, 255, 255, 0) 100%
);
}
.bg {
z-index: 0;
top: 0;
bottom: 0;
width: 100%;
position: absolute;
background: radial-gradient(
43% 90% at 84% 6%,
#ffd6c9 0%,
rgba(255, 255, 255, 0) 100%
);
}
.namebox {
padding-top: 102rpx;
margin: 0rpx 30rpx 0rpx;
display: flex;
align-items: center;
display: flex;
align-items: center;
.logo{
margin-left: 35rpx;
}
.back{
position: absolute;
left: 0;
}
.name {
margin-left: 16rpx;
font-size: 30rpx;
color: #111827;
}
}
.search {
margin: 40rpx 30rpx 0rpx;
display: flex;
align-items: center;
justify-content: space-between;
.searchwrap {
display: flex;
align-items: center;
flex: 1;
padding-left: 28rpx;
margin-right: 23rpx;
height: 80rpx;
background: #fbfbfb;
box-shadow: 0px 4rpx 10rpx 0px rgba(153, 153, 153, 0.5);
border-radius: 40rpx;
.ipt {
margin-left: 15rpx;
font-size: 28rpx;
}
}
}
</style>
+16 -8
View File
@@ -42,7 +42,7 @@ const props=defineProps({
},
type:{
type:String,
default:'',
default:'home',
},
navName:{
type:String,
@@ -50,12 +50,13 @@ const props=defineProps({
}
})
const emit = defineEmits(['changeWord'])
const placeholder = ref("输入疾病名称、标题、作者搜索");
watch(()=>props.type,(newVal)=>{
if(newVal==='doctor'){
placeholder.value='输入医生姓名'
}else if(newVal==='hospital'){
placeholder.value='输入医院名称'
if(newVal==='home'){
//placeholder.value='输入医生姓名'
}else if(newVal==='caseTalk'){
//placeholder.value='输入医院名称'
}
},{immediate: true })
@@ -68,6 +69,15 @@ const goMy=()=>{
})
}
const search=()=>{
if(props.type=='home'){
uni.navigateTo({
url: `/pages/search/search?keyWord=${keyWord.value}`,
});
}else if(props.type=='caseTalk'){
uni.navigateTo({
url: `/pages/specialList/specialList?keyWord=${keyWord.value}`,
});
}
// if (!keyWord.value) {
// return uni.showToast({
// title: "请输入关键字",
@@ -75,9 +85,7 @@ const search=()=>{
// });
// }
uni.navigateTo({
url: `/pages/search/search?keyWord=${keyWord.value}`,
});
}
</script>