ChatPanel.vue 220 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002
  1. <!-- src/components/ChatPanel.vue -->
  2. <template>
  3. <div class="chat-panel">
  4. <div class="chat-header">
  5. <img class="chat-icon" :src=avatar alt="在线会话" />
  6. <span @click="clickShowMessage">{{ this.$store.state.user.name }}</span>
  7. <span class="chat-status online"></span>
  8. <span class="chat-close" @click="$emit('close')">×</span>
  9. </div>
  10. <div class="chat-tabs">
  11. <span
  12. v-for="(tab, idx) in tabList"
  13. :key="tab.key"
  14. class="tab"
  15. :class="{ active: activeTab === idx }"
  16. @click="activeTab = idx"
  17. >
  18. <img :src="activeTab === idx ? tab.active : tab.icon" class="tab-icon" />
  19. </span>
  20. </div>
  21. <div class="chat-groups">
  22. <template v-if="activeTab === 0">
  23. <div class="hallLeft">
  24. <!--加载中 start------------------------------------------>
  25. <div class="hallLeftLoading" v-if="hallLeftLoading">
  26. <div class="hallLeftLoadingIcon">
  27. <div class="hallLeftLoadingIconItem"><i class="el-icon-loading"></i></div>
  28. <div class="hallLeftLoadingText">恒星管理平台</div>
  29. </div>
  30. </div>
  31. <!--加载中 end------------------------------------------>
  32. <!--添加好友 start------------------------------------------>
  33. <hallTitle name="聊天列表" @addUser="creatGroup" />
  34. <!--添加好友 end------------------------------------------>
  35. <!--搜索 start------------------------------------------>
  36. <div class="searchBoxMain">
  37. <div class="searchBox">
  38. <el-input
  39. placeholder="请输入账号/群聊全称"
  40. prefix-icon="el-icon-search"
  41. v-model="searchConversation"
  42. @keyup.enter.native="searchUserConversation"
  43. >
  44. </el-input>
  45. </div>
  46. </div>
  47. <!--搜索 end------------------------------------------>
  48. <div class="userListBox list001">
  49. <!--会话列表 start------------------------------------------>
  50. <div :class="['userItem', item.status === 1 ? 'active' : '']" v-for="item in conversationList" :key="item.receiver_id">
  51. <div class="flexItemBox" v-if="item.is_group==0" @click="selectConversation(item)">
  52. <!--单聊-->
  53. <div class="userAvatar">
  54. <img :src="item.avatar" v-if="item.avatar!=null&&item.avatar!=''">
  55. <img src="@/assets/chat/user/admin.png" v-else>
  56. </div>
  57. <div class="userInfo">
  58. <div class="userName">
  59. <div class="userNameText">{{item.user_name}}</div>
  60. <div class="userMessageNum" v-if="item.num>0">{{item.num}}</div>
  61. </div>
  62. </div>
  63. </div>
  64. <!--群聊-->
  65. <div class="flexItemBox" v-else @click="selectGroup(item)">
  66. <div class="userAvatar">
  67. <img src="@/assets/chat/user/group.jpg">
  68. </div>
  69. <div class="userInfo">
  70. <div class="userName">
  71. <div class="userNameText">{{item.group_name}}</div>
  72. <div class="userMessageNum" v-if="item.num>0">{{item.num}}</div>
  73. </div>
  74. </div>
  75. </div>
  76. </div>
  77. <!--会话列表 end------------------------------------------>
  78. </div>
  79. </div>
  80. </template>
  81. <template v-else>
  82. <div class="hallLeft">
  83. <!--添加好友 start------------------------------------------>
  84. <contactsTitle :name="tableTitleName" @addUser="addUser" @closeAddUser="closeAddUser" />
  85. <!--添加好友 end------------------------------------------>
  86. <!--搜索 start------------------------------------------>
  87. <div class="searchBox">
  88. <el-input
  89. placeholder="请输入用户账号"
  90. prefix-icon="el-icon-search"
  91. v-model="searchUserName"
  92. @keyup.enter.native="searchFriend"
  93. v-if="pagestatus == 4"
  94. >
  95. </el-input>
  96. <el-input
  97. placeholder="请输入好友账号"
  98. prefix-icon="el-icon-search"
  99. v-model="searchUserListName"
  100. @keyup.enter.native="searchOrdFriend"
  101. v-if="pagestatus==1||pagestatus==2||pagestatus==3"
  102. >
  103. </el-input>
  104. </div>
  105. <!--搜索 end------------------------------------------>
  106. <!-- <div class="newFriendBox">新的朋友</div> -->
  107. <div class="newFriendImgBox" v-if="pagestatus==4">
  108. <div class="newFriendImg">
  109. <img src="@/assets/chat/newcontacts.png" width="20px" height="20px">
  110. </div>
  111. <div class="newFriendText" @click="searchFriend">
  112. 搜索:{{searchUserName}}
  113. </div>
  114. <div class="searchFriendBox" v-if="searchWindowStatus==true">
  115. <div class="searchFriendItem">
  116. <div class="searchFriendAvatar">
  117. <img :src="searchFriendList.avatar" v-if="searchFriendList.avatar!=''">
  118. <img src="@/assets/chat/user/admin.png" v-else>
  119. </div>
  120. <div class="searchFriendInfo">
  121. <div class="searchFriendName">
  122. <div class="searchFriendNameText" v-if="searchFriendList.remark!=null&&searchFriendList.remark!=''">{{searchFriendList.remark}}</div>
  123. <div class="searchFriendNameText" v-else>{{searchFriendList.user_name}}</div>
  124. </div>
  125. <div class="searchFriendPhone">账号:{{searchFriendList.user_name}}</div>
  126. </div>
  127. </div>
  128. <div class="searchFriendButton">
  129. <el-button type="primary" v-if="searchFriendList.showBtn==false&&searchFriendList.id!=this.$store.state.user.userid" @click="openAddWindow(searchFriendList.id)">添加到通讯录</el-button>
  130. <el-button type="danger" v-else-if="searchFriendList.showBtn==true" @click="deleteFriend(searchFriendList)">删除好友</el-button>
  131. <el-button type="primary" disabled v-else>添加到通讯录</el-button>
  132. </div>
  133. </div>
  134. </div>
  135. <div :class="['newFriendImgBox', pagestatus === 2 ? 'newFriendIActive' : '']" @click="tabPage(2)" v-else>
  136. <div class="newFriendImg">
  137. <img src="@/assets/chat/newcontacts.png">
  138. </div>
  139. <div class="newFriendText" v-if="pagestatus==4">
  140. 搜索:{{searchUserName}}
  141. </div>
  142. <div class="newFriendText" v-else>
  143. 新的朋友
  144. <span v-if="userApplyList.length>0">{{userApplyList.length}}</span>
  145. </div>
  146. </div>
  147. <!--用户列表 start------------------------------------------>
  148. <div class="userListBox list002" v-if="pagestatus==1||pagestatus==2||pagestatus==3">
  149. <!-- <div class="userListTitle">A</div> -->
  150. <div class="userItem" @click="changeUserItem(item.friend_id)" v-for="(item,index) in userFriendList" :key="index" :class="['userItem', { active: item.status == 1 }]">
  151. <div class="userAvatar">
  152. <img :src="item.avatar" v-if="item.avatar!=''">
  153. <img src="@/assets/chat/user/admin.png" v-else>
  154. </div>
  155. <div class="userInfo">
  156. <div class="userName">
  157. <div class="userNameText" v-if="item.remark!=null">{{item.user_name}}<span v-if="item.remark!=''">({{item.remark}})</span></div>
  158. <div class="userNameText" v-else>{{item.user_name}}</div>
  159. </div>
  160. </div>
  161. </div>
  162. </div>
  163. <!--用户列表 end------------------------------------------>
  164. </div>
  165. </template>
  166. </div>
  167. <el-dialog
  168. :visible.sync="showDialog"
  169. width="80%"
  170. heigth="80%"
  171. class="chat-dialog"
  172. top="2vh"
  173. >
  174. <!--右侧菜单 start------------------------------------------------------------>
  175. <div class="hallRight">
  176. <!--加载中 start-->
  177. <div class="hallRightLoading" v-if="hallRightLoading">
  178. <div class="hallRightLoadingIcon">
  179. <div class="hallRightLoadingIconItem"><i class="el-icon-loading"></i></div>
  180. <div class="hallRightLoadingText">恒星管理平台</div>
  181. </div>
  182. </div>
  183. <!--加载中 end-->
  184. <div :class="['UserNameBox', groupId ? 'ifNotice' : '']">
  185. <div class="userName">{{ messageTitle }}</div>
  186. <img src="@/assets/chat/fi_more.png" v-if="groupId!=''" @click="openGroupSystem" class="moreIcon">
  187. <div class="groupNotice" v-if="groupId!=''&&groupProfile!=''" @click="groupProfileWindow=true">{{groupProfile}}</div>
  188. <div v-if="groupId==''">
  189. <div class="shareCardIcon" @click="openShareCard">
  190. <i class="el-icon-postcard"></i>
  191. </div>
  192. </div>
  193. </div>
  194. <div class="rightPositionBox">
  195. <div class="rightUserMessageBox" ref="rightUserMessageBox">
  196. <!-- <div class="timeBox">
  197. <span>12:40:22</span>
  198. </div> -->
  199. <div v-for="item in chatrecords" :key="item.id">
  200. <!--文字消息类型 对方-->
  201. <div class="otherUserMessage" v-if="item.action=='recieved'&&Number(item.msg_type)==1">
  202. <div class="otherUserIcon">
  203. <img :src="item.receiver_avatar" v-if="item.receiver_avatar!=null&&item.receiver_avatar!=''">
  204. <img src="@/assets/chat/user/admin.png" v-else>
  205. </div>
  206. <div class="otherUserMessageText">
  207. {{item.content}}
  208. </div>
  209. </div>
  210. <!--文字消息类型 我-->
  211. <div class="meUserMessage" v-if="item.action=='said'&&Number(item.msg_type)==1">
  212. <div class="meUserMessageText">
  213. {{item.content}}
  214. </div>
  215. <div class="meUserIcon">
  216. <img :src="item.user_avatar" v-if="item.user_avatar!=null&&item.user_avatar!=''">
  217. <img src="@/assets/chat/user/admin.png" v-else>
  218. </div>
  219. </div>
  220. <!-- 图片类型 对方-->
  221. <div class="otherUserMessage" v-if="item.action=='recieved'&&Number(item.msg_type)==2">
  222. <div class="otherUserIcon">
  223. <img :src="item.receiver_avatar" v-if="item.receiver_avatar!=null&&item.receiver_avatar!=''">
  224. <img src="@/assets/chat/user/admin.png" v-else>
  225. </div>
  226. <div class="otherUserMessageText">
  227. <div class="messageTypeImage">
  228. <img :src="item.content" @click="imgZoom(item.content)">
  229. </div>
  230. </div>
  231. </div>
  232. <!-- 图片类型 我-->
  233. <div class="meUserMessage" v-if="item.action=='said'&&Number(item.msg_type)==2">
  234. <div class="meUserMessageText">
  235. <div class="messageTypeImage">
  236. <img :src="item.content" @click="imgZoom(item.content)">
  237. </div>
  238. </div>
  239. <div class="meUserIcon">
  240. <img :src="item.user_avatar" v-if="item.user_avatar!=null&&item.user_avatar!=''">
  241. <img src="@/assets/chat/user/admin.png" v-else>
  242. </div>
  243. </div>
  244. <!--文件类型 对方-->
  245. <div class="otherUserMessage" v-if="item.action=='recieved'&&item.msg_type==3">
  246. <div class="otherUserIcon">
  247. <img :src="item.receiver_avatar" v-if="item.receiver_avatar!=null&&item.receiver_avatar!=''">
  248. <img src="@/assets/chat/user/admin.png" v-else>
  249. </div>
  250. <div class="otherUserMessageText" @click="downloadFile(item)">
  251. <div class="messageTypeFile">
  252. <div class="messageTypeFileTop">
  253. <div class="messageTypeFileInfo">
  254. <div class="messageTypeFileTitle">
  255. {{ JSON.parse(item.content).oldFileName }}
  256. </div>
  257. <div class="messageTypeFileIcon">
  258. <img src="@/assets/chat/file.png"/>
  259. </div>
  260. </div>
  261. <!-- <div class="messageTypeFileSize">20kb</div> -->
  262. </div>
  263. <div class="messageTypeFileLogo">恒星管理平台保护您的电脑安全</div>
  264. </div>
  265. </div>
  266. </div>
  267. <!--文件类型 我-->
  268. <div class="meUserMessage" v-if="item.action=='said'&&Number(item.msg_type)==3">
  269. <div class="meUserMessageText" @click="downloadFile(item)">
  270. <div class="messageTypeFile">
  271. <div class="messageTypeFileTop">
  272. <div class="messageTypeFileInfo">
  273. <div class="messageTypeFileTitle">
  274. {{ JSON.parse(item.content).oldFileName }}
  275. </div>
  276. <div class="messageTypeFileIcon">
  277. <img src="@/assets/chat/file.png"/>
  278. </div>
  279. </div>
  280. <!-- <div class="messageTypeFileSize">20kb</div> -->
  281. </div>
  282. <div class="messageTypeFileLogo">恒星管理平台保护您的电脑安全</div>
  283. </div>
  284. </div>
  285. <div class="meUserIcon">
  286. <img :src="item.user_avatar" v-if="item.user_avatar!=null&&item.user_avatar!=''">
  287. <img src="@/assets/chat/user/admin.png" v-else>
  288. </div>
  289. </div>
  290. <!--名片 我-->
  291. <div class="meUserMessage" v-if="item.action=='said'&&Number(item.msg_type)==4">
  292. <div class="meUserMessageText" @click="addFriendShow(item.content.split(',')[2])">
  293. <div class="messageTypeCard">
  294. <div class="messageTypeCardTop">
  295. <div class="messageTypeCardIcon">
  296. <!-- <img :src="item.content.split(',')[0]"> -->
  297. <img src="@/assets/chat/user/user.png">
  298. </div>
  299. <div class="messageTypeCardName">{{item.content.split(',')[1]}}</div>
  300. </div>
  301. <div class="messageTypeCardText">
  302. 分享个人名片
  303. </div>
  304. </div>
  305. </div>
  306. <div class="meUserIcon">
  307. <img :src="item.user_avatar" v-if="item.user_avatar!=null&&item.user_avatar!=''">
  308. <img src="@/assets/chat/user/admin.png" v-else>
  309. </div>
  310. </div>
  311. <!--名片 对方-->
  312. <div class="otherUserMessage" v-if="item.action=='recieved'&&Number(item.msg_type)==4">
  313. <div class="otherUserIcon">
  314. <img :src="item.receiver_avatar" v-if="item.receiver_avatar!=null&&item.receiver_avatar!=''">
  315. <img src="@/assets/chat/user/admin.png" v-else>
  316. </div>
  317. <div class="otherUserMessageText" @click="addFriend(item.content.split(',')[2])">
  318. <div class="messageTypeCard">
  319. <div class="messageTypeCardTop">
  320. <div class="messageTypeCardIcon">
  321. <!-- <img :src="item.content.split(',')[0]"> -->
  322. <img src="@/assets/chat/user/user.png">
  323. </div>
  324. <div class="messageTypeCardName">{{item.content.split(',')[1]}}</div>
  325. </div>
  326. <div class="messageTypeCardText">
  327. 分享个人名片
  328. </div>
  329. </div>
  330. </div>
  331. </div>
  332. <!--邀请加群 我-->
  333. <div class="meUserMessage" v-if="item.action=='said'&&Number(item.msg_type)==6">
  334. <div class="meUserMessageText">
  335. <div class="messageGroupInvite" @click="openGroupInviteWindow(item)">
  336. <div class="messageGroupInviteTop">
  337. <div class="messageGroupInviteIcon">
  338. <img src="@/assets/chat/user/group.jpg">
  339. </div>
  340. <div class="messageGroupInfoText">
  341. <div class="messageGroupInfoTextTitle">邀请你加入群聊</div>
  342. <div class="messageGroupInfoTextTxt">{{item.content.split(',')[0]}}</div>
  343. </div>
  344. </div>
  345. <div class="messageGroupInviteText">
  346. 点击加入
  347. </div>
  348. </div>
  349. </div>
  350. <div class="meUserIcon">
  351. <img :src="item.user_avatar" v-if="item.user_avatar!=null&&item.user_avatar!=''">
  352. <img src="@/assets/chat/user/admin.png" v-else>
  353. </div>
  354. </div>
  355. <!--邀请加群 对方-->
  356. <div class="otherUserMessage" v-if="item.action=='recieved'&&Number(item.msg_type)==6">
  357. <div class="otherUserIcon">
  358. <img :src="item.receiver_avatar" v-if="item.receiver_avatar!=null&&item.receiver_avatar!=''">
  359. <img src="@/assets/chat/user/admin.png" v-else>
  360. </div>
  361. <div class="otherUserMessageText">
  362. <div class="messageGroupInvite" @click="openGroupInviteWindow(item)">
  363. <div class="messageGroupInviteTop">
  364. <div class="messageGroupInviteIcon">
  365. <img src="@/assets/chat/user/group.jpg">
  366. </div>
  367. <div class="messageGroupInfoText">
  368. <div class="messageGroupInfoTextTitle">邀请你加入群聊</div>
  369. <div class="messageGroupInfoTextTxt">{{item.content.split(',')[0]}}</div>
  370. </div>
  371. </div>
  372. <div class="messageGroupInviteText">
  373. 点击加入
  374. </div>
  375. </div>
  376. </div>
  377. </div>
  378. </div>
  379. </div>
  380. <div class="sendMessageBox">
  381. <div class="sendMessageTools">
  382. <!--上传文件 start-->
  383. <div class="toolsBigBox">
  384. <div class="toolsBox">
  385. <el-upload class="avatar-uploader" action="#" :show-file-list="false" :before-upload="beforeImgUpload">
  386. <img src="@/assets/chat/send_img.png">
  387. </el-upload>
  388. <el-upload class="avatar-uploader" action="#" :show-file-list="false" :before-upload="beforeFileUpload">
  389. <img src="@/assets/chat/send_file.png">
  390. </el-upload>
  391. <img src="@/assets/chat/send_message.png" @click="fileWindowStatus=true">
  392. </div>
  393. </div>
  394. <div class="fileBox" v-if="sendMessage.img.imgUrl!=''">
  395. <img :src="sendMessage.img.imgUrl">
  396. <div class="fileBoxText">{{ sendMessage.img.oldFileName }}</div>
  397. <div @click="deFileUpload"><i class="el-icon-close"></i></div>
  398. </div>
  399. <div class="fileBox" v-if="sendMessage.file.fileUrl!=''">
  400. <img src="@/assets/chat/file.png">
  401. <div class="fileBoxText">{{ sendMessage.file.oldFileName }}</div>
  402. <div @click="deFileUpload"><i class="el-icon-close"></i></div>
  403. </div>
  404. <!--上传文件 end-->
  405. </div>
  406. <div class="sendMessageInput">
  407. <el-input
  408. type="textarea"
  409. placeholder="请输入内容"
  410. v-model="userMessage"
  411. :rows="4"
  412. resize="none"
  413. maxlength="200"
  414. @keyup.enter.native="sendUserMessageToFriend"
  415. >
  416. </el-input>
  417. </div>
  418. <div class="sendMessageButton">
  419. <el-button v-if="sendMessage.img.imgUrl!=''||sendMessage.file.fileUrl!=''" type="primary" size="medium" @click="sendUserMessageToFile">发送文件 <i class="el-icon-position"></i></el-button>
  420. <el-button v-else type="primary" size="medium" @click="sendUserMessage">发送 <i class="el-icon-position"></i></el-button>
  421. </div>
  422. </div>
  423. <!--右侧菜单 start------------------------------------------------------------>
  424. <div class="rightSlideBox" v-if="rightSlideBoxShow">
  425. <!--关闭按钮-->
  426. <div class="rightSlideBoxClose">
  427. <div class="rightSlideBoxCloseTitle">群设置</div>
  428. <div @click="openGroupSystem" class="rightSlideBoxCloseIcon">
  429. <i class="el-icon-close"></i>
  430. </div>
  431. </div>
  432. <!--2216-->
  433. <div class="rightSlideSearch">
  434. <div class="searchBox">
  435. <el-input
  436. placeholder="请输入内容"
  437. prefix-icon="el-icon-search"
  438. v-model="searchUser"
  439. @keyup.enter.native="rightSearchUser"
  440. >
  441. </el-input>
  442. </div>
  443. <!--弹出框-->
  444. <div class="searchFriendBox" v-if="groupRightSearchWindow">
  445. <div class="searchFriendClose">
  446. <div @click="closeRightSearchUser" class="rightSlideBoxCloseIcon">
  447. <i class="el-icon-close"></i>
  448. </div>
  449. </div>
  450. <div class="searchFriendItem">
  451. <div class="searchFriendAvatar">
  452. <img :src="groupRightUserInfo.avatar" v-if="groupRightUserInfo.avatar!=null&&groupRightUserInfo.avatar!=''">
  453. <img src="@/assets/chat/user/admin.png" v-else>
  454. </div>
  455. <div class="searchFriendInfo">
  456. <div class="searchFriendName">
  457. <div class="searchFriendNameText">{{groupRightUserInfo.user_name}}</div>
  458. </div>
  459. <div class="searchFriendPhone">账号:{{groupRightUserInfo.user_name}}</div>
  460. </div>
  461. </div>
  462. <div class="searchFriendButton">
  463. <el-button type="primary" v-if="groupRightUserInfo.isFriend==true" @click="searchConversationIfCreate(groupRightUserInfo.user_id)">发送消息</el-button>
  464. <el-button type="primary" v-if="groupRightUserInfo.isFriend==false&&Number(groupRightUserInfo.user_id)!=Number(myUserId)" @click="addFriend(groupRightUserInfo.user_id)">添加好友</el-button>
  465. <el-button type="primary" v-if="groupRightUserInfo.isFriend==false&&Number(groupRightUserInfo.user_id)==Number(myUserId)" disabled>添加好友</el-button>
  466. </div>
  467. </div>
  468. </div>
  469. <div class="rightSlideUserBox">
  470. <div class="rightSlideUserItem rightEditUserItem" @click="editGroupMember">
  471. <div class="rightSlideUserItemIcon">
  472. <div class="addUserIcon">
  473. <i class="el-icon-user-solid"></i>
  474. </div>
  475. </div>
  476. <div class="rightSlideUserItemName">
  477. 编辑成员
  478. </div>
  479. </div>
  480. <div class="rightSlideUserItem" v-for="item in groupUserList" :key="item.user_id">
  481. <div class="rightSlideUserItemIcon">
  482. <span class="el-dropdown-link">
  483. <!-- {{ creatorId }} {{ item.user_id }} -->
  484. <div class="rightSlideUserGroupLeader" v-if="creatorId == item.user_id">群主</div>
  485. <div>
  486. <img :src="item.avatar" v-if="item.avatar!=null&&item.avatar!=''">
  487. <img src="@/assets/chat/user/admin.png" v-else>
  488. </div>
  489. </span>
  490. </div>
  491. <div class="rightSlideUserItemName">
  492. <span v-if="item.user_name!=null">{{item.user_name}}</span>
  493. <span v-else>未知用户</span>
  494. </div>
  495. </div>
  496. </div>
  497. <div class="rightLineBorder"></div>
  498. <!--聊天记录 start------------------------------------------------------------>
  499. <div class="rightSlideFunction">
  500. <div class="rightSlideFunctionItem" @click="fileWindowStatus=true">
  501. <div class="rightSlideFunctionItemText">聊天记录</div>
  502. <div class="rightSlideFunctionItemIcon">
  503. <img src="@/assets/chat/arrow_right.png" alt="">
  504. </div>
  505. </div>
  506. </div>
  507. <!--聊天记录 end------------------------------------------------------------>
  508. <!--群聊设置 start------------------------------------------------------------>
  509. <div class="rightSlideFunction">
  510. <div class="groupSystem">
  511. <div class="groupChatSystem">
  512. <div class="groupChatTitle">群聊名称</div>
  513. <div class="groupChatText">
  514. <div class="groupChatTextContent">{{this.messageTitle}}</div>
  515. <img src="@/assets/chat/editGroup.png" @click="editGroupNameWindow=true">
  516. </div>
  517. </div>
  518. <div class="groupChatSystem">
  519. <div class="groupChatTitle">群公告</div>
  520. <div class="groupChatText" v-if="this.groupProfile!=''">
  521. <div class="groupChatTextContent">{{this.groupProfile}}</div>
  522. <img src="@/assets/chat/editGroup.png" @click="editGroupNoticeWindow=true" v-if="Number(this.myUserId)==Number(this.creatorId)">
  523. </div>
  524. <div class="groupChatText" v-else>
  525. 暂无群公告
  526. <img src="@/assets/chat/editGroup.png" @click="editGroupNoticeWindow=true" v-if="Number(this.myUserId)==Number(this.creatorId)">
  527. </div>
  528. </div>
  529. </div>
  530. </div>
  531. <!--群聊设置 end------------------------------------------------------------>
  532. <div class="rightSlideFooterBox">
  533. <div @click="openShareMyGroup">分享群</div>
  534. <div @click="delGroup" v-if="creatorId==myUserId">解散群</div>
  535. <div @click="closeGroup" v-else>退出群</div>
  536. <div @click="openGroupSystem">关闭</div>
  537. </div>
  538. </div>
  539. </div>
  540. <!--右侧菜单 end------------------------------------------>
  541. </div>
  542. </el-dialog>
  543. <el-dialog
  544. :visible.sync="showfrindDialog"
  545. width="40%"
  546. class="chat-friend-dialog"
  547. top="15vh"
  548. :modal="false"
  549. >
  550. <div class="hallBox">
  551. <div class="hallRight" v-if="pagestatus==1||pagestatus==4">
  552. <div class="ifHallRigthNoMessage">恒星管理平台</div>
  553. </div>
  554. <div class="hallRight newFriendBox" v-if="pagestatus==2">
  555. <div class="UserNameBox">
  556. <div class="userName">新的朋友</div>
  557. </div>
  558. <div class="rightNewFriendBox" v-for="(item,index) in userApplyList" :key="index">
  559. <div class="rightNewFriendItem">
  560. <div class="rightNewFriendAvatar">
  561. <img :src="item.avatar" v-if="item.avatar!=''">
  562. <img src="@/assets/chat/user/admin.png" v-else>
  563. </div>
  564. <div class="rightNewFriendInfo">
  565. <div class="rightNewFriendName">{{item.remark}}</div>
  566. <div class="rightNewFriendPhone">{{item.user_name}}</div>
  567. </div>
  568. </div>
  569. <div class="rightNewFriendStatus">
  570. <div class="rightNewFriendStatus2">
  571. <el-button type="primary" @click="openWindow(item)">接受</el-button>
  572. </div>
  573. </div>
  574. </div>
  575. <div class="nodata" v-if="userApplyList.length==0">暂无数据</div>
  576. </div>
  577. <div class="hallRight" v-if="pagestatus==3">
  578. <div class="userInfoMainBox">
  579. <div class="userInfoMainItem">
  580. <div class="userInfoMainAvatar">
  581. <img :src="friendInfo.avatar" v-if="friendInfo.avatar!=''">
  582. <img src="@/assets/chat/user/admin.png" v-else>
  583. </div>
  584. <div class="userInfoMainInfo">
  585. <div class="userInfoMainName">
  586. <div class="userInfoMainNameText" v-if="friendInfo.nickname!=null&&friendInfo.nickname!=''">{{friendInfo.nickname}}</div>
  587. <div class="userInfoMainNameText" v-else>{{friendInfo.user_name}}</div>
  588. </div>
  589. <div class="userInfoMainPhone">账号:{{friendInfo.user_name}}</div>
  590. </div>
  591. </div>
  592. <div class="userInfoMainLineBox">
  593. <div class="userInfoMainLineTitle">备注</div>
  594. <div class="userInfoMainLineContent">
  595. <div class="userInfoMainLineContentItem" @click="openEditWindow">
  596. <div v-if="friendInfo.remark!=null&&friendInfo.remark!=''">{{friendInfo.remark}}</div>
  597. <div v-else>暂无备注</div>
  598. <div><i class="el-icon-edit"></i></div>
  599. </div>
  600. </div>
  601. </div>
  602. <div class="userInfoMainButton">
  603. <el-button type="primary" icon="el-icon-s-promotion" @click="sendMessageToFriend(friendInfo)">发送消息</el-button>
  604. <el-button type="danger" icon="el-icon-delete" @click="deleteFriend(friendInfo.friend_id)">删除好友</el-button>
  605. </div>
  606. </div>
  607. </div>
  608. </div>
  609. </el-dialog>
  610. <el-dialog :visible.sync="groupWindowStatus" :close-on-click-modal="false" width="1028px">
  611. <div class="searchWindow">
  612. <div class="searchWindowLeft">
  613. <div class="searchUserWindowBox">
  614. <el-input
  615. placeholder="请输入内容"
  616. prefix-icon="el-icon-search"
  617. v-model="searchFriendGroup"
  618. @keyup.enter.native="searchFriendGroupUser"
  619. >
  620. </el-input>
  621. <!--搜索用户弹出框 start------------------------------------------------------------>
  622. <div class="searchFriendBox" v-if="groupFriendsWindowStatus">
  623. <div class="searchFriendClose">
  624. <div @click="closeSearchFriendWindow" class="rightSlideBoxCloseIcon">
  625. <i class="el-icon-close"></i>
  626. </div>
  627. </div>
  628. <div class="searchFriendItem">
  629. <div class="searchFriendAvatar">
  630. <img :src="groupFriendSearchUser.avatar" v-if="groupFriendSearchUser.avatar!=null&&groupFriendSearchUser.avatar!=''">
  631. <img src="@/assets/chat/user/admin.png" v-else>
  632. </div>
  633. <div class="searchFriendInfo">
  634. <div class="searchFriendName">
  635. <div class="searchFriendNameText">{{groupFriendSearchUser.user_name}}</div>
  636. </div>
  637. <div class="searchFriendPhone">账号:{{groupFriendSearchUser.user_name}}</div>
  638. </div>
  639. </div>
  640. <div class="searchFriendButton">
  641. <el-button v-if="groupFriendSearchUser.status==false" type="primary" @click="addSearchFriendWindow">添加</el-button>
  642. <el-button v-else type="warning" @click="addSearchFriendWindow">移除</el-button>
  643. </div>
  644. </div>
  645. <!--搜索用户弹出框 end------------------------------------------------------------>
  646. </div>
  647. <!--搜索用户 start------------------------------------------------------------>
  648. <div class="searchUserBox">
  649. <!-- <div class="searchNameEnglish">A</div> -->
  650. <div class="searchUserItem" v-for="item in friendsList" :key="item.id">
  651. <el-checkbox v-model="item.status"
  652. @change="changeSelectFriends(item)"
  653. :disabled="Number(item.friend_id) == Number(creatorId) || groupUserList.includes(item.friend_id)"></el-checkbox>
  654. <img :src="item.avatar" v-if="item.avatar!=null&&item.avatar!=''">
  655. <img src="@/assets/chat/user/admin.png" v-else>
  656. <div class="searchUserName" v-if="item.remark!=null&&item.remark!=''">{{item.remark}}</div>
  657. <div class="searchUserName" v-else>{{item.user_name}}</div>
  658. </div>
  659. </div>
  660. <!--搜索用户 end------------------------------------------------------------>
  661. </div>
  662. <div class="searchWindowRight">
  663. <div class="searchWindowRightTop">
  664. <div class="searchWindowRightTitle">创建群聊</div>
  665. <div class="searchWindowRightNum">已选择{{friendsList.filter(item=>item.status).length}}个联系人</div>
  666. </div>
  667. <div class="searchWindowUserList">
  668. <div class="searchWindowUserItem" v-for="item in friendsList" :key="item.id" v-if="item.status==true">
  669. <div class="searchWindowUserIcon">
  670. <img :src="item.avatar" v-if="item.avatar!=null&&item.avatar!=''">
  671. <img src="@/assets/chat/user/admin.png" v-else>
  672. <div class="searchWindowDeleteUser" @click="cancelSelectFriends(item.id)">
  673. <i class="el-icon-close"></i>
  674. </div>
  675. </div>
  676. <div class="searchWindowUserName" v-if="item.remark!=null&&item.remark!=''">{{item.remark}}</div>
  677. <div class="searchWindowUserName" v-else>{{item.user_name}}</div>
  678. </div>
  679. </div>
  680. <!--分享名片 start------------------------------------------------------------>
  681. <!-- <div class="shareCardBox">
  682. <div class="shareCardTitle">[名片]用户名称</div>
  683. <div class="shareCardInput">
  684. <el-input v-model="userCardMessage" placeholder="给用户留言"></el-input>
  685. </div>
  686. </div> -->
  687. <!--分享名片 end------------------------------------------------------------>
  688. <div class="searchWindowFooter">
  689. <el-button type="info" @click="clearCreatGroupWindow">取消</el-button>
  690. <el-button type="primary" @click="createForGroup" :disabled="friendsList.filter(item=>item.status).length<2">完成</el-button>
  691. </div>
  692. </div>
  693. </div>
  694. </el-dialog>
  695. <!--分享群聊 start------------------------------------------------------------>
  696. <el-dialog :visible.sync="shareGroupWindowStatus" title="分享群聊" :close-on-click-modal="false" width="420px">
  697. <div>
  698. <div class="shareCardWindowBox">
  699. <el-tabs v-model="shareGroupActive" type="card" @tab-click="handleClickShareGroupCard">
  700. <el-tab-pane label="分享给朋友" name="friend">
  701. <div class="shareCardWindowBoxMain">
  702. <div v-for="item in friendsList" :key="item.id" class="shareCardRadioBox" >
  703. <el-radio :label="item.friend_id" v-model="shareGroupId">
  704. <input type="hidden" :value="item.friend_id">
  705. </el-radio>
  706. <div class="shareCardItem">
  707. <img :src="item.avatar" v-if="item.avatar!=null&&item.avatar!=''">
  708. <img src="@/assets/chat/user/admin.png" v-else>
  709. <div class="shareCardName" v-if="item.remark!=null&&item.remark!=''">{{item.remark}}</div>
  710. <div class="shareCardName" v-else>{{item.user_name}}</div>
  711. </div>
  712. </div>
  713. </div>
  714. </el-tab-pane>
  715. <el-tab-pane label="分享到群聊" name="group">
  716. <div class="shareCardWindowBoxMain">
  717. <div v-for="item in groupConversationList" :key="item.receiver_id" class="shareCardRadioBox" >
  718. <el-radio :label="item.receiver_id" v-model="shareGroupId">
  719. <input type="hidden" :value="item.receiver_id">
  720. </el-radio>
  721. <div class="shareCardItem">
  722. <img :src="item.avatar" v-if="item.avatar!=null&&item.avatar!=''">
  723. <img src="@/assets/chat/user/group.jpg" v-else>
  724. <div class="shareCardName" v-if="item.remark!=null&&item.remark!=''">{{item.remark}}</div>
  725. <div class="shareCardName" v-else>{{item.name}}</div>
  726. </div>
  727. </div>
  728. </div>
  729. </el-tab-pane>
  730. </el-tabs>
  731. </div>
  732. <div class="footerButtonBox">
  733. <el-button type="info" @click="shareGroupWindowStatus=false">取消</el-button>
  734. <el-button type="primary" @click="shareMyGroup">确定</el-button>
  735. </div>
  736. </div>
  737. </el-dialog>
  738. <!--分享群聊 end------------------------------------------------------------>
  739. <!--放大图片 start------------------------------------------------------------>
  740. <el-dialog :visible.sync="imgZoomStatus" title="图片详情" :close-on-click-modal="false" max-width="600px">
  741. <div>
  742. <div class="imgZoomBox">
  743. <img :src="imgZoomUrl">
  744. </div>
  745. <div class="footerButtonBox">
  746. <el-button type="info" @click="imgZoomStatus=false">关闭</el-button>
  747. </div>
  748. </div>
  749. </el-dialog>
  750. <!--聊天记录弹出框 start------------------------------------------------------------>
  751. <el-dialog :visible.sync="fileWindowStatus" title="聊天记录" :close-on-click-modal="false" width="757px">
  752. <div class="fileWindow">
  753. <div class="fileWindowHeader">
  754. <el-input
  755. placeholder="请输入内容"
  756. prefix-icon="el-icon-search"
  757. v-model="searchChatRecords"
  758. @keyup.enter.native="searchChatRecordsUser"
  759. :disabled="activeName !== 'all'"
  760. >
  761. </el-input>
  762. </div>
  763. <!--聊天记录选项卡 start------------------------------------------------------------>
  764. <el-tabs v-model="activeName">
  765. <el-tab-pane label="全部" name="all">
  766. <!-- <div class="fileWindowMessageTime">2024-11-10</div> -->
  767. <div class="fileWindowMessageScrollBox" ref="fileWindowMessageScrollBox">
  768. <div class="fileWindowMessageItemBox" v-for="item in chatrecords">
  769. <!--文字消息 start-->
  770. <div v-if="Number(item.msg_type)==1" class="historicalMessageBox">
  771. <div class="fileWindowMessageItemIcon">
  772. <img :src="item.receiver_avatar" v-if="item.receiver_avatar!=null&&item.receiver_avatar!=''">
  773. <img src="@/assets/chat/user/admin.png" v-else>
  774. </div>
  775. <div class="fileWindowMessageItem">
  776. <div class="fileWindowMessageItemInfo">
  777. <div class="fileWindowMessageItemName">{{item.receiver_id_name}}</div>
  778. <div class="fileWindowMessageItemTime">{{item.created_at}}</div>
  779. </div>
  780. <div class="fileWindowMessageItemText">{{item.content}}</div>
  781. </div>
  782. </div>
  783. <!--文字消息 end-->
  784. <!--图片消息 start-->
  785. <div v-if="Number(item.msg_type)==2" class="historicalMessageBox">
  786. <div class="fileWindowMessageItemIcon">
  787. <img :src="item.receiver_avatar" v-if="item.receiver_avatar!=null&&item.receiver_avatar!=''">
  788. <img src="@/assets/chat/user/admin.png" v-else>
  789. </div>
  790. <div class="fileWindowMessageItem">
  791. <div class="fileWindowMessageItemInfo">
  792. <div class="fileWindowMessageItemName">{{item.receiver_id_name}}</div>
  793. <div class="fileWindowMessageItemTime">{{item.created_at}}</div>
  794. </div>
  795. <div class="fileWindowMessageItemText">
  796. <img :src="item.content" class="fileWindowMessageItemImage">
  797. </div>
  798. </div>
  799. </div>
  800. <!--图片消息 end-->
  801. <!--文件消息 start-->
  802. <div v-if="Number(item.msg_type)==3" class="historicalMessageBox">
  803. <div class="fileWindowMessageItemIcon">
  804. <img :src="item.receiver_avatar" v-if="item.receiver_avatar!=null&&item.receiver_avatar!=''">
  805. <img src="@/assets/chat/user/admin.png" v-else>
  806. </div>
  807. <div class="fileWindowMessageItem">
  808. <div class="fileWindowMessageItemInfo">
  809. <div class="fileWindowMessageItemName">{{item.receiver_id_name}}</div>
  810. <div class="fileWindowMessageItemTime">{{item.created_at}}</div>
  811. </div>
  812. <div class="fileWindowMessageItemText">
  813. <div class="messageTypeFile">
  814. <div class="messageTypeFileTop">
  815. <div class="messageTypeFileInfo">
  816. <div class="messageTypeFileTitle">
  817. {{ JSON.parse(item.content).oldFileName }}
  818. </div>
  819. <div class="messageTypeFileIcon">
  820. <img src="@/assets/chat/file.png"/>
  821. </div>
  822. </div>
  823. <!-- <div class="messageTypeFileSize">20kb</div> -->
  824. </div>
  825. <div class="messageTypeFileLogo">恒星管理平台保护您的电脑安全</div>
  826. </div>
  827. </div>
  828. </div>
  829. </div>
  830. <!--文件消息 end-->
  831. </div>
  832. </div>
  833. </el-tab-pane>
  834. <el-tab-pane label="文件" name="file">
  835. <div class="fileWindowMessageItemBox" v-for="item in chatrecords">
  836. <!--文件消息 start-->
  837. <div v-if="Number(item.msg_type)==3" class="historicalMessageBox">
  838. <div class="fileWindowMessageItemIcon">
  839. <img :src="item.receiver_avatar" v-if="item.receiver_avatar!=null&&item.receiver_avatar!=''">
  840. <img src="@/assets/chat/user/admin.png" v-else>
  841. </div>
  842. <div class="fileWindowMessageItem">
  843. <div class="fileWindowMessageItemInfo">
  844. <div class="fileWindowMessageItemName">{{item.receiver_id_name}}</div>
  845. <div class="fileWindowMessageItemTime">{{item.created_at}}</div>
  846. </div>
  847. <div class="fileWindowMessageItemText">
  848. <div class="messageTypeFile">
  849. <div class="messageTypeFileTop">
  850. <div class="messageTypeFileInfo">
  851. <div class="messageTypeFileTitle">
  852. {{ JSON.parse(item.content).oldFileName }}
  853. </div>
  854. <div class="messageTypeFileIcon">
  855. <img src="@/assets/chat/file.png"/>
  856. </div>
  857. </div>
  858. <!-- <div class="messageTypeFileSize">20kb</div> -->
  859. </div>
  860. <div class="messageTypeFileLogo">恒星管理平台保护您的电脑安全</div>
  861. </div>
  862. </div>
  863. </div>
  864. </div>
  865. <!--文件消息 end-->
  866. </div>
  867. <!--图片消息 end-->
  868. <div v-if="!chatrecords.some(item => Number(item.msg_type) === 3)" class="fileWindowNoMessage">暂无文件</div>
  869. </el-tab-pane>
  870. <el-tab-pane label="图片" name="img">
  871. <div class="fileWindowMessageItemBox" v-for="item in chatrecords">
  872. <!--图片消息 start-->
  873. <div v-if="Number(item.msg_type)==2" class="historicalMessageBox">
  874. <div class="fileWindowMessageItemIcon">
  875. <img :src="item.receiver_avatar" v-if="item.receiver_avatar!=null&&item.receiver_avatar!=''">
  876. <img src="@/assets/chat/user/admin.png" v-else>
  877. </div>
  878. <div class="fileWindowMessageItem">
  879. <div class="fileWindowMessageItemInfo">
  880. <div class="fileWindowMessageItemName">{{item.receiver_id_name}}</div>
  881. <div class="fileWindowMessageItemTime">{{item.created_at}}</div>
  882. </div>
  883. <div class="fileWindowMessageItemText">
  884. <img :src="item.content" class="fileWindowMessageItemImage">
  885. </div>
  886. </div>
  887. </div>
  888. </div>
  889. <!--图片消息 end-->
  890. <div v-if="!chatrecords.some(item => Number(item.msg_type) === 2)" class="fileWindowNoMessage">暂无图片</div>
  891. </el-tab-pane>
  892. <!-- <el-tab-pane label="日期" name="date">
  893. <div class="fileWindowDateBox">
  894. <el-date-picker
  895. v-model="time"
  896. type="date"
  897. placeholder="选择日期">
  898. </el-date-picker>
  899. <el-button type="primary" class="fileWindowDateButton">搜索</el-button>
  900. </div>
  901. </el-tab-pane>
  902. <el-tab-pane label="群成员" name="groupUser">
  903. <div class="fileWindowGroupMain">
  904. <div class="fileWindowGroupUserLeft">
  905. <div class="fileWindowMessageTime">2024-11-10</div>
  906. <div class="fileWindowMessageItemBox">
  907. <div class="fileWindowMessageItemIcon">
  908. <img src="@/assets/chat/user/user.png" alt="">
  909. </div>
  910. <div class="fileWindowMessageItem">
  911. <div class="fileWindowMessageItemInfo">
  912. <div class="fileWindowMessageItemName">用户名称</div>
  913. <div class="fileWindowMessageItemTime">12:40</div>
  914. </div>
  915. <div class="fileWindowMessageItemText">用用户消息用户消息用户消息用户消息用户消息用户消息用户消息用户消息用户消息用户消息用户消息用户消息用户消息用户消息用户消息</div>
  916. </div>
  917. </div>
  918. </div>
  919. <div class="fileWindowGroupUserRight">
  920. <div class="fileWindowGroupUserBox">
  921. <el-input placeholder="请输入内容" prefix-icon="el-icon-search"></el-input>
  922. <div class="searchUserBox">
  923. <div class="searchNameEnglish">A</div>
  924. <div class="searchUserItem">
  925. <img src="@/assets/chat/user/user.png">
  926. <div class="searchUserName">A农贸站群长</div>
  927. </div>
  928. <div class="searchNameEnglish">B</div>
  929. <div class="searchUserItem">
  930. <img src="@/assets/chat/user/user.png">
  931. <div class="searchUserName">B农贸站群长</div>
  932. </div>
  933. </div>
  934. </div>
  935. </div>
  936. </div>
  937. </el-tab-pane> -->
  938. </el-tabs>
  939. <!--聊天记录选项卡 end------------------------------------------------------------>
  940. </div>
  941. </el-dialog>
  942. <!--聊天记录弹出框 end------------------------------------------------------------>
  943. <!--编辑群成员弹出框 start------------------------------------------------------------>
  944. <!--编辑时 左侧显示的是好友列表 右侧显示的是群成员-->
  945. <el-dialog :visible.sync="groupEditWindowStatus" :close-on-click-modal="false" width="1028px" @closed="cancelEditGroupMember">
  946. <div class="searchWindow">
  947. <div class="searchWindowLeft">
  948. <div class="searchUserWindowBox">
  949. <el-input
  950. placeholder="请输入内容"
  951. prefix-icon="el-icon-search"
  952. v-model="searchGroup"
  953. @keyup.enter.native="searchGroupUser">
  954. </el-input>
  955. <!--搜索用户弹出框 start------------------------------------------------------------>
  956. <div class="searchFriendBox" v-if="groupEditMainWindowStatus">
  957. <div class="searchFriendClose">
  958. <div @click="closeAddGroupUserWindow" class="rightSlideBoxCloseIcon">
  959. <i class="el-icon-close"></i>
  960. </div>
  961. </div>
  962. <div class="searchFriendItem">
  963. <div class="searchFriendAvatar">
  964. <img :src="groupSearchUser.avatar" v-if="groupSearchUser.avatar!=null&&groupSearchUser.avatar!=''">
  965. <img src="@/assets/chat/user/admin.png" v-else>
  966. </div>
  967. <div class="searchFriendInfo">
  968. <div class="searchFriendName">
  969. <div class="searchFriendNameText">{{groupSearchUser.nickname}}</div>
  970. </div>
  971. <div class="searchFriendPhone">账号:{{groupSearchUser.nickname}}</div>
  972. </div>
  973. </div>
  974. <div class="searchFriendButton">
  975. <el-button v-if="groupSearchUser.status==false" type="primary" @click="addGroupUser(groupSearchUser)">添加</el-button>
  976. <el-button v-else-if="Number(creatorId)==Number(myUserId)" type="warning" @click="addGroupUser(groupSearchUser)" >移除</el-button>
  977. <el-button v-else type="warning" @click="addGroupUser(groupSearchUser)" disabled>移除</el-button>
  978. </div>
  979. </div>
  980. <!--搜索用户弹出框 end------------------------------------------------------------>
  981. </div>
  982. <!--通讯录列表 start------------------------------------------------------------>
  983. <div class="searchUserBox">
  984. <!-- <div class="searchNameEnglish">A</div> -->
  985. <!--群主-->
  986. <div class="searchUserItem" v-for="(item,index) in friendsList" :key="index" v-if="Number(creatorId)==Number(myUserId)">
  987. <!-- {{ item.friend_id }}
  988. {{ creatorId }} -->
  989. <!-- <el-checkbox v-model="item.status" @change="changeSelectFriends(item)" :disabled="Number(item.friend_id)==Number(creatorId)"></el-checkbox> -->
  990. <el-checkbox v-model="item.status" @change="changeSelectFriends(item)" :disabled="Number(item.friend_id) == Number(creatorId)"></el-checkbox>
  991. <img :src="item.avatar" v-if="item.avatar!=null&&item.avatar!=''">
  992. <img src="@/assets/chat/user/admin.png" v-else>
  993. <div class="searchUserName" v-if="item.remark!=null&&item.remark!=''">{{item.remark}}</div>
  994. <div class="searchUserName" v-else>
  995. {{item.user_name}}
  996. </div>
  997. </div>
  998. <!--非群主-->
  999. <div class="searchUserItem" v-for="(item,index) in friendsList" :key="index" v-if="Number(creatorId)!=Number(myUserId)">
  1000. <el-checkbox v-model="item.status" @change="changeSelectFriends(item)" :disabled="Number(item.friend_id) == Number(creatorId) || isGroupUser(item.friend_id)"></el-checkbox>
  1001. <img :src="item.avatar" v-if="item.avatar!=null&&item.avatar!=''">
  1002. <img src="@/assets/chat/user/admin.png" v-else>
  1003. <div class="searchUserName" v-if="item.remark!=null&&item.remark!=''">{{item.remark}}</div>
  1004. <div class="searchUserName" v-else>
  1005. {{item.user_name}}
  1006. </div>
  1007. </div>
  1008. </div>
  1009. <!--通讯录列表 end------------------------------------------------------------>
  1010. </div>
  1011. <div class="searchWindowRight">
  1012. <div class="searchWindowRightTop">
  1013. <div class="searchWindowRightTitle">编辑群聊</div>
  1014. <div class="searchWindowRightNum">已选择{{groupUserList.length}}个联系人</div>
  1015. </div>
  1016. <div class="searchWindowUserList">
  1017. <div class="searchWindowUserItem" v-for="(item,index) in groupUserList" :key="index" v-if="item.status==true">
  1018. <div class="searchWindowUserIcon">
  1019. <img :src="item.avatar" v-if="item.avatar!=null&&item.avatar!=''">
  1020. <img src="@/assets/chat/user/admin.png" v-else>
  1021. <div class="rightSlideUserGroupLeader" v-if="creatorId == item.user_id">群主</div>
  1022. <div class="searchWindowDeleteUser" @click="editRemoveGroupUser(item.user_id)" v-if="Number(creatorId)==Number(myUserId)&&item.user_id!=myUserId">
  1023. <i class="el-icon-close"></i>
  1024. </div>
  1025. </div>
  1026. <div class="searchWindowUserName" v-if="item.remark!=null&&item.remark!=''">{{item.remark}}</div>
  1027. <div class="searchWindowUserName" v-else-if="item.user_name!=null&&item.user_name!=''">{{item.user_name}}</div>
  1028. <div class="searchWindowUserName" v-else>未知用户</div>
  1029. </div>
  1030. </div>
  1031. <div class="searchWindowFooter">
  1032. <el-button type="info" @click="cancelEditGroupMember">取消</el-button>
  1033. <el-button type="primary" @click="saveEditGroupMember" :disabled="groupUserList.filter(item=>item.status).length<=2">完成</el-button>
  1034. </div>
  1035. </div>
  1036. </div>
  1037. </el-dialog>
  1038. <!--编辑群成员弹出框 end------------------------------------------------------------>
  1039. <!--群名称弹出框 start------------------------------------------------------------>
  1040. <el-dialog :visible.sync="editGroupNameWindow" title="编辑群名称" :close-on-click-modal="false" width="420px">
  1041. <div>
  1042. <div>
  1043. <el-input type="textarea" resize="none" v-model="editMessageTitle" placeholder="请输入" maxlength="20"></el-input>
  1044. </div>
  1045. <div class="footerButtonBox">
  1046. <el-button type="info" @click="editGroupNameWindow=false">取消</el-button>
  1047. <el-button type="primary" @click="editGroupName">确定</el-button>
  1048. </div>
  1049. </div>
  1050. </el-dialog>
  1051. <!--群名称弹出框 end------------------------------------------------------------>
  1052. <!--群公告弹出框 start------------------------------------------------------------>
  1053. <el-dialog :visible.sync="editGroupNoticeWindow" title="编辑群公告" :close-on-click-modal="false" width="420px">
  1054. <div>
  1055. <div>
  1056. <el-input type="textarea" resize="none" v-model="editGroupProfile" placeholder="请输入" rows="10" maxlength="500"></el-input>
  1057. </div>
  1058. <div class="footerButtonBox">
  1059. <el-button type="info" @click="editGroupNoticeWindow=false">取消</el-button>
  1060. <el-button type="primary" @click="editGroupNotice">确定</el-button>
  1061. </div>
  1062. </div>
  1063. </el-dialog>
  1064. <!--群公告弹出框 end------------------------------------------------------------>
  1065. <!--查看群公告 start------------------------------------------------------------>
  1066. <el-dialog :visible.sync="groupProfileWindow" title="群公告详情" :close-on-click-modal="false" width="420px">
  1067. <div>
  1068. <div class="groupProfileBox">
  1069. {{groupProfile}}
  1070. </div>
  1071. <div class="footerButtonBox">
  1072. <el-button type="info" @click="groupProfileWindow=false">关闭</el-button>
  1073. </div>
  1074. </div>
  1075. </el-dialog>
  1076. <!--查看群公告 end------------------------------------------------------------>
  1077. <!--分享名片 start------------------------------------------------------------>
  1078. <el-dialog :visible.sync="userCardWindowStatus" title="分享名片" :close-on-click-modal="false" width="420px">
  1079. <div>
  1080. <div class="shareCardWindowBox">
  1081. <el-tabs v-model="shareTableActive" type="card" @tab-click="handleClickShareCard">
  1082. <el-tab-pane label="分享给朋友" name="friend">
  1083. <div class="shareCardWindowBoxMain">
  1084. <div v-for="item in friendsList" :key="item.id" class="shareCardRadioBox" >
  1085. <el-radio :label="item.friend_id" v-model="useShareUserId">
  1086. <input type="hidden" :value="item.friend_id">
  1087. </el-radio>
  1088. <div class="shareCardItem">
  1089. <img :src="item.avatar" v-if="item.avatar!=null&&item.avatar!=''">
  1090. <img src="@/assets/chat/user/admin.png" v-else>
  1091. <div class="shareCardName" v-if="item.remark!=null&&item.remark!=''">{{item.remark}}</div>
  1092. <div class="shareCardName" v-else>{{item.user_name}}</div>
  1093. </div>
  1094. </div>
  1095. </div>
  1096. </el-tab-pane>
  1097. <el-tab-pane label="分享到群聊" name="group">
  1098. <div class="shareCardWindowBoxMain">
  1099. <div v-for="item in groupConversationList" :key="item.receiver_id" class="shareCardRadioBox" >
  1100. <el-radio :label="item.receiver_id" v-model="shareGroupId">
  1101. <input type="hidden" :value="item.receiver_id">
  1102. </el-radio>
  1103. <div class="shareCardItem">
  1104. <img :src="item.avatar" v-if="item.avatar!=null&&item.avatar!=''">
  1105. <img src="@/assets/chat/user/group.jpg" v-else>
  1106. <div class="shareCardName" v-if="item.remark!=null&&item.remark!=''">{{item.remark}}</div>
  1107. <div class="shareCardName" v-else>{{item.name}}</div>
  1108. </div>
  1109. </div>
  1110. </div>
  1111. </el-tab-pane>
  1112. </el-tabs>
  1113. </div>
  1114. <div class="footerButtonBox">
  1115. <el-button type="info" @click="userCardWindowStatus=false">取消</el-button>
  1116. <el-button type="primary" @click="shareCard">确定</el-button>
  1117. </div>
  1118. </div>
  1119. </el-dialog>
  1120. <!--分享名片 end------------------------------------------------------------>
  1121. <!--发送好友申请弹出框 start------------------------------------------------------------>
  1122. <el-dialog :visible.sync="addFriendWindowStatus" title="朋友申请" :close-on-click-modal="false" width="420px">
  1123. <div>
  1124. <div>
  1125. <el-form :model="form" ref="form" autocomplete="off" label-position="left">
  1126. <div class="formDiv">
  1127. <el-form-item label="验证消息:" :label-width="formLabelWidth" class="custom-align-right">
  1128. <el-input v-model="addform.remark" autocomplete="off" placeholder="请输入"></el-input>
  1129. </el-form-item>
  1130. </div>
  1131. </el-form>
  1132. </div>
  1133. <div class="footerButtonBox">
  1134. <el-button type="info" @click="addFriendWindowStatus=false">取消</el-button>
  1135. <el-button type="primary" @click="addMyFriend">确定</el-button>
  1136. </div>
  1137. </div>
  1138. </el-dialog>
  1139. <!--发送好友申请弹出框 end------------------------------------------------------------>
  1140. <!--加入群聊弹出框 start------------------------------------------------------------>
  1141. <el-dialog :visible.sync="addGroupWindow" title="加入群聊" :close-on-click-modal="false" width="420px">
  1142. <div class="addGroupWindow">
  1143. <div class="addGroupWindowImg">
  1144. <img src="@/assets/chat/user/group.jpg" alt="">
  1145. </div>
  1146. <div class="addGroupWindowTitle">{{groupInviteInfo.group_name}}</div>
  1147. <div class="addGroupWindowText">加入"{{groupInviteInfo.group_name}}"群聊,点击可查看该群消息</div>
  1148. <div class="footerButtonBox">
  1149. <el-button type="info" @click="addGroupWindow = false">取消</el-button>
  1150. <el-button type="primary" @click="joinGroup">确定</el-button>
  1151. </div>
  1152. </div>
  1153. </el-dialog>
  1154. <!--加入群聊弹出框 end------------------------------------------------------------>
  1155. <el-dialog
  1156. :visible.sync="searchConversationStatus"
  1157. title=" "
  1158. :close-on-click-modal="false"
  1159. width="420px"
  1160. >
  1161. <div class="searchFriendBox" >
  1162. <div class="searchFriendItem">
  1163. <div class="searchFriendAvatar" v-if="selectConversationItem.group_name==null">
  1164. <img :src="selectConversationItem.avatar" v-if="selectConversationItem.avatar!=null&&selectConversationItem.avatar!=''">
  1165. <img src="@/assets/chat/user/admin.png" v-else>
  1166. </div>
  1167. <div class="searchFriendAvatar" v-else>
  1168. <img src="@/assets/chat/user/group.jpg">
  1169. </div>
  1170. <div class="searchFriendInfo">
  1171. <div class="searchFriendName">
  1172. <div class="searchFriendNameText" v-if="selectConversationItem.group_name==null">{{selectConversationItem.user_name}}</div>
  1173. <div class="searchFriendNameText" v-else>{{selectConversationItem.group_name}}</div>
  1174. </div>
  1175. <div class="searchFriendPhone" v-if="selectConversationItem.group_name==null">账号:{{selectConversationItem.user_name}}</div>
  1176. <div class="searchFriendPhone" v-else>多人群组</div>
  1177. </div>
  1178. </div>
  1179. <div class="searchFriendButton">
  1180. <el-button type="primary" @click="selectConversation(selectConversationItem)">发送消息</el-button>
  1181. </div>
  1182. </div>
  1183. </el-dialog>
  1184. <!--请求验证弹出框 start------------------------------------------------------------>
  1185. <el-dialog :visible.sync="friendWindowStatus" title="通过朋友验证" :close-on-click-modal="false" width="420px">
  1186. <div>
  1187. <div class="friendWindowText">
  1188. <!--此处修改备注是没用的,修改备注需要friendId,但是此时你们还不是好友,改不了备注-->
  1189. <!-- <el-form :model="form" ref="form" autocomplete="off" label-position="left">
  1190. <div class="formDiv">
  1191. <el-form-item label="备注名" :label-width="formLabelWidth" class="custom-align-right">
  1192. <el-input v-model="form.remark" autocomplete="off" placeholder="请输入备注名.."></el-input>
  1193. </el-form-item>
  1194. </div>
  1195. </el-form> -->
  1196. 确定要添加<span>{{friendInfo.user_name}}</span>为好友吗?
  1197. </div>
  1198. <div class="footerButtonBox">
  1199. <el-button type="info" @click="friendWindowStatus=false">取消</el-button>
  1200. <el-button type="primary" @click="addFriend">确定</el-button>
  1201. </div>
  1202. </div>
  1203. </el-dialog>
  1204. <!--请求验证弹出框 end------------------------------------------------------------>
  1205. <!--修改备注弹出框 start------------------------------------------------------------>
  1206. <el-dialog :visible.sync="editWindowStatus" title="修改备注" :close-on-click-modal="false" width="420px">
  1207. <div>
  1208. <div>
  1209. <el-form :model="form" ref="form" autocomplete="off" label-position="left">
  1210. <div class="formDiv">
  1211. <el-form-item label="备注名" :label-width="formLabelWidth" class="custom-align-right">
  1212. <el-input v-model="remark" autocomplete="off" placeholder="请输入备注名.."></el-input>
  1213. </el-form-item>
  1214. </div>
  1215. </el-form>
  1216. </div>
  1217. <div class="footerButtonBox">
  1218. <el-button type="info" @click="editWindowStatus=false">取消</el-button>
  1219. <el-button type="primary" @click="editFriend">确定</el-button>
  1220. </div>
  1221. </div>
  1222. </el-dialog>
  1223. <!--修改备注弹出框 end------------------------------------------------------------>
  1224. <el-dialog :visible.sync="searchWindowStatus" title="聊天记录" :close-on-click-modal="false" width="420px" :modal="false">
  1225. <div class="searchFriendBox">
  1226. <div class="searchFriendItem">
  1227. <div class="searchFriendAvatar">
  1228. <img :src="searchFriendList.avatar" v-if="searchFriendList.avatar!=''">
  1229. <img src="@/assets/chat/user/admin.png" v-else>
  1230. </div>
  1231. <div class="searchFriendInfo">
  1232. <div class="searchFriendName">
  1233. <div class="searchFriendNameText" v-if="searchFriendList.remark!=null&&searchFriendList.remark!=''">{{searchFriendList.remark}}</div>
  1234. <div class="searchFriendNameText" v-else>{{searchFriendList.user_name}}</div>
  1235. </div>
  1236. <div class="searchFriendPhone">账号:{{searchFriendList.user_name}}</div>
  1237. </div>
  1238. </div>
  1239. <div class="searchFriendButton">
  1240. <el-button type="primary" v-if="searchFriendList.showBtn==false&&searchFriendList.id!=this.$store.state.user.userid" @click="openAddWindow(searchFriendList.id)">添加到通讯录</el-button>
  1241. <el-button type="danger" v-else-if="searchFriendList.showBtn==true" @click="deleteFriend(searchFriendList)">删除好友</el-button>
  1242. <el-button type="primary" disabled v-else>添加到通讯录</el-button>
  1243. </div>
  1244. </div>
  1245. </el-dialog>
  1246. </div>
  1247. </template>
  1248. <script>
  1249. //引入组件
  1250. import hallTitle from './components/hallTitle.vue';
  1251. import contactsTitle from './components/contactsTitle.vue';
  1252. import baseUrl from '@/utils/baseUrl';
  1253. export default {
  1254. components: {
  1255. hallTitle,
  1256. contactsTitle
  1257. },
  1258. name: "ChatPanel",
  1259. data() {
  1260. return {
  1261. ones:0,
  1262. messageContent:{},
  1263. avatar:this.$store.state.user.avatar,
  1264. showfrindDialog:false,
  1265. activeTab: 0,
  1266. groupList: [],
  1267. contactList: [],
  1268. showDialog:false,
  1269. //1.全局配置 start---------------------------------------->
  1270. myUserId:'',//我的用户id
  1271. tableTitleName:'聊天列表',//左侧菜单标题
  1272. messageTitle:'',//当前的聊天名称
  1273. editMessageTitle:'',//正在编辑的聊天名称
  1274. groupProfile:'',//当前的群公告
  1275. editGroupProfile:'',//正在编辑的群公告
  1276. groupProfileWindow:false,//群公告弹出框
  1277. listTimeOut:null,//定时器
  1278. addFriendWindowStatus:false,//添加好友弹出框
  1279. addform:{
  1280. friend_id:'',//好友id
  1281. remark:'',//备注名
  1282. },
  1283. formLabelWidth:'100px',
  1284. imgZoomStatus:false,//图片放大框
  1285. imgZoomUrl:'',//图片放大框的图片地址
  1286. //1.全局配置 end---------------------------------------->
  1287. //2.会话列表 start---------------------------------------->
  1288. hallLeftLoading:false,//左侧加载中
  1289. hallRightLoading:false,//右侧加载中
  1290. conversationList:[],//会话列表
  1291. groupConversationList:[],//群聊会话列表
  1292. selectConversationItem:{},//选择会话
  1293. searchConversationStatus:false,//搜索会话状态
  1294. chatrecords:[],//聊天记录
  1295. ifTop:false,//是否为置顶
  1296. searchConversation:'',//搜索会话
  1297. //2.会话列表 end---------------------------------------->
  1298. //3.聊天记录 start---------------------------------------->
  1299. receiverId:'',//接收消息的id
  1300. receiverType:'',//接收消息的类型 1单聊 2群聊
  1301. ifNoMessage:true,//如果没有选择任何聊天记录
  1302. searchChatRecords:"",//搜索聊天记录
  1303. userMessage:'',//用户发送的消息
  1304. fileWindowStatus:false,//聊天记录弹出框是否显示
  1305. activeName: 'all',//聊天记录选项卡
  1306. time:'',//按照时间搜索
  1307. //3.聊天记录 end---------------------------------------->
  1308. //4.群聊 start---------------------------------------->
  1309. //4.1 创建群聊
  1310. groupWindowStatus:false,//添加聊天群组出框是否显示
  1311. groupFriendsWindowStatus:false,//创建群聊时搜索框
  1312. friendsList:[],//左侧好友列表
  1313. searchFriendGroup:'',//搜索群聊的输入框绑定值
  1314. groupFriendSearchUser:{},//编辑群时搜索群成员 用于显示搜索结果
  1315. //4.2 加入群聊
  1316. addGroupWindow:false,//加入群聊弹出框
  1317. //4.2 编辑群聊
  1318. groupId:'',//当前编辑的群聊的id
  1319. creatorId:'',//群主id
  1320. groupUserList:[],//群成员列表
  1321. groupInfo:{},//群设置信息
  1322. groupSearchUser:{},//编辑群时搜索群成员 用于显示搜索结果
  1323. rightSlideBoxShow:false,//右侧菜单是否显示
  1324. searchGroup:'',//搜索群聊的输入框绑定值
  1325. editGroupNoticeWindow:false,//编辑群公告弹出框
  1326. editGroupNameWindow:false,//编辑群名称弹出框
  1327. groupEditWindowStatus:false,//编辑群成员弹出框
  1328. groupEditMainWindowStatus:false,//编辑弹框中搜索人员
  1329. searchUser:"",//右侧菜单的搜索框
  1330. groupRightUserInfo:{},//直接从右侧群组菜单中搜索成员
  1331. groupRightSearchWindow:false,//右侧群组详情弹出框
  1332. //shareGroupMessage:"",//分享群聊的消息
  1333. shareGroupWindowStatus:false,//分享群聊弹出框
  1334. shareGroupActive:'friend',//分享名片选项卡
  1335. shareGroupId:'',//要分享给谁
  1336. useShareGroupInfo:{},//分享名片时选中的群组信息
  1337. groupInviteInfo:{},//群邀请信息
  1338. //4.群聊 end---------------------------------------->
  1339. //6.名片 start---------------------------------------->
  1340. //userCardMessage:'',//用户留言
  1341. userCardWindowStatus:false,//用户名片弹出框
  1342. shareTableActive:'friend',//分享名片选项卡
  1343. useShareUserId:'',//分享名片时选中的用户id
  1344. useShareUserInfo:{},//分享名片时选中的用户信息
  1345. //6.名片 end---------------------------------------->
  1346. //7.加好友 start---------------------------------------->
  1347. addUserWindowStatus:false,//添加用户弹出框是否显示
  1348. form:{
  1349. //好友申请
  1350. addUserForm:{
  1351. notes:"",//备注
  1352. nickname:"",//修改昵称
  1353. }
  1354. },
  1355. //7.加好友 end---------------------------------------->
  1356. //8.发消息 start---------------------------------------->
  1357. sendMessage:{
  1358. img:{
  1359. imgUrl:'',//图片地址
  1360. oldFileName:"",//文件名
  1361. },
  1362. file:{
  1363. fileUrl:'',
  1364. oldFileName:"",//文件名
  1365. }
  1366. },
  1367. //1.全局配置 start------------------------------------------------------------>
  1368. tableTitleName:'通讯录',
  1369. pagestatus:1,//1=没有选择任何联系人 2=申请列表 3=好友详情 4=搜索结果
  1370. formLabelWidth:"100px",//表单label宽度
  1371. searchUserName:"",//搜索新添加用户
  1372. searchUserListName:"",//搜索好友列表
  1373. friendId:"",//要添加的好友id
  1374. friendWindowStatus:false,//通过朋友申请弹出框
  1375. searchWindowStatus:false,//搜索窗口左侧弹出框
  1376. searchUserWindowStatus:false,//搜索好友列表弹出框
  1377. editWindowStatus:false,//修改备注弹出框
  1378. addFriendWindowStatus:false,//发送好友申请弹出框
  1379. editFriendId:"",//要编辑的好友
  1380. getFriendApplyListStatus:null,//获取好友申请列表状态
  1381. //1.全局配置 end------------------------------------------------------------>
  1382. //2.好友列表 start------------------------------------------------------------>
  1383. userFriendList:[],//好友列表
  1384. userApplyList:[],//好友申请列表
  1385. searchFriendList:"",//搜索好友列表
  1386. //2.好友列表 end------------------------------------------------------------>
  1387. //3.通过好友申请 start------------------------------------------------------------>
  1388. form:{
  1389. //好友的用户id
  1390. id:"",
  1391. //好友id
  1392. friend_id:"",
  1393. //好友申请
  1394. remark:"",
  1395. //状态
  1396. status:2,
  1397. //申请id
  1398. apply_id:""
  1399. },
  1400. //3.通过好友申请 end------------------------------------------------------------>
  1401. //4.编辑好友 start------------------------------------------------------------>
  1402. friendInfo:{},//好友信息
  1403. remark:"",//修改的用户备注
  1404. //4.编辑好友 end------------------------------------------------------------>
  1405. //5.发送好友申请 start------------------------------------------------------------>
  1406. addform:{
  1407. //好友id
  1408. friend_id:"",
  1409. //好友申请
  1410. remark:"",
  1411. },
  1412. };
  1413. },
  1414. computed: {
  1415. tabList() {
  1416. return [
  1417. { key: "user-solid", icon: require('@/assets/chat/huihua.png'), active: require('@/assets/chat/huihua_select.png') },
  1418. { key: "user", icon: require('@/assets/chat/tongxl.png'), active: require('@/assets/chat/tongxl_select.png') },
  1419. ];
  1420. }
  1421. },
  1422. methods: {
  1423. clickShowMessage() {
  1424. // 先关闭所有旧消息
  1425. this.$message.closeAll();
  1426. this.$message({
  1427. dangerouslyUseHTMLString: true,
  1428. message: `
  1429. <div
  1430. class="my-custom-message"
  1431. style="display:flex;align-items:center;background:#fff !important;color:#000 !important;padding:8px 16px;border-radius:4px;cursor:pointer;border:none !important;box-shadow:none !important;">
  1432. <img src="http://img.bjzxtw.org.cn/master/image/webp/chatinfo.png" style="width:24px;height:24px;margin-right:10px;" alt="info"/>
  1433. <span>收到新消息</span>
  1434. </div>
  1435. `,
  1436. duration: 3000,
  1437. });
  1438. setTimeout(() => {
  1439. const el = document.querySelector('.my-custom-message');
  1440. if (el) {
  1441. el.onclick = () => {
  1442. this.onCustomMessageClick();
  1443. };
  1444. }
  1445. }, 50);
  1446. },
  1447. onCustomMessageClick() {
  1448. if(this.messageContent.receiver_id && this.messageContent.receiver_id.length==18){
  1449. this.selectGroup(this.messageContent);
  1450. }else{
  1451. this.selectConversation(this.messageContent);
  1452. }
  1453. console.log('自定义消息弹窗被点击了');
  1454. },
  1455. //1.会话列表 start---------------------------------------->
  1456. //1.1获取会话列表
  1457. getConversationList(){
  1458. this.$store.dispatch('chat/getConversation',{}).then(res=> {
  1459. console.log(res)
  1460. let data = res.data;
  1461. for(let item of data){
  1462. item.status = 0; //默认未选中
  1463. }
  1464. this.conversationList = data;
  1465. this.hallLeftLoading = false;
  1466. }).catch(() => {
  1467. this.$message.error('获取会话列表失败!')
  1468. })
  1469. },
  1470. //1.2选择会话
  1471. selectConversation(item){
  1472. this.showDialog = true;
  1473. console.log("发送消息消息体2:",item)
  1474. //选择会话的时候开启loading框
  1475. this.hallRightLoading = true;
  1476. //关闭右侧详情框
  1477. this.closeRightDetailWindow();
  1478. //使用receiverId判断当前是哪个会话
  1479. this.receiverId = item.receiver_id;
  1480. //会话类型 = 1 单聊
  1481. this.receiverType = 1;
  1482. //分享名片时需要使用用户的头像和名称
  1483. this.useShareUserInfo = item;
  1484. //关闭搜索会话搜索框
  1485. this.closeSearchConversation();
  1486. //清理单聊状态
  1487. this.conversationList.forEach(conversation => {
  1488. conversation.status = (conversation.receiver_id === item.receiver_id) ? 1 : 0;
  1489. if(conversation.receiver_id === item.receiver_id){
  1490. //当前的聊天名称
  1491. this.messageTitle = item.user_name;
  1492. }
  1493. });
  1494. //console.log(this.conversationList)
  1495. this.getchatrecords(item.receiver_id);
  1496. //关闭没有选择任何聊天的界面
  1497. this.ifNoMessage = false;
  1498. //选择单聊的时候把群聊的id清空
  1499. this.groupId = '';
  1500. },
  1501. //1.3获取聊天记录
  1502. getchatrecords(user_id){
  1503. //此处增加一个show_id 用于后端判断如何积累未读消息 注意,选择group的方法在下面
  1504. this.$store.dispatch('chat/getChatRecords',{friend_id:user_id}).then(res=> {
  1505. console.log(res)
  1506. this.chatrecords = res.data.data;
  1507. //滚动条滚动到底部
  1508. this.scorllBottom();
  1509. console.log(this.chatrecords)
  1510. //选择会话后关闭loading框
  1511. this.hallRightLoading = false;
  1512. }).catch(() => {
  1513. this.$message.error('获取聊天记录失败!')
  1514. //选择会话后关闭loading框
  1515. this.hallRightLoading = false;
  1516. })
  1517. },
  1518. //1.4搜索会话
  1519. searchUserConversation(){
  1520. this.selectConversationItem = {};
  1521. let flag = false; //是否找到会话
  1522. //当group_name等于搜索内容的时候,选择会话
  1523. for(let item of this.conversationList){
  1524. if(item.group_name==this.searchConversation||item.user_name==this.searchConversation){
  1525. this.selectConversationItem = item;
  1526. flag = true;
  1527. }
  1528. }
  1529. //如果没有找到会话 就提示没有找到
  1530. if(!flag){
  1531. this.$message.error('没有找到该会话!')
  1532. }else{
  1533. this.searchConversationStatus = true;
  1534. }
  1535. },
  1536. //1.5关闭搜索会话
  1537. closeSearchConversation(){
  1538. this.selectConversationItem = {};
  1539. this.searchConversationStatus = false;
  1540. },
  1541. //1.6 搜索并定位聊天记录
  1542. searchChatRecordsUser() {
  1543. // 获取输入的内容
  1544. const searchTerm = this.searchChatRecords.toLowerCase();
  1545. // 查找匹配的消息
  1546. const matchingItem = this.chatrecords.find(item => {
  1547. return item.content.toLowerCase().includes(searchTerm);
  1548. });
  1549. // 如果找到匹配的消息,滚动到该消息
  1550. if (matchingItem) {
  1551. const index = this.chatrecords.indexOf(matchingItem);
  1552. this.$nextTick(() => {
  1553. const messageElements = this.$refs.fileWindowMessageScrollBox.children;
  1554. if (messageElements[index]) {
  1555. messageElements[index].scrollIntoView({ behavior: 'smooth', block: 'nearest' });
  1556. }
  1557. });
  1558. } else {
  1559. this.$message.error('聊天信息不存在!'); // 提示用户
  1560. }
  1561. },
  1562. //1.7 从通讯录进入会话大厅
  1563. retrieveSession(){
  1564. console.log("开始执行retrieveSession方法!")
  1565. //1.获取会话列表
  1566. this.$store.dispatch('chat/getConversation',{}).then(res=> {
  1567. //2.查询当前会话中是否已经存在该好友的会话
  1568. let data = res.data;
  1569. let SeleteItem = {};
  1570. let flag = false;//对话是否已经存在
  1571. for(let item of data){
  1572. //3.如果会话中含有该好友的会话,则选中该会话
  1573. if(item.receiver_id == this.$route.query.friend_id){
  1574. item.status = 1;
  1575. SeleteItem = item;
  1576. flag = true;
  1577. }else{
  1578. item.status = 0;
  1579. }
  1580. }
  1581. //4.更新会话列表
  1582. this.conversationList = data;
  1583. //5.判断对话是否已经在会话列表中存在
  1584. if(flag==true){
  1585. console.log("会话存在!选中会话!")
  1586. //6.如果存在,则选中该会话
  1587. this.selectConversation(SeleteItem)
  1588. }else{
  1589. console.log("会话不存在!创建单聊!")
  1590. //7.如果不存在,则创建单聊
  1591. this.createSession();
  1592. }
  1593. //8.循环更新会话列表
  1594. this.forSearchConversationList();
  1595. }).catch(() => {
  1596. this.$message.error('获取会话列表失败!')
  1597. })
  1598. },
  1599. //1.8 创建单聊
  1600. createSession(){
  1601. //console.log(this.$route.query.friend_id)
  1602. const currentDateTime = new Date();
  1603. const formattedDateTime = currentDateTime.toLocaleString('zh-CN', { timeZone: 'Asia/Shanghai' });
  1604. console.log("当前时间(北京时间):", formattedDateTime);
  1605. const message = {
  1606. talk_type:1,//当前的会话类型
  1607. //receiver_id:this.$route.query.friend_id,//当前的会话id
  1608. receiver_id:this.createMessageId,//当前的会话id
  1609. content:"我于" + formattedDateTime + "创建了一个会话",//用户发发送的消息
  1610. msg_type:1,//消息类型 1:文本 2:图片 3:文件 4:好友卡片 5:系统消息;6:加群卡片
  1611. };
  1612. //console.log(message)
  1613. //发送消息
  1614. let that = this;
  1615. if (this.ws && this.ws.readyState === WebSocket.OPEN) {
  1616. //打开左侧loading防止重复点击
  1617. this.hallLeftLoading = true;
  1618. this.ws.send(JSON.stringify(message));
  1619. //bug
  1620. //如果双方不是好友,此处可以弹出错误
  1621. //2秒后搜索会话列表 防止创建失败
  1622. setTimeout(() => {
  1623. that.$store.dispatch('chat/getConversation',{}).then(res=> {
  1624. //查询当前会话中是否已经存在该好友的会话
  1625. let data = res.data;
  1626. let SeleteItem = {};
  1627. let flag = false;//对话是否已经存在
  1628. for(let item of data){
  1629. //如果会话中含有该好友的会话,则选中该会话
  1630. if(item.receiver_id == this.createMessageId){
  1631. item.status = 1;
  1632. SeleteItem = item;
  1633. flag = true;
  1634. }else{
  1635. item.status = 0;
  1636. }
  1637. }
  1638. //更新会话列表
  1639. that.conversationList = data;
  1640. //关闭loading层
  1641. that.hallLeftLoading = false;
  1642. //判断对话是否已经在会话列表中存在
  1643. if(flag==true){
  1644. //如果存在,则选中该会话
  1645. that.selectConversation(SeleteItem)
  1646. }else{
  1647. that.$message.error('创建会话失败,请重新从通讯录发起会话!')
  1648. }
  1649. }).catch(() => {
  1650. that.$message.error('获取会话列表失败!')
  1651. })
  1652. }, 2000);
  1653. }else{
  1654. this.$message.error('WebSocket连接失败!创建会话失败!')
  1655. }
  1656. },
  1657. //1.9 循环更新会话列表
  1658. forSearchConversationList(){
  1659. let that = this;
  1660. this.listTimeOut = setInterval(() => {
  1661. //刷新时先判断是否有选中的会话
  1662. if(that.receiverId!=''){
  1663. //如果不为空,说明用户选择了某一个会话,此时需要修改会话列表中该会话的状态
  1664. this.$store.dispatch('chat/getConversation',{}).then(res=> {
  1665. console.log(res)
  1666. let data = res.data;
  1667. for(let item of data){
  1668. if(item.receiver_id==that.receiverId){
  1669. item.status = 1;
  1670. }else{
  1671. item.status = 0;
  1672. }
  1673. }
  1674. this.conversationList = data;
  1675. console.log("开始获取会话列表,将于8秒后再次获取!")
  1676. }).catch(() => {
  1677. this.$message.error('获取会话列表失败!')
  1678. })
  1679. }else{
  1680. //如果为空,说明用户没有选择任何会话,此时可以直接请求列表
  1681. that.getConversationList();
  1682. }
  1683. }, 7000);
  1684. },
  1685. //1.10 查询会话列表中是否存在会话,不存在就创建
  1686. searchConversationIfCreate(user_id){
  1687. //从会话列表中找到receiver_id于user_id相同的会话
  1688. let flag = false;
  1689. for(let item of this.conversationList){
  1690. if(item.receiver_id==user_id){
  1691. flag = true;
  1692. }
  1693. }
  1694. //第一种情况:两人是好友,且会话已经创建了
  1695. if(flag){
  1696. //给与右侧展示列表的id
  1697. this.groupRightUserInfo.receiver_id = String(user_id);
  1698. this.groupRightUserInfo.user_id = String(user_id);
  1699. this.selectConversation(this.groupRightUserInfo)
  1700. this.rightSlideBoxShow = false;
  1701. this.groupRightSearchWindow = false;
  1702. }else{
  1703. //第二种情况:两人是好友但是不存在对话
  1704. //console.log("不存在这个会话,创建单聊")
  1705. this.createMessageId = user_id;
  1706. this.createSession();
  1707. }
  1708. },
  1709. //1.会话列表 end---------------------------------------->
  1710. //2.群聊 start---------------------------------------->
  1711. //2.1 创建群聊
  1712. //2.1.1 打开群聊创建窗口
  1713. creatGroup(){
  1714. this.groupWindowStatus = true;
  1715. //获得好友列表
  1716. this.getFriendsList();
  1717. },
  1718. //2.1.2 左侧菜单获取好友列表
  1719. getFriendsList(){
  1720. this.$store.dispatch('chat/getFriendsList',{user_id:this.myUserId}).then(res=> {
  1721. console.log(res)
  1722. for(let item of res.data){
  1723. item.status = false; //默认未选中
  1724. }
  1725. this.friendsList = res.data;
  1726. }).catch(() => {
  1727. this.$message.error('获取好友列表失败!')
  1728. })
  1729. },
  1730. //2.1.3 左侧菜单取消选择好友
  1731. cancelSelectFriends(id){
  1732. this.friendsList.forEach(item => {
  1733. if(item.id == id){
  1734. item.status = false;
  1735. }
  1736. });
  1737. },
  1738. //2.1.4 清空并关闭创建群弹出框
  1739. clearCreatGroupWindow(){
  1740. this.friendsList.forEach(item => {
  1741. item.status = false;
  1742. });
  1743. this.groupWindowStatus = false;
  1744. },
  1745. //2.1.5 创建群
  1746. createForGroup(){
  1747. let data = {
  1748. group_name:"",//群聊名称
  1749. group_desc:"仅群主可以修改",//群聊公告
  1750. group_avatar:"",//群聊头像
  1751. group_member:""//群成员
  1752. }
  1753. //从friendsList找出用户选择的联系人,然后创建群组
  1754. //先把我自己放进去
  1755. data.group_member = this.myUserId + ",";
  1756. //然后循环添加其他用户
  1757. this.friendsList.forEach(item => {
  1758. if(item.status){
  1759. data.group_member += item.friend_id + ",";
  1760. }
  1761. data.group_name = this.friendsList
  1762. .filter(item => item.status)
  1763. .slice(0, 3) // 只取前三个
  1764. .map(item => item.remark !== null ? item.remark : item.user_name)
  1765. .join(", ") // 使用逗号和空格分隔
  1766. });
  1767. data.group_member = data.group_member.slice(0,-1);//掉最后一个字符
  1768. //console.log(data)
  1769. this.$store.dispatch('chat/addGroup',data).then(res=> {
  1770. this.$message.success('创建群聊成功!')
  1771. //完成后关闭弹出框
  1772. this.clearCreatGroupWindow();
  1773. //重新获取会话列表
  1774. this.getConversationList();
  1775. }).catch(() => {
  1776. this.$message.error('创建群聊失败!')
  1777. })
  1778. },
  1779. //2.1.6 建群时搜索群成员
  1780. searchFriendGroupUser(){
  1781. this.groupFriendSearchUser = {};
  1782. let flag = false; //是否找到成员
  1783. for(let item of this.friendsList){
  1784. if(item.user_name==this.searchFriendGroup||item.remark==this.searchFriendGroup){
  1785. this.groupFriendSearchUser = item;
  1786. flag = true;
  1787. }
  1788. }
  1789. console.log(this.searchGroup)
  1790. console.log(this.friendsList)
  1791. console.log(flag)
  1792. console.log(this.groupFriendSearchUser)
  1793. //this.searchGroup 搜索的内容
  1794. //this.groupEditWindowStatus 弹出框状态
  1795. //this.groupSearchUser 搜索出来的成员
  1796. if(!flag){
  1797. this.$message.error('没有找到该成员!')
  1798. }else{
  1799. this.groupFriendsWindowStatus = true;
  1800. }
  1801. },
  1802. //2.1.7 把用户添加到选择框里面
  1803. addSearchFriendWindow(){
  1804. this.groupFriendSearchUser.status=!this.groupFriendSearchUser.status;
  1805. this.closeSearchFriendWindow();
  1806. },
  1807. //2.1.7 关闭搜索弹出框
  1808. closeSearchFriendWindow(){
  1809. this.groupFriendsWindowStatus = false;
  1810. },
  1811. //2.2 选择群聊
  1812. //2.1.1 在会话列表中选择一个群聊
  1813. selectGroup(item){
  1814. this.$fixModalZIndex();
  1815. this.showDialog = true;
  1816. //选择会话的时候开启loading框
  1817. this.hallRightLoading = true;
  1818. //关闭右侧详情框
  1819. this.closeRightDetailWindow();
  1820. //使用receiverId判断当前是哪个会话
  1821. this.receiverId = item.receiver_id;
  1822. //会话类型 = 2 群聊
  1823. this.receiverType = 2;
  1824. //分享群聊时需要使用群名称和群id
  1825. this.useShareGroupInfo = item;
  1826. console.log("选择群聊")
  1827. //清理单聊状态
  1828. this.conversationList.forEach(conversation => {
  1829. conversation.status = (conversation.receiver_id === item.receiver_id) ? 1 : 0;
  1830. });
  1831. console.log(item)
  1832. //记录准备加入群聊的id
  1833. this.groupId = item.receiver_id;
  1834. //当前的聊天名称
  1835. this.messageTitle = item.group_name;
  1836. //关闭没有选择任何聊天的界面
  1837. this.ifNoMessage = false;
  1838. //获取群聊天信息
  1839. this.getGroupChatRecords(item.receiver_id);
  1840. //获取群设置信息
  1841. this.getGroupSystem(item.receiver_id);
  1842. //获取群成员
  1843. this.getGroupMember(item.receiver_id);
  1844. },
  1845. //2.1.2 获取群聊消息
  1846. getGroupChatRecords(group_id){
  1847. this.$store.dispatch('chat/getGroupChatRecords',{group_id:group_id}).then(res=> {
  1848. console.log(res)
  1849. this.chatrecords = res.data.data;
  1850. //滚动条滚动到底部
  1851. this.scorllBottom();
  1852. //选择会话的时候开启loading框
  1853. this.hallRightLoading = false;
  1854. }).catch(() => {
  1855. this.$message.error('获取群设置信息失败!');
  1856. //选择会话的时候开启loading框
  1857. this.hallRightLoading = false;
  1858. })
  1859. },
  1860. //2.3 编辑群聊
  1861. //2.3.1 打开右侧菜单设置窗口
  1862. openGroupSystem(){
  1863. this.rightSlideBoxShow = !this.rightSlideBoxShow;
  1864. },
  1865. //2.3.2 获取群设置群成员
  1866. getGroupMember(group_id){
  1867. this.$store.dispatch('chat/getGroupMembers',{group_id:group_id}).then(res=> {
  1868. for(let item of res.data){
  1869. item.status = true; //默认选中
  1870. }
  1871. this.groupUserList = res.data;
  1872. }).catch(() => {
  1873. this.$message.error('获取群成员信息失败!')
  1874. })
  1875. },
  1876. //2.3.3 获取群设置信息
  1877. getGroupSystem(group_id){
  1878. this.$store.dispatch('chat/getGroupInfo',{group_id:group_id}).then(res=> {
  1879. console.log(res)
  1880. this.groupInfo = res.data;
  1881. this.creatorId = res.data.creator_id;
  1882. this.messageTitle = res.data.group_name;
  1883. this.editMessageTitle = res.data.group_name;
  1884. if(res.data.profile==null){
  1885. this.groupProfile = "暂无群公告"
  1886. }else{
  1887. this.groupProfile = res.data.profile;
  1888. this.editGroupProfile = res.data.profile;
  1889. }
  1890. }).catch(() => {
  1891. this.$message.error('获取群设置信息失败!')
  1892. })
  1893. },
  1894. //2.3.4 右侧菜单退出群聊
  1895. closeGroup(){
  1896. this.$confirm('将要退出该群聊,确定吗?', '提示', {
  1897. confirmButtonText: '确定',
  1898. cancelButtonText: '取消',
  1899. type: 'warning'
  1900. }).then(() => {
  1901. //this.groupId
  1902. this.$store.dispatch('chat/quitGroup',{group_id:this.groupId}).then(res=> {
  1903. this.$message.success('退出群聊成功!')
  1904. //关闭右侧菜单
  1905. this.rightSlideBoxShow = false;
  1906. //关闭右侧聊天界面
  1907. this.ifNoMessage = true;
  1908. //重新请求会话列表
  1909. this.getConversationList();
  1910. }).catch(() => {
  1911. this.$message.error('群聊退出失败!')
  1912. })
  1913. }).catch(() => {
  1914. this.$message.warning('已取消退出')
  1915. });
  1916. },
  1917. //2.3.5 右侧菜单删除群聊
  1918. delGroup(){
  1919. this.$confirm('将要解散该群聊,确定吗?', '提示', {
  1920. confirmButtonText: '确定',
  1921. cancelButtonText: '取消',
  1922. type: 'warning',
  1923. zIndex: 11000 // 新增,确保弹窗在最上层
  1924. }).then(() => {
  1925. //this.groupId
  1926. this.$store.dispatch('chat/delGroup',{group_id:this.groupId}).then(res=> {
  1927. this.$message.success('已解散群聊!')
  1928. //关闭右侧菜单
  1929. this.rightSlideBoxShow = false;
  1930. //关闭右侧聊天界面
  1931. this.ifNoMessage = true;
  1932. //重新请求会话列表
  1933. this.getConversationList();
  1934. }).catch(() => {
  1935. this.$message.error('解散群聊失败!')
  1936. })
  1937. }).catch(() => {
  1938. this.$message.warning('已取消解散')
  1939. });
  1940. },
  1941. //2.3.6 右侧菜单编辑群名称
  1942. editGroupName(){
  1943. let data = {
  1944. group_id:this.groupId,
  1945. group_name:this.editMessageTitle//群名称
  1946. }
  1947. this.$store.dispatch('chat/updateGroup',data).then(res=> {
  1948. this.$message.success('成功修改群聊名称!');
  1949. //重新获取群详情
  1950. this.getGroupSystem(this.groupId);
  1951. //重新获取会话列表
  1952. this.getConversationList();
  1953. this.editGroupNameWindow = false;
  1954. }).catch(() => {
  1955. this.$message.error('修改群聊名称失败!')
  1956. })
  1957. },
  1958. //2.3.7 右侧菜单编辑群公告
  1959. editGroupNotice(){
  1960. let data = {
  1961. group_id:this.groupId,
  1962. profile:this.editGroupProfile//群公告
  1963. }
  1964. this.$store.dispatch('chat/updateGroup',data).then(res=> {
  1965. this.editGroupNoticeWindow = false;
  1966. this.$message.success('成功添加群公告')
  1967. //重新获取群详情
  1968. this.getGroupSystem(this.groupId)
  1969. }).catch(() => {
  1970. this.$message.error('编辑群公告失败!')
  1971. })
  1972. },
  1973. //2.3.8 群弹出框回显群内成员
  1974. editGroupMember(){
  1975. //1.打开编辑窗口
  1976. this.groupEditWindowStatus = true;
  1977. //2.获得好友列表
  1978. this.$store.dispatch('chat/getFriendsList',{user_id:this.myUserId}).then(res=> {
  1979. //3.设置成未选中
  1980. for(let item of res.data){
  1981. item.status = false; //默认未选中
  1982. }
  1983. this.friendsList = res.data;
  1984. console.log(this.friendsList)
  1985. console.log(this.groupUserList)
  1986. //4.判断一下groupUserList是否包含friendsList中的成员,如果包含,就把friendsList中的成员status设置为true
  1987. this.friendsList.forEach(item => {
  1988. console.log(item.user_id)
  1989. if(this.groupUserList.find(groupItem => groupItem.user_id == item.friend_id)){
  1990. item.status = true;
  1991. }
  1992. });
  1993. console.log(this.friendsList)
  1994. }).catch(() => {
  1995. this.$message.error('获取好友列表失败!')
  1996. })
  1997. },
  1998. //2.3.9 群弹出框编辑群成员
  1999. changeSelectFriends(item) {
  2000. // 检查 groupUserList 是否包含 item
  2001. const index = this.groupUserList.findIndex(i => i.user_id == item.friend_id);
  2002. // 如果包含,就删除这个 item;否则,添加到 groupUserList
  2003. // 注意不能直接把friend_id放进去,因为最后编辑保存的时候取的是user_id,这里要传一下值
  2004. if (index !== -1) {
  2005. this.groupUserList.splice(index, 1);
  2006. } else {
  2007. item.user_id = item.friend_id;
  2008. this.groupUserList.push(item);
  2009. }
  2010. },
  2011. //2.3.19 群弹出框取消编辑群成员
  2012. cancelEditGroupMember(){
  2013. this.groupEditWindowStatus = false;
  2014. this.getGroupMember(this.groupId);
  2015. },
  2016. //2.3.20 群弹出框保存编辑群成员
  2017. saveEditGroupMember(){
  2018. let groupUser = []
  2019. // console.log(this.myUserId)
  2020. // console.log(this.groupUserList)
  2021. //取出所有选择的user_id且不能与自己的id相同
  2022. for(let item of this.groupUserList){
  2023. if(Number(item.user_id) != Number(this.myUserId)){
  2024. groupUser.push(item.user_id);
  2025. }
  2026. }
  2027. groupUser = groupUser.join(',');
  2028. //console.log(groupUser)
  2029. let data = {
  2030. group_id:this.groupId,
  2031. group_member:groupUser
  2032. }
  2033. this.$store.dispatch('chat/updateGroupMembers',data).then(res=> {
  2034. this.$message.success('群成员保存成功!')
  2035. this.groupEditWindowStatus = false;
  2036. this.getGroupMember(this.groupId);
  2037. }).catch(() => {
  2038. this.$message.error('群成员保存失败!')
  2039. this.groupEditWindowStatus = false;
  2040. this.getGroupMember(this.groupId);
  2041. })
  2042. },
  2043. //2.3.21 群弹出框搜索群成员
  2044. searchGroupUser(){
  2045. this.groupSearchUser = {};
  2046. let flag = false; //是否找到成员
  2047. for(let item of this.friendsList){
  2048. if(item.user_name==this.searchGroup||item.remark==this.searchGroup){
  2049. this.groupSearchUser = item;
  2050. flag = true;
  2051. }
  2052. }
  2053. console.log(this.searchGroup)
  2054. console.log(this.friendsList)
  2055. console.log(flag)
  2056. //this.searchGroup 搜索的内容
  2057. //this.groupEditWindowStatus 弹出框状态
  2058. //this.groupSearchUser 搜索出来的成员
  2059. if(!flag){
  2060. this.$message.error('没有找到该成员!')
  2061. }else{
  2062. this.groupEditMainWindowStatus = true;
  2063. }
  2064. },
  2065. //2.3.22 群弹出框添加群成员
  2066. addGroupUser(item){
  2067. item.user_id = item.friend_id;
  2068. console.log(item)
  2069. //找到friendsList中的该成员,把status设置为相反的值
  2070. for(let item of this.friendsList){
  2071. if(item.user_id==this.groupSearchUser.user_id){
  2072. item.status = !item.status;
  2073. }
  2074. }
  2075. // 找到groupUserList中是否存在该成员,如果存在就删除,没有不存在就添加
  2076. const index = this.groupUserList.findIndex(member => member.user_id === item.user_id);
  2077. if (index !== -1) {
  2078. // 如果存在,删除该成员
  2079. this.groupUserList.splice(index, 1);
  2080. } else {
  2081. // 如果不存在,添加该成员
  2082. this.groupUserList.push(item);
  2083. }
  2084. //完成后关闭弹出框
  2085. this.closeAddGroupUserWindow();
  2086. },
  2087. //2.3.23 群弹出框关闭弹出框
  2088. closeAddGroupUserWindow(){
  2089. this.searchGroup = "";
  2090. this.groupSearchUser = {};
  2091. this.groupEditMainWindowStatus = false;
  2092. },
  2093. //2.3.24 群弹出框移除群成员
  2094. editRemoveGroupUser(id){
  2095. console.log(id)
  2096. //移除this.groupUserList中user_id与id一致的
  2097. const index = this.groupUserList.findIndex(member => member.user_id === id);
  2098. if (index !== -1) {
  2099. this.groupUserList.splice(index, 1);
  2100. }
  2101. //找到friendsList中user_id与id一致的,把status设置为false
  2102. for(let item of this.friendsList){
  2103. if(item.friend_id==id){
  2104. item.status = false;
  2105. }
  2106. }
  2107. },
  2108. //2.3.25 右侧菜单编辑成员
  2109. rightSearchUser(){
  2110. this.groupRightUserInfo = {};
  2111. let flag = false; //是否找到成员
  2112. for(let item of this.groupUserList){
  2113. if(item.user_name==this.searchUser||item.remark==this.searchUser){
  2114. this.groupRightUserInfo = item;
  2115. flag = true;
  2116. }
  2117. }
  2118. console.log(this.searchUser)
  2119. console.log(this.groupUserList)
  2120. console.log(flag)
  2121. //this.searchGroup 搜索的内容
  2122. //this.groupEditWindowStatus 弹出框状态
  2123. //this.groupSearchUser 搜索出来的成员
  2124. if(!flag){
  2125. this.$message.error('没有找到该成员!')
  2126. }else{
  2127. //找到这个成员以后,需要先验证一下他俩是不是好友
  2128. this.$store.dispatch('chat/isFriend',{friend_id:this.groupRightUserInfo.user_id}).then(res=> {
  2129. console.log(res.data)//true false
  2130. this.groupRightUserInfo.isFriend = res.data;
  2131. //打开弹出框
  2132. this.groupRightSearchWindow = true;
  2133. }).catch(() => {
  2134. this.$message.error('获取成员身份信息失败!')
  2135. })
  2136. }
  2137. },
  2138. //2.3.26 关闭弹出框
  2139. closeRightSearchUser(){
  2140. this.searchUser = "";
  2141. this.groupRightUserInfo = {};
  2142. this.groupRightSearchWindow = false;
  2143. },
  2144. //2.4 加入群聊
  2145. //2.4.1 打开群聊邀请窗口
  2146. openGroupInviteWindow(info){
  2147. this.addGroupWindow = true;
  2148. //info.content.split(',')[0] 群名称
  2149. //info.content.split(',')[1] 群id
  2150. //获得要加入的群聊详情
  2151. console.log(info.content)
  2152. this.groupInviteInfo.group_name = info.content.split(',')[0];
  2153. this.groupInviteInfo.group_id = info.content.split(',')[1];
  2154. },
  2155. //2.4.2 加入群聊
  2156. joinGroup(){
  2157. this.$store.dispatch('chat/joinGroup',{group_id:this.groupInviteInfo.group_id}).then(res=> {
  2158. if(res.code=='200'){
  2159. this.$message.success('加入群聊成功!')
  2160. this.addGroupWindow = false;
  2161. }else{
  2162. this.$message.error(res.message)
  2163. }
  2164. }).catch(() => {
  2165. this.$message.error('加入群聊失败!')
  2166. })
  2167. },
  2168. //2.4.3 打开分享群聊弹出框
  2169. openShareMyGroup(){
  2170. //群组聊天数据初始化
  2171. this.groupConversationList = [];
  2172. //打开名片弹出框
  2173. this.shareGroupWindowStatus = true;
  2174. // shareGroupWindowStatus:false,//分享群聊弹出框
  2175. // shareGroupActive:'friend',//分享名片选项卡
  2176. // shareGroupId:'',//要分享的群聊id
  2177. // useShareGroupInfo:{},//分享名片时选中的群组信息
  2178. //默认获取一下好友列表
  2179. this.getFriendsList();
  2180. //把群聊提出来单独放到一个数组
  2181. for(let item of this.conversationList){
  2182. if(item.is_group==1){
  2183. this.groupConversationList.push(item);
  2184. }
  2185. }
  2186. },
  2187. //2.4.4 分享群聊
  2188. shareMyGroup(){
  2189. console.log(this.shareGroupId)
  2190. if(this.shareGroupId!=''){
  2191. let message = {};
  2192. console.log(this.useShareGroupInfo)
  2193. let userInfo = [this.useShareGroupInfo.group_name,this.useShareGroupInfo.receiver_id];
  2194. let userInfoString = userInfo.join(',');
  2195. if(this.shareGroupActive=='friend'){
  2196. //单聊
  2197. message = {
  2198. talk_type:1,
  2199. receiver_id:this.shareGroupId,
  2200. msg_type:6,//消息类型 1:文本 2:图片 3:文件 4:好友卡片 5:系统消息;6:加群卡片
  2201. };
  2202. message.content = userInfoString;
  2203. }else if(this.shareGroupActive=='group'){
  2204. //群聊
  2205. message = {
  2206. talk_type:2,
  2207. receiver_id:this.shareGroupId,
  2208. content:userInfo,
  2209. msg_type:6,//消息类型 1:文本 2:图片 3:文件 4:好友卡片 5:系统消息;6:加群卡片
  2210. };
  2211. message.content = userInfoString;
  2212. }
  2213. console.log(message)
  2214. //发送消息
  2215. if (this.ws && this.ws.readyState === WebSocket.OPEN) {
  2216. this.ws.send(JSON.stringify(message));
  2217. }
  2218. //关闭分享弹出框
  2219. this.shareGroupWindowStatus = false;
  2220. this.$message.success('分享名片成功!')
  2221. }else{
  2222. this.$message.error('请选择分享对象!')
  2223. }
  2224. },
  2225. handleClickShareGroupCard(tab, event) {
  2226. const tabName = tab.name;
  2227. console.log("当前选中的tab name:", tabName);
  2228. this.shareGroupActive = tabName;
  2229. },
  2230. //2.4.5 判断该成员是否在群聊中
  2231. isGroupUser(id){
  2232. let flag = false;
  2233. for(let item of this.groupUserList){
  2234. if(item.user_id==id){
  2235. flag = true;
  2236. }
  2237. }
  2238. return flag;
  2239. },
  2240. //2.群聊 end---------------------------------------->
  2241. //3.全局应用 start---------------------------------------->
  2242. //3.1 滚动条滚动到底部
  2243. scorllBottom(){
  2244. //滚动条滚动到底部
  2245. this.$nextTick(() => {
  2246. const rightUserMessageBox = this.$refs.rightUserMessageBox;
  2247. if (rightUserMessageBox) {
  2248. rightUserMessageBox.scrollTop = rightUserMessageBox.scrollHeight;
  2249. }
  2250. });
  2251. },
  2252. //3.2 添加好友
  2253. addFriendShow(id){
  2254. console.log("添加好友:",id)
  2255. this.addFriendWindowStatus = true;
  2256. this.addform.friend_id = id;
  2257. },
  2258. addMyFriend(){
  2259. this.$store.dispatch('chat/addFriend',this.addform).then(res=> {
  2260. if(res.code=='200'){
  2261. this.$message.success("好友申请发送成功!")
  2262. this.addFriendWindowStatus = false;
  2263. }else{
  2264. //this.$message.error(res.data)
  2265. this.$message.error(res.message)
  2266. }
  2267. })
  2268. },
  2269. //3.3 关闭右侧详情框
  2270. closeRightDetailWindow(){
  2271. this.rightSlideBoxShow = false;
  2272. this.groupRightSearchWindow = false;
  2273. this.searchUser = "";
  2274. },
  2275. //3.全局应用 end---------------------------------------->
  2276. //4.会话框 start---------------------------------------->
  2277. //4.1上传
  2278. //4.1.1上传图片
  2279. beforeImgUpload(file) {
  2280. //先清理一下上传的缩略窗口
  2281. this.deFileUpload()
  2282. const isJPG = file.type === 'image/jpeg';
  2283. const isPNG = file.type === 'image/png';
  2284. const isLt2M = file.size / 1024 / 1024 < 2;
  2285. if (!isJPG && !isPNG) {
  2286. this.$message.error('发送的图片只能是 JPG 或 PNG 格式!');
  2287. return false;
  2288. }
  2289. if (!isLt2M) {
  2290. this.$message.error('发送的图片大小不能超过 2MB!');
  2291. return false;
  2292. }
  2293. const formData = new FormData();
  2294. formData.append('file', file);
  2295. this.$store.dispatch('pool/uploadFile',formData).then(res=> {
  2296. this.sendMessage.img.imgUrl = res.data.imgUrl;//获取上传的图片地址
  2297. this.sendMessage.img.oldFileName = res.data.oldFileName;
  2298. console.log(res.data.imgUrl)
  2299. }).catch(() => {
  2300. this.$message({
  2301. type: 'info',
  2302. message: '网络错误,请重试!'
  2303. });
  2304. })
  2305. // 阻止默认的上传行为
  2306. return false;
  2307. },
  2308. //4.1.2上传文件
  2309. beforeFileUpload(file) {
  2310. //先清理一下上传的缩略窗口
  2311. this.deFileUpload()
  2312. console.log(file)
  2313. //允许的文件类型
  2314. const isDoc = file.type === 'application/msword';
  2315. const isDocx = file.type === 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';
  2316. const isXls = file.type === 'application/vnd.ms-excel';
  2317. const isXlsx = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
  2318. const isPptx = file.type === 'application/vnd.openxmlformats-officedocument.presentationml.presentation';
  2319. const isRar = file.type === 'application/x-rar-compressed';
  2320. const isZip = file.type === 'application/x-zip-compressed';
  2321. const isTxt = file.type === 'text/plain';
  2322. const isPdf = file.type === 'application/pdf';
  2323. //文件大小不能超过2M
  2324. const isLt2M = file.size / 1024 / 1024 < 2;
  2325. if (!isTxt && !isDoc && !isDocx && !isXls && !isXlsx && !isPptx && !isRar && !isZip && !isPdf) {
  2326. this.$message.error('该文件类型不允许上传!');
  2327. return false;
  2328. }
  2329. if (!isLt2M) {
  2330. this.$message.error('发送的文件大小不能超过2M!');
  2331. return false;
  2332. }
  2333. const formData = new FormData();
  2334. formData.append('file', file);
  2335. this.$store.dispatch('pool/uploadFile',formData).then(res=> {
  2336. this.sendMessage.file.fileUrl = res.data.imgUrl;
  2337. this.sendMessage.file.oldFileName = res.data.oldFileName;
  2338. console.log(res.data)
  2339. }).catch(() => {
  2340. this.$message({
  2341. type: 'info',
  2342. message: '网络错误,请重试!'
  2343. });
  2344. })
  2345. // 阻止默认的上传行为
  2346. return false;
  2347. },
  2348. //4.1.3 删除上传的文件
  2349. deFileUpload(){
  2350. this.sendMessage.img.imgUrl = "";
  2351. this.sendMessage.img.oldFileName = "";
  2352. this.sendMessage.file.fileUrl = "";
  2353. this.sendMessage.file.oldFileName = "";
  2354. },
  2355. //4.会话框 end---------------------------------------->
  2356. //5.websocket会话 start---------------------------------------->
  2357. //5.1 接受消息
  2358. handleIncomingMessage(event) {
  2359. const message = JSON.parse(event.data);
  2360. this.clickShowMessage();
  2361. console.log("监听消息1:",message)
  2362. if(this.ones==0){
  2363. this.ones = 1
  2364. this.getConversationList();
  2365. }
  2366. console.log(message.receiver_id)
  2367. this.conversationList.forEach(item => {
  2368. if(item.receiver_id==message.receiver_id){
  2369. console.log("当前消息属于当前的聊天窗口!")
  2370. this.messageContent = message;
  2371. }
  2372. });
  2373. // console.log(message.receiver_id.length == 18)
  2374. //第一步:先判断是否为群消息
  2375. if (message.receiver_id && message.receiver_id.length == 18) {
  2376. //第二步:判断当前接收的消息是否显示到聊天框中
  2377. if(Number(this.receiverId)==Number(message.receiver_id)){
  2378. console.log("当前消息为群消息,并且可以显示到当前的会话框中!")
  2379. //18位就是群聊
  2380. if(Number(this.myUserId) == Number(message.user_id)){
  2381. //如果message的receiverId和会话的receiverId一致,说明这条信息是自己发的回显
  2382. let receiveMessage = {
  2383. action:"said",//自己说的
  2384. user_avatar:message.user_avatar,//头像
  2385. content:message.content,//内容
  2386. msg_type:message.msg_type,//消息类型
  2387. }
  2388. console.log("来自单聊的回显消息:"+this.receiverId,message.receiver_id)
  2389. console.log(message)
  2390. //消息添加到聊天记录
  2391. this.chatrecords.push(receiveMessage);
  2392. // 确保 Vue 能够检测到数组的变化
  2393. //this.$set(this.chatrecords, this.chatrecords.length, receiveMessage);
  2394. console.log(this.chatrecords)
  2395. //滚动条滚动到底部
  2396. this.scorllBottom();
  2397. }else{
  2398. let receiveMessage = {
  2399. action:"recieved",//对方说的
  2400. receiver_avatar:message.user_avatar,//头像
  2401. content:message.content,//内容
  2402. msg_type:message.msg_type,//消息类型
  2403. }
  2404. //如果message的receiverId和会话的receiverId不一致,说明这条信息是别人发的,需要添加到聊天记录
  2405. //消息添加到聊天记录
  2406. console.log("来自单聊消息:"+this.receiverId,message.user_id)
  2407. this.chatrecords.push(receiveMessage);
  2408. console.log(message)
  2409. //滚动条滚动到底部
  2410. this.scorllBottom();
  2411. }
  2412. }else{
  2413. console.log("当前消息为群消息,但是用户未开启此聊天窗口!")
  2414. }
  2415. }else{
  2416. //当前的单聊消息是自己发的,回显到聊天框中
  2417. if(Number(this.receiverId)==Number(message.receiver_id)){
  2418. //如果message的receiverId和会话的receiverId一致,说明这条信息是自己发的回显
  2419. let receiveMessage = {
  2420. action:"said",//自己说的
  2421. user_avatar:message.user_avatar,//头像
  2422. content:message.content,//内容
  2423. msg_type:message.msg_type,//消息类型
  2424. }
  2425. console.log("来自单聊的回显消息:"+this.receiverId,message.receiver_id)
  2426. console.log(message)
  2427. //消息添加到聊天记录
  2428. this.chatrecords.push(receiveMessage);
  2429. // 确保 Vue 能够检测到数组的变化
  2430. //this.$set(this.chatrecords, this.chatrecords.length, receiveMessage);
  2431. console.log(this.chatrecords)
  2432. //滚动条滚动到底部
  2433. this.scorllBottom();
  2434. }else{
  2435. //判断要回显的内容是不是在群聊
  2436. if(message.receiver_id && Number(message.receiver_id.length) == 18){
  2437. console.log("当前是单聊消息,你选择的是单聊框,可以回显!")
  2438. let receiveMessage = {
  2439. action:"recieved",//对方说的
  2440. receiver_avatar:message.user_avatar,//头像
  2441. content:message.content,//内容
  2442. msg_type:message.msg_type,//消息类型
  2443. }
  2444. console.log("来自单聊的回显消息:"+this.receiverId,message.receiver_id)
  2445. console.log(message)
  2446. //消息添加到聊天记录
  2447. this.chatrecords.push(receiveMessage);
  2448. // 确保 Vue 能够检测到数组的变化
  2449. //this.$set(this.chatrecords, this.chatrecords.length, receiveMessage);
  2450. console.log(this.chatrecords)
  2451. //滚动条滚动到底部
  2452. this.scorllBottom();
  2453. }else{
  2454. // console.log(this.receiverId)
  2455. // console.log(message.receiver_id,message.user_id)
  2456. // console.log("当前是单聊消息,但是你选择的是群聊框,该条消息不能回显!")
  2457. if(this.receiverId!=message.receiver_id&&this.receiverId!=message.user_id){
  2458. //收到单聊消息,但是单聊消息不属于当前的聊天窗口
  2459. console.log("当前单聊消息不属于当前的聊天窗口,不回显!")
  2460. }else{
  2461. if(this.receiverId==message.user_id){
  2462. console.log("当前单聊消息属于当前的聊天窗口,回显!")
  2463. let receiveMessage = {
  2464. action:"recieved",//对方说的
  2465. receiver_avatar:message.user_avatar,//头像
  2466. content:message.content,//内容
  2467. msg_type:message.msg_type,//消息类型
  2468. }
  2469. console.log("来自单聊的回显消息:"+this.receiverId,message.receiver_id)
  2470. console.log(message)
  2471. //消息添加到聊天记录
  2472. this.chatrecords.push(receiveMessage);
  2473. // 确保 Vue 能够检测到数组的变化
  2474. //this.$set(this.chatrecords, this.chatrecords.length, receiveMessage);
  2475. console.log(this.chatrecords)
  2476. //滚动条滚动到底部
  2477. this.scorllBottom();
  2478. }
  2479. }
  2480. }
  2481. }
  2482. }
  2483. },
  2484. // 5.2 发送消息
  2485. sendUserMessage() {
  2486. if (this.userMessage.trim() !== '') {
  2487. const message = {
  2488. talk_type:this.receiverType,//当前的会话类型
  2489. receiver_id:this.receiverId,//当前的会话id
  2490. content:this.userMessage,//用户发发送的消息
  2491. msg_type:1,//消息类型 1:文本 2:图片 3:文件 4:好友卡片 5:系统消息;6:加群卡片
  2492. };
  2493. //发送消息
  2494. if (this.ws && this.ws.readyState === WebSocket.OPEN) {
  2495. this.ws.send(JSON.stringify(message));
  2496. }
  2497. this.userMessage = '';
  2498. }else{
  2499. this.$message.error('消息不能为空!')
  2500. }
  2501. },
  2502. // 5.3 发送图片或者文字
  2503. sendUserMessageToFile() {
  2504. if(this.sendMessage.img.imgUrl!=''){
  2505. const message = {
  2506. talk_type:this.receiverType,//当前的会话类型
  2507. receiver_id:this.receiverId,//当前的会话id
  2508. content:this.sendMessage.img.imgUrl,//用户发发送的消息
  2509. msg_type:2,//消息类型 1:文本 2:图片 3:文件 4:好友卡片 5:系统消息;6:加群卡片
  2510. };
  2511. if (this.ws && this.ws.readyState === WebSocket.OPEN) {
  2512. this.ws.send(JSON.stringify(message));
  2513. //发送完毕清除选择的图片
  2514. this.sendMessage.img.imgUrl='';
  2515. }
  2516. //如果文本框不为空,把文本框内的消息也提交过去
  2517. if(this.userMessage.trim()!=''){
  2518. this.sendUserMessage();
  2519. }
  2520. }
  2521. if(this.sendMessage.file.fileUrl!=''){
  2522. //把名称和地址打包成一个对象
  2523. const fileInfo = {
  2524. file_url:this.sendMessage.file.fileUrl,
  2525. oldFileName:this.sendMessage.file.oldFileName
  2526. }
  2527. const fileInfoString = JSON.stringify(fileInfo);
  2528. //发送消息
  2529. const message = {
  2530. talk_type:this.receiverType,//当前的会话类型
  2531. receiver_id:this.receiverId,//当前的会话id
  2532. content:fileInfoString,//用户发发送的消息
  2533. msg_type:3,//消息类型 1:文本 2:图片 3:文件 4:好友卡片 5:系统消息;6:加群卡片
  2534. };
  2535. if (this.ws && this.ws.readyState === WebSocket.OPEN) {
  2536. this.ws.send(JSON.stringify(message));
  2537. //发送完毕清除选择的文件
  2538. this.sendMessage.file.fileUrl='';
  2539. }
  2540. //如果文本框不为空,把文本框内的消息也提交过去
  2541. if(this.userMessage.trim()!=''){
  2542. this.sendUserMessage();
  2543. }
  2544. }
  2545. },
  2546. //5.4 打开名片弹出框
  2547. openShareCard(){
  2548. //群组聊天数据初始化
  2549. this.groupConversationList = [];
  2550. //打开名片弹出框
  2551. this.userCardWindowStatus = true;
  2552. //默认获取一下好友列表
  2553. this.getFriendsList();
  2554. //好友列表
  2555. //this.friendsList
  2556. //会话列表
  2557. //this.conversationList
  2558. //把群聊提出来单独放到一个数组
  2559. //this.groupConversationList
  2560. for(let item of this.conversationList){
  2561. if(item.is_group==1){
  2562. this.groupConversationList.push(item);
  2563. }
  2564. }
  2565. },
  2566. //5.5 分享名片
  2567. shareCard(){
  2568. console.log(this.useShareUserId)
  2569. if(this.useShareUserId!=''){
  2570. let message = {};
  2571. // let userInfo = {
  2572. // avatar:this.useShareUserInfo.avatar,
  2573. // user_name:this.useShareUserInfo.user_name,
  2574. // friend_id:this.receiverId
  2575. // }
  2576. let userInfo = [this.useShareUserInfo.avatar,this.useShareUserInfo.user_name,this.receiverId];
  2577. let userInfoString = userInfo.join(',');
  2578. if(this.shareTableActive=='friend'){
  2579. //单聊
  2580. message = {
  2581. talk_type:1,
  2582. receiver_id:this.useShareUserId,
  2583. msg_type:4,//消息类型 1:文本 2:图片 3:文件 4:好友卡片 5:系统消息;6:加群卡片
  2584. };
  2585. message.content = userInfoString;
  2586. }else if(this.shareTableActive=='group'){
  2587. //群聊
  2588. message = {
  2589. talk_type:2,
  2590. receiver_id:this.useShareUserId,
  2591. content:userInfo,
  2592. msg_type:4,//消息类型 1:文本 2:图片 3:文件 4:好友卡片 5:系统消息;6:加群卡片
  2593. };
  2594. message.content = userInfoString;
  2595. }
  2596. console.log(message)
  2597. //发送消息
  2598. if (this.ws && this.ws.readyState === WebSocket.OPEN) {
  2599. this.ws.send(JSON.stringify(message));
  2600. }
  2601. //关闭分享弹出框
  2602. this.userCardWindowStatus = false;
  2603. this.$message.success('分享名片成功!')
  2604. }else{
  2605. this.$message.error('请选择分享对象!')
  2606. }
  2607. },
  2608. //5.6 切换分享名片
  2609. handleClickShareCard(tab, event) {
  2610. const tabName = tab.name;
  2611. console.log("当前选中的tab name:", tabName);
  2612. this.shareTableActive = tabName;
  2613. },
  2614. //5.7 下载文件
  2615. downloadFile(item){
  2616. let downloadData = JSON.parse(item.content);
  2617. console.log(downloadData.file_url)
  2618. if(downloadData.file_url!=''){
  2619. const link = document.createElement('a');
  2620. link.href = downloadData.file_url;
  2621. link.setAttribute('download', 'downloaded_file'); // You can set a default file name here
  2622. document.body.appendChild(link);
  2623. link.click();
  2624. document.body.removeChild(link);
  2625. }else{
  2626. this.$message.error('文件下载失败!')
  2627. }
  2628. },
  2629. //5.8 图片放大
  2630. imgZoom(url){
  2631. this.imgZoomUrl = url;
  2632. this.imgZoomStatus = true;
  2633. },
  2634. //5.9 创建链接 防止websocket意外中断
  2635. getWebsocket(){
  2636. //判断当前的route是否为/hall,否则不触发这个方法
  2637. if(this.$route.path=="/hall"){
  2638. this.$confirm('您的会话意外断开,是否重新连接?', '提示', {
  2639. confirmButtonText: '重新连接',
  2640. cancelButtonText: '取消',
  2641. type: 'warning'
  2642. }).then(() => {
  2643. //强制刷新页面
  2644. window.location.reload();
  2645. }).catch(() => {
  2646. //取消刷新
  2647. this.$message.error("您的连接已中断!")
  2648. });
  2649. }else{
  2650. console.log("前往其他页面,关闭ws!")
  2651. }
  2652. },
  2653. //5.websocket会话 end---------------------------------------->
  2654. //0.全局操作 start------------------------------------------------------------>
  2655. //0.1切换页面状态
  2656. tabPage(status){
  2657. this.showfrindDialog = true;
  2658. this.pagestatus = status;
  2659. if(status==2){
  2660. //如果是2 好友列表状态还原
  2661. for(let item of this.userFriendList){
  2662. item.status = 0;
  2663. }
  2664. }
  2665. this.getFriendApplyList();
  2666. },
  2667. //0.全局操作 end------------------------------------------------------------>
  2668. //1.好友列表 start------------------------------------------------------------>
  2669. addUser(){
  2670. this.pagestatus = 4;
  2671. },
  2672. closeAddUser(){
  2673. this.pagestatus = 2;
  2674. this.searchWindowStatus = false;
  2675. this.searchUserName = "";
  2676. },
  2677. //1.1获取联系人列表
  2678. getUserFriendList(){
  2679. console.log("获取联系人列表##")
  2680. //获取用户身份id
  2681. //const userId = this.$store.state.user.userid;
  2682. this.$store.dispatch('chat/getFriendsList',{}).then(res=> {
  2683. let data = res.data;
  2684. console.log("=====:",data)
  2685. for(let item of data){
  2686. item.status = 0; //默认未选中
  2687. }
  2688. this.userFriendList = data;
  2689. }).catch(() => {
  2690. this.$message.error('获取好友列表失败!')
  2691. })
  2692. },
  2693. //1.2选择联系人
  2694. changeUserItem(id){
  2695. for(let item of this.userFriendList){
  2696. if(item.friend_id == id){
  2697. item.status = 1;
  2698. }else{
  2699. item.status = 0;
  2700. }
  2701. }
  2702. //切换页面到用户列表
  2703. this.pagestatus = 3;
  2704. this.showfrindDialog = true;
  2705. //把要编辑的好友的id存起来
  2706. this.editFriendId = id;
  2707. // console.log(id)
  2708. // console.log(this.userFriendList)
  2709. //获取好友身份信息详情
  2710. this.$store.dispatch('chat/getFriendInfo',{friend_id:this.editFriendId}).then(res=> {
  2711. console.log(res)
  2712. //保存好友信息
  2713. this.friendInfo = res.data;
  2714. this.remark = res.data.remark;
  2715. }).catch(() => {
  2716. this.$message.error('获得好友身份详情失败!')
  2717. })
  2718. },
  2719. //1.3搜索联系人
  2720. searchFriend(){
  2721. //搜索联系人
  2722. this.$store.dispatch('chat/searchFriend',{keyword:this.searchUserName}).then(res=> {
  2723. //获取到好友
  2724. this.searchWindowStatus = false;
  2725. console.log(res);
  2726. if(res.code==200){
  2727. if(res.data.length>0){
  2728. this.searchWindowStatus = true;
  2729. this.searchFriendList = res.data[0];
  2730. //搜出来以后查询两人是否为好友
  2731. this.searchIsFriend(this.searchFriendList)
  2732. }else{
  2733. this.$message.error('没有找到该联系人!')
  2734. }
  2735. }else{
  2736. this.$message.error('搜索关键字不能为空!')
  2737. }
  2738. })
  2739. },
  2740. //1.3搜索好友列表中的好友
  2741. searchOrdFriend(){
  2742. if(this.searchUserListName==""){
  2743. this.$message.error('搜索关键字不能为空!')
  2744. return;
  2745. }else{
  2746. let isFriend = false;
  2747. for(let item of this.userFriendList){
  2748. if(item.user_name == this.searchUserListName){
  2749. isFriend = true;
  2750. this.searchFriendList = item;
  2751. }
  2752. }
  2753. if(isFriend){
  2754. this.changeUserItem(this.searchFriendList.friend_id)
  2755. //console.log(this.searchFriendList);
  2756. }else{
  2757. this.$message.error('没有找到该联系人!')
  2758. }
  2759. }
  2760. },
  2761. //1.好友列表 end------------------------------------------------------------>
  2762. //2.获得好友申请列表 start------------------------------------------------------------>
  2763. //2.1 好友申请列表
  2764. getFriendApplyList(){
  2765. console.log("获取好友申请列表");
  2766. const userId = this.$store.state.user.userid;
  2767. this.$store.dispatch('chat/getFriendsApplyList',{user_id:userId}).then(res=> {
  2768. this.userApplyList = res.data;
  2769. }).catch(() => {
  2770. this.$message.error('获取好友申请列表失败!')
  2771. })
  2772. },
  2773. //2.2 接受好友申请
  2774. addFriend(){
  2775. //通过用户申请
  2776. console.log(this.form);
  2777. this.$store.dispatch('chat/applyFriend',this.form).then(res=> {
  2778. if(res.code==200){
  2779. this.showfrindDialog = false;
  2780. this.$message.success('成功添加好友!')
  2781. this.friendWindowStatus = false;
  2782. //重新加载用户列表
  2783. this.getUserFriendList();
  2784. //清空右侧
  2785. this.friendInfo = {};
  2786. //this.pagestatus = 1;
  2787. this.getFriendApplyListStatus();
  2788. }
  2789. })
  2790. },
  2791. //2.3 删除好友
  2792. deleteFriend(id){
  2793. console.log(id);
  2794. if(id){
  2795. this.editFriendId = String(id);
  2796. }
  2797. console.log(id)
  2798. this.$confirm('此操作将永久删除该联系人, 是否继续?', '提示', {
  2799. confirmButtonText: '确定',
  2800. cancelButtonText: '取消',
  2801. type: 'warning',
  2802. zIndex: 11000, // 新增,确保弹窗在最上层
  2803. modal: false // 移除蒙层
  2804. }).then(() => {
  2805. console.log(this.editFriendId);
  2806. this.$store.dispatch('chat/delFriend',{friend_id:this.editFriendId}).then(res=> {
  2807. this.$message.success('删除成功!')
  2808. //关闭用户详情显示
  2809. this.pagestatus = 1;
  2810. //重新装在用户列表
  2811. this.getUserFriendList();
  2812. })
  2813. }).catch(() => {
  2814. this.$message({
  2815. type: 'warning',
  2816. message: '已取消删除'
  2817. });
  2818. });
  2819. },
  2820. //2.4 编辑好友
  2821. editFriend(){
  2822. let data = {
  2823. friend_id:this.editFriendId,
  2824. remark:this.remark
  2825. }
  2826. //this.editFriendId
  2827. this.$store.dispatch('chat/updateFriend',data).then(res=> {
  2828. if(res.code==200){
  2829. this.showfrindDialog = false;
  2830. this.$message.success('修改备注名成功!')
  2831. this.pagestatus = 1;
  2832. this.editWindowStatus = false;
  2833. this.getUserFriendList();
  2834. this.remark = "";
  2835. }else{
  2836. this.$message.error(res.message)
  2837. }
  2838. }).catch(() => {
  2839. this.$message.error('修改备注名失败!')
  2840. })
  2841. },
  2842. //2.5 发送好友申请
  2843. addMyFriend(){
  2844. console.log(this.addform);
  2845. this.$store.dispatch('chat/addFriend',this.addform).then(res=> {
  2846. this.$message.success("已成功发送好友申请!")
  2847. this.addFriendWindowStatus = false;
  2848. this.searchWindowStatus = false;
  2849. this.addform.remark = "";
  2850. })
  2851. },
  2852. //2.6 查询是否是好友
  2853. searchIsFriend(item){
  2854. let data = {
  2855. friend_id:item.isfriend
  2856. }
  2857. console.log(data);
  2858. this.$store.dispatch('chat/isFriend',data).then(res=>{
  2859. console.log(res);
  2860. if(res.code==0&&res.message=="不是好友"){
  2861. this.searchFriendList.showBtn = false;
  2862. }else{
  2863. this.searchFriendList.showBtn = true;
  2864. }
  2865. this.$forceUpdate();
  2866. })
  2867. },
  2868. //2.7 定时查询好友申请状态
  2869. setTimeFriendApplyList(){
  2870. console.log("定时查询好友申请状态");
  2871. let that = this;
  2872. this.getFriendApplyListStatus = setInterval(()=>{
  2873. that.getFriendApplyList();
  2874. },5000)
  2875. },
  2876. //2.获得好友申请列表 end------------------------------------------------------------>
  2877. //3.操作弹出框 start------------------------------------------------------------>
  2878. //用户菜单操作
  2879. openWindow(item){
  2880. this.form.id = item.id;
  2881. this.form.friend_id = item.friend_id;
  2882. this.friendInfo = item;
  2883. //打开弹出框
  2884. this.friendWindowStatus = true;
  2885. },
  2886. openEditWindow(id){
  2887. //打开修改备注弹出框
  2888. this.editWindowStatus = true;
  2889. },
  2890. openAddWindow(id){
  2891. console.log(id);
  2892. this.addform.friend_id = String(id);
  2893. this.addFriendWindowStatus = true;
  2894. },
  2895. //发送消息===
  2896. sendMessageToFriend(item){
  2897. this.showfrindDialog = false;
  2898. this.showDialog = true;
  2899. console.log("发送消息消息体1:",item)
  2900. //选择会话的时候开启loading框
  2901. this.hallRightLoading = true;
  2902. //关闭右侧详情框
  2903. this.closeRightDetailWindow();
  2904. //使用receiverId判断当前是哪个会话
  2905. this.receiverId = item.friend_id;
  2906. //会话类型 = 1 单聊
  2907. this.receiverType = 1;
  2908. //分享名片时需要使用用户的头像和名称
  2909. this.useShareUserInfo = item;
  2910. //关闭搜索会话搜索框
  2911. this.closeSearchConversation();
  2912. //清理单聊状态
  2913. // this.conversationList.forEach(conversation => {
  2914. // conversation.status = (conversation.receiver_id === item.friend_id) ? 1 : 0;
  2915. // if(conversation.receiver_id === item.friend_id){
  2916. // //当前的聊天名称
  2917. // this.messageTitle = item.user_name;
  2918. // }
  2919. // });
  2920. this.messageTitle = item.user_name;
  2921. //console.log(this.conversationList)
  2922. this.getchatrecords(item.friend_id);
  2923. //关闭没有选择任何聊天的界面
  2924. this.ifNoMessage = false;
  2925. //选择单聊的时候把群聊的id清空
  2926. this.groupId = '';
  2927. },
  2928. handleDialogOpen() {
  2929. this.$nextTick(() => {
  2930. setTimeout(() => {
  2931. const modals = document.querySelectorAll('.v-modal');
  2932. modals.forEach(modal => {
  2933. // 10999 比弹窗低,确保弹窗在上面
  2934. if (parseInt(modal.style.zIndex, 10) > 10999) {
  2935. modal.style.zIndex = 10999;
  2936. }
  2937. });
  2938. }, 50); // 动画结束后再修正一次
  2939. });
  2940. },
  2941. initDrag() {
  2942. const panel = this.$el;
  2943. const header = panel.querySelector('.chat-header');
  2944. if (!header) return;
  2945. let isDragging = false;
  2946. let startX, startY, startLeft, startTop;
  2947. header.style.cursor = 'move';
  2948. header.addEventListener('mousedown', (e) => {
  2949. // 只允许鼠标左键拖动
  2950. if (e.button !== 0) return;
  2951. isDragging = true;
  2952. startX = e.clientX;
  2953. startY = e.clientY;
  2954. const rect = panel.getBoundingClientRect();
  2955. startLeft = rect.left;
  2956. startTop = rect.top;
  2957. // 防止选中文字
  2958. document.body.style.userSelect = 'none';
  2959. const onMouseMove = (moveEvent) => {
  2960. if (!isDragging) return;
  2961. const dx = moveEvent.clientX - startX;
  2962. const dy = moveEvent.clientY - startY;
  2963. let newLeft = startLeft + dx;
  2964. let newTop = startTop + dy;
  2965. // 限制不拖出屏幕
  2966. const maxLeft = window.innerWidth - panel.offsetWidth;
  2967. const maxTop = window.innerHeight - panel.offsetHeight;
  2968. newLeft = Math.max(0, Math.min(newLeft, maxLeft));
  2969. newTop = Math.max(0, Math.min(newTop, maxTop));
  2970. panel.style.left = newLeft + 'px';
  2971. panel.style.top = newTop + 'px';
  2972. panel.style.right = '';
  2973. panel.style.bottom = '';
  2974. };
  2975. const onMouseUp = () => {
  2976. isDragging = false;
  2977. document.removeEventListener('mousemove', onMouseMove);
  2978. document.removeEventListener('mouseup', onMouseUp);
  2979. document.body.style.userSelect = '';
  2980. };
  2981. document.addEventListener('mousemove', onMouseMove);
  2982. document.addEventListener('mouseup', onMouseUp);
  2983. });
  2984. },
  2985. },
  2986. mounted() {
  2987. console.log("=====fuck")
  2988. //开启websocket连接 start---------------------------------------->
  2989. //1.获取admin-token
  2990. const adminToken = document.cookie.split('; ').find(row => row.startsWith('Admin-Token=')).split('=')[1];
  2991. console.log("Admin-Token:", adminToken);
  2992. //2.连接websocket
  2993. let websocketNewUrl = baseUrl.WebsocketUrl +"?token=" + adminToken;
  2994. //let websocketNewUrl = URL.WebsocketUrl +"?token=" + adminToken;
  2995. this.ws = new WebSocket(websocketNewUrl);
  2996. this.ws.addEventListener('message', this.handleIncomingMessage);
  2997. //3.当连接中断时提供一个方法重新连接
  2998. let that = this;
  2999. //当连接关闭的时候关闭websocket
  3000. this.ws.addEventListener('close', function (event) {
  3001. // 连接关闭时执行的操作
  3002. console.log("关闭链接",event);
  3003. // 弹窗询问用户是否手动刷新
  3004. // that.getWebsocket();
  3005. });
  3006. //开启websocket连接 end---------------------------------------->
  3007. //从通讯录创建单聊 start---------------------------------------->
  3008. //当ws创建成功以后再执行,防止数据未加载
  3009. this.ws.onopen = () => {
  3010. console.log("ws创建成功!");
  3011. console.log(this.$route.query.friend_id)
  3012. //判断当前路由是否携带friend_id
  3013. if(this.$route.query.friend_id){
  3014. console.log("从通讯录进入,开始创建会话!")
  3015. //1.从通讯录进入会话大厅
  3016. this.retrieveSession();
  3017. //2.获取我的用户id
  3018. this.myUserId = this.$store.state.user.userid;
  3019. //把这个id存一下
  3020. this.createMessageId = this.$route.query.friend_id;
  3021. }else{
  3022. console.log("直接进入,无需创建会话!")
  3023. //直接进入会话大厅
  3024. //1.获取会话列表
  3025. this.getConversationList();
  3026. this.getUserFriendList();
  3027. this.getFriendApplyList();
  3028. //2.获取我的用户id
  3029. this.myUserId = this.$store.state.user.userid;
  3030. //3.循环获取会话列表
  3031. //开启loading
  3032. this.hallLeftLoading = true;
  3033. this.forSearchConversationList();
  3034. }
  3035. };
  3036. //从通讯录创建单聊 end---------------------------------------->
  3037. // if (!document.getElementById('custom-message-style')) {
  3038. // const style = document.createElement('style');
  3039. // style.id = 'custom-message-style';
  3040. // style.innerHTML = `
  3041. // .el-message {
  3042. // min-width: auto !important;
  3043. // padding: 0 !important;
  3044. // background: transparent !important;
  3045. // border: none !important;
  3046. // box-shadow: 0 2px 8px rgba(0,0,0,0.4) !important;
  3047. // border-radius:100px !important;
  3048. // }
  3049. // .el-message .el-message__icon {
  3050. // display: none !important;
  3051. // }
  3052. // .el-message .my-custom-message {
  3053. // background: #fff !important;
  3054. // color: #000 !important;
  3055. // border-radius: 4px !important;
  3056. // box-shadow: 0 2px 8px rgba(0,0,0,0.5) !important;
  3057. // border: none !important;
  3058. // padding: 8px 16px !important;
  3059. // display: flex;
  3060. // align-items: center;
  3061. // }
  3062. // `;
  3063. // document.head.appendChild(style);
  3064. // }
  3065. this.initDrag();
  3066. },
  3067. beforeDestroy() {
  3068. //页面销毁的时候清除定时器获取列表
  3069. clearInterval(this.listTimeOut);
  3070. //页面销毁的时候关闭websocket
  3071. if (this.ws) {
  3072. this.ws.removeEventListener('message', this.handleIncomingMessage);
  3073. this.ws.close();
  3074. }
  3075. clearInterval(this.getFriendApplyListStatus);
  3076. }
  3077. };
  3078. </script>
  3079. <style scoped lang="less">
  3080. .chat-panel {
  3081. position: fixed;
  3082. right: 30px;
  3083. bottom: 30px;
  3084. width: 270px;
  3085. height: 520px;
  3086. background: #fff;
  3087. border-radius: 8px;
  3088. box-shadow: 0 2px 16px rgba(0,0,0,0.18);
  3089. z-index: 10000;
  3090. display: flex;
  3091. flex-direction: column;
  3092. overflow: hidden;
  3093. }
  3094. .chat-header {
  3095. height: 48px;
  3096. display: flex;
  3097. align-items: center;
  3098. padding: 0 16px;
  3099. background: #f5f5f5;
  3100. border-bottom: 1px solid #eee;
  3101. position: relative;
  3102. }
  3103. .chat-header .chat-status {
  3104. width: 8px;
  3105. height: 8px;
  3106. background: #4caf50;
  3107. border-radius: 50%;
  3108. margin-left: 8px;
  3109. }
  3110. .chat-header .chat-close {
  3111. position: absolute;
  3112. right: 16px;
  3113. cursor: pointer;
  3114. font-size: 20px;
  3115. }
  3116. .chat-header .chat-icon {
  3117. width: 24px;
  3118. height: 24px;
  3119. margin-right: 8px;
  3120. border-radius: 50%;
  3121. }
  3122. .chat-tabs {
  3123. display: flex;
  3124. justify-content: space-between;
  3125. align-items: center;
  3126. padding: 0;
  3127. border-bottom: 1px solid #eee;
  3128. height: 44px;
  3129. }
  3130. .tab {
  3131. flex: 1;
  3132. text-align: center;
  3133. font-size: 20px;
  3134. cursor: pointer;
  3135. color: #888;
  3136. padding: 12px 0;
  3137. transition: color 0.2s, border-bottom 0.2s;
  3138. border-bottom: 2px solid transparent;
  3139. }
  3140. .tab.active {
  3141. color: #409EFF;
  3142. border-bottom: 2px solid #409EFF;
  3143. }
  3144. .chat-groups {
  3145. padding: 0 6px;
  3146. }
  3147. .group {
  3148. margin-bottom: 12px;
  3149. font-size: 16px;
  3150. color: #333;
  3151. cursor: pointer;
  3152. }
  3153. .chat-footer {
  3154. height: 48px;
  3155. display: flex;
  3156. align-items: center;
  3157. justify-content: space-around;
  3158. border-top: 1px solid #eee;
  3159. background: #fafafa;
  3160. }
  3161. .footer-icon {
  3162. font-size: 22px;
  3163. cursor: pointer;
  3164. }
  3165. .contact {
  3166. display: flex;
  3167. align-items: center;
  3168. justify-content: space-between;
  3169. margin-bottom: 12px;
  3170. font-size: 16px;
  3171. color: #333;
  3172. }
  3173. .status {
  3174. width: 8px;
  3175. height: 8px;
  3176. border-radius: 50%;
  3177. display: inline-block;
  3178. }
  3179. .status.online {
  3180. background: #4caf50;
  3181. }
  3182. .status.offline {
  3183. background: #ccc;
  3184. }
  3185. //左侧
  3186. .hallLeft {
  3187. // width: 420px;
  3188. background: #fff;
  3189. border-radius: 20px;
  3190. margin-top: 11px;
  3191. position: relative;
  3192. .newFriendBox {
  3193. padding: 10px 25px 0 25px;
  3194. font-size: 18px;
  3195. color: #999;
  3196. }
  3197. .newFriendImgBox {
  3198. padding: 8px 21px 8px 25px;
  3199. height: 62px;
  3200. display: flex;
  3201. align-items: center;
  3202. justify-content: flex-start;
  3203. cursor: pointer;
  3204. border-bottom: 1px solid #E9EDF7;
  3205. position: relative;
  3206. box-sizing: border-box;
  3207. border-right: 4px solid #fff;
  3208. margin-top:10px;
  3209. .newFriendImg {
  3210. border-radius: 4px;
  3211. background: #5570F1;
  3212. display: flex;
  3213. align-items: center;
  3214. justify-content: center;
  3215. margin-right: 10px;
  3216. width: 20px;
  3217. height: 20px;
  3218. img{
  3219. width: 100%;
  3220. }
  3221. }
  3222. .newFriendText {
  3223. color: #333;
  3224. font-size: 14px;
  3225. display: flex;
  3226. align-items: center;
  3227. justify-content: space-between;
  3228. flex: 1;
  3229. span {
  3230. background: #5570F1;
  3231. color: #fff;
  3232. line-height: 24px;
  3233. font-size: 12px;
  3234. width: 24px;
  3235. height: 24px;
  3236. text-align: center;
  3237. border-radius: 50%;
  3238. display: block;
  3239. margin-right: 20px;
  3240. }
  3241. }
  3242. }
  3243. .newFriendIActive {
  3244. border-right: 4px solid #5570F1 !important;
  3245. background: #F5F7FD
  3246. }
  3247. .searchFriendBox {
  3248. position: absolute;
  3249. width: 280px;
  3250. border-radius: 8px;
  3251. top: 0;
  3252. right: -300px;
  3253. background: #fff;
  3254. box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.1);
  3255. border-radius: 8px;
  3256. z-index: 100;
  3257. box-sizing: border-box;
  3258. padding: 30px 0;
  3259. .searchFriendItem {
  3260. display: flex;
  3261. align-items: center;
  3262. justify-content: flex-start;
  3263. border-bottom: 1px solid #E9EDF7;
  3264. padding: 0 20px 30px 20px;
  3265. .searchFriendAvatar {
  3266. img {
  3267. width: 66px;
  3268. height: 66px;
  3269. border-radius: 50%;
  3270. }
  3271. margin-right: 15px;
  3272. }
  3273. .searchFriendInfo {
  3274. flex: 1;
  3275. .searchFriendName {
  3276. display: flex;
  3277. align-items: center;
  3278. .gender {
  3279. img {
  3280. width: 12px;
  3281. height: 12px;
  3282. }
  3283. }
  3284. img {
  3285. width: 18px;
  3286. height: 18px;
  3287. cursor: pointer;
  3288. }
  3289. .searchFriendNameText {
  3290. font-size: 18px;
  3291. width: 120px;
  3292. height: 28px;
  3293. line-height: 28px;
  3294. white-space: nowrap;
  3295. overflow: hidden;
  3296. text-overflow: ellipsis;
  3297. }
  3298. }
  3299. .searchFriendPhone {
  3300. font-size: 14px;
  3301. color: #999;
  3302. margin-top: 10px;
  3303. }
  3304. }
  3305. }
  3306. .searchFriendLineBox {
  3307. display: flex;
  3308. align-items: center;
  3309. justify-content: flex-start;
  3310. padding: 20px;
  3311. border-bottom: 1px solid #E9EDF7;
  3312. .searchFriendLineTitle{
  3313. font-size: 16px;
  3314. color: #999999;
  3315. width: 90px;
  3316. }
  3317. .searchFriendLineContent{
  3318. font-size: 16px;
  3319. color: #333;
  3320. flex: 1;
  3321. .searchFriendLineContentItem{
  3322. display: flex;
  3323. align-items: center;
  3324. justify-content: space-between;
  3325. }
  3326. }
  3327. }
  3328. .searchFriendButton {
  3329. padding:40px 0 10px 0;
  3330. text-align: center;
  3331. .searchFriendButtonItem {
  3332. font-size: 14px;
  3333. color: #5570F1;
  3334. img {
  3335. width: 30px;
  3336. height: 30px;
  3337. margin-bottom: 5px;
  3338. }
  3339. }
  3340. }
  3341. }
  3342. .userListTitle {
  3343. padding: 15px 25px;
  3344. font-size: 18px;
  3345. color: #999;
  3346. }
  3347. .searchBox {
  3348. padding-left: 25px;
  3349. padding-right: 25px;
  3350. padding-bottom: 0px;
  3351. }
  3352. .userListBox {
  3353. padding: 15px 0;
  3354. overflow-y: auto;
  3355. // height: 300px;
  3356. .active {
  3357. background: #F5F7FD;
  3358. box-sizing: border-box;
  3359. border-right: 4px solid #5570F1 !important;
  3360. }
  3361. .userItem {
  3362. padding: 8 21px 8 25px;
  3363. display: flex;
  3364. align-items: center;
  3365. justify-content: space-between;
  3366. height: 52px;
  3367. box-sizing: border-box;
  3368. border-right: 4px solid #fff;
  3369. cursor: pointer;
  3370. .userAvatar {
  3371. width: 38px;
  3372. height: 38px;
  3373. img {
  3374. width: 100%;
  3375. height: 100%;
  3376. border-radius: 50%;
  3377. }
  3378. }
  3379. .userInfo {
  3380. flex: 1;
  3381. box-sizing: border-box;
  3382. padding-left: 5px;
  3383. .userName {
  3384. display: flex;
  3385. align-items: center;
  3386. justify-content: space-between;
  3387. .userNameText {
  3388. font-size: 14px;
  3389. font-weight: bold;
  3390. // width: 240px;
  3391. white-space: nowrap;
  3392. overflow: hidden;
  3393. text-overflow: ellipsis;
  3394. color: #333;
  3395. }
  3396. .userMessageNum {
  3397. font-size: 12px;
  3398. color: #333;
  3399. width: 64px;
  3400. height: 24px;
  3401. line-height: 24px;
  3402. text-align: center;
  3403. border-radius: 50%;
  3404. background: #FFCC91;
  3405. font-weight: bold;
  3406. }
  3407. }
  3408. .userMessage {
  3409. display: flex;
  3410. align-items: center;
  3411. justify-content: space-between;
  3412. .userMessageText {
  3413. display: block;
  3414. width: 240px;
  3415. white-space: nowrap;
  3416. overflow: hidden;
  3417. text-overflow: ellipsis;
  3418. font-size: 14px;
  3419. color: #999999;
  3420. }
  3421. .userMessageTime {
  3422. font-size: 14px;
  3423. color: #999999;
  3424. }
  3425. }
  3426. }
  3427. }
  3428. }
  3429. .hallLeftLoading{
  3430. position: absolute;
  3431. top: 0;
  3432. left: 0;
  3433. width: 420px;
  3434. height: 740px;
  3435. display: flex;
  3436. align-items: center;
  3437. justify-content: center;
  3438. background: rgba(255, 255, 255, 0.5);
  3439. z-index: 100;
  3440. .hallLeftLoadingIcon {
  3441. .hallLeftLoadingIconItem {
  3442. color: #CCCCCC;
  3443. text-align: center;
  3444. margin-bottom: 20px;
  3445. font-size: 60px;
  3446. }
  3447. .hallLeftLoadingText {
  3448. color: #CCCCCC;
  3449. font-size: 32px;
  3450. font-weight: bold;
  3451. }
  3452. }
  3453. }
  3454. .searchBoxMain {
  3455. position: relative;
  3456. .searchFriendClose {
  3457. display: flex;
  3458. align-items: center;
  3459. justify-content: flex-end;
  3460. padding-right: 10px;
  3461. padding-bottom: 10px;
  3462. .rightSlideBoxCloseIcon {
  3463. cursor: pointer;
  3464. width: 28px;
  3465. height: 28px;
  3466. line-height: 28px;
  3467. text-align: center;
  3468. background: #EFEFEF;
  3469. border-radius: 8px;
  3470. }
  3471. }
  3472. .searchBox {
  3473. padding-left: 25px;
  3474. padding-right: 25px;
  3475. padding-bottom: 0px;
  3476. }
  3477. .searchFriendBox {
  3478. position: absolute;
  3479. width: 280px;
  3480. border-radius: 8px;
  3481. top: 0;
  3482. right: -300px;
  3483. background: #fff;
  3484. box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.1);
  3485. border-radius: 8px;
  3486. z-index: 100;
  3487. box-sizing: border-box;
  3488. padding: 20px 0 30px 0;
  3489. .searchFriendItem {
  3490. display: flex;
  3491. align-items: center;
  3492. justify-content: flex-start;
  3493. border-bottom: 1px solid #E9EDF7;
  3494. padding: 0 20px 30px 20px;
  3495. .searchFriendAvatar {
  3496. img {
  3497. width: 66px;
  3498. height: 66px;
  3499. border-radius: 50%;
  3500. }
  3501. margin-right: 15px;
  3502. }
  3503. .searchFriendInfo {
  3504. flex: 1;
  3505. .searchFriendName {
  3506. display: flex;
  3507. align-items: center;
  3508. .gender {
  3509. img {
  3510. width: 12px;
  3511. height: 12px;
  3512. }
  3513. }
  3514. img {
  3515. width: 18px;
  3516. height: 18px;
  3517. cursor: pointer;
  3518. }
  3519. .searchFriendNameText {
  3520. font-size: 18px;
  3521. width: 120px;
  3522. height: 28px;
  3523. line-height: 28px;
  3524. white-space: nowrap;
  3525. overflow: hidden;
  3526. text-overflow: ellipsis;
  3527. }
  3528. }
  3529. .searchFriendPhone {
  3530. font-size: 14px;
  3531. color: #999;
  3532. margin-top: 10px;
  3533. }
  3534. }
  3535. }
  3536. .searchFriendLineBox {
  3537. display: flex;
  3538. align-items: center;
  3539. justify-content: flex-start;
  3540. padding: 20px;
  3541. border-bottom: 1px solid #E9EDF7;
  3542. .searchFriendLineTitle{
  3543. font-size: 16px;
  3544. color: #999999;
  3545. width: 90px;
  3546. }
  3547. .searchFriendLineContent{
  3548. font-size: 16px;
  3549. color: #333;
  3550. flex: 1;
  3551. .searchFriendLineContentItem{
  3552. display: flex;
  3553. align-items: center;
  3554. justify-content: space-between;
  3555. }
  3556. }
  3557. }
  3558. .searchFriendButton {
  3559. padding:40px 0 10px 0;
  3560. text-align: center;
  3561. .searchFriendButtonItem {
  3562. font-size: 14px;
  3563. color: #5570F1;
  3564. img {
  3565. width: 30px;
  3566. height: 30px;
  3567. margin-bottom: 5px;
  3568. }
  3569. }
  3570. }
  3571. }
  3572. }
  3573. .userListBox {
  3574. .active {
  3575. background: #F5F7FD;
  3576. box-sizing: border-box;
  3577. border-right: 4px solid #5570F1 !important;
  3578. }
  3579. .userItem {
  3580. padding: 8px 21px 8px 25px;
  3581. height: 62px;
  3582. box-sizing: border-box;
  3583. border-right: 4px solid #fff;
  3584. cursor: pointer;
  3585. display: flex;
  3586. align-items: center;
  3587. .flexItemBox{
  3588. width: 100%;
  3589. .userAvatar {
  3590. width: 38px;
  3591. height: 38px;
  3592. float:left;
  3593. img {
  3594. width: 100%;
  3595. height: 100%;
  3596. border-radius: 50%;
  3597. }
  3598. }
  3599. .userInfo {
  3600. float:left;
  3601. width:131px;
  3602. margin-top:17px;
  3603. box-sizing: border-box;
  3604. padding-left: 15px;
  3605. .userName {
  3606. display: flex;
  3607. align-items: center;
  3608. justify-content: space-between;
  3609. //padding-bottom: 10px;
  3610. .userNameText {
  3611. font-size: 14px;
  3612. font-weight: bold;
  3613. width:260px;
  3614. }
  3615. .userMessageNum {
  3616. font-size: 12px;
  3617. color: #333;
  3618. width: 64px;
  3619. height: 24px;
  3620. line-height: 24px;
  3621. text-align: center;
  3622. border-radius: 50%;
  3623. background: #FFCC91;
  3624. font-weight: bold;
  3625. }
  3626. }
  3627. .userMessage {
  3628. display: flex;
  3629. align-items: center;
  3630. justify-content: space-between;
  3631. .userMessageText {
  3632. display: block;
  3633. width: 240px;
  3634. white-space: nowrap;
  3635. overflow: hidden;
  3636. text-overflow: ellipsis;
  3637. font-size: 14px;
  3638. color: #999999;
  3639. }
  3640. .userMessageTime {
  3641. font-size: 14px;
  3642. color: #999999;
  3643. }
  3644. }
  3645. }
  3646. }
  3647. }
  3648. }
  3649. }
  3650. //右侧菜单
  3651. .rightSlideBox {
  3652. width: 420px;
  3653. height: 100%;
  3654. position: absolute;
  3655. right: 0;
  3656. top: 0;
  3657. background: #fff;
  3658. box-shadow: -4px 0px 4px 0px rgba(0, 0, 0, 0.1);
  3659. .rightSlideBoxClose {
  3660. padding: 20px 20px 0 20px;
  3661. height: 50px;
  3662. overflow: hidden;
  3663. display: flex;
  3664. align-items: center;
  3665. justify-content: space-between;
  3666. .rightSlideBoxCloseTitle {
  3667. font-size: 18px;
  3668. color: #333;
  3669. }
  3670. .rightSlideBoxCloseIcon {
  3671. cursor: pointer;
  3672. width: 28px;
  3673. height: 28px;
  3674. line-height: 28px;
  3675. text-align: center;
  3676. background: #EFEFEF;
  3677. border-radius: 8px;
  3678. }
  3679. }
  3680. .rightSlideSearch {
  3681. padding: 30px 25px 0 25px;
  3682. height: 66px;
  3683. //overflow: hidden;
  3684. position: relative;
  3685. .searchFriendBox {
  3686. position: absolute;
  3687. width: 280px;
  3688. border-radius: 8px;
  3689. top: 65px;
  3690. left: -260px;
  3691. background: #fff;
  3692. box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.1);
  3693. border-radius: 8px;
  3694. z-index: 100;
  3695. box-sizing: border-box;
  3696. padding: 20px 0 30px 0;
  3697. .searchFriendClose {
  3698. display: flex;
  3699. align-items: center;
  3700. justify-content: flex-end;
  3701. padding-right: 10px;
  3702. padding-bottom: 10px;
  3703. .rightSlideBoxCloseIcon {
  3704. cursor: pointer;
  3705. width: 28px;
  3706. height: 28px;
  3707. line-height: 28px;
  3708. text-align: center;
  3709. background: #EFEFEF;
  3710. border-radius: 8px;
  3711. }
  3712. }
  3713. .searchFriendItem {
  3714. display: flex;
  3715. align-items: center;
  3716. justify-content: flex-start;
  3717. border-bottom: 1px solid #E9EDF7;
  3718. padding: 0 20px 30px 20px;
  3719. .searchFriendAvatar {
  3720. img {
  3721. width: 66px;
  3722. height: 66px;
  3723. border-radius: 50%;
  3724. }
  3725. margin-right: 15px;
  3726. }
  3727. .searchFriendInfo {
  3728. flex: 1;
  3729. .searchFriendName {
  3730. display: flex;
  3731. align-items: center;
  3732. .gender {
  3733. img {
  3734. width: 12px;
  3735. height: 12px;
  3736. }
  3737. }
  3738. img {
  3739. width: 18px;
  3740. height: 18px;
  3741. cursor: pointer;
  3742. }
  3743. .searchFriendNameText {
  3744. font-size: 18px;
  3745. width: 120px;
  3746. height: 28px;
  3747. line-height: 28px;
  3748. white-space: nowrap;
  3749. overflow: hidden;
  3750. text-overflow: ellipsis;
  3751. }
  3752. }
  3753. .searchFriendPhone {
  3754. font-size: 14px;
  3755. color: #999;
  3756. margin-top: 10px;
  3757. }
  3758. }
  3759. }
  3760. .searchFriendLineBox {
  3761. display: flex;
  3762. align-items: center;
  3763. justify-content: flex-start;
  3764. padding: 20px;
  3765. border-bottom: 1px solid #E9EDF7;
  3766. .searchFriendLineTitle{
  3767. font-size: 16px;
  3768. color: #999999;
  3769. width: 90px;
  3770. }
  3771. .searchFriendLineContent{
  3772. font-size: 16px;
  3773. color: #333;
  3774. flex: 1;
  3775. .searchFriendLineContentItem{
  3776. display: flex;
  3777. align-items: center;
  3778. justify-content: space-between;
  3779. }
  3780. }
  3781. }
  3782. .searchFriendButton {
  3783. padding:40px 0 10px 0;
  3784. text-align: center;
  3785. .searchFriendButtonItem {
  3786. font-size: 14px;
  3787. color: #5570F1;
  3788. img {
  3789. width: 30px;
  3790. height: 30px;
  3791. margin-bottom: 5px;
  3792. }
  3793. }
  3794. }
  3795. }
  3796. }
  3797. .rightSlideUserBox {
  3798. box-sizing: border-box;
  3799. padding: 40px 40px 10px 40px;
  3800. height: 180px;
  3801. overflow-y: auto;
  3802. display: flex;
  3803. align-items: center;
  3804. flex-wrap: wrap;
  3805. //border-bottom: 1px solid #E9EDF7;
  3806. .rightEditUserItem {
  3807. cursor: pointer;
  3808. // color: #333;
  3809. // .rightSlideUserItemIcon {
  3810. // .addUserIcon {
  3811. // transition: all 0.5s ease;
  3812. // }
  3813. // .addUserIcon:hover {
  3814. // background: #5570F1;
  3815. // color: #fff;
  3816. // }
  3817. // }
  3818. }
  3819. .rightSlideUserItem {
  3820. margin-bottom: 20px;
  3821. width: 25%;
  3822. position: relative;
  3823. //cursor: pointer;
  3824. //用户菜单
  3825. .rightSlideUserItemMore {
  3826. position: absolute;
  3827. background: #fff;
  3828. box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.1);
  3829. bottom: -220px;
  3830. left: -240px;
  3831. width: 280px;
  3832. height: 270px;
  3833. .rightSlideUserItemMoreMain {
  3834. display: flex;
  3835. align-items: center;
  3836. justify-content: flex-start;
  3837. padding:0 20px;
  3838. .rightSlideUserItemMoreMainIcon {
  3839. img {
  3840. width: 66px;
  3841. height: 66px;
  3842. border-radius: 50%;
  3843. }
  3844. }
  3845. .rightSlideUserItemMoreMainInfo {
  3846. padding: 30px 0 30px 20px;
  3847. border-bottom: 1px solid #E9EDF7;
  3848. flex: 1;
  3849. .rightSlideUserItemMoreMainInfoTop {
  3850. display: flex;
  3851. align-items: center;
  3852. justify-content: space-between;
  3853. .rightSlideUserItemMoreUserName {
  3854. display: flex;
  3855. align-items: center;
  3856. justify-content: center;
  3857. font-size: 18px;
  3858. .rightSlideUserItemMoreUserMore {
  3859. margin-left: 10px;
  3860. img {
  3861. width: 12px;
  3862. height: 12px;
  3863. }
  3864. }
  3865. }
  3866. .rightSlideUserItemMoreUserMoreIcon {
  3867. img {
  3868. width: 18px;
  3869. height: 18px;
  3870. }
  3871. }
  3872. }
  3873. }
  3874. .rightSlideUserItemMoreNumber {
  3875. font-size: 14px;
  3876. color: #999;
  3877. margin-top: 10px;
  3878. }
  3879. }
  3880. .rightSlideUserItemMoreLine {
  3881. .rightSlideUserItemMoreLineItem {
  3882. padding: 20px;
  3883. border-bottom: 1px solid #E9EDF7;
  3884. display: flex;
  3885. .rightSlideUserItemMoreTitle {
  3886. font-size: 16px;
  3887. color: #999;
  3888. width: 80px;
  3889. }
  3890. .rightSlideUserItemMoreText {
  3891. font-size: 16px;
  3892. color: #333;
  3893. display: flex;
  3894. align-items: center;
  3895. justify-content: space-between;
  3896. flex:1;
  3897. }
  3898. }
  3899. .rightSlideUserItemMoreLineButton {
  3900. padding-top: 25px;
  3901. text-align: center;
  3902. font-size: 14px;
  3903. color:#5570F1;
  3904. display: flex;
  3905. align-items: center;
  3906. justify-content: center;
  3907. img {
  3908. width: 25px;
  3909. height: 25px;
  3910. margin-bottom: 8px;
  3911. }
  3912. .rightSlideUserItemMoreLineGroup {
  3913. width: 33.33%;
  3914. }
  3915. }
  3916. }
  3917. }
  3918. .rightSlideUserItemIcon {
  3919. display: flex;
  3920. align-items: center;
  3921. justify-content: center;
  3922. img {
  3923. width: 58px;
  3924. height: 58px;
  3925. border-radius: 50%;
  3926. }
  3927. .el-dropdown-link {
  3928. width: 58px;
  3929. height: 58px;
  3930. position: relative;
  3931. .rightSlideUserGroupLeader{
  3932. font-size: 12px;
  3933. color: #FEAF50;
  3934. background: #FFEAD1;
  3935. width: 36px;
  3936. height: 20px;
  3937. border-radius: 4px;
  3938. position: absolute;
  3939. bottom: 0;
  3940. right: -10px;
  3941. text-align: center;
  3942. line-height: 20px;
  3943. }
  3944. }
  3945. .addUserIcon {
  3946. width: 58px;
  3947. height: 58px;
  3948. line-height: 58px;
  3949. background: #F0F0F0;
  3950. border-radius: 50%;
  3951. text-align: center;
  3952. color:#fff;
  3953. font-size: 32px;
  3954. }
  3955. }
  3956. .rightSlideUserItemName {
  3957. //width: 80px;
  3958. padding: 0 5px;
  3959. font-size: 16px;
  3960. color: #333;
  3961. margin-top: 10px;
  3962. text-align: center;
  3963. white-space: nowrap; /* 强制不换行 */
  3964. overflow: hidden; /* 超出宽度隐藏 */
  3965. text-overflow: ellipsis; /* 显示省略号 */
  3966. }
  3967. }
  3968. }
  3969. .rightLineBorder {
  3970. width: 100%;
  3971. border-bottom: 1px solid #E9EDF7;
  3972. }
  3973. .rightSlideMore {
  3974. padding: 30px 40px;
  3975. font-size: 18px;
  3976. color: #999;
  3977. text-align: center
  3978. }
  3979. //聊天记录
  3980. .rightSlideFunction {
  3981. .rightSlideFunctionItem {
  3982. height: 60px;
  3983. display: flex;
  3984. align-items: center;
  3985. justify-content: space-between;
  3986. padding: 20px 40px;
  3987. border-bottom: 1px solid #E9EDF7;
  3988. cursor: pointer;
  3989. .rightSlideFunctionItemText {
  3990. font-size: 18px;
  3991. color: #333;
  3992. }
  3993. .rightSlideFunctionItemIcon {
  3994. img {
  3995. width: 18px;
  3996. height: 18px;
  3997. }
  3998. }
  3999. }
  4000. }
  4001. //群聊设置
  4002. .groupSystem {
  4003. border-bottom: 1px solid #E9EDF7;
  4004. padding-bottom: 30px;
  4005. .groupChatSystem {
  4006. padding: 30px 40px 0 40px;
  4007. height: 80px;
  4008. overflow: hidden;
  4009. .groupChatTitle {
  4010. font-size: 18px;
  4011. color: #333;
  4012. margin-bottom: 10px;
  4013. }
  4014. .groupChatText {
  4015. width: 100%;
  4016. height: 20px;
  4017. overflow: hidden;
  4018. font-size: 18px;
  4019. color: #999;
  4020. display: flex;
  4021. align-items: center;
  4022. justify-content: space-between;
  4023. img {
  4024. cursor: pointer;
  4025. }
  4026. .groupChatTextContent {
  4027. width: 300px;
  4028. overflow: hidden;
  4029. text-overflow: ellipsis;
  4030. white-space: nowrap;
  4031. }
  4032. }
  4033. }
  4034. }
  4035. .rightSlideFooterBox {
  4036. flex: 1;
  4037. display: flex;
  4038. align-items: center;
  4039. justify-content: space-between;
  4040. div{
  4041. width: 33%;
  4042. text-align: center;
  4043. font-size: 16px;
  4044. color: #666;
  4045. cursor: pointer;
  4046. margin-top: 30px;
  4047. box-sizing: border-box;
  4048. border-right: 1px solid #E9EDF7;
  4049. }
  4050. }
  4051. .rightSlideFooter {
  4052. font-size: 18px;
  4053. color: #666;
  4054. padding: 30px 40px;
  4055. text-align: center;
  4056. cursor: pointer;
  4057. border-bottom: 1px solid #E9EDF7;
  4058. }
  4059. .isLast {
  4060. border-bottom: 0;
  4061. color: #999;
  4062. }
  4063. }
  4064. .newFriendBox{
  4065. height: 400px;
  4066. }
  4067. //右侧
  4068. .hallRight {
  4069. flex: 1;
  4070. background: #fff;
  4071. border-radius: 20px;
  4072. position: relative;
  4073. // min-height: 500px;
  4074. display: flex;
  4075. flex-direction: column;
  4076. position: relative;
  4077. // height: 400px;
  4078. overflow:auto;
  4079. .hallRightLoading {
  4080. position: absolute;
  4081. top: 0;
  4082. left: 0;
  4083. height: 740px;
  4084. width: 100%;
  4085. display: flex;
  4086. align-items: center;
  4087. justify-content: center;
  4088. background: rgba(255, 255, 255, 0.5);
  4089. z-index: 100;
  4090. .hallRightLoadingIcon {
  4091. .hallRightLoadingIconItem {
  4092. color: #CCCCCC;
  4093. text-align: center;
  4094. margin-bottom: 20px;
  4095. font-size: 60px;
  4096. }
  4097. .hallRightLoadingText {
  4098. color: #CCCCCC;
  4099. font-size: 32px;
  4100. font-weight: bold;
  4101. }
  4102. }
  4103. }
  4104. .ifHallRigthNoMessage {
  4105. color: #CCCCCC;
  4106. font-size: 32px;
  4107. font-weight: bold;
  4108. text-align: center;
  4109. height: 740px;
  4110. line-height: 740px;
  4111. }
  4112. .userName {
  4113. font-size: 20px;
  4114. color: #333;
  4115. font-weight: bold;
  4116. }
  4117. .ifNotice {
  4118. padding-bottom: 50px !important;
  4119. }
  4120. .UserNameBox {
  4121. display: flex;
  4122. align-items: center;
  4123. justify-content: space-between;
  4124. padding: 0px 30px 0px 0px;
  4125. border-bottom: 1px solid #E7E7E7;
  4126. position: relative;
  4127. .moreIcon {
  4128. cursor: pointer;
  4129. }
  4130. .groupNotice {
  4131. position: absolute;
  4132. height: 40px;
  4133. line-height: 40px;
  4134. font-size: 16px;
  4135. background:url('../../../assets/chat/notice.png') no-repeat 10px center #F6F8FE;
  4136. // left: 30px;
  4137. box-sizing: border-box;
  4138. padding-left: 40px;
  4139. bottom: 10px;
  4140. color: #999999;
  4141. border-radius: 10px;
  4142. padding-right: 10px;
  4143. width: 400px;
  4144. white-space: nowrap;
  4145. overflow: hidden;
  4146. text-overflow: ellipsis;
  4147. cursor: pointer;
  4148. }
  4149. .shareCardIcon {
  4150. font-size: 24px;
  4151. cursor: pointer;
  4152. color: #666;
  4153. }
  4154. }
  4155. .rightPositionBox {
  4156. flex: 1;
  4157. position: relative;
  4158. .rightUserMessageBox {
  4159. padding: 40px;
  4160. height: 375px;
  4161. box-sizing: border-box;
  4162. overflow-y: auto;
  4163. .timeBox {
  4164. width: 100%;
  4165. display: flex;
  4166. align-items: center;
  4167. justify-content: center;
  4168. padding:0 0 30px 0;
  4169. span {
  4170. border-radius: 8px;
  4171. display: block;
  4172. width: 80px;
  4173. height: 30px;
  4174. line-height: 30px;
  4175. font-size: 14px;
  4176. text-align: center;
  4177. display: block;
  4178. background: #F4F5FA;
  4179. color: #999999;
  4180. }
  4181. }
  4182. .newUserStatus {
  4183. width: 100%;
  4184. display: flex;
  4185. align-items: center;
  4186. justify-content: center;
  4187. padding:0 0 30px 0;
  4188. .newUserStatusText {
  4189. display: flex;
  4190. align-items: center;
  4191. justify-content: center;
  4192. border-radius: 8px;
  4193. width: 200px;
  4194. height: 30px;
  4195. line-height: 30px;
  4196. font-size: 14px;
  4197. text-align: center;
  4198. background: #F4F5FA;
  4199. color: #999999;
  4200. }
  4201. span {
  4202. display: inline-block;
  4203. line-height: 30px;
  4204. }
  4205. .newUserStatusTextName {
  4206. display: inline-block;
  4207. width: 100px;
  4208. line-height: 30px;
  4209. overflow: hidden;
  4210. white-space: nowrap;
  4211. text-overflow: ellipsis;
  4212. }
  4213. }
  4214. //其他用户
  4215. .otherUserMessage {
  4216. display: flex;
  4217. align-items: flex-start;
  4218. margin-bottom: 30px;
  4219. .otherUserIcon {
  4220. margin-right: 20px;
  4221. img {
  4222. width: 58px;
  4223. height: 58px;
  4224. border-radius: 50%;
  4225. }
  4226. }
  4227. .otherUserMessageText {
  4228. border-radius: 16px;
  4229. padding: 16px;
  4230. font-size: 16px;
  4231. color: #fff;
  4232. background: #5570F1;
  4233. position: relative;
  4234. min-height: 50px;
  4235. word-wrap:break-word;
  4236. word-break:break-all;
  4237. }
  4238. .otherUserMessageText::before {
  4239. content: '';
  4240. position: absolute;
  4241. left: -8px;
  4242. top: 26px;
  4243. transform: translateY(-50%);
  4244. width: 0;
  4245. height: 0;
  4246. border-top: 8px solid transparent;
  4247. border-bottom: 8px solid transparent;
  4248. border-right: 8px solid #5570F1;
  4249. }
  4250. }
  4251. //我
  4252. .meUserMessage {
  4253. display: flex;
  4254. align-items: flex-start;
  4255. margin-bottom: 30px;
  4256. justify-content: flex-end;
  4257. .meUserIcon {
  4258. margin-left: 20px;
  4259. img {
  4260. width: 58px;
  4261. height: 58px;
  4262. border-radius: 50%;
  4263. }
  4264. }
  4265. .meUserMessageText {
  4266. border-radius: 16px;
  4267. padding:16px;
  4268. font-size: 16px;
  4269. color:#333;
  4270. background: #FFEAD1;
  4271. position: relative;
  4272. min-height: 50px;
  4273. cursor: pointer;
  4274. word-wrap:break-word;
  4275. word-break:break-all;
  4276. //width: 100%;
  4277. }
  4278. .meUserMessageText::before {
  4279. content: '';
  4280. position: absolute;
  4281. right: -8px;
  4282. top: 26px;
  4283. transform: translateY(-50%);
  4284. width: 0;
  4285. height: 0;
  4286. border-top: 8px solid transparent;
  4287. border-bottom: 8px solid transparent;
  4288. border-left: 8px solid #FFEAD1;
  4289. }
  4290. }
  4291. }
  4292. }
  4293. //消息框
  4294. .sendMessageBox {
  4295. //height: 250px;
  4296. padding: 20px 40px 0 40px;
  4297. border-top: 1px solid #E7E7E7;
  4298. box-sizing: border-box;
  4299. .sendMessageTools {
  4300. display: flex;
  4301. align-items: center;
  4302. justify-content: space-between;
  4303. .toolsBigBox {
  4304. display: flex;
  4305. align-items: center;
  4306. justify-content: space-between;
  4307. .toolsBox {
  4308. display: flex;
  4309. align-items: center;
  4310. justify-content: flex-start;
  4311. img {
  4312. width: 36px;
  4313. height: 36px;
  4314. margin-right: 30px;
  4315. cursor: pointer;
  4316. }
  4317. }
  4318. }
  4319. .fileBox {
  4320. width: 180px;
  4321. display: flex;
  4322. align-items: center;
  4323. border: 1px solid #E9EDF7;
  4324. border-radius: 8px;
  4325. padding: 5px 10px;
  4326. .fileBoxText {
  4327. font-size: 14px;
  4328. color: #999;
  4329. white-space: nowrap;
  4330. overflow: hidden;
  4331. text-overflow: ellipsis;
  4332. width: 110px;
  4333. }
  4334. img {
  4335. width: 40px;
  4336. height: 40px;
  4337. margin-right: 5px;
  4338. }
  4339. }
  4340. }
  4341. .sendMessageInput {
  4342. margin-top: 5px;
  4343. }
  4344. .sendMessageButton {
  4345. padding-top: 20px;
  4346. text-align: right;
  4347. button {
  4348. width: 120px;
  4349. height: 38px;
  4350. }
  4351. }
  4352. }
  4353. //右侧菜单
  4354. .rightSlideBox {
  4355. width: 420px;
  4356. height: 100%;
  4357. position: absolute;
  4358. right: 0;
  4359. top: 0;
  4360. background: #fff;
  4361. box-shadow: -4px 0px 4px 0px rgba(0, 0, 0, 0.1);
  4362. .rightSlideBoxClose {
  4363. padding: 20px 20px 0 20px;
  4364. height: 50px;
  4365. overflow: hidden;
  4366. display: flex;
  4367. align-items: center;
  4368. justify-content: space-between;
  4369. .rightSlideBoxCloseTitle {
  4370. font-size: 18px;
  4371. color: #333;
  4372. }
  4373. .rightSlideBoxCloseIcon {
  4374. cursor: pointer;
  4375. width: 28px;
  4376. height: 28px;
  4377. line-height: 28px;
  4378. text-align: center;
  4379. background: #EFEFEF;
  4380. border-radius: 8px;
  4381. }
  4382. }
  4383. .rightSlideSearch {
  4384. padding: 30px 25px 0 25px;
  4385. height: 66px;
  4386. //overflow: hidden;
  4387. position: relative;
  4388. .searchFriendBox {
  4389. position: absolute;
  4390. width: 280px;
  4391. border-radius: 8px;
  4392. top: 65px;
  4393. left: -260px;
  4394. background: #fff;
  4395. box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.1);
  4396. border-radius: 8px;
  4397. z-index: 100;
  4398. box-sizing: border-box;
  4399. padding: 20px 0 30px 0;
  4400. .searchFriendClose {
  4401. display: flex;
  4402. align-items: center;
  4403. justify-content: flex-end;
  4404. padding-right: 10px;
  4405. padding-bottom: 10px;
  4406. .rightSlideBoxCloseIcon {
  4407. cursor: pointer;
  4408. width: 28px;
  4409. height: 28px;
  4410. line-height: 28px;
  4411. text-align: center;
  4412. background: #EFEFEF;
  4413. border-radius: 8px;
  4414. }
  4415. }
  4416. .searchFriendItem {
  4417. display: flex;
  4418. align-items: center;
  4419. justify-content: flex-start;
  4420. border-bottom: 1px solid #E9EDF7;
  4421. padding: 0 20px 30px 20px;
  4422. .searchFriendAvatar {
  4423. img {
  4424. width: 66px;
  4425. height: 66px;
  4426. border-radius: 50%;
  4427. }
  4428. margin-right: 15px;
  4429. }
  4430. .searchFriendInfo {
  4431. flex: 1;
  4432. .searchFriendName {
  4433. display: flex;
  4434. align-items: center;
  4435. .gender {
  4436. img {
  4437. width: 12px;
  4438. height: 12px;
  4439. }
  4440. }
  4441. img {
  4442. width: 18px;
  4443. height: 18px;
  4444. cursor: pointer;
  4445. }
  4446. .searchFriendNameText {
  4447. font-size: 18px;
  4448. width: 120px;
  4449. height: 28px;
  4450. line-height: 28px;
  4451. white-space: nowrap;
  4452. overflow: hidden;
  4453. text-overflow: ellipsis;
  4454. }
  4455. }
  4456. .searchFriendPhone {
  4457. font-size: 14px;
  4458. color: #999;
  4459. margin-top: 10px;
  4460. }
  4461. }
  4462. }
  4463. .searchFriendLineBox {
  4464. display: flex;
  4465. align-items: center;
  4466. justify-content: flex-start;
  4467. padding: 20px;
  4468. border-bottom: 1px solid #E9EDF7;
  4469. .searchFriendLineTitle{
  4470. font-size: 16px;
  4471. color: #999999;
  4472. width: 90px;
  4473. }
  4474. .searchFriendLineContent{
  4475. font-size: 16px;
  4476. color: #333;
  4477. flex: 1;
  4478. .searchFriendLineContentItem{
  4479. display: flex;
  4480. align-items: center;
  4481. justify-content: space-between;
  4482. }
  4483. }
  4484. }
  4485. .searchFriendButton {
  4486. padding:40px 0 10px 0;
  4487. text-align: center;
  4488. .searchFriendButtonItem {
  4489. font-size: 14px;
  4490. color: #5570F1;
  4491. img {
  4492. width: 30px;
  4493. height: 30px;
  4494. margin-bottom: 5px;
  4495. }
  4496. }
  4497. }
  4498. }
  4499. }
  4500. .rightSlideUserBox {
  4501. box-sizing: border-box;
  4502. padding: 40px 40px 10px 40px;
  4503. height: 180px;
  4504. overflow-y: auto;
  4505. display: flex;
  4506. align-items: center;
  4507. flex-wrap: wrap;
  4508. //border-bottom: 1px solid #E9EDF7;
  4509. .rightEditUserItem {
  4510. cursor: pointer;
  4511. // color: #333;
  4512. // .rightSlideUserItemIcon {
  4513. // .addUserIcon {
  4514. // transition: all 0.5s ease;
  4515. // }
  4516. // .addUserIcon:hover {
  4517. // background: #5570F1;
  4518. // color: #fff;
  4519. // }
  4520. // }
  4521. }
  4522. .rightSlideUserItem {
  4523. margin-bottom: 20px;
  4524. width: 25%;
  4525. position: relative;
  4526. //cursor: pointer;
  4527. //用户菜单
  4528. .rightSlideUserItemMore {
  4529. position: absolute;
  4530. background: #fff;
  4531. box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.1);
  4532. bottom: -220px;
  4533. left: -240px;
  4534. width: 280px;
  4535. height: 270px;
  4536. .rightSlideUserItemMoreMain {
  4537. display: flex;
  4538. align-items: center;
  4539. justify-content: flex-start;
  4540. padding:0 20px;
  4541. .rightSlideUserItemMoreMainIcon {
  4542. img {
  4543. width: 66px;
  4544. height: 66px;
  4545. border-radius: 50%;
  4546. }
  4547. }
  4548. .rightSlideUserItemMoreMainInfo {
  4549. padding: 30px 0 30px 20px;
  4550. border-bottom: 1px solid #E9EDF7;
  4551. flex: 1;
  4552. .rightSlideUserItemMoreMainInfoTop {
  4553. display: flex;
  4554. align-items: center;
  4555. justify-content: space-between;
  4556. .rightSlideUserItemMoreUserName {
  4557. display: flex;
  4558. align-items: center;
  4559. justify-content: center;
  4560. font-size: 18px;
  4561. .rightSlideUserItemMoreUserMore {
  4562. margin-left: 10px;
  4563. img {
  4564. width: 12px;
  4565. height: 12px;
  4566. }
  4567. }
  4568. }
  4569. .rightSlideUserItemMoreUserMoreIcon {
  4570. img {
  4571. width: 18px;
  4572. height: 18px;
  4573. }
  4574. }
  4575. }
  4576. }
  4577. .rightSlideUserItemMoreNumber {
  4578. font-size: 14px;
  4579. color: #999;
  4580. margin-top: 10px;
  4581. }
  4582. }
  4583. .rightSlideUserItemMoreLine {
  4584. .rightSlideUserItemMoreLineItem {
  4585. padding: 20px;
  4586. border-bottom: 1px solid #E9EDF7;
  4587. display: flex;
  4588. .rightSlideUserItemMoreTitle {
  4589. font-size: 16px;
  4590. color: #999;
  4591. width: 80px;
  4592. }
  4593. .rightSlideUserItemMoreText {
  4594. font-size: 16px;
  4595. color: #333;
  4596. display: flex;
  4597. align-items: center;
  4598. justify-content: space-between;
  4599. flex:1;
  4600. }
  4601. }
  4602. .rightSlideUserItemMoreLineButton {
  4603. padding-top: 25px;
  4604. text-align: center;
  4605. font-size: 14px;
  4606. color:#5570F1;
  4607. display: flex;
  4608. align-items: center;
  4609. justify-content: center;
  4610. img {
  4611. width: 25px;
  4612. height: 25px;
  4613. margin-bottom: 8px;
  4614. }
  4615. .rightSlideUserItemMoreLineGroup {
  4616. width: 33.33%;
  4617. }
  4618. }
  4619. }
  4620. }
  4621. .rightSlideUserItemIcon {
  4622. display: flex;
  4623. align-items: center;
  4624. justify-content: center;
  4625. img {
  4626. width: 58px;
  4627. height: 58px;
  4628. border-radius: 50%;
  4629. }
  4630. .el-dropdown-link {
  4631. width: 58px;
  4632. height: 58px;
  4633. position: relative;
  4634. .rightSlideUserGroupLeader{
  4635. font-size: 12px;
  4636. color: #FEAF50;
  4637. background: #FFEAD1;
  4638. width: 36px;
  4639. height: 20px;
  4640. border-radius: 4px;
  4641. position: absolute;
  4642. bottom: 0;
  4643. right: -10px;
  4644. text-align: center;
  4645. line-height: 20px;
  4646. }
  4647. }
  4648. .addUserIcon {
  4649. width: 58px;
  4650. height: 58px;
  4651. line-height: 58px;
  4652. background: #F0F0F0;
  4653. border-radius: 50%;
  4654. text-align: center;
  4655. color:#fff;
  4656. font-size: 32px;
  4657. }
  4658. }
  4659. .rightSlideUserItemName {
  4660. //width: 80px;
  4661. padding: 0 5px;
  4662. font-size: 16px;
  4663. color: #333;
  4664. margin-top: 10px;
  4665. text-align: center;
  4666. white-space: nowrap; /* 强制不换行 */
  4667. overflow: hidden; /* 超出宽度隐藏 */
  4668. text-overflow: ellipsis; /* 显示省略号 */
  4669. }
  4670. }
  4671. }
  4672. .rightLineBorder {
  4673. width: 100%;
  4674. border-bottom: 1px solid #E9EDF7;
  4675. }
  4676. .rightSlideMore {
  4677. padding: 30px 40px;
  4678. font-size: 18px;
  4679. color: #999;
  4680. text-align: center
  4681. }
  4682. //聊天记录
  4683. .rightSlideFunction {
  4684. .rightSlideFunctionItem {
  4685. height: 60px;
  4686. display: flex;
  4687. align-items: center;
  4688. justify-content: space-between;
  4689. padding: 20px 40px;
  4690. border-bottom: 1px solid #E9EDF7;
  4691. cursor: pointer;
  4692. .rightSlideFunctionItemText {
  4693. font-size: 18px;
  4694. color: #333;
  4695. }
  4696. .rightSlideFunctionItemIcon {
  4697. img {
  4698. width: 18px;
  4699. height: 18px;
  4700. }
  4701. }
  4702. }
  4703. }
  4704. //群聊设置
  4705. .groupSystem {
  4706. border-bottom: 1px solid #E9EDF7;
  4707. padding-bottom: 30px;
  4708. .groupChatSystem {
  4709. padding: 30px 40px 0 40px;
  4710. height: 80px;
  4711. overflow: hidden;
  4712. .groupChatTitle {
  4713. font-size: 18px;
  4714. color: #333;
  4715. margin-bottom: 10px;
  4716. }
  4717. .groupChatText {
  4718. width: 100%;
  4719. height: 20px;
  4720. overflow: hidden;
  4721. font-size: 18px;
  4722. color: #999;
  4723. display: flex;
  4724. align-items: center;
  4725. justify-content: space-between;
  4726. img {
  4727. cursor: pointer;
  4728. }
  4729. .groupChatTextContent {
  4730. width: 300px;
  4731. overflow: hidden;
  4732. text-overflow: ellipsis;
  4733. white-space: nowrap;
  4734. }
  4735. }
  4736. }
  4737. }
  4738. .rightSlideFooterBox {
  4739. flex: 1;
  4740. display: flex;
  4741. align-items: center;
  4742. justify-content: space-between;
  4743. div{
  4744. width: 33%;
  4745. text-align: center;
  4746. font-size: 16px;
  4747. color: #666;
  4748. cursor: pointer;
  4749. margin-top: 15px;
  4750. box-sizing: border-box;
  4751. border-right: 1px solid #E9EDF7;
  4752. }
  4753. }
  4754. .rightSlideFooter {
  4755. font-size: 18px;
  4756. color: #666;
  4757. padding: 30px 40px;
  4758. text-align: center;
  4759. cursor: pointer;
  4760. border-bottom: 1px solid #E9EDF7;
  4761. }
  4762. .isLast {
  4763. border-bottom: 0;
  4764. color: #999;
  4765. }
  4766. }
  4767. }
  4768. .chat-dialog{
  4769. margin-top: 5vh !important;
  4770. }
  4771. .list002{
  4772. height: 270px;
  4773. }
  4774. .list001{
  4775. height: 330px;
  4776. }
  4777. .hallBox {
  4778. display: flex;
  4779. // margin: 30px;
  4780. //左侧
  4781. .hallLeft {
  4782. width: 420px;
  4783. background: #fff;
  4784. border-radius: 20px;
  4785. margin-right: 20px;
  4786. .newFriendBox {
  4787. padding: 10px 25px 0 25px;
  4788. font-size: 18px;
  4789. color: #999;
  4790. }
  4791. .newFriendImgBox {
  4792. margin: 10px 0 10px 0;
  4793. padding: 20px 0 20px 25px;
  4794. display: flex;
  4795. align-items: center;
  4796. justify-content: flex-start;
  4797. cursor: pointer;
  4798. border-bottom: 1px solid #E9EDF7;
  4799. position: relative;
  4800. box-sizing: border-box;
  4801. border-right: 4px solid #fff;
  4802. .newFriendImg {
  4803. width: 58px;
  4804. height: 58px;
  4805. border-radius: 8px;
  4806. background: #5570F1;
  4807. display: flex;
  4808. align-items: center;
  4809. justify-content: center;
  4810. margin-right: 20px;
  4811. }
  4812. .newFriendText {
  4813. color: #333;
  4814. font-size: 18px;
  4815. display: flex;
  4816. align-items: center;
  4817. justify-content: space-between;
  4818. flex: 1;
  4819. span {
  4820. background: #5570F1;
  4821. color: #fff;
  4822. line-height: 24px;
  4823. font-size: 12px;
  4824. width: 24px;
  4825. height: 24px;
  4826. text-align: center;
  4827. border-radius: 50%;
  4828. display: block;
  4829. margin-right: 20px;
  4830. }
  4831. }
  4832. }
  4833. .newFriendIActive {
  4834. border-right: 4px solid #5570F1 !important;
  4835. background: #F5F7FD
  4836. }
  4837. .searchFriendBox {
  4838. position: absolute;
  4839. width: 280px;
  4840. border-radius: 8px;
  4841. top: 0;
  4842. right: -300px;
  4843. background: #fff;
  4844. box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.1);
  4845. border-radius: 8px;
  4846. z-index: 100;
  4847. box-sizing: border-box;
  4848. padding: 30px 0;
  4849. .searchFriendItem {
  4850. display: flex;
  4851. align-items: center;
  4852. justify-content: flex-start;
  4853. border-bottom: 1px solid #E9EDF7;
  4854. padding: 0 20px 30px 20px;
  4855. .searchFriendAvatar {
  4856. img {
  4857. width: 66px;
  4858. height: 66px;
  4859. border-radius: 50%;
  4860. }
  4861. margin-right: 15px;
  4862. }
  4863. .searchFriendInfo {
  4864. flex: 1;
  4865. .searchFriendName {
  4866. display: flex;
  4867. align-items: center;
  4868. .gender {
  4869. img {
  4870. width: 12px;
  4871. height: 12px;
  4872. }
  4873. }
  4874. img {
  4875. width: 18px;
  4876. height: 18px;
  4877. cursor: pointer;
  4878. }
  4879. .searchFriendNameText {
  4880. font-size: 18px;
  4881. width: 120px;
  4882. height: 28px;
  4883. line-height: 28px;
  4884. white-space: nowrap;
  4885. overflow: hidden;
  4886. text-overflow: ellipsis;
  4887. }
  4888. }
  4889. .searchFriendPhone {
  4890. font-size: 14px;
  4891. color: #999;
  4892. margin-top: 10px;
  4893. }
  4894. }
  4895. }
  4896. .searchFriendLineBox {
  4897. display: flex;
  4898. align-items: center;
  4899. justify-content: flex-start;
  4900. padding: 20px;
  4901. border-bottom: 1px solid #E9EDF7;
  4902. .searchFriendLineTitle{
  4903. font-size: 16px;
  4904. color: #999999;
  4905. width: 90px;
  4906. }
  4907. .searchFriendLineContent{
  4908. font-size: 16px;
  4909. color: #333;
  4910. flex: 1;
  4911. .searchFriendLineContentItem{
  4912. display: flex;
  4913. align-items: center;
  4914. justify-content: space-between;
  4915. }
  4916. }
  4917. }
  4918. .searchFriendButton {
  4919. padding:40px 0 10px 0;
  4920. text-align: center;
  4921. .searchFriendButtonItem {
  4922. font-size: 14px;
  4923. color: #5570F1;
  4924. img {
  4925. width: 30px;
  4926. height: 30px;
  4927. margin-bottom: 5px;
  4928. }
  4929. }
  4930. }
  4931. }
  4932. .userListTitle {
  4933. padding: 15px 25px;
  4934. font-size: 18px;
  4935. color: #999;
  4936. }
  4937. .searchBox {
  4938. padding-left: 25px;
  4939. padding-right: 25px;
  4940. padding-bottom: 20px;
  4941. }
  4942. .userListBox {
  4943. padding: 15px 0;
  4944. overflow-y: auto;
  4945. height: 380px;
  4946. .active {
  4947. background: #F5F7FD;
  4948. box-sizing: border-box;
  4949. border-right: 4px solid #5570F1 !important;
  4950. }
  4951. .userItem {
  4952. padding: 0 21px 0 25px;
  4953. display: flex;
  4954. align-items: center;
  4955. justify-content: space-between;
  4956. height: 90px;
  4957. box-sizing: border-box;
  4958. border-right: 4px solid #fff;
  4959. cursor: pointer;
  4960. .userAvatar {
  4961. img {
  4962. width: 38px;
  4963. height: 38px;
  4964. border-radius: 50%;
  4965. }
  4966. }
  4967. .userInfo {
  4968. flex: 1;
  4969. box-sizing: border-box;
  4970. padding-left: 15px;
  4971. .userName {
  4972. display: flex;
  4973. align-items: center;
  4974. justify-content: space-between;
  4975. .userNameText {
  4976. font-size: 18px;
  4977. font-weight: bold;
  4978. width: 240px;
  4979. white-space: nowrap;
  4980. overflow: hidden;
  4981. text-overflow: ellipsis;
  4982. color: #333;
  4983. }
  4984. .userMessageNum {
  4985. font-size: 12px;
  4986. color: #333;
  4987. width: 24px;
  4988. height: 24px;
  4989. line-height: 24px;
  4990. text-align: center;
  4991. border-radius: 50%;
  4992. background: #FFCC91;
  4993. font-weight: bold;
  4994. }
  4995. }
  4996. .userMessage {
  4997. display: flex;
  4998. align-items: center;
  4999. justify-content: space-between;
  5000. .userMessageText {
  5001. display: block;
  5002. width: 240px;
  5003. white-space: nowrap;
  5004. overflow: hidden;
  5005. text-overflow: ellipsis;
  5006. font-size: 14px;
  5007. color: #999999;
  5008. }
  5009. .userMessageTime {
  5010. font-size: 14px;
  5011. color: #999999;
  5012. }
  5013. }
  5014. }
  5015. }
  5016. }
  5017. }
  5018. //右侧
  5019. .hallRight {
  5020. flex: 1;
  5021. background: #fff;
  5022. border-radius: 0px;
  5023. position: relative;
  5024. // height: 740px;
  5025. .rightNewFriendBox {
  5026. height: 126px;
  5027. border-bottom: 1px solid #E9EDF7;
  5028. display: flex;
  5029. align-items: center;
  5030. justify-content: space-between;
  5031. box-sizing: border-box;
  5032. padding: 30px 40px;
  5033. .rightNewFriendItem {
  5034. display: flex;
  5035. align-items: center;
  5036. .rightNewFriendAvatar {
  5037. margin-right: 15px;
  5038. img {
  5039. width: 66px;
  5040. height: 66px;
  5041. border-radius: 50%;
  5042. }
  5043. }
  5044. .rightNewFriendInfo {
  5045. .rightNewFriendName {
  5046. font-size: 18px;
  5047. margin-bottom: 7px;
  5048. }
  5049. .rightNewFriendPhone {
  5050. font-size: 18px;
  5051. color: #999;
  5052. }
  5053. }
  5054. }
  5055. .rightNewFriendStatus {
  5056. .rightNewFriendStatus1 {
  5057. font-size: 16px;
  5058. color: #999;
  5059. width: 69px;
  5060. text-align: center;
  5061. }
  5062. }
  5063. }
  5064. .userInfoMainBox {
  5065. // padding: 40px;
  5066. // max-width: 900px;
  5067. // margin: 100px auto 0 auto;
  5068. .userInfoMainItem {
  5069. display: flex;
  5070. align-items: center;
  5071. justify-content: flex-start;
  5072. border-bottom: 1px solid #E9EDF7;
  5073. padding: 0 20px 30px 20px;
  5074. .userInfoMainAvatar {
  5075. img {
  5076. width: 66px;
  5077. height: 66px;
  5078. border-radius: 50%;
  5079. }
  5080. margin-right: 15px;
  5081. }
  5082. .userInfoMainInfo {
  5083. flex: 1;
  5084. .userInfoMainName {
  5085. display: flex;
  5086. align-items: center;
  5087. justify-content: space-between;
  5088. img {
  5089. width: 18px;
  5090. height: 18px;
  5091. cursor: pointer;
  5092. }
  5093. .userInfoMainNameText {
  5094. font-size: 18px;
  5095. width: 240px;
  5096. height: 28px;
  5097. line-height: 28px;
  5098. white-space: nowrap;
  5099. overflow: hidden;
  5100. text-overflow: ellipsis;
  5101. }
  5102. }
  5103. .userInfoMainPhone {
  5104. font-size: 14px;
  5105. color: #999;
  5106. margin-top: 10px;
  5107. }
  5108. }
  5109. }
  5110. .userInfoMainLineBox {
  5111. display: flex;
  5112. align-items: center;
  5113. justify-content: flex-start;
  5114. padding: 20px;
  5115. border-bottom: 1px solid #E9EDF7;
  5116. .userInfoMainLineTitle{
  5117. font-size: 16px;
  5118. color: #999999;
  5119. width: 90px;
  5120. }
  5121. .userInfoMainLineContent{
  5122. font-size: 16px;
  5123. color: #333;
  5124. flex: 1;
  5125. .userInfoMainLineContentItem{
  5126. display: flex;
  5127. align-items: center;
  5128. justify-content: space-between;
  5129. cursor: pointer;
  5130. }
  5131. }
  5132. }
  5133. .userInfoMainButton {
  5134. padding:40px 0 10px 0;
  5135. text-align: center;
  5136. .userInfoMainButtonItem {
  5137. font-size: 14px;
  5138. color: #5570F1;
  5139. img {
  5140. width: 30px;
  5141. height: 30px;
  5142. margin-bottom: 5px;
  5143. }
  5144. }
  5145. }
  5146. }
  5147. .ifHallRigthNoMessage {
  5148. color: #CCCCCC;
  5149. font-size: 32px;
  5150. font-weight: bold;
  5151. text-align: center;
  5152. height: 740px;
  5153. line-height: 740px;
  5154. }
  5155. .userName {
  5156. font-size: 20px;
  5157. color: #333;
  5158. font-weight: bold;
  5159. }
  5160. .ifNotice {
  5161. padding-bottom: 60px !important;
  5162. }
  5163. .UserNameBox {
  5164. display: flex;
  5165. align-items: center;
  5166. justify-content: space-between;
  5167. // padding: 40px 30px 30px 30px;
  5168. border-bottom: 1px solid #E7E7E7;
  5169. position: relative;
  5170. .moreIcon {
  5171. cursor: pointer;
  5172. }
  5173. .groupNotice {
  5174. position: absolute;
  5175. height: 40px;
  5176. line-height: 40px;
  5177. font-size: 16px;
  5178. background:url('~@/assets/chat/notice.png') no-repeat 10px center #F6F8FE;
  5179. left: 30px;
  5180. box-sizing: border-box;
  5181. padding-left: 40px;
  5182. bottom: 10px;
  5183. color: #999999;
  5184. border-radius: 10px;
  5185. padding-right: 10px;
  5186. width: 400px;
  5187. white-space: nowrap;
  5188. overflow: hidden;
  5189. text-overflow: ellipsis;
  5190. }
  5191. }
  5192. }
  5193. }
  5194. .searchWindow {
  5195. display: flex;
  5196. .searchWindowLeft {
  5197. width: 330px;
  5198. box-sizing: border-box;
  5199. border-right: 1px solid #E9EDF7;
  5200. padding-right: 25px;
  5201. .searchUserWindowBox {
  5202. position: relative;
  5203. .searchFriendClose {
  5204. display: flex;
  5205. align-items: center;
  5206. justify-content: flex-end;
  5207. padding-right: 10px;
  5208. padding-bottom: 10px;
  5209. .rightSlideBoxCloseIcon {
  5210. cursor: pointer;
  5211. width: 28px;
  5212. height: 28px;
  5213. line-height: 28px;
  5214. text-align: center;
  5215. background: #EFEFEF;
  5216. border-radius: 8px;
  5217. }
  5218. }
  5219. .searchFriendBox {
  5220. position: absolute;
  5221. width: 280px;
  5222. border-radius: 8px;
  5223. top: 0;
  5224. right: -280px;
  5225. background: #fff;
  5226. box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.1);
  5227. border-radius: 8px;
  5228. z-index: 100;
  5229. box-sizing: border-box;
  5230. padding: 20px 0 30px 0;
  5231. .searchFriendItem {
  5232. display: flex;
  5233. align-items: center;
  5234. justify-content: flex-start;
  5235. border-bottom: 1px solid #E9EDF7;
  5236. padding: 0 20px 30px 20px;
  5237. .searchFriendAvatar {
  5238. img {
  5239. width: 66px;
  5240. height: 66px;
  5241. border-radius: 50%;
  5242. }
  5243. margin-right: 15px;
  5244. }
  5245. .searchFriendInfo {
  5246. flex: 1;
  5247. .searchFriendName {
  5248. display: flex;
  5249. align-items: center;
  5250. .gender {
  5251. img {
  5252. width: 12px;
  5253. height: 12px;
  5254. }
  5255. }
  5256. img {
  5257. width: 18px;
  5258. height: 18px;
  5259. cursor: pointer;
  5260. }
  5261. .searchFriendNameText {
  5262. font-size: 18px;
  5263. width: 120px;
  5264. height: 28px;
  5265. line-height: 28px;
  5266. white-space: nowrap;
  5267. overflow: hidden;
  5268. text-overflow: ellipsis;
  5269. }
  5270. }
  5271. .searchFriendPhone {
  5272. font-size: 14px;
  5273. color: #999;
  5274. margin-top: 10px;
  5275. }
  5276. }
  5277. }
  5278. .searchFriendLineBox {
  5279. display: flex;
  5280. align-items: center;
  5281. justify-content: flex-start;
  5282. padding: 20px;
  5283. border-bottom: 1px solid #E9EDF7;
  5284. .searchFriendLineTitle{
  5285. font-size: 16px;
  5286. color: #999999;
  5287. width: 90px;
  5288. }
  5289. .searchFriendLineContent{
  5290. font-size: 16px;
  5291. color: #333;
  5292. flex: 1;
  5293. .searchFriendLineContentItem{
  5294. display: flex;
  5295. align-items: center;
  5296. justify-content: space-between;
  5297. }
  5298. }
  5299. }
  5300. .searchFriendButton {
  5301. padding:40px 0 10px 0;
  5302. text-align: center;
  5303. .searchFriendButtonItem {
  5304. font-size: 14px;
  5305. color: #5570F1;
  5306. img {
  5307. width: 30px;
  5308. height: 30px;
  5309. margin-bottom: 5px;
  5310. }
  5311. }
  5312. }
  5313. }
  5314. }
  5315. .searchUserBox {
  5316. padding-top: 30px;
  5317. .searchNameEnglish {
  5318. font-size: 18px;
  5319. color: #999;
  5320. padding: 30px 0 20px 0;
  5321. }
  5322. .searchUserItem {
  5323. display: flex;
  5324. align-items: center;
  5325. margin-bottom: 20px;
  5326. .searchUserName {
  5327. font-size: 18px;
  5328. font-weight: bold;
  5329. color: #333;
  5330. }
  5331. img {
  5332. width: 38px;
  5333. height: 38px;
  5334. border-radius: 50%;
  5335. margin: 0 20px;
  5336. }
  5337. }
  5338. }
  5339. }
  5340. .searchWindowRight {
  5341. width: 690px;
  5342. .searchWindowRightTop {
  5343. display: flex;
  5344. align-items: center;
  5345. justify-content: space-between;
  5346. padding: 0 30px 30px 30px;
  5347. .searchWindowRightTitle {
  5348. font-size: 18px;
  5349. color: #333;
  5350. }
  5351. .searchWindowRightNum {
  5352. font-size: 18px;
  5353. color: #999;
  5354. }
  5355. }
  5356. .searchWindowUserList {
  5357. padding: 0 30px;
  5358. height: 400px;
  5359. display: flex;
  5360. flex-wrap: wrap;
  5361. align-items: flex-start;
  5362. align-content: flex-start;
  5363. .searchWindowUserItem {
  5364. width:20%;
  5365. text-align: center;
  5366. margin-bottom: 30px;
  5367. .searchWindowUserName {
  5368. font-size: 18px;
  5369. color: #333;
  5370. font-weight: bold;
  5371. width: 122px;
  5372. white-space: nowrap; /* 强制不换行 */
  5373. overflow: hidden; /* 超出宽度隐藏 */
  5374. text-overflow: ellipsis; /* 显示省略号 */
  5375. }
  5376. .searchWindowUserIcon {
  5377. width: 58px;
  5378. height: 58px;
  5379. position: relative;
  5380. margin: 0 auto 10px auto;
  5381. .searchWindowDeleteUser {
  5382. position: absolute;
  5383. width: 15px;
  5384. height: 15px;
  5385. background: rgba(0,0,0,0.3);
  5386. border-radius: 5px;
  5387. color: #fff;
  5388. right: -3px;
  5389. top: -3px;
  5390. cursor: pointer;
  5391. }
  5392. .rightSlideUserGroupLeader{
  5393. font-size: 12px;
  5394. color: #FEAF50;
  5395. background: #FFEAD1;
  5396. width: 36px;
  5397. height: 20px;
  5398. border-radius: 4px;
  5399. position: absolute;
  5400. bottom: 0;
  5401. right: -10px;
  5402. text-align: center;
  5403. line-height: 20px;
  5404. }
  5405. img {
  5406. width: 58px;
  5407. height: 58px;
  5408. border-radius: 50%;
  5409. margin-bottom: 10px;
  5410. }
  5411. }
  5412. }
  5413. }
  5414. .shareCardBox {
  5415. border-top: 1px solid #E9EDF7;
  5416. .shareCardTitle {
  5417. padding: 30px;
  5418. }
  5419. .shareCardInput {
  5420. padding: 0 30px 0 30px;
  5421. }
  5422. }
  5423. .searchWindowFooter {
  5424. text-align: center;
  5425. padding-top: 30px;
  5426. }
  5427. }
  5428. }
  5429. .shareCardWindowBox{
  5430. .shareCardWindowBoxMain {
  5431. border: 1px solid #E9EDF7;
  5432. border-top: none;
  5433. border-bottom-left-radius: 4px;
  5434. border-bottom-right-radius: 4px;
  5435. background: #F5F7FB;
  5436. padding-left: 14px;
  5437. padding: 10px;
  5438. }
  5439. .shareCardRadioBox {
  5440. height: 50px;
  5441. display: flex;
  5442. align-items: center;
  5443. justify-content: flex-start;
  5444. >.el-radio {
  5445. margin-right: 5px;
  5446. }
  5447. }
  5448. .shareCardItem{
  5449. display: flex;
  5450. align-items: center;
  5451. justify-content: flex-start;
  5452. .shareCardName {
  5453. font-size: 14px;
  5454. color: #333;
  5455. margin-left: 10px;
  5456. }
  5457. img {
  5458. width: 38px;
  5459. height: 38px;
  5460. border-radius: 50%;
  5461. }
  5462. }
  5463. }
  5464. //弹出框底部按钮
  5465. .footerButtonBox {
  5466. padding-top: 40px;
  5467. text-align: center;
  5468. }
  5469. //聊天记录弹出框
  5470. .fileWindow {
  5471. .fileWindowHeader {
  5472. margin-bottom: 20px;
  5473. }
  5474. .fileWindowMessageTime {
  5475. width: 100px;
  5476. height: 37px;
  5477. line-height: 37px;
  5478. text-align: center;
  5479. background: #F4F5FA;
  5480. border-radius: 8px;
  5481. font-size: 14px;
  5482. color: #999999;
  5483. margin-top: 30px;
  5484. }
  5485. .fileWindowMessageScrollBox {
  5486. height: 500px;
  5487. overflow-y: auto;
  5488. }
  5489. .fileWindowNoMessage {
  5490. font-size: 18px;
  5491. color: #999;
  5492. text-align: center;
  5493. height: 500px;
  5494. line-height: 500px;
  5495. }
  5496. .fileWindowMessageItemBox {
  5497. display: flex;
  5498. align-items: flex-start;
  5499. .active {
  5500. background: #F5F7FD;
  5501. border-right: 4px solid #5570F1 !important;
  5502. }
  5503. .historicalMessageBox {
  5504. width: 100%;
  5505. display: flex;
  5506. align-items: flex-start;
  5507. padding: 30px 0 20px 0;
  5508. border-bottom: 1px solid #E9EDF7;
  5509. }
  5510. .fileWindowMessageItemIcon {
  5511. img {
  5512. width: 58px;
  5513. height: 58px;
  5514. border-radius: 50%;
  5515. }
  5516. }
  5517. .fileWindowMessageItemIcon {
  5518. padding-right: 15px;
  5519. }
  5520. .fileWindowMessageItem {
  5521. flex: 1;
  5522. .fileWindowMessageItemInfo {
  5523. display: flex;
  5524. align-items: center;
  5525. justify-content: space-between;
  5526. padding-bottom: 20px;
  5527. .fileWindowMessageItemName {
  5528. font-size: 18px;
  5529. color: #333;
  5530. }
  5531. .fileWindowMessageItemTime {
  5532. font-size: 14px;
  5533. color: #999;
  5534. }
  5535. }
  5536. .fileWindowMessageItemText {
  5537. font-size: 14px;
  5538. color: #999;
  5539. }
  5540. .fileWindowMessageItemImage {
  5541. width: 150px;
  5542. height: 150px;
  5543. border-radius: 16px;
  5544. border: 1px solid #ECECEC;
  5545. }
  5546. }
  5547. }
  5548. //文件列表
  5549. .fileWindowFlieBox {
  5550. .fileWindowFlieItem {
  5551. padding:30px 0 20px 0;
  5552. display: flex;
  5553. align-items: center;
  5554. border-bottom: 1px solid #E9EDF7;
  5555. .fileWindowFlieItemIcon {
  5556. margin-right: 10px;
  5557. img {
  5558. width: 42px;
  5559. height: 42px;
  5560. }
  5561. }
  5562. .fileWindowFlieItemMain {
  5563. flex: 1;
  5564. .fileWindowFlieItemTitle {
  5565. display: flex;
  5566. align-items: center;
  5567. justify-content: space-between;
  5568. font-size: 16px;
  5569. color: #333;
  5570. margin-bottom: 6px;
  5571. }
  5572. .fileWindowFlieItemTime {
  5573. font-size: 14px;
  5574. color: #999;
  5575. }
  5576. .fileWindowFlieInfo {
  5577. display: flex;
  5578. align-items: center;
  5579. justify-content: space-between;
  5580. font-size: 12px;
  5581. color: #999;
  5582. }
  5583. }
  5584. }
  5585. }
  5586. //图片列表
  5587. .fileWindowImageBox {
  5588. display: flex;
  5589. flex-wrap: wrap;
  5590. div {
  5591. width: 25%;
  5592. text-align: center;
  5593. padding: 20px 0 0 0;
  5594. }
  5595. img {
  5596. width: 150px;
  5597. height: 150px;
  5598. border-radius: 16px;
  5599. border: 1px solid #ECECEC;
  5600. }
  5601. }
  5602. //日期���索
  5603. .fileWindowDateBox {
  5604. width: 100%;
  5605. padding: 30px 0;
  5606. }
  5607. .fileWindowDateButton {
  5608. margin-left: 10px;
  5609. }
  5610. //群成员搜索
  5611. .fileWindowGroupMain{
  5612. display: flex;
  5613. .fileWindowGroupUserLeft {
  5614. flex: 1;
  5615. box-sizing: border-box;
  5616. padding-right: 20px;
  5617. }
  5618. .fileWindowGroupUserRight {
  5619. width: 300px;
  5620. .fileWindowGroupUserBox {
  5621. padding: 30px 0;
  5622. .searchUserBox {
  5623. .searchNameEnglish {
  5624. font-size: 18px;
  5625. color: #999;
  5626. padding: 30px 0 20px 0;
  5627. }
  5628. .searchUserItem {
  5629. display: flex;
  5630. align-items: center;
  5631. .searchUserName {
  5632. font-size: 18px;
  5633. font-weight: bold;
  5634. color: #333;
  5635. }
  5636. img {
  5637. width: 38px;
  5638. height: 38px;
  5639. border-radius: 50%;
  5640. margin: 0 20px 0 0;
  5641. }
  5642. }
  5643. }
  5644. }
  5645. }
  5646. }
  5647. }
  5648. //发送文件
  5649. .messageTypeFile {
  5650. width: 283px;
  5651. background: #fff;
  5652. border-radius: 16px;
  5653. border: 1px solid #E9EDF7;
  5654. cursor:pointer;
  5655. .messageTypeFileTop{
  5656. border-bottom: 1px solid #E9EDF7;
  5657. .messageTypeFileSize {
  5658. padding: 10px 20px 10px 20px;
  5659. }
  5660. .messageTypeFileInfo {
  5661. display: flex;
  5662. align-items: center;
  5663. padding:20px 20px 20px 20px;
  5664. .messageTypeFileTitle {
  5665. font-size: 16px;
  5666. color: #333;
  5667. height: auto; /* Allow height to adjust */
  5668. max-height: 48px; /* Maximum height for two lines (16px * 2) */
  5669. overflow: hidden; /* Hide overflow */
  5670. text-overflow: ellipsis; /* Show ellipsis for overflow text */
  5671. display: -webkit-box; /* Use flexbox for multi-line ellipsis */
  5672. -webkit-box-orient: vertical; /* Set box orientation to vertical */
  5673. -webkit-line-clamp: 2; /* Limit to 2 lines */
  5674. white-space: normal; /* Allow text wrapping */
  5675. width: 200px;
  5676. }
  5677. .messageTypeFileIcon {
  5678. img {
  5679. width: 42px;
  5680. height: 42px;
  5681. }
  5682. }
  5683. }
  5684. }
  5685. .messageTypeFileLogo {
  5686. padding:15px 20px;
  5687. }
  5688. .messageTypeFileSize {
  5689. font-size: 12px;
  5690. color: #999;
  5691. }
  5692. .messageTypeFileLogo {
  5693. font-size: 12px;
  5694. color: #999;
  5695. }
  5696. }
  5697. //发送名片
  5698. .messageTypeCard {
  5699. width: 321px;
  5700. background: #fff;
  5701. border-radius: 16px;
  5702. border: 1px solid #E9EDF7;
  5703. .messageTypeCardTop {
  5704. display: flex;
  5705. align-items: center;
  5706. padding: 20px 20px 24px 20px;
  5707. border-bottom: 1px solid #E9EDF7;
  5708. .messageTypeCardIcon {
  5709. margin-right: 15px;
  5710. img {
  5711. width: 58px;
  5712. height: 58px;
  5713. border-radius: 50%;
  5714. }
  5715. }
  5716. .messageTypeCardName {
  5717. font-size: 16px;
  5718. color: #333;
  5719. }
  5720. }
  5721. .messageTypeCardText {
  5722. padding-top: 14px;
  5723. padding-left: 20px;
  5724. padding-bottom: 15px;
  5725. font-size: 12px;
  5726. color: #999999;
  5727. }
  5728. }
  5729. //发送图片
  5730. .messageTypeImage {
  5731. width: 200px;
  5732. //height: 200px;
  5733. img {
  5734. max-width: 200px;
  5735. border-radius: 16px;
  5736. border: 1px solid #ECECEC;
  5737. }
  5738. }
  5739. //发送群聊
  5740. .messageGroupInvite {
  5741. background: #fff;
  5742. border-radius: 16px;
  5743. border: 1px solid #E9EDF7;
  5744. .messageGroupInviteTop {
  5745. display: flex;
  5746. align-items: center;
  5747. justify-content: space-between;
  5748. padding: 20px 20px 24px 20px;
  5749. .messageGroupInviteIcon {
  5750. margin-right: 15px;
  5751. img {
  5752. width: 58px;
  5753. height: 58px;
  5754. border-radius: 50%;
  5755. }
  5756. }
  5757. .messageGroupInfoText {
  5758. .messageGroupInfoTextTitle {
  5759. font-size: 16px;
  5760. color: #333;
  5761. margin-bottom: 5px;
  5762. }
  5763. .messageGroupInfoTextTxt {
  5764. font-size: 12px;
  5765. color: #999;
  5766. line-height: 18px;
  5767. }
  5768. }
  5769. }
  5770. .messageGroupInviteText {
  5771. padding-top: 14px;
  5772. padding-left: 20px;
  5773. padding-bottom: 15px;
  5774. font-size: 12px;
  5775. color: #999999;
  5776. border-top: 1px solid #E9EDF7;
  5777. }
  5778. }
  5779. //加入群聊弹出框
  5780. .addGroupWindow {
  5781. .addGroupWindowImg {
  5782. img {
  5783. width:58px;
  5784. height: 58px;
  5785. }
  5786. text-align: center;
  5787. font-size: 18px;
  5788. color: #333;
  5789. }
  5790. .addGroupWindowTitle {
  5791. font-size: 18px;
  5792. color: #333;
  5793. text-align: center;
  5794. padding: 20px 0 40px 0;
  5795. }
  5796. .addGroupWindowText {
  5797. font-size: 12px;
  5798. color: #999;
  5799. text-align: center;
  5800. }
  5801. }
  5802. .searchFriendBox {
  5803. .searchFriendItem {
  5804. display: flex;
  5805. align-items: center;
  5806. justify-content: flex-start;
  5807. border-bottom: 1px solid #E9EDF7;
  5808. padding: 0 20px 30px 20px;
  5809. .searchFriendAvatar {
  5810. img {
  5811. width: 66px;
  5812. height: 66px;
  5813. border-radius: 50%;
  5814. }
  5815. margin-right: 15px;
  5816. }
  5817. .searchFriendInfo {
  5818. flex: 1;
  5819. .searchFriendName {
  5820. display: flex;
  5821. align-items: center;
  5822. .gender {
  5823. img {
  5824. width: 12px;
  5825. height: 12px;
  5826. }
  5827. }
  5828. img {
  5829. width: 18px;
  5830. height: 18px;
  5831. cursor: pointer;
  5832. }
  5833. .searchFriendNameText {
  5834. font-size: 18px;
  5835. width: 120px;
  5836. height: 28px;
  5837. line-height: 28px;
  5838. white-space: nowrap;
  5839. overflow: hidden;
  5840. text-overflow: ellipsis;
  5841. }
  5842. }
  5843. .searchFriendPhone {
  5844. font-size: 14px;
  5845. color: #999;
  5846. margin-top: 10px;
  5847. }
  5848. }
  5849. }
  5850. .searchFriendLineBox {
  5851. display: flex;
  5852. align-items: center;
  5853. justify-content: flex-start;
  5854. padding: 20px;
  5855. border-bottom: 1px solid #E9EDF7;
  5856. .searchFriendLineTitle{
  5857. font-size: 16px;
  5858. color: #999999;
  5859. width: 90px;
  5860. }
  5861. .searchFriendLineContent{
  5862. font-size: 16px;
  5863. color: #333;
  5864. flex: 1;
  5865. .searchFriendLineContentItem{
  5866. display: flex;
  5867. align-items: center;
  5868. justify-content: space-between;
  5869. }
  5870. }
  5871. }
  5872. .searchFriendButton {
  5873. padding:40px 0 10px 0;
  5874. text-align: center;
  5875. .searchFriendButtonItem {
  5876. font-size: 14px;
  5877. color: #5570F1;
  5878. img {
  5879. width: 30px;
  5880. height: 30px;
  5881. margin-bottom: 5px;
  5882. }
  5883. }
  5884. }
  5885. }
  5886. .nodata{
  5887. margin: 0 auto;
  5888. text-align: center;
  5889. font-size: 18px;
  5890. height: 400px;
  5891. line-height: 400px;
  5892. }
  5893. </style>