Commit 50ad7f59 authored by wildfirecode's avatar wildfirecode

Merge branch 'dev' of gitlab2.dui88.com:wanghongyuan/xiaoxiaole into dev

parents 9bb65f02 65738edc
...@@ -2014,5 +2014,19 @@ export class NetManager extends ABNetManager { ...@@ -2014,5 +2014,19 @@ export class NetManager extends ABNetManager {
}; };
this.send(net); this.send(net);
} }
public acceptInvitationPrize(callback: Function): void {
const net: INetData = {
name: NetName.ACCEPT_INVITATION,
uri: '/customActivity/happyclear/acceptInvitationPrize',
type: 'post',
dataType: 'json',
param: {
activityId: DataManager.ins.customCfgData.actId,
},
callback: callback
};
this.send(net);
}
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
} }
\ No newline at end of file
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
</e:skinName> </e:skinName>
</e:Button> </e:Button>
<e:Group x="84.67" y="0"> <e:Group x="84.67" y="0">
<e:Image source="invite_txtbg_png" x="0" y="0" touchEnabled="false"/> <e:Image id="inviteTipsBg" source="invite_txtbg_png" x="0" y="0" touchEnabled="false"/>
<e:Label id="inviteTips" text="待领取取" horizontalCenter="0" verticalCenter="0" verticalAlign="middle" textAlign="center" textColor="0xffffff" size="16"/> <e:Label id="inviteTips" text="待领取取" horizontalCenter="0" verticalCenter="0" verticalAlign="middle" textAlign="center" textColor="0xffffff" size="16"/>
</e:Group> </e:Group>
</e:Group> </e:Group>
......
...@@ -20,6 +20,7 @@ import getResPath from "../../libs/new_tc/getResPath"; ...@@ -20,6 +20,7 @@ import getResPath from "../../libs/new_tc/getResPath";
import CountDown from "./CountDown"; import CountDown from "./CountDown";
import AvatarComp from "./AvatarComp"; import AvatarComp from "./AvatarComp";
import Utils from "../Utils"; import Utils from "../Utils";
import tr = egret.sys.tr;
export default class MapScene extends Scene { export default class MapScene extends Scene {
...@@ -391,17 +392,30 @@ export default class MapScene extends Scene { ...@@ -391,17 +392,30 @@ export default class MapScene extends Scene {
case (flag == 0): // 未完成 case (flag == 0): // 未完成
PanelCtrl.instance.show('invite', res.data); PanelCtrl.instance.show('invite', res.data);
break; break;
case (flag == 1): // 完成未开奖 待领奖 case (flag == 1): // 完成未开奖 待领奖 请求领奖接口
NetManager.ins.acceptInvitationPrize((success, res)=>{
if(!success){
return;
}
console.log(res.data);
if(res.data.completeFlag == 3){
showToast("哎呀,萌狮开小差啦!\n过会再来看吧!");
}else{
PanelCtrl.instance.show('invitePrize', res.data); PanelCtrl.instance.show('invitePrize', res.data);
}
});
break; break;
case (flag == 2): // 领奖成功 case (flag == 2): // 领奖成功 倒计时
case (flag == 3): // 领奖失败 倒计时
PanelCtrl.instance.show('inviteCutTime', res.data); PanelCtrl.instance.show('inviteCutTime', res.data);
break;
case (flag == 3): // 领奖失败
break; break;
case (flag == 4): // 可以开启下一次发任务 case (flag == 4): // 可以开启下一次发任务
NetManager.ins.acceptInvitationInfo((success, res)=>{
if(!success){
return;
}
PanelCtrl.instance.show('invite', res.data);
});
break; break;
default: default:
break; break;
...@@ -421,6 +435,8 @@ export default class MapScene extends Scene { ...@@ -421,6 +435,8 @@ export default class MapScene extends Scene {
let flag = res.data.completeFlag; let flag = res.data.completeFlag;
switch(true) { switch(true) {
case (flag == 0): // 未完成 显示倒计时 case (flag == 0): // 未完成 显示倒计时
this["inviteTipsBg"].visible = true;
this["inviteTips"].visible = true;
this.cutTime = res.data.endTime - res.data.sysTime + 1000; this.cutTime = res.data.endTime - res.data.sysTime + 1000;
console.log(this.cutTime); console.log(this.cutTime);
this.timer = new egret.Timer(1000, 0); this.timer = new egret.Timer(1000, 0);
...@@ -429,13 +445,19 @@ export default class MapScene extends Scene { ...@@ -429,13 +445,19 @@ export default class MapScene extends Scene {
this.cutTimer(); this.cutTimer();
break; break;
case (flag == 1): // 完成未开奖 待领奖 显示待领奖 case (flag == 1): // 完成未开奖 待领奖 显示待领奖
this["inviteTipsBg"].visible = true;
this["inviteTips"].visible = true;
this["inviteTips"].text = "待领奖"; this["inviteTips"].text = "待领奖";
break; break;
case (flag == 2): // 领奖成功 case (flag == 2): // 领奖成功 无角标
break; case (flag == 3): // 领奖失败 无角标
case (flag == 3): // 领奖失败 this["inviteTipsBg"].visible = false;
this["inviteTips"].visible = false;
break; break;
case (flag == 4): // 可以开启下一次发任务 case (flag == 4): // 可以开启下一次发任务 显示立即到账
this["inviteTipsBg"].visible = true;
this["inviteTips"].visible = true;
this["inviteTips"].text = "立即到账";
break; break;
default: default:
break; break;
......
...@@ -40,6 +40,11 @@ export default class InviteCutTimePanel extends Panel { ...@@ -40,6 +40,11 @@ export default class InviteCutTimePanel extends Panel {
} }
onTouchOK() { onTouchOK() {
if((getHomeData().levels.length + 1)>window['last_level']){
changeMapScene();
super.hidePanel();
return;
}
PanelCtrl.instance.show("StartPanel", getHomeData().levels.length + 1); PanelCtrl.instance.show("StartPanel", getHomeData().levels.length + 1);
} }
......
...@@ -64,6 +64,9 @@ export default class InvitePanel extends Panel { ...@@ -64,6 +64,9 @@ export default class InvitePanel extends Panel {
initUI() { initUI() {
this.setWXShareTip(); this.setWXShareTip();
this.prizeImg.source = this.data.img; this.prizeImg.source = this.data.img;
if(!this.data.invitationUser){
this.data.invitationUser = [];
}
let dNum = this.data.invitationCount - this.data.invitationUser.length; let dNum = this.data.invitationCount - this.data.invitationUser.length;
this.numLabel.text = `仅差${dNum}人可获得`; this.numLabel.text = `仅差${dNum}人可获得`;
for(let i = 0; i < dNum; i++) { for(let i = 0; i < dNum; i++) {
......
import Panel from "../../libs/new_wx/components/Panel"; import Panel from "../../libs/new_wx/components/Panel";
import PanelCtrl from "../../libs/new_wx/ctrls/panelCtrl"; import PanelCtrl from "../../libs/new_wx/ctrls/panelCtrl";
import getHomeData from "../getHomeData"; import getHomeData from "../getHomeData";
import { changeMapScene } from "../startScene/StartScene";
/** /**
* 邀请规则面板 * 邀请规则面板
...@@ -37,6 +38,11 @@ export default class InvitePrizePanel extends Panel { ...@@ -37,6 +38,11 @@ export default class InvitePrizePanel extends Panel {
} }
onTouchOK() { onTouchOK() {
if((getHomeData().levels.length + 1)>window['last_level']){
changeMapScene();
super.hidePanel();
return;
}
PanelCtrl.instance.show("StartPanel", getHomeData().levels.length + 1); PanelCtrl.instance.show("StartPanel", getHomeData().levels.length + 1);
} }
......
...@@ -128,6 +128,12 @@ const config = { ...@@ -128,6 +128,12 @@ const config = {
'/customActivity/happyclear/invitationInfo': { '/customActivity/happyclear/invitationInfo': {
data: './happyclear/getInviteInfo.json' data: './happyclear/getInviteInfo.json'
}, },
'/customActivity/happyclear/acceptInvitationInfo':{
data: './happyclear/acceptInvitationInfo.json'
},
'/customActivity/happyclear/acceptInvitationPrize':{
data: './happyclear/acceptInvitationPrize.json'
}
} }
for (let item in config) { for (let item in config) {
......
{
"success": true,
"code": null,
"desc": null,
"timestamp": 1566199822308,
"data": {
"invitationId": "活动id",
"invitationCount": 0,
"img": "http://yun.duiba.com.cn/db_games/xiaoxiaole.jpg",
"sysTime": 1570630215000,
"endTime": 1570672800000,
"completeFlag": 0,
"openPrizMsg": "图片",
"prizeType": "nickname",
"prizeName": "nickname",
"prizeImg": "http://yun.duiba.com.cn/db_games/xiaoxiaole.jpg",
"facePrice": "avatar"
}
}
\ No newline at end of file
{
"success": true,
"code": null,
"desc": null,
"timestamp": 1566199822308,
"data": {
"invitationId": "活动id",
"img": "http://yun.duiba.com.cn/db_games/xiaoxiaole.jpg",
"completeFlag": 1,
"openPrizMsg": "图片",
"prizeType": "nickname",
"prizeName": "nickname",
"prizeImg": "http://yun.duiba.com.cn/db_games/xiaoxiaole.jpg",
"facePrice": "avatar"
}
}
\ No newline at end of file
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
"avatar": "http://yun.duiba.com.cn/db_games/xiaoxiaole.jpg" "avatar": "http://yun.duiba.com.cn/db_games/xiaoxiaole.jpg"
} }
], ],
"completeFlag": 0, "completeFlag": 1,
"openPrizeMsg": "图片", "openPrizeMsg": "图片",
"prizeType": "nickname", "prizeType": "nickname",
"prizeName": "nickname", "prizeName": "nickname",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment