This commit is contained in:
zoujiandong
2025-06-16 19:01:04 +08:00
parent c1309bc9fc
commit bbc99ec0dd
26 changed files with 488 additions and 260 deletions
+17 -4
View File
@@ -19,7 +19,7 @@
<up-icon name="search" size="26" color="#999" @click="search"></up-icon>
</view>
<up--image
:src="headImg"
:src="userHeadImg"
@click="goMy"
mode="widthFix"
width="62rpx"
@@ -34,6 +34,9 @@
import { ref, watch} from "vue";
import headImg from "@/static/headImg.png";
import logoImg from "@/static/logo.png";
import navTo from "@/utils/navTo.js";
import { onShow,onLoad } from "@dcloudio/uni-app";
const userHeadImg = ref('');
const keyWord = ref('');
const props=defineProps({
searchWord:{
@@ -64,17 +67,17 @@ watch(()=>props.searchWord,(newVal)=>{
keyWord.value=newVal
})
const goMy=()=>{
uni.navigateTo({
navTo({
url:'/pages/my/my'
})
}
const search=()=>{
if(props.type=='home'){
uni.navigateTo({
navTo({
url: `/pages/search/search?keyWord=${keyWord.value}`,
});
}else if(props.type=='caseTalk'){
uni.navigateTo({
navTo({
url: `/pages/specialList/specialList?keyWord=${keyWord.value}`,
});
}
@@ -87,6 +90,16 @@ const search=()=>{
}
onLoad(()=>{
let userInfo = uni.getStorageSync('userInfo');
if(userInfo && userInfo.avatar){
userHeadImg.value=userInfo.avatar
}else{
userHeadImg.value=headImg;
}
})
</script>
<style lang="scss" scoped>