77d42084-be76-47c2-8338-e2cdfbbee723.js
5.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
"use strict";
cc._RF.push(module, '77d42CEvnZHwoM44s37vucj', 'DatingEventSubviewImpl');
// script/game/ui/view/impl/dating/DatingEventSubviewImpl.ts
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.DatingEventSubviewImpl = void 0;
const ListSubviewImpl_1 = require("../../../baseview/impl/ListSubviewImpl");
const DatingEventSubview_1 = require("../../type/DatingEventSubview");
const DatingEventItemViewImpl_1 = require("./DatingEventItemViewImpl");
const PresenterCCViewFactory_1 = require("../../../PresenterCCViewFactory");
const CCDummyObjects_1 = require("../../../../../common/CCDummyObjects");
const GameModelManager_1 = require("../../../../model/GameModelManager");
const { ccclass, property } = cc._decorator;
let DatingEventSubviewImpl = /** @class */ (() => {
let DatingEventSubviewImpl = class DatingEventSubviewImpl extends ListSubviewImpl_1.ListSubviewImpl {
constructor() {
super(...arguments);
this.listItemPrefab = CCDummyObjects_1.DummyPrefab;
this.leftButton = CCDummyObjects_1.DummyButton;
this.nameButton = CCDummyObjects_1.DummyButton;
this.rightButton = CCDummyObjects_1.DummyButton;
this.scrollViewRoot = CCDummyObjects_1.DummyNode;
this.scrollViewContent = CCDummyObjects_1.DummyNode;
this.sectionBtn = CCDummyObjects_1.DummyPrefab;
this.extraPlotButton = CCDummyObjects_1.DummyNode;
this.getItemNode = (k) => {
let ret = undefined;
let v = this._itemViews[k];
if (v) {
ret = v.node;
}
return ret;
};
}
// private _scrollViewOffsetY: number;
onLoad() {
super.onLoad();
}
createListItemView(index) {
let node = cc.instantiate(this.listItemPrefab);
return Promise.resolve(node.getComponent(DatingEventItemViewImpl_1.DatingEventItemViewImpl));
}
onRefreshListEnd() {
this.scheduleOnce(() => {
this.scheduleOnce(() => {
this.contentLayout.updateLayout();
// if (this._scrollViewOffsetY) {
// this.scrollView.scrollToOffset(new cc.Vec2(0, this._scrollViewOffsetY));
// this._scrollViewOffsetY = 0;
// } else {
this.scrollToTop();
// }
GameModelManager_1.GameModelManager.CheckDateGuide.emit();
});
});
}
onScrollEvent(scrollview, eventType, customEventData) {
if (cc.ScrollView.EventType.SCROLL_BEGAN === eventType) {
this._props.onScrollBegin();
}
else if (cc.ScrollView.EventType.SCROLL_ENDED === eventType) {
this._props.onScrollEnd();
}
}
// setCurrEventId(id: number) {
// this._scrollViewOffsetY = this.scrollView.content.height - (250 * id) - (250 / 2);
// }
getLeftButton() {
return this.leftButton;
}
getNameButton() {
return this.nameButton;
}
getRightButton() {
return this.rightButton;
}
getScrollViewRoot() {
return this.scrollViewRoot;
}
getScrollViewContent() {
return this.scrollViewContent;
}
getSectionBtn() {
return this.sectionBtn;
}
getExtraPlotButton() {
return this.extraPlotButton;
}
onLeftButtonClick() {
this._props.onLeftButtonClickCallback();
}
onRightButtonClick() {
this._props.onRightButtonClickCallback();
}
onNameButtonClick() {
this._props.onNameButtonClickCallback();
}
onExtraPlotButtonClick() {
this._props.onExtraPlotButtonClickCallback();
}
onCloseSectionView() {
this._props.onCloseSectionViewCallBack();
}
};
__decorate([
property(cc.Prefab)
], DatingEventSubviewImpl.prototype, "listItemPrefab", void 0);
__decorate([
property(cc.Button)
], DatingEventSubviewImpl.prototype, "leftButton", void 0);
__decorate([
property(cc.Button)
], DatingEventSubviewImpl.prototype, "nameButton", void 0);
__decorate([
property(cc.Button)
], DatingEventSubviewImpl.prototype, "rightButton", void 0);
__decorate([
property(cc.Node)
], DatingEventSubviewImpl.prototype, "scrollViewRoot", void 0);
__decorate([
property(cc.Node)
], DatingEventSubviewImpl.prototype, "scrollViewContent", void 0);
__decorate([
property(cc.Prefab)
], DatingEventSubviewImpl.prototype, "sectionBtn", void 0);
__decorate([
property(cc.Node)
], DatingEventSubviewImpl.prototype, "extraPlotButton", void 0);
DatingEventSubviewImpl = __decorate([
ccclass,
PresenterCCViewFactory_1.RegSubview(DatingEventSubview_1.DatingEventSubviewType)
], DatingEventSubviewImpl);
return DatingEventSubviewImpl;
})();
exports.DatingEventSubviewImpl = DatingEventSubviewImpl;
cc._RF.pop();