40 lines
964 B
TypeScript
40 lines
964 B
TypeScript
|
//已TS化,測試無誤可刪除原JS代碼
|
|||
|
import GameModel from "../../ts/core/GameModel";
|
|||
|
import GameUtil from "../../ts/core/GameUtil";
|
|||
|
import JSUtil = require("../../ts/core/JSUtil");
|
|||
|
const {ccclass, property} = cc._decorator;
|
|||
|
|
|||
|
@ccclass
|
|||
|
export default class ChatTasktem extends cc.Component {
|
|||
|
@property(cc.Label)
|
|||
|
nameLab: cc.Label = null;
|
|||
|
|
|||
|
itemInfo :any =null;
|
|||
|
onLoad() {
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
loadInfo(info:any) {
|
|||
|
let stTaskConfig = JSUtil.getTaskConfigMgr().GetTaskInfo(info.nTaskID);
|
|||
|
cc.log(info, stTaskConfig);
|
|||
|
this.itemInfo = info;
|
|||
|
this.itemInfo.type = 6;
|
|||
|
this.itemInfo.id = info.nTaskID;
|
|||
|
this.itemInfo.name = stTaskConfig.strTaskName;
|
|||
|
this.nameLab.string = stTaskConfig.strTaskName;
|
|||
|
}
|
|||
|
|
|||
|
mCallback: any;
|
|||
|
setCallback(callback) {
|
|||
|
this.mCallback = callback;
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
onPetClick() {
|
|||
|
if(this.mCallback){
|
|||
|
this.mCallback(this.itemInfo);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
}
|