hall.vue 146 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998
  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.created_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.created_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.created_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. export default {
  1157. components: {
  1158. hallTitle
  1159. },
  1160. data() {
  1161. return {
  1162. //1.全局配置 start---------------------------------------->
  1163. myUserId:'',//我的用户id
  1164. tableTitleName:'聊天列表',//左侧菜单标题
  1165. messageTitle:'',//当前的聊天名称
  1166. groupProfile:'',//当前的群公告
  1167. listTimeOut:null,//定时器
  1168. addFriendWindowStatus:false,//添加好友弹出框
  1169. addform:{
  1170. friend_id:'',//好友id
  1171. remark:'',//备注名
  1172. },
  1173. formLabelWidth:'100px',
  1174. imgZoomStatus:false,//图片放大框
  1175. imgZoomUrl:'',//图片放大框的图片地址
  1176. //1.全局配置 end---------------------------------------->
  1177. //2.会话列表 start---------------------------------------->
  1178. hallLeftLoading:false,//左侧加载中
  1179. hallRightLoading:false,//右侧加载中
  1180. conversationList:[],//会话列表
  1181. groupConversationList:[],//群聊会话列表
  1182. selectConversationItem:{},//选择会话
  1183. searchConversationStatus:false,//搜索会话状态
  1184. chatrecords:[],//聊天记录
  1185. ifTop:false,//是否为置顶
  1186. searchConversation:'',//搜索会话
  1187. //2.会话列表 end---------------------------------------->
  1188. //3.聊天记录 start---------------------------------------->
  1189. receiverId:'',//接收消息的id
  1190. receiverType:'',//接收消息的类型 1单聊 2群聊
  1191. ifNoMessage:true,//如果没有选择任何聊天记录
  1192. searchChatRecords:"",//搜索聊天记录
  1193. userMessage:'',//用户发送的消息
  1194. fileWindowStatus:false,//聊天记录弹出框是否显示
  1195. activeName: 'all',//聊天记录选项卡
  1196. time:'',//按照时间搜索
  1197. //3.聊天记录 end---------------------------------------->
  1198. //4.群聊 start---------------------------------------->
  1199. //4.1 创建群聊
  1200. groupWindowStatus:false,//添加聊天群组出框是否显示
  1201. groupFriendsWindowStatus:false,//创建群聊时搜索框
  1202. friendsList:[],//左侧好友列表
  1203. searchFriendGroup:'',//搜索群聊的输入框绑定值
  1204. groupFriendSearchUser:{},//编辑群时搜索群成员 用于显示搜索结果
  1205. //4.2 加入群聊
  1206. addGroupWindow:false,//加入群聊弹出框
  1207. //4.2 编辑群聊
  1208. groupId:'',//当前编辑的群聊的id
  1209. creatorId:'',//群主id
  1210. groupUserList:[],//群成员列表
  1211. groupInfo:{},//群设置信息
  1212. groupSearchUser:{},//编辑群时搜索群成员 用于显示搜索结果
  1213. rightSlideBoxShow:false,//右侧菜单是否显示
  1214. searchGroup:'',//搜索群聊的输入框绑定值
  1215. editGroupNoticeWindow:false,//编辑群公告弹出框
  1216. editGroupNameWindow:false,//编辑群名称弹出框
  1217. groupEditWindowStatus:false,//编辑群成员弹出框
  1218. groupEditMainWindowStatus:false,//编辑弹框中搜索人员
  1219. searchUser:"",//右侧菜单的搜索框
  1220. groupRightUserInfo:{},//直接从右侧群组菜单中搜索成员
  1221. groupRightSearchWindow:false,//右侧群组详情弹出框
  1222. //shareGroupMessage:"",//分享群聊的消息
  1223. shareGroupWindowStatus:false,//分享群聊弹出框
  1224. shareGroupActive:'friend',//分享名片选项卡
  1225. shareGroupId:'',//要分享给谁
  1226. useShareGroupInfo:{},//分享名片时选中的群组信息
  1227. groupInviteInfo:{},//群邀请信息
  1228. //4.群聊 end---------------------------------------->
  1229. //6.名片 start---------------------------------------->
  1230. //userCardMessage:'',//用户留言
  1231. userCardWindowStatus:false,//用户名片弹出框
  1232. shareTableActive:'friend',//分享名片选项卡
  1233. useShareUserId:'',//分享名片时选中的用户id
  1234. useShareUserInfo:{},//分享名片时选中的用户信息
  1235. //6.名片 end---------------------------------------->
  1236. //7.加好友 start---------------------------------------->
  1237. addUserWindowStatus:false,//添加用户弹出框是否显示
  1238. form:{
  1239. //好友申请
  1240. addUserForm:{
  1241. notes:"",//备注
  1242. nickname:"",//修改昵称
  1243. }
  1244. },
  1245. //7.加好友 end---------------------------------------->
  1246. //8.发消息 start---------------------------------------->
  1247. sendMessage:{
  1248. img:{
  1249. imgUrl:'',//图片地址
  1250. oldFileName:"",//文件名
  1251. },
  1252. file:{
  1253. fileUrl:'',
  1254. oldFileName:"",//文件名
  1255. }
  1256. }
  1257. //8.发消息 end---------------------------------------->
  1258. //老刘的代码 start---------------------------------------->
  1259. // activeConversation: null,
  1260. // newMessage: '',
  1261. // conversations: [],
  1262. // ws: null,
  1263. // contextMenuVisible: false, // 控制右键菜单的显示
  1264. // contextMenuX: 0, // 右键菜单的 X 坐标
  1265. // contextMenuY: 0, // 右键菜单的 Y 坐标
  1266. // selectedConversation: null // 选中的对话
  1267. //老刘的代码 end---------------------------------------->
  1268. };
  1269. },
  1270. methods: {
  1271. //1.会话列表 start---------------------------------------->
  1272. //1.1获取会话列表
  1273. getConversationList(){
  1274. this.$store.dispatch('chat/getConversation',{}).then(res=> {
  1275. console.log(res)
  1276. let data = res.data;
  1277. for(let item of data){
  1278. item.status = 0; //默认未选中
  1279. }
  1280. this.conversationList = data;
  1281. this.hallLeftLoading = false;
  1282. }).catch(() => {
  1283. this.$message.error('获取会话列表失败!')
  1284. })
  1285. },
  1286. //1.2选择会话
  1287. selectConversation(item){
  1288. console.log(item)
  1289. //选择会话的时候开启loading框
  1290. this.hallRightLoading = true;
  1291. //关闭右侧详情框
  1292. this.closeRightDetailWindow();
  1293. //使用receiverId判断当前是哪个会话
  1294. this.receiverId = item.receiver_id;
  1295. //会话类型 = 1 单聊
  1296. this.receiverType = 1;
  1297. //分享名片时需要使用用户的头像和名称
  1298. this.useShareUserInfo = item;
  1299. //关闭搜索会话搜索框
  1300. this.closeSearchConversation();
  1301. //清理单聊状态
  1302. this.conversationList.forEach(conversation => {
  1303. conversation.status = (conversation.receiver_id === item.receiver_id) ? 1 : 0;
  1304. if(conversation.receiver_id === item.receiver_id){
  1305. //当前的聊天名称
  1306. this.messageTitle = item.user_name;
  1307. }
  1308. });
  1309. //console.log(this.conversationList)
  1310. this.getchatrecords(item.receiver_id);
  1311. //关闭没有选择任何聊天的界面
  1312. this.ifNoMessage = false;
  1313. //选择单聊的时候把群聊的id清空
  1314. this.groupId = '';
  1315. },
  1316. //1.3获取聊天记录
  1317. getchatrecords(user_id){
  1318. this.$store.dispatch('chat/getChatRecords',{friend_id:user_id}).then(res=> {
  1319. console.log(res)
  1320. this.chatrecords = res.data.data;
  1321. //滚动条滚动到底部
  1322. this.scorllBottom();
  1323. console.log(this.chatrecords)
  1324. //选择会话后关闭loading框
  1325. this.hallRightLoading = false;
  1326. }).catch(() => {
  1327. this.$message.error('获取聊天记录失败!')
  1328. //选择会话后关闭loading框
  1329. this.hallRightLoading = false;
  1330. })
  1331. },
  1332. //1.4搜索会话
  1333. searchUserConversation(){
  1334. this.selectConversationItem = {};
  1335. let flag = false; //是否找到会话
  1336. //当group_name等于搜索内容的时候,选择会话
  1337. for(let item of this.conversationList){
  1338. if(item.group_name==this.searchConversation||item.user_name==this.searchConversation){
  1339. this.selectConversationItem = item;
  1340. flag = true;
  1341. }
  1342. }
  1343. //如果没有找到会话 就提示没有找到
  1344. if(!flag){
  1345. this.$message.error('没有找到该会话!')
  1346. }else{
  1347. this.searchConversationStatus = true;
  1348. }
  1349. },
  1350. //1.5关闭搜索会话
  1351. closeSearchConversation(){
  1352. this.selectConversationItem = {};
  1353. this.searchConversationStatus = false;
  1354. },
  1355. //1.6 搜索并定位聊天记录
  1356. searchChatRecordsUser() {
  1357. // 获取输入的内容
  1358. const searchTerm = this.searchChatRecords.toLowerCase();
  1359. // 查找匹配的消息
  1360. const matchingItem = this.chatrecords.find(item => {
  1361. return item.content.toLowerCase().includes(searchTerm);
  1362. });
  1363. // 如果找到匹配的消息,滚动到该消息
  1364. if (matchingItem) {
  1365. const index = this.chatrecords.indexOf(matchingItem);
  1366. this.$nextTick(() => {
  1367. const messageElements = this.$refs.fileWindowMessageScrollBox.children;
  1368. if (messageElements[index]) {
  1369. messageElements[index].scrollIntoView({ behavior: 'smooth', block: 'nearest' });
  1370. }
  1371. });
  1372. } else {
  1373. this.$message.error('聊天信息不存在!'); // 提示用户
  1374. }
  1375. },
  1376. //1.7 从通讯录进入会话大厅
  1377. retrieveSession(){
  1378. //1.获取会话列表
  1379. this.$store.dispatch('chat/getConversation',{}).then(res=> {
  1380. //2.查询当前会话中是否已经存在该好友的会话
  1381. let data = res.data;
  1382. let SeleteItem = {};
  1383. let flag = false;//对话是否已经存在
  1384. for(let item of data){
  1385. //3.如果会话中含有该好友的会话,则选中该会话
  1386. if(item.receiver_id == this.$route.query.friend_id){
  1387. item.status = 1;
  1388. SeleteItem = item;
  1389. flag = true;
  1390. }else{
  1391. item.status = 0;
  1392. }
  1393. }
  1394. //4.更新会话列表
  1395. this.conversationList = data;
  1396. //5.判断对话是否已经在会话列表中存在
  1397. if(flag==true){
  1398. //6.如果存在,则选中该会话
  1399. this.selectConversation(SeleteItem)
  1400. }else{
  1401. //7.如果不存在,则创建单聊
  1402. this.createSession();
  1403. }
  1404. }).catch(() => {
  1405. this.$message.error('获取会话列表失败!')
  1406. })
  1407. },
  1408. //1.8 创建单聊
  1409. createSession(){
  1410. //console.log(this.$route.query.friend_id)
  1411. const currentDateTime = new Date();
  1412. const formattedDateTime = currentDateTime.toLocaleString('zh-CN', { timeZone: 'Asia/Shanghai' });
  1413. console.log("当前时间(北京时间):", formattedDateTime);
  1414. const message = {
  1415. talk_type:1,//当前的会话类型
  1416. //receiver_id:this.$route.query.friend_id,//当前的会话id
  1417. receiver_id:this.createMessageId,//当前的会话id
  1418. content:"我于" + formattedDateTime + "创建了一个会话",//用户发发送的消息
  1419. msg_type:1,//消息类型 1:文本 2:图片 3:文件 4:好友卡片 5:系统消息;6:加群卡片
  1420. };
  1421. //console.log(message)
  1422. //发送消息
  1423. let that = this;
  1424. if (this.ws && this.ws.readyState === WebSocket.OPEN) {
  1425. //打开左侧loading防止重复点击
  1426. this.hallLeftLoading = true;
  1427. this.ws.send(JSON.stringify(message));
  1428. //2秒后搜索会话列表 防止创建失败
  1429. setTimeout(() => {
  1430. that.$store.dispatch('chat/getConversation',{}).then(res=> {
  1431. //查询当前会话中是否已经存在该好友的会话
  1432. let data = res.data;
  1433. let SeleteItem = {};
  1434. let flag = false;//对话是否已经存在
  1435. for(let item of data){
  1436. //如果会话中含有该好友的会话,则选中该会话
  1437. if(item.receiver_id == this.createMessageId){
  1438. item.status = 1;
  1439. SeleteItem = item;
  1440. flag = true;
  1441. }else{
  1442. item.status = 0;
  1443. }
  1444. }
  1445. //更新会话列表
  1446. that.conversationList = data;
  1447. //关闭loading层
  1448. that.hallLeftLoading = false;
  1449. //判断对话是否已经在会话列表中存在
  1450. if(flag==true){
  1451. //如果存在,则选中该会话
  1452. that.selectConversation(SeleteItem)
  1453. }
  1454. }).catch(() => {
  1455. that.$message.error('获取会话列表失败!')
  1456. })
  1457. }, 2000);
  1458. }
  1459. },
  1460. //1.9 循环更新会话列表
  1461. forSearchConversationList(){
  1462. let that = this;
  1463. this.listTimeOut = setInterval(() => {
  1464. //刷新时先判断是否有选中的会话
  1465. if(that.receiverId!=''){
  1466. //如果不为空,说明用户选择了某一个会话,此时需要修改会话列表中该会话的状态
  1467. this.$store.dispatch('chat/getConversation',{}).then(res=> {
  1468. console.log(res)
  1469. let data = res.data;
  1470. for(let item of data){
  1471. if(item.receiver_id==that.receiverId){
  1472. item.status = 1;
  1473. }else{
  1474. item.status = 0;
  1475. }
  1476. }
  1477. this.conversationList = data;
  1478. console.log("开始获取会话列表,将于8秒后再次获取!")
  1479. }).catch(() => {
  1480. this.$message.error('获取会话列表失败!')
  1481. })
  1482. }else{
  1483. //如果为空,说明用户没有选择任何会话,此时可以直接请求列表
  1484. that.getConversationList();
  1485. }
  1486. }, 7000);
  1487. },
  1488. //1.10 查询会话列表中是否存在会话,不存在就创建
  1489. searchConversationIfCreate(user_id){
  1490. //从会话列表中找到receiver_id于user_id相同的会话
  1491. let flag = false;
  1492. for(let item of this.conversationList){
  1493. if(item.receiver_id==user_id){
  1494. flag = true;
  1495. }
  1496. }
  1497. //第一种情况:两人是好友,且会话已经创建了
  1498. if(flag){
  1499. //给与右侧展示列表的id
  1500. this.groupRightUserInfo.receiver_id = String(user_id);
  1501. this.groupRightUserInfo.user_id = String(user_id);
  1502. this.selectConversation(this.groupRightUserInfo)
  1503. this.rightSlideBoxShow = false;
  1504. this.groupRightSearchWindow = false;
  1505. }else{
  1506. //第二种情况:两人是好友但是不存在对话
  1507. //console.log("不存在这个会话,创建单聊")
  1508. this.createMessageId = user_id;
  1509. this.createSession();
  1510. }
  1511. },
  1512. //1.会话列表 end---------------------------------------->
  1513. //2.群聊 start---------------------------------------->
  1514. //2.1 创建群聊
  1515. //2.1.1 打开群聊创建窗口
  1516. creatGroup(){
  1517. this.groupWindowStatus = true;
  1518. //获得好友列表
  1519. this.getFriendsList();
  1520. },
  1521. //2.1.2 左侧菜单获取好友列表
  1522. getFriendsList(){
  1523. this.$store.dispatch('chat/getFriendsList',{user_id:this.myUserId}).then(res=> {
  1524. console.log(res)
  1525. for(let item of res.data){
  1526. item.status = false; //默认未选中
  1527. }
  1528. this.friendsList = res.data;
  1529. }).catch(() => {
  1530. this.$message.error('获取好友列表失败!')
  1531. })
  1532. },
  1533. //2.1.3 左侧菜单取消选择好友
  1534. cancelSelectFriends(id){
  1535. this.friendsList.forEach(item => {
  1536. if(item.id == id){
  1537. item.status = false;
  1538. }
  1539. });
  1540. },
  1541. //2.1.4 清空并关闭创建群弹出框
  1542. clearCreatGroupWindow(){
  1543. this.friendsList.forEach(item => {
  1544. item.status = false;
  1545. });
  1546. this.groupWindowStatus = false;
  1547. },
  1548. //2.1.5 创建群
  1549. createForGroup(){
  1550. let data = {
  1551. group_name:"",//群聊名称
  1552. group_desc:"仅群主可以修改",//群聊公告
  1553. group_avatar:"",//群聊头像
  1554. group_member:""//群成员
  1555. }
  1556. //从friendsList找出用户选择的联系人,然后创建群组
  1557. //先把我自己放进去
  1558. data.group_member = this.myUserId + ",";
  1559. //然后循环添加其他用户
  1560. this.friendsList.forEach(item => {
  1561. if(item.status){
  1562. data.group_member += item.friend_id + ",";
  1563. }
  1564. data.group_name = this.friendsList
  1565. .filter(item => item.status)
  1566. .slice(0, 3) // 只取前三个
  1567. .map(item => item.remark !== null ? item.remark : item.user_name)
  1568. .join(", ") // 使用逗号和空格分隔
  1569. });
  1570. data.group_member = data.group_member.slice(0,-1);//掉最后一个字符
  1571. //console.log(data)
  1572. this.$store.dispatch('chat/addGroup',data).then(res=> {
  1573. this.$message.success('创建群聊成功!')
  1574. //完成后关闭弹出框
  1575. this.clearCreatGroupWindow();
  1576. //重新获取会话列表
  1577. this.getConversationList();
  1578. }).catch(() => {
  1579. this.$message.error('创建群聊失败!')
  1580. })
  1581. },
  1582. //2.1.6 建群时搜索群成员
  1583. searchFriendGroupUser(){
  1584. this.groupFriendSearchUser = {};
  1585. let flag = false; //是否找到成员
  1586. for(let item of this.friendsList){
  1587. if(item.user_name==this.searchFriendGroup||item.remark==this.searchFriendGroup){
  1588. this.groupFriendSearchUser = item;
  1589. flag = true;
  1590. }
  1591. }
  1592. console.log(this.searchGroup)
  1593. console.log(this.friendsList)
  1594. console.log(flag)
  1595. console.log(this.groupFriendSearchUser)
  1596. //this.searchGroup 搜索的内容
  1597. //this.groupEditWindowStatus 弹出框状态
  1598. //this.groupSearchUser 搜索出来的成员
  1599. if(!flag){
  1600. this.$message.error('没有找到该成员!')
  1601. }else{
  1602. this.groupFriendsWindowStatus = true;
  1603. }
  1604. },
  1605. //2.1.7 把用户添加到选择框里面
  1606. addSearchFriendWindow(){
  1607. this.groupFriendSearchUser.status=!this.groupFriendSearchUser.status;
  1608. this.closeSearchFriendWindow();
  1609. },
  1610. //2.1.7 关闭搜索弹出框
  1611. closeSearchFriendWindow(){
  1612. this.groupFriendsWindowStatus = false;
  1613. },
  1614. //2.2 选择群聊
  1615. //2.1.1 在会话列表中选择一个群聊
  1616. selectGroup(item){
  1617. //选择会话的时候开启loading框
  1618. this.hallRightLoading = true;
  1619. //关闭右侧详情框
  1620. this.closeRightDetailWindow();
  1621. //使用receiverId判断当前是哪个会话
  1622. this.receiverId = item.receiver_id;
  1623. //会话类型 = 2 群聊
  1624. this.receiverType = 2;
  1625. //分享群聊时需要使用群名称和群id
  1626. this.useShareGroupInfo = item;
  1627. console.log("选择群聊")
  1628. //清理单聊状态
  1629. this.conversationList.forEach(conversation => {
  1630. conversation.status = (conversation.receiver_id === item.receiver_id) ? 1 : 0;
  1631. });
  1632. console.log(item)
  1633. //记录准备加入群聊的id
  1634. this.groupId = item.receiver_id;
  1635. //当前的聊天名称
  1636. this.messageTitle = item.group_name;
  1637. //关闭没有选择任何聊天的界面
  1638. this.ifNoMessage = false;
  1639. //获取群聊天信息
  1640. this.getGroupChatRecords(item.receiver_id);
  1641. //获取群设置信息
  1642. this.getGroupSystem(item.receiver_id);
  1643. //获取群成员
  1644. this.getGroupMember(item.receiver_id);
  1645. },
  1646. //2.1.2 获取群聊消息
  1647. getGroupChatRecords(group_id){
  1648. this.$store.dispatch('chat/getGroupChatRecords',{group_id:group_id}).then(res=> {
  1649. console.log(res)
  1650. this.chatrecords = res.data.data;
  1651. //滚动条滚动到底部
  1652. this.scorllBottom();
  1653. //选择会话的时候开启loading框
  1654. this.hallRightLoading = false;
  1655. }).catch(() => {
  1656. this.$message.error('获取群设置信息失败!');
  1657. //选择会话的时候开启loading框
  1658. this.hallRightLoading = false;
  1659. })
  1660. },
  1661. //2.3 编辑群聊
  1662. //2.3.1 打开右侧菜单设置窗口
  1663. openGroupSystem(){
  1664. this.rightSlideBoxShow = !this.rightSlideBoxShow;
  1665. },
  1666. //2.3.2 获取群设置群成员
  1667. getGroupMember(group_id){
  1668. this.$store.dispatch('chat/getGroupMembers',{group_id:group_id}).then(res=> {
  1669. for(let item of res.data){
  1670. item.status = true; //默认选中
  1671. }
  1672. this.groupUserList = res.data;
  1673. }).catch(() => {
  1674. this.$message.error('获取群成员信息失败!')
  1675. })
  1676. },
  1677. //2.3.3 获取群设置信息
  1678. getGroupSystem(group_id){
  1679. this.$store.dispatch('chat/getGroupInfo',{group_id:group_id}).then(res=> {
  1680. console.log(res)
  1681. this.groupInfo = res.data;
  1682. this.creatorId = res.data.creator_id;
  1683. if(res.data.profile==null){
  1684. this.groupProfile = "暂无群公告"
  1685. }else{
  1686. this.groupProfile = res.data.profile;
  1687. }
  1688. }).catch(() => {
  1689. this.$message.error('获取群设置信息失败!')
  1690. })
  1691. },
  1692. //2.3.4 右侧菜单退出群聊
  1693. closeGroup(){
  1694. this.$confirm('将要退出该群聊,确定吗?', '提示', {
  1695. confirmButtonText: '确定',
  1696. cancelButtonText: '取消',
  1697. type: 'warning'
  1698. }).then(() => {
  1699. //this.groupId
  1700. this.$store.dispatch('chat/quitGroup',{group_id:this.groupId}).then(res=> {
  1701. this.$message.success('退出群聊成功!')
  1702. //关闭右侧菜单
  1703. this.rightSlideBoxShow = false;
  1704. //关闭右侧聊天界面
  1705. this.ifNoMessage = true;
  1706. //重新请求会话列表
  1707. this.getConversationList();
  1708. }).catch(() => {
  1709. this.$message.error('群聊退出失败!')
  1710. })
  1711. }).catch(() => {
  1712. this.$message.warning('已取消退出')
  1713. });
  1714. },
  1715. //2.3.5 右侧菜单删除群聊
  1716. delGroup(){
  1717. this.$confirm('将要解散该群聊,确定吗?', '提示', {
  1718. confirmButtonText: '确定',
  1719. cancelButtonText: '取消',
  1720. type: 'warning'
  1721. }).then(() => {
  1722. //this.groupId
  1723. this.$store.dispatch('chat/delGroup',{group_id:this.groupId}).then(res=> {
  1724. this.$message.success('已解散群聊!')
  1725. //关闭右侧菜单
  1726. this.rightSlideBoxShow = false;
  1727. //关闭右侧聊天界面
  1728. this.ifNoMessage = true;
  1729. //重新请求会话列表
  1730. this.getConversationList();
  1731. }).catch(() => {
  1732. this.$message.error('解散群聊失败!')
  1733. })
  1734. }).catch(() => {
  1735. this.$message.warning('已取消解散')
  1736. });
  1737. },
  1738. //2.3.6 右侧菜单编辑群名称
  1739. editGroupName(){
  1740. let data = {
  1741. group_id:this.groupId,
  1742. group_name:this.messageTitle//群名称
  1743. }
  1744. this.$store.dispatch('chat/updateGroup',data).then(res=> {
  1745. this.$message.success('成功修改群聊名称!');
  1746. //重新获取群详情
  1747. this.getGroupSystem(this.groupId);
  1748. //重新获取会话列表
  1749. this.getConversationList();
  1750. this.editGroupNameWindow = false;
  1751. }).catch(() => {
  1752. this.$message.error('修改群聊名称失败!')
  1753. })
  1754. },
  1755. //2.3.7 右侧菜单编辑群公告
  1756. editGroupNotice(){
  1757. let data = {
  1758. group_id:this.groupId,
  1759. profile:this.groupProfile//群公告
  1760. }
  1761. this.$store.dispatch('chat/updateGroup',data).then(res=> {
  1762. this.editGroupNoticeWindow = false;
  1763. this.$message.success('成功添加群公告')
  1764. //重新获取群详情
  1765. this.getGroupSystem(this.groupId)
  1766. }).catch(() => {
  1767. this.$message.error('编辑群公告失败!')
  1768. })
  1769. },
  1770. //2.3.8 群弹出框回显群内成员
  1771. editGroupMember(){
  1772. //1.打开编辑窗口
  1773. this.groupEditWindowStatus = true;
  1774. //2.获得好友列表
  1775. this.$store.dispatch('chat/getFriendsList',{user_id:this.myUserId}).then(res=> {
  1776. //3.设置成未选中
  1777. for(let item of res.data){
  1778. item.status = false; //默认未选中
  1779. }
  1780. this.friendsList = res.data;
  1781. console.log(this.friendsList)
  1782. console.log(this.groupUserList)
  1783. //4.判断一下groupUserList是否包含friendsList中的成员,如果包含,就把friendsList中的成员status设置为true
  1784. this.friendsList.forEach(item => {
  1785. console.log(item.user_id)
  1786. if(this.groupUserList.find(groupItem => groupItem.user_id == item.friend_id)){
  1787. item.status = true;
  1788. }
  1789. });
  1790. console.log(this.friendsList)
  1791. }).catch(() => {
  1792. this.$message.error('获取好友列表失败!')
  1793. })
  1794. },
  1795. //2.3.9 群弹出框编辑群成员
  1796. changeSelectFriends(item) {
  1797. // 检查 groupUserList 是否包含 item
  1798. const index = this.groupUserList.findIndex(i => i.user_id == item.friend_id);
  1799. // 如果包含,就删除这个 item;否则,添加到 groupUserList
  1800. // 注意不能直接把friend_id放进去,因为最后编辑保存的时候取的是user_id,这里要传一下值
  1801. if (index !== -1) {
  1802. this.groupUserList.splice(index, 1);
  1803. } else {
  1804. item.user_id = item.friend_id;
  1805. this.groupUserList.push(item);
  1806. }
  1807. },
  1808. //2.3.19 群弹出框取消编辑群成员
  1809. cancelEditGroupMember(){
  1810. this.groupEditWindowStatus = false;
  1811. this.getGroupMember(this.groupId);
  1812. },
  1813. //2.3.20 群弹出框保存编辑群成员
  1814. saveEditGroupMember(){
  1815. let groupUser = []
  1816. // console.log(this.myUserId)
  1817. // console.log(this.groupUserList)
  1818. //取出所有选择的user_id且不能与自己的id相同
  1819. for(let item of this.groupUserList){
  1820. if(Number(item.user_id) != Number(this.myUserId)){
  1821. groupUser.push(item.user_id);
  1822. }
  1823. }
  1824. groupUser = groupUser.join(',');
  1825. //console.log(groupUser)
  1826. let data = {
  1827. group_id:this.groupId,
  1828. group_member:groupUser
  1829. }
  1830. this.$store.dispatch('chat/updateGroupMembers',data).then(res=> {
  1831. this.$message.success('群成员保存成功!')
  1832. this.groupEditWindowStatus = false;
  1833. this.getGroupMember(this.groupId);
  1834. }).catch(() => {
  1835. this.$message.error('群成员保存失败!')
  1836. this.groupEditWindowStatus = false;
  1837. this.getGroupMember(this.groupId);
  1838. })
  1839. },
  1840. //2.3.21 群弹出框搜索群成员
  1841. searchGroupUser(){
  1842. this.groupSearchUser = {};
  1843. let flag = false; //是否找到成员
  1844. for(let item of this.friendsList){
  1845. if(item.user_name==this.searchGroup||item.remark==this.searchGroup){
  1846. this.groupSearchUser = item;
  1847. flag = true;
  1848. }
  1849. }
  1850. console.log(this.searchGroup)
  1851. console.log(this.friendsList)
  1852. console.log(flag)
  1853. //this.searchGroup 搜索的内容
  1854. //this.groupEditWindowStatus 弹出框状态
  1855. //this.groupSearchUser 搜索出来的成员
  1856. if(!flag){
  1857. this.$message.error('没有找到该成员!')
  1858. }else{
  1859. this.groupEditMainWindowStatus = true;
  1860. }
  1861. },
  1862. //2.3.22 群弹出框添加群成员
  1863. addGroupUser(item){
  1864. item.user_id = item.friend_id;
  1865. console.log(item)
  1866. //找到friendsList中的该成员,把status设置为相反的值
  1867. for(let item of this.friendsList){
  1868. if(item.user_id==this.groupSearchUser.user_id){
  1869. item.status = !item.status;
  1870. }
  1871. }
  1872. // 找到groupUserList中是否存在该成员,如果存在就删除,没有不存在就添加
  1873. const index = this.groupUserList.findIndex(member => member.user_id === item.user_id);
  1874. if (index !== -1) {
  1875. // 如果存在,删除该成员
  1876. this.groupUserList.splice(index, 1);
  1877. } else {
  1878. // 如果不存在,添加该成员
  1879. this.groupUserList.push(item);
  1880. }
  1881. //完成后关闭弹出框
  1882. this.closeAddGroupUserWindow();
  1883. },
  1884. //2.3.23 群弹出框关闭弹出框
  1885. closeAddGroupUserWindow(){
  1886. this.searchGroup = "";
  1887. this.groupSearchUser = {};
  1888. this.groupEditMainWindowStatus = false;
  1889. },
  1890. //2.3.24 群弹出框移除群成员
  1891. editRemoveGroupUser(id){
  1892. console.log(id)
  1893. //移除this.groupUserList中user_id与id一致的
  1894. const index = this.groupUserList.findIndex(member => member.user_id === id);
  1895. if (index !== -1) {
  1896. this.groupUserList.splice(index, 1);
  1897. }
  1898. //找到friendsList中user_id与id一致的,把status设置为false
  1899. for(let item of this.friendsList){
  1900. if(item.friend_id==id){
  1901. item.status = false;
  1902. }
  1903. }
  1904. },
  1905. //2.3.25 右侧菜单编辑成员
  1906. rightSearchUser(){
  1907. this.groupRightUserInfo = {};
  1908. let flag = false; //是否找到成员
  1909. for(let item of this.groupUserList){
  1910. if(item.user_name==this.searchUser||item.remark==this.searchUser){
  1911. this.groupRightUserInfo = item;
  1912. flag = true;
  1913. }
  1914. }
  1915. console.log(this.searchUser)
  1916. console.log(this.groupUserList)
  1917. console.log(flag)
  1918. //this.searchGroup 搜索的内容
  1919. //this.groupEditWindowStatus 弹出框状态
  1920. //this.groupSearchUser 搜索出来的成员
  1921. if(!flag){
  1922. this.$message.error('没有找到该成员!')
  1923. }else{
  1924. //找到这个成员以后,需要先验证一下他俩是不是好友
  1925. this.$store.dispatch('chat/isFriend',{friend_id:this.groupRightUserInfo.user_id}).then(res=> {
  1926. console.log(res.data)//true false
  1927. this.groupRightUserInfo.isFriend = res.data;
  1928. //打开弹出框
  1929. this.groupRightSearchWindow = true;
  1930. }).catch(() => {
  1931. this.$message.error('获取成员身份信息失败!')
  1932. })
  1933. }
  1934. },
  1935. //2.3.26 关闭弹出框
  1936. closeRightSearchUser(){
  1937. this.searchUser = "";
  1938. this.groupRightUserInfo = {};
  1939. this.groupRightSearchWindow = false;
  1940. },
  1941. //2.4 加入群聊
  1942. //2.4.1 打开群聊邀请窗口
  1943. openGroupInviteWindow(info){
  1944. this.addGroupWindow = true;
  1945. //info.content.split(',')[0] 群名称
  1946. //info.content.split(',')[1] 群id
  1947. //获得要加入的群聊详情
  1948. this.groupInviteInfo.group_name = info.content.split(',')[0];
  1949. this.groupInviteInfo.group_id = info.content.split(',')[1];
  1950. },
  1951. //2.4.2 加入群聊
  1952. joinGroup(){
  1953. this.$store.dispatch('chat/joinGroup',{group_id:this.groupInviteInfo.group_id}).then(res=> {
  1954. this.$message.success('加入群聊成功!')
  1955. this.addGroupWindow = false;
  1956. }).catch(() => {
  1957. this.$message.error('加入群聊失败!')
  1958. })
  1959. },
  1960. //2.4.3 打开分享群聊弹出框
  1961. openShareMyGroup(){
  1962. //群组聊天数据初始化
  1963. this.groupConversationList = [];
  1964. //打开名片弹出框
  1965. this.shareGroupWindowStatus = true;
  1966. // shareGroupWindowStatus:false,//分享群聊弹出框
  1967. // shareGroupActive:'friend',//分享名片选项卡
  1968. // shareGroupId:'',//要分享的群聊id
  1969. // useShareGroupInfo:{},//分享名片时选中的群组信息
  1970. //默认获取一下好友列表
  1971. this.getFriendsList();
  1972. //把群聊提出来单独放到一个数组
  1973. for(let item of this.conversationList){
  1974. if(item.is_group==1){
  1975. this.groupConversationList.push(item);
  1976. }
  1977. }
  1978. },
  1979. shareMyGroup(){
  1980. console.log(this.shareGroupId)
  1981. if(this.shareGroupId!=''){
  1982. let message = {};
  1983. console.log(this.useShareGroupInfo)
  1984. let userInfo = [this.useShareGroupInfo.group_name,this.useShareGroupInfo.receiver_id];
  1985. let userInfoString = userInfo.join(',');
  1986. if(this.shareGroupActive=='friend'){
  1987. //单聊
  1988. message = {
  1989. talk_type:1,
  1990. receiver_id:this.shareGroupId,
  1991. msg_type:6,//消息类型 1:文本 2:图片 3:文件 4:好友卡片 5:系统消息;6:加群卡片
  1992. };
  1993. message.content = userInfoString;
  1994. }else if(this.shareGroupActive=='group'){
  1995. //群聊
  1996. message = {
  1997. talk_type:2,
  1998. receiver_id:this.shareGroupId,
  1999. content:userInfo,
  2000. msg_type:6,//消息类型 1:文本 2:图片 3:文件 4:好友卡片 5:系统消息;6:加群卡片
  2001. };
  2002. message.content = userInfoString;
  2003. }
  2004. console.log(message)
  2005. //发送消息
  2006. if (this.ws && this.ws.readyState === WebSocket.OPEN) {
  2007. this.ws.send(JSON.stringify(message));
  2008. }
  2009. //关闭分享弹出框
  2010. this.shareGroupWindowStatus = false;
  2011. this.$message.success('分享名片成功!')
  2012. }else{
  2013. this.$message.error('请选择分享对象!')
  2014. }
  2015. },
  2016. handleClickShareGroupCard(tab, event) {
  2017. const tabName = tab.name;
  2018. console.log("当前选中的tab name:", tabName);
  2019. this.shareGroupActive = tabName;
  2020. },
  2021. //2.群聊 end---------------------------------------->
  2022. //3.全局应用 start---------------------------------------->
  2023. //3.1 滚动条滚动到底部
  2024. scorllBottom(){
  2025. //滚动条滚动到底部
  2026. this.$nextTick(() => {
  2027. const rightUserMessageBox = this.$refs.rightUserMessageBox;
  2028. if (rightUserMessageBox) {
  2029. rightUserMessageBox.scrollTop = rightUserMessageBox.scrollHeight;
  2030. }
  2031. });
  2032. },
  2033. //3.2 添加好友
  2034. addFriend(id){
  2035. console.log(id)
  2036. this.addFriendWindowStatus = true;
  2037. this.addform.friend_id = id;
  2038. },
  2039. addMyFriend(){
  2040. this.$store.dispatch('chat/addFriend',this.addform).then(res=> {
  2041. this.$message.success(res.data)
  2042. this.addFriendWindowStatus = false;
  2043. })
  2044. },
  2045. //3.3 关闭右侧详情框
  2046. closeRightDetailWindow(){
  2047. this.rightSlideBoxShow = false;
  2048. this.groupRightSearchWindow = false;
  2049. this.searchUser = "";
  2050. },
  2051. //3.全局应用 end---------------------------------------->
  2052. //4.会话框 start---------------------------------------->
  2053. //4.1上传
  2054. //4.1.1上传图片
  2055. beforeImgUpload(file) {
  2056. //先清理一下上传的缩略窗口
  2057. this.deFileUpload()
  2058. const isJPG = file.type === 'image/jpeg';
  2059. const isPNG = file.type === 'image/png';
  2060. const isLt2M = file.size / 1024 / 1024 < 2;
  2061. if (!isJPG && !isPNG) {
  2062. this.$message.error('发送的图片只能是 JPG 或 PNG 格式!');
  2063. return false;
  2064. }
  2065. if (!isLt2M) {
  2066. this.$message.error('发送的图片大小不能超过 2MB!');
  2067. return false;
  2068. }
  2069. const formData = new FormData();
  2070. formData.append('file', file);
  2071. this.$store.dispatch('pool/uploadFile',formData).then(res=> {
  2072. this.sendMessage.img.imgUrl = res.data.imgUrl;//获取上传的图片地址
  2073. this.sendMessage.img.oldFileName = res.data.oldFileName;
  2074. console.log(res.data.imgUrl)
  2075. }).catch(() => {
  2076. this.$message({
  2077. type: 'info',
  2078. message: '网络错误,请重试!'
  2079. });
  2080. })
  2081. // 阻止默认的上传行为
  2082. return false;
  2083. },
  2084. //4.1.2上传文件
  2085. beforeFileUpload(file) {
  2086. //先清理一下上传的缩略窗口
  2087. this.deFileUpload()
  2088. console.log(file)
  2089. //允许的文件类型
  2090. const isDoc = file.type === 'application/msword';
  2091. const isDocx = file.type === 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';
  2092. const isXls = file.type === 'application/vnd.ms-excel';
  2093. const isXlsx = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
  2094. const isPptx = file.type === 'application/vnd.openxmlformats-officedocument.presentationml.presentation';
  2095. const isRar = file.type === 'application/x-rar-compressed';
  2096. const isZip = file.type === 'application/x-zip-compressed';
  2097. const isTxt = file.type === 'text/plain';
  2098. //文件大小不能超过2M
  2099. const isLt2M = file.size / 1024 / 1024 < 2;
  2100. if (!isTxt && !isDoc && !isDocx && !isXls && !isXlsx && !isPptx && !isRar && !isZip) {
  2101. this.$message.error('该文件类型不允许上传!');
  2102. return false;
  2103. }
  2104. if (!isLt2M) {
  2105. this.$message.error('发送的文件大小不能超过2M!');
  2106. return false;
  2107. }
  2108. const formData = new FormData();
  2109. formData.append('file', file);
  2110. this.$store.dispatch('pool/uploadFile',formData).then(res=> {
  2111. this.sendMessage.file.fileUrl = res.data.imgUrl;
  2112. this.sendMessage.file.oldFileName = res.data.oldFileName;
  2113. console.log(res.data)
  2114. }).catch(() => {
  2115. this.$message({
  2116. type: 'info',
  2117. message: '网络错误,请重试!'
  2118. });
  2119. })
  2120. // 阻止默认的上传行为
  2121. return false;
  2122. },
  2123. //4.1.3 删除上传的文件
  2124. deFileUpload(){
  2125. this.sendMessage.img.imgUrl = "";
  2126. this.sendMessage.img.oldFileName = "";
  2127. this.sendMessage.file.fileUrl = "";
  2128. this.sendMessage.file.oldFileName = "";
  2129. },
  2130. //4.会话框 end---------------------------------------->
  2131. //5.websocket会话 start---------------------------------------->
  2132. //5.1 接受消息
  2133. handleIncomingMessage(event) {
  2134. const message = JSON.parse(event.data);
  2135. console.log("监听消息:",message)
  2136. if(Number(this.receiverId) == Number(message.receiver_id)){
  2137. //如果message的receiverId和会话的receiverId一致,说明这条信息是自己发的回显
  2138. let receiveMessage = {
  2139. action:"said",//是谁说的
  2140. user_avatar:message.user_avatar,//头像
  2141. content:message.content,//内容
  2142. msg_type:message.msg_type,//消息类型
  2143. }
  2144. console.log("回显自己的消息:"+this.receiverId,message.receiver_id)
  2145. console.log(message)
  2146. //消息添加到聊天记录
  2147. this.chatrecords.push(receiveMessage);
  2148. // 确保 Vue 能够检测到数组的变化
  2149. //this.$set(this.chatrecords, this.chatrecords.length, receiveMessage);
  2150. console.log(this.chatrecords)
  2151. //滚动条滚动到底部
  2152. this.scorllBottom();
  2153. }else if(Number(this.receiverId) == Number(message.user_id)){
  2154. let receiveMessage = {
  2155. action:"recieved",//是谁说的
  2156. receiver_avatar:message.user_avatar,//头像
  2157. content:message.content,//内容
  2158. msg_type:message.msg_type,//消息类型
  2159. }
  2160. //如果message的receiverId和会话的receiverId不一致,说明这条信息是别人发的,需要添加到聊天记录
  2161. //消息添加到聊天记录
  2162. console.log("来自单聊消息:"+this.receiverId,message.user_id)
  2163. this.chatrecords.push(receiveMessage);
  2164. console.log(message)
  2165. }
  2166. },
  2167. // 5.2 发送消息
  2168. sendUserMessage() {
  2169. if (this.userMessage.trim() !== '') {
  2170. const message = {
  2171. talk_type:this.receiverType,//当前的会话类型
  2172. receiver_id:this.receiverId,//当前的会话id
  2173. content:this.userMessage,//用户发发送的消息
  2174. msg_type:1,//消息类型 1:文本 2:图片 3:文件 4:好友卡片 5:系统消息;6:加群卡片
  2175. };
  2176. //发送消息
  2177. if (this.ws && this.ws.readyState === WebSocket.OPEN) {
  2178. this.ws.send(JSON.stringify(message));
  2179. }
  2180. this.userMessage = '';
  2181. }else{
  2182. this.$message.error('消息不能为空!')
  2183. }
  2184. },
  2185. // 5.3 发送图片或者文字
  2186. sendUserMessageToFile() {
  2187. if(this.sendMessage.img.imgUrl!=''){
  2188. const message = {
  2189. talk_type:this.receiverType,//当前的会话类型
  2190. receiver_id:this.receiverId,//当前的会话id
  2191. content:this.sendMessage.img.imgUrl,//用户发发送的消息
  2192. msg_type:2,//消息类型 1:文本 2:图片 3:文件 4:好友卡片 5:系统消息;6:加群卡片
  2193. };
  2194. if (this.ws && this.ws.readyState === WebSocket.OPEN) {
  2195. this.ws.send(JSON.stringify(message));
  2196. //发送完毕清除选择的图片
  2197. this.sendMessage.img.imgUrl='';
  2198. }
  2199. //如果文本框不为空,把文本框内的消息也提交过去
  2200. if(this.userMessage.trim()!=''){
  2201. this.sendUserMessage();
  2202. }
  2203. }
  2204. if(this.sendMessage.file.fileUrl!=''){
  2205. //把名称和地址打包成一个对象
  2206. const fileInfo = {
  2207. file_url:this.sendMessage.file.fileUrl,
  2208. oldFileName:this.sendMessage.file.oldFileName
  2209. }
  2210. const fileInfoString = JSON.stringify(fileInfo);
  2211. //发送消息
  2212. const message = {
  2213. talk_type:this.receiverType,//当前的会话类型
  2214. receiver_id:this.receiverId,//当前的会话id
  2215. content:fileInfoString,//用户发发送的消息
  2216. msg_type:3,//消息类型 1:文本 2:图片 3:文件 4:好友卡片 5:系统消息;6:加群卡片
  2217. };
  2218. if (this.ws && this.ws.readyState === WebSocket.OPEN) {
  2219. this.ws.send(JSON.stringify(message));
  2220. //发送完毕清除选择的文件
  2221. this.sendMessage.file.fileUrl='';
  2222. }
  2223. //如果文本框不为空,把文本框内的消息也提交过去
  2224. if(this.userMessage.trim()!=''){
  2225. this.sendUserMessage();
  2226. }
  2227. }
  2228. },
  2229. //5.4 打开名片弹出框
  2230. openShareCard(){
  2231. //群组聊天数据初始化
  2232. this.groupConversationList = [];
  2233. //打开名片弹出框
  2234. this.userCardWindowStatus = true;
  2235. //默认获取一下好友列表
  2236. this.getFriendsList();
  2237. //好友列表
  2238. //this.friendsList
  2239. //会话列表
  2240. //this.conversationList
  2241. //把群聊提出来单独放到一个数组
  2242. //this.groupConversationList
  2243. for(let item of this.conversationList){
  2244. if(item.is_group==1){
  2245. this.groupConversationList.push(item);
  2246. }
  2247. }
  2248. },
  2249. //5.5 分享名片
  2250. shareCard(){
  2251. console.log(this.useShareUserId)
  2252. if(this.useShareUserId!=''){
  2253. let message = {};
  2254. // let userInfo = {
  2255. // avatar:this.useShareUserInfo.avatar,
  2256. // user_name:this.useShareUserInfo.user_name,
  2257. // friend_id:this.receiverId
  2258. // }
  2259. let userInfo = [this.useShareUserInfo.avatar,this.useShareUserInfo.user_name,this.receiverId];
  2260. let userInfoString = userInfo.join(',');
  2261. if(this.shareTableActive=='friend'){
  2262. //单聊
  2263. message = {
  2264. talk_type:1,
  2265. receiver_id:this.useShareUserId,
  2266. msg_type:4,//消息类型 1:文本 2:图片 3:文件 4:好友卡片 5:系统消息;6:加群卡片
  2267. };
  2268. message.content = userInfoString;
  2269. }else if(this.shareTableActive=='group'){
  2270. //群聊
  2271. message = {
  2272. talk_type:2,
  2273. receiver_id:this.useShareUserId,
  2274. content:userInfo,
  2275. msg_type:4,//消息类型 1:文本 2:图片 3:文件 4:好友卡片 5:系统消息;6:加群卡片
  2276. };
  2277. message.content = userInfoString;
  2278. }
  2279. // console.log(typeof message.content)
  2280. // console.log(message.content)
  2281. // console.log(message)
  2282. //发送消息
  2283. if (this.ws && this.ws.readyState === WebSocket.OPEN) {
  2284. this.ws.send(JSON.stringify(message));
  2285. }
  2286. //关闭分享弹出框
  2287. this.userCardWindowStatus = false;
  2288. this.$message.success('分享名片成功!')
  2289. }else{
  2290. this.$message.error('请选择分享对象!')
  2291. }
  2292. },
  2293. //5.6 切换分享名片
  2294. handleClickShareCard(tab, event) {
  2295. const tabName = tab.name;
  2296. console.log("当前选中的tab name:", tabName);
  2297. this.shareTableActive = tabName;
  2298. },
  2299. //5.7 下载文件
  2300. downloadFile(item){
  2301. let downloadData = JSON.parse(item.content);
  2302. console.log(downloadData.file_url)
  2303. if(downloadData.file_url!=''){
  2304. const link = document.createElement('a');
  2305. link.href = downloadData.file_url;
  2306. link.setAttribute('download', 'downloaded_file'); // You can set a default file name here
  2307. document.body.appendChild(link);
  2308. link.click();
  2309. document.body.removeChild(link);
  2310. }else{
  2311. this.$message.error('文件下载失败!')
  2312. }
  2313. },
  2314. //5.8 图片放大
  2315. imgZoom(url){
  2316. this.imgZoomUrl = url;
  2317. this.imgZoomStatus = true;
  2318. },
  2319. //5.websocket会话 end---------------------------------------->
  2320. },
  2321. mounted() {
  2322. //开启websocket连接 start---------------------------------------->
  2323. //1.获取admin-token
  2324. const adminToken = document.cookie.split('; ').find(row => row.startsWith('Admin-Token=')).split('=')[1];
  2325. //console.log("Admin-Token:", adminToken);
  2326. //2.连接websocket
  2327. let websocketNewUrl = process.env.VUE_APP_BASE_WEBSOCKET +"?token=" + adminToken;
  2328. //let websocketNewUrl = URL.WebsocketUrl +"?token=" + adminToken;
  2329. this.ws = new WebSocket(websocketNewUrl);
  2330. this.ws.addEventListener('message', this.handleIncomingMessage);
  2331. //当连接关闭的时候关闭websocket
  2332. this.ws.addEventListener('close', function (event) {
  2333. // 连接关闭时执行的操作
  2334. console.log("关闭链接",event)
  2335. });
  2336. //开启websocket连接 end---------------------------------------->
  2337. //从通讯录创建单聊 start---------------------------------------->
  2338. //当ws创建成功以后再执行,防止数据未加载
  2339. this.ws.onopen = () => {
  2340. console.log("ws创建成功!");
  2341. //判断当前路由是否携带friend_id
  2342. if(this.$route.query.friend_id){
  2343. //1.从通讯录进入会话大厅
  2344. this.retrieveSession();
  2345. //2.获取我的用户id
  2346. this.myUserId = this.$store.state.user.userid;
  2347. //把这个id存一下
  2348. this.createMessageId = this.$route.query.friend_id;
  2349. }else{
  2350. //直接进入会话大厅
  2351. //1.获取会话列表
  2352. this.getConversationList();
  2353. //2.获取我的用户id
  2354. this.myUserId = this.$store.state.user.userid;
  2355. //3.循环获取会话列表
  2356. //开启loading
  2357. this.hallLeftLoading = true;
  2358. this.forSearchConversationList();
  2359. }
  2360. };
  2361. //从通讯录创建单聊 end---------------------------------------->
  2362. },
  2363. beforeDestroy() {
  2364. //页面销毁的时候清除定时器获取列表
  2365. clearInterval(this.listTimeOut);
  2366. //页面销毁的时候关闭websocket
  2367. if (this.ws) {
  2368. this.ws.removeEventListener('message', this.handleIncomingMessage);
  2369. this.ws.close();
  2370. }
  2371. }
  2372. }
  2373. </script>
  2374. <style scoped lang="less">
  2375. .hallBox {
  2376. display: flex;
  2377. margin: 30px;
  2378. //左侧
  2379. .hallLeft {
  2380. width: 420px;
  2381. background: #fff;
  2382. border-radius: 20px;
  2383. margin-right: 20px;
  2384. position: relative;
  2385. .hallLeftLoading{
  2386. position: absolute;
  2387. top: 0;
  2388. left: 0;
  2389. width: 420px;
  2390. height: 740px;
  2391. display: flex;
  2392. align-items: center;
  2393. justify-content: center;
  2394. background: rgba(255, 255, 255, 0.5);
  2395. z-index: 100;
  2396. .hallLeftLoadingIcon {
  2397. .hallLeftLoadingIconItem {
  2398. color: #CCCCCC;
  2399. text-align: center;
  2400. margin-bottom: 20px;
  2401. font-size: 60px;
  2402. }
  2403. .hallLeftLoadingText {
  2404. color: #CCCCCC;
  2405. font-size: 32px;
  2406. font-weight: bold;
  2407. }
  2408. }
  2409. }
  2410. .searchBoxMain {
  2411. position: relative;
  2412. .searchFriendClose {
  2413. display: flex;
  2414. align-items: center;
  2415. justify-content: flex-end;
  2416. padding-right: 10px;
  2417. padding-bottom: 10px;
  2418. .rightSlideBoxCloseIcon {
  2419. cursor: pointer;
  2420. width: 28px;
  2421. height: 28px;
  2422. line-height: 28px;
  2423. text-align: center;
  2424. background: #EFEFEF;
  2425. border-radius: 8px;
  2426. }
  2427. }
  2428. .searchBox {
  2429. padding-left: 25px;
  2430. padding-right: 25px;
  2431. padding-bottom: 20px;
  2432. }
  2433. .searchFriendBox {
  2434. position: absolute;
  2435. width: 280px;
  2436. border-radius: 8px;
  2437. top: 0;
  2438. right: -300px;
  2439. background: #fff;
  2440. box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.1);
  2441. border-radius: 8px;
  2442. z-index: 100;
  2443. box-sizing: border-box;
  2444. padding: 20px 0 30px 0;
  2445. .searchFriendItem {
  2446. display: flex;
  2447. align-items: center;
  2448. justify-content: flex-start;
  2449. border-bottom: 1px solid #E9EDF7;
  2450. padding: 0 20px 30px 20px;
  2451. .searchFriendAvatar {
  2452. img {
  2453. width: 66px;
  2454. height: 66px;
  2455. border-radius: 50%;
  2456. }
  2457. margin-right: 15px;
  2458. }
  2459. .searchFriendInfo {
  2460. flex: 1;
  2461. .searchFriendName {
  2462. display: flex;
  2463. align-items: center;
  2464. .gender {
  2465. img {
  2466. width: 12px;
  2467. height: 12px;
  2468. }
  2469. }
  2470. img {
  2471. width: 18px;
  2472. height: 18px;
  2473. cursor: pointer;
  2474. }
  2475. .searchFriendNameText {
  2476. font-size: 18px;
  2477. width: 120px;
  2478. height: 28px;
  2479. line-height: 28px;
  2480. white-space: nowrap;
  2481. overflow: hidden;
  2482. text-overflow: ellipsis;
  2483. }
  2484. }
  2485. .searchFriendPhone {
  2486. font-size: 14px;
  2487. color: #999;
  2488. margin-top: 10px;
  2489. }
  2490. }
  2491. }
  2492. .searchFriendLineBox {
  2493. display: flex;
  2494. align-items: center;
  2495. justify-content: flex-start;
  2496. padding: 20px;
  2497. border-bottom: 1px solid #E9EDF7;
  2498. .searchFriendLineTitle{
  2499. font-size: 16px;
  2500. color: #999999;
  2501. width: 90px;
  2502. }
  2503. .searchFriendLineContent{
  2504. font-size: 16px;
  2505. color: #333;
  2506. flex: 1;
  2507. .searchFriendLineContentItem{
  2508. display: flex;
  2509. align-items: center;
  2510. justify-content: space-between;
  2511. }
  2512. }
  2513. }
  2514. .searchFriendButton {
  2515. padding:40px 0 10px 0;
  2516. text-align: center;
  2517. .searchFriendButtonItem {
  2518. font-size: 14px;
  2519. color: #5570F1;
  2520. img {
  2521. width: 30px;
  2522. height: 30px;
  2523. margin-bottom: 5px;
  2524. }
  2525. }
  2526. }
  2527. }
  2528. }
  2529. .userListBox {
  2530. padding: 15px 0;
  2531. overflow-y: auto;
  2532. height: 560px;
  2533. .active {
  2534. background: #F5F7FD;
  2535. box-sizing: border-box;
  2536. border-right: 4px solid #5570F1 !important;
  2537. }
  2538. .userItem {
  2539. padding: 0 21px 0 25px;
  2540. height: 90px;
  2541. box-sizing: border-box;
  2542. border-right: 4px solid #fff;
  2543. cursor: pointer;
  2544. display: flex;
  2545. align-items: center;
  2546. .flexItemBox{
  2547. width: 100%;
  2548. display: flex;
  2549. align-items: center;
  2550. justify-content: space-between;
  2551. .userAvatar {
  2552. img {
  2553. width: 58px;
  2554. height: 58px;
  2555. border-radius: 50%;
  2556. }
  2557. }
  2558. .userInfo {
  2559. flex: 1;
  2560. box-sizing: border-box;
  2561. padding-left: 15px;
  2562. .userName {
  2563. display: flex;
  2564. align-items: center;
  2565. justify-content: space-between;
  2566. //padding-bottom: 10px;
  2567. .userNameText {
  2568. font-size: 18px;
  2569. font-weight: bold;
  2570. }
  2571. .userMessageNum {
  2572. font-size: 12px;
  2573. color: #333;
  2574. width: 24px;
  2575. height: 24px;
  2576. line-height: 24px;
  2577. text-align: center;
  2578. border-radius: 50%;
  2579. background: #FFCC91;
  2580. font-weight: bold;
  2581. }
  2582. }
  2583. .userMessage {
  2584. display: flex;
  2585. align-items: center;
  2586. justify-content: space-between;
  2587. .userMessageText {
  2588. display: block;
  2589. width: 240px;
  2590. white-space: nowrap;
  2591. overflow: hidden;
  2592. text-overflow: ellipsis;
  2593. font-size: 14px;
  2594. color: #999999;
  2595. }
  2596. .userMessageTime {
  2597. font-size: 14px;
  2598. color: #999999;
  2599. }
  2600. }
  2601. }
  2602. }
  2603. }
  2604. }
  2605. }
  2606. //右侧
  2607. .hallRight {
  2608. flex: 1;
  2609. background: #fff;
  2610. border-radius: 20px;
  2611. position: relative;
  2612. height: 760px;
  2613. display: flex;
  2614. flex-direction: column;
  2615. position: relative;
  2616. .hallRightLoading {
  2617. position: absolute;
  2618. top: 0;
  2619. left: 0;
  2620. height: 740px;
  2621. width: 100%;
  2622. display: flex;
  2623. align-items: center;
  2624. justify-content: center;
  2625. background: rgba(255, 255, 255, 0.5);
  2626. z-index: 100;
  2627. .hallRightLoadingIcon {
  2628. .hallRightLoadingIconItem {
  2629. color: #CCCCCC;
  2630. text-align: center;
  2631. margin-bottom: 20px;
  2632. font-size: 60px;
  2633. }
  2634. .hallRightLoadingText {
  2635. color: #CCCCCC;
  2636. font-size: 32px;
  2637. font-weight: bold;
  2638. }
  2639. }
  2640. }
  2641. .ifHallRigthNoMessage {
  2642. color: #CCCCCC;
  2643. font-size: 32px;
  2644. font-weight: bold;
  2645. text-align: center;
  2646. height: 740px;
  2647. line-height: 740px;
  2648. }
  2649. .userName {
  2650. font-size: 20px;
  2651. color: #333;
  2652. font-weight: bold;
  2653. }
  2654. .ifNotice {
  2655. padding-bottom: 60px !important;
  2656. }
  2657. .UserNameBox {
  2658. display: flex;
  2659. align-items: center;
  2660. justify-content: space-between;
  2661. padding: 40px 30px 30px 30px;
  2662. border-bottom: 1px solid #E7E7E7;
  2663. position: relative;
  2664. .moreIcon {
  2665. cursor: pointer;
  2666. }
  2667. .groupNotice {
  2668. position: absolute;
  2669. height: 40px;
  2670. line-height: 40px;
  2671. font-size: 16px;
  2672. background:url('../../assets/chat/notice.png') no-repeat 10px center #F6F8FE;
  2673. left: 30px;
  2674. box-sizing: border-box;
  2675. padding-left: 40px;
  2676. bottom: 10px;
  2677. color: #999999;
  2678. border-radius: 10px;
  2679. padding-right: 10px;
  2680. width: 400px;
  2681. white-space: nowrap;
  2682. overflow: hidden;
  2683. text-overflow: ellipsis;
  2684. }
  2685. .shareCardIcon {
  2686. font-size: 24px;
  2687. cursor: pointer;
  2688. color: #666;
  2689. }
  2690. }
  2691. .rightPositionBox {
  2692. flex: 1;
  2693. position: relative;
  2694. .rightUserMessageBox {
  2695. padding: 40px;
  2696. height: 375px;
  2697. box-sizing: border-box;
  2698. overflow-y: auto;
  2699. .timeBox {
  2700. width: 100%;
  2701. display: flex;
  2702. align-items: center;
  2703. justify-content: center;
  2704. padding:0 0 30px 0;
  2705. span {
  2706. border-radius: 8px;
  2707. display: block;
  2708. width: 80px;
  2709. height: 30px;
  2710. line-height: 30px;
  2711. font-size: 14px;
  2712. text-align: center;
  2713. display: block;
  2714. background: #F4F5FA;
  2715. color: #999999;
  2716. }
  2717. }
  2718. .newUserStatus {
  2719. width: 100%;
  2720. display: flex;
  2721. align-items: center;
  2722. justify-content: center;
  2723. padding:0 0 30px 0;
  2724. .newUserStatusText {
  2725. display: flex;
  2726. align-items: center;
  2727. justify-content: center;
  2728. border-radius: 8px;
  2729. width: 200px;
  2730. height: 30px;
  2731. line-height: 30px;
  2732. font-size: 14px;
  2733. text-align: center;
  2734. background: #F4F5FA;
  2735. color: #999999;
  2736. }
  2737. span {
  2738. display: inline-block;
  2739. line-height: 30px;
  2740. }
  2741. .newUserStatusTextName {
  2742. display: inline-block;
  2743. width: 100px;
  2744. line-height: 30px;
  2745. overflow: hidden;
  2746. white-space: nowrap;
  2747. text-overflow: ellipsis;
  2748. }
  2749. }
  2750. //其他用户
  2751. .otherUserMessage {
  2752. display: flex;
  2753. align-items: flex-start;
  2754. margin-bottom: 30px;
  2755. .otherUserIcon {
  2756. margin-right: 20px;
  2757. img {
  2758. width: 58px;
  2759. height: 58px;
  2760. border-radius: 50%;
  2761. }
  2762. }
  2763. .otherUserMessageText {
  2764. border-radius: 16px;
  2765. padding: 16px;
  2766. font-size: 16px;
  2767. color: #fff;
  2768. background: #5570F1;
  2769. position: relative;
  2770. min-height: 50px;
  2771. }
  2772. .otherUserMessageText::before {
  2773. content: '';
  2774. position: absolute;
  2775. left: -8px;
  2776. top: 26px;
  2777. transform: translateY(-50%);
  2778. width: 0;
  2779. height: 0;
  2780. border-top: 8px solid transparent;
  2781. border-bottom: 8px solid transparent;
  2782. border-right: 8px solid #5570F1;
  2783. }
  2784. }
  2785. //我
  2786. .meUserMessage {
  2787. display: flex;
  2788. align-items: flex-start;
  2789. margin-bottom: 30px;
  2790. justify-content: flex-end;
  2791. .meUserIcon {
  2792. margin-left: 20px;
  2793. img {
  2794. width: 58px;
  2795. height: 58px;
  2796. border-radius: 50%;
  2797. }
  2798. }
  2799. .meUserMessageText {
  2800. border-radius: 16px;
  2801. padding:16px;
  2802. font-size: 16px;
  2803. color:#333;
  2804. background: #FFEAD1;
  2805. position: relative;
  2806. min-height: 50px;
  2807. cursor: pointer;
  2808. }
  2809. .meUserMessageText::before {
  2810. content: '';
  2811. position: absolute;
  2812. right: -8px;
  2813. top: 26px;
  2814. transform: translateY(-50%);
  2815. width: 0;
  2816. height: 0;
  2817. border-top: 8px solid transparent;
  2818. border-bottom: 8px solid transparent;
  2819. border-left: 8px solid #FFEAD1;
  2820. }
  2821. }
  2822. }
  2823. }
  2824. //消息框
  2825. .sendMessageBox {
  2826. //height: 250px;
  2827. padding: 20px 40px 0 40px;
  2828. border-top: 1px solid #E7E7E7;
  2829. box-sizing: border-box;
  2830. .sendMessageTools {
  2831. display: flex;
  2832. align-items: center;
  2833. justify-content: space-between;
  2834. .toolsBigBox {
  2835. display: flex;
  2836. align-items: center;
  2837. justify-content: space-between;
  2838. .toolsBox {
  2839. display: flex;
  2840. align-items: center;
  2841. justify-content: flex-start;
  2842. img {
  2843. width: 36px;
  2844. height: 36px;
  2845. margin-right: 30px;
  2846. cursor: pointer;
  2847. }
  2848. }
  2849. }
  2850. .fileBox {
  2851. width: 180px;
  2852. display: flex;
  2853. align-items: center;
  2854. border: 1px solid #E9EDF7;
  2855. border-radius: 8px;
  2856. padding: 5px 10px;
  2857. .fileBoxText {
  2858. font-size: 14px;
  2859. color: #999;
  2860. white-space: nowrap;
  2861. overflow: hidden;
  2862. text-overflow: ellipsis;
  2863. width: 110px;
  2864. }
  2865. img {
  2866. width: 40px;
  2867. height: 40px;
  2868. margin-right: 5px;
  2869. }
  2870. }
  2871. }
  2872. .sendMessageInput {
  2873. margin-top: 5px;
  2874. }
  2875. .sendMessageButton {
  2876. padding-top: 20px;
  2877. text-align: right;
  2878. button {
  2879. width: 120px;
  2880. height: 38px;
  2881. }
  2882. }
  2883. }
  2884. //右侧菜单
  2885. .rightSlideBox {
  2886. width: 420px;
  2887. height: 100%;
  2888. position: absolute;
  2889. right: 0;
  2890. top: 0;
  2891. background: #fff;
  2892. box-shadow: -4px 0px 4px 0px rgba(0, 0, 0, 0.1);
  2893. .rightSlideBoxClose {
  2894. padding: 20px 20px 0 20px;
  2895. height: 50px;
  2896. overflow: hidden;
  2897. display: flex;
  2898. align-items: center;
  2899. justify-content: space-between;
  2900. .rightSlideBoxCloseTitle {
  2901. font-size: 18px;
  2902. color: #333;
  2903. }
  2904. .rightSlideBoxCloseIcon {
  2905. cursor: pointer;
  2906. width: 28px;
  2907. height: 28px;
  2908. line-height: 28px;
  2909. text-align: center;
  2910. background: #EFEFEF;
  2911. border-radius: 8px;
  2912. }
  2913. }
  2914. .rightSlideSearch {
  2915. padding: 30px 25px 0 25px;
  2916. height: 66px;
  2917. overflow: hidden;
  2918. position: relative;
  2919. .searchFriendBox {
  2920. position: absolute;
  2921. width: 280px;
  2922. border-radius: 8px;
  2923. top: 65px;
  2924. left: -260px;
  2925. background: #fff;
  2926. box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.1);
  2927. border-radius: 8px;
  2928. z-index: 100;
  2929. box-sizing: border-box;
  2930. padding: 20px 0 30px 0;
  2931. .searchFriendClose {
  2932. display: flex;
  2933. align-items: center;
  2934. justify-content: flex-end;
  2935. padding-right: 10px;
  2936. padding-bottom: 10px;
  2937. .rightSlideBoxCloseIcon {
  2938. cursor: pointer;
  2939. width: 28px;
  2940. height: 28px;
  2941. line-height: 28px;
  2942. text-align: center;
  2943. background: #EFEFEF;
  2944. border-radius: 8px;
  2945. }
  2946. }
  2947. .searchFriendItem {
  2948. display: flex;
  2949. align-items: center;
  2950. justify-content: flex-start;
  2951. border-bottom: 1px solid #E9EDF7;
  2952. padding: 0 20px 30px 20px;
  2953. .searchFriendAvatar {
  2954. img {
  2955. width: 66px;
  2956. height: 66px;
  2957. border-radius: 50%;
  2958. }
  2959. margin-right: 15px;
  2960. }
  2961. .searchFriendInfo {
  2962. flex: 1;
  2963. .searchFriendName {
  2964. display: flex;
  2965. align-items: center;
  2966. .gender {
  2967. img {
  2968. width: 12px;
  2969. height: 12px;
  2970. }
  2971. }
  2972. img {
  2973. width: 18px;
  2974. height: 18px;
  2975. cursor: pointer;
  2976. }
  2977. .searchFriendNameText {
  2978. font-size: 18px;
  2979. width: 120px;
  2980. height: 28px;
  2981. line-height: 28px;
  2982. white-space: nowrap;
  2983. overflow: hidden;
  2984. text-overflow: ellipsis;
  2985. }
  2986. }
  2987. .searchFriendPhone {
  2988. font-size: 14px;
  2989. color: #999;
  2990. margin-top: 10px;
  2991. }
  2992. }
  2993. }
  2994. .searchFriendLineBox {
  2995. display: flex;
  2996. align-items: center;
  2997. justify-content: flex-start;
  2998. padding: 20px;
  2999. border-bottom: 1px solid #E9EDF7;
  3000. .searchFriendLineTitle{
  3001. font-size: 16px;
  3002. color: #999999;
  3003. width: 90px;
  3004. }
  3005. .searchFriendLineContent{
  3006. font-size: 16px;
  3007. color: #333;
  3008. flex: 1;
  3009. .searchFriendLineContentItem{
  3010. display: flex;
  3011. align-items: center;
  3012. justify-content: space-between;
  3013. }
  3014. }
  3015. }
  3016. .searchFriendButton {
  3017. padding:40px 0 10px 0;
  3018. text-align: center;
  3019. .searchFriendButtonItem {
  3020. font-size: 14px;
  3021. color: #5570F1;
  3022. img {
  3023. width: 30px;
  3024. height: 30px;
  3025. margin-bottom: 5px;
  3026. }
  3027. }
  3028. }
  3029. }
  3030. }
  3031. .rightSlideUserBox {
  3032. box-sizing: border-box;
  3033. padding: 40px 40px 10px 40px;
  3034. height: 180px;
  3035. overflow-y: auto;
  3036. display: flex;
  3037. align-items: center;
  3038. flex-wrap: wrap;
  3039. //border-bottom: 1px solid #E9EDF7;
  3040. .rightEditUserItem {
  3041. cursor: pointer;
  3042. // color: #333;
  3043. // .rightSlideUserItemIcon {
  3044. // .addUserIcon {
  3045. // transition: all 0.5s ease;
  3046. // }
  3047. // .addUserIcon:hover {
  3048. // background: #5570F1;
  3049. // color: #fff;
  3050. // }
  3051. // }
  3052. }
  3053. .rightSlideUserItem {
  3054. margin-bottom: 20px;
  3055. width: 25%;
  3056. position: relative;
  3057. //cursor: pointer;
  3058. //用户菜单
  3059. .rightSlideUserItemMore {
  3060. position: absolute;
  3061. background: #fff;
  3062. box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.1);
  3063. bottom: -220px;
  3064. left: -240px;
  3065. width: 280px;
  3066. height: 270px;
  3067. .rightSlideUserItemMoreMain {
  3068. display: flex;
  3069. align-items: center;
  3070. justify-content: flex-start;
  3071. padding:0 20px;
  3072. .rightSlideUserItemMoreMainIcon {
  3073. img {
  3074. width: 66px;
  3075. height: 66px;
  3076. border-radius: 50%;
  3077. }
  3078. }
  3079. .rightSlideUserItemMoreMainInfo {
  3080. padding: 30px 0 30px 20px;
  3081. border-bottom: 1px solid #E9EDF7;
  3082. flex: 1;
  3083. .rightSlideUserItemMoreMainInfoTop {
  3084. display: flex;
  3085. align-items: center;
  3086. justify-content: space-between;
  3087. .rightSlideUserItemMoreUserName {
  3088. display: flex;
  3089. align-items: center;
  3090. justify-content: center;
  3091. font-size: 18px;
  3092. .rightSlideUserItemMoreUserMore {
  3093. margin-left: 10px;
  3094. img {
  3095. width: 12px;
  3096. height: 12px;
  3097. }
  3098. }
  3099. }
  3100. .rightSlideUserItemMoreUserMoreIcon {
  3101. img {
  3102. width: 18px;
  3103. height: 18px;
  3104. }
  3105. }
  3106. }
  3107. }
  3108. .rightSlideUserItemMoreNumber {
  3109. font-size: 14px;
  3110. color: #999;
  3111. margin-top: 10px;
  3112. }
  3113. }
  3114. .rightSlideUserItemMoreLine {
  3115. .rightSlideUserItemMoreLineItem {
  3116. padding: 20px;
  3117. border-bottom: 1px solid #E9EDF7;
  3118. display: flex;
  3119. .rightSlideUserItemMoreTitle {
  3120. font-size: 16px;
  3121. color: #999;
  3122. width: 80px;
  3123. }
  3124. .rightSlideUserItemMoreText {
  3125. font-size: 16px;
  3126. color: #333;
  3127. display: flex;
  3128. align-items: center;
  3129. justify-content: space-between;
  3130. flex:1;
  3131. }
  3132. }
  3133. .rightSlideUserItemMoreLineButton {
  3134. padding-top: 25px;
  3135. text-align: center;
  3136. font-size: 14px;
  3137. color:#5570F1;
  3138. display: flex;
  3139. align-items: center;
  3140. justify-content: center;
  3141. img {
  3142. width: 25px;
  3143. height: 25px;
  3144. margin-bottom: 8px;
  3145. }
  3146. .rightSlideUserItemMoreLineGroup {
  3147. width: 33.33%;
  3148. }
  3149. }
  3150. }
  3151. }
  3152. .rightSlideUserItemIcon {
  3153. display: flex;
  3154. align-items: center;
  3155. justify-content: center;
  3156. img {
  3157. width: 58px;
  3158. height: 58px;
  3159. border-radius: 50%;
  3160. }
  3161. .el-dropdown-link {
  3162. width: 58px;
  3163. height: 58px;
  3164. }
  3165. .addUserIcon {
  3166. width: 58px;
  3167. height: 58px;
  3168. line-height: 58px;
  3169. background: #F0F0F0;
  3170. border-radius: 50%;
  3171. text-align: center;
  3172. color:#fff;
  3173. font-size: 32px;
  3174. }
  3175. }
  3176. .rightSlideUserItemName {
  3177. //width: 80px;
  3178. padding: 0 5px;
  3179. font-size: 16px;
  3180. color: #333;
  3181. margin-top: 10px;
  3182. text-align: center;
  3183. white-space: nowrap; /* 强制不换行 */
  3184. overflow: hidden; /* 超出宽度隐藏 */
  3185. text-overflow: ellipsis; /* 显示省略号 */
  3186. }
  3187. }
  3188. }
  3189. .rightLineBorder {
  3190. width: 100%;
  3191. border-bottom: 1px solid #E9EDF7;
  3192. }
  3193. .rightSlideMore {
  3194. padding: 30px 40px;
  3195. font-size: 18px;
  3196. color: #999;
  3197. text-align: center
  3198. }
  3199. //聊天记录
  3200. .rightSlideFunction {
  3201. .rightSlideFunctionItem {
  3202. height: 60px;
  3203. display: flex;
  3204. align-items: center;
  3205. justify-content: space-between;
  3206. padding: 20px 40px;
  3207. border-bottom: 1px solid #E9EDF7;
  3208. cursor: pointer;
  3209. .rightSlideFunctionItemText {
  3210. font-size: 18px;
  3211. color: #333;
  3212. }
  3213. .rightSlideFunctionItemIcon {
  3214. img {
  3215. width: 18px;
  3216. height: 18px;
  3217. }
  3218. }
  3219. }
  3220. }
  3221. //群聊设置
  3222. .groupSystem {
  3223. border-bottom: 1px solid #E9EDF7;
  3224. padding-bottom: 30px;
  3225. .groupChatSystem {
  3226. padding: 30px 40px 0 40px;
  3227. height: 80px;
  3228. overflow: hidden;
  3229. .groupChatTitle {
  3230. font-size: 18px;
  3231. color: #333;
  3232. margin-bottom: 10px;
  3233. }
  3234. .groupChatText {
  3235. width: 100%;
  3236. height: 20px;
  3237. overflow: hidden;
  3238. font-size: 18px;
  3239. color: #999;
  3240. cursor: pointer;
  3241. white-space: nowrap;
  3242. text-overflow: ellipsis;
  3243. }
  3244. }
  3245. }
  3246. .rightSlideFooterBox {
  3247. flex: 1;
  3248. display: flex;
  3249. align-items: center;
  3250. justify-content: space-between;
  3251. div{
  3252. width: 33%;
  3253. text-align: center;
  3254. font-size: 16px;
  3255. color: #666;
  3256. cursor: pointer;
  3257. margin-top: 30px;
  3258. box-sizing: border-box;
  3259. border-right: 1px solid #E9EDF7;
  3260. }
  3261. }
  3262. .rightSlideFooter {
  3263. font-size: 18px;
  3264. color: #666;
  3265. padding: 30px 40px;
  3266. text-align: center;
  3267. cursor: pointer;
  3268. border-bottom: 1px solid #E9EDF7;
  3269. }
  3270. .isLast {
  3271. border-bottom: 0;
  3272. color: #999;
  3273. }
  3274. }
  3275. }
  3276. }
  3277. //不同的消息类型
  3278. //发送文件
  3279. .messageTypeFile {
  3280. width: 283px;
  3281. background: #fff;
  3282. border-radius: 16px;
  3283. border: 1px solid #E9EDF7;
  3284. cursor:pointer;
  3285. .messageTypeFileTop{
  3286. border-bottom: 1px solid #E9EDF7;
  3287. .messageTypeFileSize {
  3288. padding: 10px 20px 10px 20px;
  3289. }
  3290. .messageTypeFileInfo {
  3291. display: flex;
  3292. align-items: center;
  3293. padding:20px 20px 20px 20px;
  3294. .messageTypeFileTitle {
  3295. font-size: 16px;
  3296. color: #333;
  3297. height: auto; /* Allow height to adjust */
  3298. max-height: 48px; /* Maximum height for two lines (16px * 2) */
  3299. overflow: hidden; /* Hide overflow */
  3300. text-overflow: ellipsis; /* Show ellipsis for overflow text */
  3301. display: -webkit-box; /* Use flexbox for multi-line ellipsis */
  3302. -webkit-box-orient: vertical; /* Set box orientation to vertical */
  3303. -webkit-line-clamp: 2; /* Limit to 2 lines */
  3304. white-space: normal; /* Allow text wrapping */
  3305. width: 200px;
  3306. }
  3307. .messageTypeFileIcon {
  3308. img {
  3309. width: 42px;
  3310. height: 42px;
  3311. }
  3312. }
  3313. }
  3314. }
  3315. .messageTypeFileLogo {
  3316. padding:15px 20px;
  3317. }
  3318. .messageTypeFileSize {
  3319. font-size: 12px;
  3320. color: #999;
  3321. }
  3322. .messageTypeFileLogo {
  3323. font-size: 12px;
  3324. color: #999;
  3325. }
  3326. }
  3327. //发送名片
  3328. .messageTypeCard {
  3329. width: 321px;
  3330. background: #fff;
  3331. border-radius: 16px;
  3332. border: 1px solid #E9EDF7;
  3333. .messageTypeCardTop {
  3334. display: flex;
  3335. align-items: center;
  3336. padding: 20px 20px 24px 20px;
  3337. border-bottom: 1px solid #E9EDF7;
  3338. .messageTypeCardIcon {
  3339. margin-right: 15px;
  3340. img {
  3341. width: 58px;
  3342. height: 58px;
  3343. border-radius: 50%;
  3344. }
  3345. }
  3346. .messageTypeCardName {
  3347. font-size: 16px;
  3348. color: #333;
  3349. }
  3350. }
  3351. .messageTypeCardText {
  3352. padding-top: 14px;
  3353. padding-left: 20px;
  3354. padding-bottom: 15px;
  3355. font-size: 12px;
  3356. color: #999999;
  3357. }
  3358. }
  3359. //发送图片
  3360. .messageTypeImage {
  3361. width: 200px;
  3362. //height: 200px;
  3363. img {
  3364. max-width: 200px;
  3365. border-radius: 16px;
  3366. border: 1px solid #ECECEC;
  3367. }
  3368. }
  3369. //发送群聊
  3370. .messageGroupInvite {
  3371. background: #fff;
  3372. border-radius: 16px;
  3373. border: 1px solid #E9EDF7;
  3374. .messageGroupInviteTop {
  3375. display: flex;
  3376. align-items: center;
  3377. justify-content: space-between;
  3378. padding: 20px 20px 24px 20px;
  3379. .messageGroupInviteIcon {
  3380. margin-right: 15px;
  3381. img {
  3382. width: 58px;
  3383. height: 58px;
  3384. border-radius: 50%;
  3385. }
  3386. }
  3387. .messageGroupInfoText {
  3388. .messageGroupInfoTextTitle {
  3389. font-size: 16px;
  3390. color: #333;
  3391. margin-bottom: 5px;
  3392. }
  3393. .messageGroupInfoTextTxt {
  3394. font-size: 12px;
  3395. color: #999;
  3396. line-height: 18px;
  3397. }
  3398. }
  3399. }
  3400. .messageGroupInviteText {
  3401. padding-top: 14px;
  3402. padding-left: 20px;
  3403. padding-bottom: 15px;
  3404. font-size: 12px;
  3405. color: #999999;
  3406. border-top: 1px solid #E9EDF7;
  3407. }
  3408. }
  3409. //添加用户弹出框
  3410. .searchWindow {
  3411. display: flex;
  3412. .searchWindowLeft {
  3413. width: 330px;
  3414. box-sizing: border-box;
  3415. border-right: 1px solid #E9EDF7;
  3416. padding-right: 25px;
  3417. .searchUserWindowBox {
  3418. position: relative;
  3419. .searchFriendClose {
  3420. display: flex;
  3421. align-items: center;
  3422. justify-content: flex-end;
  3423. padding-right: 10px;
  3424. padding-bottom: 10px;
  3425. .rightSlideBoxCloseIcon {
  3426. cursor: pointer;
  3427. width: 28px;
  3428. height: 28px;
  3429. line-height: 28px;
  3430. text-align: center;
  3431. background: #EFEFEF;
  3432. border-radius: 8px;
  3433. }
  3434. }
  3435. .searchFriendBox {
  3436. position: absolute;
  3437. width: 280px;
  3438. border-radius: 8px;
  3439. top: 0;
  3440. right: -280px;
  3441. background: #fff;
  3442. box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.1);
  3443. border-radius: 8px;
  3444. z-index: 100;
  3445. box-sizing: border-box;
  3446. padding: 20px 0 30px 0;
  3447. .searchFriendItem {
  3448. display: flex;
  3449. align-items: center;
  3450. justify-content: flex-start;
  3451. border-bottom: 1px solid #E9EDF7;
  3452. padding: 0 20px 30px 20px;
  3453. .searchFriendAvatar {
  3454. img {
  3455. width: 66px;
  3456. height: 66px;
  3457. border-radius: 50%;
  3458. }
  3459. margin-right: 15px;
  3460. }
  3461. .searchFriendInfo {
  3462. flex: 1;
  3463. .searchFriendName {
  3464. display: flex;
  3465. align-items: center;
  3466. .gender {
  3467. img {
  3468. width: 12px;
  3469. height: 12px;
  3470. }
  3471. }
  3472. img {
  3473. width: 18px;
  3474. height: 18px;
  3475. cursor: pointer;
  3476. }
  3477. .searchFriendNameText {
  3478. font-size: 18px;
  3479. width: 120px;
  3480. height: 28px;
  3481. line-height: 28px;
  3482. white-space: nowrap;
  3483. overflow: hidden;
  3484. text-overflow: ellipsis;
  3485. }
  3486. }
  3487. .searchFriendPhone {
  3488. font-size: 14px;
  3489. color: #999;
  3490. margin-top: 10px;
  3491. }
  3492. }
  3493. }
  3494. .searchFriendLineBox {
  3495. display: flex;
  3496. align-items: center;
  3497. justify-content: flex-start;
  3498. padding: 20px;
  3499. border-bottom: 1px solid #E9EDF7;
  3500. .searchFriendLineTitle{
  3501. font-size: 16px;
  3502. color: #999999;
  3503. width: 90px;
  3504. }
  3505. .searchFriendLineContent{
  3506. font-size: 16px;
  3507. color: #333;
  3508. flex: 1;
  3509. .searchFriendLineContentItem{
  3510. display: flex;
  3511. align-items: center;
  3512. justify-content: space-between;
  3513. }
  3514. }
  3515. }
  3516. .searchFriendButton {
  3517. padding:40px 0 10px 0;
  3518. text-align: center;
  3519. .searchFriendButtonItem {
  3520. font-size: 14px;
  3521. color: #5570F1;
  3522. img {
  3523. width: 30px;
  3524. height: 30px;
  3525. margin-bottom: 5px;
  3526. }
  3527. }
  3528. }
  3529. }
  3530. }
  3531. .searchUserBox {
  3532. padding-top: 30px;
  3533. .searchNameEnglish {
  3534. font-size: 18px;
  3535. color: #999;
  3536. padding: 30px 0 20px 0;
  3537. }
  3538. .searchUserItem {
  3539. display: flex;
  3540. align-items: center;
  3541. margin-bottom: 20px;
  3542. .searchUserName {
  3543. font-size: 18px;
  3544. font-weight: bold;
  3545. color: #333;
  3546. }
  3547. img {
  3548. width: 38px;
  3549. height: 38px;
  3550. border-radius: 50%;
  3551. margin: 0 20px;
  3552. }
  3553. }
  3554. }
  3555. }
  3556. .searchWindowRight {
  3557. width: 690px;
  3558. .searchWindowRightTop {
  3559. display: flex;
  3560. align-items: center;
  3561. justify-content: space-between;
  3562. padding: 0 30px 30px 30px;
  3563. .searchWindowRightTitle {
  3564. font-size: 18px;
  3565. color: #333;
  3566. }
  3567. .searchWindowRightNum {
  3568. font-size: 18px;
  3569. color: #999;
  3570. }
  3571. }
  3572. .searchWindowUserList {
  3573. padding: 0 30px;
  3574. height: 400px;
  3575. display: flex;
  3576. flex-wrap: wrap;
  3577. align-items: flex-start;
  3578. align-content: flex-start;
  3579. .searchWindowUserItem {
  3580. width:20%;
  3581. text-align: center;
  3582. margin-bottom: 30px;
  3583. .searchWindowUserName {
  3584. font-size: 18px;
  3585. color: #333;
  3586. font-weight: bold;
  3587. width: 122px;
  3588. white-space: nowrap; /* 强制不换行 */
  3589. overflow: hidden; /* 超出宽度隐藏 */
  3590. text-overflow: ellipsis; /* 显示省略号 */
  3591. }
  3592. .searchWindowUserIcon {
  3593. width: 58px;
  3594. height: 58px;
  3595. position: relative;
  3596. margin: 0 auto 10px auto;
  3597. .searchWindowDeleteUser {
  3598. position: absolute;
  3599. width: 15px;
  3600. height: 15px;
  3601. background: rgba(0,0,0,0.3);
  3602. border-radius: 5px;
  3603. color: #fff;
  3604. right: -3px;
  3605. top: -3px;
  3606. cursor: pointer;
  3607. }
  3608. img {
  3609. width: 58px;
  3610. height: 58px;
  3611. border-radius: 50%;
  3612. margin-bottom: 10px;
  3613. }
  3614. }
  3615. }
  3616. }
  3617. .shareCardBox {
  3618. border-top: 1px solid #E9EDF7;
  3619. .shareCardTitle {
  3620. padding: 30px;
  3621. }
  3622. .shareCardInput {
  3623. padding: 0 30px 0 30px;
  3624. }
  3625. }
  3626. .searchWindowFooter {
  3627. text-align: center;
  3628. padding-top: 30px;
  3629. }
  3630. }
  3631. }
  3632. //聊天记录弹出框
  3633. .fileWindow {
  3634. .fileWindowHeader {
  3635. margin-bottom: 20px;
  3636. }
  3637. .fileWindowMessageTime {
  3638. width: 100px;
  3639. height: 37px;
  3640. line-height: 37px;
  3641. text-align: center;
  3642. background: #F4F5FA;
  3643. border-radius: 8px;
  3644. font-size: 14px;
  3645. color: #999999;
  3646. margin-top: 30px;
  3647. }
  3648. .fileWindowMessageScrollBox {
  3649. height: 500px;
  3650. overflow-y: auto;
  3651. }
  3652. .fileWindowNoMessage {
  3653. font-size: 18px;
  3654. color: #999;
  3655. text-align: center;
  3656. height: 500px;
  3657. line-height: 500px;
  3658. }
  3659. .fileWindowMessageItemBox {
  3660. display: flex;
  3661. align-items: flex-start;
  3662. .active {
  3663. background: #F5F7FD;
  3664. border-right: 4px solid #5570F1 !important;
  3665. }
  3666. .historicalMessageBox {
  3667. width: 100%;
  3668. display: flex;
  3669. align-items: flex-start;
  3670. padding: 30px 0 20px 0;
  3671. border-bottom: 1px solid #E9EDF7;
  3672. }
  3673. .fileWindowMessageItemIcon {
  3674. img {
  3675. width: 58px;
  3676. height: 58px;
  3677. border-radius: 50%;
  3678. }
  3679. }
  3680. .fileWindowMessageItemIcon {
  3681. padding-right: 15px;
  3682. }
  3683. .fileWindowMessageItem {
  3684. flex: 1;
  3685. .fileWindowMessageItemInfo {
  3686. display: flex;
  3687. align-items: center;
  3688. justify-content: space-between;
  3689. padding-bottom: 20px;
  3690. .fileWindowMessageItemName {
  3691. font-size: 18px;
  3692. color: #333;
  3693. }
  3694. .fileWindowMessageItemTime {
  3695. font-size: 14px;
  3696. color: #999;
  3697. }
  3698. }
  3699. .fileWindowMessageItemText {
  3700. font-size: 14px;
  3701. color: #999;
  3702. }
  3703. .fileWindowMessageItemImage {
  3704. width: 150px;
  3705. height: 150px;
  3706. border-radius: 16px;
  3707. border: 1px solid #ECECEC;
  3708. }
  3709. }
  3710. }
  3711. //文件列表
  3712. .fileWindowFlieBox {
  3713. .fileWindowFlieItem {
  3714. padding:30px 0 20px 0;
  3715. display: flex;
  3716. align-items: center;
  3717. border-bottom: 1px solid #E9EDF7;
  3718. .fileWindowFlieItemIcon {
  3719. margin-right: 10px;
  3720. img {
  3721. width: 42px;
  3722. height: 42px;
  3723. }
  3724. }
  3725. .fileWindowFlieItemMain {
  3726. flex: 1;
  3727. .fileWindowFlieItemTitle {
  3728. display: flex;
  3729. align-items: center;
  3730. justify-content: space-between;
  3731. font-size: 16px;
  3732. color: #333;
  3733. margin-bottom: 6px;
  3734. }
  3735. .fileWindowFlieItemTime {
  3736. font-size: 14px;
  3737. color: #999;
  3738. }
  3739. .fileWindowFlieInfo {
  3740. display: flex;
  3741. align-items: center;
  3742. justify-content: space-between;
  3743. font-size: 12px;
  3744. color: #999;
  3745. }
  3746. }
  3747. }
  3748. }
  3749. //图片列表
  3750. .fileWindowImageBox {
  3751. display: flex;
  3752. flex-wrap: wrap;
  3753. div {
  3754. width: 25%;
  3755. text-align: center;
  3756. padding: 20px 0 0 0;
  3757. }
  3758. img {
  3759. width: 150px;
  3760. height: 150px;
  3761. border-radius: 16px;
  3762. border: 1px solid #ECECEC;
  3763. }
  3764. }
  3765. //日期���索
  3766. .fileWindowDateBox {
  3767. width: 100%;
  3768. padding: 30px 0;
  3769. }
  3770. .fileWindowDateButton {
  3771. margin-left: 10px;
  3772. }
  3773. //群成员搜索
  3774. .fileWindowGroupMain{
  3775. display: flex;
  3776. .fileWindowGroupUserLeft {
  3777. flex: 1;
  3778. box-sizing: border-box;
  3779. padding-right: 20px;
  3780. }
  3781. .fileWindowGroupUserRight {
  3782. width: 300px;
  3783. .fileWindowGroupUserBox {
  3784. padding: 30px 0;
  3785. .searchUserBox {
  3786. .searchNameEnglish {
  3787. font-size: 18px;
  3788. color: #999;
  3789. padding: 30px 0 20px 0;
  3790. }
  3791. .searchUserItem {
  3792. display: flex;
  3793. align-items: center;
  3794. .searchUserName {
  3795. font-size: 18px;
  3796. font-weight: bold;
  3797. color: #333;
  3798. }
  3799. img {
  3800. width: 38px;
  3801. height: 38px;
  3802. border-radius: 50%;
  3803. margin: 0 20px 0 0;
  3804. }
  3805. }
  3806. }
  3807. }
  3808. }
  3809. }
  3810. }
  3811. //添加用户弹出框
  3812. .messageFormBox {
  3813. .messageFormTitle {
  3814. font-size: 18px;
  3815. padding-bottom: 20px;
  3816. }
  3817. .messageFormInput {
  3818. margin-bottom: 30px;
  3819. }
  3820. }
  3821. .imgZoomBox {
  3822. img {
  3823. width: 550px;
  3824. }
  3825. }
  3826. //弹出框底部按钮
  3827. .footerButtonBox {
  3828. padding-top: 40px;
  3829. text-align: center;
  3830. }
  3831. //加入群聊弹出框
  3832. .addGroupWindow {
  3833. .addGroupWindowImg {
  3834. img {
  3835. width:58px;
  3836. height: 58px;
  3837. }
  3838. text-align: center;
  3839. font-size: 18px;
  3840. color: #333;
  3841. }
  3842. .addGroupWindowTitle {
  3843. font-size: 18px;
  3844. color: #333;
  3845. text-align: center;
  3846. padding: 20px 0 40px 0;
  3847. }
  3848. .addGroupWindowText {
  3849. font-size: 12px;
  3850. color: #999;
  3851. text-align: center;
  3852. }
  3853. }
  3854. .shareCardWindowBox{
  3855. .shareCardWindowBoxMain {
  3856. border: 1px solid #E9EDF7;
  3857. border-top: none;
  3858. border-bottom-left-radius: 4px;
  3859. border-bottom-right-radius: 4px;
  3860. background: #F5F7FB;
  3861. padding-left: 14px;
  3862. padding: 10px;
  3863. }
  3864. .shareCardRadioBox {
  3865. height: 50px;
  3866. display: flex;
  3867. align-items: center;
  3868. justify-content: flex-start;
  3869. >.el-radio {
  3870. margin-right: 5px;
  3871. }
  3872. }
  3873. .shareCardItem{
  3874. display: flex;
  3875. align-items: center;
  3876. justify-content: flex-start;
  3877. .shareCardName {
  3878. font-size: 14px;
  3879. color: #333;
  3880. margin-left: 10px;
  3881. }
  3882. img {
  3883. width: 38px;
  3884. height: 38px;
  3885. border-radius: 50%;
  3886. }
  3887. }
  3888. }
  3889. //表单微调 start------------------------------------------------------------>*/
  3890. ::v-deep .custom-form-item > .el-form-item__label {
  3891. line-height: 140px !important;
  3892. }
  3893. ::v-deep .custom-textarea .el-textarea__inner {
  3894. resize: none; /* 禁止用拖拽调整大小 */
  3895. }
  3896. ::v-deep .custom-align-right .el-form-item__label {
  3897. text-align: right; /* 设置标签文字右对齐 */
  3898. }
  3899. ::v-deep .el-select-group__title {
  3900. color: #909399;
  3901. }
  3902. ::v-deep .el-select {
  3903. width: 100% !important;
  3904. }
  3905. ::v-deep .el-tabs__active-bar{
  3906. height: 1px !important;
  3907. }
  3908. ::v-deep .el-tabs__nav-wrap::after {
  3909. height:1px !important;
  3910. }
  3911. ::v-deep .el-tabs__header {
  3912. margin-bottom: 0 !important;
  3913. }
  3914. /* 添加样式以确保右键菜单的显示 */
  3915. .el-dropdown {
  3916. z-index: 2000; /* 确保右键菜单在其他元素之上 */
  3917. }
  3918. </style>