chat.vue 50 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702
  1. <template>
  2. <div v-loading="allLoading" element-loading-text="拼命连接中" >
  3. <!-- -->
  4. <el-container class="chatBox">
  5. <!-- ************************* 头部消息 ************************* -->
  6. <el-header height='80px'>
  7. <el-row type="flex" justify='space-between' align = 'middle' style="height:100%;">
  8. <el-col class="tit nopd" v-if="machineAndAtl == 10"><span>智能客服</span></el-col>
  9. <el-col class="tit nopd" v-if="machineAndAtl == 100"><span>{{service.kf_name}}</span></el-col>
  10. <el-col>
  11. <div class="imgBox">
  12. <i v-if="selNum > chatNum" @click="ejectEvl(10)" class="sc pointer" :class="selType?'scActy':''"></i>
  13. <div style="float: right" class="pointer" @click="leaveMsg()">
  14. <span style="font-size: 25px; color: #b3c1e7; margin-top: 13px;" @click="back()" class="el-icon-chat-line-round"></span>
  15. </div>
  16. <!-- <i class="sy pointer" @click="select(2)" :class="syType?'syActy':''"></i>
  17. <i class="sq pointer" @click="select(3)" :class="sqType?'sqActy':''"></i>-->
  18. </div>
  19. </el-col>
  20. </el-row>
  21. </el-header>
  22. <el-conatiner class="cationer">
  23. <!--****************************** 聊天会话框模块 *****************************-->
  24. <el-main>
  25. <el-row class="pd informationBox" id="main">
  26. <!-- 广告展示隐藏按钮 -->
  27. <div class="retract pointer" @click="retract()">
  28. <img src="./../assets/st-img/retract.png" alt="" v-if="retractShow">
  29. <img src="./../assets/st-img/retract2.png" alt="" v-else>
  30. </div>
  31. <!-------------------机器人聊天板块 ----------------------->
  32. <div v-if="machineAndAtl == 10">
  33. <!--··············· 欢迎语 ············-->
  34. <div class="conversationBox" v-if="machine != ''">
  35. <div class=" row">
  36. <div class="conversation row">
  37. <div class="headImg">
  38. <img src="./../assets/st-img/headAdvent.png" alt="">
  39. </div>
  40. <div class="cont left" >
  41. <div>{{machine.content}}</div>
  42. </div>
  43. </div>
  44. <div style="width:66px;"></div>
  45. </div>
  46. </div>
  47. <!--··········· 快捷问题回答模块 ············-->
  48. <div class="questionList" v-if="questionShow">
  49. <section v-for="(item,idx) in problem" :key="item.id">
  50. <div @click="answers(idx)">
  51. <span class="pointer gl">{{item.robot_name}}</span>
  52. </div>
  53. </section>
  54. <section>
  55. <div>
  56. <span class="col6">上面问题都不是</span>
  57. <span class="pointer ly" @click="changeService()">转人工客服</span>
  58. </div>
  59. </section>
  60. </div>
  61. <!--················ 和机器人会话发送消息 ·············-->
  62. <div v-for="item in chatCont" :key="item.id">
  63. <!-- 用户发文本信息 -->
  64. <div class="conversationBox" v-if="item.type =='user'">
  65. <div class="timer">{{item.time}}</div>
  66. <div class="customer row allAlignment">
  67. <div style="width:66px;"></div>
  68. <div class="row">
  69. <!-- 显示内容 -->
  70. <div v-if="item.chat" class="cont right">
  71. <div v-html="item.chat"></div>
  72. </div>
  73. <div v-else class=" right noafter" style="width:200px;margin-right:10px; ">
  74. <div slot="file">
  75. <img class="el-upload-list__item-thumbnail" @click="handlePictureCardPreview(url+item.imgUrl)" style="width:100%;height:auto;border-radius: 10px;" :src="url+item.imgUrl" alt="">
  76. </div>
  77. </div>
  78. <!-- 图片放大 -->
  79. <el-dialog :visible.sync="dialogVisible">
  80. <img width="100%" :src="dialogImageUrl" alt="">
  81. </el-dialog>
  82. <!-- 头像 -->
  83. <div class="headImg">
  84. <img :src="user_info.avatar" alt="">
  85. </div>
  86. </div>
  87. </div>
  88. </div>
  89. <!-- 机器人无法回答转人工 -->
  90. <div class="conversationBox" v-if="item.type == 1001">
  91. <div class=" row">
  92. <div class="conversation row">
  93. <div class="headImg">
  94. <img src="./../assets/st-img/headAdvent.png" alt="">
  95. </div>
  96. <div class="cont left" >
  97. <div>您的问题暂时无法处理</div>
  98. <div>
  99. <span class="col">问题没有解决?</span>
  100. <span class="change pointer ly" @click="changeService()">转人工客服</span>
  101. </div>
  102. </div>
  103. </div>
  104. <div style="width:66px;"></div>
  105. </div>
  106. </div>
  107. <!-- 机器人回答 -->
  108. <div class="conversationBox" v-else-if='item.type == "service"'>
  109. <div class=" row">
  110. <div class="conversation row">
  111. <div class="headImg">
  112. <img src="./../assets/st-img/headAdvent.png" alt="">
  113. </div>
  114. <div class="cont left" >
  115. <div>{{item.cont}}</div>
  116. </div>
  117. </div>
  118. <div style="width:66px;"></div>
  119. </div>
  120. </div>
  121. <!-- 快捷问题回答 -->
  122. <div class="conversationBox" v-else-if="item.type == 'machine'">
  123. <div class="timer">
  124. {{item.robot_addTime}}
  125. </div>
  126. <div class=" row">
  127. <div class="conversation row">
  128. <div class="headImg">
  129. <img src="./../assets/st-img/headAdvent.png" alt="">
  130. </div>
  131. <div class="cont left" >
  132. <div>{{item.robot_content}}</div>
  133. <div>
  134. <span class="col">问题没有解决</span>
  135. <span class="change pointer ly" @click="changeService()">转人工客服</span>
  136. </div>
  137. </div>
  138. </div>
  139. <div style="width:66px;"></div>
  140. </div>
  141. </div>
  142. <!-- 转接客服列表 -->
  143. <div class="changeService" v-else-if="item.type == 'artService'">
  144. <div v-for="(itemList,idx) in serviceList" :key="idx">
  145. <span class="col6">人工客服:</span>
  146. <span class="colE5 pointer gl" @click="jumpService(itemList.id)">{{itemList.name}}</span>
  147. </div>
  148. </div>
  149. </div>
  150. <!--············· 各种消息提示框 ··············-->
  151. <!-- 转接客服 -->
  152. <div class="promptBox" v-if="artAndLeave == 10">
  153. <div class="prompt">
  154. <span>已转接人工客服</span>
  155. </div>
  156. </div>
  157. <!-- 客服关闭会话 -->
  158. <div class="promptBox" v-if="closeByServer">
  159. <div class="prompt" style="width: 50px">
  160. <span>会话结束</span>
  161. </div>
  162. </div>
  163. <!-- 客服不在线帮助提示框 -->
  164. <div class="promptBox " v-if="artAndLeave == 100">
  165. <div class="prompt help">
  166. <span>当前客服不在线,如需帮助请</span>
  167. <span class="colE5 ly pointer" @click="leaveMsg()">留言</span>
  168. </div>
  169. </div>
  170. </div>
  171. <!--············ 和人工会话聊天模块 ··············-->
  172. <div v-if="machineAndAtl == 100">
  173. <!-- 人工客服回复消息 -->
  174. <div v-for="item in customerSviceChat" :key="item.id">
  175. <!-- tem.cont != '' -->
  176. <div class="conversationBox" v-if="item.type == 'service' ">
  177. <div class="timer"> {{item.time}} </div>
  178. <div class=" row">
  179. <div class="conversation row">
  180. <div class="headImg">
  181. <img :src="serviceImg?url+serviceImg:require('@/assets/st-img/kf.png')" alt="">
  182. </div>
  183. <div class="cont left" >
  184. <div v-if="item.content != ''" v-html="item.content"></div>
  185. <div v-else slot="file">
  186. <img class="el-upload-list__item-thumbnail" @click="handlePictureCardPreview(url+item.imgUrl)" style="width:100%;height:auto;border-radius: 10px;" :src="url+item.imgUrl" alt="">
  187. </div>
  188. </div>
  189. </div>
  190. <div style="width:66px;"></div>
  191. </div>
  192. </div>
  193. <!-- 用户发送文本消息 -->
  194. <div class="conversationBox" v-if="item.type == 'user' ">
  195. <div>
  196. <div class="timer">{{item.time}}</div>
  197. <div class="customer row allAlignment">
  198. <div style="width:66px;"></div>
  199. <div class="row">
  200. <div class="cont right">
  201. <div v-if="item.content != ''" v-html="item.content"></div>
  202. <div v-else slot="file">
  203. <img class="el-upload-list__item-thumbnail" @click="handlePictureCardPreview(url+item.imgUrl)" style="width:100%;height:auto;border-radius: 10px;" :src="url+item.imgUrl" alt="">
  204. </div>
  205. </div>
  206. <div class="headImg">
  207. <img :src="user_info.avatar" alt="">
  208. </div>
  209. </div>
  210. </div>
  211. </div>
  212. </div>
  213. <!-- 点击图片放大 -->
  214. <el-dialog :visible.sync="dialogVisible">
  215. <img width="100%" :src="dialogImageUrl" alt="">
  216. </el-dialog>
  217. </div>
  218. <!-- 评价 -->
  219. <div class="evaluate" @click="ejectEvl(10)" v-if="consult">
  220. <span>欢迎你的咨询,请对我们的服务做出评价</span>
  221. <span class="btn seek">评价</span>
  222. </div>
  223. <div class="promptBox " v-if="comtSuccess">
  224. <div class="prompt help">
  225. <span>您对我们的服务评价为: {{comtCount}}。非常感谢!</span>
  226. </div>
  227. </div>
  228. <!-- 系统即将结束会话
  229. <div class="promptBoxH " v-if="willOverTime">
  230. <div class="prompt help" style="width: 280px; height: 35px;">
  231. <span>{{willOverTime}}</span>
  232. </div>
  233. </div> -->
  234. <!-- 客服关闭会话 -->
  235. <div class="promptBox " v-if="closeByServer">
  236. <div class="prompt help" style="width: 280px;">
  237. <span>会话已关闭,如需继续咨询请</span>
  238. <span class="colE5 ly pointer" @click="goBack()">重新连接</span>
  239. </div>
  240. </div>
  241. <!-- 客服关闭会话 -->
  242. <div class="promptBox " v-if="serverNotOnlin">
  243. <div class="prompt help" style="width: 280px;">
  244. <span>客服掉线</span>
  245. </div>
  246. </div>
  247. </div>
  248. </el-row>
  249. <!--·········· 文本编辑框 ···········-->
  250. <el-row class="chatting">
  251. <el-col>
  252. <!-- 发送图和表情按钮 -->
  253. <div style="height:18px; display:flex;">
  254. <el-popover placement="top-start" width="200" trigger="hover" style="margin-top: -10px;">
  255. <ul>
  256. <li class="emoticon" v-for="(item,index) in frceArr" :key="item.id" >
  257. <img class="pointer" :src="require(`@/assets/st-img/${index}.gif`)" @click="memeImg(index)" alt="">
  258. </li>
  259. </ul>
  260. <el-button class="expression" slot="reference"></el-button>
  261. </el-popover>
  262. <el-upload class="avatar-uploader" action="/api/index/upload/uploadImg"
  263. :on-success="handleAvatarSuccess"
  264. :before-upload="beforeAvatarUpload"
  265. :on-error ='handError'
  266. list-type ='no' accept="image/jpeg,image/jpg,image/png,image/svg">
  267. <!-- <img v-if="imageUrl" :src="imageUrl" class="avatar"> -->
  268. <i slot="default" class=" photo"></i>
  269. </el-upload>
  270. </div>
  271. <div class="row center allAlignment chattingBox">
  272. <div style="height:44px;width:300px;">
  273. <textarea name="" id="" v-model="information" cols="30" rows="1" placeholder="请输入你的问题:"></textarea>
  274. </div>
  275. <div>
  276. <!-- 准备修改 -->
  277. <div @click="sendCol?(!closeByServer||artAndLeave==0||artAndLeave==100?sendInfo():''):''" class="sendOut pointer" :class="sendCol?(!closeByServer||artAndLeave==0||artAndLeave==100?'sendCol':'netSendCol'):'netSendCol'">
  278. <span class="">发送</span>
  279. </div>
  280. </div>
  281. </div>
  282. </el-col>
  283. </el-row>
  284. </el-main>
  285. <el-aside width='255px' v-if="retractShow">
  286. <el-row class="rt">
  287. <el-col :span='24' class="artificial pd20">
  288. <div class="infor">
  289. <div>
  290. <span>姓名:</span>
  291. <span>{{service.kf_name ? service.kf_name : '智能客服' }}</span>
  292. </div>
  293. <div>
  294. <span>工号:</span>
  295. <span>{{service.serverInfo ? service.serverInfo.job_name : '001'}}</span>
  296. </div>
  297. <div>
  298. <span>性别:</span>
  299. <span>保密</span>
  300. </div>
  301. <div>
  302. <span>职务:</span>
  303. <span>咨询客服</span>
  304. </div>
  305. </div>
  306. <div class="headPortrait">
  307. <img :src="service.serverInfo?(url+service.serverInfo.avatar):require('@/assets/st-img/kf.png')" alt="">
  308. </div>
  309. </el-col>
  310. <el-col class="autograph pd20" >
  311. <div>
  312. <span>个性签名:</span>
  313. <span>{{service.serverInfo ? service.serverInfo.signature :'' }}</span>
  314. </div>
  315. </el-col>
  316. <el-col class="advent" v-for="imgs in advert" :key="imgs.id">
  317. <a :href="imgs.advertisement_url" target="_blank" ><img :src="url + imgs.advertisement_img" alt=""></a>
  318. </el-col>
  319. </el-row>
  320. </el-aside>
  321. </el-conatiner>
  322. <!-- 评价框 -->
  323. <el-card class="box-card" v-if="evlShow">
  324. <!-- <div class="close" @click="closeEvl(10)"> -->
  325. <!-- <i></i> -->
  326. <!-- </div> -->
  327. <div class="tit">
  328. <span>感谢您的咨询,请对我们的服务做出评价</span>
  329. </div>
  330. <div class="selIcon row allAlignment">
  331. <div @click="chage(1)">
  332. <i :class="changeIcon == 10? '':'sfd'"></i>
  333. <span>满意</span>
  334. </div>
  335. <div @click="chage(2)">
  336. <i class="comm" :class="changeIcon == 100?'comm2':''"></i>
  337. <span>一般</span>
  338. </div>
  339. <div @click="chage(3)">
  340. <i class="notSfd" :class="changeIcon == 1000?'notSfd2':''"></i>
  341. <span>不满意</span>
  342. </div>
  343. </div>
  344. <div class="levMsg">
  345. <el-input type="textarea" rows="6" placeholder="评价备注" v-model="textarea">
  346. </el-input>
  347. </div>
  348. <div class="sure" @click="evaluateSure()">
  349. <span>确定</span>
  350. </div>
  351. </el-card>
  352. <div class="zzBox" v-if="zzShow"></div>
  353. <!-- </div> -->
  354. </el-container>
  355. </div>
  356. </template>
  357. <script>
  358. import '../css/index.css';
  359. import frce from '../assets/frce.js';
  360. export default {
  361. data(){
  362. return{
  363. textarea : '',//备注
  364. evlShow : false, // 评价框显示
  365. zzShow : false, // 遮罩层显示
  366. vertion:'',//图形验证码
  367. provShow : true, // 验证框显示
  368. changeIcon : 10,
  369. name : '', // 验证框姓名model
  370. phone:'',// 验证框电话model
  371. email:'',// 验证框邮箱model
  372. frceArr: [], //表情包代码
  373. information:'',//发送的文本信息
  374. sendCol : false, // 发送按钮切换样式
  375. selType : false, //图标选中样式 true为选中,false为未选中
  376. selNum : 0, // 自增当达到某个条件显示图片
  377. // syType : false,
  378. // sqType : false,
  379. error: false,
  380. emlError:false,
  381. artAndLeave:0, // 默认为100,转人工为10,人工不在转留言为100
  382. chatCont :[], // 客户会话数据
  383. imageUrl:[],//上传图片
  384. img:'', //上传的单个图片路径
  385. dialogVisible: false, //图片放大
  386. dialogImageUrl :'', // 放大的图片
  387. dialogUrl :false,
  388. serviceInfor:'', //客服信息
  389. websock: null, //会话初始值
  390. currTime :"", //获取系统时间
  391. apiToken :'',//系统Token
  392. machine:'', //机器会话信息
  393. advert:'', // 广告语
  394. problem:'', //机器智能问题
  395. macNotPro : false, //机器人问题无法解决显示
  396. answer:[], //解答问题的答案
  397. questionShow:true, // 问题显示
  398. consult : false, //评价模块显示
  399. type : 1001, //自增
  400. jumpArtl:false, // 跳转人工客服状态
  401. group : '' , //客服组
  402. userConversation : {} , //用户当前会话
  403. machineAndAtl: 10, //默认为机器人,100为人工
  404. satisfaction :1 , //评价满意度,1为满意,2为一般,3为不满意
  405. url :'http://kfadmin.bocai186.com', // 域名地址
  406. //url :'http://192.168.2.186:8090', // 域名地址
  407. user_info:'', // 用户信息
  408. // 人工客服信息
  409. service:'',
  410. serviceList: [], //后台推送的人工客服列表
  411. customerWelCome : '', // 客服欢迎语
  412. customerSviceChat:[], // 客服会话信息
  413. serviceImg: '',
  414. timerVote:'', //存储上一次时间
  415. curtTimer:'',//当前时间
  416. returnTimer : '',//返回当前时间
  417. // isConnection:true,//人工分组列表开关
  418. chatNum : '', // 会话数量
  419. comtSuccess : false, // 评论发送成功显示
  420. comtCount : '', // 评论成功返回的满意度
  421. retractShow:true, // 展开侧边栏
  422. sensitive :[], //敏感词1
  423. senType:false,//敏感词状态
  424. sensitiveNumber:0,//敏感词次数
  425. doubSensitive:[],//重复的敏感词
  426. senInfo:'', //敏感词数据
  427. // sensitiveWordsNumber:0,
  428. hourse:'' , //返回时间,小时
  429. closeByServer:false , //客服关闭会话
  430. serverNotOnlin:false , //客服掉线
  431. willOverTime:'' , //超时关闭会话
  432. allLoading:true , //整个页面加载中
  433. webTime:'',//网络时间
  434. }
  435. },
  436. methods:{
  437. /******************文字信息转表情******************/
  438. turnFace(data){
  439. let str = data.match(/\#\[.*?\]\//g);
  440. let arr =Array.from(new Set(str));
  441. arr.forEach(e=>{
  442. let imgsrc = '';
  443. for(let i = 0 ; i < this.frceArr.length ; i++){
  444. let expText = e.slice(1,e.length-1);
  445. if(expText == this.frceArr[i]){
  446. imgsrc = '<img class="hover" src="'+require(`@/assets/st-img/${i}.gif`)+'"/>'
  447. break;
  448. }
  449. }
  450. data = data.replace(new RegExp(`\\#\\[${e.substring(2,e.length-2)}\\]\\/`,'g'),imgsrc);
  451. })
  452. return data;
  453. },
  454. // 关闭加载中
  455. allLoadingClose() {
  456. this.allLoading = false;
  457. },
  458. /****************************** */
  459. retract(){
  460. this.retractShow = !this.retractShow;
  461. console.log('ddsd');
  462. },
  463. /***************发送图片***************/
  464. beforeAvatarUpload(file){
  465. let self = this
  466. const isJPG = file.type =='image/jpeg'||'image/jpg'||'image/png'||'image/svg';
  467. const isLt2M = file.size / 1024 / 1024 < 2;
  468. if (!isJPG) {
  469. this.$message.error('上传只能是图片格式!');
  470. }
  471. if (!isLt2M) {
  472. this.$message.error('上传图片大小不能超过 2MB!');
  473. }
  474. // 压缩图片
  475. // this.$public.imgPreview(picavalue, function(imgSrc, config, formData) {
  476. // // console.log(imgSrc,config,formData);
  477. // self.dialogImageUrl = imgSrc;
  478. // });
  479. return isJPG && isLt2M;
  480. },
  481. handError(err, file, fileList){
  482. // 获取当前发送时间
  483. },
  484. /***************传输成功之后返回图片*************** */
  485. handleAvatarSuccess(res, file) {
  486. this.dialogUrl = true;
  487. this.img = res.data.src;
  488. this.sendMessage();
  489. },
  490. /***************图片放大*************** */
  491. handlePictureCardPreview(url){
  492. this.dialogImageUrl = url;
  493. this.dialogVisible = true;
  494. },
  495. /***************弹出评价框*************** */
  496. ejectEvl(type){
  497. if(this.comtSuccess) return;
  498. this.changeIcon = 10;
  499. if(type == 10){
  500. this.evlShow = true
  501. }
  502. this.zzShow = true;
  503. },
  504. /***************传入父组件进行组件切换*************** */
  505. leaveMsg(){
  506. this.$emit('value',100)
  507. },
  508. //回到初始页面
  509. goBack(){
  510. this.artAndLeave = 0;
  511. this.machineAndAtl = 10;
  512. this.macNotPro = false;
  513. this.jumpArtl = false;
  514. this.automaticRolling();
  515. this.initWebSocket();
  516. //this.questionShow = true;
  517. },
  518. /*******发送消息按钮*******/
  519. sendInfo(){
  520. this.closeByServer = false;
  521. this.artAndLeave = 0;
  522. this.jumpArtl = false;
  523. this.dialogUrl = false;
  524. this.sendMessage();
  525. },
  526. /***************改变评价框的满意度*************** */
  527. chage(type){
  528. this.satisfaction = type;
  529. if(type == 1){
  530. this.comtCount = '满意'
  531. this.changeIcon = 10;
  532. }else if(type == 2){
  533. this.comtCount = '一般'
  534. this.changeIcon = 100;
  535. }else{
  536. this.comtCount = '不满意'
  537. this.changeIcon = 1000;
  538. }
  539. },
  540. /***************图标样式切换*************** */
  541. select(type){
  542. if(type == 1){
  543. this.selType = !this.selType;
  544. }else if(type == 2){
  545. this.syType = !this.syType;
  546. }else{
  547. this.sqType = !this.sqType;
  548. }
  549. },
  550. /***************评价确认*************** */
  551. evaluateSure(){
  552. // 参数
  553. let params = {
  554. 'evaluateId' : this.satisfaction,
  555. 'conversationId' : this.service.conversationId,
  556. 'evaluateContent' : this.textarea
  557. }
  558. this.$axios.get('/api/index/evaluate/putEvaluate',{params,
  559. headers:{
  560. 'Content-Type' :'application/x-www-form-urlencoded',
  561. 'apiToken' : this.setApiToken('putevaluate','evaluate',this.currTime,'index')
  562. }
  563. }).then(res =>{
  564. if(res.data.code == 1){
  565. this.evlShow = false;
  566. this.zzShow = false;
  567. this.textarea = '';
  568. this.comtSuccess = true;
  569. if(this.changeIcon == 10){
  570. this.comtCount = '满意'
  571. }
  572. }
  573. })
  574. },
  575. /***************验证框确认*************** */
  576. yySure(){
  577. this.provShow = false;
  578. this.zzShow = false;
  579. },
  580. /***************转人工客服列表*************** */
  581. changeService(){
  582. // if(!this.isConnection) return
  583. this.$axios.post('/api/index/groups/index',{},{headers:{
  584. 'Content-Type' :'application/x-www-form-urlencoded',
  585. 'apiToken' : this.setApiToken('index','groups',this.currTime,'index')
  586. }}).then(res =>{
  587. if(res.data.code == 1){
  588. this.serviceList = res.data.data;
  589. this.chatCont.push({
  590. 'type' :'artService'
  591. })
  592. this.automaticRolling();
  593. }
  594. })
  595. // this.isConnection = false;
  596. },
  597. /***************表情点击*************** */
  598. memeImg(i) {
  599. //当表情被点击
  600. this.information = this.information + "#" + this.frceArr[i] + "/";
  601. },
  602. /***************失去焦点做正则验证*************** */
  603. sureInfor(type){
  604. if(type == 1){
  605. if(!/^1[34578]\d{9}$/.test(this.phone)){
  606. this.error = true;
  607. this.phone = '';
  608. }else{
  609. this.error = false;
  610. }
  611. }else if(type == 10){
  612. if(!/^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/.test(this.email)){
  613. this.emlError = true;
  614. this.email = '';
  615. }else{
  616. this.emlError = false;
  617. }
  618. }
  619. },
  620. /***************获取热点智能问题*************** */
  621. getProblem(){
  622. this.$axios.post('/api/index/robot/index',{groups_id:1,robotgroups_id:1},{
  623. headers:{
  624. 'Content-Type' :'application/x-www-form-urlencoded',
  625. 'apiToken' : this.setApiToken('index','robot',this.currTime,'index')
  626. }
  627. }).then(res =>{
  628. if(res.data.code == 1){
  629. this.problem = res.data.data
  630. }
  631. })
  632. },
  633. /*****************获取聊天次数*******************/
  634. getChatNum(){
  635. this.$axios.post('/api/index/evaluate/minRound','',{headers:{
  636. 'Content-Type' :'application/x-www-form-urlencoded',
  637. 'apiToken' : this.setApiToken('minround','evaluate',this.currTime,'index')
  638. }}).then(res =>{
  639. if(res.data.code == 1){
  640. this.chatNum = res.data.data.systemconfig_data
  641. }
  642. })
  643. },
  644. /*****************屏蔽关键字******************/
  645. shieldingKeyword(data){
  646. //将敏感词组用|转换字符串
  647. let snstive = this.sensitive.join('|');
  648. //console.log(snstive);
  649. this.sensitiveNumber = 0 ;
  650. //匹配出会话中的敏感词
  651. return data.replace(eval('/' + snstive + '/g'),(res)=>{
  652. var str = '';
  653. for(var i = 0; i < res.length;i++){
  654. str += '*';
  655. }
  656. this.sensitiveNumber ++;
  657. return str;
  658. })
  659. //console.log(this.senInfo);
  660. // let params = {
  661. // 'type' : 1,
  662. // 'conversationId' : this.service.conversationId,
  663. // 'number' : num
  664. // }
  665. // this.$axios.get('/api/index/alarm/sensitiveAlarm',{params,
  666. // headers:{
  667. // 'Content-Type' :'application/x-www-form-urlencoded',
  668. // 'apiToken' : this.setApiToken('sensitivealarm','alarm',this.currTime,'index')
  669. // }
  670. // }).then(res =>{
  671. // })
  672. },
  673. /*---------------------------------------------------------------------------------*/
  674. /**************初始化WebSocket****************/
  675. initWebSocket(){
  676. let _this = this;
  677. let apiToken = this.$md5.hex_md5('customer-service'+ this.currTime +window.location.origin);
  678. this.websock = new WebSocket('ws://103.108.43.176:9101?apiToken='+apiToken);
  679. // 数据接收
  680. this.websock.onmessage = this.websocketonmessage;
  681. // 连接建立之后
  682. this.websock.onopen = this.websocketonopen;
  683. // 连接建立失败重连
  684. this.websock.onerror = this.websocketonerror;
  685. // 关闭会话
  686. this.websock.onclose = this.websocketonclose;
  687. },
  688. /****************连接建立成功***************/
  689. websocketonopen(){
  690. console.log('链接成功');
  691. },
  692. /*************连接建立失败重连***************** */
  693. websocketonerror(){
  694. // this.initWebSocket();
  695. },
  696. /**************数据接收***************** */
  697. websocketonmessage(e){
  698. const redata = JSON.parse(e.data);
  699. console.log(redata)
  700. // 欢迎语
  701. if(redata.message_type == 'helloMessage'){
  702. this.machine = redata.data;
  703. }
  704. // 广告语
  705. if(redata.message_type == 'advertisement'){
  706. this.advert = redata.data;
  707. }
  708. // 评价
  709. if(redata.message_type == 'getEvaluate'){
  710. this.consult = true;
  711. }
  712. //返回的会话时间
  713. if(redata.message_type == 'webTime'){
  714. this.webTime = redata.data.time;
  715. if(this.machineAndAtl ==100){
  716. let num = this.customerSviceChat.length-1;
  717. if(this.customerSviceChat[num].type == "user"){
  718. this.$set(this.customerSviceChat[num],'time',redata.data.time);
  719. }
  720. }else if(this.machineAndAtl ==10){
  721. let num = this.chatCont.length-1;
  722. if(1){
  723. this.$set(this.chatCont[num],'time',redata.data.time);
  724. }
  725. // this.chatCont =
  726. }
  727. console.log(redata.data);
  728. }
  729. //会话超时提示
  730. if(redata.message_type == 'overtime'){
  731. console.log('接收会话超时');
  732. }
  733. // 链接客服信息
  734. if(redata.message_type == 'connect'){
  735. this.artAndLeave = 10;
  736. this.machineAndAtl = 100;
  737. this.service = redata.data;
  738. this.serviceImg = redata.data.serverInfo.avatar;
  739. }
  740. // 暂无客服
  741. if(redata.message_type == 'wait'){
  742. let content = JSON.parse(redata.data.content)
  743. this.artAndLeave = 100;
  744. }
  745. //接收客服会话
  746. if(redata.message_type == 'chatMessage'){
  747. //存储会话超时间
  748. this.webTime = redata.data.time;
  749. //会话大于两分钟显示
  750. let timer = ''
  751. if(this.returnTimer == ''){
  752. timer = redata.data.time;
  753. this.returnTimer = redata.data.time
  754. }else{
  755. let timeStamp = this.returnTimer.split(":");
  756. let rdtime = redata.data.time.split(":");
  757. if(timeStamp[0] == rdtime[0]){
  758. if((rdtime[1] - timeStamp[1]) < 2){
  759. timer = ''
  760. }else{
  761. timer = redata.data.time;
  762. }
  763. }
  764. }
  765. //
  766. let contType = this.isJSON(redata.data.content);
  767. let content = {};
  768. if(contType == false){
  769. content.text = redata.data.content
  770. }else{
  771. content = JSON.parse(redata.data.content)
  772. }
  773. let obj = {
  774. time:timer,
  775. content:content.text ? this.turnFace(content.text) :'',
  776. imgUrl:content.img ? content.img : '',
  777. type:'service'
  778. }
  779. this.customerSviceChat.push(obj);
  780. // console.log(this.customerSviceChat);
  781. this.selNum++;
  782. this.automaticRolling();
  783. }
  784. //接收机器会话
  785. if(redata.message_type == 'robotMessage'){
  786. if(redata.data.content == 'error'){
  787. let _this = this;
  788. this.chatCont.push({type:1001 })
  789. this.automaticRolling();
  790. }else{
  791. this.chatCont.push({
  792. 'robot_content':redata.data.content,
  793. 'type' : 'machine'
  794. })
  795. this.automaticRolling();
  796. }
  797. }
  798. // 没有客服上线.
  799. if(redata.message_type == 'notice'){
  800. this.artAndLeave = 100;
  801. this.automaticRolling();
  802. this.machineAndAtl = 10;
  803. this.jumpArtl = false;
  804. this.initWebSocket();
  805. //this.noServer();
  806. }
  807. // 客服关闭会话.
  808. if(redata.message_type == 'closeBysever'){
  809. this.closeByServer = true;
  810. this.automaticRolling();
  811. }
  812. // 客服掉线.
  813. if(redata.message_type == 'serviceoffline'){
  814. this.serverNotOnlin = true;
  815. this.closeByServer = true;
  816. this.automaticRolling();
  817. }
  818. // 超时.
  819. if(redata.message_type == 'overtime'){
  820. this.willOverTime = redata.data.content;
  821. this.automaticRolling();
  822. }
  823. },
  824. /************关闭会话****************** */
  825. websocketonclose(e){
  826. console.log('断开会话',e);
  827. },
  828. /******************消息发送数据处理********************/
  829. sendMessage(){
  830. // this.doubSensitive = [];
  831. this.senType = '';
  832. //发送消息时间获取服务器时间
  833. let currentdate = '';
  834. if(this.timerVote != ''){
  835. currentdate = this.newTimer();
  836. }else{
  837. let date = new Date();
  838. let curtDate = date.getHours()*60 + date.getMinutes()
  839. this.timerVote = curtDate;
  840. currentdate = '';
  841. }
  842. // 给机器人发送文本消息
  843. if(this.machineAndAtl == 10){
  844. //给机器人发送文本消息-本地储存
  845. let datas = {
  846. time : currentdate,
  847. chat : this.turnFace(this.shieldingKeyword(this.information)),
  848. imgUrl : this.img,
  849. type:'user'
  850. }
  851. this.chatCont.push(datas)
  852. //消息发送-机器人
  853. this.websocketsend(JSON.stringify({
  854. type:'toRobot',
  855. data:{
  856. groups_id :'1',
  857. robot_name:this.shieldingKeyword(this.information),
  858. webTime:this.webTime,
  859. robotgroups_id:'1',
  860. }
  861. }))
  862. }else if(this.machineAndAtl == 100){ //人工聊天
  863. //发送给客服消息-本地储存
  864. this.customerSviceChat.push({
  865. time : currentdate,
  866. content : this.turnFace(this.shieldingKeyword(this.information)),
  867. imgUrl : this.img,
  868. type:'user',
  869. });
  870. console.log(this.customerSviceChat);
  871. //消息发送-客服
  872. this.websocketsend(JSON.stringify({
  873. type:'chatMessage',
  874. data:{
  875. from_name : this.user_info.name,
  876. from_avatar:this.user_info.avatar,
  877. from_id : this.user_info.id,
  878. content : JSON.stringify({
  879. text:this.information,
  880. img :this.img,
  881. type:'user'
  882. }),
  883. webTime:this.webTime,
  884. to_id : this.service.kf_id,
  885. to_name :this.service.kf_name,
  886. sensitiveNumber:this.sensitiveNumber,
  887. conversationId : this.service.conversationId
  888. }
  889. }))
  890. }
  891. // 发送之后清空发送数据
  892. this.img = '';
  893. this.information = '';
  894. //高度自动向上滑动
  895. this.automaticRolling();
  896. },
  897. /**************获取会话间隔是否大于2分钟**************** */
  898. newTimer(){
  899. //console.log('house',this.hourse)
  900. this.timerVote = this.curtTimer;
  901. let currentdate = this.hourse;
  902. this.curtTimer = this.hourse;
  903. if(this.timerVote != ''){
  904. let timeDiffence = this.curtTimer - this.timerVote;
  905. if(timeDiffence < 2 ){
  906. currentdate = ''
  907. }
  908. }
  909. return currentdate;
  910. },
  911. /*************数据发送***************** */
  912. websocketsend(data){
  913. this.websock.send(data);
  914. },
  915. /*************设置token加密***************** */
  916. setApiToken(name,controller,time,modules){
  917. return this.$md5.hex_md5(name +'customer-service' + controller + time + modules)
  918. },
  919. /*************跳转人工客服***************** */
  920. jumpService(id){
  921. this.jumpArtl = true;
  922. this.closeByServer = false;
  923. this.group = id;
  924. //人工会话登陆
  925. let data = {
  926. 'type' : 'userInit',
  927. data:{
  928. 'uid':this.user_info.id,
  929. 'name':this.user_info.name,
  930. 'avatar':this.user_info.avatar,
  931. 'group':this.group
  932. }
  933. }
  934. this.websock.send(JSON.stringify(data));
  935. },
  936. /*************机器智能回答问题***************** */
  937. answers(idx){
  938. let obj = {
  939. 'robot_addTime':this.problem[idx].robot_addTime,
  940. 'robot_content':this.problem[idx].robot_content,
  941. 'type' : 'machine'
  942. }
  943. this.information = this.problem[idx].robot_name
  944. this.sendMessage();
  945. this.automaticRolling();
  946. },
  947. /**************匿名注册**************** */
  948. registered(){
  949. let token = localStorage.getItem('token');
  950. let data={
  951. token:token != null ? token :'',//
  952. appid: this.$public.getQueryString('appid') ,//
  953. appuid:this.$public.getQueryString('appuid'),//
  954. }
  955. let obj = {
  956. headers: {
  957. "apiToken":this.setApiToken('autoreg','register',this.currTime,'index')
  958. }
  959. }
  960. this.$axios.post('/api/index/register/autoReg',data,obj).then(res=>{
  961. if(res.data.code ==1){
  962. this.user_info = res.data.data;
  963. localStorage.setItem("token", res.data.data.token);
  964. }
  965. })
  966. },
  967. /***********聊天滑动的时候滑动滚动条到底部******************* */
  968. automaticRolling(){
  969. this.$nextTick(() => {
  970. let msg = document.getElementById('main') // 获取对象
  971. msg.scrollTop = msg.scrollHeight // 滚动高度
  972. })
  973. },
  974. /**************获取敏感词**************** */
  975. getSensitive(){
  976. let obj = {
  977. headers: {
  978. 'Content-Type' :'application/x-www-form-urlencoded',
  979. "apiToken":this.setApiToken('sensitivewords','index',this.currTime,'index')
  980. }
  981. };
  982. let data = {
  983. userToken :''
  984. }
  985. this.$axios.post('/api/index/index/sensitiveWords','',obj).then(res =>{
  986. if(res.data.code == 1){
  987. console.log(res.data.data);
  988. res.data.data.userSensitive.forEach(res =>{
  989. this.sensitive.push(res.sensitivewords_word)
  990. })
  991. }
  992. })
  993. },
  994. /**********判定是否是JSON格式*********** */
  995. isJSON(str) {
  996. if (typeof str == 'string') {
  997. try {
  998. JSON.parse(str);
  999. return true;
  1000. } catch(e) {
  1001. //console.log(e);
  1002. return false;
  1003. }
  1004. }
  1005. },
  1006. },
  1007. /**************页面加载中挂载**************** */
  1008. mounted(){
  1009. let self = this;
  1010. this.frceArr = frce.frce;
  1011. this.$axios.get('api/index/index/systime?t='+new Date()).then(res =>{
  1012. if(res.data.code == 1){
  1013. // 获取系统时间
  1014. let date = res.data.data.time.split(" ");
  1015. date[0] = (new Date( date[0].replace(/-/g,'/')).getTime()) /1000;;
  1016. this.currTime = date[0];
  1017. this.hourse = date[1];
  1018. // 获取机器智能问题
  1019. this.getProblem();
  1020. // 匿名注册
  1021. this.registered();
  1022. setTimeout(() => {
  1023. //关闭加载条
  1024. this.allLoadingClose();
  1025. // 初始化websocket
  1026. this.initWebSocket();
  1027. }, 2000);
  1028. // 获取聊天次数
  1029. this.getChatNum();
  1030. // 获取敏感词
  1031. this.getSensitive();
  1032. }
  1033. })
  1034. },
  1035. // 组件挂载阶段
  1036. destroyed() {
  1037. this.websock.close() //离开路由之后断开websocket连接
  1038. },
  1039. computed:{
  1040. inforLeng(){
  1041. return this.information.length;
  1042. }
  1043. },
  1044. watch:{
  1045. inforLeng(val){
  1046. if(val > 0){
  1047. this.sendCol = true;
  1048. }else{
  1049. this.sendCol = false;
  1050. }
  1051. }
  1052. }
  1053. }
  1054. </script>
  1055. <style scoped>
  1056. .chatBox{
  1057. width: 700px;
  1058. position: relative;
  1059. }
  1060. .el-header{
  1061. background:linear-gradient(90deg,rgba(22,84,209,1) 0%,rgba(9,52,173,1) 100%);
  1062. box-shadow:0px 3px 3px rgba(0,0,0,0.2);
  1063. }
  1064. .tit{
  1065. height: 100%;
  1066. line-height: 80px;
  1067. text-align: left;
  1068. padding-left: 20px;
  1069. }
  1070. .el-col span{
  1071. font-size: 18px;
  1072. color: #FFFFFF;
  1073. }
  1074. .imgBox{
  1075. text-align: right;
  1076. }
  1077. .imgBox img{
  1078. margin-right: 20px;
  1079. }
  1080. .imgBox img:nth-last-child(1){
  1081. margin-right: 0
  1082. }
  1083. .el-main{
  1084. background: #fff;
  1085. width: 63%;
  1086. padding: 0;
  1087. }
  1088. .el-aside{
  1089. background: #F5F5F5;
  1090. width: 37%;
  1091. }
  1092. .cationer,.artificial{
  1093. display: flex;
  1094. justify-content: space-between;
  1095. /* align-items: center; */
  1096. }
  1097. .rt{
  1098. width: 100%;
  1099. box-sizing:inherit;
  1100. }
  1101. .artificial{
  1102. /* width: 150px; */
  1103. /* padding:0 20px; */
  1104. margin-top: 23px;
  1105. margin-bottom: 9px;
  1106. vertical-align: middle;
  1107. /* flex-direction: column;*/
  1108. }
  1109. .infor div{
  1110. margin-bottom: 3px;
  1111. }
  1112. .infor div span,.autograph span{
  1113. color: #999999;
  1114. font-size: 14px;
  1115. font-weight:400;
  1116. }
  1117. .infor div span:nth-child(2),.autograph span:nth-child(2){
  1118. color: #666666;
  1119. margin-left: 4px;
  1120. }
  1121. .headPortrait{
  1122. width: 46%;
  1123. height: 100px;
  1124. }
  1125. .headPortrait img{
  1126. width: 100%;
  1127. height: 100%;
  1128. }
  1129. .autograph{
  1130. margin-bottom: 11px;
  1131. }
  1132. .advent{
  1133. border-top: 1px solid #DDDDDD;
  1134. padding: 20px;
  1135. }
  1136. .advent img{
  1137. width: 100%;
  1138. height: 350px;
  1139. }
  1140. .pd{
  1141. padding: 20px;
  1142. }
  1143. .pd20{
  1144. padding: 0 20px;
  1145. }
  1146. /* 会话 */
  1147. .conversationBox{
  1148. margin-top: 13px;
  1149. margin-bottom: 13px;
  1150. }
  1151. .timer{
  1152. text-align: center;
  1153. margin: 10px 0;
  1154. color: #999999;
  1155. font-size: 12px;
  1156. }
  1157. .headImg{
  1158. width: 40px;
  1159. height: 40px;
  1160. margin-right: 13px;
  1161. }
  1162. .headImg img{
  1163. display: inline-block;
  1164. width: 40px;
  1165. height: 40px;
  1166. }
  1167. .conversation .cont,.customer .cont{
  1168. background: #ffffff;
  1169. padding: 9px 8px 12px 10px;
  1170. display: inline-block;
  1171. border: 1px solid rgba(223, 223, 223, 1);
  1172. border-radius: 5px;
  1173. position: relative;
  1174. max-width: 270px;
  1175. }
  1176. .left::after{
  1177. position: absolute;
  1178. content: "";
  1179. display: inline-block;
  1180. left: -4px;
  1181. top: 5px;
  1182. width: 5px;
  1183. height: 9px;
  1184. background: #fff;
  1185. -webkit-transform: skewX(30deg);
  1186. transform: skewX(30deg);
  1187. /* z-index: -1; */
  1188. border-left: 1px solid #dfdfdf;
  1189. border-top: 1px solid #dfdfdf;
  1190. }
  1191. div.noafter::after{
  1192. content: '';
  1193. width: 0;
  1194. height: 0;;
  1195. display: inline;
  1196. position: relative;
  1197. border: 0;
  1198. }
  1199. .conversation .cont div,.customer .cont div{
  1200. color: #666666;
  1201. font-size: 16px;
  1202. }
  1203. .customer{
  1204. justify-content: space-between;
  1205. }
  1206. .customer .cont{
  1207. margin-right: 13px;
  1208. border: 0;
  1209. background: #5EA0F7;
  1210. max-width: 260px;
  1211. word-wrap: break-word;
  1212. word-break: normal;
  1213. }
  1214. .customer .cont div{
  1215. color: #FFFFFF;
  1216. }
  1217. .right::after{
  1218. position: absolute;
  1219. content: "";
  1220. display: inline-block;
  1221. right: -3px;
  1222. top: 6px;
  1223. width: 5px;
  1224. height: 9px;
  1225. background: #5ea0f7;
  1226. -webkit-transform: skewX(-30deg);
  1227. transform: skewX(-30deg);
  1228. border-left: 1px solid #5ea0f7;
  1229. border-top: 1px solid #5ea0f7;
  1230. }
  1231. .col{
  1232. color: #999999;
  1233. }
  1234. .change{
  1235. color: #5ea0f7;
  1236. }
  1237. .questionList,.changeService{
  1238. margin: 10px;
  1239. border:1px solid rgba(223,223,223,1);
  1240. border-radius: 5px;
  1241. }
  1242. .questionList div,.changeService div{
  1243. height: 40px;
  1244. line-height: 40px;
  1245. padding-left: 15px;
  1246. }
  1247. .questionList div span{
  1248. color: #5EA0F7;
  1249. font-size:14px;
  1250. }
  1251. .questionList section:nth-child(odd),.changeService div:nth-child(odd){
  1252. background: #F6F6F6;
  1253. }
  1254. .changeService div span{
  1255. font-size: 14px;
  1256. }
  1257. .changeService div span:nth-child(1){
  1258. margin-right: 5px;
  1259. }
  1260. .col6{
  1261. color: #666666!important;
  1262. }
  1263. .colE5{
  1264. color: #5EA0F7;
  1265. }
  1266. .promptBox{
  1267. display: flex;
  1268. justify-content: center;
  1269. height: 26px;
  1270. margin: 10px 0 10px;
  1271. /* line-height: 26px; */
  1272. }
  1273. .promptBoxH{
  1274. display: flex;
  1275. justify-content: center;
  1276. height: 50px;
  1277. margin: 10px 0 10px;
  1278. /* line-height: 26px; */
  1279. }
  1280. .prompt{
  1281. text-align: center;
  1282. padding: 5px 28px 4px;
  1283. background: #DDDDDD;
  1284. border-radius:30px;
  1285. width: 140px;
  1286. color: #FFFFFF;
  1287. font-size: 12px;
  1288. }
  1289. .help{
  1290. width: 260px;
  1291. }
  1292. .help .prompt{
  1293. width: 100%;
  1294. }
  1295. /* 评论 */
  1296. .evaluate{
  1297. height: 101px;
  1298. padding: 19px 0 16px;
  1299. background:rgba(255,255,255,1);
  1300. border:1px solid rgba(223,223,223,1);
  1301. border-radius:10px;
  1302. margin-top: 15px;
  1303. text-align: center;
  1304. position: relative;
  1305. box-sizing: border-box;
  1306. }
  1307. .evaluate span{
  1308. font-size: 14px;
  1309. color: #666666;
  1310. }
  1311. .nopd{
  1312. padding: 0;
  1313. }
  1314. .evaluate .btn{
  1315. display: block;
  1316. background: #F04992;
  1317. border-radius:10px;
  1318. margin-top: 10px;
  1319. color: #FFFFFF;
  1320. height: 36px;
  1321. line-height: 36px;
  1322. width: 100px;
  1323. position: absolute;
  1324. bottom: 16px;
  1325. left: 35%;
  1326. cursor: pointer;
  1327. }
  1328. /* 聊天框 */
  1329. .chatting{
  1330. width: 100%;
  1331. background:rgba(255,255,255,1);
  1332. box-shadow:0px -5px 5px rgba(0,0,0,0.05);
  1333. height: 100px;
  1334. padding: 10px 20px;
  1335. }
  1336. .informationBox{
  1337. height: 500px;
  1338. overflow: auto;
  1339. }
  1340. .expression,.photo{
  1341. display: inline-block;
  1342. width: 18px;
  1343. height: 18px;
  1344. background: url("./../assets/st-img/expression.png") no-repeat;
  1345. background-size: 100% 100%;
  1346. cursor: pointer;
  1347. margin-right: 18px;
  1348. }
  1349. .expression:hover{
  1350. background: url("./../assets/st-img/expressionHover.png") no-repeat;
  1351. background-size: 100% 100%;
  1352. }
  1353. .photo{
  1354. background: url("./../assets/st-img/photo.png") no-repeat;
  1355. background-size: 100% 100%;
  1356. }
  1357. .photo:hover{
  1358. background: url("./../assets/st-img/photoHover.png") no-repeat;
  1359. background-size: 100% 100%;
  1360. }
  1361. textarea{
  1362. height: 30px;
  1363. width: 300px;
  1364. border: 0;
  1365. -webkit-user-select:auto;
  1366. user-select:auto;-o-user-select:auto;
  1367. -ms-user-select:auto;
  1368. resize: none;
  1369. outline: none;
  1370. padding-top: 10px;
  1371. }
  1372. .sendOut{
  1373. width: 80px;
  1374. height: 44px;
  1375. line-height: 40px;
  1376. border:1px solid rgba(221,221,221,1);
  1377. border-radius:5px;
  1378. text-align: center;
  1379. margin-left: 20px;
  1380. }
  1381. .sendOut span{
  1382. color: #CCCCCC;
  1383. font-size: 16px;
  1384. }
  1385. .chattingBox{
  1386. margin-top: 12px;
  1387. }
  1388. /* 评论弹框 */
  1389. .zzBox{
  1390. position: absolute;
  1391. width: 100%;
  1392. height: 100%;
  1393. background: rgba(0,0,0,0.3)
  1394. }
  1395. .box-card,.proving{
  1396. width: 494px;
  1397. height: 429px;
  1398. position: absolute;
  1399. left: 50%;
  1400. top: 50%;
  1401. transform: translate(-50%,-50%);
  1402. z-index : 999;
  1403. border-radius:10px;
  1404. padding: 20px 20px 30px 50px;
  1405. box-sizing: border-box;
  1406. }
  1407. .proving{
  1408. padding:20px 20px 30px 47px;
  1409. }
  1410. /* .close{
  1411. text-align: right;
  1412. cursor: pointer;
  1413. } */
  1414. /* .close i{
  1415. display: inline-block;
  1416. width: 18px;
  1417. height: 18px;
  1418. background: url("./../assets/st-img/close.png") no-repeat;
  1419. background-size: 100% 100%;
  1420. } */
  1421. .box-card .tit{
  1422. text-align: center;
  1423. padding-right: 65px;
  1424. margin-bottom: 40px;
  1425. }
  1426. .box-card .tit span{
  1427. font-size:18px;
  1428. color: #666666;
  1429. }
  1430. .selIcon{
  1431. padding-right: 30px;
  1432. margin-bottom: 30px;
  1433. }
  1434. .selIcon div {
  1435. text-align: center;
  1436. cursor: pointer;
  1437. }
  1438. .selIcon div i{
  1439. display: block;
  1440. width: 44px;
  1441. height: 44px;
  1442. background: url("./../assets/st-img/satisfied.png") no-repeat;
  1443. background-size: 100% 100%;
  1444. margin-bottom: 10px;
  1445. }
  1446. .selIcon div span{
  1447. /* display: block; */
  1448. }
  1449. .selIcon div .comm{
  1450. background: url("./../assets/st-img/comm2.png") no-repeat;
  1451. }
  1452. .selIcon div .sfd{
  1453. background: url("./../assets/st-img/Satisfied2.png") no-repeat;
  1454. }
  1455. .selIcon div .comm2{
  1456. background: url("./../assets/st-img/comm.png")no-repeat;
  1457. }
  1458. .selIcon div .notSfd{
  1459. background: url("./../assets/st-img/notSatisfied2.png")
  1460. }
  1461. .selIcon div .notSfd2{
  1462. background: url("./../assets/st-img/notSatisfied.png")
  1463. }
  1464. .levMsg{
  1465. padding-right: 30px;
  1466. margin-bottom: 20px;
  1467. }
  1468. .sure{
  1469. text-align: center;
  1470. background:linear-gradient(90deg,rgba(22,84,209,1) 0%,rgba(9,52,173,1) 100%);
  1471. box-shadow:0px 3px 3px rgba(0,0,0,0.2);
  1472. border-radius:10px;
  1473. width: 100px;
  1474. height: 48px;
  1475. line-height: 48px;
  1476. color: #fff;
  1477. position: absolute;
  1478. bottom:30px;
  1479. left: 37%;
  1480. cursor: pointer;
  1481. }
  1482. /* 验证框 */
  1483. .logo{
  1484. text-align: center;
  1485. margin-bottom: 20px;
  1486. }
  1487. .logo span{
  1488. font-size: 38px;
  1489. font-weight:bold;
  1490. color: #5EA0F7;
  1491. font-family:Microsoft YaHei;
  1492. }
  1493. .logo span:nth-child(1){
  1494. color: #F04992;
  1495. }
  1496. .formBox{
  1497. padding:0 27px 0 0;
  1498. }
  1499. .formBox .el-input{
  1500. margin-bottom: 21px;
  1501. }
  1502. .formBox .phone .el-input,.formBox .email .el-input{
  1503. margin-bottom: 0;
  1504. }
  1505. .formBox .phone,.formBox .email{
  1506. margin-bottom: 10px;
  1507. }
  1508. .vertion {
  1509. vertical-align: middle;
  1510. /* margin-bottom: 28px; */
  1511. }
  1512. .vertion .el-input{
  1513. width: 250px;
  1514. margin-right: 15px;
  1515. display: inline-block;
  1516. }
  1517. .vertion span{
  1518. display: inline-block;
  1519. width: 128px;
  1520. height: 40px;;
  1521. vertical-align: middle;
  1522. background:rgba(241,225,224,1);
  1523. }
  1524. .formBox .sure{
  1525. bottom: 21px;
  1526. }
  1527. .el-card__body .tit{
  1528. line-height: 25px;
  1529. }
  1530. .chatting .el-button{
  1531. border: none;
  1532. padding: 0;
  1533. border-radius: 0
  1534. }
  1535. .emoticon{
  1536. width: 30px;
  1537. height: 30px;
  1538. display: inline-block;
  1539. }
  1540. .pointer{
  1541. cursor: pointer;
  1542. }
  1543. .ly:hover{
  1544. border-bottom: 1px solid #5EA0F7;
  1545. /* 高亮效果 */
  1546. filter: brightness(0.9);
  1547. }
  1548. .gl:hover{
  1549. filter: brightness(0.9);
  1550. }
  1551. .seek:hover{
  1552. background: #860c60
  1553. }
  1554. .sendCol{
  1555. background: linear-gradient(90deg,rgba(22,84,209,1) 0%,rgba(9,52,173,1) 100%);
  1556. }
  1557. .netSendCol{
  1558. cursor: not-allowed;
  1559. }
  1560. /* 修改滚动条 */
  1561. ::-webkit-scrollbar-button{
  1562. background: transparent;
  1563. border: 0;
  1564. }
  1565. /* 顶部三个图标 */
  1566. .imgBox i{
  1567. display: inline-block;
  1568. width: 25px;
  1569. height: 25px;
  1570. margin-right: 20px;
  1571. background: url("./../assets/st-img/pj.png") no-repeat;
  1572. background-size: 100% 100%;
  1573. vertical-align: middle;
  1574. }
  1575. .imgBox .sy{
  1576. background: url("./../assets/st-img/sy.png") no-repeat;
  1577. }
  1578. .imgBox .sq{
  1579. background: url("./../assets/st-img/sq.png") no-repeat;
  1580. }
  1581. /* .sc:hover{
  1582. background: url("./../assets/st-img/pjhover.png") no-repeat;
  1583. }
  1584. .sy:hover{
  1585. background: url("./../assets/st-img/sy2.png")no-repeat;
  1586. }
  1587. .sq:hover{
  1588. background: url("./../assets/st-img/sq2.png") no-repeat;
  1589. } */
  1590. i.scActy{
  1591. background: #1654D1 url("./../assets/st-img/pjhover.png") no-repeat;
  1592. width: 33px;
  1593. height: 33px;
  1594. background-position: 5px;
  1595. }
  1596. /* .imgBox .syActy{
  1597. background:#1654D1 url("./../assets/st-img/jzsy.png") no-repeat;
  1598. width: 33px;
  1599. height: 33px;
  1600. background-position: 5px;
  1601. }
  1602. .imgBox .sqActy{
  1603. background: #1654D1 url("./../assets/st-img/sq2.png") no-repeat;
  1604. width: 33px;
  1605. height: 33px;
  1606. transform: rotate(180deg);
  1607. background-position: 5px;
  1608. } */
  1609. .tips{
  1610. font-size: 12px;
  1611. color: #F04992;
  1612. }
  1613. #main{
  1614. position: relative;
  1615. }
  1616. .retract{
  1617. position: absolute;
  1618. right: 0;
  1619. top: 225px;
  1620. }
  1621. </style>