hall.vue 146 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001
  1. <template>
  2. <div class="mainBox">
  3. <div class="hallBox">
  4. <div class="hallLeft">
  5. <!--加载中 start------------------------------------------>
  6. <div class="hallLeftLoading" v-if="hallLeftLoading">
  7. <div class="hallLeftLoadingIcon">
  8. <div class="hallLeftLoadingIconItem"><i class="el-icon-loading"></i></div>
  9. <div class="hallLeftLoadingText">恒星管理平台</div>
  10. </div>
  11. </div>
  12. <!--加载中 end------------------------------------------>
  13. <!--添加好友 start------------------------------------------>
  14. <hallTitle :name="tableTitleName" @addUser="creatGroup" />
  15. <!--添加好友 end------------------------------------------>
  16. <!--搜索 start------------------------------------------>
  17. <div class="searchBoxMain">
  18. <div class="searchBox">
  19. <el-input
  20. placeholder="请输入内容"
  21. prefix-icon="el-icon-search"
  22. v-model="searchConversation"
  23. @keyup.enter.native="searchUserConversation"
  24. >
  25. </el-input>
  26. </div>
  27. <div class="searchFriendBox" v-if="searchConversationStatus">
  28. <div class="searchFriendClose">
  29. <div @click="closeSearchConversation" class="rightSlideBoxCloseIcon">
  30. <i class="el-icon-close"></i>
  31. </div>
  32. </div>
  33. <div class="searchFriendItem">
  34. <div class="searchFriendAvatar" v-if="selectConversationItem.group_name==null">
  35. <img :src="selectConversationItem.avatar" v-if="selectConversationItem.avatar!=null&&selectConversationItem.avatar!=''">
  36. <img src="@/assets/chat/user/admin.png" v-else>
  37. </div>
  38. <div class="searchFriendAvatar" v-else>
  39. <img src="@/assets/chat/user/group.jpg">
  40. </div>
  41. <div class="searchFriendInfo">
  42. <div class="searchFriendName">
  43. <div class="searchFriendNameText" v-if="selectConversationItem.group_name==null">{{selectConversationItem.user_name}}</div>
  44. <div class="searchFriendNameText" v-else>{{selectConversationItem.group_name}}</div>
  45. </div>
  46. <div class="searchFriendPhone" v-if="selectConversationItem.group_name==null">账号:{{selectConversationItem.user_name}}</div>
  47. <div class="searchFriendPhone" v-else>多人群组</div>
  48. </div>
  49. </div>
  50. <div class="searchFriendButton">
  51. <el-button type="primary" @click="selectConversation(selectConversationItem)">发送消息</el-button>
  52. </div>
  53. </div>
  54. </div>
  55. <!--搜索 end------------------------------------------>
  56. <div class="userListBox">
  57. <!--会话列表 start------------------------------------------>
  58. <div :class="['userItem', item.status === 1 ? 'active' : '']" v-for="item in conversationList" :key="item.receiver_id">
  59. <div class="flexItemBox" v-if="item.is_group==0" @click="selectConversation(item)">
  60. <!--单聊-->
  61. <div class="userAvatar">
  62. <img :src="item.avatar" v-if="item.avatar!=null&&item.avatar!=''">
  63. <img src="@/assets/chat/user/admin.png" v-else>
  64. </div>
  65. <div class="userInfo">
  66. <div class="userName">
  67. <div class="userNameText">{{item.user_name}}</div>
  68. <div class="userMessageNum" v-if="item.num>0">{{item.num}}</div>
  69. </div>
  70. </div>
  71. </div>
  72. <!--群聊-->
  73. <div class="flexItemBox" v-else @click="selectGroup(item)">
  74. <div class="userAvatar">
  75. <img src="@/assets/chat/user/group.jpg">
  76. </div>
  77. <div class="userInfo">
  78. <div class="userName">
  79. <div class="userNameText">{{item.group_name}}</div>
  80. <div class="userMessageNum" v-if="item.num>0">{{item.num}}</div>
  81. </div>
  82. </div>
  83. </div>
  84. </div>
  85. <!--会话列表 end------------------------------------------>
  86. </div>
  87. </div>
  88. <!--右侧菜单 start------------------------------------------>
  89. <div class="hallRight" v-if="ifNoMessage==true">
  90. <div class="ifHallRigthNoMessage">恒星管理平台</div>
  91. </div>
  92. <div class="hallRight" v-else>
  93. <!--加载中 start-->
  94. <div class="hallRightLoading" v-if="hallRightLoading">
  95. <div class="hallRightLoadingIcon">
  96. <div class="hallRightLoadingIconItem"><i class="el-icon-loading"></i></div>
  97. <div class="hallRightLoadingText">恒星管理平台</div>
  98. </div>
  99. </div>
  100. <!--加载中 end-->
  101. <div :class="['UserNameBox', groupId ? 'ifNotice' : '']">
  102. <div class="userName">{{ messageTitle }}</div>
  103. <img src="@/assets/chat/fi_more.png" v-if="groupId!=''" @click="openGroupSystem" class="moreIcon">
  104. <div class="groupNotice" v-if="groupId!=''&&groupProfile!=''">{{groupProfile}}</div>
  105. <div v-if="groupId==''">
  106. <div class="shareCardIcon" @click="openShareCard">
  107. <i class="el-icon-postcard"></i>
  108. </div>
  109. </div>
  110. </div>
  111. <div class="rightPositionBox">
  112. <div class="rightUserMessageBox" ref="rightUserMessageBox">
  113. <!-- <div class="timeBox">
  114. <span>12:40:22</span>
  115. </div> -->
  116. <div v-for="item in chatrecords" :key="item.id">
  117. <!--文字消息类型 对方-->
  118. <div class="otherUserMessage" v-if="item.action=='recieved'&&Number(item.msg_type)==1">
  119. <div class="otherUserIcon">
  120. <img :src="item.receiver_avatar" v-if="item.receiver_avatar!=null&&item.receiver_avatar!=''">
  121. <img src="@/assets/chat/user/admin.png" v-else>
  122. </div>
  123. <div class="otherUserMessageText">
  124. {{item.content}}
  125. </div>
  126. </div>
  127. <!--文字消息类型 我-->
  128. <div class="meUserMessage" v-if="item.action=='said'&&Number(item.msg_type)==1">
  129. <div class="meUserMessageText">
  130. {{item.content}}
  131. </div>
  132. <div class="meUserIcon">
  133. <img :src="item.user_avatar" v-if="item.user_avatar!=null&&item.user_avatar!=''">
  134. <img src="@/assets/chat/user/admin.png" v-else>
  135. </div>
  136. </div>
  137. <!-- 图片类型 对方-->
  138. <div class="otherUserMessage" v-if="item.action=='recieved'&&Number(item.msg_type)==2">
  139. <div class="otherUserIcon">
  140. <img :src="item.receiver_avatar" v-if="item.receiver_avatar!=null&&item.receiver_avatar!=''">
  141. <img src="@/assets/chat/user/admin.png" v-else>
  142. </div>
  143. <div class="otherUserMessageText">
  144. <div class="messageTypeImage">
  145. <img :src="item.content" @click="imgZoom(item.content)">
  146. </div>
  147. </div>
  148. </div>
  149. <!-- 图片类型 我-->
  150. <div class="meUserMessage" v-if="item.action=='said'&&Number(item.msg_type)==2">
  151. <div class="meUserMessageText">
  152. <div class="messageTypeImage">
  153. <img :src="item.content" @click="imgZoom(item.content)">
  154. </div>
  155. </div>
  156. <div class="meUserIcon">
  157. <img :src="item.user_avatar" v-if="item.user_avatar!=null&&item.user_avatar!=''">
  158. <img src="@/assets/chat/user/admin.png" v-else>
  159. </div>
  160. </div>
  161. <!--文件类型 对方-->
  162. <div class="otherUserMessage" v-if="item.action=='recieved'&&item.msg_type==3">
  163. <div class="otherUserIcon">
  164. <img :src="item.receiver_avatar" v-if="item.receiver_avatar!=null&&item.receiver_avatar!=''">
  165. <img src="@/assets/chat/user/admin.png" v-else>
  166. </div>
  167. <div class="otherUserMessageText" @click="downloadFile(item)">
  168. <div class="messageTypeFile">
  169. <div class="messageTypeFileTop">
  170. <div class="messageTypeFileInfo">
  171. <div class="messageTypeFileTitle">
  172. {{ JSON.parse(item.content).oldFileName }}
  173. </div>
  174. <div class="messageTypeFileIcon">
  175. <img src="@/assets/chat/file.png"/>
  176. </div>
  177. </div>
  178. <!-- <div class="messageTypeFileSize">20kb</div> -->
  179. </div>
  180. <div class="messageTypeFileLogo">恒星管理平台保护您的电脑安全</div>
  181. </div>
  182. </div>
  183. </div>
  184. <!--文件类型 我-->
  185. <div class="meUserMessage" v-if="item.action=='said'&&Number(item.msg_type)==3">
  186. <div class="meUserMessageText" @click="downloadFile(item)">
  187. <div class="messageTypeFile">
  188. <div class="messageTypeFileTop">
  189. <div class="messageTypeFileInfo">
  190. <div class="messageTypeFileTitle">
  191. {{ JSON.parse(item.content).oldFileName }}
  192. </div>
  193. <div class="messageTypeFileIcon">
  194. <img src="@/assets/chat/file.png"/>
  195. </div>
  196. </div>
  197. <!-- <div class="messageTypeFileSize">20kb</div> -->
  198. </div>
  199. <div class="messageTypeFileLogo">恒星管理平台保护您的电脑安全</div>
  200. </div>
  201. </div>
  202. <div class="meUserIcon">
  203. <img :src="item.user_avatar" v-if="item.user_avatar!=null&&item.user_avatar!=''">
  204. <img src="@/assets/chat/user/admin.png" v-else>
  205. </div>
  206. </div>
  207. <!--名片 我-->
  208. <div class="meUserMessage" v-if="item.action=='said'&&Number(item.msg_type)==4">
  209. <div class="meUserMessageText" @click="addFriend(item.content.split(',')[2])">
  210. <div class="messageTypeCard">
  211. <div class="messageTypeCardTop">
  212. <div class="messageTypeCardIcon">
  213. <!-- <img :src="item.content.split(',')[0]"> -->
  214. <img src="@/assets/chat/user/user.png">
  215. </div>
  216. <div class="messageTypeCardName">{{item.content.split(',')[1]}}</div>
  217. </div>
  218. <div class="messageTypeCardText">
  219. 分享个人名片
  220. </div>
  221. </div>
  222. </div>
  223. <div class="meUserIcon">
  224. <img :src="item.user_avatar" v-if="item.user_avatar!=null&&item.user_avatar!=''">
  225. <img src="@/assets/chat/user/admin.png" v-else>
  226. </div>
  227. </div>
  228. <!--名片 对方-->
  229. <div class="otherUserMessage" v-if="item.action=='recieved'&&Number(item.msg_type)==2">
  230. <div class="otherUserIcon">
  231. <img :src="item.receiver_avatar" v-if="item.receiver_avatar!=null&&item.receiver_avatar!=''">
  232. <img src="@/assets/chat/user/admin.png" v-else>
  233. </div>
  234. <div class="otherUserMessageText" @click="addFriend(item.content.split(',')[2])">
  235. <div class="messageTypeCard">
  236. <div class="messageTypeCardTop">
  237. <div class="messageTypeCardIcon">
  238. <!-- <img :src="item.content.split(',')[0]"> -->
  239. <img src="@/assets/chat/user/user.png">
  240. </div>
  241. <div class="messageTypeCardName">{{item.content.split(',')[1]}}</div>
  242. </div>
  243. <div class="messageTypeCardText">
  244. 分享个人名片
  245. </div>
  246. </div>
  247. </div>
  248. </div>
  249. <!--邀请加群 我-->
  250. <div class="meUserMessage" v-if="item.action=='said'&&Number(item.msg_type)==6">
  251. <div class="meUserMessageText">
  252. <div class="messageGroupInvite" @click="openGroupInviteWindow(item)">
  253. <div class="messageGroupInviteTop">
  254. <div class="messageGroupInviteIcon">
  255. <img src="@/assets/chat/user/group.jpg">
  256. </div>
  257. <div class="messageGroupInfoText">
  258. <div class="messageGroupInfoTextTitle">邀请你加入群聊</div>
  259. <div class="messageGroupInfoTextTxt">{{item.content.split(',')[0]}}</div>
  260. </div>
  261. </div>
  262. <div class="messageGroupInviteText">
  263. 点击加入
  264. </div>
  265. </div>
  266. </div>
  267. <div class="meUserIcon">
  268. <img :src="item.user_avatar" v-if="item.user_avatar!=null&&item.user_avatar!=''">
  269. <img src="@/assets/chat/user/admin.png" v-else>
  270. </div>
  271. </div>
  272. <!--邀请加群 对方-->
  273. <div class="otherUserMessage" v-if="item.action=='recieved'&&Number(item.msg_type)==6">
  274. <div class="otherUserIcon">
  275. <img :src="item.receiver_avatar" v-if="item.receiver_avatar!=null&&item.receiver_avatar!=''">
  276. <img src="@/assets/chat/user/admin.png" v-else>
  277. </div>
  278. <div class="otherUserMessageText">
  279. <div class="messageGroupInvite" @click="openGroupInviteWindow">
  280. <div class="messageGroupInviteTop">
  281. <div class="messageGroupInviteIcon">
  282. <img src="@/assets/chat/user/group.jpg">
  283. </div>
  284. <div class="messageGroupInfoText">
  285. <div class="messageGroupInfoTextTitle">邀请你加入群聊</div>
  286. <div class="messageGroupInfoTextTxt">{{item.content.split(',')[0]}}</div>
  287. </div>
  288. </div>
  289. <div class="messageGroupInviteText">
  290. 点击加入
  291. </div>
  292. </div>
  293. </div>
  294. </div>
  295. </div>
  296. <!-- <div class="newUserStatus">
  297. <div class="newUserStatusText">
  298. <span>"</span>
  299. <span class="newUserStatusTextName">新用户新用户新用户新用户</span>
  300. <span>"加入了群聊</span>
  301. </div>
  302. </div> -->
  303. </div>
  304. <div class="sendMessageBox">
  305. <div class="sendMessageTools">
  306. <!--上传文件 start-->
  307. <div class="toolsBigBox">
  308. <div class="toolsBox">
  309. <el-upload class="avatar-uploader" action="#" :show-file-list="false" :before-upload="beforeImgUpload">
  310. <img src="@/assets/chat/send_img.png">
  311. </el-upload>
  312. <el-upload class="avatar-uploader" action="#" :show-file-list="false" :before-upload="beforeFileUpload">
  313. <img src="@/assets/chat/send_file.png">
  314. </el-upload>
  315. <img src="@/assets/chat/send_message.png" @click="fileWindowStatus=true">
  316. </div>
  317. </div>
  318. <div class="fileBox" v-if="sendMessage.img.imgUrl!=''">
  319. <img :src="sendMessage.img.imgUrl">
  320. <div class="fileBoxText">{{ sendMessage.img.oldFileName }}</div>
  321. <div @click="deFileUpload"><i class="el-icon-close"></i></div>
  322. </div>
  323. <div class="fileBox" v-if="sendMessage.file.fileUrl!=''">
  324. <img src="@/assets/chat/file.png">
  325. <div class="fileBoxText">{{ sendMessage.file.oldFileName }}</div>
  326. <div @click="deFileUpload"><i class="el-icon-close"></i></div>
  327. </div>
  328. <!--上传文件 end-->
  329. </div>
  330. <div class="sendMessageInput">
  331. <el-input
  332. type="textarea"
  333. placeholder="请输入内容"
  334. v-model="userMessage"
  335. :rows="4"
  336. resize="none"
  337. maxlength="200"
  338. @keyup.enter.native="sendUserMessage"
  339. >
  340. </el-input>
  341. </div>
  342. <div class="sendMessageButton">
  343. <el-button v-if="sendMessage.img.imgUrl!=''||sendMessage.file.fileUrl!=''" type="primary" size="medium" @click="sendUserMessageToFile">发送文件 <i class="el-icon-position"></i></el-button>
  344. <el-button v-else type="primary" size="medium" @click="sendUserMessage">发送 <i class="el-icon-position"></i></el-button>
  345. </div>
  346. </div>
  347. <!--右侧菜单 start------------------------------------------------------------>
  348. <div class="rightSlideBox" v-if="rightSlideBoxShow">
  349. <!--关闭按钮-->
  350. <div class="rightSlideBoxClose">
  351. <div class="rightSlideBoxCloseTitle">群设置</div>
  352. <div @click="openGroupSystem" class="rightSlideBoxCloseIcon">
  353. <i class="el-icon-close"></i>
  354. </div>
  355. </div>
  356. <!--2216-->
  357. <div class="rightSlideSearch">
  358. <div class="searchBox">
  359. <el-input
  360. placeholder="请输入内容"
  361. prefix-icon="el-icon-search"
  362. v-model="searchUser"
  363. @keyup.enter.native="rightSearchUser"
  364. >
  365. </el-input>
  366. </div>
  367. <!--弹出框-->
  368. <div class="searchFriendBox" v-if="groupRightSearchWindow">
  369. <div class="searchFriendClose">
  370. <div @click="closeRightSearchUser" class="rightSlideBoxCloseIcon">
  371. <i class="el-icon-close"></i>
  372. </div>
  373. </div>
  374. <div class="searchFriendItem">
  375. <div class="searchFriendAvatar">
  376. <img :src="groupRightUserInfo.avatar" v-if="groupRightUserInfo.avatar!=null&&groupRightUserInfo.avatar!=''">
  377. <img src="@/assets/chat/user/admin.png" v-else>
  378. </div>
  379. <div class="searchFriendInfo">
  380. <div class="searchFriendName">
  381. <div class="searchFriendNameText">{{groupRightUserInfo.user_name}}</div>
  382. </div>
  383. <div class="searchFriendPhone">账号:{{groupRightUserInfo.user_name}}</div>
  384. </div>
  385. </div>
  386. <div class="searchFriendButton">
  387. <el-button type="primary" v-if="groupRightUserInfo.isFriend==true" @click="searchConversationIfCreate(groupRightUserInfo.user_id)">发送消息</el-button>
  388. <el-button type="primary" v-if="groupRightUserInfo.isFriend==false&&Number(groupRightUserInfo.user_id)!=Number(myUserId)" @click="addFriend(groupRightUserInfo.user_id)">添加好友</el-button>
  389. <el-button type="primary" v-if="groupRightUserInfo.isFriend==false&&Number(groupRightUserInfo.user_id)==Number(myUserId)" disabled>添加好友</el-button>
  390. </div>
  391. </div>
  392. </div>
  393. <div class="rightSlideUserBox">
  394. <div class="rightSlideUserItem rightEditUserItem" @click="editGroupMember">
  395. <div class="rightSlideUserItemIcon">
  396. <div class="addUserIcon">
  397. <i class="el-icon-user-solid"></i>
  398. </div>
  399. </div>
  400. <div class="rightSlideUserItemName">
  401. 编辑成员
  402. </div>
  403. </div>
  404. <div class="rightSlideUserItem" v-for="item in groupUserList" :key="item.user_id">
  405. <div class="rightSlideUserItemIcon">
  406. <span class="el-dropdown-link">
  407. <img :src="item.avatar" v-if="item.avatar!=null&&item.avatar!=''">
  408. <img src="@/assets/chat/user/admin.png" v-else>
  409. </span>
  410. </div>
  411. <div class="rightSlideUserItemName">
  412. <span v-if="item.user_name!=null">{{item.user_name}}</span>
  413. <span v-else>未知用户</span>
  414. </div>
  415. <!-- <div class="rightSlideUserItemMore">
  416. <div class="rightSlideUserItemMoreMain">
  417. <div class="rightSlideUserItemMoreMainIcon">
  418. <img src="@/assets/chat/user/user.png">
  419. </div>
  420. <div class="rightSlideUserItemMoreMainInfo">
  421. <div class="rightSlideUserItemMoreMainInfoTop">
  422. <div class="rightSlideUserItemMoreUserName">
  423. <div>用户名</div>
  424. <div class="rightSlideUserItemMoreUserMore">
  425. <img src="@/assets/chat/boy.png">
  426. </div>
  427. </div>
  428. <div class="rightSlideUserItemMoreUserMoreIcon">
  429. <img src="@/assets/chat/fi_more.png">
  430. </div>
  431. </div>
  432. <div class="rightSlideUserItemMoreNumber">
  433. 账号:15210211200
  434. </div>
  435. </div>
  436. </div>
  437. <div class="rightSlideUserItemMoreLine">
  438. <div class="rightSlideUserItemMoreLineItem">
  439. <div class="rightSlideUserItemMoreTitle">备注</div>
  440. <div class="rightSlideUserItemMoreText">
  441. 用户名
  442. <i class="el-icon-edit"></i>
  443. </div>
  444. </div>
  445. <div class="rightSlideUserItemMoreLineItem">
  446. <div class="rightSlideUserItemMoreTitle">共同群聊</div>
  447. <div class="rightSlideUserItemMoreText">0个</div>
  448. </div>
  449. <div class="rightSlideUserItemMoreLineItem">
  450. <div class="rightSlideUserItemMoreTitle">添加方式</div>
  451. <div class="rightSlideUserItemMoreText">通过账号添加</div>
  452. </div>
  453. <div class="rightSlideUserItemMoreLineButton">
  454. <div class="rightSlideUserItemMoreLineGroup">
  455. <img src="@/assets/chat/sendmessage.png">
  456. <div>发消息</div>
  457. </div>
  458. </div>
  459. </div>
  460. </div> -->
  461. </div>
  462. </div>
  463. <!-- <div class="rightSlideMore">
  464. 显示更多 <i class="el-icon-arrow-down"></i>
  465. </div> -->
  466. <div class="rightLineBorder"></div>
  467. <!--聊天记录 start------------------------------------------------------------>
  468. <div class="rightSlideFunction">
  469. <div class="rightSlideFunctionItem" @click="fileWindowStatus=true">
  470. <div class="rightSlideFunctionItemText">聊天记录</div>
  471. <div class="rightSlideFunctionItemIcon">
  472. <img src="@/assets/chat/arrow_right.png" alt="">
  473. </div>
  474. </div>
  475. <!-- <div class="rightSlideFunction">
  476. <div class="rightSlideFunctionItem">
  477. <div class="rightSlideFunctionItemText">设置为置顶</div>
  478. <div class="rightSlideFunctionItemIcon">
  479. <el-switch
  480. v-model="ifTop"
  481. active-color="#5570F1"
  482. inactive-color="#BBC5CB">
  483. </el-switch>
  484. </div>
  485. </div>
  486. </div> -->
  487. </div>
  488. <!--聊天记录 end------------------------------------------------------------>
  489. <!--群聊设置 start------------------------------------------------------------>
  490. <div class="rightSlideFunction">
  491. <div class="groupSystem">
  492. <div class="groupChatSystem">
  493. <div class="groupChatTitle">群聊名称</div>
  494. <div class="groupChatText" @click="editGroupNameWindow=true">
  495. {{this.messageTitle}}
  496. </div>
  497. </div>
  498. <div class="groupChatSystem">
  499. <div class="groupChatTitle">群公告</div>
  500. <div class="groupChatText" v-if="this.groupProfile!=''" @click="editGroupNoticeWindow=true">
  501. {{this.groupProfile}}
  502. </div>
  503. <div class="groupChatText" v-else @click="editGroupNoticeWindow=true">
  504. 暂无群公告
  505. </div>
  506. </div>
  507. <!-- <div class="groupChatSystem">
  508. <div class="groupChatTitle">我在本群的昵称</div>
  509. <div class="groupChatText">
  510. 仅群主可修改
  511. </div>
  512. </div> -->
  513. </div>
  514. <!-- <div class="rightSlideFunction">
  515. <div class="rightSlideFunctionItem">
  516. <div class="rightSlideFunctionItemText">显示群成员昵称</div>
  517. <div class="rightSlideFunctionItemIcon">
  518. <el-switch
  519. v-model="ifTop"
  520. active-color="#5570F1"
  521. inactive-color="#BBC5CB">
  522. </el-switch>
  523. </div>
  524. </div>
  525. </div> -->
  526. </div>
  527. <!--群聊设置 end------------------------------------------------------------>
  528. <div class="rightSlideFooterBox">
  529. <div @click="openShareMyGroup">分享群</div>
  530. <div @click="delGroup" v-if="creatorId==myUserId">解散群</div>
  531. <div @click="closeGroup" v-else>退出群</div>
  532. <div @click="openGroupSystem">关闭</div>
  533. </div>
  534. <!-- <div class="rightSlideFooter isShare" @click="openShareMyGroup">
  535. 分享群聊
  536. </div>
  537. <div class="rightSlideFooter" @click="delGroup" v-if="creatorId==myUserId">
  538. 解散群聊
  539. </div>
  540. <div class="rightSlideFooter" @click="closeGroup" v-else>
  541. 退出群聊
  542. </div>
  543. <div class="rightSlideFooter isLast" @click="openGroupSystem">
  544. 关闭
  545. </div> -->
  546. </div>
  547. </div>
  548. <!--右侧菜单 end------------------------------------------>
  549. </div>
  550. </div>
  551. <!--大厅 end------------------------------------------------------------>
  552. <!--添加群组弹出框 start------------------------------------------------------------>
  553. <el-dialog :visible.sync="groupWindowStatus" :close-on-click-modal="false" width="1028px">
  554. <div class="searchWindow">
  555. <div class="searchWindowLeft">
  556. <div class="searchUserWindowBox">
  557. <el-input
  558. placeholder="请输入内容"
  559. prefix-icon="el-icon-search"
  560. v-model="searchFriendGroup"
  561. @keyup.enter.native="searchFriendGroupUser"
  562. >
  563. </el-input>
  564. <!--搜索用户弹出框 start------------------------------------------------------------>
  565. <div class="searchFriendBox" v-if="groupFriendsWindowStatus">
  566. <div class="searchFriendClose">
  567. <div @click="closeSearchFriendWindow" class="rightSlideBoxCloseIcon">
  568. <i class="el-icon-close"></i>
  569. </div>
  570. </div>
  571. <div class="searchFriendItem">
  572. <div class="searchFriendAvatar">
  573. <img :src="groupFriendSearchUser.avatar" v-if="groupFriendSearchUser.avatar!=null&&groupFriendSearchUser.avatar!=''">
  574. <img src="@/assets/chat/user/admin.png" v-else>
  575. </div>
  576. <div class="searchFriendInfo">
  577. <div class="searchFriendName">
  578. <div class="searchFriendNameText">{{groupFriendSearchUser.user_name}}</div>
  579. </div>
  580. <div class="searchFriendPhone">账号:{{groupFriendSearchUser.user_name}}</div>
  581. </div>
  582. </div>
  583. <div class="searchFriendButton">
  584. <el-button v-if="groupFriendSearchUser.status==false" type="primary" @click="addSearchFriendWindow">添加</el-button>
  585. <el-button v-else type="warning" @click="addSearchFriendWindow">移除</el-button>
  586. </div>
  587. </div>
  588. <!--搜索用户弹出框 end------------------------------------------------------------>
  589. </div>
  590. <!--搜索用户 start------------------------------------------------------------>
  591. <div class="searchUserBox">
  592. <!-- <div class="searchNameEnglish">A</div> -->
  593. <div class="searchUserItem" v-for="item in friendsList" :key="item.id">
  594. <el-checkbox v-model="item.status"></el-checkbox>
  595. <img :src="item.avatar" v-if="item.avatar!=null&&item.avatar!=''">
  596. <img src="@/assets/chat/user/admin.png" v-else>
  597. <div class="searchUserName" v-if="item.remark!=null">{{item.remark}}</div>
  598. <div class="searchUserName" v-else>{{item.user_name}}</div>
  599. </div>
  600. </div>
  601. <!--搜索用户 end------------------------------------------------------------>
  602. </div>
  603. <div class="searchWindowRight">
  604. <div class="searchWindowRightTop">
  605. <div class="searchWindowRightTitle">创建群聊</div>
  606. <div class="searchWindowRightNum">已选择{{friendsList.filter(item=>item.status).length}}个联系人</div>
  607. </div>
  608. <div class="searchWindowUserList">
  609. <div class="searchWindowUserItem" v-for="item in friendsList" :key="item.id" v-if="item.status==true">
  610. <div class="searchWindowUserIcon">
  611. <img :src="item.avatar" v-if="item.avatar!=null&&item.avatar!=''">
  612. <img src="@/assets/chat/user/admin.png" v-else>
  613. <div class="searchWindowDeleteUser" @click="cancelSelectFriends(item.id)">
  614. <i class="el-icon-close"></i>
  615. </div>
  616. </div>
  617. <div class="searchWindowUserName" v-if="item.remark!=null">{{item.remark}}</div>
  618. <div class="searchWindowUserName" v-else>{{item.user_name}}</div>
  619. </div>
  620. </div>
  621. <!--分享名片 start------------------------------------------------------------>
  622. <!-- <div class="shareCardBox">
  623. <div class="shareCardTitle">[名片]用户名称</div>
  624. <div class="shareCardInput">
  625. <el-input v-model="userCardMessage" placeholder="给用户留言"></el-input>
  626. </div>
  627. </div> -->
  628. <!--分享名片 end------------------------------------------------------------>
  629. <div class="searchWindowFooter">
  630. <el-button type="info" @click="clearCreatGroupWindow">取消</el-button>
  631. <el-button type="primary" @click="createForGroup" :disabled="friendsList.filter(item=>item.status).length<2">完成</el-button>
  632. </div>
  633. </div>
  634. </div>
  635. </el-dialog>
  636. <!--添加群组弹出框 end------------------------------------------------------------>
  637. <!--聊天记录弹出框 start------------------------------------------------------------>
  638. <el-dialog :visible.sync="fileWindowStatus" title="聊天记录" :close-on-click-modal="false" width="757px">
  639. <div class="fileWindow">
  640. <div class="fileWindowHeader">
  641. <el-input
  642. placeholder="请输入内容"
  643. prefix-icon="el-icon-search"
  644. v-model="searchChatRecords"
  645. @keyup.enter.native="searchChatRecordsUser"
  646. :disabled="activeName !== 'all'"
  647. >
  648. </el-input>
  649. </div>
  650. <!--聊天记录选项卡 start------------------------------------------------------------>
  651. <el-tabs v-model="activeName">
  652. <el-tab-pane label="全部" name="all">
  653. <!-- <div class="fileWindowMessageTime">2024-11-10</div> -->
  654. <div class="fileWindowMessageScrollBox" ref="fileWindowMessageScrollBox">
  655. <div class="fileWindowMessageItemBox" v-for="item in chatrecords">
  656. <!--文字消息 start-->
  657. <div v-if="Number(item.msg_type)==1" class="historicalMessageBox">
  658. <div class="fileWindowMessageItemIcon">
  659. <img :src="item.receiver_avatar" v-if="item.receiver_avatar!=null&&item.receiver_avatar!=''">
  660. <img src="@/assets/chat/user/admin.png" v-else>
  661. </div>
  662. <div class="fileWindowMessageItem">
  663. <div class="fileWindowMessageItemInfo">
  664. <div class="fileWindowMessageItemName">{{item.receiver_id_name}}</div>
  665. <div class="fileWindowMessageItemTime">{{item.updated_at}}</div>
  666. </div>
  667. <div class="fileWindowMessageItemText">{{item.content}}</div>
  668. </div>
  669. </div>
  670. <!--文字消息 end-->
  671. <!--图片消息 start-->
  672. <div v-if="Number(item.msg_type)==2" class="historicalMessageBox">
  673. <div class="fileWindowMessageItemIcon">
  674. <img :src="item.receiver_avatar" v-if="item.receiver_avatar!=null&&item.receiver_avatar!=''">
  675. <img src="@/assets/chat/user/admin.png" v-else>
  676. </div>
  677. <div class="fileWindowMessageItem">
  678. <div class="fileWindowMessageItemInfo">
  679. <div class="fileWindowMessageItemName">{{item.receiver_id_name}}</div>
  680. <div class="fileWindowMessageItemTime">{{item.updated_at}}</div>
  681. </div>
  682. <div class="fileWindowMessageItemText">
  683. <img :src="item.content" class="fileWindowMessageItemImage">
  684. </div>
  685. </div>
  686. </div>
  687. <!--图片消息 end-->
  688. <!--文件消息 start-->
  689. <div v-if="Number(item.msg_type)==3" class="historicalMessageBox">
  690. <div class="fileWindowMessageItemIcon">
  691. <img :src="item.receiver_avatar" v-if="item.receiver_avatar!=null&&item.receiver_avatar!=''">
  692. <img src="@/assets/chat/user/admin.png" v-else>
  693. </div>
  694. <div class="fileWindowMessageItem">
  695. <div class="fileWindowMessageItemInfo">
  696. <div class="fileWindowMessageItemName">{{item.receiver_id_name}}</div>
  697. <div class="fileWindowMessageItemTime">{{item.updated_at}}</div>
  698. </div>
  699. <div class="fileWindowMessageItemText">
  700. <div class="messageTypeFile">
  701. <div class="messageTypeFileTop">
  702. <div class="messageTypeFileInfo">
  703. <div class="messageTypeFileTitle">
  704. {{ JSON.parse(item.content).oldFileName }}
  705. </div>
  706. <div class="messageTypeFileIcon">
  707. <img src="@/assets/chat/file.png"/>
  708. </div>
  709. </div>
  710. <!-- <div class="messageTypeFileSize">20kb</div> -->
  711. </div>
  712. <div class="messageTypeFileLogo">恒星管理平台保护您的电脑安全</div>
  713. </div>
  714. </div>
  715. </div>
  716. </div>
  717. <!--文件消息 end-->
  718. </div>
  719. </div>
  720. </el-tab-pane>
  721. <el-tab-pane label="文件" name="file">
  722. <div class="fileWindowMessageItemBox" v-for="item in chatrecords">
  723. <!--文件消息 start-->
  724. <div v-if="Number(item.msg_type)==3" class="historicalMessageBox">
  725. <div class="fileWindowMessageItemIcon">
  726. <img :src="item.receiver_avatar" v-if="item.receiver_avatar!=null&&item.receiver_avatar!=''">
  727. <img src="@/assets/chat/user/admin.png" v-else>
  728. </div>
  729. <div class="fileWindowMessageItem">
  730. <div class="fileWindowMessageItemInfo">
  731. <div class="fileWindowMessageItemName">{{item.receiver_id_name}}</div>
  732. <div class="fileWindowMessageItemTime">{{item.updated_at}}</div>
  733. </div>
  734. <div class="fileWindowMessageItemText">
  735. <div class="messageTypeFile">
  736. <div class="messageTypeFileTop">
  737. <div class="messageTypeFileInfo">
  738. <div class="messageTypeFileTitle">
  739. {{ JSON.parse(item.content).oldFileName }}
  740. </div>
  741. <div class="messageTypeFileIcon">
  742. <img src="@/assets/chat/file.png"/>
  743. </div>
  744. </div>
  745. <!-- <div class="messageTypeFileSize">20kb</div> -->
  746. </div>
  747. <div class="messageTypeFileLogo">恒星管理平台保护您的电脑安全</div>
  748. </div>
  749. </div>
  750. </div>
  751. </div>
  752. <!--文件消息 end-->
  753. </div>
  754. <!--图片消息 end-->
  755. <div v-if="!chatrecords.some(item => Number(item.msg_type) === 3)" class="fileWindowNoMessage">暂无文件</div>
  756. </el-tab-pane>
  757. <el-tab-pane label="图片" name="img">
  758. <div class="fileWindowMessageItemBox" v-for="item in chatrecords">
  759. <!--图片消息 start-->
  760. <div v-if="Number(item.msg_type)==2" class="historicalMessageBox">
  761. <div class="fileWindowMessageItemIcon">
  762. <img :src="item.receiver_avatar" v-if="item.receiver_avatar!=null&&item.receiver_avatar!=''">
  763. <img src="@/assets/chat/user/admin.png" v-else>
  764. </div>
  765. <div class="fileWindowMessageItem">
  766. <div class="fileWindowMessageItemInfo">
  767. <div class="fileWindowMessageItemName">{{item.receiver_id_name}}</div>
  768. <div class="fileWindowMessageItemTime">{{item.updated_at}}</div>
  769. </div>
  770. <div class="fileWindowMessageItemText">
  771. <img :src="item.content" class="fileWindowMessageItemImage">
  772. </div>
  773. </div>
  774. </div>
  775. </div>
  776. <!--图片消息 end-->
  777. <div v-if="!chatrecords.some(item => Number(item.msg_type) === 2)" class="fileWindowNoMessage">暂无图片</div>
  778. </el-tab-pane>
  779. <!-- <el-tab-pane label="日期" name="date">
  780. <div class="fileWindowDateBox">
  781. <el-date-picker
  782. v-model="time"
  783. type="date"
  784. placeholder="选择日期">
  785. </el-date-picker>
  786. <el-button type="primary" class="fileWindowDateButton">搜索</el-button>
  787. </div>
  788. </el-tab-pane>
  789. <el-tab-pane label="群成员" name="groupUser">
  790. <div class="fileWindowGroupMain">
  791. <div class="fileWindowGroupUserLeft">
  792. <div class="fileWindowMessageTime">2024-11-10</div>
  793. <div class="fileWindowMessageItemBox">
  794. <div class="fileWindowMessageItemIcon">
  795. <img src="@/assets/chat/user/user.png" alt="">
  796. </div>
  797. <div class="fileWindowMessageItem">
  798. <div class="fileWindowMessageItemInfo">
  799. <div class="fileWindowMessageItemName">用户名称</div>
  800. <div class="fileWindowMessageItemTime">12:40</div>
  801. </div>
  802. <div class="fileWindowMessageItemText">用用户消息用户消息用户消息用户消息用户消息用户消息用户消息用户消息用户消息用户消息户消息用户消息用户消息用户消息用户消息用户消息用户消息用户消息用户消息用户消息用户消息用户消息用户消息用户消息用户消息</div>
  803. </div>
  804. </div>
  805. </div>
  806. <div class="fileWindowGroupUserRight">
  807. <div class="fileWindowGroupUserBox">
  808. <el-input placeholder="请输入内容" prefix-icon="el-icon-search"></el-input>
  809. <div class="searchUserBox">
  810. <div class="searchNameEnglish">A</div>
  811. <div class="searchUserItem">
  812. <img src="@/assets/chat/user/user.png">
  813. <div class="searchUserName">A农贸站群长</div>
  814. </div>
  815. <div class="searchNameEnglish">B</div>
  816. <div class="searchUserItem">
  817. <img src="@/assets/chat/user/user.png">
  818. <div class="searchUserName">B农贸站群长</div>
  819. </div>
  820. </div>
  821. </div>
  822. </div>
  823. </div>
  824. </el-tab-pane> -->
  825. </el-tabs>
  826. <!--聊天记录选项卡 end------------------------------------------------------------>
  827. </div>
  828. </el-dialog>
  829. <!--聊天记录弹出框 end------------------------------------------------------------>
  830. <!--添加用户弹出框 start------------------------------------------------------------>
  831. <el-dialog :visible.sync="addUserWindowStatus" title="添加用户" :close-on-click-modal="false" width="420px">
  832. <div class="messageFormBox">
  833. <div class="messageFormTitle">发送添加朋友申请</div>
  834. <div class="messageFormInput">
  835. <el-input v-model="form.addUserForm.notes" placeholder="请输入"></el-input>
  836. </div>
  837. <div class="messageFormTitle">备注名</div>
  838. <div class="messageFormInput">
  839. <el-input v-model="form.addUserForm.nickname" placeholder="请输入"></el-input>
  840. </div>
  841. <div class="footerButtonBox">
  842. <el-button type="info">取消</el-button>
  843. <el-button type="primary">确定</el-button>
  844. </div>
  845. </div>
  846. </el-dialog>
  847. <!--添加用户弹出框 end------------------------------------------------------------>
  848. <!--群公告弹出框 start------------------------------------------------------------>
  849. <el-dialog :visible.sync="editGroupNoticeWindow" title="编辑群公告" :close-on-click-modal="false" width="420px">
  850. <div>
  851. <div>
  852. <el-input type="textarea" resize="none" v-model="groupProfile" placeholder="请输入"></el-input>
  853. </div>
  854. <div class="footerButtonBox">
  855. <el-button type="info" @click="editGroupNoticeWindow=false">取消</el-button>
  856. <el-button type="primary" @click="editGroupNotice">确定</el-button>
  857. </div>
  858. </div>
  859. </el-dialog>
  860. <!--群公告弹出框 end------------------------------------------------------------>
  861. <!--群名称弹出框 start------------------------------------------------------------>
  862. <el-dialog :visible.sync="editGroupNameWindow" title="编辑群名称" :close-on-click-modal="false" width="420px">
  863. <div>
  864. <div>
  865. <el-input type="textarea" resize="none" v-model="messageTitle" placeholder="请输入"></el-input>
  866. </div>
  867. <div class="footerButtonBox">
  868. <el-button type="info" @click="editGroupNameWindow=false">取消</el-button>
  869. <el-button type="primary" @click="editGroupName">确定</el-button>
  870. </div>
  871. </div>
  872. </el-dialog>
  873. <!--群名称弹出框 end------------------------------------------------------------>
  874. <!--加入群聊弹出框 start------------------------------------------------------------>
  875. <el-dialog :visible.sync="addGroupWindow" title="加入群聊" :close-on-click-modal="false" width="420px">
  876. <div class="addGroupWindow">
  877. <div class="addGroupWindowImg">
  878. <img src="@/assets/chat/user/group.jpg" alt="">
  879. </div>
  880. <div class="addGroupWindowTitle">{{groupInviteInfo.group_name}}</div>
  881. <div class="addGroupWindowText">加入"{{groupInviteInfo.group_name}}"群聊,点击可查看该群消息</div>
  882. <div class="footerButtonBox">
  883. <el-button type="info" @click="addGroupWindow = false">取消</el-button>
  884. <el-button type="primary" @click="joinGroup">确定</el-button>
  885. </div>
  886. </div>
  887. </el-dialog>
  888. <!--加入群聊弹出框 end------------------------------------------------------------>
  889. <!--编辑群成员弹出框 start------------------------------------------------------------>
  890. <!--编辑时 左侧显示的是好友列表 右侧显示的是群成员-->
  891. <el-dialog :visible.sync="groupEditWindowStatus" :close-on-click-modal="false" width="1028px" @closed="cancelEditGroupMember">
  892. <div class="searchWindow">
  893. <div class="searchWindowLeft">
  894. <div class="searchUserWindowBox">
  895. <el-input
  896. placeholder="请输入内容"
  897. prefix-icon="el-icon-search"
  898. v-model="searchGroup"
  899. @keyup.enter.native="searchGroupUser">
  900. </el-input>
  901. <!--搜索用户弹出框 start------------------------------------------------------------>
  902. <div class="searchFriendBox" v-if="groupEditMainWindowStatus">
  903. <div class="searchFriendClose">
  904. <div @click="closeAddGroupUserWindow" class="rightSlideBoxCloseIcon">
  905. <i class="el-icon-close"></i>
  906. </div>
  907. </div>
  908. <div class="searchFriendItem">
  909. <div class="searchFriendAvatar">
  910. <img :src="groupSearchUser.avatar" v-if="groupSearchUser.avatar!=null&&groupSearchUser.avatar!=''">
  911. <img src="@/assets/chat/user/admin.png" v-else>
  912. </div>
  913. <div class="searchFriendInfo">
  914. <div class="searchFriendName">
  915. <div class="searchFriendNameText">{{groupSearchUser.user_name}}</div>
  916. </div>
  917. <div class="searchFriendPhone">账号:{{groupSearchUser.user_name}}</div>
  918. </div>
  919. </div>
  920. <div class="searchFriendButton">
  921. <el-button v-if="groupSearchUser.status==false" type="primary" @click="addGroupUser(groupSearchUser)">添加</el-button>
  922. <el-button v-else type="warning" @click="addGroupUser(groupSearchUser)">移除</el-button>
  923. </div>
  924. </div>
  925. <!--搜索用户弹出框 end------------------------------------------------------------>
  926. </div>
  927. <!--通讯录列表 start------------------------------------------------------------>
  928. <div class="searchUserBox">
  929. <!-- <div class="searchNameEnglish">A</div> -->
  930. <div class="searchUserItem" v-for="(item,index) in friendsList" :key="index">
  931. <el-checkbox v-model="item.status" @change="changeSelectFriends(item)"></el-checkbox>
  932. <img :src="item.avatar" v-if="item.avatar!=null&&item.avatar!=''">
  933. <img src="@/assets/chat/user/admin.png" v-else>
  934. <div class="searchUserName" v-if="item.remark!=null">{{item.remark}}</div>
  935. <div class="searchUserName" v-else>
  936. {{item.user_name}}
  937. </div>
  938. </div>
  939. </div>
  940. <!--通讯录列表 end------------------------------------------------------------>
  941. </div>
  942. <div class="searchWindowRight">
  943. <div class="searchWindowRightTop">
  944. <div class="searchWindowRightTitle">编辑群聊</div>
  945. <div class="searchWindowRightNum">已选择{{groupUserList.length}}个联系人</div>
  946. </div>
  947. <div class="searchWindowUserList">
  948. <div class="searchWindowUserItem" v-for="(item,index) in groupUserList" :key="index" v-if="item.status==true">
  949. <div class="searchWindowUserIcon">
  950. <img :src="item.avatar" v-if="item.avatar!=null&&item.avatar!=''">
  951. <img src="@/assets/chat/user/admin.png" v-else>
  952. <div class="searchWindowDeleteUser" @click="editRemoveGroupUser(item.user_id)" v-if="Number(creatorId)==Number(myUserId)&&item.user_id!=myUserId">
  953. <i class="el-icon-close"></i>
  954. </div>
  955. </div>
  956. <div class="searchWindowUserName" v-if="item.remark!=null">{{item.remark}}</div>
  957. <div class="searchWindowUserName" v-else-if="item.user_name!=null">{{item.user_name}}</div>
  958. <div class="searchWindowUserName" v-else>未知用户</div>
  959. </div>
  960. </div>
  961. <div class="searchWindowFooter">
  962. <el-button type="info" @click="cancelEditGroupMember">取消</el-button>
  963. <el-button type="primary" @click="saveEditGroupMember" :disabled="groupUserList.filter(item=>item.status).length<=2">完成</el-button>
  964. </div>
  965. </div>
  966. </div>
  967. </el-dialog>
  968. <!--编辑群成员弹出框 end------------------------------------------------------------>
  969. <!--发送好友申请弹出框 start------------------------------------------------------------>
  970. <el-dialog :visible.sync="addFriendWindowStatus" title="朋友申请" :close-on-click-modal="false" width="420px">
  971. <div>
  972. <div>
  973. <el-form :model="form" ref="form" autocomplete="off" label-position="left">
  974. <div class="formDiv">
  975. <el-form-item label="备注名" :label-width="formLabelWidth" class="custom-align-right">
  976. <el-input v-model="addform.remark" autocomplete="off" placeholder="请输入备注名.."></el-input>
  977. </el-form-item>
  978. </div>
  979. </el-form>
  980. </div>
  981. <div class="footerButtonBox">
  982. <el-button type="info" @click="addFriendWindowStatus=false">取消</el-button>
  983. <el-button type="primary" @click="addMyFriend">确定</el-button>
  984. </div>
  985. </div>
  986. </el-dialog>
  987. <!--发送好友申请弹出框 end------------------------------------------------------------>
  988. <!--分享名片 start------------------------------------------------------------>
  989. <el-dialog :visible.sync="userCardWindowStatus" title="分享名片" :close-on-click-modal="false" width="420px">
  990. <div>
  991. <div class="shareCardWindowBox">
  992. <el-tabs v-model="shareTableActive" type="card" @tab-click="handleClickShareCard">
  993. <el-tab-pane label="分享给朋友" name="friend">
  994. <div class="shareCardWindowBoxMain">
  995. <div v-for="item in friendsList" :key="item.id" class="shareCardRadioBox" >
  996. <el-radio :label="item.friend_id" v-model="useShareUserId">
  997. <input type="hidden" :value="item.friend_id">
  998. </el-radio>
  999. <div class="shareCardItem">
  1000. <img :src="item.avatar" v-if="item.avatar!=null&&item.avatar!=''">
  1001. <img src="@/assets/chat/user/admin.png" v-else>
  1002. <div class="shareCardName" v-if="item.remark!=null">{{item.remark}}</div>
  1003. <div class="shareCardName" v-else>{{item.user_name}}</div>
  1004. </div>
  1005. </div>
  1006. </div>
  1007. </el-tab-pane>
  1008. <el-tab-pane label="分享到群聊" name="group">
  1009. <div class="shareCardWindowBoxMain">
  1010. <div v-for="item in groupConversationList" :key="item.receiver_id" class="shareCardRadioBox" >
  1011. <el-radio :label="item.receiver_id" v-model="useShareUserId">
  1012. <input type="hidden" :value="item.receiver_id">
  1013. </el-radio>
  1014. <div class="shareCardItem">
  1015. <img :src="item.avatar" v-if="item.avatar!=null&&item.avatar!=''">
  1016. <img src="@/assets/chat/user/group.jpg" v-else>
  1017. <div class="shareCardName" v-if="item.remark!=null">{{item.remark}}</div>
  1018. <div class="shareCardName" v-else>{{item.name}}</div>
  1019. </div>
  1020. </div>
  1021. </div>
  1022. </el-tab-pane>
  1023. </el-tabs>
  1024. </div>
  1025. <div class="footerButtonBox">
  1026. <el-button type="info" @click="userCardWindowStatus=false">取消</el-button>
  1027. <el-button type="primary" @click="shareCard">确定</el-button>
  1028. </div>
  1029. </div>
  1030. </el-dialog>
  1031. <!--分享名片 end------------------------------------------------------------>
  1032. <!--分享群聊 start------------------------------------------------------------>
  1033. <el-dialog :visible.sync="shareGroupWindowStatus" title="分享群聊" :close-on-click-modal="false" width="420px">
  1034. <div>
  1035. <div class="shareCardWindowBox">
  1036. <el-tabs v-model="shareGroupActive" type="card" @tab-click="handleClickShareGroupCard">
  1037. <el-tab-pane label="分享给朋友" name="friend">
  1038. <div class="shareCardWindowBoxMain">
  1039. <div v-for="item in friendsList" :key="item.id" class="shareCardRadioBox" >
  1040. <el-radio :label="item.friend_id" v-model="shareGroupId">
  1041. <input type="hidden" :value="item.friend_id">
  1042. </el-radio>
  1043. <div class="shareCardItem">
  1044. <img :src="item.avatar" v-if="item.avatar!=null&&item.avatar!=''">
  1045. <img src="@/assets/chat/user/admin.png" v-else>
  1046. <div class="shareCardName" v-if="item.remark!=null">{{item.remark}}</div>
  1047. <div class="shareCardName" v-else>{{item.user_name}}</div>
  1048. </div>
  1049. </div>
  1050. </div>
  1051. </el-tab-pane>
  1052. <el-tab-pane label="分享到群聊" name="group">
  1053. <div class="shareCardWindowBoxMain">
  1054. <div v-for="item in groupConversationList" :key="item.receiver_id" class="shareCardRadioBox" >
  1055. <el-radio :label="item.receiver_id" v-model="shareGroupId">
  1056. <input type="hidden" :value="item.receiver_id">
  1057. </el-radio>
  1058. <div class="shareCardItem">
  1059. <img :src="item.avatar" v-if="item.avatar!=null&&item.avatar!=''">
  1060. <img src="@/assets/chat/user/group.jpg" v-else>
  1061. <div class="shareCardName" v-if="item.remark!=null">{{item.remark}}</div>
  1062. <div class="shareCardName" v-else>{{item.name}}</div>
  1063. </div>
  1064. </div>
  1065. </div>
  1066. </el-tab-pane>
  1067. </el-tabs>
  1068. </div>
  1069. <div class="footerButtonBox">
  1070. <el-button type="info" @click="shareGroupWindowStatus=false">取消</el-button>
  1071. <el-button type="primary" @click="shareMyGroup">确定</el-button>
  1072. </div>
  1073. </div>
  1074. </el-dialog>
  1075. <!--分享群聊 end------------------------------------------------------------>
  1076. <!--放大图片 start------------------------------------------------------------>
  1077. <el-dialog :visible.sync="imgZoomStatus" title="图片详情" :close-on-click-modal="false" width="600px">
  1078. <div>
  1079. <div class="imgZoomBox">
  1080. <img :src="imgZoomUrl">
  1081. </div>
  1082. <div class="footerButtonBox">
  1083. <el-button type="info" @click="imgZoomStatus=false">关闭</el-button>
  1084. </div>
  1085. </div>
  1086. </el-dialog>
  1087. <!--放大图片 end------------------------------------------------------------>
  1088. <!--老刘的代码 start------------------------------------------------------------>
  1089. <!-- <div class="layerBox">
  1090. <el-container style="height: 100vh;">
  1091. <el-aside width="300px" style="background: #f2f2f2;">
  1092. <el-menu>
  1093. <div class="conversation-list">会话记录(100)</div>
  1094. <el-menu-item
  1095. v-for="conversation in conversations"
  1096. :key="conversation.session_id"
  1097. @click="selectConversation(conversation)"
  1098. @contextmenu.prevent="showContextMenu($event, conversation)"
  1099. :class="{ 'is-active': activeConversation && activeConversation.session_id === conversation.session_id }">
  1100. <div v-if="conversation.talk_type==1">
  1101. <el-avatar :src=conversation.user_avatar>{{ conversation.nickname }}</el-avatar> {{ conversation.nickname }}
  1102. </div>
  1103. <div v-if="conversation.talk_type==2">
  1104. <el-avatar :src=conversation.group_avatar>{{ conversation.group_name }}</el-avatar> {{ conversation.group_name }}
  1105. </div>
  1106. </el-menu-item>
  1107. <el-dropdown v-if="contextMenuVisible" :style="{ position: 'absolute', top: contextMenuY + 'px', left: contextMenuX + 'px' }" @command="handleMenuCommand">
  1108. <el-dropdown-menu slot="dropdown">
  1109. <el-dropdown-item command="view">查看</el-dropdown-item>
  1110. <el-dropdown-item command="delete">删除</el-dropdown-item>
  1111. <el-dropdown-item command="edit">编辑</el-dropdown-item>
  1112. </el-dropdown-menu>
  1113. </el-dropdown>
  1114. </el-menu>
  1115. </el-aside>
  1116. <el-container>
  1117. <el-main style="padding: 20px;">
  1118. <div v-if="activeConversation">
  1119. <div v-for="(message, index) in activeConversation.messages" :key="index" class="message">
  1120. <div v-if="message.is_me==1" :class="{'is_me':message.is_me==1}">
  1121. {{ message.content }} <el-avatar :src=message.user_avatar>{{ message.nickname }}</el-avatar>
  1122. </div>
  1123. <div v-else>
  1124. <el-avatar :src=message.user_avatar>{{ message.nickname }}</el-avatar>{{ message.content }}
  1125. </div>
  1126. </div>
  1127. </div>
  1128. <div v-else>
  1129. 请选择一个会话
  1130. </div>
  1131. </el-main>
  1132. <el-footer height="60px" style="padding: 10px; background: #fff;">
  1133. <el-input
  1134. v-model="newMessage"
  1135. placeholder="输入消息..."
  1136. @keyup.enter="sendMessage"
  1137. style="width: calc(100% - 100px); margin-right: 10px;">
  1138. </el-input>
  1139. <el-button @click="sendMessage" type="primary">发送</el-button>
  1140. </el-footer>
  1141. </el-container>
  1142. </el-container>
  1143. </div> -->
  1144. <!--老刘的代码 end------------------------------------------------------------>
  1145. </div>
  1146. </template>
  1147. <script>
  1148. //引入公用样式
  1149. import '@/styles/global.less';
  1150. //引入baseUrl
  1151. import URL from '@/utils/baseUrl';
  1152. //引入组件
  1153. import hallTitle from './components/hallTitle.vue';
  1154. import RingChart from '../dashboard/admin/components/RingChart.vue';
  1155. import { TimeSelect } from 'element-ui';
  1156. //引入socket地址 注意 后续版本将会删除这个请求方式
  1157. import baseUrl from '@/utils/baseUrl';
  1158. export default {
  1159. components: {
  1160. hallTitle
  1161. },
  1162. data() {
  1163. return {
  1164. //1.全局配置 start---------------------------------------->
  1165. myUserId:'',//我的用户id
  1166. tableTitleName:'聊天列表',//左侧菜单标题
  1167. messageTitle:'',//当前的聊天名称
  1168. groupProfile:'',//当前的群公告
  1169. listTimeOut:null,//定时器
  1170. addFriendWindowStatus:false,//添加好友弹出框
  1171. addform:{
  1172. friend_id:'',//好友id
  1173. remark:'',//备注名
  1174. },
  1175. formLabelWidth:'100px',
  1176. imgZoomStatus:false,//图片放大框
  1177. imgZoomUrl:'',//图片放大框的图片地址
  1178. //1.全局配置 end---------------------------------------->
  1179. //2.会话列表 start---------------------------------------->
  1180. hallLeftLoading:false,//左侧加载中
  1181. hallRightLoading:false,//右侧加载中
  1182. conversationList:[],//会话列表
  1183. groupConversationList:[],//群聊会话列表
  1184. selectConversationItem:{},//选择会话
  1185. searchConversationStatus:false,//搜索会话状态
  1186. chatrecords:[],//聊天记录
  1187. ifTop:false,//是否为置顶
  1188. searchConversation:'',//搜索会话
  1189. //2.会话列表 end---------------------------------------->
  1190. //3.聊天记录 start---------------------------------------->
  1191. receiverId:'',//接收消息的id
  1192. receiverType:'',//接收消息的类型 1单聊 2群聊
  1193. ifNoMessage:true,//如果没有选择任何聊天记录
  1194. searchChatRecords:"",//搜索聊天记录
  1195. userMessage:'',//用户发送的消息
  1196. fileWindowStatus:false,//聊天记录弹出框是否显示
  1197. activeName: 'all',//聊天记录选项卡
  1198. time:'',//按照时间搜索
  1199. //3.聊天记录 end---------------------------------------->
  1200. //4.群聊 start---------------------------------------->
  1201. //4.1 创建群聊
  1202. groupWindowStatus:false,//添加聊天群组出框是否显示
  1203. groupFriendsWindowStatus:false,//创建群聊时搜索框
  1204. friendsList:[],//左侧好友列表
  1205. searchFriendGroup:'',//搜索群聊的输入框绑定值
  1206. groupFriendSearchUser:{},//编辑群时搜索群成员 用于显示搜索结果
  1207. //4.2 加入群聊
  1208. addGroupWindow:false,//加入群聊弹出框
  1209. //4.2 编辑群聊
  1210. groupId:'',//当前编辑的群聊的id
  1211. creatorId:'',//群主id
  1212. groupUserList:[],//群成员列表
  1213. groupInfo:{},//群设置信息
  1214. groupSearchUser:{},//编辑群时搜索群成员 用于显示搜索结果
  1215. rightSlideBoxShow:false,//右侧菜单是否显示
  1216. searchGroup:'',//搜索群聊的输入框绑定值
  1217. editGroupNoticeWindow:false,//编辑群公告弹出框
  1218. editGroupNameWindow:false,//编辑群名称弹出框
  1219. groupEditWindowStatus:false,//编辑群成员弹出框
  1220. groupEditMainWindowStatus:false,//编辑弹框中搜索人员
  1221. searchUser:"",//右侧菜单的搜索框
  1222. groupRightUserInfo:{},//直接从右侧群组菜单中搜索成员
  1223. groupRightSearchWindow:false,//右侧群组详情弹出框
  1224. //shareGroupMessage:"",//分享群聊的消息
  1225. shareGroupWindowStatus:false,//分享群聊弹出框
  1226. shareGroupActive:'friend',//分享名片选项卡
  1227. shareGroupId:'',//要分享给谁
  1228. useShareGroupInfo:{},//分享名片时选中的群组信息
  1229. groupInviteInfo:{},//群邀请信息
  1230. //4.群聊 end---------------------------------------->
  1231. //6.名片 start---------------------------------------->
  1232. //userCardMessage:'',//用户留言
  1233. userCardWindowStatus:false,//用户名片弹出框
  1234. shareTableActive:'friend',//分享名片选项卡
  1235. useShareUserId:'',//分享名片时选中的用户id
  1236. useShareUserInfo:{},//分享名片时选中的用户信息
  1237. //6.名片 end---------------------------------------->
  1238. //7.加好友 start---------------------------------------->
  1239. addUserWindowStatus:false,//添加用户弹出框是否显示
  1240. form:{
  1241. //好友申请
  1242. addUserForm:{
  1243. notes:"",//备注
  1244. nickname:"",//修改昵称
  1245. }
  1246. },
  1247. //7.加好友 end---------------------------------------->
  1248. //8.发消息 start---------------------------------------->
  1249. sendMessage:{
  1250. img:{
  1251. imgUrl:'',//图片地址
  1252. oldFileName:"",//文件名
  1253. },
  1254. file:{
  1255. fileUrl:'',
  1256. oldFileName:"",//文件名
  1257. }
  1258. }
  1259. //8.发消息 end---------------------------------------->
  1260. //老刘的代码 start---------------------------------------->
  1261. // activeConversation: null,
  1262. // newMessage: '',
  1263. // conversations: [],
  1264. // ws: null,
  1265. // contextMenuVisible: false, // 控制右键菜单的显示
  1266. // contextMenuX: 0, // 右键菜单的 X 坐标
  1267. // contextMenuY: 0, // 右键菜单的 Y 坐标
  1268. // selectedConversation: null // 选中的对话
  1269. //老刘的代码 end---------------------------------------->
  1270. };
  1271. },
  1272. methods: {
  1273. //1.会话列表 start---------------------------------------->
  1274. //1.1获取会话列表
  1275. getConversationList(){
  1276. this.$store.dispatch('chat/getConversation',{}).then(res=> {
  1277. console.log(res)
  1278. let data = res.data;
  1279. for(let item of data){
  1280. item.status = 0; //默认未选中
  1281. }
  1282. this.conversationList = data;
  1283. this.hallLeftLoading = false;
  1284. }).catch(() => {
  1285. this.$message.error('获取会话列表失败!')
  1286. })
  1287. },
  1288. //1.2选择会话
  1289. selectConversation(item){
  1290. console.log(item)
  1291. //选择会话的时候开启loading框
  1292. this.hallRightLoading = true;
  1293. //关闭右侧详情框
  1294. this.closeRightDetailWindow();
  1295. //使用receiverId判断当前是哪个会话
  1296. this.receiverId = item.receiver_id;
  1297. //会话类型 = 1 单聊
  1298. this.receiverType = 1;
  1299. //分享名片时需要使用用户的头像和名称
  1300. this.useShareUserInfo = item;
  1301. //关闭搜索会话搜索框
  1302. this.closeSearchConversation();
  1303. //清理单聊状态
  1304. this.conversationList.forEach(conversation => {
  1305. conversation.status = (conversation.receiver_id === item.receiver_id) ? 1 : 0;
  1306. if(conversation.receiver_id === item.receiver_id){
  1307. //当前的聊天名称
  1308. this.messageTitle = item.user_name;
  1309. }
  1310. });
  1311. //console.log(this.conversationList)
  1312. this.getchatrecords(item.receiver_id);
  1313. //关闭没有选择任何聊天的界面
  1314. this.ifNoMessage = false;
  1315. //选择单聊的时候把群聊的id清空
  1316. this.groupId = '';
  1317. },
  1318. //1.3获取聊天记录
  1319. getchatrecords(user_id){
  1320. //此处增加一个show_id 用于后端判断如何积累未读消息 注意,选择group的方法在下面
  1321. this.$store.dispatch('chat/getChatRecords',{friend_id:user_id}).then(res=> {
  1322. console.log(res)
  1323. this.chatrecords = res.data.data;
  1324. //滚动条滚动到底部
  1325. this.scorllBottom();
  1326. console.log(this.chatrecords)
  1327. //选择会话后关闭loading框
  1328. this.hallRightLoading = false;
  1329. }).catch(() => {
  1330. this.$message.error('获取聊天记录失败!')
  1331. //选择会话后关闭loading框
  1332. this.hallRightLoading = false;
  1333. })
  1334. },
  1335. //1.4搜索会话
  1336. searchUserConversation(){
  1337. this.selectConversationItem = {};
  1338. let flag = false; //是否找到会话
  1339. //当group_name等于搜索内容的时候,选择会话
  1340. for(let item of this.conversationList){
  1341. if(item.group_name==this.searchConversation||item.user_name==this.searchConversation){
  1342. this.selectConversationItem = item;
  1343. flag = true;
  1344. }
  1345. }
  1346. //如果没有找到会话 就提示没有找到
  1347. if(!flag){
  1348. this.$message.error('没有找到该会话!')
  1349. }else{
  1350. this.searchConversationStatus = true;
  1351. }
  1352. },
  1353. //1.5关闭搜索会话
  1354. closeSearchConversation(){
  1355. this.selectConversationItem = {};
  1356. this.searchConversationStatus = false;
  1357. },
  1358. //1.6 搜索并定位聊天记录
  1359. searchChatRecordsUser() {
  1360. // 获取输入的内容
  1361. const searchTerm = this.searchChatRecords.toLowerCase();
  1362. // 查找匹配的消息
  1363. const matchingItem = this.chatrecords.find(item => {
  1364. return item.content.toLowerCase().includes(searchTerm);
  1365. });
  1366. // 如果找到匹配的消息,滚动到该消息
  1367. if (matchingItem) {
  1368. const index = this.chatrecords.indexOf(matchingItem);
  1369. this.$nextTick(() => {
  1370. const messageElements = this.$refs.fileWindowMessageScrollBox.children;
  1371. if (messageElements[index]) {
  1372. messageElements[index].scrollIntoView({ behavior: 'smooth', block: 'nearest' });
  1373. }
  1374. });
  1375. } else {
  1376. this.$message.error('聊天信息不存在!'); // 提示用户
  1377. }
  1378. },
  1379. //1.7 从通讯录进入会话大厅
  1380. retrieveSession(){
  1381. //1.获取会话列表
  1382. this.$store.dispatch('chat/getConversation',{}).then(res=> {
  1383. //2.查询当前会话中是否已经存在该好友的会话
  1384. let data = res.data;
  1385. let SeleteItem = {};
  1386. let flag = false;//对话是否已经存在
  1387. for(let item of data){
  1388. //3.如果会话中含有该好友的会话,则选中该会话
  1389. if(item.receiver_id == this.$route.query.friend_id){
  1390. item.status = 1;
  1391. SeleteItem = item;
  1392. flag = true;
  1393. }else{
  1394. item.status = 0;
  1395. }
  1396. }
  1397. //4.更新会话列表
  1398. this.conversationList = data;
  1399. //5.判断对话是否已经在会话列表中存在
  1400. if(flag==true){
  1401. //6.如果存在,则选中该会话
  1402. this.selectConversation(SeleteItem)
  1403. }else{
  1404. //7.如果不存在,则创建单聊
  1405. this.createSession();
  1406. }
  1407. }).catch(() => {
  1408. this.$message.error('获取会话列表失败!')
  1409. })
  1410. },
  1411. //1.8 创建单聊
  1412. createSession(){
  1413. //console.log(this.$route.query.friend_id)
  1414. const currentDateTime = new Date();
  1415. const formattedDateTime = currentDateTime.toLocaleString('zh-CN', { timeZone: 'Asia/Shanghai' });
  1416. console.log("当前时间(北京时间):", formattedDateTime);
  1417. const message = {
  1418. talk_type:1,//当前的会话类型
  1419. //receiver_id:this.$route.query.friend_id,//当前的会话id
  1420. receiver_id:this.createMessageId,//当前的会话id
  1421. content:"我于" + formattedDateTime + "创建了一个会话",//用户发发送的消息
  1422. msg_type:1,//消息类型 1:文本 2:图片 3:文件 4:好友卡片 5:系统消息;6:加群卡片
  1423. };
  1424. //console.log(message)
  1425. //发送消息
  1426. let that = this;
  1427. if (this.ws && this.ws.readyState === WebSocket.OPEN) {
  1428. //打开左侧loading防止重复点击
  1429. this.hallLeftLoading = true;
  1430. this.ws.send(JSON.stringify(message));
  1431. //2秒后搜索会话列表 防止创建失败
  1432. setTimeout(() => {
  1433. that.$store.dispatch('chat/getConversation',{}).then(res=> {
  1434. //查询当前会话中是否已经存在该好友的会话
  1435. let data = res.data;
  1436. let SeleteItem = {};
  1437. let flag = false;//对话是否已经存在
  1438. for(let item of data){
  1439. //如果会话中含有该好友的会话,则选中该会话
  1440. if(item.receiver_id == this.createMessageId){
  1441. item.status = 1;
  1442. SeleteItem = item;
  1443. flag = true;
  1444. }else{
  1445. item.status = 0;
  1446. }
  1447. }
  1448. //更新会话列表
  1449. that.conversationList = data;
  1450. //关闭loading层
  1451. that.hallLeftLoading = false;
  1452. //判断对话是否已经在会话列表中存在
  1453. if(flag==true){
  1454. //如果存在,则选中该会话
  1455. that.selectConversation(SeleteItem)
  1456. }
  1457. }).catch(() => {
  1458. that.$message.error('获取会话列表失败!')
  1459. })
  1460. }, 2000);
  1461. }
  1462. },
  1463. //1.9 循环更新会话列表
  1464. forSearchConversationList(){
  1465. let that = this;
  1466. this.listTimeOut = setInterval(() => {
  1467. //刷新时先判断是否有选中的会话
  1468. if(that.receiverId!=''){
  1469. //如果不为空,说明用户选择了某一个会话,此时需要修改会话列表中该会话的状态
  1470. this.$store.dispatch('chat/getConversation',{}).then(res=> {
  1471. console.log(res)
  1472. let data = res.data;
  1473. for(let item of data){
  1474. if(item.receiver_id==that.receiverId){
  1475. item.status = 1;
  1476. }else{
  1477. item.status = 0;
  1478. }
  1479. }
  1480. this.conversationList = data;
  1481. console.log("开始获取会话列表,将于8秒后再次获取!")
  1482. }).catch(() => {
  1483. this.$message.error('获取会话列表失败!')
  1484. })
  1485. }else{
  1486. //如果为空,说明用户没有选择任何会话,此时可以直接请求列表
  1487. that.getConversationList();
  1488. }
  1489. }, 7000);
  1490. },
  1491. //1.10 查询会话列表中是否存在会话,不存在就创建
  1492. searchConversationIfCreate(user_id){
  1493. //从会话列表中找到receiver_id于user_id相同的会话
  1494. let flag = false;
  1495. for(let item of this.conversationList){
  1496. if(item.receiver_id==user_id){
  1497. flag = true;
  1498. }
  1499. }
  1500. //第一种情况:两人是好友,且会话已经创建了
  1501. if(flag){
  1502. //给与右侧展示列表的id
  1503. this.groupRightUserInfo.receiver_id = String(user_id);
  1504. this.groupRightUserInfo.user_id = String(user_id);
  1505. this.selectConversation(this.groupRightUserInfo)
  1506. this.rightSlideBoxShow = false;
  1507. this.groupRightSearchWindow = false;
  1508. }else{
  1509. //第二种情况:两人是好友但是不存在对话
  1510. //console.log("不存在这个会话,创建单聊")
  1511. this.createMessageId = user_id;
  1512. this.createSession();
  1513. }
  1514. },
  1515. //1.会话列表 end---------------------------------------->
  1516. //2.群聊 start---------------------------------------->
  1517. //2.1 创建群聊
  1518. //2.1.1 打开群聊创建窗口
  1519. creatGroup(){
  1520. this.groupWindowStatus = true;
  1521. //获得好友列表
  1522. this.getFriendsList();
  1523. },
  1524. //2.1.2 左侧菜单获取好友列表
  1525. getFriendsList(){
  1526. this.$store.dispatch('chat/getFriendsList',{user_id:this.myUserId}).then(res=> {
  1527. console.log(res)
  1528. for(let item of res.data){
  1529. item.status = false; //默认未选中
  1530. }
  1531. this.friendsList = res.data;
  1532. }).catch(() => {
  1533. this.$message.error('获取好友列表失败!')
  1534. })
  1535. },
  1536. //2.1.3 左侧菜单取消选择好友
  1537. cancelSelectFriends(id){
  1538. this.friendsList.forEach(item => {
  1539. if(item.id == id){
  1540. item.status = false;
  1541. }
  1542. });
  1543. },
  1544. //2.1.4 清空并关闭创建群弹出框
  1545. clearCreatGroupWindow(){
  1546. this.friendsList.forEach(item => {
  1547. item.status = false;
  1548. });
  1549. this.groupWindowStatus = false;
  1550. },
  1551. //2.1.5 创建群
  1552. createForGroup(){
  1553. let data = {
  1554. group_name:"",//群聊名称
  1555. group_desc:"仅群主可以修改",//群聊公告
  1556. group_avatar:"",//群聊头像
  1557. group_member:""//群成员
  1558. }
  1559. //从friendsList找出用户选择的联系人,然后创建群组
  1560. //先把我自己放进去
  1561. data.group_member = this.myUserId + ",";
  1562. //然后循环添加其他用户
  1563. this.friendsList.forEach(item => {
  1564. if(item.status){
  1565. data.group_member += item.friend_id + ",";
  1566. }
  1567. data.group_name = this.friendsList
  1568. .filter(item => item.status)
  1569. .slice(0, 3) // 只取前三个
  1570. .map(item => item.remark !== null ? item.remark : item.user_name)
  1571. .join(", ") // 使用逗号和空格分隔
  1572. });
  1573. data.group_member = data.group_member.slice(0,-1);//掉最后一个字符
  1574. //console.log(data)
  1575. this.$store.dispatch('chat/addGroup',data).then(res=> {
  1576. this.$message.success('创建群聊成功!')
  1577. //完成后关闭弹出框
  1578. this.clearCreatGroupWindow();
  1579. //重新获取会话列表
  1580. this.getConversationList();
  1581. }).catch(() => {
  1582. this.$message.error('创建群聊失败!')
  1583. })
  1584. },
  1585. //2.1.6 建群时搜索群成员
  1586. searchFriendGroupUser(){
  1587. this.groupFriendSearchUser = {};
  1588. let flag = false; //是否找到成员
  1589. for(let item of this.friendsList){
  1590. if(item.user_name==this.searchFriendGroup||item.remark==this.searchFriendGroup){
  1591. this.groupFriendSearchUser = item;
  1592. flag = true;
  1593. }
  1594. }
  1595. console.log(this.searchGroup)
  1596. console.log(this.friendsList)
  1597. console.log(flag)
  1598. console.log(this.groupFriendSearchUser)
  1599. //this.searchGroup 搜索的内容
  1600. //this.groupEditWindowStatus 弹出框状态
  1601. //this.groupSearchUser 搜索出来的成员
  1602. if(!flag){
  1603. this.$message.error('没有找到该成员!')
  1604. }else{
  1605. this.groupFriendsWindowStatus = true;
  1606. }
  1607. },
  1608. //2.1.7 把用户添加到选择框里面
  1609. addSearchFriendWindow(){
  1610. this.groupFriendSearchUser.status=!this.groupFriendSearchUser.status;
  1611. this.closeSearchFriendWindow();
  1612. },
  1613. //2.1.7 关闭搜索弹出框
  1614. closeSearchFriendWindow(){
  1615. this.groupFriendsWindowStatus = false;
  1616. },
  1617. //2.2 选择群聊
  1618. //2.1.1 在会话列表中选择一个群聊
  1619. selectGroup(item){
  1620. //选择会话的时候开启loading框
  1621. this.hallRightLoading = true;
  1622. //关闭右侧详情框
  1623. this.closeRightDetailWindow();
  1624. //使用receiverId判断当前是哪个会话
  1625. this.receiverId = item.receiver_id;
  1626. //会话类型 = 2 群聊
  1627. this.receiverType = 2;
  1628. //分享群聊时需要使用群名称和群id
  1629. this.useShareGroupInfo = item;
  1630. console.log("选择群聊")
  1631. //清理单聊状态
  1632. this.conversationList.forEach(conversation => {
  1633. conversation.status = (conversation.receiver_id === item.receiver_id) ? 1 : 0;
  1634. });
  1635. console.log(item)
  1636. //记录准备加入群聊的id
  1637. this.groupId = item.receiver_id;
  1638. //当前的聊天名称
  1639. this.messageTitle = item.group_name;
  1640. //关闭没有选择任何聊天的界面
  1641. this.ifNoMessage = false;
  1642. //获取群聊天信息
  1643. this.getGroupChatRecords(item.receiver_id);
  1644. //获取群设置信息
  1645. this.getGroupSystem(item.receiver_id);
  1646. //获取群成员
  1647. this.getGroupMember(item.receiver_id);
  1648. },
  1649. //2.1.2 获取群聊消息
  1650. getGroupChatRecords(group_id){
  1651. this.$store.dispatch('chat/getGroupChatRecords',{group_id:group_id}).then(res=> {
  1652. console.log(res)
  1653. this.chatrecords = res.data.data;
  1654. //滚动条滚动到底部
  1655. this.scorllBottom();
  1656. //选择会话的时候开启loading框
  1657. this.hallRightLoading = false;
  1658. }).catch(() => {
  1659. this.$message.error('获取群设置信息失败!');
  1660. //选择会话的时候开启loading框
  1661. this.hallRightLoading = false;
  1662. })
  1663. },
  1664. //2.3 编辑群聊
  1665. //2.3.1 打开右侧菜单设置窗口
  1666. openGroupSystem(){
  1667. this.rightSlideBoxShow = !this.rightSlideBoxShow;
  1668. },
  1669. //2.3.2 获取群设置群成员
  1670. getGroupMember(group_id){
  1671. this.$store.dispatch('chat/getGroupMembers',{group_id:group_id}).then(res=> {
  1672. for(let item of res.data){
  1673. item.status = true; //默认选中
  1674. }
  1675. this.groupUserList = res.data;
  1676. }).catch(() => {
  1677. this.$message.error('获取群成员信息失败!')
  1678. })
  1679. },
  1680. //2.3.3 获取群设置信息
  1681. getGroupSystem(group_id){
  1682. this.$store.dispatch('chat/getGroupInfo',{group_id:group_id}).then(res=> {
  1683. console.log(res)
  1684. this.groupInfo = res.data;
  1685. this.creatorId = res.data.creator_id;
  1686. if(res.data.profile==null){
  1687. this.groupProfile = "暂无群公告"
  1688. }else{
  1689. this.groupProfile = res.data.profile;
  1690. }
  1691. }).catch(() => {
  1692. this.$message.error('获取群设置信息失败!')
  1693. })
  1694. },
  1695. //2.3.4 右侧菜单退出群聊
  1696. closeGroup(){
  1697. this.$confirm('将要退出该群聊,确定吗?', '提示', {
  1698. confirmButtonText: '确定',
  1699. cancelButtonText: '取消',
  1700. type: 'warning'
  1701. }).then(() => {
  1702. //this.groupId
  1703. this.$store.dispatch('chat/quitGroup',{group_id:this.groupId}).then(res=> {
  1704. this.$message.success('退出群聊成功!')
  1705. //关闭右侧菜单
  1706. this.rightSlideBoxShow = false;
  1707. //关闭右侧聊天界面
  1708. this.ifNoMessage = true;
  1709. //重新请求会话列表
  1710. this.getConversationList();
  1711. }).catch(() => {
  1712. this.$message.error('群聊退出失败!')
  1713. })
  1714. }).catch(() => {
  1715. this.$message.warning('已取消退出')
  1716. });
  1717. },
  1718. //2.3.5 右侧菜单删除群聊
  1719. delGroup(){
  1720. this.$confirm('将要解散该群聊,确定吗?', '提示', {
  1721. confirmButtonText: '确定',
  1722. cancelButtonText: '取消',
  1723. type: 'warning'
  1724. }).then(() => {
  1725. //this.groupId
  1726. this.$store.dispatch('chat/delGroup',{group_id:this.groupId}).then(res=> {
  1727. this.$message.success('已解散群聊!')
  1728. //关闭右侧菜单
  1729. this.rightSlideBoxShow = false;
  1730. //关闭右侧聊天界面
  1731. this.ifNoMessage = true;
  1732. //重新请求会话列表
  1733. this.getConversationList();
  1734. }).catch(() => {
  1735. this.$message.error('解散群聊失败!')
  1736. })
  1737. }).catch(() => {
  1738. this.$message.warning('已取消解散')
  1739. });
  1740. },
  1741. //2.3.6 右侧菜单编辑群名称
  1742. editGroupName(){
  1743. let data = {
  1744. group_id:this.groupId,
  1745. group_name:this.messageTitle//群名称
  1746. }
  1747. this.$store.dispatch('chat/updateGroup',data).then(res=> {
  1748. this.$message.success('成功修改群聊名称!');
  1749. //重新获取群详情
  1750. this.getGroupSystem(this.groupId);
  1751. //重新获取会话列表
  1752. this.getConversationList();
  1753. this.editGroupNameWindow = false;
  1754. }).catch(() => {
  1755. this.$message.error('修改群聊名称失败!')
  1756. })
  1757. },
  1758. //2.3.7 右侧菜单编辑群公告
  1759. editGroupNotice(){
  1760. let data = {
  1761. group_id:this.groupId,
  1762. profile:this.groupProfile//群公告
  1763. }
  1764. this.$store.dispatch('chat/updateGroup',data).then(res=> {
  1765. this.editGroupNoticeWindow = false;
  1766. this.$message.success('成功添加群公告')
  1767. //重新获取群详情
  1768. this.getGroupSystem(this.groupId)
  1769. }).catch(() => {
  1770. this.$message.error('编辑群公告失败!')
  1771. })
  1772. },
  1773. //2.3.8 群弹出框回显群内成员
  1774. editGroupMember(){
  1775. //1.打开编辑窗口
  1776. this.groupEditWindowStatus = true;
  1777. //2.获得好友列表
  1778. this.$store.dispatch('chat/getFriendsList',{user_id:this.myUserId}).then(res=> {
  1779. //3.设置成未选中
  1780. for(let item of res.data){
  1781. item.status = false; //默认未选中
  1782. }
  1783. this.friendsList = res.data;
  1784. console.log(this.friendsList)
  1785. console.log(this.groupUserList)
  1786. //4.判断一下groupUserList是否包含friendsList中的成员,如果包含,就把friendsList中的成员status设置为true
  1787. this.friendsList.forEach(item => {
  1788. console.log(item.user_id)
  1789. if(this.groupUserList.find(groupItem => groupItem.user_id == item.friend_id)){
  1790. item.status = true;
  1791. }
  1792. });
  1793. console.log(this.friendsList)
  1794. }).catch(() => {
  1795. this.$message.error('获取好友列表失败!')
  1796. })
  1797. },
  1798. //2.3.9 群弹出框编辑群成员
  1799. changeSelectFriends(item) {
  1800. // 检查 groupUserList 是否包含 item
  1801. const index = this.groupUserList.findIndex(i => i.user_id == item.friend_id);
  1802. // 如果包含,就删除这个 item;否则,添加到 groupUserList
  1803. // 注意不能直接把friend_id放进去,因为最后编辑保存的时候取的是user_id,这里要传一下值
  1804. if (index !== -1) {
  1805. this.groupUserList.splice(index, 1);
  1806. } else {
  1807. item.user_id = item.friend_id;
  1808. this.groupUserList.push(item);
  1809. }
  1810. },
  1811. //2.3.19 群弹出框取消编辑群成员
  1812. cancelEditGroupMember(){
  1813. this.groupEditWindowStatus = false;
  1814. this.getGroupMember(this.groupId);
  1815. },
  1816. //2.3.20 群弹出框保存编辑群成员
  1817. saveEditGroupMember(){
  1818. let groupUser = []
  1819. // console.log(this.myUserId)
  1820. // console.log(this.groupUserList)
  1821. //取出所有选择的user_id且不能与自己的id相同
  1822. for(let item of this.groupUserList){
  1823. if(Number(item.user_id) != Number(this.myUserId)){
  1824. groupUser.push(item.user_id);
  1825. }
  1826. }
  1827. groupUser = groupUser.join(',');
  1828. //console.log(groupUser)
  1829. let data = {
  1830. group_id:this.groupId,
  1831. group_member:groupUser
  1832. }
  1833. this.$store.dispatch('chat/updateGroupMembers',data).then(res=> {
  1834. this.$message.success('群成员保存成功!')
  1835. this.groupEditWindowStatus = false;
  1836. this.getGroupMember(this.groupId);
  1837. }).catch(() => {
  1838. this.$message.error('群成员保存失败!')
  1839. this.groupEditWindowStatus = false;
  1840. this.getGroupMember(this.groupId);
  1841. })
  1842. },
  1843. //2.3.21 群弹出框搜索群成员
  1844. searchGroupUser(){
  1845. this.groupSearchUser = {};
  1846. let flag = false; //是否找到成员
  1847. for(let item of this.friendsList){
  1848. if(item.user_name==this.searchGroup||item.remark==this.searchGroup){
  1849. this.groupSearchUser = item;
  1850. flag = true;
  1851. }
  1852. }
  1853. console.log(this.searchGroup)
  1854. console.log(this.friendsList)
  1855. console.log(flag)
  1856. //this.searchGroup 搜索的内容
  1857. //this.groupEditWindowStatus 弹出框状态
  1858. //this.groupSearchUser 搜索出来的成员
  1859. if(!flag){
  1860. this.$message.error('没有找到该成员!')
  1861. }else{
  1862. this.groupEditMainWindowStatus = true;
  1863. }
  1864. },
  1865. //2.3.22 群弹出框添加群成员
  1866. addGroupUser(item){
  1867. item.user_id = item.friend_id;
  1868. console.log(item)
  1869. //找到friendsList中的该成员,把status设置为相反的值
  1870. for(let item of this.friendsList){
  1871. if(item.user_id==this.groupSearchUser.user_id){
  1872. item.status = !item.status;
  1873. }
  1874. }
  1875. // 找到groupUserList中是否存在该成员,如果存在就删除,没有不存在就添加
  1876. const index = this.groupUserList.findIndex(member => member.user_id === item.user_id);
  1877. if (index !== -1) {
  1878. // 如果存在,删除该成员
  1879. this.groupUserList.splice(index, 1);
  1880. } else {
  1881. // 如果不存在,添加该成员
  1882. this.groupUserList.push(item);
  1883. }
  1884. //完成后关闭弹出框
  1885. this.closeAddGroupUserWindow();
  1886. },
  1887. //2.3.23 群弹出框关闭弹出框
  1888. closeAddGroupUserWindow(){
  1889. this.searchGroup = "";
  1890. this.groupSearchUser = {};
  1891. this.groupEditMainWindowStatus = false;
  1892. },
  1893. //2.3.24 群弹出框移除群成员
  1894. editRemoveGroupUser(id){
  1895. console.log(id)
  1896. //移除this.groupUserList中user_id与id一致的
  1897. const index = this.groupUserList.findIndex(member => member.user_id === id);
  1898. if (index !== -1) {
  1899. this.groupUserList.splice(index, 1);
  1900. }
  1901. //找到friendsList中user_id与id一致的,把status设置为false
  1902. for(let item of this.friendsList){
  1903. if(item.friend_id==id){
  1904. item.status = false;
  1905. }
  1906. }
  1907. },
  1908. //2.3.25 右侧菜单编辑成员
  1909. rightSearchUser(){
  1910. this.groupRightUserInfo = {};
  1911. let flag = false; //是否找到成员
  1912. for(let item of this.groupUserList){
  1913. if(item.user_name==this.searchUser||item.remark==this.searchUser){
  1914. this.groupRightUserInfo = item;
  1915. flag = true;
  1916. }
  1917. }
  1918. console.log(this.searchUser)
  1919. console.log(this.groupUserList)
  1920. console.log(flag)
  1921. //this.searchGroup 搜索的内容
  1922. //this.groupEditWindowStatus 弹出框状态
  1923. //this.groupSearchUser 搜索出来的成员
  1924. if(!flag){
  1925. this.$message.error('没有找到该成员!')
  1926. }else{
  1927. //找到这个成员以后,需要先验证一下他俩是不是好友
  1928. this.$store.dispatch('chat/isFriend',{friend_id:this.groupRightUserInfo.user_id}).then(res=> {
  1929. console.log(res.data)//true false
  1930. this.groupRightUserInfo.isFriend = res.data;
  1931. //打开弹出框
  1932. this.groupRightSearchWindow = true;
  1933. }).catch(() => {
  1934. this.$message.error('获取成员身份信息失败!')
  1935. })
  1936. }
  1937. },
  1938. //2.3.26 关闭弹出框
  1939. closeRightSearchUser(){
  1940. this.searchUser = "";
  1941. this.groupRightUserInfo = {};
  1942. this.groupRightSearchWindow = false;
  1943. },
  1944. //2.4 加入群聊
  1945. //2.4.1 打开群聊邀请窗口
  1946. openGroupInviteWindow(info){
  1947. this.addGroupWindow = true;
  1948. //info.content.split(',')[0] 群名称
  1949. //info.content.split(',')[1] 群id
  1950. //获得要加入的群聊详情
  1951. this.groupInviteInfo.group_name = info.content.split(',')[0];
  1952. this.groupInviteInfo.group_id = info.content.split(',')[1];
  1953. },
  1954. //2.4.2 加入群聊
  1955. joinGroup(){
  1956. this.$store.dispatch('chat/joinGroup',{group_id:this.groupInviteInfo.group_id}).then(res=> {
  1957. this.$message.success('加入群聊成功!')
  1958. this.addGroupWindow = false;
  1959. }).catch(() => {
  1960. this.$message.error('加入群聊失败!')
  1961. })
  1962. },
  1963. //2.4.3 打开分享群聊弹出框
  1964. openShareMyGroup(){
  1965. //群组聊天数据初始化
  1966. this.groupConversationList = [];
  1967. //打开名片弹出框
  1968. this.shareGroupWindowStatus = true;
  1969. // shareGroupWindowStatus:false,//分享群聊弹出框
  1970. // shareGroupActive:'friend',//分享名片选项卡
  1971. // shareGroupId:'',//要分享的群聊id
  1972. // useShareGroupInfo:{},//分享名片时选中的群组信息
  1973. //默认获取一下好友列表
  1974. this.getFriendsList();
  1975. //把群聊提出来单独放到一个数组
  1976. for(let item of this.conversationList){
  1977. if(item.is_group==1){
  1978. this.groupConversationList.push(item);
  1979. }
  1980. }
  1981. },
  1982. shareMyGroup(){
  1983. console.log(this.shareGroupId)
  1984. if(this.shareGroupId!=''){
  1985. let message = {};
  1986. console.log(this.useShareGroupInfo)
  1987. let userInfo = [this.useShareGroupInfo.group_name,this.useShareGroupInfo.receiver_id];
  1988. let userInfoString = userInfo.join(',');
  1989. if(this.shareGroupActive=='friend'){
  1990. //单聊
  1991. message = {
  1992. talk_type:1,
  1993. receiver_id:this.shareGroupId,
  1994. msg_type:6,//消息类型 1:文本 2:图片 3:文件 4:好友卡片 5:系统消息;6:加群卡片
  1995. };
  1996. message.content = userInfoString;
  1997. }else if(this.shareGroupActive=='group'){
  1998. //群聊
  1999. message = {
  2000. talk_type:2,
  2001. receiver_id:this.shareGroupId,
  2002. content:userInfo,
  2003. msg_type:6,//消息类型 1:文本 2:图片 3:文件 4:好友卡片 5:系统消息;6:加群卡片
  2004. };
  2005. message.content = userInfoString;
  2006. }
  2007. console.log(message)
  2008. //发送消息
  2009. if (this.ws && this.ws.readyState === WebSocket.OPEN) {
  2010. this.ws.send(JSON.stringify(message));
  2011. }
  2012. //关闭分享弹出框
  2013. this.shareGroupWindowStatus = false;
  2014. this.$message.success('分享名片成功!')
  2015. }else{
  2016. this.$message.error('请选择分享对象!')
  2017. }
  2018. },
  2019. handleClickShareGroupCard(tab, event) {
  2020. const tabName = tab.name;
  2021. console.log("当前选中的tab name:", tabName);
  2022. this.shareGroupActive = tabName;
  2023. },
  2024. //2.群聊 end---------------------------------------->
  2025. //3.全局应用 start---------------------------------------->
  2026. //3.1 滚动条滚动到底部
  2027. scorllBottom(){
  2028. //滚动条滚动到底部
  2029. this.$nextTick(() => {
  2030. const rightUserMessageBox = this.$refs.rightUserMessageBox;
  2031. if (rightUserMessageBox) {
  2032. rightUserMessageBox.scrollTop = rightUserMessageBox.scrollHeight;
  2033. }
  2034. });
  2035. },
  2036. //3.2 添加好友
  2037. addFriend(id){
  2038. console.log(id)
  2039. this.addFriendWindowStatus = true;
  2040. this.addform.friend_id = id;
  2041. },
  2042. addMyFriend(){
  2043. this.$store.dispatch('chat/addFriend',this.addform).then(res=> {
  2044. this.$message.success(res.data)
  2045. this.addFriendWindowStatus = false;
  2046. })
  2047. },
  2048. //3.3 关闭右侧详情框
  2049. closeRightDetailWindow(){
  2050. this.rightSlideBoxShow = false;
  2051. this.groupRightSearchWindow = false;
  2052. this.searchUser = "";
  2053. },
  2054. //3.全局应用 end---------------------------------------->
  2055. //4.会话框 start---------------------------------------->
  2056. //4.1上传
  2057. //4.1.1上传图片
  2058. beforeImgUpload(file) {
  2059. //先清理一下上传的缩略窗口
  2060. this.deFileUpload()
  2061. const isJPG = file.type === 'image/jpeg';
  2062. const isPNG = file.type === 'image/png';
  2063. const isLt2M = file.size / 1024 / 1024 < 2;
  2064. if (!isJPG && !isPNG) {
  2065. this.$message.error('发送的图片只能是 JPG 或 PNG 格式!');
  2066. return false;
  2067. }
  2068. if (!isLt2M) {
  2069. this.$message.error('发送的图片大小不能超过 2MB!');
  2070. return false;
  2071. }
  2072. const formData = new FormData();
  2073. formData.append('file', file);
  2074. this.$store.dispatch('pool/uploadFile',formData).then(res=> {
  2075. this.sendMessage.img.imgUrl = res.data.imgUrl;//获取上传的图片地址
  2076. this.sendMessage.img.oldFileName = res.data.oldFileName;
  2077. console.log(res.data.imgUrl)
  2078. }).catch(() => {
  2079. this.$message({
  2080. type: 'info',
  2081. message: '网络错误,请重试!'
  2082. });
  2083. })
  2084. // 阻止默认的上传行为
  2085. return false;
  2086. },
  2087. //4.1.2上传文件
  2088. beforeFileUpload(file) {
  2089. //先清理一下上传的缩略窗口
  2090. this.deFileUpload()
  2091. console.log(file)
  2092. //允许的文件类型
  2093. const isDoc = file.type === 'application/msword';
  2094. const isDocx = file.type === 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';
  2095. const isXls = file.type === 'application/vnd.ms-excel';
  2096. const isXlsx = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
  2097. const isPptx = file.type === 'application/vnd.openxmlformats-officedocument.presentationml.presentation';
  2098. const isRar = file.type === 'application/x-rar-compressed';
  2099. const isZip = file.type === 'application/x-zip-compressed';
  2100. const isTxt = file.type === 'text/plain';
  2101. //文件大小不能超过2M
  2102. const isLt2M = file.size / 1024 / 1024 < 2;
  2103. if (!isTxt && !isDoc && !isDocx && !isXls && !isXlsx && !isPptx && !isRar && !isZip) {
  2104. this.$message.error('该文件类型不允许上传!');
  2105. return false;
  2106. }
  2107. if (!isLt2M) {
  2108. this.$message.error('发送的文件大小不能超过2M!');
  2109. return false;
  2110. }
  2111. const formData = new FormData();
  2112. formData.append('file', file);
  2113. this.$store.dispatch('pool/uploadFile',formData).then(res=> {
  2114. this.sendMessage.file.fileUrl = res.data.imgUrl;
  2115. this.sendMessage.file.oldFileName = res.data.oldFileName;
  2116. console.log(res.data)
  2117. }).catch(() => {
  2118. this.$message({
  2119. type: 'info',
  2120. message: '网络错误,请重试!'
  2121. });
  2122. })
  2123. // 阻止默认的上传行为
  2124. return false;
  2125. },
  2126. //4.1.3 删除上传的文件
  2127. deFileUpload(){
  2128. this.sendMessage.img.imgUrl = "";
  2129. this.sendMessage.img.oldFileName = "";
  2130. this.sendMessage.file.fileUrl = "";
  2131. this.sendMessage.file.oldFileName = "";
  2132. },
  2133. //4.会话框 end---------------------------------------->
  2134. //5.websocket会话 start---------------------------------------->
  2135. //5.1 接受消息
  2136. handleIncomingMessage(event) {
  2137. const message = JSON.parse(event.data);
  2138. console.log("监听消息:",message)
  2139. if(Number(this.receiverId) == Number(message.receiver_id)){
  2140. //如果message的receiverId和会话的receiverId一致,说明这条信息是自己发的回显
  2141. let receiveMessage = {
  2142. action:"said",//是谁说的
  2143. user_avatar:message.user_avatar,//头像
  2144. content:message.content,//内容
  2145. msg_type:message.msg_type,//消息类型
  2146. }
  2147. console.log("回显自己的消息:"+this.receiverId,message.receiver_id)
  2148. console.log(message)
  2149. //消息添加到聊天记录
  2150. this.chatrecords.push(receiveMessage);
  2151. // 确保 Vue 能够检测到数组的变化
  2152. //this.$set(this.chatrecords, this.chatrecords.length, receiveMessage);
  2153. console.log(this.chatrecords)
  2154. //滚动条滚动到底部
  2155. this.scorllBottom();
  2156. }else if(Number(this.receiverId) == Number(message.user_id)){
  2157. let receiveMessage = {
  2158. action:"recieved",//是谁说的
  2159. receiver_avatar:message.user_avatar,//头像
  2160. content:message.content,//内容
  2161. msg_type:message.msg_type,//消息类型
  2162. }
  2163. //如果message的receiverId和会话的receiverId不一致,说明这条信息是别人发的,需要添加到聊天记录
  2164. //消息添加到聊天记录
  2165. console.log("来自单聊消息:"+this.receiverId,message.user_id)
  2166. this.chatrecords.push(receiveMessage);
  2167. console.log(message)
  2168. }
  2169. },
  2170. // 5.2 发送消息
  2171. sendUserMessage() {
  2172. if (this.userMessage.trim() !== '') {
  2173. const message = {
  2174. talk_type:this.receiverType,//当前的会话类型
  2175. receiver_id:this.receiverId,//当前的会话id
  2176. content:this.userMessage,//用户发发送的消息
  2177. msg_type:1,//消息类型 1:文本 2:图片 3:文件 4:好友卡片 5:系统消息;6:加群卡片
  2178. };
  2179. //发送消息
  2180. if (this.ws && this.ws.readyState === WebSocket.OPEN) {
  2181. this.ws.send(JSON.stringify(message));
  2182. }
  2183. this.userMessage = '';
  2184. }else{
  2185. this.$message.error('消息不能为空!')
  2186. }
  2187. },
  2188. // 5.3 发送图片或者文字
  2189. sendUserMessageToFile() {
  2190. if(this.sendMessage.img.imgUrl!=''){
  2191. const message = {
  2192. talk_type:this.receiverType,//当前的会话类型
  2193. receiver_id:this.receiverId,//当前的会话id
  2194. content:this.sendMessage.img.imgUrl,//用户发发送的消息
  2195. msg_type:2,//消息类型 1:文本 2:图片 3:文件 4:好友卡片 5:系统消息;6:加群卡片
  2196. };
  2197. if (this.ws && this.ws.readyState === WebSocket.OPEN) {
  2198. this.ws.send(JSON.stringify(message));
  2199. //发送完毕清除选择的图片
  2200. this.sendMessage.img.imgUrl='';
  2201. }
  2202. //如果文本框不为空,把文本框内的消息也提交过去
  2203. if(this.userMessage.trim()!=''){
  2204. this.sendUserMessage();
  2205. }
  2206. }
  2207. if(this.sendMessage.file.fileUrl!=''){
  2208. //把名称和地址打包成一个对象
  2209. const fileInfo = {
  2210. file_url:this.sendMessage.file.fileUrl,
  2211. oldFileName:this.sendMessage.file.oldFileName
  2212. }
  2213. const fileInfoString = JSON.stringify(fileInfo);
  2214. //发送消息
  2215. const message = {
  2216. talk_type:this.receiverType,//当前的会话类型
  2217. receiver_id:this.receiverId,//当前的会话id
  2218. content:fileInfoString,//用户发发送的消息
  2219. msg_type:3,//消息类型 1:文本 2:图片 3:文件 4:好友卡片 5:系统消息;6:加群卡片
  2220. };
  2221. if (this.ws && this.ws.readyState === WebSocket.OPEN) {
  2222. this.ws.send(JSON.stringify(message));
  2223. //发送完毕清除选择的文件
  2224. this.sendMessage.file.fileUrl='';
  2225. }
  2226. //如果文本框不为空,把文本框内的消息也提交过去
  2227. if(this.userMessage.trim()!=''){
  2228. this.sendUserMessage();
  2229. }
  2230. }
  2231. },
  2232. //5.4 打开名片弹出框
  2233. openShareCard(){
  2234. //群组聊天数据初始化
  2235. this.groupConversationList = [];
  2236. //打开名片弹出框
  2237. this.userCardWindowStatus = true;
  2238. //默认获取一下好友列表
  2239. this.getFriendsList();
  2240. //好友列表
  2241. //this.friendsList
  2242. //会话列表
  2243. //this.conversationList
  2244. //把群聊提出来单独放到一个数组
  2245. //this.groupConversationList
  2246. for(let item of this.conversationList){
  2247. if(item.is_group==1){
  2248. this.groupConversationList.push(item);
  2249. }
  2250. }
  2251. },
  2252. //5.5 分享名片
  2253. shareCard(){
  2254. console.log(this.useShareUserId)
  2255. if(this.useShareUserId!=''){
  2256. let message = {};
  2257. // let userInfo = {
  2258. // avatar:this.useShareUserInfo.avatar,
  2259. // user_name:this.useShareUserInfo.user_name,
  2260. // friend_id:this.receiverId
  2261. // }
  2262. let userInfo = [this.useShareUserInfo.avatar,this.useShareUserInfo.user_name,this.receiverId];
  2263. let userInfoString = userInfo.join(',');
  2264. if(this.shareTableActive=='friend'){
  2265. //单聊
  2266. message = {
  2267. talk_type:1,
  2268. receiver_id:this.useShareUserId,
  2269. msg_type:4,//消息类型 1:文本 2:图片 3:文件 4:好友卡片 5:系统消息;6:加群卡片
  2270. };
  2271. message.content = userInfoString;
  2272. }else if(this.shareTableActive=='group'){
  2273. //群聊
  2274. message = {
  2275. talk_type:2,
  2276. receiver_id:this.useShareUserId,
  2277. content:userInfo,
  2278. msg_type:4,//消息类型 1:文本 2:图片 3:文件 4:好友卡片 5:系统消息;6:加群卡片
  2279. };
  2280. message.content = userInfoString;
  2281. }
  2282. // console.log(typeof message.content)
  2283. // console.log(message.content)
  2284. // console.log(message)
  2285. //发送消息
  2286. if (this.ws && this.ws.readyState === WebSocket.OPEN) {
  2287. this.ws.send(JSON.stringify(message));
  2288. }
  2289. //关闭分享弹出框
  2290. this.userCardWindowStatus = false;
  2291. this.$message.success('分享名片成功!')
  2292. }else{
  2293. this.$message.error('请选择分享对象!')
  2294. }
  2295. },
  2296. //5.6 切换分享名片
  2297. handleClickShareCard(tab, event) {
  2298. const tabName = tab.name;
  2299. console.log("当前选中的tab name:", tabName);
  2300. this.shareTableActive = tabName;
  2301. },
  2302. //5.7 下载文件
  2303. downloadFile(item){
  2304. let downloadData = JSON.parse(item.content);
  2305. console.log(downloadData.file_url)
  2306. if(downloadData.file_url!=''){
  2307. const link = document.createElement('a');
  2308. link.href = downloadData.file_url;
  2309. link.setAttribute('download', 'downloaded_file'); // You can set a default file name here
  2310. document.body.appendChild(link);
  2311. link.click();
  2312. document.body.removeChild(link);
  2313. }else{
  2314. this.$message.error('文件下载失败!')
  2315. }
  2316. },
  2317. //5.8 图片放大
  2318. imgZoom(url){
  2319. this.imgZoomUrl = url;
  2320. this.imgZoomStatus = true;
  2321. },
  2322. //5.websocket会话 end---------------------------------------->
  2323. },
  2324. mounted() {
  2325. //开启websocket连接 start---------------------------------------->
  2326. //1.获取admin-token
  2327. const adminToken = document.cookie.split('; ').find(row => row.startsWith('Admin-Token=')).split('=')[1];
  2328. //console.log("Admin-Token:", adminToken);
  2329. //2.连接websocket
  2330. let websocketNewUrl = baseUrl.WebsocketUrl +"?token=" + adminToken;
  2331. //let websocketNewUrl = URL.WebsocketUrl +"?token=" + adminToken;
  2332. this.ws = new WebSocket(websocketNewUrl);
  2333. this.ws.addEventListener('message', this.handleIncomingMessage);
  2334. //当连接关闭的时候关闭websocket
  2335. this.ws.addEventListener('close', function (event) {
  2336. // 连接关闭时执行的操作
  2337. console.log("关闭链接",event)
  2338. });
  2339. //开启websocket连接 end---------------------------------------->
  2340. //从通讯录创建单聊 start---------------------------------------->
  2341. //当ws创建成功以后再执行,防止数据未加载
  2342. this.ws.onopen = () => {
  2343. console.log("ws创建成功!");
  2344. //判断当前路由是否携带friend_id
  2345. if(this.$route.query.friend_id){
  2346. //1.从通讯录进入会话大厅
  2347. this.retrieveSession();
  2348. //2.获取我的用户id
  2349. this.myUserId = this.$store.state.user.userid;
  2350. //把这个id存一下
  2351. this.createMessageId = this.$route.query.friend_id;
  2352. }else{
  2353. //直接进入会话大厅
  2354. //1.获取会话列表
  2355. this.getConversationList();
  2356. //2.获取我的用户id
  2357. this.myUserId = this.$store.state.user.userid;
  2358. //3.循环获取会话列表
  2359. //开启loading
  2360. this.hallLeftLoading = true;
  2361. this.forSearchConversationList();
  2362. }
  2363. };
  2364. //从通讯录创建单聊 end---------------------------------------->
  2365. },
  2366. beforeDestroy() {
  2367. //页面销毁的时候清除定时器获取列表
  2368. clearInterval(this.listTimeOut);
  2369. //页面销毁的时候关闭websocket
  2370. if (this.ws) {
  2371. this.ws.removeEventListener('message', this.handleIncomingMessage);
  2372. this.ws.close();
  2373. }
  2374. }
  2375. }
  2376. </script>
  2377. <style scoped lang="less">
  2378. .hallBox {
  2379. display: flex;
  2380. margin: 30px;
  2381. //左侧
  2382. .hallLeft {
  2383. width: 420px;
  2384. background: #fff;
  2385. border-radius: 20px;
  2386. margin-right: 20px;
  2387. position: relative;
  2388. .hallLeftLoading{
  2389. position: absolute;
  2390. top: 0;
  2391. left: 0;
  2392. width: 420px;
  2393. height: 740px;
  2394. display: flex;
  2395. align-items: center;
  2396. justify-content: center;
  2397. background: rgba(255, 255, 255, 0.5);
  2398. z-index: 100;
  2399. .hallLeftLoadingIcon {
  2400. .hallLeftLoadingIconItem {
  2401. color: #CCCCCC;
  2402. text-align: center;
  2403. margin-bottom: 20px;
  2404. font-size: 60px;
  2405. }
  2406. .hallLeftLoadingText {
  2407. color: #CCCCCC;
  2408. font-size: 32px;
  2409. font-weight: bold;
  2410. }
  2411. }
  2412. }
  2413. .searchBoxMain {
  2414. position: relative;
  2415. .searchFriendClose {
  2416. display: flex;
  2417. align-items: center;
  2418. justify-content: flex-end;
  2419. padding-right: 10px;
  2420. padding-bottom: 10px;
  2421. .rightSlideBoxCloseIcon {
  2422. cursor: pointer;
  2423. width: 28px;
  2424. height: 28px;
  2425. line-height: 28px;
  2426. text-align: center;
  2427. background: #EFEFEF;
  2428. border-radius: 8px;
  2429. }
  2430. }
  2431. .searchBox {
  2432. padding-left: 25px;
  2433. padding-right: 25px;
  2434. padding-bottom: 20px;
  2435. }
  2436. .searchFriendBox {
  2437. position: absolute;
  2438. width: 280px;
  2439. border-radius: 8px;
  2440. top: 0;
  2441. right: -300px;
  2442. background: #fff;
  2443. box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.1);
  2444. border-radius: 8px;
  2445. z-index: 100;
  2446. box-sizing: border-box;
  2447. padding: 20px 0 30px 0;
  2448. .searchFriendItem {
  2449. display: flex;
  2450. align-items: center;
  2451. justify-content: flex-start;
  2452. border-bottom: 1px solid #E9EDF7;
  2453. padding: 0 20px 30px 20px;
  2454. .searchFriendAvatar {
  2455. img {
  2456. width: 66px;
  2457. height: 66px;
  2458. border-radius: 50%;
  2459. }
  2460. margin-right: 15px;
  2461. }
  2462. .searchFriendInfo {
  2463. flex: 1;
  2464. .searchFriendName {
  2465. display: flex;
  2466. align-items: center;
  2467. .gender {
  2468. img {
  2469. width: 12px;
  2470. height: 12px;
  2471. }
  2472. }
  2473. img {
  2474. width: 18px;
  2475. height: 18px;
  2476. cursor: pointer;
  2477. }
  2478. .searchFriendNameText {
  2479. font-size: 18px;
  2480. width: 120px;
  2481. height: 28px;
  2482. line-height: 28px;
  2483. white-space: nowrap;
  2484. overflow: hidden;
  2485. text-overflow: ellipsis;
  2486. }
  2487. }
  2488. .searchFriendPhone {
  2489. font-size: 14px;
  2490. color: #999;
  2491. margin-top: 10px;
  2492. }
  2493. }
  2494. }
  2495. .searchFriendLineBox {
  2496. display: flex;
  2497. align-items: center;
  2498. justify-content: flex-start;
  2499. padding: 20px;
  2500. border-bottom: 1px solid #E9EDF7;
  2501. .searchFriendLineTitle{
  2502. font-size: 16px;
  2503. color: #999999;
  2504. width: 90px;
  2505. }
  2506. .searchFriendLineContent{
  2507. font-size: 16px;
  2508. color: #333;
  2509. flex: 1;
  2510. .searchFriendLineContentItem{
  2511. display: flex;
  2512. align-items: center;
  2513. justify-content: space-between;
  2514. }
  2515. }
  2516. }
  2517. .searchFriendButton {
  2518. padding:40px 0 10px 0;
  2519. text-align: center;
  2520. .searchFriendButtonItem {
  2521. font-size: 14px;
  2522. color: #5570F1;
  2523. img {
  2524. width: 30px;
  2525. height: 30px;
  2526. margin-bottom: 5px;
  2527. }
  2528. }
  2529. }
  2530. }
  2531. }
  2532. .userListBox {
  2533. padding: 15px 0;
  2534. overflow-y: auto;
  2535. height: 560px;
  2536. .active {
  2537. background: #F5F7FD;
  2538. box-sizing: border-box;
  2539. border-right: 4px solid #5570F1 !important;
  2540. }
  2541. .userItem {
  2542. padding: 0 21px 0 25px;
  2543. height: 90px;
  2544. box-sizing: border-box;
  2545. border-right: 4px solid #fff;
  2546. cursor: pointer;
  2547. display: flex;
  2548. align-items: center;
  2549. .flexItemBox{
  2550. width: 100%;
  2551. display: flex;
  2552. align-items: center;
  2553. justify-content: space-between;
  2554. .userAvatar {
  2555. img {
  2556. width: 58px;
  2557. height: 58px;
  2558. border-radius: 50%;
  2559. }
  2560. }
  2561. .userInfo {
  2562. flex: 1;
  2563. box-sizing: border-box;
  2564. padding-left: 15px;
  2565. .userName {
  2566. display: flex;
  2567. align-items: center;
  2568. justify-content: space-between;
  2569. //padding-bottom: 10px;
  2570. .userNameText {
  2571. font-size: 18px;
  2572. font-weight: bold;
  2573. }
  2574. .userMessageNum {
  2575. font-size: 12px;
  2576. color: #333;
  2577. width: 24px;
  2578. height: 24px;
  2579. line-height: 24px;
  2580. text-align: center;
  2581. border-radius: 50%;
  2582. background: #FFCC91;
  2583. font-weight: bold;
  2584. }
  2585. }
  2586. .userMessage {
  2587. display: flex;
  2588. align-items: center;
  2589. justify-content: space-between;
  2590. .userMessageText {
  2591. display: block;
  2592. width: 240px;
  2593. white-space: nowrap;
  2594. overflow: hidden;
  2595. text-overflow: ellipsis;
  2596. font-size: 14px;
  2597. color: #999999;
  2598. }
  2599. .userMessageTime {
  2600. font-size: 14px;
  2601. color: #999999;
  2602. }
  2603. }
  2604. }
  2605. }
  2606. }
  2607. }
  2608. }
  2609. //右侧
  2610. .hallRight {
  2611. flex: 1;
  2612. background: #fff;
  2613. border-radius: 20px;
  2614. position: relative;
  2615. height: 760px;
  2616. display: flex;
  2617. flex-direction: column;
  2618. position: relative;
  2619. .hallRightLoading {
  2620. position: absolute;
  2621. top: 0;
  2622. left: 0;
  2623. height: 740px;
  2624. width: 100%;
  2625. display: flex;
  2626. align-items: center;
  2627. justify-content: center;
  2628. background: rgba(255, 255, 255, 0.5);
  2629. z-index: 100;
  2630. .hallRightLoadingIcon {
  2631. .hallRightLoadingIconItem {
  2632. color: #CCCCCC;
  2633. text-align: center;
  2634. margin-bottom: 20px;
  2635. font-size: 60px;
  2636. }
  2637. .hallRightLoadingText {
  2638. color: #CCCCCC;
  2639. font-size: 32px;
  2640. font-weight: bold;
  2641. }
  2642. }
  2643. }
  2644. .ifHallRigthNoMessage {
  2645. color: #CCCCCC;
  2646. font-size: 32px;
  2647. font-weight: bold;
  2648. text-align: center;
  2649. height: 740px;
  2650. line-height: 740px;
  2651. }
  2652. .userName {
  2653. font-size: 20px;
  2654. color: #333;
  2655. font-weight: bold;
  2656. }
  2657. .ifNotice {
  2658. padding-bottom: 60px !important;
  2659. }
  2660. .UserNameBox {
  2661. display: flex;
  2662. align-items: center;
  2663. justify-content: space-between;
  2664. padding: 40px 30px 30px 30px;
  2665. border-bottom: 1px solid #E7E7E7;
  2666. position: relative;
  2667. .moreIcon {
  2668. cursor: pointer;
  2669. }
  2670. .groupNotice {
  2671. position: absolute;
  2672. height: 40px;
  2673. line-height: 40px;
  2674. font-size: 16px;
  2675. background:url('../../assets/chat/notice.png') no-repeat 10px center #F6F8FE;
  2676. left: 30px;
  2677. box-sizing: border-box;
  2678. padding-left: 40px;
  2679. bottom: 10px;
  2680. color: #999999;
  2681. border-radius: 10px;
  2682. padding-right: 10px;
  2683. width: 400px;
  2684. white-space: nowrap;
  2685. overflow: hidden;
  2686. text-overflow: ellipsis;
  2687. }
  2688. .shareCardIcon {
  2689. font-size: 24px;
  2690. cursor: pointer;
  2691. color: #666;
  2692. }
  2693. }
  2694. .rightPositionBox {
  2695. flex: 1;
  2696. position: relative;
  2697. .rightUserMessageBox {
  2698. padding: 40px;
  2699. height: 375px;
  2700. box-sizing: border-box;
  2701. overflow-y: auto;
  2702. .timeBox {
  2703. width: 100%;
  2704. display: flex;
  2705. align-items: center;
  2706. justify-content: center;
  2707. padding:0 0 30px 0;
  2708. span {
  2709. border-radius: 8px;
  2710. display: block;
  2711. width: 80px;
  2712. height: 30px;
  2713. line-height: 30px;
  2714. font-size: 14px;
  2715. text-align: center;
  2716. display: block;
  2717. background: #F4F5FA;
  2718. color: #999999;
  2719. }
  2720. }
  2721. .newUserStatus {
  2722. width: 100%;
  2723. display: flex;
  2724. align-items: center;
  2725. justify-content: center;
  2726. padding:0 0 30px 0;
  2727. .newUserStatusText {
  2728. display: flex;
  2729. align-items: center;
  2730. justify-content: center;
  2731. border-radius: 8px;
  2732. width: 200px;
  2733. height: 30px;
  2734. line-height: 30px;
  2735. font-size: 14px;
  2736. text-align: center;
  2737. background: #F4F5FA;
  2738. color: #999999;
  2739. }
  2740. span {
  2741. display: inline-block;
  2742. line-height: 30px;
  2743. }
  2744. .newUserStatusTextName {
  2745. display: inline-block;
  2746. width: 100px;
  2747. line-height: 30px;
  2748. overflow: hidden;
  2749. white-space: nowrap;
  2750. text-overflow: ellipsis;
  2751. }
  2752. }
  2753. //其他用户
  2754. .otherUserMessage {
  2755. display: flex;
  2756. align-items: flex-start;
  2757. margin-bottom: 30px;
  2758. .otherUserIcon {
  2759. margin-right: 20px;
  2760. img {
  2761. width: 58px;
  2762. height: 58px;
  2763. border-radius: 50%;
  2764. }
  2765. }
  2766. .otherUserMessageText {
  2767. border-radius: 16px;
  2768. padding: 16px;
  2769. font-size: 16px;
  2770. color: #fff;
  2771. background: #5570F1;
  2772. position: relative;
  2773. min-height: 50px;
  2774. }
  2775. .otherUserMessageText::before {
  2776. content: '';
  2777. position: absolute;
  2778. left: -8px;
  2779. top: 26px;
  2780. transform: translateY(-50%);
  2781. width: 0;
  2782. height: 0;
  2783. border-top: 8px solid transparent;
  2784. border-bottom: 8px solid transparent;
  2785. border-right: 8px solid #5570F1;
  2786. }
  2787. }
  2788. //我
  2789. .meUserMessage {
  2790. display: flex;
  2791. align-items: flex-start;
  2792. margin-bottom: 30px;
  2793. justify-content: flex-end;
  2794. .meUserIcon {
  2795. margin-left: 20px;
  2796. img {
  2797. width: 58px;
  2798. height: 58px;
  2799. border-radius: 50%;
  2800. }
  2801. }
  2802. .meUserMessageText {
  2803. border-radius: 16px;
  2804. padding:16px;
  2805. font-size: 16px;
  2806. color:#333;
  2807. background: #FFEAD1;
  2808. position: relative;
  2809. min-height: 50px;
  2810. cursor: pointer;
  2811. }
  2812. .meUserMessageText::before {
  2813. content: '';
  2814. position: absolute;
  2815. right: -8px;
  2816. top: 26px;
  2817. transform: translateY(-50%);
  2818. width: 0;
  2819. height: 0;
  2820. border-top: 8px solid transparent;
  2821. border-bottom: 8px solid transparent;
  2822. border-left: 8px solid #FFEAD1;
  2823. }
  2824. }
  2825. }
  2826. }
  2827. //消息框
  2828. .sendMessageBox {
  2829. //height: 250px;
  2830. padding: 20px 40px 0 40px;
  2831. border-top: 1px solid #E7E7E7;
  2832. box-sizing: border-box;
  2833. .sendMessageTools {
  2834. display: flex;
  2835. align-items: center;
  2836. justify-content: space-between;
  2837. .toolsBigBox {
  2838. display: flex;
  2839. align-items: center;
  2840. justify-content: space-between;
  2841. .toolsBox {
  2842. display: flex;
  2843. align-items: center;
  2844. justify-content: flex-start;
  2845. img {
  2846. width: 36px;
  2847. height: 36px;
  2848. margin-right: 30px;
  2849. cursor: pointer;
  2850. }
  2851. }
  2852. }
  2853. .fileBox {
  2854. width: 180px;
  2855. display: flex;
  2856. align-items: center;
  2857. border: 1px solid #E9EDF7;
  2858. border-radius: 8px;
  2859. padding: 5px 10px;
  2860. .fileBoxText {
  2861. font-size: 14px;
  2862. color: #999;
  2863. white-space: nowrap;
  2864. overflow: hidden;
  2865. text-overflow: ellipsis;
  2866. width: 110px;
  2867. }
  2868. img {
  2869. width: 40px;
  2870. height: 40px;
  2871. margin-right: 5px;
  2872. }
  2873. }
  2874. }
  2875. .sendMessageInput {
  2876. margin-top: 5px;
  2877. }
  2878. .sendMessageButton {
  2879. padding-top: 20px;
  2880. text-align: right;
  2881. button {
  2882. width: 120px;
  2883. height: 38px;
  2884. }
  2885. }
  2886. }
  2887. //右侧菜单
  2888. .rightSlideBox {
  2889. width: 420px;
  2890. height: 100%;
  2891. position: absolute;
  2892. right: 0;
  2893. top: 0;
  2894. background: #fff;
  2895. box-shadow: -4px 0px 4px 0px rgba(0, 0, 0, 0.1);
  2896. .rightSlideBoxClose {
  2897. padding: 20px 20px 0 20px;
  2898. height: 50px;
  2899. overflow: hidden;
  2900. display: flex;
  2901. align-items: center;
  2902. justify-content: space-between;
  2903. .rightSlideBoxCloseTitle {
  2904. font-size: 18px;
  2905. color: #333;
  2906. }
  2907. .rightSlideBoxCloseIcon {
  2908. cursor: pointer;
  2909. width: 28px;
  2910. height: 28px;
  2911. line-height: 28px;
  2912. text-align: center;
  2913. background: #EFEFEF;
  2914. border-radius: 8px;
  2915. }
  2916. }
  2917. .rightSlideSearch {
  2918. padding: 30px 25px 0 25px;
  2919. height: 66px;
  2920. overflow: hidden;
  2921. position: relative;
  2922. .searchFriendBox {
  2923. position: absolute;
  2924. width: 280px;
  2925. border-radius: 8px;
  2926. top: 65px;
  2927. left: -260px;
  2928. background: #fff;
  2929. box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.1);
  2930. border-radius: 8px;
  2931. z-index: 100;
  2932. box-sizing: border-box;
  2933. padding: 20px 0 30px 0;
  2934. .searchFriendClose {
  2935. display: flex;
  2936. align-items: center;
  2937. justify-content: flex-end;
  2938. padding-right: 10px;
  2939. padding-bottom: 10px;
  2940. .rightSlideBoxCloseIcon {
  2941. cursor: pointer;
  2942. width: 28px;
  2943. height: 28px;
  2944. line-height: 28px;
  2945. text-align: center;
  2946. background: #EFEFEF;
  2947. border-radius: 8px;
  2948. }
  2949. }
  2950. .searchFriendItem {
  2951. display: flex;
  2952. align-items: center;
  2953. justify-content: flex-start;
  2954. border-bottom: 1px solid #E9EDF7;
  2955. padding: 0 20px 30px 20px;
  2956. .searchFriendAvatar {
  2957. img {
  2958. width: 66px;
  2959. height: 66px;
  2960. border-radius: 50%;
  2961. }
  2962. margin-right: 15px;
  2963. }
  2964. .searchFriendInfo {
  2965. flex: 1;
  2966. .searchFriendName {
  2967. display: flex;
  2968. align-items: center;
  2969. .gender {
  2970. img {
  2971. width: 12px;
  2972. height: 12px;
  2973. }
  2974. }
  2975. img {
  2976. width: 18px;
  2977. height: 18px;
  2978. cursor: pointer;
  2979. }
  2980. .searchFriendNameText {
  2981. font-size: 18px;
  2982. width: 120px;
  2983. height: 28px;
  2984. line-height: 28px;
  2985. white-space: nowrap;
  2986. overflow: hidden;
  2987. text-overflow: ellipsis;
  2988. }
  2989. }
  2990. .searchFriendPhone {
  2991. font-size: 14px;
  2992. color: #999;
  2993. margin-top: 10px;
  2994. }
  2995. }
  2996. }
  2997. .searchFriendLineBox {
  2998. display: flex;
  2999. align-items: center;
  3000. justify-content: flex-start;
  3001. padding: 20px;
  3002. border-bottom: 1px solid #E9EDF7;
  3003. .searchFriendLineTitle{
  3004. font-size: 16px;
  3005. color: #999999;
  3006. width: 90px;
  3007. }
  3008. .searchFriendLineContent{
  3009. font-size: 16px;
  3010. color: #333;
  3011. flex: 1;
  3012. .searchFriendLineContentItem{
  3013. display: flex;
  3014. align-items: center;
  3015. justify-content: space-between;
  3016. }
  3017. }
  3018. }
  3019. .searchFriendButton {
  3020. padding:40px 0 10px 0;
  3021. text-align: center;
  3022. .searchFriendButtonItem {
  3023. font-size: 14px;
  3024. color: #5570F1;
  3025. img {
  3026. width: 30px;
  3027. height: 30px;
  3028. margin-bottom: 5px;
  3029. }
  3030. }
  3031. }
  3032. }
  3033. }
  3034. .rightSlideUserBox {
  3035. box-sizing: border-box;
  3036. padding: 40px 40px 10px 40px;
  3037. height: 180px;
  3038. overflow-y: auto;
  3039. display: flex;
  3040. align-items: center;
  3041. flex-wrap: wrap;
  3042. //border-bottom: 1px solid #E9EDF7;
  3043. .rightEditUserItem {
  3044. cursor: pointer;
  3045. // color: #333;
  3046. // .rightSlideUserItemIcon {
  3047. // .addUserIcon {
  3048. // transition: all 0.5s ease;
  3049. // }
  3050. // .addUserIcon:hover {
  3051. // background: #5570F1;
  3052. // color: #fff;
  3053. // }
  3054. // }
  3055. }
  3056. .rightSlideUserItem {
  3057. margin-bottom: 20px;
  3058. width: 25%;
  3059. position: relative;
  3060. //cursor: pointer;
  3061. //用户菜单
  3062. .rightSlideUserItemMore {
  3063. position: absolute;
  3064. background: #fff;
  3065. box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.1);
  3066. bottom: -220px;
  3067. left: -240px;
  3068. width: 280px;
  3069. height: 270px;
  3070. .rightSlideUserItemMoreMain {
  3071. display: flex;
  3072. align-items: center;
  3073. justify-content: flex-start;
  3074. padding:0 20px;
  3075. .rightSlideUserItemMoreMainIcon {
  3076. img {
  3077. width: 66px;
  3078. height: 66px;
  3079. border-radius: 50%;
  3080. }
  3081. }
  3082. .rightSlideUserItemMoreMainInfo {
  3083. padding: 30px 0 30px 20px;
  3084. border-bottom: 1px solid #E9EDF7;
  3085. flex: 1;
  3086. .rightSlideUserItemMoreMainInfoTop {
  3087. display: flex;
  3088. align-items: center;
  3089. justify-content: space-between;
  3090. .rightSlideUserItemMoreUserName {
  3091. display: flex;
  3092. align-items: center;
  3093. justify-content: center;
  3094. font-size: 18px;
  3095. .rightSlideUserItemMoreUserMore {
  3096. margin-left: 10px;
  3097. img {
  3098. width: 12px;
  3099. height: 12px;
  3100. }
  3101. }
  3102. }
  3103. .rightSlideUserItemMoreUserMoreIcon {
  3104. img {
  3105. width: 18px;
  3106. height: 18px;
  3107. }
  3108. }
  3109. }
  3110. }
  3111. .rightSlideUserItemMoreNumber {
  3112. font-size: 14px;
  3113. color: #999;
  3114. margin-top: 10px;
  3115. }
  3116. }
  3117. .rightSlideUserItemMoreLine {
  3118. .rightSlideUserItemMoreLineItem {
  3119. padding: 20px;
  3120. border-bottom: 1px solid #E9EDF7;
  3121. display: flex;
  3122. .rightSlideUserItemMoreTitle {
  3123. font-size: 16px;
  3124. color: #999;
  3125. width: 80px;
  3126. }
  3127. .rightSlideUserItemMoreText {
  3128. font-size: 16px;
  3129. color: #333;
  3130. display: flex;
  3131. align-items: center;
  3132. justify-content: space-between;
  3133. flex:1;
  3134. }
  3135. }
  3136. .rightSlideUserItemMoreLineButton {
  3137. padding-top: 25px;
  3138. text-align: center;
  3139. font-size: 14px;
  3140. color:#5570F1;
  3141. display: flex;
  3142. align-items: center;
  3143. justify-content: center;
  3144. img {
  3145. width: 25px;
  3146. height: 25px;
  3147. margin-bottom: 8px;
  3148. }
  3149. .rightSlideUserItemMoreLineGroup {
  3150. width: 33.33%;
  3151. }
  3152. }
  3153. }
  3154. }
  3155. .rightSlideUserItemIcon {
  3156. display: flex;
  3157. align-items: center;
  3158. justify-content: center;
  3159. img {
  3160. width: 58px;
  3161. height: 58px;
  3162. border-radius: 50%;
  3163. }
  3164. .el-dropdown-link {
  3165. width: 58px;
  3166. height: 58px;
  3167. }
  3168. .addUserIcon {
  3169. width: 58px;
  3170. height: 58px;
  3171. line-height: 58px;
  3172. background: #F0F0F0;
  3173. border-radius: 50%;
  3174. text-align: center;
  3175. color:#fff;
  3176. font-size: 32px;
  3177. }
  3178. }
  3179. .rightSlideUserItemName {
  3180. //width: 80px;
  3181. padding: 0 5px;
  3182. font-size: 16px;
  3183. color: #333;
  3184. margin-top: 10px;
  3185. text-align: center;
  3186. white-space: nowrap; /* 强制不换行 */
  3187. overflow: hidden; /* 超出宽度隐藏 */
  3188. text-overflow: ellipsis; /* 显示省略号 */
  3189. }
  3190. }
  3191. }
  3192. .rightLineBorder {
  3193. width: 100%;
  3194. border-bottom: 1px solid #E9EDF7;
  3195. }
  3196. .rightSlideMore {
  3197. padding: 30px 40px;
  3198. font-size: 18px;
  3199. color: #999;
  3200. text-align: center
  3201. }
  3202. //聊天记录
  3203. .rightSlideFunction {
  3204. .rightSlideFunctionItem {
  3205. height: 60px;
  3206. display: flex;
  3207. align-items: center;
  3208. justify-content: space-between;
  3209. padding: 20px 40px;
  3210. border-bottom: 1px solid #E9EDF7;
  3211. cursor: pointer;
  3212. .rightSlideFunctionItemText {
  3213. font-size: 18px;
  3214. color: #333;
  3215. }
  3216. .rightSlideFunctionItemIcon {
  3217. img {
  3218. width: 18px;
  3219. height: 18px;
  3220. }
  3221. }
  3222. }
  3223. }
  3224. //群聊设置
  3225. .groupSystem {
  3226. border-bottom: 1px solid #E9EDF7;
  3227. padding-bottom: 30px;
  3228. .groupChatSystem {
  3229. padding: 30px 40px 0 40px;
  3230. height: 80px;
  3231. overflow: hidden;
  3232. .groupChatTitle {
  3233. font-size: 18px;
  3234. color: #333;
  3235. margin-bottom: 10px;
  3236. }
  3237. .groupChatText {
  3238. width: 100%;
  3239. height: 20px;
  3240. overflow: hidden;
  3241. font-size: 18px;
  3242. color: #999;
  3243. cursor: pointer;
  3244. white-space: nowrap;
  3245. text-overflow: ellipsis;
  3246. }
  3247. }
  3248. }
  3249. .rightSlideFooterBox {
  3250. flex: 1;
  3251. display: flex;
  3252. align-items: center;
  3253. justify-content: space-between;
  3254. div{
  3255. width: 33%;
  3256. text-align: center;
  3257. font-size: 16px;
  3258. color: #666;
  3259. cursor: pointer;
  3260. margin-top: 30px;
  3261. box-sizing: border-box;
  3262. border-right: 1px solid #E9EDF7;
  3263. }
  3264. }
  3265. .rightSlideFooter {
  3266. font-size: 18px;
  3267. color: #666;
  3268. padding: 30px 40px;
  3269. text-align: center;
  3270. cursor: pointer;
  3271. border-bottom: 1px solid #E9EDF7;
  3272. }
  3273. .isLast {
  3274. border-bottom: 0;
  3275. color: #999;
  3276. }
  3277. }
  3278. }
  3279. }
  3280. //不同的消息类型
  3281. //发送文件
  3282. .messageTypeFile {
  3283. width: 283px;
  3284. background: #fff;
  3285. border-radius: 16px;
  3286. border: 1px solid #E9EDF7;
  3287. cursor:pointer;
  3288. .messageTypeFileTop{
  3289. border-bottom: 1px solid #E9EDF7;
  3290. .messageTypeFileSize {
  3291. padding: 10px 20px 10px 20px;
  3292. }
  3293. .messageTypeFileInfo {
  3294. display: flex;
  3295. align-items: center;
  3296. padding:20px 20px 20px 20px;
  3297. .messageTypeFileTitle {
  3298. font-size: 16px;
  3299. color: #333;
  3300. height: auto; /* Allow height to adjust */
  3301. max-height: 48px; /* Maximum height for two lines (16px * 2) */
  3302. overflow: hidden; /* Hide overflow */
  3303. text-overflow: ellipsis; /* Show ellipsis for overflow text */
  3304. display: -webkit-box; /* Use flexbox for multi-line ellipsis */
  3305. -webkit-box-orient: vertical; /* Set box orientation to vertical */
  3306. -webkit-line-clamp: 2; /* Limit to 2 lines */
  3307. white-space: normal; /* Allow text wrapping */
  3308. width: 200px;
  3309. }
  3310. .messageTypeFileIcon {
  3311. img {
  3312. width: 42px;
  3313. height: 42px;
  3314. }
  3315. }
  3316. }
  3317. }
  3318. .messageTypeFileLogo {
  3319. padding:15px 20px;
  3320. }
  3321. .messageTypeFileSize {
  3322. font-size: 12px;
  3323. color: #999;
  3324. }
  3325. .messageTypeFileLogo {
  3326. font-size: 12px;
  3327. color: #999;
  3328. }
  3329. }
  3330. //发送名片
  3331. .messageTypeCard {
  3332. width: 321px;
  3333. background: #fff;
  3334. border-radius: 16px;
  3335. border: 1px solid #E9EDF7;
  3336. .messageTypeCardTop {
  3337. display: flex;
  3338. align-items: center;
  3339. padding: 20px 20px 24px 20px;
  3340. border-bottom: 1px solid #E9EDF7;
  3341. .messageTypeCardIcon {
  3342. margin-right: 15px;
  3343. img {
  3344. width: 58px;
  3345. height: 58px;
  3346. border-radius: 50%;
  3347. }
  3348. }
  3349. .messageTypeCardName {
  3350. font-size: 16px;
  3351. color: #333;
  3352. }
  3353. }
  3354. .messageTypeCardText {
  3355. padding-top: 14px;
  3356. padding-left: 20px;
  3357. padding-bottom: 15px;
  3358. font-size: 12px;
  3359. color: #999999;
  3360. }
  3361. }
  3362. //发送图片
  3363. .messageTypeImage {
  3364. width: 200px;
  3365. //height: 200px;
  3366. img {
  3367. max-width: 200px;
  3368. border-radius: 16px;
  3369. border: 1px solid #ECECEC;
  3370. }
  3371. }
  3372. //发送群聊
  3373. .messageGroupInvite {
  3374. background: #fff;
  3375. border-radius: 16px;
  3376. border: 1px solid #E9EDF7;
  3377. .messageGroupInviteTop {
  3378. display: flex;
  3379. align-items: center;
  3380. justify-content: space-between;
  3381. padding: 20px 20px 24px 20px;
  3382. .messageGroupInviteIcon {
  3383. margin-right: 15px;
  3384. img {
  3385. width: 58px;
  3386. height: 58px;
  3387. border-radius: 50%;
  3388. }
  3389. }
  3390. .messageGroupInfoText {
  3391. .messageGroupInfoTextTitle {
  3392. font-size: 16px;
  3393. color: #333;
  3394. margin-bottom: 5px;
  3395. }
  3396. .messageGroupInfoTextTxt {
  3397. font-size: 12px;
  3398. color: #999;
  3399. line-height: 18px;
  3400. }
  3401. }
  3402. }
  3403. .messageGroupInviteText {
  3404. padding-top: 14px;
  3405. padding-left: 20px;
  3406. padding-bottom: 15px;
  3407. font-size: 12px;
  3408. color: #999999;
  3409. border-top: 1px solid #E9EDF7;
  3410. }
  3411. }
  3412. //添加用户弹出框
  3413. .searchWindow {
  3414. display: flex;
  3415. .searchWindowLeft {
  3416. width: 330px;
  3417. box-sizing: border-box;
  3418. border-right: 1px solid #E9EDF7;
  3419. padding-right: 25px;
  3420. .searchUserWindowBox {
  3421. position: relative;
  3422. .searchFriendClose {
  3423. display: flex;
  3424. align-items: center;
  3425. justify-content: flex-end;
  3426. padding-right: 10px;
  3427. padding-bottom: 10px;
  3428. .rightSlideBoxCloseIcon {
  3429. cursor: pointer;
  3430. width: 28px;
  3431. height: 28px;
  3432. line-height: 28px;
  3433. text-align: center;
  3434. background: #EFEFEF;
  3435. border-radius: 8px;
  3436. }
  3437. }
  3438. .searchFriendBox {
  3439. position: absolute;
  3440. width: 280px;
  3441. border-radius: 8px;
  3442. top: 0;
  3443. right: -280px;
  3444. background: #fff;
  3445. box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.1);
  3446. border-radius: 8px;
  3447. z-index: 100;
  3448. box-sizing: border-box;
  3449. padding: 20px 0 30px 0;
  3450. .searchFriendItem {
  3451. display: flex;
  3452. align-items: center;
  3453. justify-content: flex-start;
  3454. border-bottom: 1px solid #E9EDF7;
  3455. padding: 0 20px 30px 20px;
  3456. .searchFriendAvatar {
  3457. img {
  3458. width: 66px;
  3459. height: 66px;
  3460. border-radius: 50%;
  3461. }
  3462. margin-right: 15px;
  3463. }
  3464. .searchFriendInfo {
  3465. flex: 1;
  3466. .searchFriendName {
  3467. display: flex;
  3468. align-items: center;
  3469. .gender {
  3470. img {
  3471. width: 12px;
  3472. height: 12px;
  3473. }
  3474. }
  3475. img {
  3476. width: 18px;
  3477. height: 18px;
  3478. cursor: pointer;
  3479. }
  3480. .searchFriendNameText {
  3481. font-size: 18px;
  3482. width: 120px;
  3483. height: 28px;
  3484. line-height: 28px;
  3485. white-space: nowrap;
  3486. overflow: hidden;
  3487. text-overflow: ellipsis;
  3488. }
  3489. }
  3490. .searchFriendPhone {
  3491. font-size: 14px;
  3492. color: #999;
  3493. margin-top: 10px;
  3494. }
  3495. }
  3496. }
  3497. .searchFriendLineBox {
  3498. display: flex;
  3499. align-items: center;
  3500. justify-content: flex-start;
  3501. padding: 20px;
  3502. border-bottom: 1px solid #E9EDF7;
  3503. .searchFriendLineTitle{
  3504. font-size: 16px;
  3505. color: #999999;
  3506. width: 90px;
  3507. }
  3508. .searchFriendLineContent{
  3509. font-size: 16px;
  3510. color: #333;
  3511. flex: 1;
  3512. .searchFriendLineContentItem{
  3513. display: flex;
  3514. align-items: center;
  3515. justify-content: space-between;
  3516. }
  3517. }
  3518. }
  3519. .searchFriendButton {
  3520. padding:40px 0 10px 0;
  3521. text-align: center;
  3522. .searchFriendButtonItem {
  3523. font-size: 14px;
  3524. color: #5570F1;
  3525. img {
  3526. width: 30px;
  3527. height: 30px;
  3528. margin-bottom: 5px;
  3529. }
  3530. }
  3531. }
  3532. }
  3533. }
  3534. .searchUserBox {
  3535. padding-top: 30px;
  3536. .searchNameEnglish {
  3537. font-size: 18px;
  3538. color: #999;
  3539. padding: 30px 0 20px 0;
  3540. }
  3541. .searchUserItem {
  3542. display: flex;
  3543. align-items: center;
  3544. margin-bottom: 20px;
  3545. .searchUserName {
  3546. font-size: 18px;
  3547. font-weight: bold;
  3548. color: #333;
  3549. }
  3550. img {
  3551. width: 38px;
  3552. height: 38px;
  3553. border-radius: 50%;
  3554. margin: 0 20px;
  3555. }
  3556. }
  3557. }
  3558. }
  3559. .searchWindowRight {
  3560. width: 690px;
  3561. .searchWindowRightTop {
  3562. display: flex;
  3563. align-items: center;
  3564. justify-content: space-between;
  3565. padding: 0 30px 30px 30px;
  3566. .searchWindowRightTitle {
  3567. font-size: 18px;
  3568. color: #333;
  3569. }
  3570. .searchWindowRightNum {
  3571. font-size: 18px;
  3572. color: #999;
  3573. }
  3574. }
  3575. .searchWindowUserList {
  3576. padding: 0 30px;
  3577. height: 400px;
  3578. display: flex;
  3579. flex-wrap: wrap;
  3580. align-items: flex-start;
  3581. align-content: flex-start;
  3582. .searchWindowUserItem {
  3583. width:20%;
  3584. text-align: center;
  3585. margin-bottom: 30px;
  3586. .searchWindowUserName {
  3587. font-size: 18px;
  3588. color: #333;
  3589. font-weight: bold;
  3590. width: 122px;
  3591. white-space: nowrap; /* 强制不换行 */
  3592. overflow: hidden; /* 超出宽度隐藏 */
  3593. text-overflow: ellipsis; /* 显示省略号 */
  3594. }
  3595. .searchWindowUserIcon {
  3596. width: 58px;
  3597. height: 58px;
  3598. position: relative;
  3599. margin: 0 auto 10px auto;
  3600. .searchWindowDeleteUser {
  3601. position: absolute;
  3602. width: 15px;
  3603. height: 15px;
  3604. background: rgba(0,0,0,0.3);
  3605. border-radius: 5px;
  3606. color: #fff;
  3607. right: -3px;
  3608. top: -3px;
  3609. cursor: pointer;
  3610. }
  3611. img {
  3612. width: 58px;
  3613. height: 58px;
  3614. border-radius: 50%;
  3615. margin-bottom: 10px;
  3616. }
  3617. }
  3618. }
  3619. }
  3620. .shareCardBox {
  3621. border-top: 1px solid #E9EDF7;
  3622. .shareCardTitle {
  3623. padding: 30px;
  3624. }
  3625. .shareCardInput {
  3626. padding: 0 30px 0 30px;
  3627. }
  3628. }
  3629. .searchWindowFooter {
  3630. text-align: center;
  3631. padding-top: 30px;
  3632. }
  3633. }
  3634. }
  3635. //聊天记录弹出框
  3636. .fileWindow {
  3637. .fileWindowHeader {
  3638. margin-bottom: 20px;
  3639. }
  3640. .fileWindowMessageTime {
  3641. width: 100px;
  3642. height: 37px;
  3643. line-height: 37px;
  3644. text-align: center;
  3645. background: #F4F5FA;
  3646. border-radius: 8px;
  3647. font-size: 14px;
  3648. color: #999999;
  3649. margin-top: 30px;
  3650. }
  3651. .fileWindowMessageScrollBox {
  3652. height: 500px;
  3653. overflow-y: auto;
  3654. }
  3655. .fileWindowNoMessage {
  3656. font-size: 18px;
  3657. color: #999;
  3658. text-align: center;
  3659. height: 500px;
  3660. line-height: 500px;
  3661. }
  3662. .fileWindowMessageItemBox {
  3663. display: flex;
  3664. align-items: flex-start;
  3665. .active {
  3666. background: #F5F7FD;
  3667. border-right: 4px solid #5570F1 !important;
  3668. }
  3669. .historicalMessageBox {
  3670. width: 100%;
  3671. display: flex;
  3672. align-items: flex-start;
  3673. padding: 30px 0 20px 0;
  3674. border-bottom: 1px solid #E9EDF7;
  3675. }
  3676. .fileWindowMessageItemIcon {
  3677. img {
  3678. width: 58px;
  3679. height: 58px;
  3680. border-radius: 50%;
  3681. }
  3682. }
  3683. .fileWindowMessageItemIcon {
  3684. padding-right: 15px;
  3685. }
  3686. .fileWindowMessageItem {
  3687. flex: 1;
  3688. .fileWindowMessageItemInfo {
  3689. display: flex;
  3690. align-items: center;
  3691. justify-content: space-between;
  3692. padding-bottom: 20px;
  3693. .fileWindowMessageItemName {
  3694. font-size: 18px;
  3695. color: #333;
  3696. }
  3697. .fileWindowMessageItemTime {
  3698. font-size: 14px;
  3699. color: #999;
  3700. }
  3701. }
  3702. .fileWindowMessageItemText {
  3703. font-size: 14px;
  3704. color: #999;
  3705. }
  3706. .fileWindowMessageItemImage {
  3707. width: 150px;
  3708. height: 150px;
  3709. border-radius: 16px;
  3710. border: 1px solid #ECECEC;
  3711. }
  3712. }
  3713. }
  3714. //文件列表
  3715. .fileWindowFlieBox {
  3716. .fileWindowFlieItem {
  3717. padding:30px 0 20px 0;
  3718. display: flex;
  3719. align-items: center;
  3720. border-bottom: 1px solid #E9EDF7;
  3721. .fileWindowFlieItemIcon {
  3722. margin-right: 10px;
  3723. img {
  3724. width: 42px;
  3725. height: 42px;
  3726. }
  3727. }
  3728. .fileWindowFlieItemMain {
  3729. flex: 1;
  3730. .fileWindowFlieItemTitle {
  3731. display: flex;
  3732. align-items: center;
  3733. justify-content: space-between;
  3734. font-size: 16px;
  3735. color: #333;
  3736. margin-bottom: 6px;
  3737. }
  3738. .fileWindowFlieItemTime {
  3739. font-size: 14px;
  3740. color: #999;
  3741. }
  3742. .fileWindowFlieInfo {
  3743. display: flex;
  3744. align-items: center;
  3745. justify-content: space-between;
  3746. font-size: 12px;
  3747. color: #999;
  3748. }
  3749. }
  3750. }
  3751. }
  3752. //图片列表
  3753. .fileWindowImageBox {
  3754. display: flex;
  3755. flex-wrap: wrap;
  3756. div {
  3757. width: 25%;
  3758. text-align: center;
  3759. padding: 20px 0 0 0;
  3760. }
  3761. img {
  3762. width: 150px;
  3763. height: 150px;
  3764. border-radius: 16px;
  3765. border: 1px solid #ECECEC;
  3766. }
  3767. }
  3768. //日期���索
  3769. .fileWindowDateBox {
  3770. width: 100%;
  3771. padding: 30px 0;
  3772. }
  3773. .fileWindowDateButton {
  3774. margin-left: 10px;
  3775. }
  3776. //群成员搜索
  3777. .fileWindowGroupMain{
  3778. display: flex;
  3779. .fileWindowGroupUserLeft {
  3780. flex: 1;
  3781. box-sizing: border-box;
  3782. padding-right: 20px;
  3783. }
  3784. .fileWindowGroupUserRight {
  3785. width: 300px;
  3786. .fileWindowGroupUserBox {
  3787. padding: 30px 0;
  3788. .searchUserBox {
  3789. .searchNameEnglish {
  3790. font-size: 18px;
  3791. color: #999;
  3792. padding: 30px 0 20px 0;
  3793. }
  3794. .searchUserItem {
  3795. display: flex;
  3796. align-items: center;
  3797. .searchUserName {
  3798. font-size: 18px;
  3799. font-weight: bold;
  3800. color: #333;
  3801. }
  3802. img {
  3803. width: 38px;
  3804. height: 38px;
  3805. border-radius: 50%;
  3806. margin: 0 20px 0 0;
  3807. }
  3808. }
  3809. }
  3810. }
  3811. }
  3812. }
  3813. }
  3814. //添加用户弹出框
  3815. .messageFormBox {
  3816. .messageFormTitle {
  3817. font-size: 18px;
  3818. padding-bottom: 20px;
  3819. }
  3820. .messageFormInput {
  3821. margin-bottom: 30px;
  3822. }
  3823. }
  3824. .imgZoomBox {
  3825. img {
  3826. width: 550px;
  3827. }
  3828. }
  3829. //弹出框底部按钮
  3830. .footerButtonBox {
  3831. padding-top: 40px;
  3832. text-align: center;
  3833. }
  3834. //加入群聊弹出框
  3835. .addGroupWindow {
  3836. .addGroupWindowImg {
  3837. img {
  3838. width:58px;
  3839. height: 58px;
  3840. }
  3841. text-align: center;
  3842. font-size: 18px;
  3843. color: #333;
  3844. }
  3845. .addGroupWindowTitle {
  3846. font-size: 18px;
  3847. color: #333;
  3848. text-align: center;
  3849. padding: 20px 0 40px 0;
  3850. }
  3851. .addGroupWindowText {
  3852. font-size: 12px;
  3853. color: #999;
  3854. text-align: center;
  3855. }
  3856. }
  3857. .shareCardWindowBox{
  3858. .shareCardWindowBoxMain {
  3859. border: 1px solid #E9EDF7;
  3860. border-top: none;
  3861. border-bottom-left-radius: 4px;
  3862. border-bottom-right-radius: 4px;
  3863. background: #F5F7FB;
  3864. padding-left: 14px;
  3865. padding: 10px;
  3866. }
  3867. .shareCardRadioBox {
  3868. height: 50px;
  3869. display: flex;
  3870. align-items: center;
  3871. justify-content: flex-start;
  3872. >.el-radio {
  3873. margin-right: 5px;
  3874. }
  3875. }
  3876. .shareCardItem{
  3877. display: flex;
  3878. align-items: center;
  3879. justify-content: flex-start;
  3880. .shareCardName {
  3881. font-size: 14px;
  3882. color: #333;
  3883. margin-left: 10px;
  3884. }
  3885. img {
  3886. width: 38px;
  3887. height: 38px;
  3888. border-radius: 50%;
  3889. }
  3890. }
  3891. }
  3892. //表单微调 start------------------------------------------------------------>*/
  3893. ::v-deep .custom-form-item > .el-form-item__label {
  3894. line-height: 140px !important;
  3895. }
  3896. ::v-deep .custom-textarea .el-textarea__inner {
  3897. resize: none; /* 禁止用拖拽调整大小 */
  3898. }
  3899. ::v-deep .custom-align-right .el-form-item__label {
  3900. text-align: right; /* 设置标签文字右对齐 */
  3901. }
  3902. ::v-deep .el-select-group__title {
  3903. color: #909399;
  3904. }
  3905. ::v-deep .el-select {
  3906. width: 100% !important;
  3907. }
  3908. ::v-deep .el-tabs__active-bar{
  3909. height: 1px !important;
  3910. }
  3911. ::v-deep .el-tabs__nav-wrap::after {
  3912. height:1px !important;
  3913. }
  3914. ::v-deep .el-tabs__header {
  3915. margin-bottom: 0 !important;
  3916. }
  3917. /* 添加样式以确保右键菜单的显示 */
  3918. .el-dropdown {
  3919. z-index: 2000; /* 确保右键菜单在其他元素之上 */
  3920. }
  3921. </style>