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 @@ ...@@ -216,10 +216,40 @@
API.getUserInfo(opt).then((res) => { API.getUserInfo(opt).then((res) => {
this.user_info = res.data this.user_info = res.data
console.log('%c ---------------------src'+'\\'+'components'+'\\'+'Profile.vue---------------------%c:219','background:#ed162b','background:#7d382d',
res)
}); });
}, },
methods: { 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 () { init: function () {
}, },
...@@ -241,12 +271,14 @@ ...@@ -241,12 +271,14 @@
if (!username) return; if (!username) return;
API.getUserDueHistory({ username: username, type: "1", page_num: 100 }).then((res) => { API.getUserDueHistory({ username: username, type: "1", page_num: 100 }).then((res) => {
if (rankTable) { if (rankTable) {
rankTable.destroy(); rankTable.destroy();
} }
rankTable = this.renderRankTable("#athletic_rank", res.data.data, "DP") rankTable = this.renderRankTable("#athletic_rank", res.data.data, "DP")
}, (res) => { }, (res) => {
console.log(res)
}); });
API.getUserDueHistory({ username: username, type: "2", page_num: 100 }).then((res) => { API.getUserDueHistory({ username: username, type: "2", page_num: 100 }).then((res) => {
...@@ -255,7 +287,8 @@ ...@@ -255,7 +287,8 @@
} }
rankTable2 = this.renderRankTable("#entertain_rank", res.data.data, "") rankTable2 = this.renderRankTable("#entertain_rank", res.data.data, "")
}, (res) => { }, (res) => {
console.log(res) console.log('%c ---------------------src'+'\\'+'components'+'\\'+'Profile.vue---------------------%c:258','background:#ef98b5','background:#53116e',
res)
}); });
var _this = this; var _this = this;
...@@ -266,7 +299,8 @@ ...@@ -266,7 +299,8 @@
_this.showActivity = true; _this.showActivity = true;
} }
}, (res) => { }, (res) => {
console.log(res) console.log('%c ---------------------src'+'\\'+'components'+'\\'+'Profile.vue---------------------%c:271','background:#c85336','background:#a4c933',
res)
}); });
}, },
...@@ -275,7 +309,13 @@ ...@@ -275,7 +309,13 @@
var lang = localStorage.getItem('lang') || 'cn'; var lang = localStorage.getItem('lang') || 'cn';
var rank = 1; 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) { 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'), 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, moment(d.end_time).format('YYYY-MM-DD HH:mm'), d.userscorea, d.userscoreb,
d.pta, d.pta_ex, d.ptb, d.ptb_ex]; d.pta, d.pta_ex, d.ptb, d.ptb_ex];
......
...@@ -240,7 +240,30 @@ ...@@ -240,7 +240,30 @@
}, },
methods: { 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 () { onSubmit: function () {
this.searchByUsername(this.searchText) this.searchByUsername(this.searchText)
}, },
...@@ -303,7 +326,9 @@ ...@@ -303,7 +326,9 @@
var lang = localStorage.getItem('lang') || 'cn'; var lang = localStorage.getItem('lang') || 'cn';
var rank = 1; var rank = 1;
let that=this
var processData = tableData.map(function (d) { 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'), 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, moment(d.end_time).format('YYYY-MM-DD HH:mm'), d.userscorea, d.userscoreb,
d.pta, d.pta_ex, d.ptb, d.ptb_ex]; 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