role.js 682 Bytes
/*
    yoho客服 im: 角色
    @author xuan.chen@yoh.cn
*/

'use strict';

class ChatRole {
    constructor(msg) {
        this.msg = msg;
    }
}

class Customer extends ChatRole {
    sendMsg(msg, status) {
        status = status ? '' : '<i class="send-fail">!</i>';
        return `<div class="msg-wrap send-msg">
                    <img src="" alt="" class="head-icon">
                    <div class="chat-info">
                        ${status}
                        <span>${msg}</span> 
                    </div>
                </div>`;
    }
}

class Employee extends ChatRole {

}

class Robot extends ChatRole {

}

export {ChatRole, Customer, Employee, Robot};