6.16
This commit is contained in:
@@ -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}`,
|
||||
// });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user