商业化-前端部分
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import { _decorator, Component, Label, Node } from "cc";
|
||||
import { PurchasePanel } from "../ui/panels/PurchasePanel";
|
||||
import { PurchaseConfig } from "../../schema/schema";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass("PurchasePanelItem")
|
||||
export class PurchasePanelItem extends Component {
|
||||
@property(Label)
|
||||
count: Label;
|
||||
@property(Label)
|
||||
price: Label;
|
||||
|
||||
baseView: PurchasePanel;
|
||||
data: PurchaseConfig;
|
||||
public init(base: PurchasePanel, data: PurchaseConfig) {
|
||||
this.baseView = base;
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public show() {
|
||||
this.count.string = this.data.desc.toString();
|
||||
this.price.string = this.data.count.toString();
|
||||
}
|
||||
|
||||
onClickThis() {
|
||||
this.baseView.setDiamondTag(this.data.id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "0c5a1f4a-a909-49dd-802c-06e27182eb79",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
Reference in New Issue
Block a user