95 lines
3.1 KiB
JavaScript
95 lines
3.1 KiB
JavaScript
|
|
"use strict";
|
||
|
|
cc._RF.push(module, '46d68qjE7FCb46d0iYrmQQz', 'cmp.pvp.ladder.record.item');
|
||
|
|
// Scripts/mod/pvp/ladder/cmp/cmp.pvp.ladder.record.item.js
|
||
|
|
|
||
|
|
"use strict";
|
||
|
|
|
||
|
|
var SVCItem = require("nx.fx.sv.expand.item");
|
||
|
|
var Header = require("cmp.common.header");
|
||
|
|
var RoleController = require("role_controller");
|
||
|
|
var BattleController = require("battle_controller");
|
||
|
|
|
||
|
|
/**********
|
||
|
|
*
|
||
|
|
* 各不同类型排行列表单个ui数据显示
|
||
|
|
*/
|
||
|
|
|
||
|
|
cc.Class({
|
||
|
|
"extends": SVCItem,
|
||
|
|
properties: {
|
||
|
|
nodOtherHeader: {
|
||
|
|
"default": null,
|
||
|
|
type: Header,
|
||
|
|
displayName: "对战者头像"
|
||
|
|
},
|
||
|
|
nodResult: {
|
||
|
|
"default": null,
|
||
|
|
type: cc.Node,
|
||
|
|
displayName: "输赢显示"
|
||
|
|
},
|
||
|
|
nodDate: {
|
||
|
|
"default": null,
|
||
|
|
type: cc.Node,
|
||
|
|
displayName: "时间戳"
|
||
|
|
},
|
||
|
|
nodResultLog: {
|
||
|
|
"default": null,
|
||
|
|
type: cc.Node,
|
||
|
|
displayName: "输赢标识"
|
||
|
|
},
|
||
|
|
nodResultScore: {
|
||
|
|
"default": null,
|
||
|
|
type: cc.Node,
|
||
|
|
displayName: "输赢分数显示"
|
||
|
|
}
|
||
|
|
},
|
||
|
|
// 数据重置
|
||
|
|
rebind: function rebind(_idx, _data, _key) {
|
||
|
|
this._super(_idx, _data, _key);
|
||
|
|
this.freshInfo();
|
||
|
|
},
|
||
|
|
// 刷新具体信息
|
||
|
|
freshInfo: function freshInfo() {
|
||
|
|
if (!this.mdata) {
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
this.freshHeader();
|
||
|
|
this.freshContentInfo();
|
||
|
|
/****{"rid":140,"srv_id":"fx_1","name":"Myuokok","lev":90,"sex":2,
|
||
|
|
* "face":24406,"avatar_id":0,"power":1107668,"score":0,"type":1,
|
||
|
|
* "ret":2,"replay_id":2344,"time":1687142042,"face_update_time":0,"face_file":""} */
|
||
|
|
// console.log( "挑战记录---->>>>" + JSON.stringify( this.mdata ) );
|
||
|
|
},
|
||
|
|
|
||
|
|
freshHeader: function freshHeader() {
|
||
|
|
nx.gui.setString(this, "info/server", "[" + this.mdata.srv_id + "]");
|
||
|
|
nx.gui.setString(this, "info/name", this.mdata.name);
|
||
|
|
nx.gui.setString(this, "power/txt", this.mdata.power);
|
||
|
|
var data = {
|
||
|
|
face: this.mdata.face
|
||
|
|
};
|
||
|
|
this.nodOtherHeader.setData(data);
|
||
|
|
},
|
||
|
|
freshContentInfo: function freshContentInfo() {
|
||
|
|
var path = "";
|
||
|
|
path = this.mdata.ret == 2 ? cc.path.join("prefab/pvp/ui/lose") : cc.path.join("prefab/pvp/ui/win");
|
||
|
|
nx.gui.setSpriteFrame(this.nodResult, "", path);
|
||
|
|
var color = this.mdata.rank == 0 ? cc.Color.BLACK : this.mdata.rank > 0 ? new cc.Color().fromHEX("#039419") : new cc.Color().fromHEX("#f32f09");
|
||
|
|
var score = this.mdata.rank == 0 ? nx.text.getKey("UnChanged") : this.mdata.rank > 0 ? "No." + this.mdata.rank : "No." + this.mdata.rank;
|
||
|
|
nx.gui.setString(this.nodResultScore, "", score);
|
||
|
|
nx.gui.setColor(this.nodResultScore, "", color);
|
||
|
|
var ilog = "";
|
||
|
|
ilog = this.mdata.ret == 1 ? cc.path.join("prefab/pvp/ui/arena_30") : cc.path.join("prefab/pvp/ui/arena_31");
|
||
|
|
nx.gui.setSpriteFrame(this.nodResultLog, "", ilog);
|
||
|
|
nx.gui.setActive(this.nodResultLog, "", this.mdata.score != 0);
|
||
|
|
var date = nx.bridge.time.toLocalString(this.mdata.time);
|
||
|
|
nx.gui.setString(this.nodDate, "", date);
|
||
|
|
},
|
||
|
|
onTouchRecord: function onTouchRecord() {
|
||
|
|
var BC = BattleController.getInstance();
|
||
|
|
BC.csRecordBattle(this.mdata.replay_id);
|
||
|
|
nx.bridge.closePanel("WndLadderWarLog");
|
||
|
|
}
|
||
|
|
});
|
||
|
|
|
||
|
|
cc._RF.pop();
|