9f761f34-8c20-4fd1-b175-e20780c6e5a8.js 3.19 KB
"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();