Commit f2ac242d authored by 邱旭's avatar 邱旭

1

parent 57aa4a66
......@@ -2,41 +2,44 @@ import { ModuleTypes } from "../types/sceneTypes";
import Panel from "../components/Panel";
import Loading from "../components/Loading";
import wait from "../../new_tc/wait";
export default class PanelCtrl {
addToShowPanels(panelName: string) {
this._panels.unshift(panelName);
}
_params:any[]
private _panels:any[]
_callback:any;
showPanels(panels: any[],params:any[],callback:Function) {
this._panels=panels;
this._params=params;
this._callback=callback;
if(panels.length<=0) {
_params: any[]
private _panels: any[]
_callback: any;
showPanels(panels: any[], params: any[], callback: Function) {
this._panels = panels;
this._params = params;
this._callback = callback;
if(panels.length <= 0) {
this._callback();
this._callback=null;
this._callback = null;
}
if(this._panels.length <=0 ) return;
if(this._panels.length <= 0) return;
const panel = this._panels.shift();
const param = this._params.shift();
PanelCtrl.instance.show(panel,param);
PanelCtrl.instance.show(panel, param);
}
checkPanels(){
if(this._panels && this._panels.length <=0 ) {
this._panels=null;
if(this._callback)this._callback();
checkPanels() {
if(this._panels && this._panels.length <= 0) {
this._panels = [];
if(this._callback) this._callback();
}
if(!this._panels || this._panels.length <=0 ) return;
if(!this._panels || this._panels.length <= 0) return;
wait(300);
const panel = this._panels.shift();
const param = this._params.shift();
PanelCtrl.instance.show(panel,param);
PanelCtrl.instance.show(panel, param);
}
private _parent: egret.Sprite;
_mask: egret.Sprite;
_mask: egret.Sprite;
static _instance: PanelCtrl;
static get instance() {
return PanelCtrl._instance || (PanelCtrl._instance = new PanelCtrl())
......@@ -46,13 +49,14 @@ export default class PanelCtrl {
this._parent = parent;
}
private noLoadingList = ['StartPanel','failed','prize2', ModuleTypes.PRIZE_PANEL,ModuleTypes.NO_PRIZE_PANEL];
private noLoadingList = ['StartPanel', 'failed', 'prize2', ModuleTypes.PRIZE_PANEL, ModuleTypes.NO_PRIZE_PANEL];
show(type: any, data?) {
this.closeCurrent(true);
const cls = this._panelClassMap[type];
const panel: Panel = new cls(data);
this.addMask();
if (!window['development']) {
if(!window['development']) {
if(this.noLoadingList.indexOf(type) == -1)
Loading.instace.show();
const key = panel.skinKey.toLowerCase();
......@@ -78,7 +82,7 @@ export default class PanelCtrl {
}
addMask() {
if (!this._mask) {
if(!this._mask) {
this._mask = new egret.Sprite();
this._mask.touchEnabled = true;
this._mask.graphics.beginFill(0, .7);
......@@ -90,11 +94,11 @@ export default class PanelCtrl {
}
removeMask(rightNow = false) {
if (this._mask) {
if (rightNow) {
if(this._mask) {
if(rightNow) {
this._parent.removeChild(this._mask);
} else
egret.Tween.get(this._mask).to({ alpha: 0 }, 300, egret.Ease.quartIn).call(
egret.Tween.get(this._mask).to({alpha: 0}, 300, egret.Ease.quartIn).call(
() => this._parent.removeChild(this._mask), this);
}
}
......@@ -105,13 +109,13 @@ export default class PanelCtrl {
}
private remove(panel: Panel, rightNow = true) {
if (rightNow) {
if(rightNow) {
this._parent.removeChild(panel);
this.removeMask(rightNow);
return;
}
const tw = egret.Tween.get(panel);
tw.to({ y: panel.stage.stageHeight }, 300, egret.Ease.quartIn)
tw.to({y: panel.stage.stageHeight}, 300, egret.Ease.quartIn)
.call(() => {
this._parent.removeChild(panel);
this.removeMask();
......@@ -122,11 +126,12 @@ export default class PanelCtrl {
const panel = e.target as Panel;
panel.removeEventListener('onDestroy', this.onPanelHide, this);
this.remove(panel);
this._current=null;
this._current = null;
this.checkPanels();
}
private _panelClassMap: any;
registerPanel(name, config) {
this._panelClassMap = this._panelClassMap || {};
this._panelClassMap[name] = config.cls;
......@@ -136,7 +141,7 @@ export default class PanelCtrl {
_current: Panel;
closeCurrent(rightNow = false) {
if (this._current) {
if(this._current) {
this.remove(this._current, rightNow);
this._current = null;
}
......
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"sign","version":5,"files":["../assets/sign/signitem.png","../assets/sign/signicon6.png","../assets/sign/signicon5.png","../assets/sign/signicon4.png","../assets/sign/signicon3.png","../assets/sign/signicon2.png","../assets/sign/signicon_blood.png","../assets/sign/signbtn4.png","../assets/sign/signbtn3.png","../assets/sign/signbtn2.png","../assets/sign/signbtn1.png","../assets/sign/signbg.png","../assets/sign/sign_quan88.png","../assets/sign/sign_quan8.png","../assets/sign/sign_quan58.png","../assets/sign/sign_quan38.png","../assets/sign/sign_quan28.png","../assets/sign/sign_quan16.png","../assets/sign/sign_quan15.png","../assets/sign/sign_quan12.png","../assets/sign/sign_line2.png","../assets/sign/sign_line.png","../assets/sign/sign_light.png","../assets/sign/sign_icon1.png","../assets/sign/sign_quan10.png","../assets/sign/sign_quan23.png","../assets/sign/sign_quan36.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"sign","version":5,"files":["../assets/sign/signitem.png","../assets/sign/signicon6.png","../assets/sign/signicon5.png","../assets/sign/signicon4.png","../assets/sign/signicon3.png","../assets/sign/signicon2.png","../assets/sign/signicon_blood.png","../assets/sign/signbtn4.png","../assets/sign/signbtn3.png","../assets/sign/signbtn2.png","../assets/sign/signbtn1.png","../assets/sign/signbg.png","../assets/sign/sign_quan88.png","../assets/sign/sign_quan8.png","../assets/sign/sign_quan58.png","../assets/sign/sign_quan38.png","../assets/sign/sign_quan28.png","../assets/sign/sign_quan16.png","../assets/sign/sign_quan15.png","../assets/sign/sign_quan12.png","../assets/sign/sign_line2.png","../assets/sign/sign_line.png","../assets/sign/sign_light.png","../assets/sign/sign_icon1.png","../assets/sign/sign_quan10.png","../assets/sign/sign_quan23.png","../assets/sign/sign_quan36.png","../assets/sign/sign_quan25.png","../assets/sign/sign_quan35.png"]}
\ No newline at end of file
......@@ -73,7 +73,7 @@
"name": "exchange"
},
{
"keys": "signitem_png,signicon6_png,signicon5_png,signicon4_png,signicon3_png,signicon2_png,signicon_blood_png,signbtn4_png,signbtn3_png,signbtn2_png,signbtn1_png,signbg_png,sign_quan88_png,sign_quan8_png,sign_quan58_png,sign_quan38_png,sign_quan28_png,sign_quan16_png,sign_quan15_png,sign_quan12_png,sign_line2_png,sign_line_png,sign_light_png,sign_icon1_png,sign_quan10_png,sign_quan23_png,sign_quan36_png",
"keys": "signitem_png,signicon6_png,signicon5_png,signicon4_png,signicon3_png,signicon2_png,signicon_blood_png,signbtn4_png,signbtn3_png,signbtn2_png,signbtn1_png,signbg_png,sign_quan88_png,sign_quan8_png,sign_quan58_png,sign_quan38_png,sign_quan28_png,sign_quan16_png,sign_quan15_png,sign_quan12_png,sign_line2_png,sign_line_png,sign_light_png,sign_icon1_png,sign_quan10_png,sign_quan23_png,sign_quan36_png,sign_quan25_png,sign_quan35_png",
"name": "sign"
},
{
......@@ -3675,6 +3675,16 @@
"url": "assets/TaskCenterPanel/TaskCenter_btn.png",
"type": "image",
"name": "TaskCenter_btn_png"
},
{
"url": "assets/sign/sign_quan25.png",
"type": "image",
"name": "sign_quan25_png"
},
{
"url": "assets/sign/sign_quan35.png",
"type": "image",
"name": "sign_quan35_png"
}
]
}
\ No newline at end of file
......@@ -24,6 +24,8 @@
<e:Image id="quan28" x="95" y="56" source="sign_quan28_png" visible="false"/>
<e:Image id="quan8" x="95" y="56" source="sign_quan8_png" visible="false"/>
<e:Image id="quan88" x="95" y="56" source="sign_quan88_png" visible="false"/>
<e:Image id="quan35" x="95" y="56" source="sign_quan35_png" visible="false"/>
<e:Image id="quan25" x="95" y="56" source="sign_quan25_png" visible="false"/>
<e:Button id="btn1" label="" x="364" y="65">
<e:skinName>
<e:Skin states="up,down,disabled">
......
......@@ -2,8 +2,8 @@
<e:Skin class="SignPrizeSkin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<w:Config id="16d5c2563cb"/>
<e:Component y="867.5" skinName="ADSmallSkin" x="84" visible="false"/>
<e:Image y="101.5" horizontalCenter="-0.5" source="TaskCenterNoPrizebg_png"/>
<e:Button id="closeBtn" label="" x="613.5" y="125.5">
<e:Image y="101.5" source="TaskCenterNoPrizebg_png" horizontalCenter="0"/>
<e:Button id="closeBtn" label="" x="631" y="136">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="closeCommonBtn_png" source.down="closeCommonBtn_png" source.disabled="closeCommonBtn_png"/>
......@@ -18,7 +18,7 @@
<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="btn" x="194.5" y="728.5" width="358" height="113">
<e:Group id="btn" y="728.5" width="358" height="113" horizontalCenter="0">
<e:Button label="" y="0" x="0">
<e:skinName>
<e:Skin states="up,down,disabled">
......
......@@ -74,7 +74,9 @@ class TaskCenterItem extends eui.ItemRenderer {
dataChanged() {
// console.log(this.data);
this.taskImg.source = this.data.icon;
if(this.data.icon) {
this.taskImg.source = (((this.data.icon[0] + this.data.icon[1]) == '//') ? 'http:' : '') + this.data.icon;
}
this.title.text = this.data.taskTitle;
this.remark.text = this.data.remark;
this.setBtn(); // 设置按钮
......@@ -100,7 +102,14 @@ class TaskCenterItem extends eui.ItemRenderer {
// 领奖
this.btnGroup.touchEnabled = false;
this.btnGroup.touchChildren = false;
try {
if(window['getRST']) window['getRST']();
} catch(error) {
console.warn(error)
}
NetManager.ins.taskAward((success, res) => {
this.btnGroup.touchEnabled = true;
this.btnGroup.touchChildren = true;
if(!success) {
PanelCtrl.instance.show('taskCenterNoPrize', {prizeData: res, taskData: this.data});
return;
......@@ -120,7 +129,7 @@ class TaskCenterItem extends eui.ItemRenderer {
this.btnGroup.addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
NetManager.ins.clickLog(getlogItem(63));
// 跳转任务链接
window.open(this.data.appIncompletelink);
window.location.href = this.data.appIncompletelink;
}, this);
} else { // 已完成
this.btnImg.source = 'TaskCenter_' + 'done' + 'Btn_png';
......
......@@ -5,7 +5,7 @@ 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";
import SceneCtrl from "../../../libs/new_wx/ctrls/sceneCtrl";
export default class TaskCenterPrize extends Panel {
public closeBtn: eui.Button;
......@@ -22,6 +22,9 @@ export default class TaskCenterPrize extends Panel {
start(data) {
super.start();
NetManager.ins.hc_home(() => {
SceneCtrl.instance.updateScene();
}, window['collectRuleId']);
// console.log(data);
......
......@@ -2,19 +2,19 @@
"success": true,
"code": "0000000000",
"desc": "OK",
"timestamp": 1575292008257,
"timestamp": 1575374211419,
"data": [
{
"subActivityId": "1",
"subActivityId": "SUB446971598063218688",
"subActivityName": "狮狮连萌下单",
"status": "0",
"taskStatus": "0",
"remark": "下单任务",
"taskTitle": "狮狮连萌下单任务",
"taskViceTitle": "狮狮连萌下单任务",
"icon": "http://uimgpre.cnsuning.com/uimg//scdc/exchange/152420922403871250.png",
"limit": "5",
"done": "3",
"icon": "//uimgpre.cnsuning.com/uimg/scdc/exchange/152420922403871250.png",
"limit": "1",
"done": "0",
"appIncompleteText": "去看看",
"appCompleteText": "已完成",
"appIncompletelink": "http://cprexg.m.cnsuning.com/snWhale.html#/fight",
......@@ -29,25 +29,25 @@
"incompleteLink": null,
"completeLink": null,
"terminalType": "9",
"taskName": "狮狮连萌逛店铺",
"taskId": "RW448429803289649152",
"count": "2",
"taskName": null,
"taskId": null,
"count": null,
"tips": "你好"
},
{
"subActivityId": "2",
"subActivityId": "SUB446970931785445376",
"subActivityName": "狮狮连萌逛店铺",
"status": "0",
"status": "1",
"taskStatus": "99",
"remark": "逛店铺呀",
"taskTitle": "狮狮连萌逛店铺",
"taskViceTitle": "200金币",
"icon": "http://uimgxgpre.cnsuning.com/uimg//scdc/exchange/157086878298813552.png",
"icon": "//uimgxgpre.cnsuning.com/uimg//scdc/exchange/157086878298813552.png",
"limit": "3",
"done": "0",
"done": "3",
"appIncompleteText": "去看看",
"appCompleteText": "已完成",
"appIncompletelink": "http://shopxgmpre.cnsuning.com/0070060496.html?scene=activityJr&activityCode=SL446689024459878400&taskCode=SUB446970931785445376&detailCode=0070060496&sourceFrom=ebuySngame",
"appIncompletelink": "",
"appCompletelink": "//m.suning.com",
"pcIncompleteText": null,
"pcCompleteText": "已完成",
......@@ -59,20 +59,20 @@
"incompleteLink": "//uimgxgpre.cnsuning.com/uimg//scdc/exchange/157438697439978713.png",
"completeLink": "//uimgxgpre.cnsuning.com/uimg//scdc/exchange/157438697442128421.png",
"terminalType": "9",
"taskName": "狮狮连萌浏览商品",
"taskId": "RW448431261020004352",
"count": "1",
"taskName": "狮狮连萌逛店铺",
"taskId": "RW448429803289649152",
"count": "3",
"tips": "你好02"
},
{
"subActivityId": "3",
"subActivityId": "SUB446971290222411776",
"subActivityName": "狮狮连萌浏览商品",
"status": "0",
"taskStatus": "99",
"remark": "浏览商品聚合页",
"taskTitle": "狮狮连萌浏览商品",
"taskViceTitle": "200金币",
"icon": "http://uimgxgpre.cnsuning.com/uimg//scdc/exchange/157086878298813552.png",
"icon": "//uimgxgpre.cnsuning.com/uimg/scdc/exchange/157086878298813552.png",
"limit": "1",
"done": "0",
"appIncompleteText": "去看看",
......@@ -92,22 +92,22 @@
"taskName": null,
"taskId": null,
"count": null,
"tips": "你好02"
"tips": "你好04"
},
{
"subActivityId": "4",
"subActivityId": "SUB446689681678090240",
"subActivityName": "狮狮连萌逛会场",
"status": "0",
"status": "1",
"taskStatus": "99",
"remark": "狮狮连萌浏览啦",
"taskTitle": "狮狮连萌逛会场任务",
"taskViceTitle": null,
"icon": "http://uimgpre.cnsuning.com/uimg//scdc/exchange/152420922403871250.png",
"icon": null,
"limit": "8",
"done": "0",
"done": "8",
"appIncompleteText": "去看看",
"appCompleteText": null,
"appIncompletelink": "http://cuxiaoprexg.m.cnsuning.com/scms/cx521.html?activityId=SL446689024459878400&subactivityId=SUB446689681678090240&businessid=cx521",
"appIncompletelink": "",
"appCompletelink": null,
"pcIncompleteText": null,
"pcCompleteText": null,
......@@ -121,8 +121,8 @@
"terminalType": "9",
"taskName": "狮狮连萌逛会场任务",
"taskId": "RW446695731227987968",
"count": "1",
"tips": "你好04"
"count": "2",
"tips": "你好03"
}
]
}
\ No newline at end of file
{
"success": true,
"success": false,
"code": "600064",
"desc": "OK",
"timestamp": 1572958024679,
......
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