9f761f34-8c20-4fd1-b175-e20780c6e5a8.js
3.19 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
"use strict";
cc._RF.push(module, '9f76180jCBP0bF14geAxuWo', 'SinInDayitemImpl');
// script/game/ui/view/impl/SinInDayitemImpl.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 });
const CCDummyObjects_1 = require("../../../../common/CCDummyObjects");
const ResUtils_1 = require("../../../../common/utils/ResUtils");
const { ccclass, property } = cc._decorator;
let SininDayItemImpl = /** @class */ (() => {
let SininDayItemImpl = class SininDayItemImpl extends cc.Component {
constructor() {
// LIFE-CYCLE CALLBACKS:
super(...arguments);
// onLoad () {}
this._viewProps = {
key: "",
titlecontent: "",
itemicon: "",
number: "",
itemmask: true
};
this.item_title = CCDummyObjects_1.DummyLabel;
this.item_icon = CCDummyObjects_1.DummySprite;
this.number = CCDummyObjects_1.DummyLabel;
this.item_mask = CCDummyObjects_1.DummyNode;
// update (dt) {}
}
setSininDayItem(item) {
if (this._viewProps.key != item.key) {
this._viewProps.key = item.key;
}
if (this._viewProps.titlecontent != item.titlecontent) {
this._viewProps.titlecontent = item.titlecontent;
this.item_title.string = item.titlecontent;
}
if (this._viewProps.itemicon != item.itemicon) {
ResUtils_1.ResUtils.loadRes(item.itemicon, cc.SpriteFrame).then((value) => {
this.item_icon.spriteFrame = value;
});
this._viewProps.itemicon = item.itemicon;
}
if (this._viewProps.number != item.number) {
this.number.string = item.number;
this._viewProps.number = item.number;
}
if (this._viewProps.itemmask != item.itemmask) {
this.item_mask.active = item.itemmask;
this._viewProps.itemmask = item.itemmask;
}
}
};
__decorate([
property(cc.Label)
], SininDayItemImpl.prototype, "item_title", void 0);
__decorate([
property(cc.Sprite)
], SininDayItemImpl.prototype, "item_icon", void 0);
__decorate([
property(cc.Label)
], SininDayItemImpl.prototype, "number", void 0);
__decorate([
property(cc.Node)
], SininDayItemImpl.prototype, "item_mask", void 0);
SininDayItemImpl = __decorate([
ccclass
], SininDayItemImpl);
return SininDayItemImpl;
})();
exports.default = SininDayItemImpl;
cc._RF.pop();