2016-11-18 16:00:25 +08:00
|
|
|
|
$(function () {
|
2016-11-19 10:32:20 +08:00
|
|
|
|
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}</td><td class="view-message dont-show">{3}</td><td class="view-message ">{4}</td><td class="view-message text-right">{5}</td></tr>';
|
|
|
|
|
|
|
|
|
|
function listData(options) {
|
2016-11-18 16:00:25 +08:00
|
|
|
|
|
2016-11-18 20:49:44 +08:00
|
|
|
|
$.bc({
|
2016-11-19 10:32:20 +08:00
|
|
|
|
Id: options.Id, url: Messages.url, method: 'GET', swal: false,
|
2016-11-18 16:00:25 +08:00
|
|
|
|
callback: function (result) {
|
|
|
|
|
if (result) {
|
|
|
|
|
var content = result.map(function (mail) {
|
2016-11-19 10:32:20 +08:00
|
|
|
|
if (mail.Status == '0')
|
|
|
|
|
mailStatus = 'class="unread"';
|
|
|
|
|
else
|
|
|
|
|
mailStatus = " "
|
|
|
|
|
if (mail.Mark == '1')
|
|
|
|
|
mailMark = "inbox-started";
|
|
|
|
|
else
|
|
|
|
|
mailMark = " ";
|
|
|
|
|
return $.format(html, mailStatus, mailMark, mail.FromDisplayName, mail.Title, mail.Content, mail.SendTime);
|
2016-11-18 16:00:25 +08:00
|
|
|
|
}).join('');
|
|
|
|
|
$('#tbMsg').html(content);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
2016-11-19 10:32:20 +08:00
|
|
|
|
|
|
|
|
|
listData({ Id: 'inbox' });
|
|
|
|
|
|
|
|
|
|
$('#mailBox').on('click', 'a', function () {
|
|
|
|
|
listData({ Id: $(this).attr('data-id') });
|
|
|
|
|
})
|
2016-11-18 16:00:25 +08:00
|
|
|
|
});
|