|
|
@@ -10,6 +10,8 @@ export default class RedBagCash extends cc.Component {
|
|
|
|
|
|
@property({ displayName: '滚动视图', type: cc.ScrollView })
|
|
|
private sroll_view: cc.ScrollView = null!;
|
|
|
+ @property({ displayName: '条目容器', type: cc.Node })
|
|
|
+ private node_content: cc.Node = null!;
|
|
|
@property({ displayName: 'lbl红包数量', type: cc.Label })
|
|
|
private lbl_redbag: cc.Label = null!;
|
|
|
@property({ displayName: 'lbl毛币数量', type: cc.Label })
|
|
|
@@ -39,6 +41,22 @@ export default class RedBagCash extends cc.Component {
|
|
|
private initScrollView() {
|
|
|
this.sroll_view.node.emit('srollview-init', gData.redBagCash.c_data);
|
|
|
gData.redBagCash.init_list = false;
|
|
|
+ // 条目动画
|
|
|
+ this.itemAnim();
|
|
|
+ }
|
|
|
+
|
|
|
+ private itemAnim() {
|
|
|
+ let arr_node = this.node_content.children;
|
|
|
+ const n_count = this.node_content.childrenCount;
|
|
|
+ const start_pos = new cc.Vec2(0, -this.sroll_view.node.height);
|
|
|
+ for (let i = 0; i < n_count; i++) {
|
|
|
+ let node_item = arr_node[i];
|
|
|
+ const end_pos = node_item.getPosition();
|
|
|
+ node_item.y = start_pos.y;
|
|
|
+ this.scheduleOnce(() => {
|
|
|
+ mk.tween.move(node_item, 0.6, start_pos, end_pos, null, 'backOut');
|
|
|
+ }, i * 0.1)
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|