notify.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. use common\helpers\Url;
  3. use common\enums\NotifyTypeEnum;
  4. ?>
  5. <li class="nav-item dropdown">
  6. <a class="nav-link" data-toggle="dropdown" href="#">
  7. <i class="far fa-bell"></i>
  8. <span class="badge badge-warning navbar-badge rf-notify-all-count"><?= $count; ?></span>
  9. </a>
  10. <div class="dropdown-menu dropdown-menu-lg dropdown-menu-right">
  11. <span class="dropdown-item dropdown-header"><span class="rf-notify-all-count"><?= $count; ?></span> 消息提醒</span>
  12. <div class="dropdown-divider"></div>
  13. <a href="<?= Url::to(['/notify/remind', 'type' => NotifyTypeEnum::ANNOUNCE]); ?>" class="dropdown-item J_menuItem" data-title="公告消息">
  14. <i class="fas fa-comments mr-2"></i> 收到 <span class="announce-count"><?= $notify[NotifyTypeEnum::ANNOUNCE]['count'] ?? 0; ?></span> 条公告消息
  15. <span class="float-right text-muted text-sm announce-time">
  16. <?=
  17. isset($notify[NotifyTypeEnum::ANNOUNCE])
  18. ? Yii::$app->formatter->asRelativeTime($notify[NotifyTypeEnum::ANNOUNCE]['created_at'])
  19. : '';
  20. ?>
  21. </span>
  22. </a>
  23. <div class="dropdown-divider"></div>
  24. <a href="<?= Url::to(['/notify/remind', 'type' => NotifyTypeEnum::REMIND]); ?>" class="dropdown-item J_menuItem" data-title="提醒消息">
  25. <i class="fas fa-bell mr-2"></i> 收到 <span class="remind-count"><?= $notify[NotifyTypeEnum::REMIND]['count'] ?? 0; ?></span> 条提醒消息
  26. <span class="float-right text-muted text-sm remind-time">
  27. <?=
  28. isset($notify[NotifyTypeEnum::REMIND])
  29. ? Yii::$app->formatter->asRelativeTime($notify[NotifyTypeEnum::REMIND]['created_at'])
  30. : '';
  31. ?>
  32. </span>
  33. </a>
  34. <div class="dropdown-divider"></div>
  35. <a href="<?= Url::to(['/notify/remind']); ?>" class="dropdown-item dropdown-footer J_menuItem" onclick="$('body').click();">全部消息</a>
  36. </div>
  37. </li>
粤ICP备19079148号