Commit d1c22a83 authored by wangzhujun's avatar wangzhujun

321654

parent d67a1217
......@@ -231,12 +231,16 @@ export default class MainBase extends eui.UILayer {
GDispatcher.dispatchEvent('startsceneLoaded');
RES.loadGroup("card");
} else if (event.groupName == 'card') {
this.trace("card");
this.trace("card组加载完成");
GDispatcher.dispatchEvent('cardLoaded');
RES.loadGroup("task");
} else if (event.groupName == 'task') {
this.trace("task组加载完成");
GDispatcher.dispatchEvent('taskLoaded');
RES.loadGroup("chouka");
} else if (event.groupName == 'chouka') {
this.trace("chouka组加载完成");
GDispatcher.dispatchEvent('choukaLoaded');
RES.removeEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onResourceLoadComplete, this);
RES.removeEventListener(RES.ResourceEvent.GROUP_LOAD_ERROR, this.onResourceLoadError, this);
RES.removeEventListener(RES.ResourceEvent.GROUP_PROGRESS, this.onResourceProgress, this);
......
......@@ -43,6 +43,10 @@
{
"keys": "composecard_png,compBtn_png,combtnbg_png,comBtn_png,thinkBtn_png,notgetcard_png,light_png,getcard_png,exchangeBtn_png,exchangebgg_png,exchangbg_png,exBG_png,closebtn_png,backbtn_png,honglight_png,hongcoin_png,hongBtn_png,hongbaoBtn_png,hongbaoBG_png,gai5_png,gai4_png,gai3_png,gai2_png,gai1_png",
"name": "task"
},
{
"keys": "choukafubg_png,choukafuBtn_png,choukalab_png,choukabg2_png,choukaBtn_png,choukabg_png",
"name": "chouka"
}
],
"resources": [
......@@ -595,6 +599,36 @@
"url": "assets/mycard/rule3.png",
"type": "image",
"name": "rule3_png"
},
{
"url": "assets/chouka/choukafubg.png",
"type": "image",
"name": "choukafubg_png"
},
{
"url": "assets/chouka/choukafuBtn.png",
"type": "image",
"name": "choukafuBtn_png"
},
{
"url": "assets/chouka/choukalab.png",
"type": "image",
"name": "choukalab_png"
},
{
"url": "assets/chouka/choukabg2.png",
"type": "image",
"name": "choukabg2_png"
},
{
"url": "assets/chouka/choukaBtn.png",
"type": "image",
"name": "choukaBtn_png"
},
{
"url": "assets/chouka/choukabg.png",
"type": "image",
"name": "choukabg_png"
}
]
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="GetCardSkin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Image id="light" width="708" height="828" source="light_png" anchorOffsetX="354" anchorOffsetY="414" x="375" y="506"/>
<e:Image id="cardbg" width="373" height="526" x="189" y="268" source="cardbglight_png"/>
<e:Image id="card" width="317" height="470" source="cardbg_png" anchorOffsetX="158.5" anchorOffsetY="235" x="375.5" y="531"/>
<e:Image id="carddesign" width="295" height="443" x="228" y="310" source="designs_png"/>
<e:Group id="insGroup" width="750" height="1206" x="0" y="0">
<e:Label id="cardname" text="恭喜你获得一张爱豆卡" size="44" fontFamily="Microsoft YaHei" x="0" y="168" width="750" textAlign="center" scaleX="1" scaleY="1"/>
<e:Label id="cardintr" text="集齐9张爱豆卡,瓜分5000万现金" y="227" size="26" fontFamily="Microsoft YaHei" x="0" width="750" textAlign="center" scaleX="1" scaleY="1"/>
<e:Button id="getcard" label="Button" skinName="ui.IconButtonSkin" icon="btnbg_png" width="520" height="90" anchorOffsetX="260" anchorOffsetY="45" y="808" scaleX="1" scaleY="1" x="375"/>
<e:Label id="gettimes" text="继续集卡x1" size="36" fontFamily="Microsoft YaHei" textColor="0x5d0303" width="520" height="90" verticalAlign="middle" textAlign="center" anchorOffsetX="260" anchorOffsetY="45" scaleX="1" scaleY="1" y="808" x="375"/>
<e:Button id="closeBtn" label="Button" skinName="ui.IconButtonSkin" icon="closebtn_png" width="67" height="67" anchorOffsetX="33.5" anchorOffsetY="33.5" y="1054" scaleX="1" scaleY="1" horizontalCenter="0"/>
<e:Group id="cardurl" width="94" height="37" y="941" anchorOffsetY="0" anchorOffsetX="0" scaleX="1" scaleY="1" x="328">
<e:Group id="getCardGroup" width="750" height="1204" x="0" y="0" visible="false">
<e:Image id="light" width="708" height="828" source="light_png" anchorOffsetX="354" anchorOffsetY="414" scaleX="1" scaleY="1" x="375" y="531"/>
<e:Image id="cardbg" width="373" height="526" source="cardbglight_png" scaleX="1" scaleY="1" y="268" x="189"/>
<e:Image id="card" width="317" height="470" source="cardbg_png" anchorOffsetX="158.5" anchorOffsetY="235" scaleX="1" scaleY="1" y="531" x="375.5"/>
<e:Image id="carddesign" width="295" height="443" x="228" y="310" source="designs_png" scaleX="1" scaleY="1"/>
<e:Group id="insGroup" width="750" height="1206" x="0" y="0" scaleX="1" scaleY="1">
<e:Label id="cardname" text="恭喜你获得一张爱豆卡" size="44" fontFamily="Microsoft YaHei" x="0" y="168" width="750" textAlign="center" scaleX="1" scaleY="1"/>
<e:Label id="cardintr" text="集齐9张爱豆卡,瓜分5000万现金" y="227" size="26" fontFamily="Microsoft YaHei" x="0" width="750" textAlign="center" scaleX="1" scaleY="1"/>
<e:Button id="getcard" label="Button" skinName="ui.IconButtonSkin" icon="btnbg_png" width="520" height="90" anchorOffsetX="260" anchorOffsetY="45" y="808" scaleX="1" scaleY="1" x="375"/>
<e:Label id="gettimes" text="继续集卡x1" size="36" fontFamily="Microsoft YaHei" textColor="0x5d0303" width="520" height="90" verticalAlign="middle" textAlign="center" anchorOffsetX="260" anchorOffsetY="45" scaleX="1" scaleY="1" y="808" x="375"/>
<e:Button id="closeBtn" label="Button" skinName="ui.IconButtonSkin" icon="closebtn_png" width="67" height="67" anchorOffsetX="33.5" anchorOffsetY="33.5" y="1054" scaleX="1" scaleY="1" x="375.5"/>
<e:Group id="cardurl" width="94" height="37" y="941" anchorOffsetY="0" anchorOffsetX="0" scaleX="1" scaleY="1" x="328">
<e:Label id="urllab" text="去兑换" x="0" y="0" scaleX="1" scaleY="1"/>
<e:Image width="90" height="2" x="0" y="32" source="line_png" scaleX="1" scaleY="1"/>
</e:Group>
</e:Group>
</e:Group>
<e:Group id="getFudaiGroup" width="750" height="1204" x="0" y="0">
<e:Image width="750" height="993" x="0" y="40" source="light_png"/>
<e:Image width="660" height="885" x="43" y="216" source="choukafubg_png"/>
<e:Button id="fuclose" label="Button" skinName="ui.IconButtonSkin" icon="closebtn_png" anchorOffsetX="33.5" anchorOffsetY="33.5" y="307.5" x="636.5" width="67" height="67"/>
<e:Image id="prizeimg" width="512" height="240" x="119" y="516"/>
<e:Label id="prizename" text="优惠券" x="0" y="763" size="24" fontFamily="Microsoft YaHei" textColor="0x3f3f3f" width="750" textAlign="center"/>
<e:Button id="getfuBtn" label="Button" skinName="ui.IconButtonSkin" icon="choukafuBtn_png" anchorOffsetX="235" anchorOffsetY="49.5" x="380" y="870.5" width="470" height="99"/>
</e:Group>
<e:Group id="getDouGroup" width="750" height="1204" x="0" y="0" visible="false">
<e:Image width="750" height="993" x="0" y="3" source="light_png"/>
<e:Image width="660" height="887" x="43" y="177" source="choukabg_png"/>
<e:Image id="cardprize" width="129" height="191" x="312" y="418"/>
<e:Label id="cardlab" text="一张爱豆卡" x="0" y="357" textColor="0x3f3f3f" size="36" fontFamily="Microsoft YaHei" width="750" textAlign="center"/>
<e:Image width="684" height="671" x="37" y="404" source="choukabg2_png"/>
<e:Image width="300" height="34" x="225" y="569" source="choukalab_png"/>
<e:Image id="douprize" width="512" height="240" x="119" y="623"/>
<e:Button id="dougetBtn" label="Button" skinName="ui.IconButtonSkin" icon="choukaBtn_png" width="470" height="99" anchorOffsetX="235" anchorOffsetY="49.5" y="942.5" x="380"/>
<e:Button id="douclose" label="Button" skinName="ui.IconButtonSkin" icon="closebtn_png" width="67" height="67" anchorOffsetX="33.5" anchorOffsetY="33.5" x="636.5" y="230.5"/>
</e:Group>
</e:Skin>
\ No newline at end of file
......@@ -136,9 +136,14 @@ class Main extends MainBase {
this.trace("开始加载task资源");
GDispatcher.dispatchEvent('cardLoaded');
RES.loadGroup("task");
} else if (event.groupName == "task") {
} else if (event.groupName == "task") {
this.trace("task组加载完成");
this.trace("开始加载chouka资源");
GDispatcher.dispatchEvent('taskLoaded');
RES.loadGroup("chouka");
} else if (event.groupName == "chouka") {
this.trace("chouka组加载完成");
GDispatcher.dispatchEvent('choukaLoaded');
RES.removeEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onResourceLoadComplete, this);
RES.removeEventListener(RES.ResourceEvent.GROUP_LOAD_ERROR, this.onResourceLoadError, this);
RES.removeEventListener(RES.ResourceEvent.GROUP_PROGRESS, this.onResourceProgress, this);
......
......@@ -327,6 +327,25 @@ export class iqiyi{
};
NetManager.ins.send(net);
}
/**
* 1.14轮询订单状态
* @param callback 回调
*/
public static getOrderStatus(callback, orderId){
let param: any = {
orderId:orderId
}
const net: INetData = {
name: 'getOrderStatus',
uri: `/hdtool/recon/getOrderStatus`,
type: 'post',
dataType: 'json',
hideMsg: true,
param: param,
callback: callback
};
NetManager.ins.send(net);
}
}
......
......@@ -13,7 +13,7 @@ import { NetManager } from "../../libs/tw/manager/NetManager";
export default class GetCardPanel extends Panel{
get skinKey(){return 'GetCard'}
public getCardGroup:eui.Group;
public light:eui.Image;
public cardname:eui.Label;
public cardintr:eui.Label;
......@@ -34,19 +34,62 @@ export default class GetCardPanel extends Panel{
private _data:any;
private datatype:any;
public getFudaiGroup:eui.Group;
public fuclose:eui.Button;
public prizeimg:eui.Image;
public prizename:eui.Label;
public getfuBtn:eui.Button;
public getDouGroup:eui.Group;
public cardprize:eui.Image;
public cardlab:eui.Label;
public douprize:eui.Image;
public dougetBtn:eui.Button;
public douclose:eui.Button;
private choukaBtnExposure:any
private shoukaBtnExposure:any;
private zengkaBtnExposure:any;
private duobaoBtnExposure:any;
private wannengBtnExposure:any;
private lottery;
constructor(data){
super();
this._data = data.data;
this.datatype = data.datatype;
this.wuyongid = data.wuyong;
this.initUI(this._data,this.datatype);
this.initAni()
if(data.lottery){
this.lottery = data.lottery;
if(data.lottery.type == 'thanks'){
this.getCardGroup.visible = true;
this.getFudaiGroup.visible = false;
this.getDouGroup.visible = false;
this.initUI(this._data,this.datatype);
this.initAni()
}else{
if(data.data.id){
//有福袋,有卡片
this.getCardGroup.visible = false;
this.getFudaiGroup.visible = false;
this.getDouGroup.visible = true;
this.initUIDou();
}else{
//有福袋,没有卡片
this.getCardGroup.visible = false;
this.getFudaiGroup.visible = true;
this.getDouGroup.visible = false;
this.initUIFu();
}
}
}else{
this.getCardGroup.visible = true;
this.getFudaiGroup.visible = false;
this.getDouGroup.visible = false;
this.initUI(this._data,this.datatype);
this.initAni()
}
}
initBuired() {
......@@ -559,4 +602,50 @@ export default class GetCardPanel extends Panel{
this.onTap_closeBtn();
},window["CFG"].activityId,GameConst.getQueryString("shareCode"),GameConst.getQueryString("cardId"),GameConst.getQueryString("token"))
}
initUIFu(){
this.onTap(this.fuclose,this.onTap_closeBtn);
this.prizeimg.source = this.lottery.imgUrl;
this.prizename.text = this.lottery.title;
this.onTap(this.getfuBtn,this.onTap_goUrl);
this.BtnAni(this.getfuBtn);
}
initUIDou(){
this.BtnAni(this.dougetBtn);
for(let i = 0;i<DataManager.ins.getData('getAllCards').data.length;i++){
if(this._data.id == DataManager.ins.getData('getAllCards').data[i].id){
this.cardprize.source = DataManager.ins.getData('getAllCards').data[i].image;
if(DataManager.ins.getData('getAllCards').data[i].type == 1){
//万能卡
this.cardlab.text = "一张万能卡"
}else if(DataManager.ins.getData('getAllCards').data[i].type == 2){
//明星卡
this.cardlab.text = "一张爱豆卡"
}else if(DataManager.ins.getData('getAllCards').data[i].type == 3){
//夺宝卡
this.cardlab.text = "一张夺宝卡"
}
}
}
this.onTap(this.douclose,this.onTap_closeBtn);
this.douprize.source = this.lottery.imgUrl;
this.onTap(this.dougetBtn,this.onTap_goUrl);
}
onTap_goUrl(){
window.location.href = this.lottery.link;
this.onTap_closeBtn();
}
BtnAni(button){
egret.Tween.get(button)
.set({scaleX:1,scaleY:1})
.to({scaleX:0.8,scaleY:0.8},500)
.call(()=>{
egret.Tween.get(button)
.to({scaleX:1,scaleY:1},500)
.call(()=>{
this.BtnAni(button)
})
})
}
}
\ No newline at end of file
......@@ -552,22 +552,48 @@ export default class StartScene extends Scene {
return;
}
let data = DataManager.ins.getData('collect').data;
let carddata :any= {};
if(data.id){
for(let i = 0; i<DataManager.ins.getData('getAllCards').data.length;i++){
if(data.id == DataManager.ins.getData('getAllCards').data[i].id){
SVGACtrl.instance.load("chouka",DataManager.ins.getData('getAllCards').data[i].mark+".svga");
carddata = {data:data,wuyong:99,datatype:1};
if(data.orderId){
iqiyi.getOrderStatus((ss)=>{
if(!ss){
return;
}
let lottery = DataManager.ins.getData("getOrderStatus").data.lottery;
let carddata :any= {};
if(data.id){
for(let i = 0; i<DataManager.ins.getData('getAllCards').data.length;i++){
if(data.id == DataManager.ins.getData('getAllCards').data[i].id){
SVGACtrl.instance.load("chouka",DataManager.ins.getData('getAllCards').data[i].mark+".svga");
carddata = {data:data,wuyong:99,datatype:1,lottery:lottery};
}
}
}else{
let num = Math.floor(Math.random()*6+1);
SVGACtrl.instance.load("chouka","wuyong"+num+".svga");
carddata = {data:data,wuyong:num,datatype:1,lottery:lottery};
}
}
PanelCtrl.instance.show2(ModuleTypes.GETCARD_PANEL,carddata);
},data.orderId)
}else{
let num = Math.floor(Math.random()*6+1);
SVGACtrl.instance.load("chouka","wuyong"+num+".svga");
carddata = {data:data,wuyong:num,datatype:1};
let carddata :any= {};
if(data.id){
for(let i = 0; i<DataManager.ins.getData('getAllCards').data.length;i++){
if(data.id == DataManager.ins.getData('getAllCards').data[i].id){
SVGACtrl.instance.load("chouka",DataManager.ins.getData('getAllCards').data[i].mark+".svga");
carddata = {data:data,wuyong:99,datatype:1};
}
}
}else{
let num = Math.floor(Math.random()*6+1);
SVGACtrl.instance.load("chouka","wuyong"+num+".svga");
carddata = {data:data,wuyong:num,datatype:1};
}
PanelCtrl.instance.show2(ModuleTypes.GETCARD_PANEL,carddata);
}
PanelCtrl.instance.show2(ModuleTypes.GETCARD_PANEL,carddata);
},window["CFG"].activityId)
}
onTap_getTask(){
......
......@@ -215,6 +215,9 @@ const config = {
},//赠送卡片
'/customActivity/iqiyi/scream/getOpenResult': {
data: './iqiyi/getOpenResult.json'
},
'/hdtool/recon/getOrderStatus':{
data: './iqiyi/getOrderStatus.json'
}
......
......@@ -4,6 +4,7 @@
"code":"",
"data":{
"id":null,
"collectNum":3
"collectNum":3,
"orderId":321
}
}
\ No newline at end of file
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