This commit is contained in:
guoqing.zhu 2022-06-06 10:51:24 +08:00
parent e0ef810593
commit 2da0dbbb7b
11 changed files with 175 additions and 31 deletions

View File

@ -10246,8 +10246,8 @@
},
"_enabled": true,
"_useOriginalSize": false,
"_string": "99:99:99",
"_N$string": "99:99:99",
"_string": "",
"_N$string": "",
"_fontSize": 40,
"_lineHeight": 40,
"_enableWrapText": true,

View File

@ -4622,8 +4622,8 @@
},
"_enabled": true,
"_useOriginalSize": false,
"_string": "99:99:99",
"_N$string": "99:99:99",
"_string": "",
"_N$string": "",
"_fontSize": 40,
"_lineHeight": 40,
"_enableWrapText": true,

View File

@ -4391,8 +4391,8 @@
},
"_enabled": true,
"_useOriginalSize": false,
"_string": "99:99:99",
"_N$string": "99:99:99",
"_string": "",
"_N$string": "",
"_fontSize": 40,
"_lineHeight": 40,
"_enableWrapText": true,
@ -9012,8 +9012,8 @@
},
"_enabled": true,
"_useOriginalSize": false,
"_string": "99:99:99",
"_N$string": "99:99:99",
"_string": "",
"_N$string": "",
"_fontSize": 40,
"_lineHeight": 40,
"_enableWrapText": true,
@ -13633,8 +13633,8 @@
},
"_enabled": true,
"_useOriginalSize": false,
"_string": "99:99:99",
"_N$string": "99:99:99",
"_string": "",
"_N$string": "",
"_fontSize": 40,
"_lineHeight": 40,
"_enableWrapText": true,
@ -18254,8 +18254,8 @@
},
"_enabled": true,
"_useOriginalSize": false,
"_string": "99:99:99",
"_N$string": "99:99:99",
"_string": "",
"_N$string": "",
"_fontSize": 40,
"_lineHeight": 40,
"_enableWrapText": true,

View File

@ -3066,8 +3066,8 @@
},
"_enabled": true,
"_useOriginalSize": false,
"_string": "99:99:99",
"_N$string": "99:99:99",
"_string": "",
"_N$string": "",
"_fontSize": 40,
"_lineHeight": 40,
"_enableWrapText": true,
@ -6439,8 +6439,8 @@
},
"_enabled": true,
"_useOriginalSize": false,
"_string": "99:99:99",
"_N$string": "99:99:99",
"_string": "",
"_N$string": "",
"_fontSize": 40,
"_lineHeight": 40,
"_enableWrapText": true,
@ -9812,8 +9812,8 @@
},
"_enabled": true,
"_useOriginalSize": false,
"_string": "99:99:99",
"_N$string": "99:99:99",
"_string": "",
"_N$string": "",
"_fontSize": 40,
"_lineHeight": 40,
"_enableWrapText": true,

View File

@ -257,13 +257,19 @@ cc.Class({
herolist = data.hero_list;
for (var i = 0; i < herolist.length; i++) {
var element = herolist[i];
this.allHeroUUID.push(element.hero_uniid);
this.heroDetails.push(herolist[i])
if(element.lock_type!=3){
this.allHeroUUID.push(element.hero_uniid);
this.allHeroID.push(element.hero_id)
this.heroDetails.push(herolist[i])
}
}
});
for (var i = 0; i < openherolist.length; i++) {
var hid = openherolist[i];
console.log(this.allHeroID)
for (var i = 0; i < this.allHeroID.length; i++) {
var hid = this.allHeroID[i];
var heroType = gameConfig.playerConfig[hid].herotype;
if (type == 0 || type == heroType) {
if (cc.playerData.checkhasgethero(hid)) {
@ -273,13 +279,36 @@ cc.Class({
}
var newlist = Utils.arrtoarr(cherolist, 2);
this.allHeroID = cherolist;
// this.allHeroID = cherolist;
this.tableView_chose
.getComponent("tableView")
.initTableView(newlist.length, {
array: newlist,
target: this,
});
});
// for (var i = 0; i < openherolist.length; i++) {
// var hid = openherolist[i];
// var heroType = gameConfig.playerConfig[hid].herotype;
// if (type == 0 || type == heroType) {
// if (cc.playerData.checkhasgethero(hid)) {
// cherolist.push(hid);
// }
// }
// }
// var newlist = Utils.arrtoarr(cherolist, 2);
// this.allHeroID = cherolist;
// this.tableView_chose
// .getComponent("tableView")
// .initTableView(newlist.length, {
// array: newlist,
// target: this,
// });
},
getHeroUUidByid(id) {

View File

@ -98,7 +98,9 @@ cc.Class({
// gun.getComponent(cc.Button).
gun.getComponent("guns_single").removeClickEvent();
gun.off("click", this.chooseEvent, this);
gun.on("click", this.chooseEvent, this);
if( gun.getComponent("guns_single").wantedNode.active != true){
gun.on("click", this.chooseEvent, this);
}
});
});
});

View File

