You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
1.8 KiB
JavaScript

$(function () {
GetReaLgoldProductlist("");
});
function GetDateFormat(str) {
return new Date(parseInt(str.substr(6, 13))).toLocaleDateString();
}
function GetReaLgoldProductlist(keywords) {
pageHelper.Init({
url: "/Teacher/ReaLgoldProduct/GetReaLgoldProductList",
type: "POST",
pageDiv: "#pages",
data:
{
keywords: keywords,
rId: Math.random(),
},
bind: function (data) {
var html = "";
if (data.Data.length > 0) {
$(data.Data).each(function (index, dom) {
//每行html
var trHtml = "";
trHtml += "<tr>";
trHtml += "<td><div class=\"ellipsis\" title=\"{0}\">{0}</div></td>";
trHtml += "<td><div class=\"ellipsis\" title=\"{1}\">{1}</div></td>";
trHtml += "<td><div class=\"ellipsis\" title=\"{2}\">{2}</div></td>";
trHtml += "<td>{3}</td>";
trHtml += "<td>{4}</td>";
trHtml += "<td>{5}%</td>";
trHtml += "<td>{6}</td>";
trHtml += "</td>";
trHtml += "</tr>";
//拼接tbody
html += StringHelper.FormatStr(trHtml,
GetDateFormat(dom.TradingDay),
dom.OpeningPrice,
dom.ClosingPrice,
dom.HighestPrice,
dom.LowestPrice,
(dom.Applies * 100).toFixed(2),
dom.AveragePrice
);
});
} else {
html = "<tr><td colspan='8'>未找到相关记录!</td>";
}
$("#ReaLgoldProductList2").html(html);
}
});
}