|
@@ -9,8 +9,7 @@ const { ccclass, property } = cc._decorator;
|
|
|
export default class RedBagCash extends cc.Component {
|
|
export default class RedBagCash extends cc.Component {
|
|
|
|
|
|
|
|
@property({ displayName: '滚动视图', type: cc.ScrollView })
|
|
@property({ displayName: '滚动视图', type: cc.ScrollView })
|
|
|
- sroll_view: cc.ScrollView = null!;
|
|
|
|
|
-
|
|
|
|
|
|
|
+ private sroll_view: cc.ScrollView = null!;
|
|
|
@property({ displayName: 'lbl红包数量', type: cc.Label })
|
|
@property({ displayName: 'lbl红包数量', type: cc.Label })
|
|
|
private lbl_redbag: cc.Label = null!;
|
|
private lbl_redbag: cc.Label = null!;
|
|
|
@property({ displayName: 'lbl毛币数量', type: cc.Label })
|
|
@property({ displayName: 'lbl毛币数量', type: cc.Label })
|
|
@@ -18,7 +17,7 @@ export default class RedBagCash extends cc.Component {
|
|
|
|
|
|
|
|
private tableview: TableView = null;
|
|
private tableview: TableView = null;
|
|
|
onLoad() {
|
|
onLoad() {
|
|
|
- gData.gameData.gameData.redMoney = 3200
|
|
|
|
|
|
|
+ gData.gameData.gameData.redMoney = 10200
|
|
|
this.tableview = this.sroll_view.getComponent('TableView');
|
|
this.tableview = this.sroll_view.getComponent('TableView');
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -28,12 +27,9 @@ export default class RedBagCash extends cc.Component {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
update(dt) {
|
|
update(dt) {
|
|
|
- if (gData.redBagCash.old_index) {
|
|
|
|
|
- // 指定条目数据刷新
|
|
|
|
|
- const last_index = gData.redBagCash.old_index;
|
|
|
|
|
- const next_index = gData.redBagCash.old_index + 1;
|
|
|
|
|
- this.tableview.resetItemData(last_index, gData.sign.list_data[last_index]);
|
|
|
|
|
- if (gData.sign.list_data[next_index]) this.tableview.resetItemData(gData.redBagCash.old_index + 1, gData.sign.list_data[next_index]);
|
|
|
|
|
|
|
+ if (gData.redBagCash.init_list) {
|
|
|
|
|
+ this.initScrollView();
|
|
|
|
|
+ this.initMoney();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -42,6 +38,7 @@ 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);
|
|
|
|
|
+ gData.redBagCash.init_list = false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|