im.vue 90 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015
  1. <template>
  2. <view>
  3. <!-- 顶部导航栏 -->
  4. <view class="top-navbar">
  5. <view class="navbar-content">
  6. <!-- 左侧返回按钮 -->
  7. <view class="navbar-left" @click="goBack">
  8. <u-icon name="arrow-leftward" size="48" color="#333"></u-icon>
  9. </view>
  10. <!-- 中间用户信息 -->
  11. <view class="navbar-center">
  12. <view class="user-info">
  13. <view class="avatar-container">
  14. <image :src="postPushInfo.company ? postPushInfo.company.companyLogo : '../../static/logo.png'" class="user-avatar" mode="aspectFill"></image>
  15. <view class="status-indicator"></view>
  16. </view>
  17. <view class="user-details">
  18. <view class="user-name">{{ postPushInfo.company ? postPushInfo.company.companyLegalPerson : '未知' }}</view>
  19. <view class="user-title">{{ postPushInfo.company ? postPushInfo.company.companyName : '未知公司' }}</view>
  20. </view>
  21. </view>
  22. </view>
  23. <!-- 右侧更多按钮 -->
  24. <view class="navbar-right" @click="showMoreOptions">
  25. <u-icon name="more-dot-fill" size="38" color="#333"></u-icon>
  26. </view>
  27. </view>
  28. </view>
  29. <!-- 顶部操作 -->
  30. <view class="topSe flex justify-center" v-if="userType==1">
  31. <view class="topSe-box flex align-center justify-around">
  32. <view class="topSe-box-item flex flex-wrap justify-center" @click="currentPhone()">
  33. <image src="../../static/im/mobilePhone2.svg" style="width: 48rpx;height: 48rpx;" mode=""></image>
  34. <view class="" style="color: #999999;">
  35. 换电话
  36. </view>
  37. </view>
  38. <view class="topSe-box-item flex flex-wrap justify-center" @click="currentWchat()">
  39. <image src="../../static/im/weiChat2.svg" style="width: 48rpx;height: 48rpx;" mode=""></image>
  40. <view class="" style="color: #999999;">
  41. 换微信
  42. </view>
  43. </view>
  44. <view class="topSe-box-item flex flex-wrap justify-center" @click="sendResumes()">
  45. <image src="../../static/im/orderInfo2.svg" style="width: 48rpx;height: 48rpx;" mode=""></image>
  46. <view class="" style="color: #999999;">
  47. 发简历
  48. </view>
  49. </view>
  50. <view class="topSe-box-item flex flex-wrap justify-center">
  51. <image src="../../static/im/nowei.svg" style="width: 48rpx;height: 48rpx;" mode=""></image>
  52. <view class="" style="color: #999999;">
  53. 无兴趣
  54. </view>
  55. </view>
  56. </view>
  57. </view>
  58. <view class="topSe flex justify-center" v-else>
  59. <view class="topSe-box flex align-center justify-around">
  60. <view class="topSe-box-item flex flex-wrap justify-center" @click="currentPhone()">
  61. <image src="../../static/im/mobilePhone.png" style="width: 48rpx;height: 48rpx;" mode=""></image>
  62. <view class="" style="color: #999999;">
  63. 换电话
  64. </view>
  65. </view>
  66. <view class="topSe-box-item flex flex-wrap justify-center" @click="currentWchat()">
  67. <image src="../../static/im/weiChat.png" style="width: 48rpx;height: 48rpx;" mode=""></image>
  68. <view class="" style="color: #999999;">
  69. 换微信
  70. </view>
  71. </view>
  72. <view class="topSe-box-item flex flex-wrap justify-center" @click="giveSendResumes()">
  73. <image src="../../static/im/orderInfo.png" style="width: 48rpx;height: 48rpx;" mode=""></image>
  74. <view class="" style="color: #999999;">
  75. 求简历
  76. </view>
  77. </view>
  78. <view class="topSe-box-item flex flex-wrap justify-center" @click="mianshiF()">
  79. <image src="../../static/im/mianshi.png" style="width: 48rpx;height: 48rpx;" mode=""></image>
  80. <view class="" style="color: #999999;">
  81. 约面试
  82. </view>
  83. </view>
  84. </view>
  85. </view>
  86. <scroll-view scroll-y="true" @touchstart="hideDrawer" @scroll="scroll" :scroll-top="scrollTop"
  87. style="height: calc(100vh - 360rpx);width: 100%;padding: 20rpx 0;">
  88. <!-- 温馨提示 -->
  89. <!-- <view class="xuanfu">
  90. <view class="xuanfu-box flex">
  91. <view class="" style="margin-right: 10rpx;">
  92. <image style="width: 30rpx;height: 30rpx;"
  93. src="https://zhaopin.xianmaxiong.com/file/uploadPath/2022/09/07/85e0d70ba1d9a78463b36bf7f92f6dca.png"
  94. mode=""></image>
  95. </view>
  96. <view class="">
  97. {{messages}}
  98. </view>
  99. </view>
  100. </view> -->
  101. <!-- 岗位简介 -->
  102. <view class="jobs flex justify-center" v-if="JSON.stringify(postPushInfo)!='{}'">
  103. <view class="jobs-box">
  104. <view class="gwList-box-item flex justify-center" @click="gotoInfo(postPushInfo.postPushId)">
  105. <view class="gwList-box-item-box">
  106. <view class="gwList-box-item-box-title flex justify-between align-center">
  107. <text>{{postPushInfo.stationName}}</text>
  108. <text>{{postPushInfo.salaryRange}}</text>
  109. </view>
  110. <!-- 公司和人数 -->
  111. <view class="gwList-box-item-box-name flex align-center">
  112. <text>{{postPushInfo.company?postPushInfo.company.companyName:''}}</text>
  113. <text
  114. v-if="postPushInfo.company">{{postPushInfo.company?postPushInfo.company.companyPeople:'0人'}}</text>
  115. </view>
  116. <view class="gwList-box-item-box-label flex align-center flex-wrap">
  117. <text
  118. style="color: #666666;font-size: 26rpx;padding: 10rpx;background: rgba(198, 198, 198, 0.1);border-radius: 8rpx;margin-right: 10rpx;margin-bottom: 20rpx;">
  119. {{postPushInfo.education}}
  120. </text>
  121. <text
  122. style="color: #666666;font-size: 26rpx;padding: 10rpx;background: rgba(198, 198, 198, 0.1);border-radius: 8rpx;margin-right: 10rpx;margin-bottom: 20rpx;">
  123. {{postPushInfo.experience}}
  124. </text>
  125. <text
  126. style="color: #666666;font-size: 26rpx;padding: 10rpx;background: rgba(198, 198, 198, 0.1);border-radius: 8rpx;margin-right: 10rpx;margin-bottom: 20rpx;"
  127. v-for="(ite,ind) in postPushInfo.positionWelfare" :key="ind">{{ite}}</text>
  128. </view>
  129. <!-- <view class="gwList-box-item-box-line"></view> -->
  130. <!-- 工作描述 -->
  131. <view class="gwList-box-item-box-info-text">
  132. <view class="job-description-item">1.负责Amazon英国、欧洲站、制定推广与销售计划,达成团队要求的销售业绩;</view>
  133. <view class="job-description-item">2.做好数据的统计分析工作,收集、分析市场信息,竞争对手状况,并根据产品销售与排名变化,及时制定和调整产品的销售策略;</view>
  134. <view class="job-description-item" v-if="isJobDescExpanded">3.熟悉Amazon店铺操作,负责店铺产品编辑上传,精准把握关键词选择,负责标题,详情页面的优化;</view>
  135. <view class="job-description-item" v-if="isJobDescExpanded">4.熟悉Amazon平台规则,熟悉Amazon站内广告投放和促销式,站外促销,找红人营销等提高曝光率和转化率的引流方</view>
  136. <view class="job-description-item" v-if="isJobDescExpanded">5.控制产品风险,合理规划FBA库存,及时合理处理滞销FBA库存;</view>
  137. <view class="job-description-item" v-if="isJobDescExpanded">6.对产品销售进行跟踪,分析,及时汇报销售中存在的问题,并给出可行性意见;</view>
  138. <view class="job-description-item" v-if="isJobDescExpanded">7.及时处理客户留言及回评,解答客户相关咨询与投诉,并进行问题整理统计分析,提高店铺的好评率,确保账号安全;</view>
  139. <view class="job-description-item" v-if="isJobDescExpanded">8.每月定期整理分析运营各项数据,并提出相应的合理化建议。</view>
  140. <!-- 展开/收起按钮 -->
  141. <view class="expand-btn" @click.stop="toggleJobDesc">
  142. <text class="expand-text">{{ isJobDescExpanded ? '收起' : '展开更多' }}</text>
  143. </view>
  144. </view>
  145. <!-- hr信息 -->
  146. <view class="gwList-box-item-box-info flex justify-between align-center">
  147. <view class="gwList-box-item-box-info-l flex align-center">
  148. <image
  149. :src="postPushInfo.company?postPushInfo.company.companyLogo:'../../static/logo.png'"
  150. style="width: 58rpx;height: 58rpx;border-radius: 50%;margin-right: 20rpx;"
  151. mode=""></image>
  152. <view class="people" v-if="postPushInfo.company">
  153. {{postPushInfo.company.companyLegalPerson?postPushInfo.company.companyLegalPerson:'未知'}}
  154. </view>·创始人
  155. </view>
  156. <!--
  157. <view class="gwList-box-item-box-info-r flex justify-end">
  158. {{postPushInfo.county}} {{postPushInfo.address}}
  159. </view>
  160. -->
  161. </view>
  162. <!-- 时间和收藏 -->
  163. <view class="time-favorite flex justify-between align-center">
  164. <view class="time-text">
  165. 7月24日 14:34 向你发起的沟通
  166. </view>
  167. <view class="favorite-btn flex align-center" @click.stop="toggleFavorite">
  168. <text class="favorite-icon">☆</text>
  169. <text class="favorite-text">收藏职位</text>
  170. </view>
  171. </view>
  172. </view>
  173. </view>
  174. </view>
  175. </view>
  176. <!-- 简历简介 -->
  177. <view class="jobs flex justify-center" v-if="JSON.stringify(resumesInfo)!='{}'">
  178. <view class="jobs-box">
  179. <view class="qyList-box-item flex justify-center"
  180. @click="goNav('/pages/index/game/orderDet?resumesId='+resumesInfo.resumesId)">
  181. <view class="qyList-box-item-box">
  182. <view class="qyList-box-item-info flex justify-between align-center">
  183. <view class="qyList-box-item-info-l">
  184. <view class="" style="color: #212121;font-size: 38rpx;font-weight: 800;">
  185. {{resumesInfo.resumesName}}
  186. </view>
  187. <view class="flex align-center flex-wrap"
  188. style="color: #999999;font-size: 26rpx;margin-top: 10rpx;">
  189. <text>{{resumesInfo.resumesAge}}岁</text>
  190. <text style="margin-left: 20rpx;margin-right: 20rpx;">|</text>
  191. <text>{{resumesInfo.resumesWorkExperience}}</text>
  192. <text style="margin-left: 20rpx;margin-right: 20rpx;">|</text>
  193. <text>{{resumesInfo.school}}</text>
  194. <text style="margin-left: 20rpx;margin-right: 20rpx;">|</text>
  195. <text>期望{{resumesInfo.resumesCompensation}}</text>
  196. </view>
  197. </view>
  198. <view class="qyList-box-item-info-r">
  199. <image :src="resumesInfo.avatar?resumesInfo.avatar:'../../static/logo.png'"
  200. style="width: 95rpx;height: 95rpx;border-radius: 50%;" mode=""></image>
  201. </view>
  202. </view>
  203. <view class="qyList-box-item-job flex align-center">
  204. <u-icon name="heart-fill" color="#016BF6" size="30" style="margin-right: 16rpx;">
  205. </u-icon>
  206. 期望岗位:{{resumesInfo.resumesPost}}
  207. </view>
  208. <view class="qyList-box-item-job flex align-center"
  209. v-if="resumesInfo.resumesCompanyList[0]">
  210. <image src="../../static/images/qi.png"
  211. style="width: 30rpx;height: 32rpx;margin-right: 16rpx;" mode=""></image>
  212. {{resumesInfo.resumesCompanyList[0]?resumesInfo.resumesCompanyList[0].resumesTitle:''}}
  213. /
  214. {{resumesInfo.resumesCompanyList[0]?resumesInfo.resumesCompanyList[0].resumesPost:''}}
  215. </view>
  216. <view class="qyList-box-item-job flex align-center" v-else>
  217. <image src="../../static/images/qi.png"
  218. style="width: 30rpx;height: 32rpx;margin-right: 16rpx;" mode=""></image>
  219. 暂无
  220. </view>
  221. <view class="qyList-box-item-rem" v-if="resumesInfo.resumesDetails">
  222. 优势:{{resumesInfo.resumesDetails}}
  223. </view>
  224. </view>
  225. </view>
  226. </view>
  227. </view>
  228. <!-- 聊天记录 -->
  229. <view style="display: flex;flex-direction: column;" v-for="(item,index) in ListItem" :key="index" :id=" 'id-'+index">
  230. <view style="margin-top: 15rpx;width: 100%;text-align: center;font-size: 26rpx;color: #999999;"
  231. v-if="item.createTime">
  232. {{item.createTime}}
  233. </view>
  234. <view v-if="item.userId && userId != item.userId" style="width: 83%;margin-right: 15%;">
  235. <view class="chat-listitem" style="float: left;margin-left: 10rpx;">
  236. <view>
  237. <image @tap="goGuanZhu(item)" :src="item.avatar ? item.avatar : '/static/logo.png'"
  238. class="chat-listitem-image"></image>
  239. </view>
  240. <view v-if="item.content && item.messageType === 1" @longpress="copy(item.content)"
  241. class="chat-listitem-text"
  242. style="margin-left: 20rpx;color: #000000;background-color: #ffffff;">{{item.content}}</view>
  243. <view v-if="item.messageType === 20" @tap="sendCallVideo(2)"
  244. class="chat-listitem-text flex align-center"
  245. style="margin-left: 20rpx;color: #000000;background-color: #ffffff;">
  246. 视频通话
  247. <image src="../../static/im/historyVideo_black.png"
  248. style="width: 50rpx;height: 50rpx;margin-left: 20rpx;" mode=""></image>
  249. </view>
  250. <view v-if="item.messageType === 21" @tap="sendCallVideo(1)"
  251. class="chat-listitem-text flex align-center"
  252. style="margin-left: 20rpx;color: #000000;background-color: #ffffff;">
  253. 语音通话
  254. <image src="../../static/im/historyAudio_black.png"
  255. style="width: 50rpx;height: 50rpx;margin-left: 20rpx;" mode=""></image>
  256. </view>
  257. <!-- 互换手机号 -->
  258. <view v-if="item.content && item.messageType === 5 && item.content=='手机号请求'"
  259. @longpress="copy(item.content)" class="chat-listitem-text"
  260. style="padding-bottom: 20rpx;;padding-top: 20rpx;margin-left: 20rpx;color: #000000;background-color: #ffffff;border: 1rpx solid #c6fee7;background: linear-gradient(to bottom, #D9FEED, #ffffff);">
  261. <view class="flex align-center">
  262. <image src="../../static/im/mobilePhone.png"
  263. style="width: 60rpx;height: 60rpx;margin-right: 10rpx;" mode=""></image>
  264. 我想跟你交换手机号,是否同意?
  265. </view>
  266. <view class="flex justify-between" style="margin-top: 30rpx;font-size: 24rpx;">
  267. <view @click.stop="refuseFun(item.chatContentId)"
  268. class="flex justify-center align-center"
  269. style="width: 40%;height: 50rpx;background-color: #F5F5F5;border-radius: 12rpx;">
  270. 拒绝
  271. </view>
  272. <view @click.stop="tongyi(item.messageType,item.chatContentId)"
  273. class="flex justify-center align-center"
  274. style="width: 40%;height: 50rpx;background-color: #D9FEED;border-radius: 12rpx;">
  275. 同意
  276. </view>
  277. </view>
  278. </view>
  279. <view v-if="item.content && item.messageType === 5 && item.content!='手机号请求'"
  280. class="chat-listitem-text"
  281. style="margin-left: 20rpx;color: #000000;background-color: #ffffff;">
  282. 已同意交换手机号
  283. </view>
  284. <view v-if="item.content && item.messageType === 7"
  285. @longpress="copyss(item.content,item.userType,'phone')" class="chat-listitem-text"
  286. style="margin-left: 20rpx;color: #000000;background-color: #ffffff;">
  287. <view class="" v-if="item.userType==1">
  288. 我的手机号为:{{JSON.parse(item.content).userPhone}}
  289. </view>
  290. <view class="" v-else>
  291. 我的手机号为:{{JSON.parse(item.content).companyPhone}}
  292. </view>
  293. </view>
  294. <!-- 互换微信号 -->
  295. <view v-if="item.content && item.messageType === 6 && item.content=='微信号请求'"
  296. @longpress="copy(item.content)" class="chat-listitem-text"
  297. style="padding-bottom: 20rpx;;padding-top: 20rpx;margin-left: 20rpx;color: #000000;background-color: #ffffff;border: 1rpx solid #c6fee7;background: linear-gradient(to bottom, #D9FEED, #ffffff);">
  298. <view class="flex align-center">
  299. <image src="../../static/im/weiChat.png"
  300. style="width: 60rpx;height: 60rpx;margin-right: 10rpx;" mode=""></image>
  301. 我想跟你交换微信号,是否同意?
  302. </view>
  303. <view class="flex justify-between" style="margin-top: 30rpx;font-size: 24rpx;">
  304. <view @click.stop="refuseFun(item.chatContentId)"
  305. class="flex justify-center align-center"
  306. style="width: 40%;height: 50rpx;background-color: #F5F5F5;border-radius: 12rpx;">
  307. 拒绝
  308. </view>
  309. <view @click.stop="tongyi(item.messageType,item.chatContentId)"
  310. class="flex justify-center align-center"
  311. style="width: 40%;height: 50rpx;background-color: #D9FEED;border-radius: 12rpx;">
  312. 同意
  313. </view>
  314. </view>
  315. </view>
  316. <view v-if="item.content && item.messageType === 6 && item.content!='微信号请求'"
  317. class="chat-listitem-text"
  318. style="margin-left: 20rpx;color: #000000;background-color: #ffffff;">
  319. 已同意交换微信号
  320. </view>
  321. <view v-if="item.content && item.messageType === 8"
  322. @longpress="copyss(item.content,item.userType,'wx')" class="chat-listitem-text"
  323. style="margin-left: 20rpx;color: #000000;background-color: #ffffff;">
  324. <view class="" v-if="item.userType==1">
  325. 我的微信号为:{{JSON.parse(item.content).userWx}}
  326. </view>
  327. <view class="" v-else>
  328. 我的微信号为:{{JSON.parse(item.content).companyWx}}
  329. </view>
  330. </view>
  331. <view v-if="item.content && item.messageType === 9 && item.content=='简历请求'"
  332. @longpress="copy(item.content)" class="chat-listitem-text"
  333. style="padding-bottom: 20rpx;;padding-top: 20rpx;margin-left: 20rpx;color: #000000;background-color: #ffffff;border: 1rpx solid #c6fee7;background: linear-gradient(to bottom, #D9FEED, #ffffff);">
  334. <view class="flex align-center">
  335. <image src="../../static/im/orderInfo.png"
  336. style="width: 60rpx;height: 60rpx;margin-right: 10rpx;" mode=""></image>
  337. 我想要你的一份简历,是否同意?
  338. </view>
  339. <view class="flex justify-between" style="margin-top: 30rpx;font-size: 24rpx;">
  340. <view @click.stop="refuseFun(item.chatContentId)"
  341. class="flex justify-center align-center"
  342. style="width: 40%;height: 50rpx;background-color: #F5F5F5;border-radius: 12rpx;">
  343. 拒绝
  344. </view>
  345. <view @click.stop="resumesTy()" class="flex justify-center align-center"
  346. style="width: 40%;height: 50rpx;background-color: #D9FEED;border-radius: 12rpx;">
  347. 同意
  348. </view>
  349. </view>
  350. </view>
  351. <view v-if="item.content && item.messageType === 9 && item.content!='简历请求'"
  352. @longpress="copy(item.content)" class="chat-listitem-text"
  353. style="padding-bottom: 20rpx;;padding-top: 20rpx;margin-left: 20rpx;color: #000000;background-color: #ffffff;border: 1rpx solid #c6fee7;background: linear-gradient(to bottom, #D9FEED, #ffffff);">
  354. <view class="flex align-center">
  355. <image src="../../static/im/orderInfo.png"
  356. style="width: 60rpx;height: 60rpx;margin-right: 10rpx;" mode=""></image>
  357. {{item.content}}
  358. </view>
  359. </view>
  360. <view v-if="item.content && item.messageType === 10" class="chat-listitem-text"
  361. style="margin-left: 20rpx;color: #000000;background-color: #ffffff;">
  362. {{item.content}}
  363. </view>
  364. <view v-if="item.content && item.messageType === 12" class="chat-listitem-text"
  365. style="margin-left: 20rpx;color: #000000;background-color: #ffffff;">
  366. {{item.content}}已拒绝
  367. </view>
  368. <image @tap="viewImg(item.content)" v-if="item.content && item.messageType === 2"
  369. :src="item.content" style="height: 200rpx;width: 200rpx;margin-left: 20rpx;"></image>
  370. <image class="chat-listitem-text" @tap="viewImg(item.content)"
  371. v-if="item.content && item.messageType === 4"
  372. :src="'../../static/emoji/' +item.content"
  373. style="height: 80rpx;width: 80rpx;margin-left: 20rpx;"></image>
  374. <view v-if="item.content && item.messageType === 3" class="chat-listitem-text bubble voice"
  375. :class="playMsgid == index?'play':''"
  376. style="margin-left: 20rpx;display: flex;align-items: center;"
  377. @tap="playVoice(item.content,index)">
  378. <image v-if="playMsgid != index" src="../../static/im/laba.png"
  379. style="width: 35upx;height: 40upx;margin-right: 10rpx;"></image>
  380. <image v-if="playMsgid == index" src="../../static/im/labagif.gif"
  381. style="width: 35upx;height: 40upx;margin-right: 10rpx;"></image>
  382. <view class="length">{{item.width ? item.width : 0}}</view>
  383. </view>
  384. <view class="chat-listitem-text "
  385. style="margin-left: 20rpx;color: #000000;background-color: #ffffff;"
  386. v-if="item.content && item.messageType === 18"
  387. @click="openMapss(item.content.latitude,item.content.longitude,item.content.address)">
  388. <view class="padding-sm flex">
  389. <!-- #ifdef APP -->
  390. <u-icon name="map-fill" color="#ffffff" size="28" style="margin-right: 10rpx;"></u-icon>
  391. <!-- #endif -->
  392. {{item.content.address}}
  393. </view>
  394. <!-- #ifndef APP -->
  395. <map style="width: 100%; height: 120px;" scale="14" :latitude="item.content.latitude"
  396. :longitude="item.content.longitude"
  397. @tap="openMapss(item.content.latitude,item.content.longitude,item.content.address)"
  398. :markers="item.markers">
  399. </map>
  400. <!-- #endif -->
  401. </view>
  402. </view>
  403. </view>
  404. <!-- ++++++++++++++++++++++++++ -->
  405. <view v-if="item.userId && userId == item.userId" style="width: 83%;margin-left: 15%;">
  406. <view class="chat-listitem" style="float: right;">
  407. <view v-if="item.content && item.messageType === 1" @longpress="caozuoActive(item,1)"
  408. class="chat-listitem-text textColor" style="margin-right: 20rpx;">{{item.content}}</view>
  409. <view v-if="item.messageType === 20" @tap="sendCallVideo(2)"
  410. class="chat-listitem-text textColor flex align-center" style="margin-right: 20rpx;">
  411. 视频通话
  412. <image src="../../static/im/historyVideo_white.png"
  413. style="width: 50rpx;height: 50rpx;margin-left: 20rpx;" mode=""></image>
  414. </view>
  415. <view v-if="item.messageType === 21" @tap="sendCallVideo(1)"
  416. class="chat-listitem-text textColor flex align-center" style="margin-right: 20rpx;">
  417. 语音通话
  418. <image src="../../static/im/historyAudio_white.png"
  419. style="width: 50rpx;height: 50rpx;margin-left: 20rpx;" mode=""></image>
  420. </view>
  421. <view v-if="item.content && item.messageType === 5" class="chat-listitem-text textColor"
  422. style="margin-right: 20rpx;">
  423. 交换手机号请求已发送,等待对方同意
  424. </view>
  425. <view v-if="item.content && item.messageType === 7"
  426. @longpress="copyss(item.content,item.userType,'phone')" class="chat-listitem-text textColor"
  427. style="margin-right: 20rpx;">
  428. <view class="" v-if="item.userType==1">
  429. 我的手机号为:{{JSON.parse(item.content).userPhone}}
  430. </view>
  431. <view class="" v-else>
  432. 我的手机号为:{{JSON.parse(item.content).companyPhone}}
  433. </view>
  434. </view>
  435. <view v-if="item.content && item.messageType === 6" class="chat-listitem-text textColor"
  436. style="margin-right: 20rpx;">
  437. 交换微信号请求已发送,等待对方同意
  438. </view>
  439. <view v-if="item.content && item.messageType === 8"
  440. @longpress="copyss(item.content,item.userType,'wx')" class="chat-listitem-text textColor"
  441. style="margin-right: 20rpx;">
  442. <view class="" v-if="item.userType==1">
  443. 我的微信号为:{{JSON.parse(item.content).userWx}}
  444. </view>
  445. <view class="" v-else>
  446. 我的微信号为:{{JSON.parse(item.content).companyWx}}
  447. </view>
  448. </view>
  449. <view v-if="item.content && item.messageType === 9" class="chat-listitem-text textColor"
  450. style="margin-right: 20rpx;">
  451. 简历请求已发送,等待对方同意
  452. </view>
  453. <view v-if="item.content && item.messageType === 10" class="chat-listitem-text textColor"
  454. style="margin-right: 20rpx;">
  455. {{item.content}}
  456. </view>
  457. <view v-if="item.content && item.messageType === 12" class="chat-listitem-text textColor"
  458. style="margin-right: 20rpx;">
  459. {{item.content}}已拒绝
  460. </view>
  461. <view class="chat-listitem-text textColor" style="margin-right: 20rpx;"
  462. v-if="item.content && item.messageType === 18"
  463. @click="openMapss(item.content.latitude,item.content.longitude,item.content.address)">
  464. <view class="padding-sm flex">
  465. <!-- #ifdef APP -->
  466. <u-icon name="map-fill" color="#ffffff" size="28" style="margin-right: 10rpx;"></u-icon>
  467. <!-- #endif -->
  468. {{item.content.address}}
  469. </view>
  470. <!-- #ifndef APP -->
  471. <map style="width:520upx; height: 120px;" scale="14" :latitude="item.content.latitude"
  472. :longitude="item.content.longitude"
  473. @tap="openMapss(item.content.latitude,item.content.longitude,item.content.address)"
  474. :markers='item.markers'>
  475. </map>
  476. <!-- #endif -->
  477. </view>
  478. <!-- <view v-if="item.content && item.messageType === 1" @longpress="copy(item.content)"
  479. class="chat-listitem-text" style="margin-right: 20rpx;">{{item.content}}</view> -->
  480. <image @longpress="caozuoActive(item)" @tap="viewImg(item.content)"
  481. v-if="item.content && item.messageType === 2" :src="item.content"
  482. style="height: 200rpx;width: 200rpx;margin-right: 20rpx;"></image>
  483. <image class="chat-listitem-text textColor" @longpress="caozuoActive(item)"
  484. @tap="viewImg(item.content)" v-if="item.content && item.messageType === 4"
  485. :src="'https://zp.118zp.com/emoji/' +item.content"
  486. style="height: 80rpx;width: 80rpx;margin-right: 20rpx;">
  487. </image>
  488. <view v-if="item.content && item.messageType === 3"
  489. class="chat-listitem-text bubble voice textColor" :class="playMsgid == index?'play':''"
  490. style="margin-right: 20rpx;display: flex;align-items: center;"
  491. @longpress="caozuoActive(item)" @tap="playVoice(item.content,index)">
  492. <view class="length">{{item.width ? item.width : 0}}</view>
  493. <image v-if="playMsgid != index" src="../../static/im/labaleft.png"
  494. style="width: 35upx;height: 40upx;margin-left: 10rpx;"></image>
  495. <image v-if="playMsgid == index" src="../../static/im/labaleft.png"
  496. style="width: 35upx;height: 40upx;margin-left: 10rpx;"></image>
  497. </view>
  498. <view>
  499. <image :src="imageUrl" class="chat-listitem-image"></image>
  500. </view>
  501. </view>
  502. </view>
  503. </view>
  504. <!-- </view> -->
  505. </scroll-view>
  506. <!-- 底部聊天输入框 -->
  507. <!-- <view class="input-box">
  508. <view style="display: flex;margin-top: 15rpx;width: 100%;">
  509. <image src="https://renwu.xiansqx.com/img/20210817/024ca47bc591460daf76762a8e98283f.png" @click="chooseImage(['album'])" style="width: 60rpx;height: 60rpx;margin-top: 8rpx;"></image>
  510. <input confirm-type="send" @confirm='setChatSave(1)' type="text" v-model="content"
  511. style="width: 68%;height: 70rpx;background: #FFFFFF;margin: 4rpx 10rpx 0;border-radius: 10rpx;padding-left: 10rpx;" />
  512. <view class="save" @tap='setChatSave(1)'>发送</view>
  513. </view>
  514. </view> -->
  515. <!-- 长按操作菜单 -->
  516. <u-action-sheet :list="activelist" @click="activeclick" v-model="showActive" :tips="tips"></u-action-sheet>
  517. <!-- 抽屉栏 -->
  518. <view class="popup-layer" :class="popupLayerClass" @touchmove.stop.prevent="discard">
  519. <!-- 表情 -->
  520. <swiper class="emoji-swiper" indicator-active-color="#cccccc" :class="{hidden:hideEmoji}"
  521. indicator-dots="true" duration="150">
  522. <swiper-item v-for="(page1,pid) in emojiList" :key="pid">
  523. <view v-for="(em,eid) in page1" :key="eid" @tap="setChatSave(4,em.url)">
  524. <!-- <image src="../../static/emoji/100.gif" mode="widthFix"></image> -->
  525. <image mode="widthFix" :src="'../../static/emoji/'+em.url"></image>
  526. </view>
  527. </swiper-item>
  528. </swiper>
  529. <!-- 更多功能 相册-拍照-红包 -->
  530. <view class="more-layer" :class="{hidden:hideMore}">
  531. <view class="list" style="color: #000000;">
  532. <!-- 上传图片 -->
  533. <view style="margin-bottom: 20rpx;">
  534. <view class="box" @click="chooseImage(['album'])">
  535. <image src="../../static/im/tupian.svg" style="width: 48rpx;height: 48rpx;" mode=""></image>
  536. </view>
  537. <view style="width: 100%;text-align: center;">上传图片</view>
  538. </view>
  539. <!-- #ifdef H5 || APP -->
  540. <!-- 语音 -->
  541. <view style="margin-bottom: 20rpx;">
  542. <view class="box" @tap="sendCallVideo(1)">
  543. <image src="../../static/im/yuyin.svg" mode=""
  544. style="width: 48rpx;height: 48rpx;">
  545. </image>
  546. </view>
  547. <view style="width: 100%;text-align: center;">语音</view>
  548. </view>
  549. <!-- 视频 -->
  550. <view style="margin-bottom: 20rpx;">
  551. <view class="box" @tap="sendCallVideo(2)">
  552. <image src="../../static/im/shipin.svg" mode=""
  553. style="width: 48rpx;height: 48rpx;">
  554. </image>
  555. </view>
  556. <view style="width: 100%;text-align: center;">视频</view>
  557. </view>
  558. <!-- #endif -->
  559. <!-- 常用语 -->
  560. <view style="margin-bottom: 20rpx;">
  561. <view class="box" @tap="showChangYongSelect">
  562. <view class="icon jianpan"></view>
  563. </view>
  564. <view style="width: 100%;text-align: center;">常用语句</view>
  565. </view>
  566. <!-- 添加常用语或自动回复内容 -->
  567. <view style="margin-bottom: 20rpx;">
  568. <view class="box" @tap="goAdd">
  569. <view class="icon add"></view>
  570. </view>
  571. <view style="width: 100%;text-align: center;">添加语句</view>
  572. </view>
  573. <view style="margin-bottom: 20rpx;">
  574. <view class="box" @tap="goMapss">
  575. <image src="../../static/images/weizhi.png" mode="" style="width: 76rpx;height: 76rpx;">
  576. </image>
  577. </view>
  578. <view style="width: 100%;text-align: center;">发送位置</view>
  579. </view>
  580. <view>
  581. <view class="box" @tap="goHistory">
  582. <view class="icon chehui"></view>
  583. </view>
  584. <view style="width: 100%;text-align: center;">聊天记录</view>
  585. </view>
  586. </view>
  587. </view>
  588. </view>
  589. <!-- 底部输入栏 -->
  590. <view class="input-box" :class="popupLayerClass" @touchmove.stop.prevent="discard">
  591. <!-- H5下不能录音,输入栏布局改动一下 -->
  592. <!-- #ifndef H5 -->
  593. <view class="voice">
  594. <view class="icon" :class="isVoice?'jianpan':'yuyin'" @tap="switchVoice"></view>
  595. </view>
  596. <!-- #endif -->
  597. <view class="textbox">
  598. <view class="voice-mode" :class="[isVoice?'':'hidden',recording?'recording':'']"
  599. @touchstart="voiceBegin" @touchmove.stop.prevent="voiceIng" @touchend="voiceEnd"
  600. @touchcancel="voiceCancel">{{voiceTis}}</view>
  601. <view class="text-mode" :class="isVoice?'hidden':''">
  602. <!-- 常用语按钮 -->
  603. <view class="changgui" @tap="showChangYongSelect">
  604. <image src="../../static/im/changgui.svg" style="width: 56rpx;height: 56rpx;" mode=""></image>
  605. </view>
  606. <view class="box">
  607. <input style="color: #000000;" auto-height="true" @confirm='setChatSave(1)' v-model="content"
  608. @focus="textareaFocus" />
  609. </view>
  610. <view class="em" @tap="chooseEmoji">
  611. <image src="../../static/im/smail.svg" style="width: 56rpx;height: 56rpx;" mode=""></image>
  612. </view>
  613. <!-- #ifdef H5 -->
  614. <view class="more" @tap="showMore" style="height: auto;">
  615. <image src="../../static/im/buleAdd.svg" style="width: 56rpx;height: 56rpx;" mode=""></image>
  616. </view>
  617. <!-- #endif -->
  618. </view>
  619. </view>
  620. <!-- #ifndef H5 -->
  621. <view class="more" @tap="showMore">
  622. <view class="icon add"></view>
  623. </view>
  624. <!-- #endif -->
  625. <view class="send" :class="isVoice?'hidden':''" @tap='setChatSave(1)'>
  626. <view class="btn">发送</view>
  627. </view>
  628. </view>
  629. <!-- 录音UI效果 -->
  630. <view class="record" :class="recording?'':'hidden'">
  631. <view class="ing" :class="willStop?'hidden':''">
  632. <view class="icon luyin2"></view>
  633. </view>
  634. <view class="cancel" :class="willStop?'':'hidden'">
  635. <view class="icon chehui"></view>
  636. </view>
  637. <view class="tis" :class="willStop?'change':''">{{recordTis}}</view>
  638. </view>
  639. <u-select v-model="showChangYong" title="常用词语" mode="single-column" :list="changYongList" @confirm="selConfirm">
  640. </u-select>
  641. <u-action-sheet :list="list" @click="click" v-model="show"></u-action-sheet>
  642. <u-popup v-model="mianshiShow" mode="bottom" z-index="998" :mask-close-able="false" border-radius="14"
  643. @close="cleanMs" :closeable="true">
  644. <view class="mianshiTitle">面试邀请</view>
  645. <view class="mianshiTime flex justify-center">
  646. <view class="mianshiTime-box flex justify-between align-center">
  647. <view class="">
  648. 面试时间
  649. </view>
  650. <view class="flex align-center mianshiTime-box-ti">
  651. <u-input disabled v-model="miamshi.interviewDateTime" @click="msTime=true" type="text"
  652. placeholder="请选择面试时间" />
  653. <u-icon name="arrow-right" style="margin-left: 10rpx;" color="#016BF6" size="28"
  654. @click="msTime=true"></u-icon>
  655. </view>
  656. </view>
  657. </view>
  658. <view class="mianshiTime flex justify-center">
  659. <view class="mianshiTime-box flex justify-between align-center">
  660. <view class="">
  661. 面试地址
  662. </view>
  663. <view class="flex align-center mianshiTime-box-ti">
  664. <u-input disabled @click="goMap()" v-model="miamshi.detailedAddress" type="text"
  665. placeholder="请选择面试地址" />
  666. <u-icon name="arrow-right" style="margin-left: 10rpx;" @click="goMap()" color="#016BF6"
  667. size="28"></u-icon>
  668. </view>
  669. </view>
  670. </view>
  671. <view class="mianshiTime flex justify-center">
  672. <view class="mianshiTime-box" style="border: none;">
  673. <view class="">
  674. 备注
  675. </view>
  676. <view class="flex align-center mianshiTime-box-ti">
  677. <u-input v-model="miamshi.remarks" type="textarea" input-align="left"
  678. style="padding: 10rpx;background-color: #F2F2F7;height: 200rpx;overflow: hidden;border-radius: 14rpx;width: 100%;"
  679. :auto-height="false" />
  680. </view>
  681. </view>
  682. </view>
  683. <view class="btnm flex justify-center">
  684. <view class="btn-box flex justify-around align-center">
  685. <view class="btn-close btnItem" @click="mianshiShow = false">
  686. 取消
  687. </view>
  688. <view class="btn-sub btnItem" @click="submitMs()">
  689. 确认
  690. </view>
  691. </view>
  692. </view>
  693. </u-popup>
  694. <u-toast ref="uToast" />
  695. <u-picker v-model="msTime" mode="time" :params="params" @confirm="mianshiConfirm" confirm-color="#016BF6">
  696. </u-picker>
  697. <!-- 面试邀请弹窗 -->
  698. <u-popup v-model="msshow" mode="center" z-index="998" border-radius="24" :mask-close-able="false" width="80%">
  699. <view class="mssTitle">
  700. 面试邀请
  701. </view>
  702. <view class="avatorm flex justify-center">
  703. <view class="avatorm-box flex justify-center">
  704. <block v-if="records.userEntity && records.userEntity.userAvatar">
  705. <image :src="records.userEntity.userAvatar"
  706. style="width: 100rpx;height: 100rpx;border-radius: 50%;" mode="">
  707. </image>
  708. </block>
  709. <block v-else>
  710. <image src="../../static/logo.png" style="width: 100rpx;height: 100rpx;border-radius: 50%;"
  711. mode="">
  712. </image>
  713. </block>
  714. <block v-if="records.company && records.company.companyLogo">
  715. <image :src="records.company.companyLogo"
  716. style="width: 100rpx;height: 100rpx;border-radius: 50%;" mode="">
  717. </image>
  718. </block>
  719. <block v-else>
  720. <image src="../../static/logo.png" style="width: 100rpx;height: 100rpx;border-radius: 50%;"
  721. mode="">
  722. </image>
  723. </block>
  724. </view>
  725. </view>
  726. <view class="avatorm flex justify-center">
  727. <view class="avatorm-box">
  728. <view class="avatorm-box-item flex">
  729. <view class="avatorm-box-item-t">
  730. 面试岗位:
  731. </view>
  732. <view class="avatorm-box-item-r">
  733. {{records.postPush?records.postPush.stationName:'未知'}}
  734. </view>
  735. </view>
  736. <view class="avatorm-box-item flex" v-if="records">
  737. <view class="avatorm-box-item-t">
  738. 面试时间:
  739. </view>
  740. <view class="avatorm-box-item-r">
  741. {{records.interviewDateTime}}
  742. </view>
  743. </view>
  744. <view class="avatorm-box-item flex" @click="goMapDap(records)">
  745. <view class="avatorm-box-item-t">
  746. 面试地点:
  747. </view>
  748. <view class="avatorm-box-item-r">
  749. {{records.detailedAddress}}
  750. <u-icon name="map-fill" color="#016BF6" size="28"></u-icon>
  751. </view>
  752. </view>
  753. <view class="avatorm-box-item flex">
  754. <view class="avatorm-box-item-t">
  755. 面试备注:
  756. </view>
  757. <view class="avatorm-box-item-r">
  758. {{records.remarks?records.remarks:'暂无'}}
  759. </view>
  760. </view>
  761. </view>
  762. </view>
  763. <view class="avatorm flex justify-center" v-if="records.company">
  764. <view class="avatorm-box flex justify-center">
  765. 来自{{records.company.companyName}}的面试邀请,是否接受?
  766. </view>
  767. </view>
  768. <view class="btnm flex justify-center" style="margin-bottom: 30rpx;">
  769. <view class="btn-box flex justify-around align-center">
  770. <view class="btn-close btnItem" @click="setJuJue(records)">
  771. 拒绝
  772. </view>
  773. <view class="btn-sub btnItem" @click="setJuJues(records)">
  774. 接受
  775. </view>
  776. </view>
  777. </view>
  778. </u-popup>
  779. <!-- 交换微信自定义弹窗 -->
  780. <u-popup v-model="wechatExchangeShow" mode="center" z-index="999" border-radius="24" :mask-close-able="false" width="80%">
  781. <view class="phone-exchange-popup">
  782. <!-- 顶部背景区域 -->
  783. <view class="phone-exchange-header">
  784. <image src="../../static/im/Artwork.png" class="phone-exchange-bg" mode="aspectFill"></image>
  785. </view>
  786. <!-- 中间内容区域 -->
  787. <view class="phone-exchange-content">
  788. <view class="phone-exchange-title">确认与对方交换微信吗?</view>
  789. <view class="phone-exchange-desc">交换成功后,双方可以查看彼此的微信号<br/>您可以前往个人中心管理微信号</view>
  790. </view>
  791. <!-- 底部按钮区域 -->
  792. <view class="phone-exchange-buttons">
  793. <view class="phone-exchange-btn phone-exchange-btn-cancel" @click="cancelWechatExchange">取消</view>
  794. <view class="phone-exchange-btn phone-exchange-btn-confirm" @click="confirmWechatExchange">确认</view>
  795. </view>
  796. </view>
  797. </u-popup>
  798. <!-- 交换手机号自定义弹窗 -->
  799. <u-popup v-model="phoneExchangeShow" mode="center" z-index="999" border-radius="24" :mask-close-able="false" width="80%">
  800. <view class="phone-exchange-popup">
  801. <!-- 顶部背景区域 -->
  802. <view class="phone-exchange-header">
  803. <image src="../../static/im/Artwork.png" class="phone-exchange-bg" mode="aspectFill"></image>
  804. </view>
  805. <!-- 中间内容区域 -->
  806. <view class="phone-exchange-content">
  807. <view class="phone-exchange-title">确认与对方交换电话吗?</view>
  808. <view class="phone-exchange-desc">交换成功后,双方可以查看彼此的电话号码<br/>您可以前往个人中心管理电话号码</view>
  809. </view>
  810. <!-- 底部按钮区域 -->
  811. <view class="phone-exchange-buttons">
  812. <view class="phone-exchange-btn phone-exchange-btn-cancel" @click="cancelPhoneExchange">取消</view>
  813. <view class="phone-exchange-btn phone-exchange-btn-confirm" @click="confirmPhoneExchange">确认</view>
  814. </view>
  815. </view>
  816. </u-popup>
  817. </view>
  818. </template>
  819. <script>
  820. const RECONNECT_INTERVAL = 3000; // 延迟3秒后进行重连
  821. const HEARTBEAT_INTERVAL = 20000; // 每20秒发送一次心跳消息
  822. import configdata from '../../common/config.js';
  823. import emoji from '../../common/emoji.json';
  824. export default {
  825. data() {
  826. return {
  827. msshow: false,
  828. params: {
  829. year: false,
  830. month: true,
  831. day: true,
  832. hour: true,
  833. minute: true,
  834. second: false
  835. },
  836. msTime: false,
  837. miamshi: {
  838. interviewDateTime: '', //面试时间
  839. companyId: '', //公司id
  840. remarks: '', //面试备注
  841. userId: '', //面试者id
  842. postPushId: '', //岗位id
  843. province: '', //省
  844. city: '', //市
  845. county: '', //区
  846. lng: '', //经度
  847. lat: '', //纬度
  848. detailedAddress: '', //详细地址
  849. },
  850. tips: {
  851. text: '操作',
  852. color: 'black',
  853. fontSize: 28
  854. },
  855. activelist: [],
  856. showActive: false,
  857. list: [{
  858. text: '查看简历',
  859. color: 'black',
  860. fontSize: 28
  861. }, {
  862. text: '查看企业',
  863. color: 'black',
  864. fontSize: 28
  865. }],
  866. show: false,
  867. recordLength: 0,
  868. initPoint: {
  869. identifier: 0,
  870. Y: 0
  871. },
  872. showChangYong: false,
  873. changYongList: [],
  874. // 工作描述展开状态
  875. isJobDescExpanded: false,
  876. //播放语音相关参数
  877. AUDIO: uni.createInnerAudioContext(),
  878. playMsgid: null,
  879. VoiceTimer: null,
  880. //文字消息
  881. textMsg: '',
  882. //消息列表
  883. isHistoryLoading: false,
  884. scrollAnimation: false,
  885. scrollTop: 0,
  886. scrollToView: '',
  887. msgList: [],
  888. msgImgList: [],
  889. myuid: 0,
  890. //录音相关参数
  891. // #ifndef H5
  892. //H5不能录音
  893. RECORDER: uni.getRecorderManager(),
  894. // #endif
  895. isVoice: false,
  896. voiceTis: '按住 说话',
  897. recordTis: "手指上滑 取消发送",
  898. recording: false,
  899. willStop: false,
  900. initPoint: {
  901. identifier: 0,
  902. Y: 0
  903. },
  904. recordTimer: null,
  905. recordLength: 0,
  906. //播放语音相关参数
  907. AUDIO: uni.createInnerAudioContext(),
  908. playMsgid: null,
  909. VoiceTimer: null,
  910. // 抽屉参数
  911. popupLayerClass: '',
  912. // more参数
  913. hideMore: true,
  914. //表情定义
  915. hideEmoji: true,
  916. emojiList: emoji,
  917. msg: false,
  918. type4: [],
  919. listRight: {
  920. chat: {
  921. userHead: ""
  922. },
  923. content: "",
  924. messageType: 1,
  925. type: 1
  926. },
  927. content: '',
  928. chatId: '',
  929. type: 1,
  930. ListItem: [],
  931. index: 0,
  932. page: 1,
  933. size: 100,
  934. byUserId: 0,
  935. imageUrl: '/static/logo.png',
  936. chatConversationId: 0,
  937. userId: 0,
  938. byNickName: '',
  939. countDown: '',
  940. messages: '',
  941. scrollInto: '',
  942. tUserId: '', //对方id
  943. companyId: '', //对方企业的id
  944. activeInfo: {},
  945. userType: '',
  946. postPushId: '', //岗位id
  947. resumesId: '', //简历id
  948. postPushInfo: {}, //岗位信息
  949. resumesInfo: {}, //简历信息
  950. isSendPhone: false, //是否交换手机号
  951. isSendWx: false, //是否交换微信
  952. mianshiShow: false, //约面试弹窗
  953. phoneExchangeShow: false, //交换手机号弹窗
  954. wechatExchangeShow: false, //交换微信弹窗
  955. records: {}, //面试邀请信息
  956. recordsInter: '',
  957. mapsValue: '',
  958. showModal: true,
  959. arr: [],
  960. old: {
  961. scrollTop: 0 //记录旧的scrollTop值
  962. },
  963. isOpen: false, //scoket是否正在链接
  964. socketTimer: null, //心跳定时器
  965. isVip: false, //是否是会员
  966. isVideo: false, //是否打视频
  967. };
  968. },
  969. onUnload() {
  970. uni.closeSocket()
  971. uni.hideLoading()
  972. clearInterval(this.recordsInter)
  973. this.recordsInter = null
  974. clearInterval(this.socketTimer)
  975. this.socketTimer = null
  976. },
  977. onLoad(d) {
  978. console.log(d, 'zzzzzzzzz')
  979. if (d.postPushId) {
  980. this.postPushId = d.postPushId
  981. }
  982. if (d.resumesId) {
  983. this.resumesId = d.resumesId
  984. }
  985. this.userType = uni.getStorageSync('userType')
  986. if (this.userType == 1) {
  987. this.postPushId = d.postPushId
  988. //获取岗位信息
  989. this.getPostPushInfo(this.postPushId)
  990. this.getInterviewList()
  991. } else {
  992. this.resumesId = d.resumesId
  993. //获取简历信息
  994. this.getResumesInfo(this.resumesId)
  995. }
  996. this.userId = this.$queue.getData('userId');
  997. this.getMessage();
  998. this.connect();
  999. this.byNickName = d.byNickName;
  1000. this.byUserId = d.byUserId;
  1001. if (d.chatConversationId) {
  1002. this.chatConversationId = d.chatConversationId;
  1003. this.getTimeOrListItem1();
  1004. } else {
  1005. this.insertChat();
  1006. }
  1007. let image_url = this.$queue.getData('avatar');
  1008. if (image_url && image_url !== 'undefined') {
  1009. this.imageUrl = image_url;
  1010. } else {
  1011. this.imageUrl = '/static/logo.png';
  1012. }
  1013. // this.emojiList.forEach(d =>{
  1014. // d.forEach(e =>{
  1015. // console.log('/static/emoji/' + e.url)
  1016. // });
  1017. // });
  1018. //语音自然播放结束
  1019. this.AUDIO.onEnded((res) => {
  1020. this.playMsgid = null;
  1021. });
  1022. // #ifndef H5
  1023. //录音开始事件
  1024. this.RECORDER.onStart((e) => {
  1025. this.recordBegin(e);
  1026. })
  1027. //录音结束事件
  1028. this.RECORDER.onStop((e) => {
  1029. this.recordEnd(e);
  1030. })
  1031. // #endif
  1032. },
  1033. onShow() {
  1034. if (this.chatConversationId) {
  1035. this.getTimeOrListItem1();
  1036. }
  1037. // #ifdef MP-WEIXIN
  1038. this.$Request.getT('/app/common/type/342').then(res => { //面试通知
  1039. if (res.code == 0) {
  1040. if (res.data && res.data.value) {
  1041. this.arr.push(res.data.value)
  1042. }
  1043. }
  1044. })
  1045. if (this.showModal) {
  1046. this.openMsg()
  1047. }
  1048. // #endif
  1049. this.userType = uni.getStorageSync('userType')
  1050. this.getChangYong();
  1051. // if (this.isOpen) {
  1052. // this.connect();
  1053. // }
  1054. if (this.userType == 1) {
  1055. //获取用户是否有该岗位待接受的面试邀请
  1056. this.recordsInter = setInterval(() => {
  1057. this.getInterviewList()
  1058. }, 5000)
  1059. }
  1060. this.getUserInfo()
  1061. },
  1062. onBackPress() {
  1063. this.AUDIO.stop();
  1064. this.playMsgid = null;
  1065. },
  1066. onHide() {
  1067. // this.AUDIO.stop();
  1068. // this.playMsgid = null;
  1069. // uni.closeSocket()
  1070. // clearInterval(this.recordsInter)
  1071. // this.recordsInter = null
  1072. },
  1073. methods: {
  1074. // 返回上一页
  1075. goBack() {
  1076. uni.navigateBack();
  1077. },
  1078. // 显示更多选项
  1079. showMoreOptions() {
  1080. // 可以添加更多选项的弹窗或菜单
  1081. // console.log('显示更多选项');
  1082. uni.navigateTo({
  1083. url:'/pages/msg/interviewInvitation'
  1084. })
  1085. },
  1086. // 切换工作描述展开状态
  1087. toggleJobDesc() {
  1088. this.isJobDescExpanded = !this.isJobDescExpanded;
  1089. },
  1090. getUserInfo() {
  1091. this.$Request.get("/app/user/selectUserById").then(res => {
  1092. if (res.code == 0) {
  1093. if (this.userType == 1) { //用户
  1094. if (res.data.isUserVip == 1) { //判断用户是否是vip
  1095. this.isVip = true
  1096. } else {
  1097. this.isVip = false
  1098. }
  1099. } else { //企业
  1100. if (res.data.isCompanyVip == 1) { //判断企业用户是否是vip
  1101. this.isVip = true
  1102. } else {
  1103. this.isVip = false
  1104. }
  1105. }
  1106. }
  1107. })
  1108. },
  1109. /**
  1110. * @param {Object} type 1:语音 2视频
  1111. */
  1112. sendCallVideo(type) {
  1113. if (!this.isVip) {
  1114. uni.showModal({
  1115. title: '提示',
  1116. content: type == 1 ? '语音为会员专属功能,请开通会员!' : '视频为会员专属功能,请开通会员!',
  1117. confirmText: '开通会员',
  1118. cancelText: '取消',
  1119. confirmColor: '#016BF6',
  1120. complete(ret) {
  1121. if (ret.confirm) {
  1122. uni.navigateTo({
  1123. url: '/my/vip/index'
  1124. })
  1125. }
  1126. }
  1127. })
  1128. return
  1129. }
  1130. if (this.isVideo) {
  1131. return
  1132. }
  1133. this.isVideo = true
  1134. let data = {
  1135. focusedUserId: this.byUserId, //对方的userId
  1136. messageType: type == 1 ? 21 : 20,
  1137. userId: uni.getStorageSync('userId'), //我的userId
  1138. userType: this.userType, //1:用户 2:企业,
  1139. postPushId: this.postPushId,
  1140. resumesId: this.resumesId
  1141. }
  1142. let that = this
  1143. this.$Request.postJson('/app/chat/insertChatConversationByChatVideo', data).then(res => {
  1144. if (res.code == 0) {
  1145. //isRol 1:发起人 2:收到人
  1146. console.log(res)
  1147. uni.navigateTo({
  1148. url: '/my/videoVoice/videoVoice?byUserId=' + this.byUserId +
  1149. '&chatContentId=' + res.data.chatContentId +
  1150. '&isRol=1&messageType=' + data.messageType + '&chatConversationId=' + res
  1151. .data
  1152. .chatConversationId + '&userType=' + data.userType + '&postPushId=' + data
  1153. .postPushId + '&resumesId=' + data.resumesId,
  1154. success() {
  1155. uni.setStorageSync('isDial', true)
  1156. uni.setStorageSync('videoStatus', 1)
  1157. that.isVideo = false
  1158. }
  1159. })
  1160. } else {
  1161. that.isVideo = false
  1162. uni.showToast({
  1163. title: res.msg,
  1164. icon: 'none'
  1165. })
  1166. }
  1167. })
  1168. },
  1169. scroll(e) {
  1170. this.old.scrollTop = e.detail.scrollTop
  1171. },
  1172. // 开启订阅消息
  1173. openMsg() {
  1174. console.log('订阅消息')
  1175. var that = this
  1176. uni.getSetting({
  1177. withSubscriptions: true, //是否获取用户订阅消息的订阅状态,默认false不返回
  1178. success(ret) {
  1179. console.log(ret.subscriptionsSetting, '------------------')
  1180. // if (ret.subscriptionsSetting.itemSettings && Object.keys(ret.subscriptionsSetting.itemSettings).length == 2) {
  1181. if (ret.subscriptionsSetting.itemSettings) {
  1182. uni.setStorageSync('sendMsg', true)
  1183. uni.openSetting({ // 打开设置页
  1184. success(rea) {
  1185. console.log(rea.authSetting)
  1186. }
  1187. });
  1188. } else { // 用户没有点击“总是保持以上,不再询问”则每次都会调起订阅消息
  1189. console.log(99999)
  1190. uni.setStorageSync('sendMsg', false)
  1191. uni.showModal({
  1192. title: '提示',
  1193. content: '为了更好的体验,请绑定消息推送',
  1194. confirmText: '确定',
  1195. cancelText: '取消',
  1196. confirmColor: '#016BF6',
  1197. success: function(res) {
  1198. if (res.confirm) {
  1199. console.log(that.arr)
  1200. wx.requestSubscribeMessage({
  1201. tmplIds: that.arr,
  1202. success(re) {
  1203. console.log(JSON.stringify(re),
  1204. '++++++++++++++')
  1205. var datas = JSON.stringify(re);
  1206. if (datas.indexOf("accept") != -1) {
  1207. console.log(re)
  1208. uni.setStorageSync('sendMsg', true)
  1209. }
  1210. },
  1211. fail: (res) => {
  1212. console.log(res)
  1213. }
  1214. })
  1215. uni.setStorageSync('sendMsg', true)
  1216. console.log('确认')
  1217. that.showModal = false
  1218. } else if (res.cancel) {
  1219. console.log('取消')
  1220. uni.setStorageSync('sendMsg', false)
  1221. that.showModal = true
  1222. }
  1223. }
  1224. })
  1225. }
  1226. }
  1227. })
  1228. },
  1229. /**
  1230. * @param {Object} info 内容
  1231. * @param {Object} userType 用户类型
  1232. * @param {Object} type 参数类型
  1233. */
  1234. copyss(info, userType, type) {
  1235. let content = ''
  1236. switch (type) {
  1237. //复制手机号
  1238. case 'phone':
  1239. if (userType == 1) {
  1240. content = JSON.parse(info).companyPhone
  1241. } else {
  1242. content = JSON.parse(info).userPhone
  1243. }
  1244. break;
  1245. //复制微信号
  1246. case 'wx':
  1247. if (userType == 1) {
  1248. content = JSON.parse(info).companyWx
  1249. } else {
  1250. content = JSON.parse(info).userWx
  1251. }
  1252. break;
  1253. default:
  1254. break;
  1255. }
  1256. this.copy(content)
  1257. },
  1258. openMapss(latitude, longitude, name) {
  1259. uni.openLocation({
  1260. latitude: latitude - 0, //要去的纬度-地址
  1261. longitude: longitude - 0, //要去的经度-地址
  1262. name: name, //地址名称
  1263. address: name, //详细地址名称
  1264. success: function() {
  1265. console.log('导航成功');
  1266. },
  1267. fail: function(error) {
  1268. console.log(error)
  1269. }
  1270. });
  1271. },
  1272. goMapss() {
  1273. let that = this
  1274. uni.chooseLocation({
  1275. success: function(res) {
  1276. console.log('位置名称:' + res.name);
  1277. console.log('详细地址:' + res.address);
  1278. console.log('纬度:' + res.latitude);
  1279. console.log('经度:' + res.longitude);
  1280. let mapsValue = JSON.stringify(res);
  1281. that.setChatSave(18, mapsValue)
  1282. // console.log(typeof(res))
  1283. // return
  1284. that.showMore();
  1285. }
  1286. });
  1287. },
  1288. //接受邀请
  1289. setJuJues(item) {
  1290. // #ifdef MP-WEIXIN
  1291. if (uni.getStorageSync('sendMsg')) {
  1292. // console.log('授权+1')
  1293. wx.requestSubscribeMessage({
  1294. tmplIds: this.arr,
  1295. success(re) {
  1296. // console.log(JSON.stringify(re), 111111111111)
  1297. var datas = JSON.stringify(re);
  1298. if (datas.indexOf("accept") != -1) {
  1299. // console.log(re)
  1300. }
  1301. },
  1302. fail: (res) => {
  1303. // console.log(res)
  1304. }
  1305. })
  1306. }
  1307. // #endif
  1308. let that = this
  1309. uni.showModal({
  1310. title: '提示',
  1311. content: '确定接受来自' + item.company.companyName + '的面试邀请吗?',
  1312. confirmColor: '#016BF6',
  1313. complete(ret) {
  1314. if (ret.confirm) {
  1315. let data = {
  1316. recordId: item.recordId,
  1317. type: 1
  1318. }
  1319. that.$Request.getT("/app/interviewRecord/userUpdateInter", data).then(res => {
  1320. if (res.code == 0) {
  1321. uni.showToast({
  1322. // title: '已接受来自' + item.company.companyName + '的面试邀请'
  1323. title: '已接受面试邀请'
  1324. })
  1325. that.msshow = false
  1326. } else {
  1327. uni.showToast({
  1328. title: res.msg,
  1329. icon: 'none'
  1330. })
  1331. }
  1332. })
  1333. }
  1334. }
  1335. })
  1336. },
  1337. //去导航
  1338. goMapDap(info) {
  1339. uni.openLocation({
  1340. latitude: info.lat,
  1341. longitude: info.lng,
  1342. address: info.detailedAddress,
  1343. name: info.detailedAddress,
  1344. complete(ret) {
  1345. }
  1346. })
  1347. },
  1348. //拒绝邀请
  1349. setJuJue(item) {
  1350. let that = this
  1351. uni.showModal({
  1352. title: '提示',
  1353. content: '确定拒绝来自' + item.company.companyName + '的面试邀请吗?',
  1354. confirmColor: '#016BF6',
  1355. complete(ret) {
  1356. if (ret.confirm) {
  1357. let data = {
  1358. recordId: item.recordId,
  1359. type: 2
  1360. }
  1361. that.$Request.getT("/app/interviewRecord/userUpdateInter", data).then(res => {
  1362. if (res.code == 0) {
  1363. uni.showToast({
  1364. title: '已拒绝来自' + item.company.companyName + '的面试邀请'
  1365. })
  1366. that.msshow = false
  1367. } else {
  1368. uni.showToast({
  1369. title: res.msg,
  1370. icon: 'none'
  1371. })
  1372. }
  1373. })
  1374. }
  1375. }
  1376. })
  1377. },
  1378. //获取用户是否有面试记录
  1379. getInterviewList() {
  1380. let data = {
  1381. userId: uni.getStorageSync('userId'),
  1382. status: 1,
  1383. postPushId: this.postPushId
  1384. }
  1385. this.$Request.getT("/app/interviewRecord/interviewList", data).then(res => {
  1386. if (res.code == 0) {
  1387. if ((res.data.records).length > 0) {
  1388. this.records = res.data.records[0]
  1389. this.msshow = true
  1390. } else {
  1391. this.msshow = false
  1392. }
  1393. } else {
  1394. uni.showToast({
  1395. title: res.msg,
  1396. icon: 'none'
  1397. })
  1398. this.msshow = false
  1399. }
  1400. })
  1401. },
  1402. submitMs() {
  1403. if (!this.miamshi.interviewDateTime) {
  1404. this.$refs.uToast.show({
  1405. title: '请选择面试时间',
  1406. type: 'default',
  1407. position: 'bottom'
  1408. })
  1409. return
  1410. }
  1411. if (!this.miamshi.detailedAddress) {
  1412. this.$refs.uToast.show({
  1413. title: '请选择面试地点',
  1414. type: 'default',
  1415. position: 'bottom'
  1416. })
  1417. return
  1418. }
  1419. let that = this
  1420. uni.showModal({
  1421. title: '提示',
  1422. content: '确定发起面试邀请吗?',
  1423. confirmColor: '#016BF6',
  1424. complete(ret) {
  1425. if (ret.confirm) {
  1426. let data = {
  1427. interviewDateTime: that.miamshi.interviewDateTime + ':00',
  1428. companyId: uni.getStorageSync('companyId'),
  1429. remarks: that.miamshi.remarks,
  1430. userId: that.byUserId, //求职者id
  1431. postPushId: that.postPushId,
  1432. province: that.miamshi.province,
  1433. city: that.miamshi.city,
  1434. county: that.miamshi.county,
  1435. lng: that.miamshi.lng,
  1436. lat: that.miamshi.lat,
  1437. detailedAddress: that.miamshi.detailedAddress
  1438. }
  1439. that.$Request.postJson("/app/interviewRecord/saveInterview", data).then(res => {
  1440. if (res.code == 0) {
  1441. uni.showToast({
  1442. title: '面试邀请已发送'
  1443. })
  1444. that.mianshiShow = false
  1445. } else {
  1446. that.mianshiShow = false
  1447. uni.showToast({
  1448. title: res.msg,
  1449. icon: 'none'
  1450. })
  1451. }
  1452. })
  1453. }
  1454. }
  1455. })
  1456. },
  1457. //关闭弹窗的时候清空表单的值
  1458. cleanMs() {
  1459. this.miamshi = {
  1460. interviewDateTime: '', //面试时间
  1461. companyId: '', //公司id
  1462. remarks: '', //面试备注
  1463. userId: '', //面试者id
  1464. postPushId: '', //岗位id
  1465. province: '', //省
  1466. city: '', //市
  1467. county: '', //区
  1468. lng: '', //经度
  1469. lat: '', //纬度
  1470. detailedAddress: '', //详细地址
  1471. }
  1472. },
  1473. // 点击调起地图选择位置
  1474. goMap() {
  1475. let that = this
  1476. uni.chooseLocation({
  1477. success: function(res) {
  1478. let arrress = res.address
  1479. let reg = /.+?(省|市|自治区|自治州|县|区)/g;
  1480. let adds = arrress.match(reg)
  1481. console.log(adds)
  1482. that.miamshi.province = adds[0]
  1483. that.miamshi.city = adds[1]
  1484. that.miamshi.county = adds[2]
  1485. that.miamshi.detailedAddress = res.address + '' + res.name
  1486. that.miamshi.lat = res.latitude
  1487. that.miamshi.lng = res.longitude
  1488. }
  1489. });
  1490. },
  1491. //选择面试时间
  1492. mianshiConfirm(e) {
  1493. //获取当前时间的年份
  1494. let date = new Date()
  1495. let year = date.getFullYear()
  1496. this.miamshi.interviewDateTime = year + '-' + e.month + '-' + e.day + ' ' + e.hour + ':' + e.minute
  1497. },
  1498. mianshiF() {
  1499. // #ifdef MP-WEIXIN
  1500. if (uni.getStorageSync('sendMsg')) {
  1501. // console.log('授权+1')
  1502. wx.requestSubscribeMessage({
  1503. tmplIds: this.arr,
  1504. success(re) {
  1505. // console.log(JSON.stringify(re), 111111111111)
  1506. var datas = JSON.stringify(re);
  1507. if (datas.indexOf("accept") != -1) {
  1508. // console.log(re)
  1509. }
  1510. },
  1511. fail: (res) => {
  1512. // console.log(res)
  1513. }
  1514. })
  1515. }
  1516. // #endif
  1517. let data = {
  1518. userId: this.byUserId,
  1519. postPushId: this.postPushId
  1520. }
  1521. this.$Request.getT("/app/interviewRecord/isSendView", data).then(res => {
  1522. if (res.code == 0) {
  1523. if (res.data) {
  1524. this.mianshiShow = true
  1525. } else {
  1526. uni.showToast({
  1527. title: '已发送过面试邀请',
  1528. icon: 'none'
  1529. })
  1530. this.mianshiShow = false
  1531. }
  1532. } else {
  1533. this.mianshiShow = false
  1534. uni.showToast({
  1535. title: res.msg,
  1536. icon: 'none'
  1537. })
  1538. }
  1539. })
  1540. },
  1541. //请求拒绝
  1542. refuseFun(id) {
  1543. let that = this
  1544. uni.showModal({
  1545. title: '提示',
  1546. content: '确定拒绝吗?',
  1547. confirmColor: '#016BF6',
  1548. complete(ret) {
  1549. if (ret.confirm) {
  1550. let data = {
  1551. chatContentId: id
  1552. }
  1553. that.$Request.getT("/app/chat/refuseReqs", data).then(res => {
  1554. if (res.code == 0) {
  1555. uni.showToast({
  1556. title: '已拒绝'
  1557. })
  1558. that.setChatSave(24)
  1559. that.getTimeOrListItem1()
  1560. that.getStatusInfo()
  1561. } else {
  1562. uni.showToast({
  1563. title: res.msg,
  1564. icon: 'none'
  1565. })
  1566. }
  1567. })
  1568. }
  1569. }
  1570. })
  1571. },
  1572. // 同意简历请求并发送简历
  1573. sendResumesSave() {
  1574. let that = this
  1575. let data = {
  1576. to: this.byUserId, //接收人的userId
  1577. postPushId: this.postPushId, //岗位id
  1578. }
  1579. this.$Request.postT("/app/resumes/sendResumes", data).then(res => {
  1580. if (res.code == 0) {
  1581. uni.showToast({
  1582. title: '简历已发送',
  1583. })
  1584. that.setChatSave(24)
  1585. that.getTimeOrListItem1()
  1586. that.getStatusInfo()
  1587. } else {
  1588. uni.showToast({
  1589. title: res.msg,
  1590. icon: 'none'
  1591. })
  1592. }
  1593. })
  1594. },
  1595. resumesTy() {
  1596. let that = this
  1597. uni.showModal({
  1598. title: '提示',
  1599. content: '确定发送简历给对方?',
  1600. confirmColor: '#016BF6',
  1601. complete(ret) {
  1602. if (ret.confirm) {
  1603. that.sendResumesSave()
  1604. }
  1605. }
  1606. })
  1607. },
  1608. //求简历
  1609. giveSendResumes() {
  1610. let that = this
  1611. uni.showModal({
  1612. title: '提示',
  1613. content: '是否将简历请求发送给对方?,对方同意后将会收到对方的简历',
  1614. confirmColor: '#016BF6',
  1615. complete(ret) {
  1616. if (ret.confirm) {
  1617. that.setChatSave(9)
  1618. }
  1619. }
  1620. })
  1621. },
  1622. //发简历
  1623. sendResumes() {
  1624. let that = this
  1625. uni.showModal({
  1626. title: '提示',
  1627. content: '是否将简历发送给对方?',
  1628. confirmColor: '#016BF6',
  1629. complete(ret) {
  1630. if (ret.confirm) {
  1631. that.sendResumesSave()
  1632. }
  1633. }
  1634. })
  1635. },
  1636. //获取交换状态
  1637. getStatusInfo() {
  1638. let data = {
  1639. chatConversationId: this.chatConversationId
  1640. }
  1641. this.$Request.getT("/app/chat/getConversationInfo", data).then(res => {
  1642. if (res.code == 0) {
  1643. if (res.data.isSendWx) {
  1644. this.isSendWx = true
  1645. } else {
  1646. this.isSendWx = false
  1647. }
  1648. if (res.data.isSendPhone) {
  1649. this.isSendPhone = true
  1650. } else {
  1651. this.isSendPhone = false
  1652. }
  1653. }
  1654. })
  1655. },
  1656. //交换微信号弹窗
  1657. currentWchat() {
  1658. let that = this
  1659. if (!uni.getStorageSync('weChatNum')) {
  1660. uni.showModal({
  1661. title: '提示',
  1662. content: '请先再个人信息页面完善微信号后操作',
  1663. confirmColor: '#016BF6',
  1664. confirmText: '去完善',
  1665. complete(re) {
  1666. if (re.confirm) {
  1667. uni.navigateTo({
  1668. url: '/pages/my/userinfo'
  1669. })
  1670. }
  1671. }
  1672. })
  1673. return
  1674. }
  1675. if (this.isSendWx == false) {
  1676. this.wechatExchangeShow = true;
  1677. } else {
  1678. uni.showToast({
  1679. title: '已交换过微信号,请查看聊天记录',
  1680. icon: 'none'
  1681. })
  1682. }
  1683. },
  1684. //同意交换手机号/微信
  1685. tongyi(messageType, chatContentId) {
  1686. if (messageType == 6 && !uni.getStorageSync('weChatNum')) {
  1687. uni.showModal({
  1688. title: '提示',
  1689. content: '请先再个人信息页面完善微信号后操作',
  1690. confirmColor: '#016BF6',
  1691. confirmText: '去完善',
  1692. complete(re) {
  1693. if (re.confirm) {
  1694. uni.navigateTo({
  1695. url: '/pages/my/userinfo'
  1696. })
  1697. }
  1698. }
  1699. })
  1700. return
  1701. }
  1702. let that = this
  1703. uni.showModal({
  1704. title: '提示',
  1705. content: messageType == 5 ? '同意后将交换手机号,是否同意?' : '同意后将交换微信号,是否同意?',
  1706. confirmColor: '#016BF6',
  1707. complete(ret) {
  1708. if (ret.confirm) {
  1709. let data = {
  1710. messageType: messageType,
  1711. chatContentId: chatContentId
  1712. }
  1713. that.$Request.postT("/app/chat/sendPhoneOrWx", data).then(res => {
  1714. if (res.code == 0) {
  1715. that.setChatSave(24)
  1716. that.getTimeOrListItem1()
  1717. that.getStatusInfo()
  1718. }
  1719. })
  1720. }
  1721. }
  1722. })
  1723. },
  1724. //交换手机号弹窗
  1725. currentPhone() {
  1726. if (this.isSendPhone == false) {
  1727. this.phoneExchangeShow = true;
  1728. } else {
  1729. uni.showToast({
  1730. title: '已交换过手机号,请查看聊天记录',
  1731. icon: 'none'
  1732. })
  1733. }
  1734. },
  1735. // 取消交换手机号
  1736. cancelPhoneExchange() {
  1737. this.phoneExchangeShow = false;
  1738. },
  1739. // 确认交换手机号
  1740. confirmPhoneExchange() {
  1741. this.phoneExchangeShow = false;
  1742. this.setChatSave(5);
  1743. },
  1744. // 取消微信交换
  1745. cancelWechatExchange() {
  1746. this.wechatExchangeShow = false;
  1747. },
  1748. // 确认微信交换
  1749. confirmWechatExchange() {
  1750. this.wechatExchangeShow = false;
  1751. this.setChatSave(6);
  1752. },
  1753. goNav(url) {
  1754. uni.navigateTo({
  1755. url: url
  1756. })
  1757. },
  1758. //获取简历数据
  1759. getResumesInfo(id) {
  1760. this.$Request.getT("/app/resumes/selectResumesByResumesId", {
  1761. userId: uni.getStorageSync('userId'),
  1762. resumesId: id,
  1763. companyId: uni.getStorageSync('companyId')
  1764. }).then(res => {
  1765. if (res.code == 0) {
  1766. let title = res.data.resumesName
  1767. uni.setNavigationBarTitle({
  1768. title: title
  1769. })
  1770. this.resumesInfo = res.data
  1771. // this.postPushInfo.positionWelfare = this.postPushInfo.positionWelfare.split(',')
  1772. }
  1773. })
  1774. },
  1775. gotoInfo(id) {
  1776. uni.navigateTo({
  1777. url: '/pages/index/game/order?postPushId=' + id
  1778. })
  1779. },
  1780. //获取岗位数据
  1781. getPostPushInfo(id) {
  1782. this.$Request.getT("/app/postPush/selectPostPushDetails", {
  1783. userId: uni.getStorageSync('userId'),
  1784. postPushId: id
  1785. }).then(res => {
  1786. if (res.code == 0) {
  1787. let title = res.data.company.companyName
  1788. uni.setNavigationBarTitle({
  1789. title: title
  1790. })
  1791. this.postPushInfo = res.data
  1792. this.postPushInfo.positionWelfare = this.postPushInfo.positionWelfare.split(',')
  1793. }
  1794. })
  1795. },
  1796. caozuoActive(item, type) {
  1797. if (type == 1) {
  1798. this.activelist = [{
  1799. text: '复制',
  1800. color: 'black',
  1801. fontSize: 24
  1802. }, {
  1803. text: '撤回',
  1804. color: 'black',
  1805. fontSize: 24
  1806. }]
  1807. } else {
  1808. this.activelist = [{
  1809. text: '撤回',
  1810. color: 'black',
  1811. fontSize: 24
  1812. }]
  1813. }
  1814. this.activeInfo = item
  1815. this.showActive = true
  1816. },
  1817. activeclick(index) {
  1818. if (this.activelist[index].text == '复制') { // 复制
  1819. this.copy(this.activeInfo.content)
  1820. } else { //撤回
  1821. let t2 = this.activeInfo.createTimes; //格式不正确需要转换
  1822. let aftert2 = new Date(t2.replace(/-/g, "/")); //转换
  1823. let data = new Date(); //获取当前时间
  1824. let times = data.getTime() - aftert2.getTime(); //时间差的毫秒数
  1825. //计算分钟数
  1826. let minu = parseInt(times / (1000 * 60))
  1827. if (minu > 5) {
  1828. uni.showToast({
  1829. title: '超过五分钟无法撤回',
  1830. icon: 'none'
  1831. })
  1832. } else {
  1833. let that = this
  1834. uni.showModal({
  1835. title: '提示',
  1836. content: '确定要撤回吗?',
  1837. confirmColor: '#016BF6',
  1838. complete(ret) {
  1839. if (ret.confirm) {
  1840. that.$Request.postT('/app/chat/deleteChatContentById', {
  1841. chatContentId: that.activeInfo.chatContentId
  1842. })
  1843. .then(res => {
  1844. if (res.code == 0) {
  1845. uni.showToast({
  1846. title: '已撤回',
  1847. icon: 'none'
  1848. })
  1849. that.getTimeOrListItem1();
  1850. }
  1851. });
  1852. }
  1853. }
  1854. })
  1855. }
  1856. }
  1857. },
  1858. //跳转
  1859. click(index) {
  1860. console.log(index)
  1861. switch (index) {
  1862. case 0: //简历
  1863. uni.navigateTo({
  1864. url: '/pages/index/game/orderDet?userId=' + this.tUserId
  1865. })
  1866. break;
  1867. case 1: //企业
  1868. uni.navigateTo({
  1869. url: '/my/enterpriseInfo/enterpriseInfo?companyId=' + this.companyId + '&type=yes'
  1870. })
  1871. break;
  1872. default:
  1873. break;
  1874. }
  1875. },
  1876. //消息公告
  1877. getMessage() {
  1878. this.$Request.getT('/app/common/type/311')
  1879. .then(res => {
  1880. if (res.code == 0) {
  1881. this.messages = res.data.value
  1882. }
  1883. });
  1884. },
  1885. showChangYongSelect() {
  1886. this.showMore();
  1887. this.showChangYong = !this.showChangYong;
  1888. },
  1889. selConfirm(e) {
  1890. // this.form.game = e[0].label
  1891. // this.form.gameId = e[0].value
  1892. this.content = e[0].label;
  1893. this.setChatSave(1);
  1894. },
  1895. getChangYong() {
  1896. this.$Request.getT('/app/message/selectMessageByUserId?page=1&limit=100&state=20')
  1897. .then(res => {
  1898. if (res.code == 0) {
  1899. this.changYongList = [];
  1900. res.data.list.forEach(d => {
  1901. let data = {
  1902. label: d.content,
  1903. value: d.id
  1904. }
  1905. this.changYongList.push(data);
  1906. });
  1907. }
  1908. });
  1909. },
  1910. goGuanZhu(item) {
  1911. this.hideDrawer();
  1912. this.tUserId = item.userId
  1913. this.$Request.get('/app/user/selectUserByIds', {
  1914. 'userId': item.userId
  1915. }).then(res => {
  1916. if (res.code == 0) {
  1917. if (res.data.userType == 1 || res.data.userType == null) { //个人
  1918. uni.navigateTo({
  1919. url: '/pages/index/game/orderDet?userId=' + item.userId
  1920. })
  1921. } else {
  1922. this.$Request.get('/app/resumes/selectResumesByUserIds', {
  1923. 'userId': item.userId
  1924. }).then(ret => {
  1925. if (ret.code == 0) {
  1926. if (ret.data && JSON.stringify(ret.data) != '{}') { //有简历则选择
  1927. this.$Request.get('/app/company/selectCompanyByUserIds', {
  1928. userId: item.userId
  1929. }).then(ree => {
  1930. if (ree.code == 0) {
  1931. this.companyId = ree.data.companyId
  1932. }
  1933. });
  1934. this.show = true
  1935. } else { //没有简历直接跳转企业详情
  1936. this.$Request.get('/app/company/selectCompanyByUserIds', {
  1937. userId: item.userId
  1938. }).then(ree => {
  1939. if (ree.code == 0) {
  1940. uni.navigateTo({
  1941. url: '/my/enterpriseInfo/enterpriseInfo?companyId=' +
  1942. ree.data.companyId + '&type=yes'
  1943. })
  1944. }
  1945. });
  1946. }
  1947. }
  1948. });
  1949. }
  1950. }
  1951. });
  1952. //去关注页面
  1953. },
  1954. //添加常用语/自动回复
  1955. goAdd() {
  1956. this.showMore();
  1957. uni.navigateTo({
  1958. url: '/pages/msg/addmsg'
  1959. });
  1960. },
  1961. goHistory() {
  1962. this.showMore();
  1963. uni.navigateTo({
  1964. url: '/pages/msg/chathistory?chatConversationId=' + this.chatConversationId
  1965. });
  1966. },
  1967. insertChat() {
  1968. let userId = this.$queue.getData('userId');
  1969. let data = {
  1970. focusedUserId: this.byUserId,
  1971. userId: userId
  1972. }
  1973. this.$Request.postJson('/appChat/insertChatConversation', data).then(res => {
  1974. if (res.code == 0 && res.data) {
  1975. this.chatConversationId = res.data.chatConversationId;
  1976. this.getTimeOrListItem1();
  1977. }
  1978. });
  1979. },
  1980. //更多功能(点击+弹出)
  1981. showMore() {
  1982. this.isVoice = false;
  1983. this.hideEmoji = true;
  1984. if (this.hideMore) {
  1985. this.hideMore = false;
  1986. this.openDrawer();
  1987. } else {
  1988. this.hideDrawer();
  1989. }
  1990. },
  1991. // 打开抽屉
  1992. openDrawer() {
  1993. this.popupLayerClass = 'showLayer';
  1994. },
  1995. // 隐藏抽屉
  1996. hideDrawer() {
  1997. this.popupLayerClass = '';
  1998. setTimeout(() => {
  1999. this.hideMore = true;
  2000. this.hideEmoji = true;
  2001. }, 150);
  2002. },
  2003. // 选择表情
  2004. chooseEmoji() {
  2005. this.hideMore = true;
  2006. if (this.hideEmoji) {
  2007. this.hideEmoji = false;
  2008. this.openDrawer();
  2009. } else {
  2010. this.hideDrawer();
  2011. }
  2012. },
  2013. //添加表情
  2014. addEmoji(em) {
  2015. this.textMsg += em.alt;
  2016. },
  2017. //获取焦点,如果不是选表情ing,则关闭抽屉
  2018. textareaFocus() {
  2019. if (this.popupLayerClass == 'showLayer' && this.hideMore == false) {
  2020. this.hideDrawer();
  2021. }
  2022. },
  2023. //替换表情符号为图片
  2024. replaceEmoji(str) {
  2025. let replacedStr = str.replace(/\[([^(\]|\[)]*)\]/g, (item, index) => {
  2026. console.log("item: " + item);
  2027. for (let i = 0; i < this.emojiList.length; i++) {
  2028. let row = this.emojiList[i];
  2029. for (let j = 0; j < row.length; j++) {
  2030. let EM = row[j];
  2031. if (EM.alt == item) {
  2032. //在线表情路径,图文混排必须使用网络路径,请上传一份表情到你的服务器后再替换此路径
  2033. //比如你上传服务器后,你的100.gif路径为https://www.xxx.com/emoji/100.gif 则替换onlinePath填写为https://www.xxx.com/emoji/
  2034. let onlinePath = 'https://s2.ax1x.com/2019/04/12/'
  2035. let imgstr = '<img src="' + onlinePath + this.onlineEmoji[EM.url] + '">';
  2036. console.log("imgstr: " + imgstr);
  2037. return imgstr;
  2038. }
  2039. }
  2040. }
  2041. });
  2042. return '<div style="display: flex;align-items: center;word-wrap:break-word;">' + replacedStr + '</div>';
  2043. },
  2044. // 播放语音
  2045. playVoice(msg, index) {
  2046. console.log(msg)
  2047. this.playMsgid = index;
  2048. this.AUDIO.src = msg;
  2049. this.$nextTick(function() {
  2050. this.AUDIO.play();
  2051. });
  2052. },
  2053. // 录音开始
  2054. voiceBegin(e) {
  2055. if (e.touches.length > 1) {
  2056. return;
  2057. }
  2058. this.initPoint.Y = e.touches[0].clientY;
  2059. this.initPoint.identifier = e.touches[0].identifier;
  2060. this.RECORDER.start({
  2061. format: "mp3"
  2062. }); //录音开始,
  2063. },
  2064. //录音开始UI效果
  2065. recordBegin(e) {
  2066. this.recording = true;
  2067. this.voiceTis = '松开 结束';
  2068. this.recordLength = 0;
  2069. this.recordTimer = setInterval(() => {
  2070. this.recordLength++;
  2071. }, 1000)
  2072. },
  2073. // 录音被打断
  2074. voiceCancel() {
  2075. this.recording = false;
  2076. this.voiceTis = '按住 说话';
  2077. this.recordTis = '手指上滑 取消发送'
  2078. this.willStop = true; //不发送录音
  2079. this.RECORDER.stop(); //录音结束
  2080. },
  2081. // 录音中(判断是否触发上滑取消发送)
  2082. voiceIng(e) {
  2083. if (!this.recording) {
  2084. return;
  2085. }
  2086. let touche = e.touches[0];
  2087. //上滑一个导航栏的高度触发上滑取消发送
  2088. if (this.initPoint.Y - touche.clientY >= uni.upx2px(100)) {
  2089. this.willStop = true;
  2090. this.recordTis = '松开手指 取消发送'
  2091. } else {
  2092. this.willStop = false;
  2093. this.recordTis = '手指上滑 取消发送'
  2094. }
  2095. },
  2096. // 结束录音
  2097. voiceEnd(e) {
  2098. if (!this.recording) {
  2099. return;
  2100. }
  2101. this.recording = false;
  2102. this.voiceTis = '按住 说话';
  2103. this.recordTis = '手指上滑 取消发送'
  2104. this.RECORDER.stop(); //录音结束
  2105. },
  2106. //录音结束(回调文件)
  2107. recordEnd(e) {
  2108. clearInterval(this.recordTimer);
  2109. if (!this.willStop) {
  2110. this.$queue.showLoading('发送中...')
  2111. console.log("e: " + JSON.stringify(e));
  2112. let msg = {
  2113. length: 0,
  2114. url: e.tempFilePath
  2115. }
  2116. let min = parseInt(this.recordLength / 60);
  2117. let sec = this.recordLength % 60;
  2118. min = min < 10 ? '0' + min : min;
  2119. sec = sec < 10 ? '0' + sec : sec;
  2120. msg.length = min + ':' + sec;
  2121. console.log('msg.length___:' + msg.length)
  2122. uni.uploadFile({ // 上传接口
  2123. url: this.config("APIHOST1") + '/alioss/upload', //真实的接口地址
  2124. filePath: e.tempFilePath,
  2125. name: 'file',
  2126. success: (uploadFileRes) => {
  2127. uni.hideLoading();
  2128. this.content = JSON.parse(uploadFileRes.data).data;
  2129. console.log("语音:" + this.content)
  2130. this.setChatSave(3, msg.length);
  2131. uni.hideLoading();
  2132. }
  2133. });
  2134. } else {
  2135. console.log('取消发送录音');
  2136. }
  2137. this.willStop = false;
  2138. },
  2139. // 切换语音/文字输入
  2140. switchVoice() {
  2141. this.hideDrawer();
  2142. this.isVoice = this.isVoice ? false : true;
  2143. },
  2144. copy(content) {
  2145. uni.showModal({
  2146. title: '温馨提示',
  2147. content: '确认要复制此文字吗?',
  2148. showCancel: true,
  2149. cancelText: '取消',
  2150. confirmText: '确认',
  2151. confirmColor: '#016BF6',
  2152. success: res => {
  2153. if (res.confirm) {
  2154. uni.setClipboardData({
  2155. data: content,
  2156. success: r => {
  2157. this.$queue.showToast('复制成功');
  2158. }
  2159. });
  2160. }
  2161. }
  2162. });
  2163. },
  2164. h5Copy(content) {
  2165. if (!document.queryCommandSupported('copy')) {
  2166. // 不支持
  2167. return false
  2168. }
  2169. let textarea = document.createElement("textarea")
  2170. textarea.value = content
  2171. textarea.readOnly = "readOnly"
  2172. document.body.appendChild(textarea)
  2173. textarea.select() // 选择对象
  2174. textarea.setSelectionRange(0, content.length) //核心
  2175. let result = document.execCommand("copy") // 执行浏览器复制命令
  2176. textarea.remove()
  2177. return result
  2178. },
  2179. getDateDiff(data) {
  2180. // 传进来的data必须是日期格式,不能是时间戳
  2181. //var str = data;
  2182. //将字符串转换成时间格式
  2183. var timePublish = new Date(data);
  2184. var timeNow = new Date();
  2185. var minute = 1000 * 60;
  2186. var hour = minute * 60;
  2187. var day = hour * 24;
  2188. var month = day * 30;
  2189. var result = "2";
  2190. var diffValue = timeNow - timePublish;
  2191. var diffMonth = diffValue / month;
  2192. var diffWeek = diffValue / (7 * day);
  2193. var diffDay = diffValue / day;
  2194. var diffHour = diffValue / hour;
  2195. var diffMinute = diffValue / minute;
  2196. if (diffMonth > 3) {
  2197. result = timePublish.getFullYear() + "-";
  2198. result += timePublish.getMonth() + "-";
  2199. result += timePublish.getDate();
  2200. } else if (diffMonth > 1) { //月
  2201. result = data.substring(0, 10);
  2202. } else if (diffWeek > 1) { //周
  2203. result = data.substring(0, 10);
  2204. } else if (diffDay > 1) { //天
  2205. result = data.substring(0, 10);
  2206. } else if (diffHour > 1) { //小时
  2207. result = parseInt(diffHour) + "小时前";
  2208. } else if (diffMinute > 1) { //分钟
  2209. result = parseInt(diffMinute) + "分钟前";
  2210. } else {
  2211. result = "刚刚";
  2212. }
  2213. return result;
  2214. },
  2215. // 发送心跳包
  2216. startHeartbeat() {
  2217. // HeartBeat 这里是和后端约定好的值,我们发送给后端,后端再把这个值返给我们
  2218. // 目的就是让后端知道我们一直在
  2219. const heartbeatMsg = 'HeartBeat';
  2220. const sendHeartbeat = () => {
  2221. if (this.isOpen) {
  2222. console.log('发送HeartBeat')
  2223. uni.sendSocketMessage({
  2224. data: heartbeatMsg,
  2225. }).catch(error => {
  2226. console.log('发送心跳消息失败:', error);
  2227. //发送消息失败则进行重新链接
  2228. this.connect()
  2229. });
  2230. }
  2231. };
  2232. this.socketTimer = setInterval(sendHeartbeat, HEARTBEAT_INTERVAL);
  2233. },
  2234. // 开始重连
  2235. reconnect() {
  2236. if (!this.isOpen) {
  2237. clearTimeout(this.socketTimer);
  2238. this.socketTimer = setTimeout(() => {
  2239. console.log('开始重连...');
  2240. this.connect();
  2241. }, RECONNECT_INTERVAL);
  2242. }
  2243. },
  2244. connect() {
  2245. // #ifdef MP-WEIXIN
  2246. if (uni.getStorageSync('sendMsg')) {
  2247. // console.log('授权+1')
  2248. wx.requestSubscribeMessage({
  2249. tmplIds: this.arr,
  2250. success(re) {
  2251. // console.log(JSON.stringify(re), 111111111111)
  2252. var datas = JSON.stringify(re);
  2253. if (datas.indexOf("accept") != -1) {
  2254. // console.log(re)
  2255. }
  2256. },
  2257. fail: (res) => {
  2258. // console.log(res)
  2259. }
  2260. })
  2261. }
  2262. // #endif
  2263. let that = this
  2264. let userId = this.$queue.getData('userId');
  2265. uni.showLoading({
  2266. title: '连接中...'
  2267. })
  2268. uni.connectSocket({
  2269. // url: 'wss://h5.youxb.icu/wss/sqx_fast/chatSocket/' + userId,
  2270. // url: this.config("WSHOST1") + userId,
  2271. url: configdata.WSHOST1 + '' + userId,
  2272. // url: 'wss://zp.xianmaxiong.com/wss/chatSocket/' + userId,
  2273. // url: 'ws://192.168.0.128:7152/sqx_fast/chatSocket/' + userId,
  2274. data() {
  2275. return {
  2276. msg: 'Hello'
  2277. }
  2278. },
  2279. header: {
  2280. 'content-type': 'application/json'
  2281. },
  2282. method: 'GET',
  2283. success(res) {
  2284. // 这里是接口调用成功的回调,不是连接成功的回调,请注意
  2285. },
  2286. fail(err) {
  2287. // 这里是接口调用失败的回调,不是连接失败的回调,请注意
  2288. }
  2289. })
  2290. uni.onSocketOpen((res) => {
  2291. uni.hideLoading()
  2292. that.isOpen = true;
  2293. that.startHeartbeat()
  2294. if (that.mapsValue) {
  2295. that.setChatSave(18, that.mapsValue)
  2296. }
  2297. })
  2298. uni.onSocketError((err) => {
  2299. uni.hideLoading()
  2300. //如果连接异常那么把状态设置为false
  2301. that.isOpen = false;
  2302. //并尝试进行重连
  2303. that.reconnect();
  2304. })
  2305. uni.onSocketMessage((res) => {
  2306. if (res.data == 'HeartBeat') { //如果是心跳回推则不进行处理
  2307. return
  2308. }
  2309. this.getTimeOrListItem1();
  2310. console.log('onMessage', res)
  2311. })
  2312. uni.onSocketClose((res) => {
  2313. uni.hideLoading()
  2314. that.isOpen = false;
  2315. //链接关闭的时候也尝试进行重连
  2316. // that.reconnect();
  2317. })
  2318. },
  2319. close() {
  2320. uni.closeSocket()
  2321. },
  2322. getTimeOrListItem1() {
  2323. let userId = this.$queue.getData('userId')
  2324. this.$Request.getT('/app/chat/selectChatContent?page=' + this.page + '&limit=' + this.size +
  2325. '&chatConversationId=' + this.chatConversationId + '&userId=' + userId).then(
  2326. res => {
  2327. // this.ListItem = [];
  2328. if (res.data) {
  2329. var time = '';
  2330. res.data.list.forEach(d => {
  2331. d.createTimes = d.createTime;
  2332. d.createTime = this.getDateDiff(d.createTime);
  2333. if (d.createTime === time) {
  2334. d.createTime = '';
  2335. } else {
  2336. time = d.createTime;
  2337. }
  2338. if (d.type === 4) {
  2339. let data = d.content.split(',');
  2340. d.content = data;
  2341. }
  2342. if (d.type === 3) {
  2343. let data = d.content.split(',');
  2344. d.content = data;
  2345. }
  2346. if (d.messageType === 18) {
  2347. d.content = JSON.parse(d.content);
  2348. d.markers = [{
  2349. id: 1,
  2350. latitude: d.content.latitude,
  2351. longitude: d.content.longitude,
  2352. width: 20,
  2353. height: 20,
  2354. iconPath: '../../static/images/mapMarker.png',
  2355. callout: {
  2356. content: d.content.name,
  2357. color: '#000', //文字颜色
  2358. fontSize: 10, //文本大小
  2359. padding: 10, //附近留白
  2360. borderRadius: 24, //边框圆角
  2361. bgColor: '#FFFFFF', //背景颜色
  2362. display: 'ALWAYS', //常显
  2363. }
  2364. }]
  2365. }
  2366. // this.ListItem.push(d);
  2367. });
  2368. this.ListItem = res.data.list
  2369. this.ListItem.reverse();
  2370. this.scrollTop = this.old.scrollTop
  2371. this.$nextTick(() => {
  2372. this.scrollTop = 99999
  2373. })
  2374. this.getStatusInfo()
  2375. }
  2376. uni.hideLoading();
  2377. });
  2378. },
  2379. setChatSave(type, url) {
  2380. //type:1文字 2图片
  2381. if (type === 1 && this.content == '') {
  2382. this.$queue.showToast('请输入聊天内容');
  2383. return;
  2384. }
  2385. if (type != 3 && type != 2 && this.$queue.getChatSearchKeys(this.content)) {
  2386. uni.showToast({
  2387. title: "输入内容带有非法关键字请重新输入",
  2388. mask: false,
  2389. duration: 1500,
  2390. icon: "none"
  2391. });
  2392. return;
  2393. }
  2394. // if (type === 1 && this.$queue.getChatSearchKeys(this.content) != -1) {
  2395. // uni.showToast({
  2396. // title: "输入内容带有非法关键字请重新输入",
  2397. // mask: false,
  2398. // duration: 1500,
  2399. // icon: "none"
  2400. // });
  2401. // return;
  2402. // }
  2403. let userId = this.$queue.getData('userId');
  2404. if (type === 4) {
  2405. this.content = url;
  2406. }
  2407. if (type === 18) { //定位
  2408. this.content = url;
  2409. }
  2410. let data = {};
  2411. if (type == 3) {
  2412. data = {
  2413. userId: this.byUserId,
  2414. content: this.content,
  2415. width: url,
  2416. messageType: type,
  2417. chatConversationId: this.chatConversationId
  2418. }
  2419. } else if (type == 5) { //交换手机号
  2420. data = {
  2421. userId: this.byUserId,
  2422. content: '手机号请求',
  2423. messageType: type,
  2424. chatConversationId: this.chatConversationId
  2425. }
  2426. } else if (type == 6) { //交换微信号
  2427. data = {
  2428. userId: this.byUserId,
  2429. content: '微信号请求',
  2430. messageType: type,
  2431. chatConversationId: this.chatConversationId
  2432. }
  2433. } else if (type == 9) { //简历请求
  2434. data = {
  2435. userId: this.byUserId,
  2436. content: '简历请求',
  2437. messageType: type,
  2438. chatConversationId: this.chatConversationId
  2439. }
  2440. } else if (type == 24) {
  2441. data = {
  2442. userId: this.byUserId,
  2443. content: '刷新',
  2444. messageType: type,
  2445. chatConversationId: this.chatConversationId
  2446. }
  2447. } else {
  2448. data = {
  2449. userId: this.byUserId,
  2450. content: this.content,
  2451. messageType: type,
  2452. chatConversationId: this.chatConversationId
  2453. }
  2454. }
  2455. data = JSON.stringify(data);
  2456. let that = this;
  2457. uni.sendSocketMessage({
  2458. data: data,
  2459. success(res) {
  2460. that.mapsValue = ''
  2461. let image_url = that.$queue.getData('image_url');
  2462. if (!image_url) {
  2463. image_url = '/static/logo.png';
  2464. }
  2465. let datas = {
  2466. chat: {
  2467. userHead: image_url
  2468. },
  2469. content: that.content,
  2470. type: type,
  2471. sendType: 1
  2472. }
  2473. that.ListItem.push(datas);
  2474. setTimeout(() => {
  2475. that.getTimeOrListItem1();
  2476. that.content = '';
  2477. }, 50);
  2478. console.log(that.content);
  2479. },
  2480. fail(err) {
  2481. console.log(err);
  2482. }
  2483. })
  2484. },
  2485. //发送图片
  2486. chooseImage(sourceType) {
  2487. let that = this
  2488. uni.chooseImage({
  2489. count: 1,
  2490. sourceType: ['album'],
  2491. success: res => {
  2492. for (let i = 0; i < res.tempFilePaths.length; i++) {
  2493. this.$queue.showLoading("上传中...");
  2494. uni.uploadFile({ // 上传接口
  2495. url: this.config("APIHOST1") + '/alioss/upload', //真实的接口地址
  2496. filePath: res.tempFilePaths[i],
  2497. name: 'file',
  2498. success: (uploadFileRes) => {
  2499. let content = JSON.parse(uploadFileRes.data).data;
  2500. // this.setChatSave(2);
  2501. uni.hideLoading();
  2502. let data = {
  2503. userId: that.byUserId,
  2504. content: content,
  2505. messageType: 2,
  2506. chatConversationId: that.chatConversationId
  2507. }
  2508. data = JSON.stringify(data);
  2509. uni.sendSocketMessage({
  2510. data: data,
  2511. success(res) {
  2512. let image_url = that.$queue.getData(
  2513. 'image_url');
  2514. if (!image_url) {
  2515. image_url = '/static/logo.png';
  2516. }
  2517. let datas = {
  2518. chat: {
  2519. userHead: image_url
  2520. },
  2521. content: content,
  2522. type: 2,
  2523. sendType: 1
  2524. }
  2525. that.ListItem.push(datas);
  2526. setTimeout(() => {
  2527. that.getTimeOrListItem1();
  2528. }, 50);
  2529. },
  2530. fail(err) {
  2531. console.log(err);
  2532. }
  2533. })
  2534. }
  2535. });
  2536. }
  2537. }
  2538. })
  2539. },
  2540. config: function(name) {
  2541. var info = null;
  2542. if (name) {
  2543. var name2 = name.split("."); //字符分割
  2544. if (name2.length > 1) {
  2545. info = configdata[name2[0]][name2[1]] || null;
  2546. } else {
  2547. info = configdata[name] || null;
  2548. }
  2549. if (info == null) {
  2550. let web_config = cache.get("web_config");
  2551. if (web_config) {
  2552. if (name2.length > 1) {
  2553. info = web_config[name2[0]][name2[1]] || null;
  2554. } else {
  2555. info = web_config[name] || null;
  2556. }
  2557. }
  2558. }
  2559. }
  2560. return info;
  2561. },
  2562. //查看大图
  2563. viewImg(item) {
  2564. let imgsArray = [];
  2565. imgsArray[0] = item;
  2566. uni.previewImage({
  2567. current: 0,
  2568. urls: imgsArray
  2569. });
  2570. },
  2571. },
  2572. };
  2573. </script>
  2574. <style lang="scss">
  2575. @import "../msg/css/style.scss";
  2576. // 展开按钮样式
  2577. .expand-btn {
  2578. text-align: left;
  2579. margin-top: 20rpx;
  2580. padding: 10rpx 0;
  2581. .expand-text {
  2582. color: #007AFF;
  2583. font-size: 28rpx;
  2584. }
  2585. }
  2586. // 时间和收藏样式
  2587. .time-favorite {
  2588. padding: 10rpx 0;
  2589. .time-text {
  2590. color: rgba(156, 164, 171, 1);
  2591. font-family: DM Sans;
  2592. font-size: 12px;
  2593. font-weight: 400;
  2594. line-height: 20px;
  2595. letter-spacing: undefined;
  2596. text-align: right;
  2597. }
  2598. .favorite-btn {
  2599. color: rgba(156, 164, 171, 1);
  2600. font-size: 12px;
  2601. .favorite-icon {
  2602. margin-right: 8rpx;
  2603. font-size: 12px;
  2604. }
  2605. .favorite-text {
  2606. font-size: 12px;
  2607. }
  2608. }
  2609. }
  2610. .avatorm {
  2611. width: 100%;
  2612. // height: 100rpx;
  2613. margin-top: 20rpx;
  2614. color: #000;
  2615. .avatorm-box {
  2616. width: 90%;
  2617. height: 100%;
  2618. .avatorm-box-item {
  2619. margin-bottom: 10rpx;
  2620. .avatorm-box-item-t {
  2621. width: 30%;
  2622. }
  2623. .avatorm-box-item-r {
  2624. width: 70%;
  2625. }
  2626. }
  2627. }
  2628. }
  2629. .mssTitle {
  2630. width: 100%;
  2631. margin-top: 30rpx;
  2632. text-align: center;
  2633. font-size: 30rpx;
  2634. color: #000;
  2635. font-weight: bold;
  2636. }
  2637. .btnm {
  2638. width: 100%;
  2639. margin-top: 20rpx;
  2640. height: 80rpx;
  2641. margin-bottom: 100rpx;
  2642. .btn-box {
  2643. width: 686rpx;
  2644. height: 100%;
  2645. .btnItem {
  2646. display: flex;
  2647. align-items: center;
  2648. justify-content: center;
  2649. width: 200rpx;
  2650. height: 100%;
  2651. border-radius: 14rpx;
  2652. }
  2653. .btn-close {
  2654. color: #016BF6;
  2655. border: 1rpx solid #016BF6;
  2656. }
  2657. .btn-sub {
  2658. color: #FFFFFF;
  2659. background-color: #016BF6;
  2660. }
  2661. }
  2662. }
  2663. .mianshiTime {
  2664. width: 100%;
  2665. margin-top: 20rpx;
  2666. .mianshiTime-box {
  2667. padding-bottom: 20rpx;
  2668. width: 686rpx;
  2669. height: 100%;
  2670. color: #000000;
  2671. border-bottom: 1rpx solid #F2F2F7;
  2672. .mianshiTime-box-ti {
  2673. height: 100%;
  2674. margin-top: 20rpx;
  2675. }
  2676. }
  2677. }
  2678. .mianshiTitle {
  2679. width: 100%;
  2680. margin-top: 30rpx;
  2681. font-size: 30rpx;
  2682. text-align: center;
  2683. font-weight: bold;
  2684. color: #000000;
  2685. }
  2686. .qyList-box-item {
  2687. width: 100%;
  2688. // height: 400rpx;
  2689. padding-bottom: 40rpx;
  2690. background-color: #ffffff;
  2691. border-radius: 24rpx;
  2692. margin-bottom: 20rpx;
  2693. .qyList-box-item-box {
  2694. width: 626rpx;
  2695. height: 100%;
  2696. }
  2697. .qyList-box-item-info {
  2698. margin-top: 40rpx;
  2699. }
  2700. .qyList-box-item-job {
  2701. color: #121212;
  2702. font-size: 28rpx;
  2703. font-weight: 500;
  2704. margin-top: 20rpx;
  2705. }
  2706. .qyList-box-item-rem {
  2707. color: #999999;
  2708. font-size: 26rpx;
  2709. margin-top: 20rpx;
  2710. }
  2711. }
  2712. .topSe {
  2713. width: 100%;
  2714. height: 100%;
  2715. // padding-top: 80rpx;
  2716. background-color: #FFFFFF;
  2717. box-sizing: border-box;
  2718. .topSe-box {
  2719. width: 686rpx;
  2720. height: 100%;
  2721. .topSe-box-item {
  2722. font-size: 24rpx;
  2723. width: 80rpx;
  2724. }
  2725. }
  2726. }
  2727. .jobs {
  2728. width: 100%;
  2729. .jobs-box {
  2730. width: 95%;
  2731. }
  2732. }
  2733. .gwList-box-item {
  2734. width: 100%;
  2735. // height: 329rpx;
  2736. border: 0.5px solid rgba(227, 231, 236, 1);
  2737. background: #FDFDFD;
  2738. border-radius: 24rpx;
  2739. // margin-bottom: 20rpx;
  2740. padding-bottom: 20rpx;
  2741. }
  2742. .gwList-box-item-box {
  2743. width: 100%;
  2744. height: 100%;
  2745. padding: 0 40rpx;
  2746. .gwList-box-item-box-title {
  2747. margin-top: 30rpx;
  2748. text:nth-of-type(1) {
  2749. color: rgba(23, 23, 37, 1);
  2750. font-family: DM Sans;
  2751. font-size: 24px;
  2752. font-weight: 700;
  2753. line-height: 24px;
  2754. letter-spacing: 0%;
  2755. text-align: left;
  2756. }
  2757. text:nth-of-type(2) {
  2758. color: rgba(1, 107, 246, 1);
  2759. font-family: DM Sans;
  2760. font-size: 16px;
  2761. font-weight: 700;
  2762. line-height: 20px;
  2763. letter-spacing: 0.5%;
  2764. text-align: right;
  2765. }
  2766. }
  2767. .gwList-box-item-box-label {
  2768. margin-top: 30rpx;
  2769. }
  2770. .gwList-box-item-box-name {
  2771. color: rgba(156, 164, 171, 1);
  2772. font-family: DM Sans;
  2773. font-size: 16px;
  2774. font-weight: 400;
  2775. line-height: 20px;
  2776. letter-spacing: 0.5%;
  2777. text-align: left;
  2778. gap: 8rpx;
  2779. margin-top: 20rpx;
  2780. }
  2781. .gwList-box-item-box-line {
  2782. width: 100%;
  2783. border: 1rpx solid #E6E6E6;
  2784. margin-top: 30rpx;
  2785. margin-bottom: 20rpx;
  2786. }
  2787. .gwList-box-item-box-info-text {
  2788. color: rgba(153, 153, 153, 1);
  2789. font-family: DM Sans;
  2790. font-size: 12px;
  2791. font-weight: 400;
  2792. line-height: 12px;
  2793. letter-spacing: 0px;
  2794. text-align: left;
  2795. margin-bottom: 20rpx;
  2796. .job-description-item {
  2797. margin-bottom: 6rpx;
  2798. line-height: 1.2;
  2799. &:last-child {
  2800. margin-bottom: 0;
  2801. }
  2802. }
  2803. }
  2804. .gwList-box-item-box-info {
  2805. font-size: 26rpx;
  2806. padding-bottom: 20rpx;
  2807. border-bottom: 1rpx solid #E6E6E6;
  2808. .gwList-box-item-box-info-l {
  2809. color: #1A1A1A;
  2810. .people {
  2811. max-width: 110rpx;
  2812. overflow: hidden; //超出的文本隐藏
  2813. text-overflow: ellipsis; //溢出用省略号显示
  2814. white-space: nowrap; // 默认不换行;
  2815. color: rgba(156, 164, 171, 1);
  2816. font-family: DM Sans;
  2817. font-size: 14px;
  2818. font-weight: 400;
  2819. line-height: 20px;
  2820. letter-spacing: undefined;
  2821. text-align: left;
  2822. }
  2823. }
  2824. .gwList-box-item-box-info-r {
  2825. color: #999999;
  2826. width: 50%;
  2827. overflow: hidden; //超出的文本隐藏
  2828. text-overflow: ellipsis; //溢出用省略号显示
  2829. white-space: nowrap; // 默认不换行;
  2830. }
  2831. }
  2832. }
  2833. .xuanfu {
  2834. width: 100%;
  2835. display: flex;
  2836. justify-content: center;
  2837. align-items: center;
  2838. color: #016BF6;
  2839. .xuanfu-box {
  2840. width: 95%;
  2841. background-color: #FFFFFF;
  2842. border-radius: 10rpx;
  2843. padding: 20rpx 15rpx 20rpx 20rpx;
  2844. letter-spacing: 5rpx;
  2845. font-size: 26rpx;
  2846. }
  2847. }
  2848. page {
  2849. background: #FAFAFA;
  2850. color: #FFFFFF;
  2851. }
  2852. .chat-listitem {
  2853. display: flex;
  2854. margin-top: 20rpx;
  2855. padding: 10rpx;
  2856. }
  2857. .textColor {
  2858. color: #FFFFFF;
  2859. border-radius: 16px 16px 0px 16px;
  2860. background: rgba(1, 107, 246, 1);
  2861. }
  2862. .chat-listitem-text {
  2863. // color: #FFFFFF;
  2864. margin-top: 6rpx;
  2865. width: fit-content;
  2866. padding: 15rpx;
  2867. font-size: 30rpx;
  2868. height: max-content;
  2869. word-wrap: break-word;
  2870. word-break: break-all;
  2871. border-radius: 10rpx;
  2872. }
  2873. .chat-listitem-image-type4 {
  2874. color: #000000;
  2875. background: #FFFFFF;
  2876. width: fit-content;
  2877. font-size: 30rpx;
  2878. height: max-content;
  2879. word-wrap: break-word;
  2880. word-break: break-all;
  2881. border-top-left-radius: 20rpx;
  2882. border-top-right-radius: 20rpx;
  2883. }
  2884. .chat-listitem-image {
  2885. margin-top: 5rpx;
  2886. width: 75rpx;
  2887. height: 75rpx;
  2888. border-radius: 50%;
  2889. }
  2890. .save {
  2891. width: 130rpx;
  2892. text-align: center;
  2893. border-radius: 10rpx;
  2894. height: 70rpx;
  2895. background: #FFFFFF;
  2896. margin: 5rpx 10rpx 0;
  2897. line-height: 70rpx;
  2898. }
  2899. </style>