This commit is contained in:
guoqing.zhu 2022-06-07 17:02:08 +08:00
parent 5f057b3ae8
commit 5496a638bb
2 changed files with 82 additions and 76 deletions

View File

@ -1,83 +1,87 @@
let viewCell = require("viewCell") let viewCell = require('viewCell');
var gameConfig = require("gameConfig") var gameConfig = require('gameConfig');
var NetManage = require("NetManage") var NetManage = require('NetManage');
const { uimanger } = require('../UIManger');
const { GuestLoginTip } = require('../../tips/GuestLoginTip');
cc.Class({ cc.Class({
extends: viewCell, extends: viewCell,
properties: { properties: {
lb_des: {
default: null,
type: cc.Label,
},
lb_count: {
default: null,
type: cc.Label,
},
lb_jd: {
default: null,
type: cc.Label,
},
lb_des: { nd_doing: {
default: null, default: null,
type: cc.Label, type: cc.Node,
}, },
lb_count: { nd_finish: {
default: null, default: null,
type: cc.Label, type: cc.Node,
}, },
lb_jd: { nd_lingqu: {
default: null, default: null,
type: cc.Label, type: cc.Node,
}, },
},
init: function (index, data, reload, group) {
if (index >= data.array.length) {
this.node.active = false;
return;
}
this.target = data.target;
var sdata = data.array[index];
this.initdata(sdata);
},
initdata(v) {
var state = v.state;
this.mid = v.mission_id;
this.lb_jd.string = v.current + '/' + v.target;
var cfg = gameConfig.task[this.mid];
this.lb_des.string = cfg.des;
this.nd_lingqu.active =
this.nd_finish.active =
this.nd_doing.active =
false;
if (state == 0) {
this.nd_lingqu.active = true;
this.lb_jd.string = ' ';
} else if (state == 1) {
this.nd_finish.active = true;
this.lb_jd.string = ' ';
} else if (state == 2) {
this.nd_doing.active = true;
}
var items = cc.playerData.getDrop(cfg.reward);
nd_doing: { this.lb_count.string = items[0].num;
default: null,
type: cc.Node,
},
nd_finish: {
default: null,
type: cc.Node,
},
nd_lingqu: {
default: null,
type: cc.Node,
},
}, this.jump = cfg.jump_value;
},
init: function(index, data, reload, group) { onclickgo() {
if (index >= data.array.length) { if (!window.hasWallet) {
this.node.active = false uimanger.showUI(GuestLoginTip.prefabPath);
return; return;
} }
this.target = data.target cc.uiMain.callbattlechosehero({
var sdata = data.array[index] teamuuid: null,
this.initdata(sdata) });
}, },
initdata(v) {
var state = v.state
this.mid = v.mission_id
this.lb_jd.string = v.current + "/" + v.target
var cfg = gameConfig.task[this.mid]
this.lb_des.string = cfg.des
this.nd_lingqu.active = this.nd_finish.active = this.nd_doing.active = false
if (state == 0) {
this.nd_lingqu.active = true
this.lb_jd.string = " "
} else if (state == 1) {
this.nd_finish.active = true
this.lb_jd.string = " "
} else if (state == 2) {
this.nd_doing.active = true
}
var items = cc.playerData.getDrop(cfg.reward)
this.lb_count.string = items[0].num onclickget() {
NetManage.commitMission(this.mid, () => {
NetManage.missionList(1);
this.jump = cfg.jump_value });
}, },
onclickgo() {
cc.uiMain.callbattlechosehero({
teamuuid: null,
})
},
onclickget() {
NetManage.commitMission(this.mid, () => {
NetManage.missionList(1)
})
},
}); });

View File

@ -2,6 +2,8 @@ let viewCell = require('viewCell');
var gameConfig = require('gameConfig'); var gameConfig = require('gameConfig');
var NetManage = require('NetManage'); var NetManage = require('NetManage');
var Utils = require('Utils'); var Utils = require('Utils');
const { uimanger } = require('../UIManger');
const { GuestLoginTip } = require('../../tips/GuestLoginTip');
cc.Class({ cc.Class({
extends: viewCell, extends: viewCell,