|
@@ -36,7 +36,7 @@ Page({
|
|
pkRecord,
|
|
pkRecord,
|
|
pkRecordVOS
|
|
pkRecordVOS
|
|
} = await getPkResult(options.id)
|
|
} = await getPkResult(options.id)
|
|
- console.log(pkRecord,
|
|
|
|
|
|
+ console.log(options.id, pkRecord,
|
|
pkRecordVOS);
|
|
pkRecordVOS);
|
|
this.setData({
|
|
this.setData({
|
|
pkId: options.id,
|
|
pkId: options.id,
|
|
@@ -50,12 +50,12 @@ Page({
|
|
let first = resultData[0]
|
|
let first = resultData[0]
|
|
let second = resultData[1]
|
|
let second = resultData[1]
|
|
let victory = first.userRead.score > second.userRead.score ? first : second
|
|
let victory = first.userRead.score > second.userRead.score ? first : second
|
|
- let defeated = second.userRead.score <= first.userRead.score ? second : first
|
|
|
|
|
|
+ let defeated = second.userRead.score < first.userRead.score ? second : first
|
|
this.setData({
|
|
this.setData({
|
|
equal: first.userRead.score == second.userRead.score,
|
|
equal: first.userRead.score == second.userRead.score,
|
|
victory: first.userRead.score > second.userRead.score ? first : second,
|
|
victory: first.userRead.score > second.userRead.score ? first : second,
|
|
defeated,
|
|
defeated,
|
|
- vEnd:setDuration(victory.userRead.duration),
|
|
|
|
|
|
+ vEnd: setDuration(victory.userRead.duration),
|
|
dEnd: setDuration(defeated.userRead.duration),
|
|
dEnd: setDuration(defeated.userRead.duration),
|
|
})
|
|
})
|
|
},
|
|
},
|
|
@@ -170,10 +170,18 @@ Page({
|
|
ctx.textAlign = "center";
|
|
ctx.textAlign = "center";
|
|
var lnamex = this.data.equal ? 100 : 100,
|
|
var lnamex = this.data.equal ? 100 : 100,
|
|
lnamey = this.data.equal ? 125 : 115;
|
|
lnamey = this.data.equal ? 125 : 115;
|
|
- ctx.fillText(this.data.victory.user.nickName, lnamex, lnamey)
|
|
|
|
|
|
+ var vName = this.data.victory.user.nickName || this.data.victory.user.eid
|
|
|
|
+ if (vName.length > 4) {
|
|
|
|
+ vName = vName.slice(0, 4) + '...'
|
|
|
|
+ }
|
|
|
|
+ ctx.fillText(vName, lnamex, lnamey)
|
|
var rnamex = this.data.equal ? 280 : 280,
|
|
var rnamex = this.data.equal ? 280 : 280,
|
|
rnamey = this.data.equal ? 125 : 140;
|
|
rnamey = this.data.equal ? 125 : 140;
|
|
- ctx.fillText(this.data.defeated.user.nickName, rnamex, rnamey)
|
|
|
|
|
|
+ var dName = this.data.defeated.user.nickName || this.data.defeated.user.eid
|
|
|
|
+ if (dName.length > 4) {
|
|
|
|
+ dName = dName.slice(0, 4) + '...'
|
|
|
|
+ }
|
|
|
|
+ ctx.fillText(dName, rnamex, rnamey)
|
|
ctx.font = '19px PingFang';
|
|
ctx.font = '19px PingFang';
|
|
var lnumx = this.data.equal ? 100 : 100,
|
|
var lnumx = this.data.equal ? 100 : 100,
|
|
lnumy = this.data.equal ? 150 : 140;
|
|
lnumy = this.data.equal ? 150 : 140;
|