import { _decorator, Button, Color, EditBox, instantiate, Label, Node, RichText, Sprite, SpriteFrame, UITransform } from 'cc'; import { UIView } from '@scripts/framework/ui/UIView'; import { AppKernel } from '@scripts/app/AppKernel'; import { UIViewID } from '@scripts/define/UIDefine'; import { UICloseReason } from '@scripts/framework/ui/UILayer'; import { formatCurrency } from '@scripts/utils/Helper'; import { addBtnClick } from '@scripts/utils/UIHelper'; const { ccclass, property } = _decorator; @ccclass('SeasonPassView') export class SeasonPassView extends UIView { readonly viewId = UIViewID.SeasonPassView; @property(Node) item_DLX: Node = null; @property(Node) item_free: Node = null; @property(Node) item_progress: Node = null; @property(Node) scrollView_content: Node = null; protected onCreate(): void | Promise { // addBtnClick(this.btnGuest.node, this.onBtnGuestClick, this); // addBtnClick(this.btnFacebook.node, this.onBtnFBClick, this); // addBtnClick(this.btnGoogle.node, this.onBtnGoogleClick, this); // this._googleWebBtn = AppKernel.google.createLoginBtn( // this.btnGoogle.node, // res => this.onGoogleWebLogin(res), // ); // addBtnClick(this.btnRegister, this.onBtnRegisterClick, this); // addBtnClick(this.btnLogin, this.onBtnLoginClick, this); // addBtnClick(this.btnResetPsd, this.onBtnResetPsdClick, this); // addBtnClick(this.btnSupport, this.onBtnSupportClick, this); // this.initPsdInput(); // this.initPolicyDesc(); // this.initScrollView(); } protected onOpen(_params: unknown): void | Promise { } protected onClose(_reason: UICloseReason): void | Promise { } protected onDestroy(): void { } private initScrollView() { // const items_data = new Array(10).fill(0); // items_data.forEach((item, index) => { // const item_DLX = instantiate(this.item_DLX); // item_DLX.parent = this.item_DLX.parent; // item_DLX.active = true; // const item_free = instantiate(this.item_free); // item_free.parent = this.item_free.parent; // item_free.active = true; // const item_progress = instantiate(this.item_progress); // item_progress.parent = this.item_progress.parent; // item_progress.active = true; // }) // this.scheduleOnce(() => { // console.log("item_DLX.parent.width", this.item_DLX.parent.getComponent(UITransform).width) // console.log("item_free.parent.width", this.item_free.parent.getComponent(UITransform).width) // console.log("item_progress.parent.width", this.item_progress.parent.getComponent(UITransform).width) // this.scrollView_content.getComponent(UITransform).width = this.item_free.parent.getComponent(UITransform).width; // }) } }