Commit c3301dc6 authored by ganjingcun's avatar ganjingcun

加减dp

parent b273efbe
......@@ -61,7 +61,7 @@
var self = this
self.downloadUrls['windows'] = "https://mycard.moe"
self.downloadUrls['mac'] = "https://mycard.moe"
self.downloadUrls['android'] = "https://pan.baidu.com/s/1o7RMcMA#list/path=%2F"
self.downloadUrls['android'] = "https://pan.baidu.com/s/1eRWiWRC"
// API.getDownloadUrls().then((res) => {
// let assets = res.data.assets
// for (let i of assets) {
......
......@@ -154,7 +154,7 @@
, title: 'Hi, ' + _this.user.username
, offset: 'rb' //具体配置参考:http://www.layui.com/doc/modules/layer.html#offset
, id: 'layerDemo'
, content: '<div style="padding: 20px;">' + '是否参与问卷调查? <br><p class="voteFoot">投票可以改善您的游戏体验。还可以获得EXP哦 ^_^</p> ' + '</div>'
, content: '<div style="padding: 20px;margin-bottom: -20px; text-align: center">' + '是否参与问卷调查? <br><p class="voteFoot">参与调查可以改善您游戏体验与获得EXP!</p> ' + '</div>'
, btn: '好的'
, btnAlign: 'c' //按钮居中
, shade: 0 //不显示遮罩
......@@ -313,6 +313,7 @@
.voteFoot {
/*margin-left: 20px;*/
}
.wrap {
......
......@@ -228,8 +228,8 @@
var username = this.user.username
var type = 1;
rankTable = this.renderRankTable("#athletic_rank");
rankTable2 = this.renderRankTable("#entertain_rank");
rankTable = this.renderRankTable("#athletic_rank", [], "DP");
rankTable2 = this.renderRankTable("#entertain_rank", [], "");
if (!username) return;
......@@ -237,7 +237,7 @@
if (rankTable) {
rankTable.destroy();
}
rankTable = this.renderRankTable("#athletic_rank", res.data.data)
rankTable = this.renderRankTable("#athletic_rank", res.data.data, "DP")
}, (res) => {
console.log(res)
});
......@@ -246,19 +246,21 @@
if (rankTable2) {
rankTable2.destroy();
}
rankTable2 = this.renderRankTable("#entertain_rank", res.data.data)
rankTable2 = this.renderRankTable("#entertain_rank", res.data.data, "")
}, (res) => {
console.log(res)
});
},
renderRankTable: function (id, tableData) {
renderRankTable: function (id, tableData, ttype) {
tableData = tableData || [];
var lang = localStorage.getItem('lang') || 'cn';
var rank = 1;
var processData = tableData.map(function (d) {
return [d.usernamea, d.usernameb, moment(d.start_time).format('YYYY-MM-DD HH:mm'), moment(d.end_time).format('YYYY-MM-DD HH:mm'), d.userscorea, d.userscoreb];
return [d.usernamea, d.usernameb, moment(d.start_time).format('YYYY-MM-DD HH:mm'),
moment(d.end_time).format('YYYY-MM-DD HH:mm'), d.userscorea, d.userscoreb,
d.pta, d.pta_ex, d.ptb, d.ptb_ex];
});
var table = $(id).DataTable({
paging: true,
......@@ -280,15 +282,23 @@
"render": function (data, type, row) {
var userscorea = row[4];
var userscoreb = row[5];
var diff = (parseFloat(row[6]) - parseFloat(row[7])).toFixed(2)
if (diff > 0) {
diff = "+" + diff
}
var append = diff + ttype
if (ttype === "") {
append = ""
}
if (userscorea < 0) {
return "<a href='#/userinfo?username=" + data + "'><span class='label label-danger'>" + data + "</span></a>";
return "<a href='#/userinfo?username=" + data + "'><span class='label label-danger'>" + data + "</span></a> " + append;
}
if (userscorea > userscoreb) {
return "<a href='#/userinfo?username=" + data + "'><span class='label label-success'>" + data + "</span></a>";
return "<a href='#/userinfo?username=" + data + "'><span class='label label-success'>" + data + "</span></a> " + append;
}
return "<a href='#/userinfo?username=" + data + "'><span class='label label-info'>" + data + "</span></a>";
return "<a href='#/userinfo?username=" + data + "'><span class='label label-info'>" + data + "</span></a> " + append;
},
"targets": 0
},
......@@ -296,15 +306,23 @@
"render": function (data, type, row) {
var userscorea = row[4];
var userscoreb = row[5];
var diff = (parseFloat(row[8]) - parseFloat(row[9])).toFixed(2)
if (diff > 0) {
diff = "+" + diff
}
var append = diff + ttype
if (ttype === "") {
append = ""
}
if (userscoreb < 0) {
return "<a href='#/userinfo?username=" + data + "'><span class='label label-danger'>" + data + "</span></a>";
return "<a href='#/userinfo?username=" + data + "'><span class='label label-danger'>" + data + "</span></a> " + append;
}
if (userscorea < userscoreb) {
return "<a href='#/userinfo?username=" + data + "'><span class='label label-success'>" + data + "</span></a>";
return "<a href='#/userinfo?username=" + data + "'><span class='label label-success'>" + data + "</span></a> " + append;
}
return "<a href='#/userinfo?username=" + data + "'><span class='label label-info'>" + data + "</span></a>";
return "<a href='#/userinfo?username=" + data + "'><span class='label label-info'>" + data + "</span></a> " + append;
},
"targets": 1
},
......
......@@ -255,8 +255,9 @@
var username = this.searchText
var type = 1;
rankTable = this.renderRankTable("#athletic_rank");
rankTable2 = this.renderRankTable("#entertain_rank");
rankTable = this.renderRankTable("#athletic_rank", [], "DP");
rankTable2 = this.renderRankTable("#entertain_rank", [], "");
if (!username) return;
......@@ -264,7 +265,7 @@
if (rankTable) {
rankTable.destroy();
}
rankTable = this.renderRankTable("#athletic_rank", res.data.data)
rankTable = this.renderRankTable("#athletic_rank", res.data.data, "DP")
}, (res) => {
console.log(res)
});
......@@ -273,19 +274,21 @@
if (rankTable2) {
rankTable2.destroy();
}
rankTable2 = this.renderRankTable("#entertain_rank", res.data.data)
rankTable2 = this.renderRankTable("#entertain_rank", res.data.data, "")
}, (res) => {
console.log(res)
});
},
renderRankTable: function (id, tableData) {
renderRankTable: function (id, tableData, ttype) {
tableData = tableData || [];
var lang = localStorage.getItem('lang') || 'cn';
var rank = 1;
var processData = tableData.map(function (d) {
return [d.usernamea, d.usernameb, moment(d.start_time).format('YYYY-MM-DD HH:mm'), moment(d.end_time).format('YYYY-MM-DD HH:mm'), d.userscorea, d.userscoreb];
return [d.usernamea, d.usernameb, moment(d.start_time).format('YYYY-MM-DD HH:mm'),
moment(d.end_time).format('YYYY-MM-DD HH:mm'), d.userscorea, d.userscoreb,
d.pta, d.pta_ex, d.ptb, d.ptb_ex];
});
var table = $(id).DataTable({
paging: true,
......@@ -307,15 +310,23 @@
"render": function (data, type, row) {
var userscorea = row[4];
var userscoreb = row[5];
var diff = (parseFloat(row[6]) - parseFloat(row[7])).toFixed(2)
if (diff > 0) {
diff = "+" + diff
}
var append = diff + ttype
if(ttype === ""){
append = ""
}
if (userscorea < 0) {
return "<a href='#/userinfo?username=" + data + "'><span class='label label-danger'>" + data + "</span></a>";
return "<a href='#/userinfo?username=" + data + "'><span class='label label-danger'>" + data + "</span></a> " + append;
}
if (userscorea > userscoreb) {
return "<a href='#/userinfo?username=" + data + "'><span class='label label-success'>" + data + "</span></a>";
return "<a href='#/userinfo?username=" + data + "'><span class='label label-success'>" + data + "</span></a> " + append;
}
return "<a href='#/userinfo?username=" + data + "'><span class='label label-info'>" + data + "</span></a>";
return "<a href='#/userinfo?username=" + data + "'><span class='label label-info'>" + data + "</span></a> " + append;
},
"targets": 0
},
......@@ -323,15 +334,23 @@
"render": function (data, type, row) {
var userscorea = row[4];
var userscoreb = row[5];
var diff = (parseFloat(row[8]) - parseFloat(row[9])).toFixed(2)
if (diff > 0) {
diff = "+" + diff
}
var append = diff + ttype
if(ttype === ""){
append = ""
}
if (userscoreb < 0) {
return "<a href='#/userinfo?username=" + data + "'><span class='label label-danger'>" + data + "</span></a>";
return "<a href='#/userinfo?username=" + data + "'><span class='label label-danger'>" + data + "</span></a> " + append;
}
if (userscorea < userscoreb) {
return "<a href='#/userinfo?username=" + data + "'><span class='label label-success'>" + data + "</span></a>";
return "<a href='#/userinfo?username=" + data + "'><span class='label label-success'>" + data + "</span></a> " + append;
}
return "<a href='#/userinfo?username=" + data + "'><span class='label label-info'>" + data + "</span></a>";
return "<a href='#/userinfo?username=" + data + "'><span class='label label-info'>" + data + "</span></a> " + append;
},
"targets": 1
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment