diff --git a/assets/scripts/UI/task/mission_choose.js b/assets/scripts/UI/task/mission_choose.js index 78dfa804..adb57c52 100644 --- a/assets/scripts/UI/task/mission_choose.js +++ b/assets/scripts/UI/task/mission_choose.js @@ -62,7 +62,6 @@ cc.Class({ }, initData(data, ceg_num) { - console.log('mission detail:' + JSON.stringify(data)); this.allChooseHero = new Array(); this.allChooseHero.length = 5; this.allChooseGun = new Array(); @@ -76,7 +75,6 @@ cc.Class({ if (data.param2) { for (let i = 0; i < data.param2; i += 1) { - console.log('set onmr '); this.stars.children[i].getComponent(cc.Sprite).spriteFrame = this.fullStarSpriteframe; } @@ -165,6 +163,7 @@ cc.Class({ .getComponent('mission_oneBox') .init(data); this.allChooseHero[this.currentBtn] = data; + this.refreshSendObj(); } }); @@ -174,6 +173,7 @@ cc.Class({ .getComponent('mission_oneBox') .init(data); this.allChooseGun[this.currentBtn] = data; + this.refreshSendObj(); } }); @@ -183,6 +183,34 @@ cc.Class({ // }); }, + refreshSendObj() { + var tempSend = ''; + this.allChooseHero.forEach((element) => { + if (element) { + if (element.hero_uniid) { + tempSend += `${1}:${element.hero_uniid}|`; + } + } + }); + + this.allChooseGun.forEach((element) => { + if (element) { + if (element.gun_uniid) { + tempSend += `${0}:${element.gun_uniid}|`; + } + } + }); + + NetManage.offerRewardMissionPreview( + this.missionData.id, + tempSend, + (res) => { + console.log(`预览=--=${JSON.stringify(res)}`); + this.ceg_num.string = `x${res.ceg_num}`; + } + ); + }, + close() { this.node.destroy(); cc.Notifier.off('hasChooseHero', this); diff --git a/assets/scripts/UI/task/mission_chooseDetail.js b/assets/scripts/UI/task/mission_chooseDetail.js index 182dcdc0..d778ffc1 100644 --- a/assets/scripts/UI/task/mission_chooseDetail.js +++ b/assets/scripts/UI/task/mission_chooseDetail.js @@ -55,31 +55,27 @@ cc.Class({ // }, }, - init(datahero,datagun,type) { + init(datahero, datagun, type) { // hero - - if(type==0){ + + if (type == 0) { this.onClickHero(); - }else{ + } else { this.onClickGun(); } - this.allHasGotHero = new Array() - this.allHasGotGun = new Array() - for(let i=0;i { element.scale = 1; @@ -113,13 +109,14 @@ cc.Class({ }); //set cover if ( - this.allHasGotHero.includes(element.hero_uniid.toString()) || element.lock_type==3 + this.allHasGotHero.includes( + element.hero_uniid.toString() + ) || + element.lock_type == 3 ) { node.getComponent('wantedHero').showCover(); } - - this.nd_heroContent.addChild(node); }); }); @@ -141,7 +138,8 @@ cc.Class({ }); if ( - this.allHasGotGun.includes(element.gun_uniid.toString()) || element.lock_type==3 + this.allHasGotGun.includes(element.gun_uniid.toString()) || + element.lock_type == 3 ) { node.getComponent('wantedHero').showCover(); } @@ -153,10 +151,9 @@ cc.Class({ onClickComfirm() { if (this.currentData != null) { - - if(this.currentData.hero_uniid){ + if (this.currentData.hero_uniid) { cc.Notifier.emit('hasChooseHero', this.currentData); - }else{ + } else { cc.Notifier.emit('hasChooseGun', this.currentData); } diff --git a/assets/scripts/UI/task/singleWanted.js b/assets/scripts/UI/task/singleWanted.js index d17637c5..af80f6ab 100644 --- a/assets/scripts/UI/task/singleWanted.js +++ b/assets/scripts/UI/task/singleWanted.js @@ -73,7 +73,6 @@ cc.Class({ NetManage.commitMission(this.missionId, () => { cc.uiHelper.showTips('Get Reward Success!'); }); - this.node.destroy(); } if (this.missionState == 1) { // no send @@ -183,7 +182,7 @@ cc.Class({ } } if (originData.state == 1) { - this.node.destroy(); + // this.node.destroy(); } this.ceg = originData.ceg_num; diff --git a/assets/scripts/manages/NetManage.js b/assets/scripts/manages/NetManage.js index 5f9e46be..3348f585 100644 --- a/assets/scripts/manages/NetManage.js +++ b/assets/scripts/manages/NetManage.js @@ -56,8 +56,8 @@ module.exports = { } } - if(obj.errcode == 1001){ - cc.Notifier.emit('multipointlogin'); + if (obj.errcode == 1001) { + cc.Notifier.emit('multipointlogin'); } }, function (errcode, errmsg) { @@ -96,7 +96,6 @@ module.exports = { ); }, - getTime(cb) { this.urlbd.clear(); this.urlbd @@ -111,7 +110,6 @@ module.exports = { ); }, - createTeam(cb) { this.urlbd.clear(); this.urlbd @@ -123,7 +121,6 @@ module.exports = { this.getResponce(cb, this.urlbd); }, - getTeamInfo(team_uuid, cb) { var teamid = ''; if (typeof team_uuid == 'string') { @@ -141,7 +138,6 @@ module.exports = { this.getResponce(cb, this.urlbd); }, - joinTeam(team_uuid, cb) { this.urlbd.clear(); this.urlbd @@ -153,7 +149,6 @@ module.exports = { this.getResponce(cb, this.urlbd); }, - leaveTeam(team_uuid, cb) { this.urlbd.clear(); this.urlbd @@ -165,7 +160,6 @@ module.exports = { this.getResponce(cb, this.urlbd); }, - teamStartGame(team_uuid) { this.urlbd.clear(); this.urlbd @@ -177,7 +171,6 @@ module.exports = { this.getResponce(null, this.urlbd); }, - saveNewbie(newbieid) { this.urlbd.clear(); this.urlbd @@ -192,7 +185,6 @@ module.exports = { ); }, - getNodeID(cb) { var urlbd = new urlbuilder(BaseNet.getNodeUrl()); urlbd.clear(); @@ -204,7 +196,6 @@ module.exports = { ); }, - dirtyWordCheck(text) { var urlbd; urlbd = new urlbuilder(BaseNet.getNormalApiUrl('service')); @@ -446,7 +437,7 @@ module.exports = { this.getResponce(cb, this.urlbd); }, - getUserMainInfo(cb){ + getUserMainInfo(cb) { this.urlbd.clear(); this.urlbd .addKV('c', 'User') @@ -628,35 +619,47 @@ module.exports = { this.getResponce(cb, this.urlbd); }, - searchUserByAccountid(account, cb) { - this.urlbd.clear(); - this.urlbd - .addKV("c", "User") - .addKV("a", "info") - .addKV("account_id", this.account_id) - .addKV("session_id", this.session_id) - .addKV("target_id", account); - this.getResponce(cb, this.urlbd); - }, + offerRewardMissionPreview(mission, objects, cb) { + this.urlbd.clear(); + this.urlbd + .addKV('c', 'Mission') + .addKV('a', 'offerRewardMissionPreview') + .addKV('account_id', this.account_id) + .addKV('session_id', this.session_id) + .addKV('mission_id', mission) + .addKV('objects', objects); + this.getResponce(cb, this.urlbd); + }, - searchUserByName(name, cb) { - this.urlbd.clear(); - this.urlbd - .addKV("c", "User") - .addKV("a", "query") - .addKV("account_id", this.account_id) - .addKV("session_id", this.session_id) - .addKV("name", name); - this.getResponce(cb, this.urlbd); - }, + searchUserByAccountid(account, cb) { + this.urlbd.clear(); + this.urlbd + .addKV('c', 'User') + .addKV('a', 'info') + .addKV('account_id', this.account_id) + .addKV('session_id', this.session_id) + .addKV('target_id', account); + this.getResponce(cb, this.urlbd); + }, + + searchUserByName(name, cb) { + this.urlbd.clear(); + this.urlbd + .addKV('c', 'User') + .addKV('a', 'query') + .addKV('account_id', this.account_id) + .addKV('session_id', this.session_id) + .addKV('name', name); + this.getResponce(cb, this.urlbd); + }, getRankOpenList(cb) { - this.urlbd.clear(); - this.urlbd - .addKV("c", "Ranking") - .addKV("a", "getOpenList") - .addKV("account_id", this.account_id) - .addKV("session_id", this.session_id) - this.getResponce(cb, this.urlbd); - }, + this.urlbd.clear(); + this.urlbd + .addKV('c', 'Ranking') + .addKV('a', 'getOpenList') + .addKV('account_id', this.account_id) + .addKV('session_id', this.session_id); + this.getResponce(cb, this.urlbd); + }, };