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 {
};
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 @@
</e:skinName>
</e:Button>
<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:Group>
</e:Group>
......
......@@ -20,6 +20,7 @@ import getResPath from "../../libs/new_tc/getResPath";
import CountDown from "./CountDown";
import AvatarComp from "./AvatarComp";
import Utils from "../Utils";
import tr = egret.sys.tr;
export default class MapScene extends Scene {
......@@ -391,17 +392,30 @@ export default class MapScene extends Scene {
case (flag == 0): // 未完成
PanelCtrl.instance.show('invite', res.data);
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);
}
});
break;
case (flag == 2): // 领奖成功
case (flag == 2): // 领奖成功 倒计时
case (flag == 3): // 领奖失败 倒计时
PanelCtrl.instance.show('inviteCutTime', res.data);
break;
case (flag == 3): // 领奖失败
break;
case (flag == 4): // 可以开启下一次发任务
NetManager.ins.acceptInvitationInfo((success, res)=>{
if(!success){
return;
}
PanelCtrl.instance.show('invite', res.data);
});
break;
default:
break;
......@@ -421,6 +435,8 @@ export default class MapScene extends Scene {
let flag = res.data.completeFlag;
switch(true) {
case (flag == 0): // 未完成 显示倒计时
this["inviteTipsBg"].visible = true;
this["inviteTips"].visible = true;
this.cutTime = res.data.endTime - res.data.sysTime + 1000;
console.log(this.cutTime);
this.timer = new egret.Timer(1000, 0);
......@@ -429,13 +445,19 @@ export default class MapScene extends Scene {
this.cutTimer();
break;
case (flag == 1): // 完成未开奖 待领奖 显示待领奖
this["inviteTipsBg"].visible = true;
this["inviteTips"].visible = true;
this["inviteTips"].text = "待领奖";
break;
case (flag == 2): // 领奖成功
break;
case (flag == 3): // 领奖失败
case (flag == 2): // 领奖成功 无角标
case (flag == 3): // 领奖失败 无角标
this["inviteTipsBg"].visible = false;
this["inviteTips"].visible = false;
break;
case (flag == 4): // 可以开启下一次发任务
case (flag == 4): // 可以开启下一次发任务 显示立即到账
this["inviteTipsBg"].visible = true;
this["inviteTips"].visible = true;
this["inviteTips"].text = "立即到账";
break;
default:
break;
......
......@@ -40,6 +40,11 @@ export default class InviteCutTimePanel extends Panel {
}
onTouchOK() {
if((getHomeData().levels.length + 1)>window['last_level']){
changeMapScene();
super.hidePanel();
return;
}
PanelCtrl.instance.show("StartPanel", getHomeData().levels.length + 1);
}
......
......@@ -64,6 +64,9 @@ export default class InvitePanel extends Panel {
initUI() {
this.setWXShareTip();
this.prizeImg.source = this.data.img;
if(!this.data.invitationUser){
this.data.invitationUser = [];
}
let dNum = this.data.invitationCount - this.data.invitationUser.length;
this.numLabel.text = `仅差${dNum}人可获得`;
for(let i = 0; i < dNum; i++) {
......
import Panel from "../../libs/new_wx/components/Panel";
import PanelCtrl from "../../libs/new_wx/ctrls/panelCtrl";
import getHomeData from "../getHomeData";
import { changeMapScene } from "../startScene/StartScene";
/**
* 邀请规则面板
......@@ -37,6 +38,11 @@ export default class InvitePrizePanel extends Panel {
}
onTouchOK() {
if((getHomeData().levels.length + 1)>window['last_level']){
changeMapScene();
super.hidePanel();
return;
}
PanelCtrl.instance.show("StartPanel", getHomeData().levels.length + 1);
}
......
......@@ -128,6 +128,12 @@ const config = {
'/customActivity/happyclear/invitationInfo': {
data: './happyclear/getInviteInfo.json'
},
'/customActivity/happyclear/acceptInvitationInfo':{
data: './happyclear/acceptInvitationInfo.json'
},
'/customActivity/happyclear/acceptInvitationPrize':{
data: './happyclear/acceptInvitationPrize.json'
}
}
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 @@
"avatar": "http://yun.duiba.com.cn/db_games/xiaoxiaole.jpg"
}
],
"completeFlag": 0,
"completeFlag": 1,
"openPrizeMsg": "图片",
"prizeType": "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