111
This commit is contained in:
@@ -3,7 +3,8 @@
|
||||
<view class="bg"></view>
|
||||
<view class="namebox">
|
||||
<view class="logo">logo</view>
|
||||
<view class="name">肝胆相照临床病例库</view>
|
||||
<view class="name">{{ navName }}</view>
|
||||
|
||||
</view>
|
||||
<view class="search">
|
||||
<view class="searchwrap">
|
||||
@@ -15,8 +16,8 @@
|
||||
width="30rpx"
|
||||
height="30rpx"
|
||||
></up--image> -->
|
||||
<input type="text" class="ipt" />
|
||||
<up-icon name="search" size="26" color="#999"></up-icon>
|
||||
<input type="text" class="ipt" v-model="keyWord" :placeholder="placeholder"/>
|
||||
<up-icon name="search" size="26" color="#999" @click="search"></up-icon>
|
||||
</view>
|
||||
<up--image
|
||||
:src="headImg"
|
||||
@@ -30,8 +31,49 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, watch} from "vue";
|
||||
import headImg from "@/static/headImg.png";
|
||||
import ssImg from "@/static/ss.png";
|
||||
const keyWord = ref('');
|
||||
const props=defineProps({
|
||||
searchWord:{
|
||||
type:String,
|
||||
default:''
|
||||
},
|
||||
type:{
|
||||
type:String,
|
||||
default:'',
|
||||
},
|
||||
navName:{
|
||||
type:String,
|
||||
default:'肝胆相照临床病例库',
|
||||
}
|
||||
|
||||
})
|
||||
const placeholder = ref("输入疾病名称、标题、作者搜索");
|
||||
watch(()=>props.type,(newVal)=>{
|
||||
if(newVal==='doctor'){
|
||||
placeholder.value='输入医生姓名'
|
||||
}else if(newVal==='hospital'){
|
||||
placeholder.value='输入医院名称'
|
||||
}
|
||||
|
||||
},{immediate: true })
|
||||
watch(()=>props.searchWord,(newVal)=>{
|
||||
keyWord.value=newVal
|
||||
})
|
||||
const search=()=>{
|
||||
// if (!keyWord.value) {
|
||||
// return uni.showToast({
|
||||
// title: "请输入关键字",
|
||||
// icon:'none'
|
||||
// });
|
||||
// }
|
||||
|
||||
uni.navigateTo({
|
||||
url: `/pages/search/search?keyWord=${keyWord.value}`,
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
Reference in New Issue
Block a user