619b0e59-7430-408f-90ce-f73215067f3d.js
5.37 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
"use strict";
cc._RF.push(module, '619b05ZdDBAj5DO9zIVBn89', 'DatingEventItemViewImpl');
// script/game/ui/view/impl/dating/DatingEventItemViewImpl.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.DatingEventItemViewImpl = void 0;
const CCDummyObjects_1 = require("../../../../../common/CCDummyObjects");
const ListItemImpl_1 = require("../../../baseview/impl/ListItemImpl");
const ResUtils_1 = require("../../../../../common/utils/ResUtils");
const DatingEventSceneModel_1 = require("../../../../model/DatingEventSceneModel");
const { ccclass, property } = cc._decorator;
let DatingEventItemViewImpl = /** @class */ (() => {
let DatingEventItemViewImpl = class DatingEventItemViewImpl extends ListItemImpl_1.ListItemImpl {
constructor() {
super(...arguments);
//#region editor bindings
this.jointLines = [];
this.titleLabel = CCDummyObjects_1.DummyLabel;
this.dateLabel = CCDummyObjects_1.DummyLabel;
this.timeLabel = CCDummyObjects_1.DummyLabel;
this.newNode = CCDummyObjects_1.DummyNode;
this.coverSprite = CCDummyObjects_1.DummySprite;
this.lockText = CCDummyObjects_1.DummyLabel;
this.statusIcons = [];
this.statusSprite = CCDummyObjects_1.DummySprite;
}
//#endregion
onLoad() {
super.onLoad();
this.bindProp("title", this.titleLabel, "string");
this.bindProp("date", this.dateLabel, "string");
this.bindProp("time", this.timeLabel, "string");
this.bindProp("coverImage", (value) => {
if (value) {
ResUtils_1.ResUtils.loadRes(value, cc.SpriteFrame).then((sf) => {
this.coverSprite.spriteFrame = sf;
});
}
});
this.bindProp("lockText", this.lockText, "string");
this.bindProp("status", (status) => {
if (status === DatingEventSceneModel_1.DatingEventStatus.Locked) {
this.coverSprite.node.active = false;
this.lockText.node.parent.active = true;
}
else {
this.coverSprite.node.active = true;
this.lockText.node.parent.active = false;
if (status === DatingEventSceneModel_1.DatingEventStatus.New || status === DatingEventSceneModel_1.DatingEventStatus.InProgress) {
this.newNode.active = true;
}
else {
this.newNode.active = false;
}
if (status === DatingEventSceneModel_1.DatingEventStatus.New) {
this.statusSprite.spriteFrame = this.statusIcons[0];
}
else if (status === DatingEventSceneModel_1.DatingEventStatus.InProgress) {
this.statusSprite.spriteFrame = this.statusIcons[1];
}
else if (status === DatingEventSceneModel_1.DatingEventStatus.Completed) {
this.statusSprite.spriteFrame = this.statusIcons[2];
}
}
});
this.bindProp("lineStyle", (value) => {
if (value === "none") {
this.jointLines[0].parent.active = false;
}
else {
this.jointLines[0].parent.active = true;
this.jointLines[value].active = true;
this.jointLines[(value + 1) % 2].active = false;
}
});
}
};
__decorate([
property([cc.Node])
], DatingEventItemViewImpl.prototype, "jointLines", void 0);
__decorate([
property(cc.Label)
], DatingEventItemViewImpl.prototype, "titleLabel", void 0);
__decorate([
property(cc.Label)
], DatingEventItemViewImpl.prototype, "dateLabel", void 0);
__decorate([
property(cc.Label)
], DatingEventItemViewImpl.prototype, "timeLabel", void 0);
__decorate([
property(cc.Node)
], DatingEventItemViewImpl.prototype, "newNode", void 0);
__decorate([
property(cc.Sprite)
], DatingEventItemViewImpl.prototype, "coverSprite", void 0);
__decorate([
property(cc.Label)
], DatingEventItemViewImpl.prototype, "lockText", void 0);
__decorate([
property([cc.SpriteFrame])
], DatingEventItemViewImpl.prototype, "statusIcons", void 0);
__decorate([
property(cc.Sprite)
], DatingEventItemViewImpl.prototype, "statusSprite", void 0);
DatingEventItemViewImpl = __decorate([
ccclass
], DatingEventItemViewImpl);
return DatingEventItemViewImpl;
})();
exports.DatingEventItemViewImpl = DatingEventItemViewImpl;
cc._RF.pop();