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
+15 -2
View File
@@ -37,7 +37,10 @@
import { ref, watch,defineEmits} from "vue";
import headImg from "@/static/headImg.png";
import logoImg from "@/static/logo.png";
import { onShow,onLoad } from "@dcloudio/uni-app";
import navTo from "@/utils/navTo.js";
const keyWord = ref('');
const userHeadImg = ref('');
const props=defineProps({
searchWord:{
type:String,
@@ -69,7 +72,7 @@ watch(()=>props.searchWord,(newVal)=>{
})
const emit = defineEmits(['changeWord'])
const goMy=()=>{
uni.navigateTo({
navTo({
url:'/pages/my/my'
})
}
@@ -79,6 +82,16 @@ const goBack = () => {
delta: 1,
});
};
onLoad(()=>{
let userInfo = uni.getStorageSync('userInfo');
if(userInfo && userInfo.avatar){
userHeadImg.value=userInfo.avatar
}else{
userHeadImg.value=headImg;
}
})
const search=()=>{
// if (!keyWord.value) {
// return uni.showToast({
@@ -87,7 +100,7 @@ const search=()=>{
// });
// }
emit('changeWord',keyWord.value)
// uni.navigateTo({
// navTo({
// url: `/pages/search/search?keyWord=${keyWord.value}`,
// });
}