| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133 |
- <template>
- <div class="message flex align-center justify-center" @click.stop="closeDialog()">
- <!-- 消息主体 -->
- <div class="content flex align-center justify-between">
- <!-- 左侧聊天列表 -->
- <div class="content-l flex align-center justify-center">
- <div class="content-l-box flex algin-center justify-center flex-wrap">
- <div class="content-l-box-items" :class="selectIndex==1?'megActive':''" @click="getSysMsgList(true)"
- v-for="(item,index) in msgList" :key="index">
- <div class="content-l-box-item flex justify-between">
- <div class="content-l-box-item-l flex align-center">
- <img src="/images/message/sysIcon.png" alt="" srcset="" />
- <div class="content-l-box-item-con">
- <div class="content-l-box-item-con-title">
- {{item.title?item.title: '系统消息'}}
- </div>
- <div class="content-l-box-item-con-cons">
- {{item.content}}
- </div>
- </div>
- </div>
- <div class="content-l-box-item-r">
- <div v-if="messageCount>0"
- class="content-l-box-item-r-dian flex align-center justify-center">
- {{messageCount}}
- </div>
- </div>
- </div>
- </div>
- <!-- <div class="content-l-box-items">
- <div class="content-l-box-item flex justify-between">
- <div class="content-l-box-item-l flex align-center">
- <img src="/images/message/kefuIcon.png" alt="" srcset="" />
- <div class="content-l-box-item-con">
- <div class="content-l-box-item-con-title">
- 在线客服
- </div>
- <div class="content-l-box-item-con-cons">
- 联系在线客服
- </div>
- </div>
- </div>
- <div class="content-l-box-item-r">
- <div v-if="userCount>0"
- class="content-l-box-item-r-dian flex align-center justify-center">
- {{userCount}}
- </div>
- </div>
- </div>
- </div> -->
- <div class="content-l-box-items" :class="liftIndex==index?'megActive':''"
- @click.stop="startMsg(item,index)" v-for="(item,index) in leftList" :key="index">
- <div class="content-l-box-item flex justify-between">
- <div class="content-l-box-item-l flex align-center">
- <img :src="item.avatar?item.avatar:'/default.jpg'" alt="" srcset="" />
- <div class="content-l-box-item-con">
- <div class="content-l-box-item-con-title flex algin-center">
- {{item.userName}}
- <span>
- {{item.stationName}}
- </span>
- </div>
- <div v-if="item.messageType == 1" class="content-l-box-item-con-cons">
- {{item.content}}
- </div>
- <div v-else-if="item.messageType == 18" class="content-l-box-item-con-cons">
- 位置
- </div>
- <div v-else-if="item.messageType == 9" class="content-l-box-item-con-cons">
- 简历请求
- </div>
- <div v-else-if="item.messageType == 6" class="content-l-box-item-con-cons">
- 微信请求
- </div>
- <div v-else-if="item.messageType == 5" class="content-l-box-item-con-cons">
- 手机号请求
- </div>
- <div v-else-if="item.messageType == 99" class="content-l-box-item-con-cons">
- [面试邀约]
- </div>
- <div v-else-if="item.messageType == 96 || item.messageType == 97" class="content-l-box-item-con-cons">
- [{{ item.content }}]
- </div>
- <div v-else class="content-l-box-item-con-cons">
- [图片]
- </div>
- </div>
- </div>
- <div class="content-l-box-item-r" style="flex-shrink: 0;">
- {{item.messageTime? getDateDiff(item.messageTime):''}}
- <div class="flex justify-end delete-btn" style="margin-top: 5px;" @click="deleteMsg(item)">
- 删除
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <!-- 右侧消息窗口 -->
- <div class="content-r">
- <div v-if="selectIndex==1" v-infinite-scroll="handleScroll" ref="contentrtz" class="content-r-tz">
- <div class="content-r-tz-item" v-for="(item,index) in sysMsgList" :key="index">
- <div class="content-r-tz-item-title">
- {{item.title}}
- </div>
- <div class="content-r-tz-item-cons flex align-center justify-between">
- {{item.content}}
- <el-badge :is-dot="item.isSee == 0?true:false" style="margin-right: 10px;">
- <span>{{item.createAt}}</span>
- </el-badge>
- </div>
- </div>
- </div>
- <div v-else-if="selectIndex==3" class="content-r-msg">
- <view class="content-r-msg-title flex align-center" v-if="userType == 1">
- <div class="content-r-msg-title-s" v-if="title">
- {{title}}
- </div>
- <el-divider direction="vertical" />
- <div class="content-r-msg-title-n" v-if="postPushInfo.ruleClassifyName">
- {{ postPushInfo.ruleClassifyName }}
- </div>
- <div class="content-r-msg-title-p" v-if="postPushInfo.salaryRange">
- {{postPushInfo.salaryRange}}
- </div>
- </view>
- <view class="content-r-msg-title flex align-center" v-if="userType == 2">
- <div class="content-r-msg-title-s" v-if="resumesInfo.userName">
- {{resumesInfo.userName}}
- </div>
- <el-divider direction="vertical" />
- <div class="content-r-msg-title-n" v-if="resumesInfo.intentionRuleClassifyName">
- {{resumesInfo.intentionRuleClassifyName}}
- </div>
- </view>
- <!-- 聊天记录 -->
- <div class="content-r-msg-chat flex align-center justify-center">
- <div ref="messageBox" class="content-r-msg-chats">
- <!-- 岗位简介 -->
- <div class="resume-box" v-if="JSON.stringify(postPushInfo) != '{}' && userType == 1" @click.stop="handleClick(postPushInfo.postPushId)">
- <div class="position-title">{{ postPushInfo.ruleClassifyName || '暂无岗位' }}
- <span class="position-num">{{ postPushInfo.salaryRange }}</span>
- </div>
- <div class="company-text">{{ title }} {{ postPushInfo.company ? postPushInfo.company.companyPeople : '0人' }}</div>
- <div class="resume-label information flex flex-wrap">
- <el-tag type="info">{{ postPushInfo.education }}</el-tag>
- <el-tag type="info">{{ postPushInfo.experience }}</el-tag>
- <el-tag type="info" v-if="postPushInfo.company">{{ postPushInfo.company.workRestTime }}</el-tag>
- <el-tag type="info" v-for="(item, index) in postPushInfo.welfareTag ? postPushInfo.welfareTag.split(';') : []"
- :key="index">{{ item }}</el-tag>
- </div>
- <template v-if="isHtmlContent">
- <div :class="['position-content', !isJobDescExpanded ? 'position-content-itemAll' : '']" v-html="postPushInfo.positionDetails"></div>
- </template>
- <template v-else>
- <div :class="['position-content', !isJobDescExpanded ? 'position-content-itemAll' : '']">{{ postPushInfo.positionDetails }}</div>
- </template>
- <div class="expand-more" @click.stop="isJobDescExpanded = !isJobDescExpanded">{{ isJobDescExpanded ? '收起' : '展开更多' }}</div>
- <!-- hr信息 -->
- <div class="flex align-center personnel">
- <img class="resume-avatar" :src="postPushInfo.hr && postPushInfo.hr.hrImg ? postPushInfo.hr.hrImg : '/default.jpg'" alt="" style="width: 35px;height: 35px;">
- <div>{{ postPushInfo.user && postPushInfo.user.userName ? postPushInfo.user.userName : '未知' }}·{{ postPushInfo.hr && postPushInfo.hr.hrPosition || '创始人' }}</div>
- </div>
- <div class="resume-time resume-label">{{ conversationInfo.createTime && conversationInfo.createTime }}向你发起沟通</div>
- </div>
- <!-- 简历简介 -->
- <div class="resume-box" v-if="JSON.stringify(resumesInfo) != '{}' && userType == 2" @click="goToPage">
- <div class="flex align-center">
- <img class="resume-avatar" :src="resumesInfo && resumesInfo.avatar || '/default.jpg'" alt="" />
- <div class="flex flex-direction justify-between" style="gap: 5px;">
- <div>期望:{{ resumesInfo.intentionRuleClassifyName }}
- <span class="text-color">{{ resumesInfo.intentionSalaryRange }}</span>
- </div>
- <div class="resume-label flex">
- <span>{{ resumesInfo.resumesWorkExperience || 0 }}年</span>
- <span>{{ postPushInfo.education }}</span>
- <span>{{ postPushInfo.salaryRange }}</span>
- <span>{{ resumesStatusMap[resumesInfo.resumesStatus] || '未知' }}</span>
- </div>
- </div>
- </div>
- <div class="resume-label information">{{
- resumesInfo.resumesListDtoList && resumesInfo.resumesListDtoList.companyName || '' }}·{{
- resumesInfo.resumesListDtoList && resumesInfo.resumesListDtoList.lastWorkPosition || ''
- }}</div>
- <div class="resume-label information">{{
- resumesInfo.resumesListDtoList && resumesInfo.resumesListDtoList.school || '' }}·{{
- resumesInfo.resumesListDtoList && resumesInfo.resumesListDtoList.profession || '' }}
- </div>
- <div class="resume-tag flex flex-wrap">
- <el-tag type="info" v-for="(skill, skillIndex) in resumesInfo.resumesListDtoList && resumesInfo.resumesListDtoList.intentIndustry && resumesInfo.resumesListDtoList.intentIndustry.split('/') || []"
- :key="skillIndex">{{ skill }}</el-tag>
- </div>
- <div class="information resume-content">{{ resumesInfo.adv }}</div>
- <div class="resume-time resume-label flex">
- <span>{{ conversationInfo.createTime && conversationInfo.createTime }}</span>
- <span>沟通的职位-{{ resumesInfo.intentionRuleClassifyName }}</span>
- </div>
- </div>
- <div class="message-box-item" v-for="(item,index) in megList" :key="index">
- <!-- 对方的消息 -->
- <div class="message-boxs message-box-l flex flex-wrap" v-if="item.userId != userId">
- <img class="message-boxs-avatar" :src="item.avatar?item.avatar:'/default.jpg'"
- alt="" />
- <div class="message-box-l-con" v-if="item.messageType==1 || item.messageType==10">
- {{item.content}}
- </div>
- <div class="message-box-l-con flex align-center" v-if="item.messageType==20">
- 视频通话
- <img src="../../../public/images/message/historyVideo_black.png"
- style="width: 25px;height: 25px;margin-left: 10px;" mode=""></img>
- </div>
- <div class="message-box-l-con flex align-center" v-if="item.messageType==21">
- 语音通话
- <img src="../../../public/images/message/historyAudio_black.png"
- style="width: 25px;height: 25px;margin-left: 10px;" mode=""></img>
- </div>
- <div class="message-box-l-con flex algin-center" style="cursor: pointer;"
- @click="jumpToTencentMap(item.content.latitude,item.content.longitude,item.content.address)"
- v-if="item.messageType==18">
- {{item.content.address}}
- <el-icon style="margin-left: 10px;" :size="20" color="#00DD9A">
- <MapLocation />
- </el-icon>
- </div>
- <!-- 图片 -->
- <div class="message-box-l-con" style="background-color: #ffffff;"
- v-if="item.messageType==2">
- <el-image style="width: 100px;height: 100px;border-radius: 4px;"
- :src="item.content" fit="cover" :zoom-rate="1.2" :max-scale="7"
- :min-scale="0.2" :preview-src-list="[item.content]" :initial-index="4" />
- </div>
- <!-- 语音消息 -->
- <div class="message-box-l-con" v-if="item.messageType==3">
- 语音消息,请前往APP或小程序查看
- </div>
- <!-- 表情 -->
- <div class="message-box-l-con" style="background-color: #ffffff;"
- v-if="item.messageType==4">
- <img :src="emjSrc+item.content" alt="" />
- </div>
- <!-- 交换手机号请求 -->
- <div class="message-box-l-phone"
- v-if="item.messageType==5 && item.content=='手机号请求'">
- 我想跟你交换手机号,是否同意?
- <div class="message-box-l-phone-btn flex align-center">
- <el-button plain size="small"
- @click.stop="refuseFun(item.chatContentId)">拒绝</el-button>
- <el-button type="primary" size="small"
- @click.stop="tongyi(item.messageType,item.chatContentId)">同意</el-button>
- </div>
- </div>
- <!-- 交换手机号请求同意 -->
- <div class="message-box-l-con"
- v-if="item.messageType === 5 && item.content!='手机号请求'">
- 已同意交换手机号
- </div>
- <!-- 交换微信号请求 -->
- <div class="message-box-l-phone"
- v-if="item.messageType==6 && item.content=='微信号请求'">
- 我想跟你交换微信号,是否同意?
- <div class="message-box-l-phone-btn flex align-center">
- <el-button plain size="small"
- @click.stop="refuseFun(item.chatContentId)">拒绝</el-button>
- <el-button type="primary" size="small"
- @click.stop="tongyi(item.messageType,item.chatContentId)">同意</el-button>
- </div>
- </div>
- <!-- 交换微信号请求同意 -->
- <div class="message-box-l-con"
- v-if="item.messageType === 6 && item.content!='微信号请求'">
- 已同意交换微信号
- </div>
- <div class="message-box-l-con" v-if="item.messageType==7">
- <div class="" v-if="item.userType==1">
- 我的手机号为:{{JSON.parse(item.content).userPhone}}
- </div>
- <div v-else>
- 我的手机号为:{{JSON.parse(item.content).companyPhone}}
- </div>
- </div>
- <div class="message-box-l-con" v-if="item.messageType==8">
- <div class="" v-if="item.userType==1">
- 我的微信号为:{{JSON.parse(item.content).userWx}}
- </div>
- <div v-else>
- 我的微信号为:{{JSON.parse(item.content).companyWx}}
- </div>
- </div>
- <!-- 交换手机号请求拒绝 -->
- <div class="message-box-l-con" v-if="item.messageType==12">
- {{item.content}}已拒绝
- </div>
- <!-- 简历请求 -->
- <div class="message-box-l-phone" v-if="item.messageType==9 && item.content=='简历请求'">
- 我想要你的一份简历,是否同意?
- <div class="message-box-l-phone-btn flex align-center">
- <el-button plain size="small"
- @click.stop="refuseFun(item.chatContentId)">拒绝</el-button>
- <el-button type="primary" size="small"
- @click.stop="resumesTy()">同意</el-button>
- </div>
- </div>
- <!-- 简历请求已同意 -->
- <div class="message-box-l-con"
- v-if="item.content && item.messageType === 9 && item.content!=='简历请求'">
- {{item.content}}
- </div>
- <!-- 面试邀约消息 -->
- <div class="message-box-l-con inv-style" v-if="item.content && item.messageType === 99">您收到了{{ item.content }}</div>
- <!-- 面试拒绝或同意 -->
- <div class="message-box-l-con inv-style" v-if="item.content && (item.messageType === 96 || item.messageType === 97)">{{ item.content }}</div>
- <div
- style="width: 100%;color: #999999;font-size: 12px;padding-left: 50px;margin-top: 4px;">
- {{ getDateDiff(item.createTime) }}
- </div>
- </div>
- <!-- 我发的消息 -->
- <div class="message-boxs message-box-r flex flex-wrap" v-else>
- <!-- 文字消息 -->
- <div class="message-box-r-con" v-if="item.messageType==1 || item.messageType==10">
- {{item.content}}
- </div>
- <div class="message-box-r-con flex align-center" v-if="item.messageType==20">
- 视频通话
- <img src="../../../public/images/message/historyVideo_white.png"
- style="width: 25px;height: 25px;margin-left: 10px;" mode=""></img>
- </div>
- <div class="message-box-r-con flex align-center" v-if="item.messageType==21">
- 语音通话
- <img src="../../../public/images/message/historyAudio_white.png"
- style="width: 25px;height: 25px;margin-left: 10px;" mode=""></img>
- </div>
- <div class="message-box-r-con flex algin-center" style="cursor: pointer;"
- @click="jumpToTencentMap(item.content.latitude,item.content.longitude,item.content.address)"
- v-if="item.messageType==18">
- {{item.content.address}}
- <el-icon style="margin-left: 10px;" :size="20" color="#ffffff">
- <MapLocation />
- </el-icon>
- </div>
- <!-- 简历请求 -->
- <div class="message-box-r-con" v-if="item.messageType==9">
- 简历请求已发送,等待对方同意
- </div>
- <!-- 图片 -->
- <div class="message-box-r-con" style="background-color: #ffffff;"
- v-if="item.messageType==2">
- <el-image style="width: 100px;height: 100px;border-radius: 4px;"
- :src="item.content" fit="cover" :zoom-rate="1.2" :max-scale="7"
- :min-scale="0.2" :preview-src-list="[item.content]" :initial-index="4" />
- </div>
- <!-- 语音消息 -->
- <div class="message-box-r-con" v-if="item.messageType==3">
- 语音消息,请前往APP或小程序查看
- </div>
- <!-- 表情消息 -->
- <div class="message-box-r-con" style="background-color: #ffffff;"
- v-if="item.messageType==4">
- <img :src="emjSrc+item.content" alt="" />
- </div>
- <!-- 交换手机号请求 -->
- <div class="message-box-r-con" v-if="item.messageType==5">
- 交换手机号请求已发送,等待对方同意
- </div>
- <div class="message-box-r-con" v-if="item.messageType==7">
- <div class="" v-if="item.userType==1">
- 我的手机号为:{{JSON.parse(item.content).userPhone}}
- </div>
- <div v-else>
- 我的手机号为:{{JSON.parse(item.content).companyPhone}}
- </div>
- </div>
- <!-- 交换微信号请求 -->
- <div class="message-box-r-con" v-if="item.messageType==6">
- 交换微信号请求已发送,等待对方同意
- </div>
- <div class="message-box-r-con" v-if="item.messageType==8">
- <div class="" v-if="item.userType==1">
- 我的微信号为:{{JSON.parse(item.content).userWx}}
- </div>
- <div v-else>
- 我的微信号为:{{JSON.parse(item.content).companyWx}}
- </div>
- </div>
- <!-- 交换手机号请求拒绝 -->
- <div class="message-box-r-con" v-if="item.messageType==12">
- {{item.content}}已拒绝
- </div>
- <!-- 面试邀约消息 -->
- <div class="message-box-r-con invitation" v-if="item.content && item.messageType === 99">您发送了{{ item.content }}</div>
- <!-- 面试拒绝或同意 -->
- <div class="message-box-r-con invitation"
- v-if="item.content && (item.messageType === 96 || item.messageType === 97)">{{
- item.content }}</div>
- <img class="message-boxs-avatar" :src="avatar?avatar:'/default.jpg'" alt="" />
- <div
- style="width: 100%;color: #999999;font-size: 12px;padding-right: 50px;margin-top: 4px;text-align: right;">
- {{getDateDiff(item.createTime)}}
- </div>
-
- </div>
- </div>
- </div>
- </div>
- <!-- 底部 -->
- <div class="content-r-msg-btom flex align-center justify-center">
- <div class="content-r-msg-btoms">
- <div class="message-btom-content">
- <el-input @keyup.enter.prevent="sendMessage(1)" style="margin-top: 10px;" resize="none"
- :input-style="inputStyles" v-model="content" :autosize="{ minRows: 3, maxRows: 3 }"
- type="textarea" placeholder="请输入内容" />
- </div>
- <div class="message-btom-btn flex align-center justify-between">
- <div class="message-btom-btn-l flex align-center">
- <div @click.stop="czlist(index)" @mouseover="changeImageSrc(index)"
- @mouseout="resetImageSrc(index)"
- class="message-btom-btn-l-item flex align-center" v-for="(item,index) in czList"
- :key="index">
- <div v-if="index == 1" class="flex align-center">
- <el-upload class="flex align-center" :action="action"
- :show-file-list="false" :on-success="handleAvatarSuccess">
- <img :src="czIndex==index?item.srcS:item.src" alt="" srcset="" />
- </el-upload>
- </div>
- <div v-else class="flex align-center">
- <img :src="czIndex==index?item.srcS:item.src" alt="" srcset="" />
- {{item.name}}
- </div>
- </div>
- <div v-if="isShowEmoj"
- class="message-btom-btn-l-emj flex align-center justify-center">
- <div class="message-btom-btn-l-emj-box">
- <img @click="sendMessage(4,item.url)" v-for="(item,index) in emojList"
- :key="index" :src="emjSrc+item.url" :alt="item.alt" srcset="" />
- </div>
- </div>
- <div v-if="isShowEmoj" class="message-btom-btn-l-emjs"></div>
- <!-- 常用语 -->
- <div v-if="isShowCommon"
- class="message-btom-btn-l-emj flex align-center justify-center">
- <ul class="message-btom-btn-l-emj-box sentence-panel">
- <li class="message-text" v-for="item in changYongList" :key="item.id" @click="selConfirm(item.label)">{{ item.label }}</li>
- </ul>
- </div>
- </div>
- <el-button type="primary" @click="sendMessage(1)">发送</el-button>
- </div>
- </div>
- </div>
- </div>
- <div v-else class="content-r-no flex align-center justify-center flex-wrap">
- <img src="/images/index/noJl.png" alt="" />
- <div class="content-r-no-txt">
- 与你沟通过的都会在左侧列表展示
- </div>
- </div>
- </div>
- </div>
- <el-dialog v-model="dialogms" title="面试邀请" width="30%" @close="closeMs" :destroy-on-close="true">
- <div style="padding: 20px;">
- <el-form label-position="right" ref="formms" :model="miamshi" class="">
- <el-form-item prop="position"
- :rules="[{ required: true, message: '请选择面试岗位', trigger: 'blur', },]" label="面试岗位">
- <el-select v-model="miamshi.position" placeholder="请选择面试岗位" filterable clearable>
- <el-option v-for="item in jobList" :key="item.id" :label="item.ruleClassifyName"
- :value="item.ruleClassifyId" />
- </el-select>
- </el-form-item>
- <el-form-item prop="interviewDateTime"
- :rules="[{required: true,message: '请选择面试时间',trigger: 'blur',},]" label="面试时间">
- <el-date-picker style="width: 100%;" v-model="miamshi.interviewDateTime" type="datetime"
- placeholder="请选择面试时间" format="YYYY-MM-DD HH:mm" date-format="MMM DD, YYYY"
- time-format="HH:mm" />
- </el-form-item>
- <el-form-item prop="address"
- :rules="[{required: true,message: '请选择面试地点',trigger: 'blur',},]" label="面试地点">
- <el-autocomplete style="width: 100%;" v-model="miamshi.address"
- :fetch-suggestions="querySearchAsync" placeholder="请输入面试地点" @select="handleSelect" />
- </el-form-item>
- <el-form-item prop="detailedAddress" :rules="[{ required: true, message: '请输入详细地址', trigger: 'blur', },]"
- label="详细地址">
- <el-input v-model="miamshi.detailedAddress" placeholder="请输入详细地址" clearable />
- </el-form-item>
- <el-form-item prop="hrName" :rules="[{ required: true, message: '请输入联系人名称', trigger: 'blur', },]"
- label="联系姓名">
- <el-input v-model="miamshi.hrName" placeholder="请输入联系人" clearable />
- </el-form-item>
- <el-form-item prop="hrPhone"
- :rules="[{ required: true, message: '请输入手机号', trigger: 'blur', },]" label="手机号码">
- <el-input v-model="miamshi.hrPhone" placeholder="请输入手机号" clearable />
- </el-form-item>
- <el-form-item prop="remarks" :rules="[{required: true,message: '请输入备注',trigger: 'blur',},]"
- label="面试备注">
- <el-input v-model="miamshi.remarks" placeholder="请输入备注" clearable />
- </el-form-item>
- </el-form>
- </div>
- <template #footer>
- <span class="dialog-footer flex align-center justify-end">
- <el-button @click="dialogms = false">取消</el-button>
- <el-button type="primary" @click="submitMs()">
- 确认
- </el-button>
- </span>
- </template>
- </el-dialog>
- <!-- 附件列表 -->
- <AttachmentSelectDialog @closePostPush="closePostPush" @select="selectItem" v-if="showDialog" :showDialog="showDialog" />
- </div>
- </template>
- <script>
- import {
- ROOTPATH,
- ROOTPATH2,
- ROOTPATH3
- } from '../../../comment/httpUrl.js'
- //引入表情的json
- import emoj from './emoj.json'
- import {
- ElMessageBox,
- ElMessage,
- } from 'element-plus'
- import axios from 'axios';
- import jsonp from 'axios-jsonp'
- import AttachmentSelectDialog from '../../components/AttachmentSelectDialog/AttachmentSelectDialog.vue'
- export default {
- components: { AttachmentSelectDialog },
- data() {
- return {
- isJobDescExpanded: false,
- showDialog: false,
- miamshi: {
- hrPhone: '', //手机号
- hrName: '', //联系人
- position: '', //面试岗位
- interviewDateTime: '', //面试时间
- companyId: '', //公司id
- remarks: '', //面试备注
- userId: '', //面试者id
- postPushId: '', //岗位id
- province: '', //省
- city: '', //市
- county: '', //区
- lng: '', //经度
- lat: '', //纬度
- address: '', //地址
- detailedAddress: '', //详细地址
- },
- dialogms: false, //面试邀请弹窗
- webSco: null, //webscoket对象
- msgList: [], //系统消息
- userCount: 0,
- leftList: [], //左侧聊天列表
- byUserId: '', //userid
- chatConversationId: '', //聊天室id
- postPushId: '', //岗位id
- resumesId: '', //简历id
- postPushInfo: {}, //岗位信息
- resumesInfo: {}, //简历信息
- title: '',
- page: 1,
- limit: 100,
- megList: [],
- userId: '',
- isSendWx: false, //是否交换微信
- isSendPhone: false, //是否交换电话
- action: ROOTPATH + '/alioss/upload', //上传图片地址
- screenHeight: 0, //屏幕高度
- emjSrc: ROOTPATH3,
- content: '', //消息内容
- emojList: emoj.emojList, //表情
- czIndex: -1,
- czList: [{
- name: '',
- src: '/images/postimg/emij.png',
- srcS: '/images/postimg/emij_s.png',
- },
- {
- name: '',
- src: '/images/postimg/photo.png',
- srcS: '/images/postimg/photo_s.png',
- },
- {
- name: '',
- src: '/images/postimg/cyy.png',
- srcS: '/images/postimg/cyy_s.png',
- },
- {
- name: '发简历',
- src: '/images/postimg/jl.png',
- srcS: '/images/postimg/jl_s.png',
- },
- {
- name: '换电话',
- src: '/images/postimg/phone.png',
- srcS: '/images/postimg/phone_s.png',
- },
- {
- name: '换微信',
- src: '/images/postimg/weichat.png',
- srcS: '/images/postimg/weichat_s.png',
- }
- ], //操作图片
- isShowEmoj: false, //是否显示表情弹窗
- liftIndex: -1,
- selectIndex: -1,
- sysMsgList: [], //系统消息
- sysPgae: 1,
- sysPages: 1,
- sysLimit: 10,
- jobList:[],
- isShowCommon:false, //是否显示常用语
- changYongList:[],
- webSocketState:false,
- webSco:null,
- conversationInfo: {},
- resumesStatusMap: {
- 0: '离职-随时到岗',
- 1: '在职-月内到岗',
- 2: '在职-考虑机会',
- 3: '在职-暂不考虑'
- }
- }
- },
- computed: {
- messageCount() {
- return this.$store.state.messageCount;
- },
- userType() {
- return this.$store.state.userType;
- },
- avatar() {
- return this.$store.state.avatar;
- },
- isHtmlContent() {
- const str = this.postPushInfo?.positionDetails || '';
- return /<[^>]+>/.test(str);
- }
- },
- mounted() {
- this.screenHeight = window.innerHeight
- this.userId = localStorage.getItem('userId')
- this.getMsgList()
- this.getweiduMsg()
- this.getChatList()
- setTimeout(() => {
- this.getChangYong();
- }, 1000);
- },
- methods: {
- deleteMsg(item){
- ElMessageBox.confirm(
- '确定删除这条消息?',
- '温馨提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning',
- })
- .then(() => {
- this.$Request.get(`/app/chat/deleteConversation?chatConversationId=${item.chatConversationId}`).then(res => {
- if (res.code == 0) {
- ElMessage({
- message: res.msg || '删除成功',
- type: 'success',
- duration: 1500,
- offset: this.screenHeight / 2
- })
- this.getChatList()
- }
- });
- })
- },
- getDateDiff(data) {
- // 兼容字符串或时间戳
- let timePublish;
- if (typeof data === 'string') {
- // PC 浏览器可以正常识别 "2026-01-05 18:46:39"
- timePublish = new Date(data.replace(/-/g, '/')); // 保留这步以防某些老浏览器异常
- } else if (typeof data === 'number') {
- timePublish = new Date(data);
- } else {
- timePublish = data instanceof Date ? data : new Date();
- }
- if (isNaN(timePublish.getTime())) return '';
- const timeNow = new Date();
- const publishYear = timePublish.getFullYear();
- const publishMonth = timePublish.getMonth() + 1;
- const publishDate = timePublish.getDate();
- const publishHour = timePublish.getHours().toString().padStart(2, '0');
- const publishMinute = timePublish.getMinutes().toString().padStart(2, '0');
- // 计算两个日期的“自然日”差值
- const nowZero = new Date(timeNow.getFullYear(), timeNow.getMonth(), timeNow.getDate());
- const publishZero = new Date(publishYear, timePublish.getMonth(), publishDate);
- const diffDays = Math.floor((nowZero - publishZero) / (1000 * 60 * 60 * 24));
- const weekDays = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'];
- const weekStr = weekDays[timePublish.getDay()];
- const sameYear = publishYear === timeNow.getFullYear();
- let result = '';
- if (diffDays === 0) {
- // 今天
- result = `${publishHour}:${publishMinute}`;
- } else if (diffDays === 1) {
- // 昨天
- result = `昨天 ${publishHour}:${publishMinute}`;
- } else if (diffDays < 7) {
- // 一周内
- result = `${weekStr} ${publishHour}:${publishMinute}`;
- } else if (sameYear) {
- // 同一年
- result = `${publishMonth}月${publishDate}日 ${publishHour}:${publishMinute}`;
- } else {
- // 跨年
- result = `${publishYear}年${publishMonth}月${publishDate}日 ${publishHour}:${publishMinute}`;
- }
- return result;
- },
- goToPage(){
- if (localStorage.getItem('token')) {
- const routeUrl = this.$router.resolve({
- name: 'resumeInfo',
- query: {
- resumesId: this.resumesId,
- postPushId: this.postPushId,
- ruleClassifyId: this.postPushInfo?.ruleClassifyId || '',
- }
- });
- window.open(routeUrl.href, '_blank');
- } else {
- this.$router.push({
- name: 'login'
- })
- }
- },
- handleClick(postPushId){
- if (localStorage.getItem('token')) {
- const routeUrl = this.$router.resolve({
- name: 'postInfo',
- query: {
- postPushId: postPushId
- }
- });
- window.open(routeUrl.href, '_blank');
- } else {
- this.$router.push({
- name: 'login'
- })
- }
- },
- getChangYong() {
- let state = 0
- if (this.userType == 1) {
- state = 70
- } else {
- state = 80
- }
- this.$Request.get(`/app/message/selectMessageByType?page=1&limit=100&state=${state}`)
- .then(res => {
- if (res.code == 0) {
- console.log(res.data.list)
- this.changYongList = [{ label: '你好啊,可以聊一聊~', id: 0 }];
- res.data.list.forEach(d => {
- let data = {
- label: d.content,
- id: d.id
- }
- this.changYongList.push(data);
- });
- }
- });
- },
- selConfirm(val){
- this.content = val;
- this.isShowCommon = false;
- },
- closePostPush(){
- this.showDialog = false
- },
- // 选择附件简历的数据
- selectItem(item){
- if(item.resumesAttachmentId){
- this.sendResumesSave(item.resumesAttachmentId);
- }
- },
- //关闭面试邀请回掉
- closeMs() {
- //清楚输入的值
- this.miamshi.detailedAddress = '';
- this.miamshi.interviewDateTime = '';
- this.miamshi.address = '';
- this.miamshi.remarks = '';
- this.miamshi.userId = '';
- this.miamshi.hrPhone = ''; //手机号
- this.miamshi.hrName = ''; //联系人
- this.miamshi.position = ''; //面试岗位
- },
- jumpToTencentMap(latitude, longitude, name) {
- var url = 'https://apis.map.qq.com/uri/v1/search?keyword=' + name + '¢er=' + latitude + ',' +
- longitude + '&radius=100&referer=OB4BZ-D4W3U-B7VVO-4PJWW-6TKDJ-WPB77';
- window.open(url)
- },
- formatDate(dates, type) {
- let date = new Date(dates)
- let year = date.getFullYear()
- let month = ("0" + (date.getMonth() + 1)).slice(-2)
- let day = ("0" + date.getDate()).slice(-2)
- let hour = date.getHours()
- let minute = ("0" + date.getMinutes()).slice(-2)
- // 处理 12小时制
- let ampm = hour >= 12 ? 'PM' : 'AM'
- hour = hour % 12
- hour = hour ? hour : 12 // 0点转成12
- hour = ("0" + hour).slice(-2)
- if (type == 1) {
- // 返回完整日期 + 固定时间
- return `${year}-${month}-${day} 00:00:00`
- } else {
- // 返回 12小时制时间 + AM/PM
- return `${hour}:${minute} ${ampm}`
- }
- },
- submitMs() {
- let obj = JSON.parse(JSON.stringify(this.miamshi))
- let Time = this.formatDate(obj.interviewDateTime,1);
- obj.detailTime = this.formatDate(obj.interviewDateTime,2);
- let formms = this.$refs.formms
- formms.validate((valid) => {
- if (valid) {
- if (!obj.lng || !obj.lat) {
- ElMessage({
- message: '请选择搜索出来的地址',
- type: 'info',
- duration: 1500,
- offset: this.screenHeight / 2
- })
- return
- }
- let dataInfo = {
- address:obj.address,
- companyId:obj.companyId,
- detailTime: obj.detailTime,
- detailedAddress:obj.detailedAddress,
- hrName: obj.hrName,
- hrPhone: obj.hrPhone,
- interviewDateTime: Time,
- interviewerId:obj.userId,
- lat: obj.lat,
- lng: obj.lng,
- onlineMsg:'',
- onlineType:'',
- postPushId: obj.postPushId,
- recordId:'',//发送的这份面试的id,为空,代表添加,如果有值的话代表修改
- remarks: obj.remarks,
- resumesId:this.resumesId,
- type:0
- }
- this.$Request.post("/app/interviewRecord/saveInterview", dataInfo, {
- type: 'json'
- }).then(res => {
- if (res.code == 0) {
- ElMessage({
- message: '面试邀请已发送',
- type: 'success',
- duration: 1500,
- offset: this.screenHeight / 2
- })
- this.sendMessage(99)
- this.dialogms = false
- }
- // else {
- // ElMessage({
- // message: res.msg,
- // type: 'error',
- // duration: 1500,
- // offset: this.screenHeight / 2
- // })
- // }
- })
- }
- })
- },
- //选择地址
- handleSelect(item) {
- this.miamshi.companyId = localStorage.getItem('companyId');
- this.miamshi.userId = this.byUserId
- this.miamshi.postPushId = this.postPushId
- this.miamshi.province = item.province
- this.miamshi.city = item.city
- this.miamshi.county = item.district
- this.miamshi.lng = item.location.lng
- this.miamshi.lat = item.location.lat
- },
- //地址搜索
- querySearchAsync(queryString, cd) {
- if (!queryString) {
- cd([])
- return
- }
- let data = {
- key: "ZBABZ-ZWECU-UQTVV-4LYDR-COK3F-5SF75", //申请的密钥
- keyword: queryString, //搜索内容
- output: 'jsonp',
- };
- let url =
- "https://apis.map.qq.com/ws/place/v1/suggestion"
- axios.get(url, {
- params: data,
- adapter: jsonp
- }).then(res => {
- if (res.data.status == 0) {
- let arr = res.data.data
- arr.map(item => {
- item.value = item.title
- })
- cd(arr)
- }
- }).catch(err => {
- console.log(err)
- })
- },
- //系统消息加载更多
- handleScroll(e) {
- if (this.sysPgae < this.sysPages) {
- this.sysPgae += 1
- this.getSysMsgList(false)
- }
- },
- //获取系统通知列表
- getSysMsgList(type) {
- if (type) {
- this.sysPgae = 1
- }
- this.liftIndex = -1
- this.loading = true
- let data = {
- page: this.sysPgae,
- limit: this.sysLimit,
- // state: 5
- }
- this.$Request.get('/app/message/selectMessageByUserId', {
- params: data
- }).then(res => {
- if (res.code === 0) {
- this.selectIndex = 1
- this.sysPages = res.data.totalPage
- if (this.sysPgae == 1) {
- this.sysMsgList = res.data.list
- } else {
- this.sysMsgList = [...this.sysMsgList, ...res.data.list]
- }
- }
- });
- },
- initScoket() {
- this.webSco = this.$socket.getSocket();
- // 如果 WebSocket 已经连接,直接把状态标记为 true
- if (this.webSco.readyState === WebSocket.OPEN) {
- this.webSocketState = true
- // console.log('✅ WebSocket 已经连接,状态直接标记为 true')
- } else {
- // 还未连接,绑定 onopen
- this.webSco.onopen = this.websocketonopen.bind(this)
- }
- // 绑定其他回调
- this.webSco.onmessage = this.websocketonmessage.bind(this)
- this.webSco.onerror = this.websocketonerror.bind(this)
- this.webSco.onclose = this.websocketclose.bind(this)
- },
- //监听接收到消息的回调
- websocketonmessage(event) {
- this.webSocketState = true
- // console.log(event, '收到消息')
- //收到消息后再获取聊天记录
- this.getCHarList()
- },
- //监听错误的回调
- websocketonerror(event) {
- //连接错误后把连接状态设为false
- this.webSocketState = false
- // console.log(event, '连接错误')
- },
- //监听链接打开的回调
- websocketonopen(event) {
- this.webSocketState = true
- // console.log(event, '连接已打开')
- },
- //监听关闭的回调
- websocketclose(event) {
- // 关闭连接后把状态设为false
- this.webSocketState = false
- // console.log(event, '连接已关闭')
- },
- //开始聊天
- startMsg(item, index) {
- this.ruleClassifyName = item.stationName;//岗位名称
- this.liftIndex = index
- this.czList = [{
- name: '',
- src: '/images/postimg/emij.png',
- srcS: '/images/postimg/emij_s.png',
- },
- {
- name: '',
- src: '/images/postimg/photo.png',
- srcS: '/images/postimg/photo_s.png',
- },
- {
- name: '',
- src: '/images/postimg/cyy.png',
- srcS: '/images/postimg/cyy_s.png',
- },
- {
- name: '发简历',
- src: '/images/postimg/jl.png',
- srcS: '/images/postimg/jl_s.png',
- },
- {
- name: '换电话',
- src: '/images/postimg/phone.png',
- srcS: '/images/postimg/phone_s.png',
- },
- {
- name: '换微信',
- src: '/images/postimg/weichat.png',
- srcS: '/images/postimg/weichat_s.png',
- }
- ]
- this.postPushId = item.postPushId
- this.chatConversationId = item.chatConversationId
- this.getPostPushInfo()
- if (this.userType == 1) { //用户
- this.byUserId = item.focusedUserId
- this.czList[3].name = '发简历'
- } else { //招聘者
- this.byUserId = item.userId
- this.resumesId = item.resumesId
- this.czList[3].name = '求简历'
- this.czList.push({
- name: '约面试',
- src: '/images/postimg/yms.png',
- srcS: '/images/postimg/yms_.png',
- })
- this.getResumesInfo(this.resumesId)
- }
- //获取聊天记录
- this.getCHarList();
- this.getChatList();
- //获取交换状态
- this.getStatusInfo()
- this.initScoket()
- this.selectIndex = 3
- },
- //关闭弹窗
- closeDialog() {
- this.isShowEmoj = false
- this.isShowCommon = false
- },
- // 同意简历请求并发送简历
- sendResumesSave(resumesAttachmentId) {
- let that = this
- let data = {
- to: this.byUserId, //接收人的userId
- postPushId: this.postPushId, //岗位id
- resumesAttachmentId
- }
- this.$Request.post("/app/resumes/sendResumes", data).then(res => {
- if (res.code == 0) {
- ElMessage({
- message: '简历已发送',
- type: 'success',
- duration: 1500,
- offset: this.screenHeight / 2
- })
- this.sendMessage(24)
- this.getCHarList()
- this.getStatusInfo()
- }
- })
- },
- //同意简历请求
- resumesTy() {
- ElMessageBox.confirm(
- '确定发送简历给对方?',
- '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning',
- }
- )
- .then(() => {
- this.showDialog = true;
- }).catch(() => {
- })
- },
- //同意交换手机号/微信
- tongyi(messageType, chatContentId) {
- if (messageType == 6 && !this.$store.state.weChatNum) {
- ElMessageBox.confirm(
- '请点击右上角头像的个人信息完善微信号后操作',
- '提示', {
- confirmButtonText: '去完善',
- cancelButtonText: '取消',
- type: 'warning',
- }
- )
- .then(() => {
- }).catch(() => {
- })
- return
- }
- let that = this
- ElMessageBox.confirm(
- messageType == 5 ? '同意后将交换手机号,是否同意?' : '同意后将交换微信号,是否同意?',
- '提示', {
- confirmButtonText: '同意',
- cancelButtonText: '取消',
- type: 'warning',
- }
- )
- .then(() => {
- let data = {
- messageType: messageType,
- chatContentId: chatContentId
- }
- that.$Request.post("/app/chat/sendPhoneOrWx", data).then(res => {
- if (res.code == 0) {
- this.sendMessage(24)
- this.getCHarList()
- that.getStatusInfo()
- }
- })
- }).catch(() => {
- })
- },
- //请求拒绝
- refuseFun(id) {
- ElMessageBox.confirm(
- '确定拒绝吗?',
- '提示', {
- confirmButtonText: '确认',
- cancelButtonText: '取消',
- type: 'warning',
- }
- )
- .then(() => {
- let data = {
- chatContentId: id
- }
- this.$Request.get("/app/chat/refuseReqs", {
- params: data
- }).then(res => {
- if (res.code == 0) {
- ElMessage({
- message: '已拒绝',
- type: 'success',
- duration: 1500,
- offset: this.screenHeight / 2
- })
- this.sendMessage(24)
- this.getCHarList()
- this.getStatusInfo()
- } else {
- ElMessage({
- message: res.msg,
- type: 'error',
- duration: 1500,
- offset: this.screenHeight / 2
- })
- }
- })
- }).catch(() => {
- })
- },
- //发送图片
- handleAvatarSuccess(res) {
- let data = {
- userId: this.byUserId, //id
- content: res.data, //消息内容
- messageType: 2, //消息类型
- chatConversationId: this.chatConversationId //聊天室id
- }
- //把要发送的消息转换为json字符串
- data = JSON.stringify(data);
- //如果scoket是连接状态,那么就直接发送消息
- if (this.webSocketState) {
- // 发送消息
- this.webSco.send(data)
- setTimeout(() => {
- //发送消息后晴空输入框
- this.content = ''
- //获取聊天记录
- this.getCHarList()
- }, 50)
- } else { //如果不是,那么就重新连接
- this.initScoket()
- }
- },
- // 发送消息 type:1:文字 2:图片 3:语音 4:表情
- sendMessage(type, url) {
- let data = {
- userId: this.byUserId, //id
- content: this.content.replace(/\n/g, ''), //消息内容
- messageType: type, //消息类型
- chatConversationId: this.chatConversationId //聊天室id
- }
- if (type == 1 && !data.content) { //文字
- ElMessage({
- message: '请输入聊天内容',
- type: 'error',
- duration: 1500,
- offset: this.screenHeight / 2
- })
- this.content = ''
- return
- }
- if (type == 4) { //发送表情
- data.content = url
- }
- if (type == 5) { //交换手机号请求
- data.content = '手机号请求';
- }
- if (type == 6) { //交换微信号请求
- data.content = '微信号请求';
- }
- if (type == 9) { //简历请求
- data.content = '简历请求';
- }
- if (type == 24) { //刷新
- data.content = '刷新';
- }
- if(type == 99){ //面试邀约
- data.content = '一份面试邀约';
- }
- //把要发送的消息转换为json字符串
- data = JSON.stringify(data);
- //如果scoket是连接状态,那么就直接发送消息
- if (this.webSocketState) {
- // 发送消息
- this.webSco.send(data)
- setTimeout(() => {
- //发送消息后晴空输入框
- this.content = ''
- //获取聊天记录
- this.getCHarList()
- }, 50)
- } else { //如果不是,那么就重新连接
- this.initScoket()
- }
- },
- //发简历
- sendResumes() {
- ElMessageBox.confirm(
- '是否将简历发送给对方?',
- '提示', {
- confirmButtonText: '发送',
- cancelButtonText: '取消',
- type: 'warning',
- }
- )
- .then(() => {
- this.showDialog = true;
- }).catch(() => {
- })
- },
- //交换手机号弹窗
- currentPhone() {
- let that = this
- if (this.isSendPhone == false) {
- ElMessageBox.confirm(
- '确定后,电话交换请求将发送给对方,对方同意后将会看到彼此的手机号',
- '确定与对方交换电话吗?', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning',
- }
- )
- .then(() => {
- that.sendMessage(5)
- }).catch(() => {
- })
- } else {
- ElMessage({
- message: '已交换过手机号,请查看聊天记录',
- type: 'error',
- duration: 1500,
- offset: this.screenHeight / 2
- })
- }
- },
- //交换微信号弹窗
- currentWchat() {
- let that = this
- if (!this.$store.state.weChatNum) {
- ElMessageBox.confirm(
- '请点击右上角头像的个人信息完善微信号后操作',
- '提示', {
- confirmButtonText: '去完善',
- cancelButtonText: '取消',
- type: 'warning',
- }
- )
- .then(() => {
- }).catch(() => {
- })
- return
- }
- if (this.isSendWx == false) {
- ElMessageBox.confirm(
- '确定后,微信交换请求将发送给对方,对方同意后将会看到彼此的微信号',
- '确定与对方交换微信吗?', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning',
- }
- )
- .then(() => {
- that.sendMessage(6)
- }).catch(() => {
- })
- } else {
- ElMessage({
- message: '已交换过微信号,请查看聊天记录',
- type: 'error',
- duration: 1500,
- offset: this.screenHeight / 2
- })
- }
- },
- //求简历
- giveSendResumes() {
- ElMessageBox.confirm(
- '是否将简历请求发送给对方?',
- '确定获取对方简历吗?', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning',
- }
- )
- .then(() => {
- this.sendMessage(9)
- }).catch(() => {
- })
- },
- //操作
- czlist(index) {
- switch (index) {
- case 0: //显示表情
- this.isShowEmoj = true
- break;
- case 2: //显示常用语
- this.isShowCommon = true
- break;
- case 3: //发简历
- if (this.userType == 1) { //发简历
- this.sendResumes()
- } else { //求简历
- this.giveSendResumes()
- }
- break;
- case 4: //换电话
- this.currentPhone()
- break;
- case 5: //换微信
- this.currentWchat()
- break;
- case 6: //约面试
- this.openDialog();
- break;
- default:
- break;
- }
- },
- // 赋值地址和联系人数据
- openDialog() {
- const addressInfo = localStorage.getItem('companyAddressInfo')
- ? JSON.parse(localStorage.getItem('companyAddressInfo'))
- : {};
- this.miamshi = {
- hrPhone: this.$store.state.phone || '',
- hrName: this.$store.state.nickName || '',
- position: '',
- interviewDateTime: '',
- companyId: localStorage.getItem('companyId') || '',
- remarks: '',
- userId: this.byUserId || '',
- postPushId: this.postPushId || '',
- province: addressInfo.province || '',
- city: addressInfo.city || '',
- county: addressInfo.county || '',
- lng: addressInfo.lng || '',
- lat: addressInfo.lat || '',
- address: addressInfo.address || '',
- detailedAddress: addressInfo.detailedAddress || '',
- }
- this.dialogms = true;
- },
- //还原图片
- resetImageSrc(index) {
- this.czIndex = -1
- },
- //显示图片
- changeImageSrc(index) {
- this.czIndex = index
- },
- //获取交换状态
- getStatusInfo() {
- let data = {
- chatConversationId: this.chatConversationId
- }
- this.$Request.get("/app/chat/getConversationInfo", {
- params: data
- }).then(res => {
- if (res.code == 0) {
- this.conversationInfo = res.data
- if (res.data.isSendWx) { //是否交换微信
- this.isSendWx = true
- } else {
- this.isSendWx = false
- }
- if (res.data.isSendPhone) { //是否交换电话
- this.isSendPhone = true
- } else {
- this.isSendPhone = false
- }
- }
- })
- },
- //获取聊天记录
- getCHarList() {
- let data = {
- page: this.page,
- limit: this.limit,
- chatConversationId: this.chatConversationId,
- userId: this.userId
- }
- this.$Request.get('/app/chat/selectChatContent', {
- params: data
- }).then(res => {
- if (res.code == 0) {
- res.data.list.map(item => {
- if (item.messageType == 18) {
- item.content = JSON.parse(item.content)
- }
- })
- this.megList = res.data.list
- this.megList.reverse();
- //等数据更新后滚动到最底下
- this.$nextTick(() => {
- this.$refs.messageBox.scrollTop = this.$refs.messageBox.scrollHeight
- })
- }
- })
- },
- //获取简历数据
- getResumesInfo(id) {
- let data = {
- userId: localStorage.getItem('userId'),
- resumesId: id,
- companyId: localStorage.getItem('companyId')
- }
- this.$Request.get("/app/resumes/selectResumesByResumesId", {
- params: data
- }).then(res => {
- if (res.code == 0) {
- res.data.intentionRuleClassifyName = this.ruleClassifyName
- res.data.intentionSalaryRange = ''
- res.data.intentionList.forEach(item => {
- if (item.ruleClassifyName == this.ruleClassifyName) {
- res.data.intentionRuleClassifyName = item.ruleClassifyName
- res.data.intentionSalaryRange = item.salaryRange
- }
- })
- this.resumesInfo = res.data
- }
- })
- },
- //获取岗位数据
- getPostPushInfo() {
- let data = {
- userId: this.userId,
- postPushId: this.postPushId
- }
- this.$Request.get("/app/postPush/selectPostPushDetails", {
- params: data
- }).then(res => {
- if (res.code == 0) {
- this.title = res.data.company.companyName
- this.postPushInfo = res.data
- // this.postPushInfo.positionWelfare = this.postPushInfo?.positionWelfare.split(',');
- // 选择的岗位列表
- this.jobList = [{
- ...res.data
- }];
- }
- })
- },
- getChatList() {
- let data = {
- page: 1,
- limit: 99999
- }
- this.$Request.get("/app/chat/selectChatConversationPage", {
- params: data
- }).then(res => {
- if (res.code == 0) {
- this.leftList = res.data?.list || []
- }
- });
- },
- getweiduMsg() {
- this.$Request.get("/app/chats/userCount").then(res => {
- if (res.code == 0) {
- this.userCount = res.data
- }
- });
- },
- //获取系统消息
- getMsgList() {
- this.$Request.get("/app/message/selectMessageByUserIdLimit1").then(res => {
- if (res.code == 0) {
- this.msgList = res.data.list
- }
- });
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- $margin-60: 120px;
- .message {
- width: 100%;
- // padding-top: 20px;
- }
- .megActive {
- background-color: #F0F0F0;
- }
- :deep(.el-textarea) {
- --el-input-focus-border: none;
- --el-input-focus-border-color: none;
- }
- :deep(.el-textarea__inner) {
- box-shadow: none !important;
- }
- :deep(.el-textarea__inner:hover) {
- box-shadow: none;
- .is-focus {
- box-shadow: none;
- }
- }
- :deep(.el-dialog) {
- border-radius: 14px !important;
- }
- :deep(.el-dialog__body) {
- padding: 0 !important;
- padding-top: 10px !important;
- }
- :deep(.el-dialog__header) {
- background: linear-gradient(45deg, #f2fffa, #FFFFFF);
- border-radius: 14px 14px 0 0;
- }
- .content {
- width: calc(100% - $margin-60 * 2);
- height: 80vh;
- margin-top: 20px;
- }
- .content-l {
- width: 30%;
- height: 80vh;
- background-color: #ffffff;
- border-radius: 14px;
- .content-l-box {
- width: 100%;
- height: calc(80vh - 40px);
- align-content: flex-start;
- overflow: hidden;
- overflow-y: scroll;
- }
- .content-l-box::-webkit-scrollbar {
- /* Chrome, Safari, Opera */
- width: 0px;
- }
- .content-l-box::-webkit-scrollbar-thumb {
- background-color: #cccccc;
- /* 滚动条颜色 */
- }
- .content-l-box::-webkit-scrollbar-track {
- background-color: #ffffff;
- /* 轨道颜色 */
- }
- .content-l-box-items:hover {
- background-color: #F0F0F0;
- }
- .content-l-box-items {
- width: calc(100% - 20px);
- height: fit-content;
- border-radius: 13px;
- margin-bottom: 10px;
- }
- .content-l-box-item {
- margin: 10px 0;
- cursor: pointer;
- padding: 0 20px;
- }
- .content-l-box-item-l {
- img {
- width: 46px;
- height: 46px;
- border-radius: 50%;
- }
- }
- .content-l-box-item-con {
- margin-left: 10px;
- }
- .content-l-box-item-con-title {
- color: #222222;
- font-size: 15px;
- font-weight: 500;
- span {
- color: #999999;
- font-size: 13px;
- font-weight: 400;
- margin-left: 5px;
- }
- }
- .content-l-box-item-con-cons {
- color: #999999;
- font-size: 13px;
- margin-top: 5px;
- }
- .content-l-box-item-r {
- width: fit-content;
- color: #999999;
- font-size: 13px;
- .content-l-box-item-r-dian {
- width: 20px;
- height: 20px;
- border-radius: 50%;
- background-color: red;
- color: #ffffff;
- }
- }
- }
- .content-r {
- width: calc(70% - 20px);
- height: 80vh;
- background-color: #ffffff;
- border-radius: 14px;
- .content-r-tz {
- width: 90%;
- height: 90%;
- margin: auto;
- margin-top: 3%;
- overflow: hidden;
- overflow-y: scroll;
- }
- .content-r-tz::-webkit-scrollbar {
- /* Chrome, Safari, Opera */
- width: 0px;
- }
- .content-r-tz::-webkit-scrollbar-thumb {
- background-color: #cccccc;
- /* 滚动条颜色 */
- }
- .content-r-tz::-webkit-scrollbar-track {
- background-color: #ffffff;
- /* 轨道颜色 */
- }
- .content-r-tz-item {
- width: 100%;
- padding: 10px 0;
- border-bottom: 1px solid #f8f8f8;
- }
- .content-r-tz-item-title {
- color: #222222;
- font-size: 15px;
- font-weight: 500px;
- }
- .content-r-tz-item-cons {
- font-size: 13px;
- font-weight: 400;
- margin-top: 10px;
- color: #999999;
- }
- .content-r-no {
- width: 100%;
- height: 100%;
- align-content: center;
- img {
- width: 300px;
- height: 200px;
- }
- .content-r-no-txt {
- width: 100%;
- text-align: center;
- margin-top: 20px;
- font-size: 14px;
- }
- }
- .content-r-msg {
- width: 100%;
- height: 100%;
- }
- .content-r-msg-title {
- width: calc(100% - 40px);
- height: 55px;
- padding: 0 20px;
- border-bottom: 1px solid #EBEBEB;
- .content-r-msg-title-s {
- font-size: 16px;
- font-weight: 5000;
- color: #222222;
- }
- .content-r-msg-title-n {
- color: #999999;
- font-size: 14px;
- font-weight: 400;
- }
- .content-r-msg-title-p {
- color: red;
- font-size: 14px;
- font-weight: 400;
- margin-left: 10px;
- }
- .content-r-msg-title-e {
- color: #999999;
- font-size: 14px;
- font-weight: 400;
- margin-left: 10px;
- }
- }
- .content-r-msg-chat {
- width: 100%;
- height: calc(80vh - 255px);
- }
- .content-r-msg-chats {
- width: calc(100% - 40px);
- height: calc(100% - 40px);
- overflow: hidden;
- overflow-y: scroll;
- }
- .content-r-msg-chats::-webkit-scrollbar {
- /* Chrome, Safari, Opera */
- width: 0px;
- }
- .content-r-msg-chats::-webkit-scrollbar-thumb {
- background-color: #cccccc;
- /* 滚动条颜色 */
- }
- .content-r-msg-chats::-webkit-scrollbar-track {
- background-color: #ffffff;
- /* 轨道颜色 */
- }
- .message-box-item {
- width: 100%;
- margin-bottom: 20px;
- }
- .message-boxs {
- width: 100%;
- .message-boxs-avatar {
- width: 40px;
- height: 40px;
- border-radius: 50%;
- }
- }
- .message-box-l {
- img {
- margin-right: 10px;
- }
- .message-box-l-con {
- max-width: 40%;
- padding: 10px;
- border-radius: 13px 13px 13px 0;
- background-color: #F8F8F8;
- color: #333333;
- }
- .message-box-l-phone {
- background: linear-gradient(to bottom, #D9FEED, #ffffff);
- // background-color: red;
- padding: 10px;
- border-radius: 13px 13px 13px 0;
- }
- .message-box-l-phone-btn {
- justify-content: flex-end;
- margin-top: 10px;
- }
- }
- .message-box-r {
- justify-content: flex-end;
- img {
- margin-left: 10px;
- }
- .message-box-r-con {
- max-width: 40%;
- padding: 10px;
- border-radius: 13px 13px 0 13px;
- background: #00DD9A;
- color: #FFFFFF;
- }
- .invitation{
- background: linear-gradient(rgb(217, 254, 237), rgb(255, 255, 255));
- border: 0.5px solid rgb(198, 254, 231);
- color: #000;
- }
- }
- .inv-style{
- background: linear-gradient(rgb(217, 254, 237), rgb(255, 255, 255));
- border: 0.5px solid rgb(198, 254, 231);
- color: #000;
- }
- .content-r-msg-btom {
- width: 100%;
- height: 200px;
- border-top: 1px solid #E6E6E6;
- }
- .content-r-msg-btoms {
- width: calc(100% - 40px);
- height: calc(100% - 40px);
- }
- .message-btom-content {
- width: 100%;
- height: 70%;
- }
- .message-btom-btn {
- width: 100%;
- height: 30%;
- }
- .message-btom-btn-l {
- position: relative;
- .message-btom-btn-l-emj {
- width: 490px;
- height: 300px;
- background-color: #ffffff;
- border-radius: 10px 10px 10px 0;
- position: absolute;
- bottom: 30px;
- border: 1px solid #f2f5fa;
- box-shadow: 0 0 14px rgba(0, 0, 0, .11);
- }
- .message-btom-btn-l-emj-box {
- width: calc(100% - 40px);
- height: calc(100% - 40px);
- overflow: hidden;
- overflow-y: scroll;
- img {
- width: 30px;
- height: 30px;
- padding: 5px;
- cursor: pointer;
- }
- }
- .message-btom-btn-l-emj-box::-webkit-scrollbar {
- /* Chrome, Safari, Opera */
- width: 0px;
- }
- .message-btom-btn-l-emj-box::-webkit-scrollbar-thumb {
- background-color: #ffffff;
- /* 滚动条颜色 */
- }
- .message-btom-btn-l-emj-box::-webkit-scrollbar-track {
- background-color: #ffffff;
- /* 轨道颜色 */
- }
- .message-btom-btn-l-emjs {
- position: absolute;
- bottom: 22px;
- width: 0;
- height: 0;
- border-left: 10px solid transparent;
- /* 根据需要设置边框宽度 */
- border-right: 10px solid transparent;
- /* 根据需要设置边框宽度 */
- border-top: 10px solid #ffffff;
- /* 根据需要设置边框颜色 */
- }
- .message-btom-btn-l-item {
- margin-right: 15px;
- cursor: pointer;
- color: #666666;
- font-size: 14px;
- img {
- width: 20px;
- height: 20px;
- margin-right: 2px;
- }
- }
- .message-btom-btn-l-item:hover {
- color: #00DD9A;
- }
- .message-btom-btn-l-item:nth-of-type(1):hover {
- img {
- src: '/images/postimg/emij_s.png'
- }
- }
- }
- }
- .sentence-panel{
- margin: 0 !important;
- padding: 0 !important;
- }
- .message-text{
- height: 34px;
- line-height: 34px;
- border-radius: 4px;
- z-index: 1;
- overflow: hidden;
- cursor: pointer;
- white-space: nowrap;
- text-overflow: ellipsis;
- padding: 0 12px 0 24px;
- font-size: 13px;
- font-weight: 400;
- color: #333;
- border: none;
- position: relative;
- }
- .message-text:hover{
- background-color: #f8f8f8;
- }
- .message-text:before{
- content: "";
- position: absolute;
- top: 14px;
- left: 10px;
- width: 6px;
- height: 6px;
- border-radius: 50%;
- background: #d9d9d9;
- }
- .resume-box{
- margin-bottom: 20px;
- background-color: #F0F0F0;
- border-radius: 8px;
- padding: 15px;
- cursor: pointer;
- .resume-avatar{
- width: 46px;
- height: 46px;
- border-radius: 50%;
- margin-right: 10px;
- }
- .text-color{
- color: #016BF6;
- font-size: 14px;
- margin-left: 5px;
- }
- .resume-label{
- color: #9ca4ab;
- font-size: 14px;
- gap: 10px;
- }
- .information{
- margin: 10px 0;
- }
- .resume-tag{
- gap:6px;
- }
- .resume-content{
- color: #616e7c;
- font-size: 14px;
- }
- .resume-time{
- border-top: 1px solid #e9e3e3;
- padding-top: 5px;
- }
- .position-title{
- font-size: 20px;
- font-weight: 500;
- }
- .position-num{
- color: #016bf6;
- font-size: 16px;
- margin-left: 10px;
- }
- .company-text{
- color: #9ca4ab;
- margin-top: 5px;
- }
- .position-content{
- color: #999999;
- font-size: 14px;
- white-space: pre-wrap;
- }
- .position-content-itemAll{
- display: -webkit-box;
- -webkit-line-clamp: 4;
- -webkit-box-orient: vertical;
- overflow: hidden;
- text-overflow: ellipsis;
- }
- .expand-more{
- color: #007AFF;
- font-size: 14px;
- cursor: pointer;
- margin-top: 10px;
- }
- .personnel{
- margin: 10px 0;
- font-size: 14px;
- color: #1A1A1A;
- }
- }
- .delete-btn{
- display: none;
- }
- .content-l-box-item:hover .delete-btn {
- display: flex;
- }
- </style>
|