2018-06-07 00:45:47 +08:00
|
|
|
|
$(function () {
|
|
|
|
|
|
|
|
|
|
function loadData() {
|
|
|
|
|
$.bc({
|
2018-09-09 13:19:05 +08:00
|
|
|
|
url: Messages.url,
|
2018-06-07 00:45:47 +08:00
|
|
|
|
callback: function (result) {
|
2018-09-09 01:48:00 +08:00
|
|
|
|
if (result) {
|
2018-06-07 00:45:47 +08:00
|
|
|
|
$('#s_inbox').text(result.inboxCount);
|
|
|
|
|
$('#s_sendmail').text(result.sendmailCount);
|
|
|
|
|
$('#s_mark').text(result.markCount);
|
|
|
|
|
$('#s_trash').text(result.trashCount);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var html = '<tr {0}><td class="inbox-small-cells"><input type="checkbox" class="mail-checkbox"></td><td class="inbox-small-cells"><i class="fa fa-star {1}"></i></td><td class="view-message dont-show">{2}<span class="label {3} pull-right">{4}</span></td><td class="view-message dont-show">{5}</td><td class="view-message ">{6}</td><td class="view-message text-right">{7}</td></tr>';
|
|
|
|
|
|
|
|
|
|
function listData(options) {
|
|
|
|
|
$.bc({
|
2018-09-09 13:19:05 +08:00
|
|
|
|
id: options.id, url: Messages.url,
|
2018-06-07 00:45:47 +08:00
|
|
|
|
callback: function (result) {
|
|
|
|
|
if (result) {
|
|
|
|
|
var content = result.map(function (mail) {
|
2018-09-09 01:48:00 +08:00
|
|
|
|
if (mail.Status === '0')
|
2018-06-07 00:45:47 +08:00
|
|
|
|
mailStatus = 'class="unread"';
|
|
|
|
|
else
|
2018-09-09 01:48:00 +08:00
|
|
|
|
mailStatus = " ";
|
|
|
|
|
if (mail.Mark === '1')
|
2018-06-07 00:45:47 +08:00
|
|
|
|
mailMark = "inbox-started";
|
|
|
|
|
else
|
|
|
|
|
mailMark = " ";
|
2018-09-09 01:48:00 +08:00
|
|
|
|
if (mail.Label === '0')
|
2018-06-07 00:45:47 +08:00
|
|
|
|
mailLabel = 'label-success';
|
|
|
|
|
else
|
|
|
|
|
mailLabel = 'label-warning';
|
|
|
|
|
return $.format(html, mailStatus, mailMark, mail.FromDisplayName, mailLabel, mail.LabelName, mail.Title, mail.Content, mail.SendTime);
|
|
|
|
|
}).join('');
|
|
|
|
|
$('#tbMsg').html(content);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
listData({ id: 'inbox' });
|
|
|
|
|
loadData();
|
|
|
|
|
|
|
|
|
|
$('#mailBox').on('click', 'a', function () {
|
|
|
|
|
listData({ Id: $(this).attr('data-id') });
|
2018-09-09 01:48:00 +08:00
|
|
|
|
});
|
2016-11-18 16:00:25 +08:00
|
|
|
|
});
|