This commit is contained in:
guoqing.zhu 2022-06-07 12:21:24 +08:00
parent 8dfdfdb5aa
commit d1e1aa8b83
4 changed files with 93 additions and 66 deletions

View File

@ -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);

View File

@ -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<datahero.length;i+=1){
if(datahero[i]) this.allHasGotHero.push(datahero[i].hero_uniid)
this.allHasGotHero = new Array();
this.allHasGotGun = new Array();
for (let i = 0; i < datahero.length; i += 1) {
if (datahero[i]) this.allHasGotHero.push(datahero[i].hero_uniid);
}
for(let i=0;i<datagun.length;i+=1){
if(datagun[i]) this.allHasGotGun.push(datagun[i].gun_uniid)
for (let i = 0; i < datagun.length; i += 1) {
if (datagun[i]) this.allHasGotGun.push(datagun[i].gun_uniid);
}
this.set()
this.set();
},
close() {
this.nd_heroContent.children.forEach((element) => {
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);
}

View File

@ -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;

View File

@ -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);
},
};