77d42084-be76-47c2-8338-e2cdfbbee723.js
3.29 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
"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 { ccclass, property } = cc._decorator;
let DatingEventSubviewImpl = /** @class */ (() => {
let DatingEventSubviewImpl = class DatingEventSubviewImpl extends ListSubviewImpl_1.ListSubviewImpl {
constructor() {
super(...arguments);
//#region editor bindings
this.listItemPrefabs = [];
this.listSuffix = undefined;
this.noDataNode = CCDummyObjects_1.DummyNode;
}
//#endregion
onLoad() {
super.onLoad();
this.bindProp("items", (value) => {
this.noDataNode.active = !value.length;
if (this.listSuffix) {
this.listSuffix.active = !!value.length;
}
});
}
createListItemView(index) {
let prefab = this.listItemPrefabs[index % this.listItemPrefabs.length];
let node = cc.instantiate(prefab);
return Promise.resolve(node.getComponent(DatingEventItemViewImpl_1.DatingEventItemViewImpl));
}
onRefreshListEnd() {
if (this.listSuffix) {
this.listSuffix.setSiblingIndex(this.contentLayout.node.childrenCount);
}
if (this.name.indexOf("MainEvent") === 0) {
this.scheduleOnce(() => {
this.scheduleOnce(() => {
this.contentLayout.updateLayout();
this.scrollToBottom(false);
});
});
}
}
};
__decorate([
property([cc.Prefab])
], DatingEventSubviewImpl.prototype, "listItemPrefabs", void 0);
__decorate([
property(cc.Node)
], DatingEventSubviewImpl.prototype, "listSuffix", void 0);
__decorate([
property(cc.Node)
], DatingEventSubviewImpl.prototype, "noDataNode", void 0);
DatingEventSubviewImpl = __decorate([
ccclass,
PresenterCCViewFactory_1.RegSubview(DatingEventSubview_1.DatingEventSubviewType)
], DatingEventSubviewImpl);
return DatingEventSubviewImpl;
})();
exports.DatingEventSubviewImpl = DatingEventSubviewImpl;
cc._RF.pop();