支持动态头像

This commit is contained in:
BTMuli
2025-07-14 16:12:05 +08:00
parent cbf4e15809
commit f5b44c2e8a
6 changed files with 144 additions and 27 deletions

View File

@@ -2,7 +2,7 @@
<div class="tp-avatar-box">
<div class="tpa-img">
<div class="tpa-icon">
<TMiImg :ori="true" :src="props.data.avatar_url" alt="avatar" />
<TMiImg :ori="true" :src="getUserAvatar(props.data)" alt="avatar" />
</div>
<div v-if="props.data.pendant !== ''" class="tpa-pendant">
<TMiImg :ori="true" :src="props.data.pendant" alt="pendant" />
@@ -25,6 +25,7 @@
</template>
<script lang="ts" setup>
import TMiImg from "@comp/app/t-mi-img.vue";
import { getUserAvatar } from "@utils/toolFunc.js";
import { computed } from "vue";
type TpAvatarProps = { data: TGApp.BBS.Post.User; position: "left" | "right" };

View File

@@ -5,7 +5,7 @@
<div class="vp-ouu-info">
<div class="left">
<div class="avatar">
<TMiImg :src="userInfo.avatar_url" alt="avatar" :ori="true" />
<TMiImg :src="getUserAvatar(userInfo)" alt="avatar" :ori="true" />
</div>
<div class="pendant" v-if="userInfo.pendant !== ''">
<TMiImg :src="userInfo.pendant" alt="pendant" :ori="true" />
@@ -46,6 +46,7 @@ import showSnackbar from "@comp/func/snackbar.js";
import { useBoxReachBottom } from "@hooks/reachBottom.js";
import bbsReq from "@req/bbsReq.js";
import postReq from "@req/postReq.js";
import { getUserAvatar } from "@utils/toolFunc.js";
import { computed, ref, shallowRef, useTemplateRef, watch } from "vue";
type ToPostUserProps = { gid: number; uid: string; postId?: string };

View File

@@ -10,7 +10,7 @@
<div class="tpr-user" @click="handleUser()">
<div class="tpru-left">
<div class="avatar">
<TMiImg :ori="true" :src="props.modelValue.user.avatar_url" alt="avatar" />
<TMiImg :ori="true" :src="getUserAvatar(props.modelValue.user)" alt="avatar" />
</div>
<div class="pendant" v-if="props.modelValue.user.pendant !== ''">
<TMiImg :ori="true" :src="props.modelValue.user.pendant" alt="pendant" />
@@ -109,7 +109,7 @@ import { emit, type Event, type UnlistenFn } from "@tauri-apps/api/event";
import { save } from "@tauri-apps/plugin-dialog";
import { writeTextFile } from "@tauri-apps/plugin-fs";
import { generateShareImg } from "@utils/TGShare.js";
import { getNearTime, timestampToDate } from "@utils/toolFunc.js";
import { getNearTime, getUserAvatar, timestampToDate } from "@utils/toolFunc.js";
import { computed, onMounted, onUnmounted, ref, shallowRef, toRaw, watch } from "vue";
import TpParser from "./tp-parser.vue";