619b0e59-7430-408f-90ce-f73215067f3d.js
4 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
"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 simba_cc_resutils_1 = require("simba-cc-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);
this.titleRichText = CCDummyObjects_1.DummyRichText;
this.newNode = CCDummyObjects_1.DummyNode;
this.contentSprite = CCDummyObjects_1.DummySprite;
this.statusIcons = [];
this.statusSprite = CCDummyObjects_1.DummySprite;
}
onLoad() {
super.onLoad();
this.bindProp("title", this.titleRichText, "string");
this.bindProp("coverImage", (value) => {
if (value) {
simba_cc_resutils_1.ResUtils.loadRes(value, cc.SpriteFrame).then((sf) => {
this.contentSprite.spriteFrame = sf;
});
}
});
this.bindProp("status", (status) => {
if (status === DatingEventSceneModel_1.DatingEventStatus.Locked) {
this.contentSprite.node.active = false;
}
else {
this.contentSprite.node.active = true;
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];
}
}
});
}
};
__decorate([
property(cc.RichText)
], DatingEventItemViewImpl.prototype, "titleRichText", void 0);
__decorate([
property(cc.Node)
], DatingEventItemViewImpl.prototype, "newNode", void 0);
__decorate([
property(cc.Sprite)
], DatingEventItemViewImpl.prototype, "contentSprite", 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();