From 5496a638bb3336dc0611537e199f16c69983bb2d Mon Sep 17 00:00:00 2001 From: "guoqing.zhu" <1521292690@qq.com> Date: Tue, 7 Jun 2022 17:02:08 +0800 Subject: [PATCH] fix --- assets/scripts/UI/season/cellTaskSeason.js | 154 +++++++++++---------- assets/scripts/UI/task/cellTask.js | 4 +- 2 files changed, 82 insertions(+), 76 deletions(-) diff --git a/assets/scripts/UI/season/cellTaskSeason.js b/assets/scripts/UI/season/cellTaskSeason.js index 620aad62..0809375c 100644 --- a/assets/scripts/UI/season/cellTaskSeason.js +++ b/assets/scripts/UI/season/cellTaskSeason.js @@ -1,83 +1,87 @@ -let viewCell = require("viewCell") -var gameConfig = require("gameConfig") -var NetManage = require("NetManage") +let viewCell = require('viewCell'); +var gameConfig = require('gameConfig'); +var NetManage = require('NetManage'); +const { uimanger } = require('../UIManger'); +const { GuestLoginTip } = require('../../tips/GuestLoginTip'); 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: { - default: null, - type: cc.Label, - }, - lb_count: { - default: null, - type: cc.Label, - }, - lb_jd: { - default: null, - type: cc.Label, - }, + nd_doing: { + default: null, + type: cc.Node, + }, + nd_finish: { + default: null, + type: cc.Node, + }, + nd_lingqu: { + default: null, + 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: { - default: null, - type: cc.Node, - }, - nd_finish: { - default: null, - type: cc.Node, - }, - nd_lingqu: { - default: null, - type: cc.Node, - }, + this.lb_count.string = items[0].num; - }, + this.jump = cfg.jump_value; + }, - 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) + onclickgo() { + if (!window.hasWallet) { + uimanger.showUI(GuestLoginTip.prefabPath); + return; + } + cc.uiMain.callbattlechosehero({ + teamuuid: null, + }); + }, - this.lb_count.string = items[0].num - - - this.jump = cfg.jump_value - }, - - - onclickgo() { - cc.uiMain.callbattlechosehero({ - teamuuid: null, - }) - }, - - onclickget() { - NetManage.commitMission(this.mid, () => { - NetManage.missionList(1) - }) - }, -}); \ No newline at end of file + onclickget() { + NetManage.commitMission(this.mid, () => { + NetManage.missionList(1); + }); + }, +}); diff --git a/assets/scripts/UI/task/cellTask.js b/assets/scripts/UI/task/cellTask.js index 7f68f0dc..4fa884e1 100644 --- a/assets/scripts/UI/task/cellTask.js +++ b/assets/scripts/UI/task/cellTask.js @@ -2,6 +2,8 @@ let viewCell = require('viewCell'); var gameConfig = require('gameConfig'); var NetManage = require('NetManage'); var Utils = require('Utils'); +const { uimanger } = require('../UIManger'); +const { GuestLoginTip } = require('../../tips/GuestLoginTip'); cc.Class({ extends: viewCell, @@ -87,7 +89,7 @@ cc.Class({ } }, - onclickgo() { + onclickgo() { // console.log("open game") if (!window.hasWallet) {