Commit 540213d3 authored by GaiaXalter's avatar GaiaXalter 💬

个人信息:对战记录变更用户排序,锁定第一列玩家A为自己

parent ed62eccc
Pipeline #10700 failed with stages
in 2 minutes and 43 seconds
......@@ -216,10 +216,40 @@
API.getUserInfo(opt).then((res) => {
this.user_info = res.data
console.log('%c ---------------------src'+'\\'+'components'+'\\'+'Profile.vue---------------------%c:219','background:#ed162b','background:#7d382d',
res)
});
},
methods: {
exchangeUserInfo(info){
let userName=this.user.username
let exchangeInfo=info
if(info.usernamea!=userName)
{
exchangeInfo={
"usernamea": info.usernameb,
"usernameb": info.usernamea,
"userscorea": info.userscoreb,
"userscoreb": info.userscorea,
"expa": info.expb,
"expb": info.expa,
"expa_ex": info.expb_ex,
"expb_ex": info.expa_ex,
"pta": info.ptb,
"ptb": info.pta,
"pta_ex": info.ptb_ex,
"ptb_ex": info.pta_ex,
}
}
console.log('%c ---------------------src'+'\\'+'components'+'\\'+'Profile.vue---------------------%c:227','background:#1b5fbd','background:#ce8e6b',
info)
return exchangeInfo
},
init: function () {
},
......@@ -241,12 +271,14 @@
if (!username) return;
API.getUserDueHistory({ username: username, type: "1", page_num: 100 }).then((res) => {
if (rankTable) {
rankTable.destroy();
}
rankTable = this.renderRankTable("#athletic_rank", res.data.data, "DP")
}, (res) => {
console.log(res)
});
API.getUserDueHistory({ username: username, type: "2", page_num: 100 }).then((res) => {
......@@ -255,7 +287,8 @@
}
rankTable2 = this.renderRankTable("#entertain_rank", res.data.data, "")
}, (res) => {
console.log(res)
console.log('%c ---------------------src'+'\\'+'components'+'\\'+'Profile.vue---------------------%c:258','background:#ef98b5','background:#53116e',
res)
});
var _this = this;
......@@ -266,7 +299,8 @@
_this.showActivity = true;
}
}, (res) => {
console.log(res)
console.log('%c ---------------------src'+'\\'+'components'+'\\'+'Profile.vue---------------------%c:271','background:#c85336','background:#a4c933',
res)
});
},
......@@ -275,7 +309,13 @@
var lang = localStorage.getItem('lang') || 'cn';
var rank = 1;
console.log('%c ---------------------src'+'\\'+'components'+'\\'+'Profile.vue---------------------%c:284','background:#c896f3','background:#f332b2',
tableData)
let that=this
var processData = tableData.map(function (d) {
d=that.exchangeUserInfo(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,
d.pta, d.pta_ex, d.ptb, d.ptb_ex];
......
......@@ -240,7 +240,30 @@
},
methods: {
exchangeUserInfo(info){
let userName=this.username
let exchangeInfo=info
if(info.usernamea!=userName)
{
exchangeInfo={
"usernamea": info.usernameb,
"usernameb": info.usernamea,
"userscorea": info.userscoreb,
"userscoreb": info.userscorea,
"expa": info.expb,
"expb": info.expa,
"expa_ex": info.expb_ex,
"expb_ex": info.expa_ex,
"pta": info.ptb,
"ptb": info.pta,
"pta_ex": info.ptb_ex,
"ptb_ex": info.pta_ex,
}
}
return exchangeInfo
},
onSubmit: function () {
this.searchByUsername(this.searchText)
},
......@@ -303,7 +326,9 @@
var lang = localStorage.getItem('lang') || 'cn';
var rank = 1;
let that=this
var processData = tableData.map(function (d) {
d=that.exchangeUserInfo(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,
d.pta, d.pta_ex, d.ptb, d.ptb_ex];
......
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