{php} $messages = $messages ?? []; $messageCount = count($messages); {/php} {if condition="!empty($user)"}
{volist name="messages" id="msg"} {php} $msgArticleData = $messageArticles[$msg['id']] ?? ['articleCid' => '#-1', 'article' => null]; $articleCid = $msgArticleData['articleCid']; $msgArticle = $msgArticleData['article']; $msgType = $msg['type'] ?? 0; $coverHtml = 'cover'; if ($msgArticle) { if (($msgArticle['ptplx'] ?? '') === 'img' && !empty($msgArticle['ptpimag'])) { $firstImage = thumbUrl(assetUrl(explode('(+@+)', $msgArticle['ptpimag'])[0])); $coverHtml = 'cover'; } elseif (($msgArticle['ptplx'] ?? '') === 'only') { $coverHtml = '
' . sanitizeHtml($msgArticle['ptptext'] ?? '') . '
'; } } $unreadStyle = isFlag($msg['msg'] ?? 0) === 0 ? '' : 'style="display:none"'; // 系统/邮件/审核通知使用系统图标代替用户头像 $isSystemType = in_array($msgType, [2, 3, 4]); if ($isSystemType) { $sysIcon = $msgType === 3 ? '📣' : ($msgType === 4 ? '✉' : '✅'); $sysBg = $msgType === 3 ? '#4a90d9' : ($msgType === 4 ? '#f5a623' : (strpos($msg['text'] ?? '', '未通过') !== false ? '#e74c3c' : '#27ae60')); $avatarHtml = '
'.$sysIcon.'
'; } else { $avatarHtml = 'avatar'; } $onclickFn = $isSystemType ? 'mesgxqSys(this)' : 'mesgxq()'; {/php}

{$avatarHtml|raw}

{$msg.fname}{:formatFriendlyDate(strtotime($msg['ftime']))}

{:empty($msg['text']) ? $msg['title'] : $msg['text']}

{$coverHtml|raw}
删除
{/volist}

{$messageCount}条消息

{/if}