Commit 8a436555 authored by 张华挺's avatar 张华挺

预存

parent a50b350b
......@@ -386,6 +386,14 @@ export default class MainBase extends eui.UILayer {
});
}
hc_userConfig() {
return new Promise((r) => {
NetManager.ins.getUserConfig(() => {
r()
});
});
}
hc_userInfo() {
return new Promise((r) => {
NetManager.ins.hc_userInfo(() => {
......@@ -400,6 +408,7 @@ export default class MainBase extends eui.UILayer {
// this.getAd(),//广告,去掉
this.ajaxElement(),
this.hcHome(),
this.hc_userConfig()
// this.hcRedBoobBaseInfo(),
]);
......
......@@ -56,6 +56,24 @@ export class NetManager extends ABNetManager {
this.isInit = true;
}
/**
* tuia消消乐
* 获取用户信息,用于分流测试
*/
public getUserConfig(callback: Function): void {
const net: INetData = {
name: "getConfig",
uri: '/customActivity/tuia/happyclear/getConfig',
type: 'POST',
dataType: 'json',
param: {
deviceId: getUrl('deviceId')
},
callback: callback
};
this.send(net);
}
/**
* tuia消消乐
* 获取地图页Icon信息(Icon类型&当日领奖次数)
......@@ -96,6 +114,7 @@ export class NetManager extends ABNetManager {
}
public getTuiaAd(rewardFn, closeFn) {
if (!window["TAIsdk"].closeBtn) {
window["TAIsdk"].init({
appKey: window["appKeyTuia"] || '2ZjLbhEBCFAzBbihEtxLEq25mXKw',//固定,到时修改
slotId: window["slotIdTuia"] || '324689', //到时修改
......@@ -108,6 +127,7 @@ export class NetManager extends ABNetManager {
// newWebviewFn: newWebview,
// imageCallback: imageCallback
})
}
window["TAIsdk"].show()
}
......
......@@ -114,7 +114,7 @@
},
{
"name": "preload",
"keys": "chongxinchuangguan1_png,chongxinchuangguan2_png,chongxinchuangguan3_png"
"keys": "chongxinchuangguan1_png,chongxinchuangguan2_png,chongxinchuangguan3_png,newVideoIcon2_json,newVideoIcon2_png"
}
],
"resources": [
......@@ -2633,6 +2633,16 @@
"type": "image",
"name": "mapredbagicom_png"
},
{
"name": "newVideoIcon_move",
"type": "json",
"url": "assets/mc/newVideoIcon.json"
},
{
"name": "newVideoIcon_png",
"type": "image",
"url": "assets/mc/newVideoIcon.png"
},
{
"url": "assets/mc/effect1.json",
"type": "sheet",
......@@ -2949,6 +2959,26 @@
"name": "chongxinchuangguan3_png",
"type": "image",
"url": "assets/faild/chongxinchuangguan3.png"
},
{
"name": "newVideoIcon_json",
"type": "json",
"url": "assets/map/newVideoIcon.json"
},
{
"name": "newVideoIcon_png",
"type": "image",
"url": "assets/map/newVideoIcon.png"
},
{
"name": "newVideoIcon2_json",
"type": "json",
"url": "assets/mc/newVideoIcon.json"
},
{
"name": "newVideoIcon2_png",
"type": "image",
"url": "assets/mc/newVideoIcon.png"
}
]
}
\ No newline at end of file
......@@ -59,7 +59,7 @@
</e:Skin>
</e:skinName>
</e:Button>
<e:Group id="wuhanGroup" y="325" right="30">
<e:Group id="wuhanGroup" y="325" right="30" visible="false">
<e:Button label="" y="0">
<e:skinName>
<e:Skin states="up,down,disabled">
......@@ -72,7 +72,7 @@
<e:Image id="wuhanTips" y="0" touchEnabled="false" source="dailingqu_png"/>
</e:Group>
</e:Group>
<e:Group id="tuiaGroup" y="325" right="30">
<e:Group id="tuiaGroup" y="325" right="30" visible="false">
<e:Button label="" y="0">
<e:skinName>
<e:Skin states="up,down,disabled">
......@@ -85,6 +85,16 @@
<e:Image id="tuiaTips" y="0" touchEnabled="false" source="dailingqu_png"/>
</e:Group>
</e:Group>
<e:Group id="newTuiaGroup" y="325" right="30" visible="true">
<e:Button label="" y="0">
<e:skinName>
<e:Skin states="up,down,disabled">
<!-- <e:Image width="100%" height="100%" source="newVideoIcon_gif" source.down="newVideoIcon_gif" source.disabled="newVideoIcon_gif"/> -->
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
</e:Group>
<e:Group id="friendBtn" x="-0.12" y="22.31" width="171" height="120">
<e:Image source="avatar_png" y="0" horizontalCenter="0"/>
......
......@@ -30,7 +30,7 @@
</e:Skin>
</e:skinName>
</e:Button>
<e:Button id="video2btn" label="" y="706" horizontalCenter="-137.5">
<e:Button id="video2btn" label="" y="698.67" horizontalCenter="-166.5">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="mianfei_png" source.down="mianfei_png" source.disabled="mianfei_png"/>
......@@ -38,7 +38,7 @@
</e:Skin>
</e:skinName>
</e:Button>
<e:Button id="video1btn" label="" y="706" horizontalCenter="5.5">
<e:Button id="video1btn" label="" y="698.67" horizontalCenter="10.5">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="mianfei_png" source.down="mianfei_png" source.disabled="mianfei_png"/>
......@@ -46,7 +46,7 @@
</e:Skin>
</e:skinName>
</e:Button>
<e:Button id="video3btn" label="" y="706" horizontalCenter="148.5">
<e:Button id="video3btn" label="" y="698.67" horizontalCenter="182.5">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="mianfei_png" source.down="mianfei_png" source.disabled="mianfei_png"/>
......@@ -54,7 +54,7 @@
</e:Skin>
</e:skinName>
</e:Button>
<e:Button id="buy2btn" label="" y="663" x="252">
<e:Button id="buy2btn" label="" y="648.33" x="237.5">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="startpanel数量 副本 3_png" source.down="startpanel数量 副本 3_png" source.disabled="startpanel数量 副本 3_png"/>
......@@ -62,7 +62,7 @@
</e:Skin>
</e:skinName>
</e:Button>
<e:Button id="buy1btn" label="" y="663" x="397">
<e:Button id="buy1btn" label="" y="648.33" x="412.67">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="startpanel数量 副本 3_png" source.down="startpanel数量 副本 3_png" source.disabled="startpanel数量 副本 3_png"/>
......@@ -70,7 +70,7 @@
</e:Skin>
</e:skinName>
</e:Button>
<e:Button id="buy3btn" label="" y="663" x="540">
<e:Button id="buy3btn" label="" y="648.33" x="582">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="startpanel数量 副本 3_png" source.down="startpanel数量 副本 3_png" source.disabled="startpanel数量 副本 3_png"/>
......@@ -81,9 +81,9 @@
<e:Label id="price2" text="-300元宝" size="22" bold="true" y="715.33" textAlign="center" verticalAlign="middle" fontFamily="FZY3JW" horizontalCenter="-136.5" textColor="0xc87230" visible="false"/>
<e:Label id="price3" text="-3元宝" size="22" bold="true" y="715.33" textAlign="center" verticalAlign="middle" fontFamily="FZY3JW" horizontalCenter="5.5" textColor="0xc87230" visible="false"/>
<e:Label id="price4" text="-30元宝" size="22" bold="true" y="717.33" textAlign="center" verticalAlign="middle" fontFamily="FZY3JW" horizontalCenter="148.5" textColor="0xc87230" visible="false"/>
<e:Label id="nums2Txt" text="888" size="26" bold="true" y="596.04" textAlign="center" verticalAlign="middle" textColor="0xc87230" fontFamily="FZY3JW" horizontalCenter="-101.5"/>
<e:Label id="nums1Txt" text="8" size="26" bold="true" y="596.04" textAlign="center" verticalAlign="middle" textColor="0xc87230" fontFamily="FZY3JW" horizontalCenter="40.5"/>
<e:Label id="nums3Txt" text="88" size="26" bold="true" y="596.04" textAlign="center" verticalAlign="middle" textColor="0xc87230" fontFamily="FZY3JW" horizontalCenter="180"/>
<e:Label id="nums2Txt" text="888" size="26" bold="true" y="558.5" textAlign="center" verticalAlign="middle" textColor="0xc87230" fontFamily="FZY3JW" horizontalCenter="-123.5"/>
<e:Label id="nums1Txt" text="8" size="26" bold="true" y="558.5" textAlign="center" verticalAlign="middle" textColor="0xc87230" fontFamily="FZY3JW" horizontalCenter="48.5"/>
<e:Label id="nums3Txt" text="88" size="26" bold="true" y="558.5" textAlign="center" verticalAlign="middle" textColor="0xc87230" fontFamily="FZY3JW" horizontalCenter="216"/>
<e:Button id="closeBtn" label="" x="631" y="191">
<e:skinName>
<e:Skin states="up,down,disabled">
......@@ -97,13 +97,13 @@
<e:Image source="startpanel目标3_png" x="0" verticalCenter="0"/>
<e:BitmapLabel id="targetScoreTxt" x="76" y="0" text="0" font="nums2_fnt"/>
</e:Group>
<e:Group id="targetGroup" y="356.06" width="405" horizontalCenter="0" height="169">
<e:List id="list" y="80.94" anchorOffsetX="0" anchorOffsetY="0" horizontalCenter="0" scaleX="1.3" scaleY="1.3">
<e:Group id="targetGroup" y="318.56" width="405" horizontalCenter="0.5" height="145" anchorOffsetY="0">
<e:List id="list" y="70.94" anchorOffsetX="0" anchorOffsetY="0" horizontalCenter="0" scaleX="1.3" scaleY="1.3">
<e:layout>
<e:HorizontalLayout gap="19"/>
</e:layout>
</e:List>
<e:Label id="tips" text="在指定步数内消灭目标元素" y="23" size="24" horizontalCenter="0.5" fontFamily="FZY3JW" textAlign="center" textColor="0x885037" bold="true"/>
<e:Label id="tips" text="在指定步数内消灭目标元素" y="14" size="28" horizontalCenter="1.5" fontFamily="FZY3JW" textAlign="center" textColor="0x885037" bold="true"/>
</e:Group>
</e:Skin>
\ No newline at end of file
......@@ -248,6 +248,7 @@ export default class MainScene extends Scene {
failStep: false
}
start(data: { chapter: number, boom: number, hammer: number, step: number, videoProp: number[] }) {
console.log(123)
super.start();
//第几关
this.chapter = (data && data.chapter) ? data.chapter : 1;
......@@ -318,6 +319,7 @@ export default class MainScene extends Scene {
*/
initSvgas() {
var resPath = getResPath();
console.log(resPath)
if (!svgaParser) svgaParser = new window["SVGA"].Parser();
var svgas = ["amazing", "great", "wonderful", "bonusTime"];
//如果有节日的加
......@@ -347,6 +349,7 @@ export default class MainScene extends Scene {
}
//初始化界面ui,,道具弄在这里s
initUi() {
console.log(1234123)
//第几关
var chapterTxt = new ChapterNum();
chapterTxt.num = this.chapter >> 0;
......@@ -359,7 +362,8 @@ export default class MainScene extends Scene {
this.stepNumber.y = 85;
this.addChild(this.stepNumber);
//步数初始化
this.steps = this.chapterData.stepCount;
// 调整难度,所有步数减少5步
this.steps = this.chapter >> 0 >= 10 && this.chapterData.stepCount > 5 ? this.chapterData.stepCount - 5 : this.chapterData.stepCount;
//当前分数
var curScoreNum = new CurScoreNum();
curScoreNum.x = 322;
......
......@@ -54,28 +54,24 @@ export default class MapScene extends Scene {
//新增icon,还有埋点
this["wuhanGroup"].visible = false;
this["tuiaGroup"].visible = false;
NetManager.ins.getIconInfo((s, res) => {
//成功才显示,且有剩余次数remainAwardTimes
if (s && res.data && res.data.remainAwardTimes) {
//领奖类型:0:武汉 1:推啊
//武汉
if (res.data.type == 0) {
this["newTuiaGroup"].visible = false;
let configData = DataManager.ins.getData('getConfig')
configData = configData.data.filter(item => item.id === 1)
if (configData.length) {
const index = configData[0].index
switch (index) {
case 2:
this["wuhanGroup"].visible = true;
NetManager.ins.showLog(getlogItem(14))
this["wuhanGroup"].addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
NetManager.ins.clickLog(getlogItem(14))
handleVideo(
(s) => {
handleVideo(s => {
if (s) {
Loading.instace.show();
NetManager.ins.getIconAward((succ, ress) => {
NetManager.ins.getIconAward(succ => {
Loading.instace.hide();
if (succ) {
PanelCtrl.instance.show("DailyIconPrizePanel");
//如果次数没了就隐藏icon
if (!ress.data.remainAwardTimes) {
this["wuhanGroup"].visible = false;
}
} else {
showToast("领取失败");
}
......@@ -83,52 +79,23 @@ export default class MapScene extends Scene {
} else {
showToast("广告未成功观看,无法领取奖励");
}
},
() => { NetManager.ins.getIconAward(() => { }) },
window["slotidIcon"],
1
)
}, this)
}
//推啊
else if (res.data.type == 1) {
this["tuiaGroup"].visible = true;
NetManager.ins.showLog(getlogItem(13))
this["tuiaGroup"].addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
NetManager.ins.clickLog(getlogItem(13))
this['tuiaRewardMark'] = false;
NetManager.ins.getTuiaAd(
() => {
Loading.instace.show();
NetManager.ins.getIconAward((succ, ress) => {
Loading.instace.hide();
if (succ) {
PanelCtrl.instance.show("DailyIconPrizePanel");
//如果次数没了就隐藏icon
if (!ress.data.remainAwardTimes) {
this["tuiaGroup"].visible = false;
}
} else {
showToast("领取失败");
}
})
this['tuiaRewardMark'] = true;
//关闭弹框
// window['TAIsdk'].iframeNode.remove()
// setTimeout(function () {
// window['TAIsdk'].iframeNode.src = ''
// })
// window['TAIsdk'].closeBtn.style.display = 'none'
},
() => {
//上面没回调过。就显示toast
if (!this['tuiaRewardMark']) showToast("活动未完成,无法领取奖励");
}
)
}, () => {
NetManager.ins.getIconAward(() => { })
}, window["slotidIcon"], 1)
}, this)
break;
case 1:
this.bindTuiaActivity(this["tuiaGroup"]);
break;
case 0:
// var data = RES.getRes("newVideoIcon_move");
// var txtr = RES.getRes("newVideoIcon_png");
// var mcFactory:egret.MovieClipDataFactory = new egret.MovieClipDataFactory( data, txtr );
// console.log(mcFactory)
this.bindTuiaActivity(this["newTuiaGroup"]);
break;
}
}
})
// PanelCtrl.instance.show('RedBombAlert');
// NetManager.ins.hc_submit(()=>{
......@@ -313,6 +280,40 @@ export default class MapScene extends Scene {
this.scroll.addEventListener(egret.Event.ENTER_FRAME, this.onEnterFrame, this);
}
bindTuiaActivity(btn) {
btn.visible = true;
NetManager.ins.showLog(getlogItem(13))
btn.addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
NetManager.ins.clickLog(getlogItem(13))
this['tuiaRewardMark'] = false;
NetManager.ins.getTuiaAd(() => {
Loading.instace.show();
NetManager.ins.getIconAward((succ, ress) => {
Loading.instace.hide();
if (succ) {
PanelCtrl.instance.show("DailyIconPrizePanel");
//如果次数没了就隐藏icon
if (!ress.data.remainAwardTimes) {
btn.visible = false;
}
} else {
showToast("领取失败");
}
})
this['tuiaRewardMark'] = true;
//关闭弹框
// window['TAIsdk'].iframeNode.remove()
// setTimeout(function () {
// window['TAIsdk'].iframeNode.src = ''
// })
// window['TAIsdk'].closeBtn.style.display = 'none'
}, () => {
//上面没回调过。就显示toast
if (!this['tuiaRewardMark']) showToast("活动未完成,无法领取奖励");
})
}, this)
}
onAllPanelHide = () => {
/* 红包雨引导,去掉
......
......@@ -20,6 +20,10 @@ const config = {
'/customActivity/tuia/happyclear/getAds': {
data: './tuia/getAds.json'
},
//获取用户信息分流测试
'/customActivity/tuia/happyclear/getConfig': {
data: './tuia/getConfig.json'
},
'/crecord/getrecord': {
......
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