47 lines
1.0 KiB
TypeScript
47 lines
1.0 KiB
TypeScript
import {
|
|
_decorator,
|
|
Component,
|
|
find,
|
|
Label,
|
|
Node,
|
|
NodeEventType,
|
|
Sprite,
|
|
} from "cc";
|
|
import { DemoManager } from "../DemoManager";
|
|
const { ccclass, property } = _decorator;
|
|
|
|
@ccclass("GirlListItem")
|
|
export class GirlListItem extends Component {
|
|
@property(Sprite)
|
|
avatar: Sprite;
|
|
@property(Label)
|
|
girlName: Label;
|
|
@property(Label)
|
|
desc: Label;
|
|
@property(Label)
|
|
price: Label;
|
|
@property(Node)
|
|
chatBtn: Node;
|
|
|
|
id: number = -1;
|
|
start() {
|
|
// this.avatar = this.node
|
|
// .getChildByName("avatar/Avatar")
|
|
// .getComponent(Sprite);
|
|
// this.girlName = this.node.getChildByName("Desc/Name").getComponent(Label);
|
|
// this.desc = this.node.getChildByName("Desc/desc").getComponent(Label);
|
|
// this.price = this.node.getChildByName("purchase/price").getComponent(Label);
|
|
// this.chatBtn = this.node.getChildByName("purchase/Button");
|
|
|
|
this.id = 1;
|
|
}
|
|
|
|
refreshData() {}
|
|
|
|
onClickDetail() {
|
|
DemoManager.getInstance().EnterDetail(this.id);
|
|
}
|
|
|
|
update(deltaTime: number) {}
|
|
}
|