c3e1fc3a-21fc-4185-9b54-095990c4972c.js 2.43 KB
"use strict";
cc._RF.push(module, 'c3e1fw6IfxBhZtUCVmQxJcs', 'MessageEntryItem');
// script/game/ui/view/impl/MessageEntryItem.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.MessageEntryItemImpl = void 0;
const CCDummyObjects_1 = require("../../../../common/CCDummyObjects");
const ListItemImpl_1 = require("../../baseview/impl/ListItemImpl");
const ResUtils_1 = require("../../../../common/utils/ResUtils");
const { ccclass, property } = cc._decorator;
let MessageEntryItemImpl = /** @class */ (() => {
    let MessageEntryItemImpl = class MessageEntryItemImpl extends ListItemImpl_1.ListItemImpl {
        constructor() {
            super(...arguments);
            this.titleLabel = CCDummyObjects_1.DummyLabel;
            this.lastMsgLabel = CCDummyObjects_1.DummyRichText;
            this.iconSprite = CCDummyObjects_1.DummySprite;
        }
        onLoad() {
            this.bindProp("title", this.titleLabel, "string");
            this.bindProp("lastMsg", this.lastMsgLabel, "string");
            this.bindProp("redDot", this.node.getChildByName("RedDot"), "active");
            this.bindProp("icons", async (value) => {
                if (value.length == 1) {
                    this.iconSprite.spriteFrame = await ResUtils_1.ResUtils.loadRes(value[0], cc.SpriteFrame);
                }
            });
        }
    };
    __decorate([
        property({ type: cc.Label })
    ], MessageEntryItemImpl.prototype, "titleLabel", void 0);
    __decorate([
        property({ type: cc.RichText })
    ], MessageEntryItemImpl.prototype, "lastMsgLabel", void 0);
    __decorate([
        property(cc.Sprite)
    ], MessageEntryItemImpl.prototype, "iconSprite", void 0);
    MessageEntryItemImpl = __decorate([
        ccclass
    ], MessageEntryItemImpl);
    return MessageEntryItemImpl;
})();
exports.MessageEntryItemImpl = MessageEntryItemImpl;

cc._RF.pop();