import { _decorator, Component, Node, LabelComponent } from 'cc'; import { NoticeManager } from '../../../engines/notices/NoticeManager'; import StringUtils from '../../../engines/utils/StringUtils'; import { GameModel } from '../../models/GameModel'; const { ccclass, property } = _decorator; @ccclass('ExchangeItemRenderScript') export class ExchangeItemRenderScript extends Component { @property({ type:LabelComponent }) timeLabel:LabelComponent=null; @property({ type:LabelComponent }) timeLabel1:LabelComponent=null; @property({ type:LabelComponent }) goldLabel:LabelComponent=null; @property({ type:LabelComponent }) diamondLabel:LabelComponent=null; private data:any; UpdateItemRender(data:any):void{ this.data=data; let time:number=data.time/60/60; this.timeLabel.string=time+"小时枪械收益"; this.timeLabel1.string="立即获得"+time+"小时枪械收益!"; this.goldLabel.string=StringUtils.numberUtilsEn(GameModel.single.fullEarnings*data.time); this.diamondLabel.string=StringUtils.numberUtilsEn(data.useDiamond,0); } /** * 购买 */ BuyButtonClickHandler():void{ if(GameModel.single.diamond