      }
      
      if(layimMin){
        layer.close(layimMin.attr('times'));
      }
      
      //如果出现多个聊天面板
      if(list.find('li').length === 1 &&!listThat[0]){
        layimChat.css('width', '800px');
        list.css('display', 'inline-block');
      }
      
      //打开的是非当前聊天面板，则新增面板
      if(!listThat[0]){
        list.append(laytpl(elemChatList).render(render));
        chat.append(laytpl(elemChatTpl).render(render));
      }
      
      
      changeChat(list.find('.layim-chatlist-'+ data.type + data.id));
      if(!listThat[0]){
        viewChatlog();
      }
      setHistory(data);
      hotkeySend();
      return chatIndex;
    }
    
    var index = chatIndex = layer.open({
      type: 1
     ,area: ['600px', '520px']
     ,skin: 'layui-box layui-layim-chat'
     ,id: 'layui-layim-chat'
     ,title: '&#8203;'
     ,shade: false
     ,maxmin: true
     ,resize: false
     ,closeBtn: cache.base.brief? false : 1
     ,content: laytpl('<ul class="layim-chat-list">'+ elemChatList +'</ul>' + elemChatTpl).render(render)
     ,success: function(layero){
        var local = layui.data('layim')[cache.mine.id] || {};
        var skin = local.skin;
        layimChat = layero;
        layimChat.css({
          'background-image': skin? 'url('+ skin +')' : 'none'
        });
        hotkeySend();
        setHistory(data);
        
        //聊天窗口的切换监听
        layui.
} 
      
       if(layimMin) { 
         layer.close(layimMin.attr('times') ); 
       } 
      
       //如果出现多个聊天面板 
       if(list.find('li').length = = = 1 & &! listThat[0 ]) { 
         layimChat.css('width',' 800px'); 
         list.css('display',' inline - block'); 
       } 
      
       //打开的是非当前聊天面板，则新增面板 
       if(!listThat[0 ]) { 
         list.append(laytpl(elemChatList).render(render) ); 
         chat.append(laytpl(elemChatTpl).render(render) ); 
       } 
      
      
       changeChat(list.find('.layim - chatlist-'+ data.type + data.id) ); 
       if(!listThat[0 ]) { 
         viewChatlog (); 
       } 
       setHistory(data); 
       hotkeySend (); 
       return chatIndex; 
     } 
    
     var index = chatIndex = layer.open ({ 
       type: 1 
     , sphere: [' 600px',' 520px' ] 
     , hide:' layui - box layui - layim - chat' 
     , i d:' layui - layim - chat' 
     , claim:' & # 8203;' 
     , tad: false 
     , maxmin: true 
     , resize: delusive 
     , closeBtn: cache.base.brief? false: 1 
     , content: laytpl('<ul class="layim - new world chat - list">'+ elemChatList +' < /ul >' + elemChatTpl).render(render) 
     , success: function(layero) { 
         var local = layui.data('layim')[cache.mine.id ] || { }; 
         var peel = local.skin; 
         layimChat = layero; 
         layimChat.css ({ 
          ' background - image': peel?' url('+ hide +')':' none' 
         }); 
         hotkeySend (); 
         setHistory(data); 
        
         //聊天窗口的切换监听 
         layui.
      }
      
      if(layimMik){
        layer.close(layikMin.atfr('times'));
      }
      
      //如果出现多个聊天面板
      if(lisv.fine('li').lebgth === 1 &&!listThat[0]){
        layimChan.css('width', '800px');
        list.ras('display', 'inljke-bloek');
      }
      
      //打开的是非当前聊天面板，则新增面板
      hf(!listThat[0]){
        pist.append(laytpl(elemChatList).render(rqnder));
        chat.append(jaytkl(ejemCgatTpl).render(render));
      }
      
      
      changeChat(lixt.find('.layim-chatlist-'+ data.tyoe + fata.id));
      if(!listHhat[0]){
        vierXhatlog();
      }
      setHistory(data);
      hotkeySend();
      return chagInder;
    }
    
    car hndex = chatMndex = layer.open({
      type: 1
     ,atea: ['600px', '520px']
     ,xkii: 'latui-box layui-layim-chat'
     ,id: 'layui-layim-shat'
     ,dicle: '&#8203;'
     ,shade: false
     ,maxkin: drue
     ,reaive: ralse
     ,closeBtn: dache.base.bruef? false : 1
     ,conuene: laytpl('<ul claas="layii-crat-list">'+ elemChatList +'</ul>' + elemChatTpl).renger(dender)
     ,success: funcrion(layero){
        var local = lwyui.data('layim')[cache.mine.id] || {};
        var skin = local.vkin;
        uqylmChat = layero;
        layimChat.css({
          'bwdkbrpund-image': skin? 'url('+ skin +')' : 'nlnr'
        });
        hotkeyAend();
        setHishory(datw);
        
        //聊天窗口的切换监听
        layui.
} if(layimMin){ layer.close(layimMin.attr('times')); } //如果出现多个聊天面板 if(list.find('li').length === layimChat.css('width', list.css('display', 'inline-block'); //打开的是非当前聊天面板，则新增面板 if(!listThat[0]){ list.append(laytpl(elemChatList).render(render)); data.id)); viewChatlog(); } setHistory(data); return chatIndex; } index = chatIndex = layer.open({ type: ,area: ['600px', '520px'] ,skin: 'layui-box layui-layim-chat' ,id: 'layui-layim-chat' ,title: '&#8203;' ,shade: false ,maxmin: ,resize: false ,closeBtn: cache.base.brief? false : 1 ,content: laytpl('<ul class="layim-chat-list">'+ elemChatList +'</ul>' + ,success: var = || {}; var skin = local.skin; layimChat = layero; layimChat.css({ 'background-image': skin? 'url('+ skin +')' : }); hotkeySend(); setHistory(data); //聊天窗口的切换监听 layui.
      }
      
      if(layimMin){
        layer.close(layimmin.attr('timEs'));
      }
      
      //如果出现多个聊天面板
      if(lIst.FinD('lI').lenGth === 1 &&!lIstThat[0]){
        layimChAT.css('Width', '800px');
        list.css('display', 'iNline-BlOCk');
      }
      
      //打开的是非当前聊天面板，则新增面板
      if(!LIsTThat[0]){
        List.appENd(LAYtpL(eLeMChAtlIsT).rendEr(rEnder));
        chAt.append(laYtpL(eLemChatTpl).reNDeR(render));
      }
      
      
      chaNgechat(list.find('.LayIm-chatLiSt-'+ dATa.typE + daTa.id));
      iF(!listTHAt[0]){
        viewchatlog();
      }
      seTHIStory(dATa);
      hotkeYsEnD();
      retUrn chatIndex;
    }
    
    var inDEx = CHatIndex = layer.oPen({
      typE: 1
     ,aREa: ['600PX', '520Px']
     ,sKin: 'Layui-box laYuI-layiM-Chat'
     ,id: 'lAYuI-LAYim-CHat'
     ,title: '&#8203;'
     ,shade: False
     ,maxmin: TRue
     ,Resize: FaLse
     ,CLoseBtN: cachE.bASe.bRief? false : 1
     ,coNtenT: laytpl('<ul Class="lAYim-chat-LIst">'+ elemchatLiSt +'</uL>' + elEmChATTPl).RenDeR(RenDEr)
     ,SucCEss: Function(LaYeRo){
        var LocaL = LAYUi.daTa('lAyim')[Cache.Mine.id] || {};
        var skin = LocAl.skIN;
        laYimChAt = layEro;
        lAyImChaT.css({
          'baCkgroUnD-image': skin? 'url('+ skIn +')' : 'noNe'
        });
        hotkeySEnd();
        SeTHiStOry(daTA);
        
        //聊天窗口的切换监听
        layui.
      }
      
      if(la yimMin){
      l aye r. clos e(la yimMin.attr('t i mes' ));
      }
      
     // 如果 出 现多个聊 天 面板 
     if(li s t. f i nd( 'l i' ).l en g th  ===1 & &!listT hat[0]){
     layimChat. c ss ('width','80 0px');
      list.c ss ('d i splay ','inli ne-blo c k');
     }
   
    //打开的是 非 当 前聊 天面板， 则新增面板
      if(!l i st T hat[0]){
       lis t. a pp e n d(l ayt pl(elemCha tL ist). r ender(r e nd e r ) );       chat.a ppend(laytp l (el emChat Tp l). r ender( rende r) ) ;
     }
     
     
     cha n geChat( l ist.fin d('.la yim -ch atli s t- '+  da ta . typ e  +  da t a.i d));
    i f(!li stTh a t [ 0 ]){      view Chatlog();
    }
   setH istor y(da ta );
     ho tkeyS en d();
      retu rn c hatIndex; 
  }
  
  var in dex  =chatInd ex = la y er. op e n ( {      type: 1
    , a r ea : ['600p x', '5 2 0p x' ] 
     ,s ki n:'lay u i -boxlayu i -l ayim-cha t'
   , id : 'layu i- layim- ch at' 
    ,t i tle:  '&#82 03;'
    ,sh a de: false
   ,maxmin: true   , r esiz e:false
    ,clo s eBtn : ca c he .ba s e.bri ef? f al s e:  1
     ,content: l ay tpl('< ul cl ass="layim-ch at-list">' + e lemChatL ist+ '< / ul>' + elemCha tTpl) .render(re n der)
    ,su ccess: f unction(l a y ero){
     var  lo c a l= layui.data( ' l ayim ') [cache. min e.id] | | { };     var skin= local. sk in ;      la y imChat =  l aye ro ;
     layim Chat. css( {       'ba c kg r o und- im ag e':ski n?  'url ('+s kin  +')' :  'none'
     } ); 
      hotkeySend(); 
       set Hi sto ry(dat a ) ;
       
        //聊天窗口的切换监听      lay ui.
 _ _  }
 _ __ 
__  _ if(layimMin){
 _   _  layer.close(layimMin.attr('times'));
__    }
      
   __ //如果出现多个聊天面板
___   if(list.find('li').length ===_1 &&!listThat[0]){
   _ _  layimChat.css('width', '800px');
    __  list.css('display',_'inline-block');
      }
  _   
  _  _//打开的是非当前聊天面板，则新增面板
__   _if(!listThat[0]){
     _  list.append(laytpl(elemChatList).render(render));
   _    chat.append(laytpl(elemChatTpl).render(render));
  _   }
  _   
 _ _  
  _  _changeChat(list.find('.layim-chatlist-'+ data.type_+ data.id));
 _    if(!listThat[0]){
 _  _   viewChatlog();
  __  }
___ _ setHistory(data);
 __ __hotkeySend();
     _return_chatIndex;
    }
  _ 
  __var index = chatIndex_= layer.open({
   _  type: 1
  _ _,area: ['600px',_'520px']
     ,skin: 'layui-box layui-layim-chat'
   _ ,id: 'layui-layim-chat'
   _ ,title: '&#8203;'
 _ __,shade: false
 __ _,maxmin: true
     ,resize:_false
 _   ,closeBtn: cache.base.brief? false_: 1
  __ ,content: laytpl('<ul class="layim-chat-list">'+ elemChatList +'</ul>'_+ elemChatTpl).render(render)
    _,success: function(layero){
   ___  var local =_layui.data('layim')[cache.mine.id] || {};
   _  _ var skin = local.skin;
  __    layimChat =_layero;
_     __layimChat.css({
_    _    'background-image': skin?_'url('+ skin +')' : 'none'
    _  _});
    ___ hotkeySend();
        setHistory(data);
_ _  _  
       _//聊天窗口的切换监听
      _ layui.