@ -65,10 +65,18 @@ export default class guns_info extends UIBase {
["35", this.lab_successrate],
["37", this.lab_naijiu],
]);
console.log(JSON.stringify(data.lock_type))
var lefttime = data.unlock_lefttime
if(data.lock_type==3){
this.showWanted()
this.wantedNode.getComponentInChildren(cc.Label).string = this.formatSeconds(lefttime)
this.schedule(function () {
this.wantedNode.getComponentInChildren(cc.Label).string = this.formatSeconds(lefttime)
lefttime-=1
}, 1);
}else{
this.wantedNode.active = false
@ -119,4 +127,25 @@ export default class guns_info extends UIBase {
imgNode.getComponent(cc.Sprite).spriteFrame = res;
});
}
formatSeconds(value) {
let result = parseInt(value);
let h =
Math.floor(result / 3600) < 10
? '0' + Math.floor(result / 3600)
: Math.floor(result / 3600);
let m =
Math.floor((result / 60) % 60) < 10
? '0' + Math.floor((result / 60) % 60)
: Math.floor((result / 60) % 60);
let s =
Math.floor(result % 60) < 10
? '0' + Math.floor(result % 60)
: Math.floor(result % 60);
let res = '';
res += `${h}:`;
res += `${m}:`;
res += `${s}`;
return res;
}
}

View File

@ -31,10 +31,16 @@ export class guns_single extends cc.Component {
}
var limit = data.ceg_uplimit
var get = data.today_get_gold
console.log(JSON.stringify(data.lock_type))
var lefttime = data.unlock_lefttime
if(data.lock_type==3){
this.showWanted()
this.wantedNode.getComponentInChildren(cc.Label).string = this.formatSeconds(lefttime)
this.schedule(function () {
this.wantedNode.getComponentInChildren(cc.Label).string = this.formatSeconds(lefttime)
lefttime-=1
}, 1);
}else{
this.wantedNode.active = false
}
@ -78,4 +84,26 @@ export class guns_single extends cc.Component {
removeClickEvent() {
this.getComponent(cc.Button).clickEvents.length = 0;
}
formatSeconds(value) {
let result = parseInt(value);
let h =
Math.floor(result / 3600) < 10
? '0' + Math.floor(result / 3600)
: Math.floor(result / 3600);
let m =
Math.floor((result / 60) % 60) < 10
? '0' + Math.floor((result / 60) % 60)
: Math.floor((result / 60) % 60);
let s =
Math.floor(result % 60) < 10
? '0' + Math.floor(result % 60)
: Math.floor(result % 60);
let res = '';
res += `${h}:`;
res += `${m}:`;
res += `${s}`;
return res;
}
}

View File

@ -108,9 +108,14 @@ export class UIHeroinfo extends UIBase {
init(data: any) {
console.log(JSON.stringify(data.lock_type))
var lefttime = data.unlock_lefttime
if(data.lock_type==3){
this.showWanted()
this.wantedNode.getComponentInChildren(cc.Label).string = this.formatSeconds(lefttime)
this.schedule(function () {
this.wantedNode.getComponentInChildren(cc.Label).string = this.formatSeconds(lefttime)
lefttime-=1
}, 1);
}else{
this.wantedNode.active = false
}
@ -317,4 +322,26 @@ export class UIHeroinfo extends UIBase {
onClickUpgrade() {
uimanger.showUI(UIUpdateHero.prefabPath, {});
}
formatSeconds(value) {
let result = parseInt(value);
let h =
Math.floor(result / 3600) < 10
? '0' + Math.floor(result / 3600)
: Math.floor(result / 3600);
let m =
Math.floor((result / 60) % 60) < 10
? '0' + Math.floor((result / 60) % 60)
: Math.floor((result / 60) % 60);
let s =
Math.floor(result % 60) < 10
? '0' + Math.floor(result % 60)
: Math.floor(result % 60);
let res = '';
res += `${h}:`;
res += `${m}:`;
res += `${s}`;
return res;
}
}

View File

@ -54,9 +54,16 @@ cc.Class({
return;
}
console.log(JSON.stringify(v.lock_type))
var lefttime= v.unlock_lefttime
if(v.lock_type==3){
this.showWanted()
this.wantedNode.getComponentInChildren(cc.Label).string = this.formatSeconds(lefttime)
this.schedule(function () {
this.wantedNode.getComponentInChildren(cc.Label).string = this.formatSeconds(lefttime)
lefttime-=1
}, 1);
}else{
this.wantedNode.active = false
}
@ -106,4 +113,26 @@ cc.Class({
onclick() {
uimanger.showUI(this.infoPage, this._data);
},
formatSeconds(value) {
let result = parseInt(value);
let h =
Math.floor(result / 3600) < 10
? '0' + Math.floor(result / 3600)
: Math.floor(result / 3600);
let m =
Math.floor((result / 60) % 60) < 10
? '0' + Math.floor((result / 60) % 60)
: Math.floor((result / 60) % 60);
let s =
Math.floor(result % 60) < 10
? '0' + Math.floor(result % 60)
: Math.floor(result % 60);
let res = '';
res += `${h}:`;
res += `${m}:`;
res += `${s}`;
return res;
}
});

View File

@ -88,8 +88,8 @@ cc.Class({
: Math.floor(result % 60);
let res = '';
if (h !== '00') res += `${h}:`;
if (m !== '00') res += `${m}:`;
res += `${h}:`;
res += `${m}:`;
res += `${s}`;
return res;
},