管理端,消息页面给一个默认头像

dev
QB 2024-08-14 16:30:38 +08:00
parent 79bffca439
commit badd59d59d
2 changed files with 25 additions and 10 deletions

View File

@ -23,7 +23,9 @@
</view>
<view class="contentmessage">
<view @click="toPerson">
<image class="contentmessageimage" :src="bindIcon(youavatar)"></image>
<!-- <image class="contentmessageimage" :src="bindIcon(youavatar)"></image> -->
<image v-if="youavatar" class="contentmessageimage" :src="bindIcon(youavatar)"></image>
<image v-else class="contentmessageimage" src="../../static/images/icon/tu4-1.jpg" mode=""></image>
</view>
<view style="margin-left: 16rpx;">
<view class="message" v-if="item.messageType == 51">
@ -554,14 +556,15 @@ function hightchange(e){
useStore
} from 'vuex';
const store = useStore();
const QNDomain = store.state.user.QNDomain;
// const avatar = ref(proxy.$store.state.user.avatar)
// URL
const avatarUrl = ref("/static/images/icon/tu4-1.jpg");
const useDefaultAvatar = ref(true); // 使
function bindIcon(icon) {
return QNDomain + icon;
}
const avatar = ref(proxy.$store.state.user.avatar)
return store.state.user.QNDomain + icon;;
}
useDefaultAvatar.value = false;

View File

@ -22,7 +22,10 @@
<view>
<view class="contentboxtop" v-if=" item.statusone == 0">
</view>
<image class="contentboximage" :src="bindIcon(item.avatar)"></image>
<view>
<image v-if="item.avatar" class="contentboximage" :src="bindIcon(item.avatar)"></image>
<image v-else class="contentboximage" src="../../static/images/icon/tu4-1.jpg" mode=""></image>
</view>
</view>
<view style="margin-left: 26rpx;width: 612rpx;">
<text class="contentboxtexttop">{{ item.nickName }}</text>
@ -95,9 +98,15 @@ watch(
const toadUser = () => {
proxy.$tab.navigateTo('/pages/message/adUser');
}
// URL
const avatarUrl = ref("/static/images/icon/tu4-1.jpg");
const useDefaultAvatar = ref(true); // 使
function bindIcon(icon) {
return QNDomain + icon;
return store.state.user.QNDomain + icon;;
}
useDefaultAvatar.value = false;
const myuserid = ref(0);
onMounted(() => {
GetListid().then(res => {
@ -175,6 +184,9 @@ function ReturnTime(res) {
return `${year}.${months}.${date} ${hours}:${min}`;
}
}
</script>
<style lang="scss" scoped>