|
@@ -1,3 +1,4 @@
|
|
|
|
|
+import TableView from "../../../component/TableView";
|
|
|
|
|
|
|
|
const { ccclass, property } = cc._decorator;
|
|
const { ccclass, property } = cc._decorator;
|
|
|
/**
|
|
/**
|
|
@@ -10,14 +11,19 @@ export default class RedBagCash extends cc.Component {
|
|
|
@property({ displayName: '滚动视图', type: cc.ScrollView })
|
|
@property({ displayName: '滚动视图', type: cc.ScrollView })
|
|
|
sroll_view: cc.ScrollView = null!;
|
|
sroll_view: cc.ScrollView = null!;
|
|
|
|
|
|
|
|
- onLoad() {
|
|
|
|
|
|
|
+ @property({ displayName: 'lbl红包数量', type: cc.Label })
|
|
|
|
|
+ private lbl_redbag: cc.Label = null!;
|
|
|
|
|
+ @property({ displayName: 'lbl毛币数量', type: cc.Label })
|
|
|
|
|
+ private lbl_rmb: cc.Label = null!;
|
|
|
|
|
|
|
|
|
|
+ private tableview: TableView = null;
|
|
|
|
|
+ onLoad() {
|
|
|
|
|
+ this.tableview = this.sroll_view.getComponent('TableView');
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
start() {
|
|
start() {
|
|
|
|
|
+ this.initMoney();
|
|
|
this.initScrollView();
|
|
this.initScrollView();
|
|
|
- // 请求记录
|
|
|
|
|
- // gData.cashNormal.getRecord()
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// update (dt) {}
|
|
// update (dt) {}
|
|
@@ -27,4 +33,13 @@ export default class RedBagCash extends cc.Component {
|
|
|
private initScrollView() {
|
|
private initScrollView() {
|
|
|
this.sroll_view.node.emit('srollview-init', gData.redBagCash.c_data);
|
|
this.sroll_view.node.emit('srollview-init', gData.redBagCash.c_data);
|
|
|
}
|
|
}
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 初始化货币数量
|
|
|
|
|
+ */
|
|
|
|
|
+ private initMoney() {
|
|
|
|
|
+ this.lbl_redbag.string = `${gData.gameData.gameData.redMoney}`;
|
|
|
|
|
+ let rmb = gData.gameData.gameData.redMoney / 10000;
|
|
|
|
|
+ rmb = rmb > 1 ? Math.floor(rmb) : parseFloat(rmb.toFixed(2));
|
|
|
|
|
+ this.lbl_rmb.string = `${rmb}`;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|