70 lines
1.9 KiB
TypeScript
70 lines
1.9 KiB
TypeScript
// Learn TypeScript:
|
||
// - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
|
||
// Learn Attribute:
|
||
// - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
|
||
// Learn life-cycle callbacks:
|
||
// - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
|
||
|
||
import UIBaseEv from "../../common/ui/uiEv/UIBaseEv";
|
||
import DataManager from "../Model/data/DataManager";
|
||
import ProxyClientDataMgr, { fishCathOnline } from "../Model/ProxyClientDataMgr";
|
||
|
||
const {ccclass, property} = cc._decorator;
|
||
|
||
@ccclass
|
||
export default class earningFishModule extends UIBaseEv {
|
||
|
||
@property(cc.Sprite)
|
||
fishSpr:cc.Sprite = null;
|
||
@property(cc.Sprite)
|
||
graySpr:cc.Sprite = null;
|
||
@property(cc.Label)
|
||
unlockLabel:cc.Label = null;
|
||
@property(cc.Label)
|
||
nameLabel:cc.Label = null;
|
||
@property(cc.Label)
|
||
sellLabel:cc.Label = null;
|
||
|
||
fishCathOnlineObj:fishCathOnline = null;
|
||
// LIFE-CYCLE CALLBACKS:
|
||
|
||
// onLoad () {}
|
||
updataItem(data:fishCathOnline)
|
||
{
|
||
this.fishCathOnlineObj = data;
|
||
|
||
let objFish = DataManager.ins().getObjCfgById(this.fishCathOnlineObj.id);
|
||
|
||
this.nameLabel.string = objFish._name+"*"+this.fishCathOnlineObj.numSale;
|
||
|
||
if(this.fishCathOnlineObj.type === 1)
|
||
{
|
||
this.graySpr.node.active = true;
|
||
this.sellLabel.node.active = false;
|
||
}
|
||
else if(this.fishCathOnlineObj.type === 2)
|
||
{
|
||
this.graySpr.node.active = false;
|
||
this.sellLabel.string = ""+this.fishCathOnlineObj.coinSale;
|
||
this.sellLabel.node.active = true;
|
||
}
|
||
|
||
this.node.active = true;
|
||
|
||
}
|
||
|
||
//在线钓鱼统计
|
||
// export interface fishCathOnline{
|
||
// id:number,
|
||
// type:number, //1标识解锁,2标识出售
|
||
// numSale:number, //出售数量
|
||
// coinSale:number,//出售价值
|
||
// }
|
||
|
||
start () {
|
||
|
||
}
|
||
|
||
// update (dt) {}
|
||
}
|