import { _decorator, Component, Label, Node, Sprite, SpriteFrame, UITransform, Vec3 } from 'cc'; import { server_han_zi_zhao_bu_tong_data_item, server_mei_nv_zhao_xi_jie_data_item, server_shuang_tu_zhao_bu_tong_data_item } from '../data/server_play_list_data'; import { Util } from '../framework/util'; import { gameManager } from '../gameManager'; import { config } from '../config'; const { ccclass, property } = _decorator; @ccclass('win') export class win extends Component { @property(Node) bg:Node; @property(Node) img_caidai:Node; @property(Node) img_text:Node; @property(Node) lab_reward_number:Node; @property(Node) btn_bg:Node; @property(Node) btn_ordinary:Node; @property(Node) btn_double:Node; @property(Node) btn_next_level:Node; @property(Node) img_emote:Node; @property(Node) lab_title_1:Node; @property(SpriteFrame) sf_tailihaile:SpriteFrame; @property(SpriteFrame) sf_gongxi:SpriteFrame; private m_reward_number:number; private m_ordinary_call:any = null; private m_double_call:any = null; start() { let self = this; this.btn_ordinary.on(Node.EventType.TOUCH_START,()=>{ if(this.m_ordinary_call!=null){ this.m_ordinary_call(this) } },this); this.btn_double.on(Node.EventType.TOUCH_START,()=>{ if(this.m_double_call!=null){ this.m_double_call(this) } },this); this.btn_next_level.on(Node.EventType.TOUCH_START,()=>{ if(this.m_ordinary_call!=null){ this.m_ordinary_call(this) } },this); } public close(){ this.node.removeFromParent(); } public hideAllBtn(){ this.btn_ordinary.active = false; this.btn_double.active = false; } public showDoubleCoin(doubel_reward,call_back){ let reward = this.m_reward_number let obj = new Component gameManager.instance.addCoinNumber(obj,doubel_reward,this.lab_reward_number.getComponent(Label),reward,()=>{ call_back() },"+ ") this.hideAllBtn() } public showView(reward:number,data:server_mei_nv_zhao_xi_jie_data_item,ordinary_call,double_call){ this.bg.getComponent(UITransform).height = 374 this.m_double_call = double_call; this.m_ordinary_call = ordinary_call; this.m_reward_number = reward; this.lab_reward_number.getComponent(Label).string = "+ " +reward+""; } public showJYLView(ordinary_call,categoryid){ this.img_caidai.active = false this.bg.getComponent(UITransform).height = 280 this.img_text.position = new Vec3(this.img_text.position.x, this.img_text.position.y - 40, this.img_text.position.z) this.btn_bg.position = new Vec3(this.btn_bg.position.x, this.btn_bg.position.y + 50, this.btn_bg.position.z) if(categoryid===config.PLAY_TYPE.DOU_DI_ZHU){ this.bg.angle = -90; this.bg.position = new Vec3(this.bg.position.x,this.bg.position.y,this.bg.position.z) }else{ } this.img_text.getComponent(Sprite).spriteFrame = this.sf_tailihaile; this.hideAllBtn() this.m_ordinary_call = ordinary_call; this.btn_next_level.active = true; this.lab_reward_number.active = false; this.lab_title_1.active = false; } public showVideoAddCoinView(reward:number,data:server_mei_nv_zhao_xi_jie_data_item,ordinary_call,double_call){ this.m_double_call = double_call; this.m_ordinary_call = ordinary_call; this.m_reward_number = reward; this.img_text.getComponent(Sprite).spriteFrame = this.sf_gongxi this.lab_reward_number.getComponent(Label).string = "+ " +reward+""; } }