feat:获取会员信息 并且展示title
This commit is contained in:
@ -27,6 +27,8 @@ export function getConversationHistoryBarContent(): string {
|
||||
<span class="user-nickname" id="userNickname">加载中...</span>
|
||||
</div>
|
||||
|
||||
<img class="tier-icon" id="tierIcon" style="display: none;" />
|
||||
|
||||
<button class="new-conversation-button" onclick="createNewConversation()" title="新建对话">
|
||||
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z" fill="currentColor"/>
|
||||
@ -88,6 +90,14 @@ export function getConversationHistoryBarStyles(): string {
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.tier-icon {
|
||||
width: 110px;
|
||||
height: 35px;
|
||||
flex-shrink: 0;
|
||||
object-fit: contain;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.history-dropdown-button {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
|
||||
@ -590,10 +590,19 @@ export function getWebviewContent(
|
||||
console.log('[WebView] 收到用户信息:', message.userInfo);
|
||||
const userInfo = document.getElementById('userInfo');
|
||||
const userNickname = document.getElementById('userNickname');
|
||||
const tierIcon = document.getElementById('tierIcon');
|
||||
if (userInfo && userNickname && message.userInfo) {
|
||||
const displayName = message.userInfo.nickname || message.userInfo.username || '用户';
|
||||
console.log('[WebView] 显示用户名:', displayName);
|
||||
userNickname.textContent = displayName;
|
||||
|
||||
// 显示会员等级图标
|
||||
if (tierIcon && message.tierIconUrl) {
|
||||
tierIcon.src = message.tierIconUrl;
|
||||
tierIcon.style.display = 'block';
|
||||
console.log('[WebView] 显示会员图标:', message.tierIconUrl);
|
||||
}
|
||||
|
||||
userInfo.style.display = 'flex';
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user