function transferTime(trr) {
var jsonDate = new Date(parseInt(trr));
Date.prototype.format = function (format) {
var o = {
"y+": this.getFullYear(),
"M+": this.getMonth() + 1,
"d+": this.getDate(),
};
if (/(y+)/.test(format)) {
format = format.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp
.$1.length));
}
for (var k in o) {
if (new RegExp("(" + k + ")").test(format)) {
format = format.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ("" + o[
k]).substr("" + o[k].length));
}
}
return format;
};
var newDate = jsonDate.format("yyyy-MM-dd");
return newDate
}
type: 'POST',
contentType: "application/json;charset=utf-8",
headers:{'Accept': 'application/json','Authorization':'Bearer '+ solo},
dataType: 'json', //json 返回值类型
data: JSON.stringify(newsPageQO), //转化为json字符串
success: function (data, status) {
console.log(data.data.list);
var arr = ``;
for (var i = 0; i < data.data.list.length; i++) {
let actor = data.data.list[i].createId;
var trr = data.data.list[i].createTime;
var shijian = transferTime(trr);
arr = `
<tr class="tr" id = "${data.data.list[i].id}" style="margin-bottom:15px;">
<td><a href="#">${data.data.list[i].id}</a></td>
<td class="hidden-phone">${data.data.list[i].videoTitle}</td>
<td><span>¥${data.data.list[i].videoPrice}</span></td>
<td><span>科技</span></td>
<td><span>${shijian}</span></td>