Commit d68ee068 authored by 邱旭's avatar 邱旭

1

parent 57adc7c2
......@@ -14,18 +14,10 @@
<e:Group id="duibaGroup" horizontalCenter="0" top="360" visible="false">
<e:Label text="啊哦,奖励擦肩而过…" y="0" textColor="0xf54500" fontFamily="FZY3JW" size="40" horizontalCenter="0"/>
</e:Group>
<e:Group id="shopGroup" horizontalCenter="0" top="360">
<e:Label text="继续逛逛店铺,还可以获得更多奖励哦~" y="20" fontFamily="FZY3JW" size="28" horizontalCenter="0" x="10" textColor="0xfb6300"/>
<e:Group id="suningGroup" horizontalCenter="0" top="360">
<e:Label id="suningLabel" text="继续完成任务,还可以获得更多奖励哦~" y="20" fontFamily="FZY3JW" size="28" horizontalCenter="0" x="10" textColor="0xfb6300"/>
<e:Label text="换个姿势,再来一次!" y="-40" textColor="0xF54500" fontFamily="FZY3JW" size="46" horizontalCenter="0" x="-30" scaleX="1" scaleY="1"/>
</e:Group>
<e:Group id="watchGroup" horizontalCenter="0" top="360" visible="false">
<e:Label text="换个姿势,再来一次!" y="-40" textColor="0xF54500" fontFamily="FZY3JW" size="46" horizontalCenter="0"/>
<e:Label text="继续浏览商品,还可以获得更多奖励哦~" y="20" fontFamily="FZY3JW" size="28" horizontalCenter="0" x="10" textColor="0xfb6300"/>
</e:Group>
<e:Group id="buyGroup" horizontalCenter="0" top="360" visible="false">
<e:Label text="换个姿势,再来一次!" y="-40" textColor="0xF54500" fontFamily="FZY3JW" size="46" horizontalCenter="0"/>
<e:Label text="继续下单还可以获得更多奖励哦~" y="20" fontFamily="FZY3JW" size="28" horizontalCenter="0" x="10" textColor="0xfb6300"/>
</e:Group>
<e:Group id="btn" x="196" y="875" width="358" height="113">
<e:Button label="" y="0" x="0">
<e:skinName>
......
......@@ -117,9 +117,13 @@ export default class MapScene extends Scene {
function hbRainBaseInfo() {
return new Promise((resolve, reject) => NetManager.ins.hbRainBaseInfo(() => resolve()));
}
function getTaskInfo() {
return new Promise((resolve, reject) => NetManager.ins.getTaskInfo(() => resolve()));
}
return Promise.all([
hbRainBaseInfo(),
getTaskInfo(),
]);
}
......@@ -198,6 +202,15 @@ export default class MapScene extends Scene {
}
}
// 任务中心可领奖强提示
const taskInfoRes = DataManager.ins.getData(NetName.GET_TASKINFO);
if(taskInfoRes && taskInfoRes.data && taskInfoRes.data.length > 0){
for(let i = 0; i < taskInfoRes.data.length; i++){
if(taskInfoRes.data[i].count > 0){
panels.push('task');
}
}
}
if(!readCache() && getHomeData().levels.length <= 0) { //引导
const guide = new GuideCon(() => {
......@@ -803,7 +816,6 @@ export default class MapScene extends Scene {
});
}
// 倒计时
private inviteCutTimer() {
const timer = this.convertTime(this.cutTime -= 1000);
......@@ -828,7 +840,6 @@ export default class MapScene extends Scene {
sec: Utils.prefixInteger(sec, 2)
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////
onTap_friendBtn() {
......
......@@ -2,6 +2,8 @@ import IconBase from "./IconBase";
import PanelCtrl from "../../../libs/new_wx/ctrls/panelCtrl";
import { NetManager } from "../../../libs/tw/manager/NetManager";
import { GDispatcher } from "../../../libs/tc/util/GDispatcher";
import { getLadderGap } from "../../playScene/utils";
import { getlogItem } from "../../Main";
export default class TaskCenterIcon extends IconBase {
constructor(name: string, group: eui.Group, btn: eui.Button, tipsBg?: eui.Image, tipsLabel?: eui.Label) {
......@@ -12,12 +14,16 @@ export default class TaskCenterIcon extends IconBase {
super.start();
NetManager.ins.getTaskInfo((success, res) => {
if(!success) {
this.visible = false;
return;
}
const data = res.data;
if(!data || data.length <= 0){
this.visible = false;
GDispatcher.dispatchEvent('updateTurnTablePosition');
}else {
this.visible = true;
NetManager.ins.showLog(getlogItem(62));
}
});
}
......@@ -28,6 +34,7 @@ export default class TaskCenterIcon extends IconBase {
*/
protected onTouchBtn(e: egret.TouchEvent) {
super.onTouchBtn(e);
NetManager.ins.clickLog(getlogItem(62));
PanelCtrl.instance.show('task');
}
......
......@@ -3,6 +3,7 @@ import getSkinPath from "../../../libs/new_wx/utils/getSkinPath";
import { NetManager } from "../../../libs/tw/manager/NetManager";
import PanelCtrl from "../../../libs/new_wx/ctrls/panelCtrl";
import { GDispatcher } from "../../../libs/tc/util/GDispatcher";
import { getlogItem } from "../../Main";
export default class TaskCenter extends Panel {
public closeBtn:eui.Button;
......@@ -99,21 +100,23 @@ class TaskCenterItem extends eui.ItemRenderer {
// 领奖
NetManager.ins.taskAward((success, res) => {
if(!success) {
PanelCtrl.instance.show('taskCenterNoPrize', res);
PanelCtrl.instance.show('taskCenterNoPrize', {prizeData:res, taskData:this.data});
return;
}
if(!res.data.option || res.data.option.categoryType == 1) { // 无奖励
PanelCtrl.instance.show('taskCenterNoPrize', res);
PanelCtrl.instance.show('taskCenterNoPrize', {prizeData:res, taskData:this.data});
return;
}
PanelCtrl.instance.show('taskCenterPrize', res.data);
PanelCtrl.instance.show('taskCenterPrize', {prizeData:res, taskData:this.data});
}, this.data.subActivityId);
}, this);
} else if(done < limit) { // 未完成
NetManager.ins.showLog(getlogItem(63));
this.btnImg.source = 'TaskCenter_' + 'goTask' + 'Btn_png';
this.btnLabel.text = `${appIncompleteText}(${done}/${limit})`;
this.btnLabel.strokeColor = 0x1376df;
this.btnGroup.addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
NetManager.ins.clickLog(getlogItem(63));
// 跳转任务链接
window.open(this.data.appIncompletelink);
}, this);
......
import Panel from "../../../libs/new_wx/components/Panel";
import { addAdComp } from "../BoxPanel";
import PanelCtrl from "../../../libs/new_wx/ctrls/panelCtrl";
import { NetManager } from "../../../libs/tw/manager/NetManager";
import { getlogItem } from "../../Main";
import getHomeData from "../../getHomeData";
import { changeMapScene } from "../../startScene/StartScene";
export default class TaskCenterNoPrize extends Panel {
public closeBtn: eui.Button;
public duibaGroup: eui.Group;
public shopGroup: eui.Group;
public watchGroup: eui.Group;
public buyGroup: eui.Group;
public suningGroup: eui.Group;
public suningLabel: eui.Label;
public btn: eui.Group;
public btnLabel: eui.Label;
// duibaGroup 去闯关
// shopGroup 继续逛店铺
// watchGroup 继续浏览商品
......@@ -20,24 +22,47 @@ export default class TaskCenterNoPrize extends Panel {
start(data) {
super.start();
console.log(data);
// console.log(data);
switch(data.code) {
case 600063: // 当前活动未配置任务奖励
case 600068: // 未中奖 有可能是奖品概率小于100%
case 600067: // 当前任务未配置奖励
case 600066: // 当前任务不能领取奖励 领奖时,传参任务id对应的任务没有剩余领奖次数
break;
const prizeData = data.prizeData;
const taskData = data.taskData;
// 修改按钮文案
// 修改按钮监听
// 修改提示文案
this.btnLabel.text = (taskData.limit == taskData.done) ? "继续闯关" : (taskData.tips || '继续完成');
this.btnLabel.addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
if(taskData.limit == taskData.done) {
// 去闯关
if((getHomeData().levels.length + 1) > window['last_level']) {
changeMapScene();
super.hidePanel();
return;
}
PanelCtrl.instance.show("StartPanel", getHomeData().levels.length + 1);
} else {
window.open(taskData.data.appIncompletelink);
}
}, this);
switch(true) {
case (prizeData.code == 600063 // 当前活动未配置任务奖励
|| prizeData.code == 600068 // 未中奖 有可能是奖品概率小于100%
|| prizeData.code == 600067 // 当前任务未配置奖励
|| prizeData.code == 600066):// 当前任务不能领取奖励 领奖时,传参任务id对应的任务没有剩余领奖次数
this.duibaGroup.visible = true;
break;
case 600064: // 开发者无响应
case 600065: // 开发者响应内容异常
case 600070: // 开发者请求异常
case 600071: // 开发者响应业务处理失败 接口响应status非success或者ok
case 600069: // 苏宁风控
case (prizeData.code == 600064 // 开发者无响应
|| prizeData.code == 600065 // 开发者响应内容异常
|| prizeData.code == 600070 // 开发者请求异常
|| prizeData.code == 600071 // 开发者响应业务处理失败 接口响应status非success或者ok
|| prizeData.code == 600069): // 苏宁风控
this.suningGroup.visible = true;
break;
default:
this.duibaGroup.visible = true;
break;
}
......
import Panel from "../../../libs/new_wx/components/Panel";
import { addAdComp } from "../BoxPanel";
import PanelCtrl from "../../../libs/new_wx/ctrls/panelCtrl";
import { NetManager } from "../../../libs/tw/manager/NetManager";
import { getlogItem } from "../../Main";
import getHomeData from "../../getHomeData";
import { changeMapScene } from "../../startScene/StartScene";
import { GDispatcher } from "../../../libs/tc/util/GDispatcher";
export default class TaskCenterPrize extends Panel {
public closeBtn: eui.Button;
......@@ -18,7 +23,29 @@ export default class TaskCenterPrize extends Panel {
start(data) {
super.start();
this.updateOption(data.option);
// console.log(data);
this.updateOption(data.prizeData.data.option);
const taskData = data.taskData;
this.btnLabel.text = (taskData.limit == taskData.done) ? "继续闯关" : (taskData.tips || '继续完成');
if(taskData.limit == taskData.done) {
NetManager.ins.showLog(getlogItem(66));
}
this.btnLabel.addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
if(taskData.limit == taskData.done) {
NetManager.ins.clickLog(getlogItem(66));
// 去闯关
if((getHomeData().levels.length + 1) > window['last_level']) {
changeMapScene();
super.hidePanel();
return;
}
PanelCtrl.instance.show("StartPanel", getHomeData().levels.length + 1);
} else {
window.open(taskData.data.appIncompletelink);
}
}, this);
// 埋点
addAdComp(84, 830, this);
}
......
......@@ -15,6 +15,7 @@
"remark": "正在完成的任务Remark",
"status": 0,
"subActivityId": "666",
"tips": "去逛逛",
"browseSecond": "倒计时秒数,浏览页面倒计时的时长,兑吧无需关注。",
"completeLink": "倒计时图标(已完成),任务完成时展示的图标,兑吧无需关注。",
......@@ -45,6 +46,7 @@
"remark": "可以领奖的任务Remark",
"status": 0,
"subActivityId": "777",
"tips": "去看看",
"browseSecond": "倒计时秒数,浏览页面倒计时的时长,兑吧无需关注。",
"completeLink": "倒计时图标(已完成),任务完成时展示的图标,兑吧无需关注。",
......@@ -75,6 +77,7 @@
"remark": "已完成的任务Remark",
"status": 0,
"subActivityId": "888",
"tips": "去下单",
"browseSecond": "倒计时秒数,浏览页面倒计时的时长,兑吧无需关注。",
"completeLink": "倒计时图标(已完成),任务完成时展示的图标,兑吧无需关注。",
......@@ -105,6 +108,7 @@
"remark": "已完成的任务Remark",
"status": 0,
"subActivityId": "888",
"tips": "去逛",
"browseSecond": "倒计时秒数,浏览页面倒计时的时长,兑吧无需关注。",
"completeLink": "倒计时图标(已完成),任务完成时展示的图标,兑吧无需关注。",
......@@ -135,6 +139,7 @@
"remark": "已完成的任务Remark",
"status": 0,
"subActivityId": "888",
"tips": "去下逛",
"browseSecond": "倒计时秒数,浏览页面倒计时的时长,兑吧无需关注。",
"completeLink": "倒计时图标(已完成),任务完成时展示的图标,兑吧无需关注。",
......
{
"success": true,
"code": "0000000000",
"success": false,
"code": "600064",
"desc": "OK",
"timestamp": 1572958024679,
"data": {
......
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