index.vue 55 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079
  1. <template>
  2. <div>
  3. <!-- 聊天 -->
  4. <div class="service" v-if="!knowledge">
  5. <!-- 头部信息 -->
  6. <div class="header row allAlignment item-center">
  7. <div class="row item-center" v-if="!link_success">
  8. <img class="icon" style="margin-right:.2rem;" src="@/assets/Service1.png" @click="leftShow = true">
  9. <img class="logo" :src="img_http + logo" alt="">
  10. <p>{{service_info.name}}</p>
  11. <span style="margin:5px 0 0 5px"><img src="@/assets/on_icon.png" alt=""></span>
  12. </div>
  13. <div class="row item-center" v-else>
  14. <img class="icon" style="margin-right:.2rem;" src="@/assets/Service1.png" @click="leftShow = true">
  15. <img class="logo" :src="img_http + logo" alt="">
  16. <p>{{service_info.name}}</p>
  17. <span v-if="service_on" style="margin:5px 0 0 5px"><img src="@/assets/on_icon.png" alt=""></span>
  18. <span v-if="!service_on" style="margin:5px 0 0 5px"><img src="@/assets/off_icon.png" alt=""></span>
  19. </div>
  20. <div class="row">
  21. <yd-button v-if="isExit" color="#fff" bgcolor="#1d57dd" class="exit" size="mini" type="primary"
  22. @click.native="is_exit()">结束聊天
  23. </yd-button>
  24. <img class="icon-msg" v-if="( chat.length -1 ) + hisLength >= chatNum" @click="is_show_evaluate()" src="@/assets/Service2.png">
  25. <img class="icon-msg" @click="knowledge = true,flag = false" src="@/assets/leaveSwitch.png" v-if="!isExit">
  26. </div>
  27. </div>
  28. <div class="main" id="main">
  29. <!-- ********************************************************** -->
  30. <!-- 机器人聊天板块 -->
  31. <div v-if="!link_success">
  32. <!-- 系统欢迎语 -->
  33. <div v-if="welcome.length > 0" v-for="(item,i) in welcome" :key="'w'+i">
  34. <div class="row allAlignment" style="margin-top:.3rem;">
  35. <div class="HeadPortrait row center">
  36. <img :src="require('@/assets/headAdvent.png')">
  37. </div>
  38. <div class="messageWindow dialogueA col-w">
  39. <div class="customerService left" v-html="item"></div>
  40. </div>
  41. </div>
  42. </div>
  43. <!-- 系统消息下拉选择 -->
  44. <div class="artificial" v-if="problem.length > 0 && welcome.length > 0">
  45. <div class="row item-center allAlignment" style="height:.75rem;border-bottom:.01rem solid #EEE;"
  46. v-for="(item,index) in problem" :key="index" @click="pushMessage(item.robot_content)">
  47. <span>{{item.robot_name}}</span>
  48. <img style="width:.3rem;height:.3rem;" src="@/assets/addright.png">
  49. </div>
  50. <div class="row item-center" style="height:.72rem;">
  51. <p>以上问题都不是</p>
  52. <div style="color:#5EA0F7;padding-left:.1rem;" @click="connectionService">转人工客服</div>
  53. </div>
  54. </div>
  55. <!-- 和机器人会话 -->
  56. <div v-for="(item,i) in robot" :key="'r'+i">
  57. <!-- 和机器人会话互动 -->
  58. <div v-if="item.type == 'error'" class="row allAlignment"
  59. style="margin-top:.3rem;">
  60. <div class="HeadPortrait row center">
  61. <img v-if="item.type == 'error'" :src="require('@/assets/headAdvent.png')">
  62. </div>
  63. <div class="messageWindow dialogueA col-w">
  64. <!-- <div v-if="item.type == '1001'" class="customerService left"
  65. v-html="item.content.text"></div> -->
  66. <!-- <div v-if="item.type == 'user'" class="user right imgSrc">
  67. <yd-lightbox v-if="item.content.img" style="display:inline-block"
  68. class="row rightAlignment box-img">
  69. <yd-lightbox-img :src=" img_http + item.content.img"></yd-lightbox-img>
  70. </yd-lightbox> -->
  71. <div v-if="item.type == 'error'" class="customerService left">{{item.content.text}}
  72. <div style="color:#5EA0F7;padding-left:.1rem;cursor:pointer;" @click="connectionService">转人工客服</div>
  73. </div>
  74. <!-- </div> -->
  75. </div>
  76. <div class="HeadPortrait row center">
  77. <img v-if="item.type == 'user'"
  78. :src="require('@/assets/timg.jpg') ">
  79. </div>
  80. </div>
  81. <!-- 和机器人会话互动 -->
  82. <div v-if="item.type == 'service' || item.type == 'user'" class="row allAlignment"
  83. style="margin-top:.3rem;">
  84. <div class="HeadPortrait row center">
  85. <img v-if="item.type == 'service'" :src="require('@/assets/headAdvent.png')">
  86. </div>
  87. <div class="messageWindow dialogueA col-w"
  88. :style="item.type == 'user'?'text-align: right;':''">
  89. <div v-if="item.type == 'service'" class="customerService left"
  90. v-html="item.content.text"></div>
  91. <div v-if="item.type == 'user'" class="user right imgSrc">
  92. <yd-lightbox v-if="item.content.img" style="display:inline-block"
  93. class="row rightAlignment box-img">
  94. <yd-lightbox-img :src=" img_http + item.content.img"></yd-lightbox-img>
  95. </yd-lightbox>
  96. <div v-else v-html="item.content"></div>
  97. </div>
  98. </div>
  99. <div class="HeadPortrait row center">
  100. <img v-if="item.type == 'user'"
  101. :src="require('@/assets/timg.jpg') ">
  102. </div>
  103. </div>
  104. <!-- 转人工分组 -->
  105. <div class="artificial" v-if="item.type == 'artificial_service' ">
  106. <div @click="turnArtificial(items.id)" v-for="(items,indexs) in item.content"
  107. :key="'r'+indexs" class="row item-center allAlignment"
  108. style="height:.75rem;border-bottom:.01rem solid #EEE;">
  109. <p>
  110. 人工客服:
  111. <span style="color:#5EA0F7;padding-left:.1rem;">{{items.name}}</span>
  112. </p>
  113. <img style="width:.3rem;height:.3rem;" src="@/assets/addright.png">
  114. </div>
  115. </div>
  116. </div>
  117. </div>
  118. <!-- ********************************************************** -->
  119. <!-- 人工会话模版 -->
  120. <div v-if="link_success">
  121. <!--历史消息-->
  122. <div v-if="showHistory" v-for="item in hisSviceChat">
  123. <!-- 客服信息 -->
  124. <div v-if="item.from_id.startsWith('KF')">
  125. <div style="width: 100%;text-align: center;">
  126. <span v-if="item.time_line">{{item.time_line}}</span>
  127. </div>
  128. <div class="row allAlignment" style="margin-top:.3rem;margin-top: 0.3rem;">
  129. <div class="HeadPortrait row center">
  130. <img v-if="service_info.avatar == '' " :src="avatar_imgs">
  131. <img v-if="service_info.avatar != ''"
  132. :src="img_http + service_info.avatar ? img_http + service_info.avatar : require('@/assets/user2.png')">
  133. </div>
  134. <div class="messageWindow dialogueA col-w">
  135. <div class="customerService left imgSrc">
  136. <yd-lightbox v-if="item.content.img" style="display:inline-block"
  137. class="row rightAlignment">
  138. <yd-lightbox-img :src=" img_http + item.content.img"></yd-lightbox-img>
  139. </yd-lightbox>
  140. <div v-html="item.content.text" v-else></div>
  141. </div>
  142. </div>
  143. <div class="HeadPortrait row center">
  144. </div>
  145. </div>
  146. </div>
  147. <!-- 用户信息 -->
  148. <div v-else>
  149. <div style="width: 100%;text-align: center;margin-top: 0.3rem;">
  150. <span v-if="item.time_line">{{item.time_line}}</span>
  151. </div>
  152. <div class="row allAlignment" style="margin-top:.3rem;">
  153. <div class="HeadPortrait row center">
  154. </div>
  155. <div class="messageWindow dialogueA col-w row rightAlignment" >
  156. <div class="user right imgSrc ">
  157. <yd-lightbox v-if="item.content.img" style="display:inline-block" class="row rightAlignment">
  158. <yd-lightbox-img :src="img_http+item.content.img"></yd-lightbox-img>
  159. </yd-lightbox>
  160. <div v-html="item.content.text" v-else></div>
  161. </div>
  162. </div>
  163. <div class="HeadPortrait row center">
  164. <img :src="require('@/assets/timg.jpg') ">
  165. </div>
  166. </div>
  167. </div>
  168. </div>
  169. <div v-for="(item,index) in chat" :key="index">
  170. <!-- 展示历史消息 -->
  171. <div class="promptBox" v-if="item.type == 'historyMsg'">
  172. <div class="prompt help">
  173. <span>{{historyMsgtext}}</span>
  174. </div>
  175. </div>
  176. <!-- 客服会话 -->
  177. <div v-if="item.type == 'service'">
  178. <div style="width: 100%;text-align: center;margin-top: 0.3rem;">
  179. <span v-if="item.time ">{{item.time}}</span>
  180. </div>
  181. <div class="row allAlignment" style="margin-top:.3rem;">
  182. <div class="HeadPortrait row center">
  183. <img id="123" v-if="service_info.avatar == '' " :src="avatar_imgs">
  184. <img id="321" v-if="service_info.avatar != '' "
  185. :src="img_http + service_info.avatar ? img_http + service_info.avatar : img_http + service_info.avatar">
  186. </div>
  187. <div class="messageWindow dialogueA col-w ">
  188. <div class="customerService left imgSrc">
  189. <yd-lightbox v-if="item.content.img" style="display:inline-block"
  190. class="row rightAlignment">
  191. <yd-lightbox-img :src="img_http + item.content.img"></yd-lightbox-img>
  192. </yd-lightbox>
  193. <div v-html="item.content.text" v-else></div>
  194. </div>
  195. </div>
  196. <div class="HeadPortrait row center">
  197. </div>
  198. </div>
  199. </div>
  200. <!-- 用户会话 -->
  201. <div v-if="item.type == 'user'">
  202. <div style="width: 100%;text-align: center;margin-top: 0.3rem;">
  203. <span v-if="item.time">{{item.time}}</span>
  204. </div>
  205. <div class="row allAlignment" style="margin-top:.3rem;">
  206. <div class="HeadPortrait row center">
  207. </div>
  208. <div class="messageWindow dialogueA col-w row rightAlignment" >
  209. <div class="user right imgSrc ">
  210. <yd-lightbox v-if="item.content.img" style="display:inline-block"
  211. class="row rightAlignment">
  212. <yd-lightbox-img :src="img_http+item.content.img"></yd-lightbox-img>
  213. </yd-lightbox>
  214. <span v-html="item.content.text" v-else>{{item.content.text}}</span>
  215. </div>
  216. </div>
  217. <div class="HeadPortrait row center">
  218. <img v-if="item.type == 'user'"
  219. :src="require('@/assets/timg.jpg') ">
  220. </div>
  221. </div>
  222. </div>
  223. <!-- 常规系统消息评价 -->
  224. <div class="row center " v-if="item.type== 'system' ">
  225. <div class="column item-center "
  226. style="margin: 0.3rem 0; background: #fff; width:100% ;padding: 0.1rem 0;"
  227. v-if="item.content.state =='getEvaluate' && !haveEvaluation ">
  228. <p class="row center wrap">{{item.content.text}}</p>
  229. <button class="evaluateBtn" style="margin-top:.2rem;" @click="is_show_evaluate()">评价
  230. </button>
  231. </div>
  232. <div class="column item-center"
  233. style="margin: 0.3rem 0; background: #fff; width:100% ;padding: 0.1rem 0.5rem;"
  234. v-if="item.content.state == 'closeInform' ">
  235. <p class="row center wrap">{{item.content.text}}</p>
  236. </div>
  237. </div>
  238. </div>
  239. </div>
  240. <div v-if="Chrome_height" style="height:40px">
  241. </div>
  242. <div v-if="Safari_height" style="height:90px">
  243. </div>
  244. </div>
  245. <!-- 底部弹窗评价 -->
  246. <yd-popup v-model="bottomShow" position="bottom" height="6.5rem" :masker-opacity=".2">
  247. <div class="row rightAlignment" style="padding-top:.2rem;padding-right:.2rem;">
  248. <img @click.stop="bottomShow = false, evaluateState = 100" style="width: 0.32rem;height: 0.32rem;"
  249. src="@/assets/Service5.png">
  250. </div>
  251. <div style="color:#666;text-align: center;font-size:.28rem;">感谢您的咨询,请对我们的服务做出评价</div>
  252. <div style="height:2.3rem;" class="row allAlignment evaluatebtn">
  253. <div style="width:33%;height:100%;">
  254. <div class="row wrap center" @click="evaluateClick(1)">
  255. <img style="width:.66rem;height:.66rem;"
  256. :src="evaluateState =='1'?require('@/assets/evaluate1a.png'):require('@/assets/evaluate1.png')">
  257. <p>满意</p>
  258. </div>
  259. </div>
  260. <div style="width:33%;height:100%;" @click="evaluateClick(2)">
  261. <div class="row wrap center">
  262. <img style="width:.66rem;height:.66rem;"
  263. :src="evaluateState =='2'?require('@/assets/evaluate2a.png'):require('@/assets/evaluate2.png')">
  264. <p>一般</p>
  265. </div>
  266. </div>
  267. <div style="width:33%;height:100%;" @click="evaluateClick(3)">
  268. <div class="row wrap center">
  269. <img style="width:.66rem;height:.66rem;"
  270. :src="evaluateState =='3'?require('@/assets/evaluate3a.png'):require('@/assets/evaluate3.png')">
  271. <p>不满意</p>
  272. </div>
  273. </div>
  274. </div>
  275. <!-- <div class="evaluateBox">
  276. <textarea placeholder="评价备注" v-model="evalArea"></textarea>
  277. </div> -->
  278. <div class="row center sub" @click="evaluateEsc">确定</div>
  279. </yd-popup>
  280. <!-- 左侧弹窗客服信息 -->
  281. <yd-popup v-model="leftShow" position="left" width="4.8rem" :masker-opacity=".2">
  282. <div class="leftHader row item-center">
  283. <img @click="leftShow = false" class="icon" src="@/assets/Service4.png">
  284. <img class="logo" :src="img_http + logo" alt="">
  285. <p style="color:#FFF;font-size:.34rem;">{{service_info.name}}</p>
  286. </div>
  287. <div>
  288. <div class="leftMain-top row">
  289. <div>
  290. <p>
  291. <!-- 客服名字 -->
  292. <span>姓名:</span>
  293. {{service_info.name}}
  294. </p>
  295. <p>
  296. <!-- 客服工号 -->
  297. <span>工号:</span>
  298. {{service_info.job_name}}
  299. </p>
  300. <p>
  301. <!-- 客服性别 -->
  302. <span>性别:</span>
  303. {{service_info.gender == "0" ? "保密" :service_info.gender == 1? '男' :'女' }}
  304. </p>
  305. <p>
  306. <!-- 客服职务 -->
  307. <span>职务:</span>
  308. {{service_info.job_name}}
  309. </p>
  310. </div>
  311. <div class="row center">
  312. <img style="width:1.8rem;height:1.8rem;" v-if="!trueImg" :src="avatar_imgs">
  313. <img style="width:1.8rem;height:1.8rem;" v-if="trueImg" :src="img_http +service_info.avatar">
  314. </div>
  315. </div>
  316. <div class="leftMain-chenter"
  317. style="padding:0 .3rem;margin-top:.3rem;padding-bottom:.6rem;border-bottom:.01rem solid #ddd;"
  318. >
  319. <!-- 客服个性签名 -->
  320. <span>个性签名:</span>
  321. {{service_info.signature}}
  322. </div>
  323. <!-- 广告图 -->
  324. <div class="leftMain-bottom row center" style="padding:0 .3rem;margin-top:.6rem;">
  325. <a :href="'http://'+advertisement.advertisement_url" target="_blank" rel="noopener noreferrer">
  326. <img style="width:4.2rem;height:7rem;" :src="img_http+advertisement.advertisement_img">
  327. </a>
  328. </div>
  329. </div>
  330. </yd-popup>
  331. <!-- 底部输入框 -->
  332. <div class="footer row wrap" id='input_box'>
  333. <!-- @keydown="inputNumFun()" -->
  334. <!-- <textarea
  335. id="textarea"
  336. v-model.trim="text_info"
  337. placeholder="请输入你的问题:"
  338. maxlength="450"
  339. @keyup ='keyup_maxlength()'
  340. :style="{height:iboxheight}"
  341. >
  342. </textarea> -->
  343. <autoTextarea placeholder="" lineHeight="30px" border="false" fontSize="18px" />
  344. <div class="send row item-center" style="border-bottom:.01rem solid #ddd">
  345. <img
  346. :src="meme?require('@/assets/faceActive.png'):require('@/assets/face.png')"
  347. @click="faceClick"
  348. style="width:.48rem;height:.48rem"
  349. >
  350. <input type="file" id="file" @change="uploadIMG" accept="image/jpeg,image/jpg,image/png,image/svg"
  351. style="display:none">
  352. <label for="file">
  353. <img src="@/assets/imge.png" style="width:.46rem;height:.42rem">
  354. </label>
  355. <div
  356. @click="send()"
  357. style="color:#ccc;border:.02rem solid #ddd;width:1rem;height:.66rem;border-radius:.1rem;"
  358. :style="text_info.length>0?'background:#5EA0F7;color:#fff;':''"
  359. class="row center"
  360. >发送
  361. </div>
  362. </div>
  363. <!-- 表情包 -->
  364. <div v-show="meme" class="memeBox">
  365. <yd-slider autoplay="0" :loop="false">
  366. <yd-slider-item>
  367. <div>
  368. <ul style="width:100%;padding-bottom:.3rem;" class="row average wrap">
  369. <li v-for="(item,index) in frceArr" :key="index" v-show="index<15">
  370. <img
  371. class="memeImg"
  372. :src="require(`@/assets/${index}.gif`)"
  373. @click="memeImg(index)"
  374. >
  375. </li>
  376. </ul>
  377. </div>
  378. </yd-slider-item>
  379. <yd-slider-item>
  380. <div>
  381. <ul style="width:100%;padding-bottom:.3rem;" class="row average wrap">
  382. <li v-for="(item,index) in frceArr" :key="index" v-show="index>15&&index<=30">
  383. <img
  384. class="memeImg"
  385. :src="require(`@/assets/${index}.gif`)"
  386. @click="memeImg(index)"
  387. >
  388. </li>
  389. </ul>
  390. </div>
  391. </yd-slider-item>
  392. <yd-slider-item>
  393. <div>
  394. <ul style="width:100%;padding-bottom:.3rem;" class="row average wrap">
  395. <li v-for="(item,index) in frceArr" :key="index" v-show="index>30&&index<=45">
  396. <img
  397. class="memeImg"
  398. :src="require(`@/assets/${index}.gif`)"
  399. @click="memeImg(index)"
  400. >
  401. </li>
  402. </ul>
  403. </div>
  404. </yd-slider-item>
  405. <yd-slider-item>
  406. <div>
  407. <ul style="width:100%;padding-bottom:.3rem;" class="row average wrap">
  408. <li v-for="(item,index) in frceArr" :key="index" v-show="index>45&&index<=60">
  409. <img
  410. class="memeImg"
  411. :src="require(`@/assets/${index}.gif`)"
  412. @click="memeImg(index)"
  413. >
  414. </li>
  415. </ul>
  416. </div>
  417. </yd-slider-item>
  418. <yd-slider-item>
  419. <div>
  420. <ul style="width:100%;padding-bottom:.3rem;" class="row average wrap">
  421. <li v-for="(item,index) in frceArr" :key="index" v-show="index>60">
  422. <img
  423. class="memeImg"
  424. :src="require(`@/assets/${index}.gif`)"
  425. @click="memeImg(index)"
  426. >
  427. </li>
  428. </ul>
  429. </div>
  430. </yd-slider-item>
  431. </yd-slider>
  432. </div>
  433. </div>
  434. </div>
  435. <!-- 留言知识库 -->
  436. <div v-if="knowledge">
  437. <!-- 接收返回消息 -->
  438. <knowledgeLibrary @returnIndex="returnIndex" :currentTime="currentTime"/>
  439. </div>
  440. <!-- 发送消息音频提示
  441. <audio id="send" src="../../static/send.wav"></audio>
  442. 接收消息音频提示
  443. <audio id="receive" src="../../static/receive.wav"></audio>
  444. -->
  445. </div>
  446. </template>
  447. <script>
  448. import "../css/index.css";
  449. import knowledgeLibrary from './knowledgeLibrary'
  450. import frce from "./frce.js";
  451. import defaultImgs from "./../assets/timg.jpg"
  452. import headPortrait from "./../assets/headPortrait.png"
  453. import autoTextarea from 'auto-textarea'
  454. export default {
  455. name: "service",
  456. // 模板注册
  457. components: {
  458. knowledgeLibrary,
  459. autoTextarea
  460. },
  461. data() {
  462. return {
  463. /*-----------------------------------------------*/
  464. text_info: "", //输入框内容
  465. knowledge: false,//留言知识库开关
  466. leftShow: false, //左侧详细开关
  467. evaluateOnOff: false, //人工客服评价通知
  468. bottomShow: false, //底部评价弹窗开关
  469. meme: false, // 表情包开关
  470. frceArr: [], //表情包代码
  471. evaluateState: 100,//评价状态
  472. websock: null,//创建websock
  473. user_info: '',//用户信息
  474. apiToken: '',//通话调用凭证
  475. currentTime: '',//接口调用服务器时间
  476. problem: [],//机器人问题
  477. welcome: [],//欢迎语
  478. advertisement: '', //广告
  479. img_http: 'http://manage.281570.com',//图片路径域
  480. //img_http:'http://192.168.2.186:8090',//图片路径域
  481. robot: [],//和机器人聊天临时数据
  482. chat: [],//人工会话
  483. error_num: 1001,//机器人回答超出能力之外编号
  484. isConnection: true,//人工分组列表开关
  485. ibox_height:'auto',
  486. //客服信息
  487. service_info: {
  488. avatar: headPortrait,
  489. job_name: '001',
  490. name: '智能客服',
  491. signature: ""
  492. },
  493. link_success: false,//人工链接成功
  494. service_on: true,
  495. closeByServer: false, //客服关闭会话
  496. serverNotOnlin: false, //客服掉线
  497. willOverTime: false, //超时关闭会话
  498. overTimeMsg: '', // 超时提示内容
  499. conversationId: '',//会话工单
  500. chatNum: 0,//触发评价按钮条件
  501. haveEvaluation: false,//是否已评价
  502. evalArea: '', //评价备注
  503. source: {},//来源信息
  504. initData: 1,//
  505. isTurnArtifcial: true,
  506. Chrome_height: false, // chrome浏览器增加会话框高度
  507. Safari_height:false, // 苹果浏览器增加会话框高度
  508. logo: '',
  509. isExit: false,
  510. historyMsg: false, // 是否展示历史信息
  511. historyMsgtext: "", // 历史信息内容提示
  512. hisSviceChat: [],
  513. showHistory: true,
  514. avatar_imgs: headPortrait,
  515. webTime: '',//人工会话上一次发送消息时间
  516. chatIndex: '',//人工会话上一次下标
  517. /*****************websockt心跳变量*******************/
  518. reconnectData: null,
  519. lockReconnect: false, //避免重复连接,因为onerror之后会立即触发 onclose
  520. timeout: 5000, //5s一次心跳检测
  521. timeoutObj: null,
  522. serverTimeoutObj: null,
  523. waitingMsg: false, // 是否显示等待排队
  524. serviceNotOnlineText: '',
  525. comtSuccess:false,
  526. hisLength:0,
  527. trueImg:false,
  528. };
  529. },
  530. // 方法
  531. methods: {
  532. // 退出聊天
  533. is_exit() {
  534. this.webTime = ''
  535. this.socket_send(JSON.stringify({
  536. type: 'kfCloseUser',
  537. data: {
  538. to_id: this.user_info.id,
  539. kf_id: this.service_info.id,
  540. group_id: this.service_info.group,
  541. conversationId: this.conversationId,
  542. type: 6,
  543. }
  544. }));
  545. this.setInit();
  546. },
  547. /*******************************************/
  548. //设置token加密
  549. setApiToken(name, controller, time, modules) {
  550. //let txetVal = name + 'customer-service' + controller + time + modules;
  551. let txetVal = name + 'customer-service' + controller + modules;
  552. let sssd = txetVal.toLowerCase();
  553. return this.$md5(txetVal.toLowerCase());
  554. },
  555. /*******************************************/
  556. //初始化Websocket链接
  557. initWebSocket(apiToken) {
  558. let sock_ip = ''; // 线上
  559. // let sock_ip = 'ws://192.168.2.187:9101'; // 本地
  560. this.websock = new WebSocket("ws://ky.281570.com:9101?apiToken=" + apiToken);
  561. //数据返回
  562. this.websock.onmessage = this.socket_message;
  563. //数据发送
  564. this.websock.onopen = this.socket_open;
  565. //重新链接
  566. this.websock.onerror = this.socket_error;
  567. //关闭链接
  568. this.websock.onclose = this.socket_close;
  569. },
  570. /*******************************************/
  571. //连接建立之后执行send方法发送数据
  572. socket_open() {
  573. console.log('我链接了');
  574. },
  575. /*******************************************/
  576. //连接建立失败重连
  577. socket_error() {
  578. console.log('连接建立失败重连');
  579. // this.initWebSocket();
  580. // this.setInit();
  581. // this.reconnect();
  582. },
  583. /*******************************************/
  584. //数据接收
  585. socket_message(e) {
  586. if (!e.data) return;
  587. const redata = JSON.parse(e.data);
  588. //心跳检测
  589. this.heatBeat();
  590. // 心跳检测
  591. if (redata.message_type == "ping") {
  592. this.websock.send('{"type":"pong"}')
  593. return false;
  594. }
  595. if (redata.type == 'pong') return false;
  596. if (redata.type != 'pong' || redata.message_type != "ping") {
  597. console.log(redata)
  598. }
  599. //欢迎语
  600. if (redata.message_type == 'helloMessage') {
  601. this.isTurnArtifcial = true;
  602. if (this.initData == 1) {
  603. this.welcome.push(redata.data.content);
  604. //this.welcome.push('请点击您想咨询的问题,若都不是,请在输入框直接输入');
  605. }
  606. }
  607. //广告语
  608. if (redata.message_type == 'advertisement') {
  609. this.advertisement = redata.data[0]
  610. }
  611. //机器人回复
  612. if (redata.message_type == "robotMessage") {
  613. // console.log(redata);
  614. if (redata.data.content == "error") {
  615. this.robot.push({
  616. type: 'error',
  617. content: {text: "您的问题暂无法处理"}
  618. })
  619. // this.error_num++;
  620. } else {
  621. this.robot.push({
  622. type: 'service',
  623. content: {text: redata.data.content}
  624. })
  625. }
  626. console.log(this.robot);
  627. // this.automaticRolling();
  628. //data
  629. //this.robot =
  630. }
  631. //人工链接
  632. if (redata.message_type == 'connect') {
  633. this.willOverTime = false;
  634. this.trueImg = true
  635. this.chat.splice(-1)
  636. let server = {};
  637. if (redata.data) {
  638. server = redata.data
  639. } else {
  640. server = {
  641. conversationId: redata.data.conversationId,
  642. kf_id: redata.data.kf_id,
  643. kf_name: "",
  644. serverInfo: {
  645. avatar: avatarImgs,
  646. client_id: "",
  647. group: "",
  648. id: "",
  649. intime: "",
  650. job_name: "",
  651. name: "tank",
  652. signature: "",
  653. status: 0,
  654. task: 0,
  655. }
  656. }
  657. }
  658. this.service_on = true;
  659. this.isExit = true;
  660. this.link_success = true;
  661. // localStorage.getItem('comtSuccess',true)
  662. this.$dialog.loading.close();
  663. this.service_info = server.serverInfo;
  664. this.conversationId = server.conversationId;
  665. }
  666. // 客服掉线.
  667. if (redata.message_type == 'serviceoffline') {
  668. this.chat.push({
  669. type: 'system',
  670. content: {
  671. text: redata.msg,
  672. state: 'closeInform',
  673. }
  674. })
  675. this.automaticRolling();
  676. this.service_on = false;
  677. // let that = this;
  678. // setTimeout(function () {
  679. // that.link_success = false;
  680. // that.serverNotOnlin = true;
  681. // that.closeByServer = true;
  682. // that.chat.splice(-1)
  683. // },3000)
  684. }
  685. // 客服不在线请稍后再试
  686. if (redata.message_type == 'kfNotOnlin') {
  687. this.service_on = false;
  688. }
  689. // 客服会话超时
  690. if (redata.message_type == 'overtime') {
  691. this.willOverTime = true;
  692. this.automaticRolling();
  693. // this.goBack();
  694. this.overTimeMsg = redata.data.content;
  695. }
  696. // 客服等待排队
  697. if (redata.message_type == "inqueue") {
  698. this.waitingMsg = true;
  699. // this.automaticRolling();
  700. // this.waitingText = redata.content;
  701. this.$dialog.confirm({
  702. title: '温馨提示',
  703. mes: redata.content,
  704. opts: [{
  705. txt: '取消排队',
  706. color: true,
  707. callback: () => {
  708. this.socket_send(JSON.stringify({
  709. "type": "cancelqueue",
  710. "data": {
  711. "uid": localStorage.getItem('uid')
  712. }
  713. }));
  714. this.isTurnArtifcial =true;
  715. // this.$dialog.toast({mes: '你点了确定', timeout: 1000});
  716. }
  717. }]
  718. });
  719. }
  720. //人工会话回复
  721. if (redata.message_type == "chatMessage") {
  722. // 转接的时候清除历史信息
  723. // this.hisSviceChat = [];
  724. // this.getHistory = false;
  725. // 接收提示音
  726. this.receiveAudio();
  727. this.$dialog.loading.close();
  728. let obj = {};
  729. let thisTime = '';
  730. if (this.$public.isJSON(redata.data.content)) {
  731. obj = JSON.parse(redata.data.content);
  732. obj.text = this.turnFace(obj.text);
  733. //接收消息大于两分钟显示时间
  734. let newTime = redata.data.time.split(':');
  735. if (this.webTime) {
  736. let lastTime = this.webTime.split(":");
  737. if (newTime[0] == lastTime[0] && newTime[1] < (lastTime[1] + 2)) {
  738. thisTime = ''
  739. } else {
  740. thisTime = redata.data.time;
  741. }
  742. } else {
  743. thisTime = redata.data.time;
  744. }
  745. this.webTime = redata.data.time;
  746. } else {
  747. obj.text = redata.data.content;
  748. }
  749. this.chat.push({
  750. type: 'service',
  751. time: thisTime ? thisTime : '',
  752. content: obj
  753. })
  754. }
  755. //系统消息通知客户结束通话
  756. if (redata.message_type == 'closeBysever') {
  757. this.setInit();
  758. this.showHistory = false;
  759. this.link_success = false;
  760. this.isTurnArtifcial = true;
  761. localStorage.removeItem('comtSuccess');
  762. this.comtSuccess = false;
  763. }
  764. if (redata.message_type == "changeKeFuSuccess") {
  765. this.$dialog.alert({
  766. mes: redata.data.content
  767. });
  768. }
  769. //系统消息通转人工
  770. if (redata.message_type == 'notice') {
  771. this.$dialog.loading.close();
  772. this.isTurnArtifcial = true;
  773. let _this = this;
  774. this.$dialog.alert({
  775. mes: redata.content, callback: () => {
  776. this.initData = 100;
  777. // _this.$dialog.loading.open('数据加载中...');
  778. // setTimeout(() => {
  779. // _this.$dialog.loading.close();
  780. // // _this.registered();
  781. // }, 2000);
  782. }
  783. });
  784. }
  785. //系统消息评价
  786. if (redata.message_type == "getEvaluate") {
  787. // this.evaluateOnOff = true;
  788. // console.log( this.chat)
  789. this.chat.push({
  790. type: 'system',
  791. content: {
  792. text: redata.data.content,
  793. state: 'getEvaluate',
  794. }
  795. })
  796. }
  797. //会话关闭前通知用户
  798. if (redata.message_type == 'overtime') {
  799. this.chat.push({
  800. type: 'system',
  801. content: {
  802. text: redata.data.content,
  803. state: 'closeInform',
  804. }
  805. })
  806. }
  807. // 历史信息
  808. if (redata.message_type == 'toOld') {
  809. this.hisSviceChat = [];
  810. let obj = redata;
  811. this.historyMsgtext = obj.data.content;
  812. this.chat.push({
  813. type: 'historyMsg',
  814. content: {
  815. text: this.historyMsgtext,
  816. }
  817. })
  818. let historyTime = '';
  819. this.hisLength =obj.data.chatLog.length
  820. obj.data.chatLog.forEach(res => {
  821. // console.log(res,'历史信息');
  822. res.content = JSON.parse(res.content);
  823. let time_line = this.$public.customFormatDateTime(res.time_line, '', 3);
  824. // res.time_line =
  825. if (!historyTime) {
  826. res.time_line = time_line
  827. } else {
  828. let newTime = time_line.split(':');
  829. let lastTime = historyTime.split(':');
  830. if (newTime[0] == lastTime[0] && newTime[1] < (lastTime[1] + 2)) {
  831. res.time_line = '';
  832. } else {
  833. res.time_line = time_line
  834. }
  835. }
  836. historyTime = time_line;
  837. this.hisSviceChat.push(res);
  838. })
  839. }
  840. //获取发送时间
  841. if (redata.message_type == "webTime") {
  842. // console.log(this.chat)
  843. // console.log(this.chatIndex)
  844. if (this.webTime) {
  845. let newTime = redata.data.webTime.split(':');
  846. let time = this.webTime.split(':');
  847. if (newTime[0] * 1 > time[0] * 1) {
  848. // console.log('newTime[0]')
  849. this.$set(this.chat[this.chatIndex], 'time', redata.data.webTime);
  850. } else if (newTime[0] * 1 == time[0] * 1 && (newTime[1] * 1 - time[1] * 1) > 2) {
  851. this.$set(this.chat[this.chatIndex], 'time', redata.data.webTime);
  852. // console.log('newTime[1]')
  853. }
  854. } else {
  855. this.$set(this.chat[this.chatIndex],'time',redata.data.webTime);
  856. }
  857. this.webTime = redata.data.webTime
  858. }
  859. // 评价返回
  860. if (redata.message_type == "evaluate") {
  861. if (redata.data.status == 1) {
  862. this.comtSuccess = true;
  863. localStorage.setItem('comtSuccess',true)
  864. }
  865. }
  866. //屏幕滚动
  867. this.automaticRolling();
  868. },
  869. /*******************************************/
  870. //数据发送
  871. socket_send(Data) {
  872. this.websock.send(Data);
  873. },
  874. /*******************************************/
  875. //关闭
  876. socket_close(e) {
  877. console.log('断开连接', e);
  878. this.initData = 100;
  879. this.link_success = false;
  880. this.setInit();
  881. this.reconnect();
  882. // this.registered();
  883. // this.websock.close()
  884. },
  885. /***************************************/
  886. //socket重连
  887. reconnect() {
  888. if (this.lockReconnect) { //这里很关键,因为连接失败之后之后会相继触发 连接关闭,不然会连接上两个 WebSocket
  889. return
  890. }
  891. this.lockReconnect = true;
  892. this.reconnectData && clearTimeout(this.reconnectData);
  893. this.reconnectData = setTimeout(() => {
  894. this.initWebSocket(this.apiToken);
  895. //this.registered()
  896. // console.log('-----lail-----');
  897. this.lockReconnect = false;
  898. }, 2000)
  899. },
  900. /*************************************/
  901. //心跳检测
  902. heatBeat() {
  903. this.timeoutObj && clearTimeout(this.timeoutObj);
  904. this.serverTimeoutObj && clearTimeout(this.serverTimeoutObj);
  905. this.timeoutObj = setTimeout(() => {
  906. // console.log('发送', {type: 'ping'});
  907. this.socket_send(JSON.stringify({type: 'ping'})) //根据后台要求发送
  908. this.serverTimeoutObj = setTimeout(() => {
  909. // console.log('------close-------')
  910. this.websock.close(); //如果 4秒之后我们没有收到 后台返回的心跳检测数据 断开socket,断开后会启动重连机制
  911. }, 4000);
  912. }, this.timeout)
  913. },
  914. /*****************************************/
  915. //用户匿名注册
  916. registered() {
  917. let token = localStorage.getItem('token');
  918. let appuid = this.$public.getQueryString('appuid');
  919. let tutype = this.$public.getQueryString('tutype');
  920. if (appuid && tutype >= 1) {
  921. token = localStorage.getItem('token');
  922. } else if (!appuid && tutype < 1) {
  923. token = localStorage.getItem('token');
  924. } else {
  925. token = '';
  926. }
  927. let data = {
  928. token: token != null ? token : '',
  929. appid: this.$public.getQueryString('appid'),
  930. appuid: this.$public.getQueryString('appuid'),
  931. }
  932. let obj = {
  933. headers: {
  934. "apiToken": this.setApiToken('autoReg', 'register', this.currentTime[0], 'index')
  935. }
  936. }
  937. this.$http.post('/index/register/autoReg', data, obj).then(res => {
  938. if (res.data.code == 0) {
  939. this.$dialog.alert({
  940. mes: res.data.msg
  941. });
  942. } else if (res.data.code == 1) {
  943. this.user_info = res.data.data;
  944. // console.log(this.user_info)
  945. localStorage.setItem('uid', res.data.data.id)
  946. // 游客 token
  947. localStorage.setItem("token", res.data.data.token);
  948. localStorage.setItem("tutype", res.data.tutype);
  949. //Websocket链接
  950. this.$dialog.loading.close();
  951. this.initWebSocket(this.apiToken);
  952. //console.log(res.data.data)
  953. }
  954. })
  955. },
  956. /******************************************/
  957. //获取热门问题
  958. getProblem() {
  959. let obj = {
  960. headers: {
  961. // 'Content-Type': 'application/x-www-form-urlencoded',
  962. "apiToken": this.setApiToken('index', 'robot', this.currentTime[0], 'index')
  963. }
  964. }
  965. this.$http.post('/index/robot/index', {groups_id: 1, robotgroups_id: 1}, obj).then(res => {
  966. //console.log(res.data.data);
  967. this.problem = res.data.data;
  968. })
  969. },
  970. /*******************************************/
  971. //推送机器人消息
  972. pushMessage(e) {
  973. this.robot.push({
  974. type: 'service',
  975. content: {text: e}
  976. });
  977. this.automaticRolling();
  978. },
  979. checkSetType(){
  980. let u = navigator.userAgent, app = navigator.appVersion;
  981. let isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1; //g
  982. let isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
  983. if (isAndroid) {
  984. return 'android';
  985. }
  986. if (isIOS) {
  987.     return 'ios';
  988. }
  989. },
  990. /*******************************************/
  991. //转人工
  992. turnArtificial(id) {
  993. this.group = id;
  994. // this.$dialog.loading.open('转接中...')
  995. if (this.isTurnArtifcial) {
  996. let data = {
  997. 'type': 'userInit',
  998. data: {
  999. 'uid': this.user_info.id,
  1000. 'name': this.user_info.name,
  1001. 'avatar': this.user_info.avatar,
  1002. 'group': this.group,
  1003. 'settype':this.checkSetType()
  1004. }
  1005. }
  1006. this.socket_send(JSON.stringify(data));
  1007. this.isTurnArtifcial = false
  1008. }
  1009. },
  1010. /******************************************/
  1011. // 消息发送
  1012. send() {
  1013. if (this.text_info == '') return;
  1014. let str = this.text_info;
  1015. let formatStr = str.replace(/\n|\r\n/g, "<br>");
  1016. let type = 'toRobot';
  1017. let data = {};
  1018. let obj = {
  1019. text: formatStr,
  1020. img: '',
  1021. type: ''
  1022. }
  1023. this.meme = false;
  1024. // console.log(JSON.stringify(obj))
  1025. //和人工发送消息
  1026. if (this.link_success) {
  1027. // if(this.getHistory){
  1028. // this.getHistory = false;
  1029. // }
  1030. data = {
  1031. from_name: this.user_info.name,
  1032. content: JSON.stringify(obj),
  1033. from_id: this.user_info.id,
  1034. avatar: '',
  1035. to_id: this.service_info.id,
  1036. to_name: this.service_info.name,
  1037. conversationId: this.conversationId,
  1038. }
  1039. type = 'chatMessage';
  1040. this.chatIndex = this.chat.length;
  1041. this.chat.push({
  1042. type: 'user',
  1043. time: '',
  1044. content: {text: this.turnFace(obj.text)}
  1045. })
  1046. } else {//和机器人聊天
  1047. data = {
  1048. groups_id: '1',
  1049. robot_name: formatStr,
  1050. robotgroups_id: '1',
  1051. }
  1052. // console.log(this.turnFace(formatStr));
  1053. type = 'toRobot';
  1054. //本地存放数据
  1055. this.robot.push({
  1056. type: 'user',
  1057. content: this.turnFace(formatStr) //obj
  1058. })
  1059. }
  1060. this.socket_send(JSON.stringify({type, data}))
  1061. this.text_info = '';
  1062. this.automaticRolling();
  1063. // console.log(data)
  1064. this.sendAudio();
  1065. },
  1066. // 消息发送音频
  1067. sendAudio() {
  1068. let send = new Audio();
  1069. send.src = '../../static/audio/send.wav';
  1070. send.play()
  1071. },
  1072. // 消息接收音频
  1073. receiveAudio() {
  1074. let receive = new Audio()
  1075. receive.src = "../../static/audio/receive.wav";
  1076. receive.play();
  1077. },
  1078. /*******************************************/
  1079. //获取转接人工客服列表
  1080. connectionService() {
  1081. // if (!this.isConnection) return
  1082. let obj = {
  1083. headers: {
  1084. "apiToken": this.setApiToken('index', 'groups', this.currentTime[0], 'index')
  1085. }
  1086. }
  1087. // this.isConnection = false;
  1088. //api
  1089. this.$http.get('/index/groups/index', obj).then(res => {
  1090. if (res.data.code == 1) {
  1091. this.robot.push({
  1092. type: 'artificial_service',
  1093. content: res.data.data
  1094. });
  1095. this.automaticRolling();
  1096. }
  1097. })
  1098. //this.hintSwitch.connection = true; //系统提示开关激活
  1099. // 此处为请求
  1100. },
  1101. /*******************************************/
  1102. //发送消息后自动滚动高度
  1103. automaticRolling() {
  1104. this.$nextTick(() => {
  1105. let msg = document.getElementById('main') // 获取对象
  1106. // let input_box = document.getElementById('input_box') // 获取对象
  1107. //判断是否是苹果手机自代浏览器
  1108. if (/iPhone/.test(navigator.userAgent)) {
  1109. this.Safari_height = true; //input_box+'px';
  1110. }
  1111. if (/Linux/.test(navigator.userAgent)) {
  1112. this.Chrome_height = true; //input_box+'px';
  1113. }
  1114. msg.scrollTop = msg.scrollHeight // 滚动高度
  1115. })
  1116. },
  1117. /*******************************************/
  1118. //图片发送
  1119. uploadIMG(e) {
  1120. // console.log(e);
  1121. let self = this;
  1122. let files = e.target.files || e.dataTransfer.files;
  1123. if (!files.length) return;
  1124. let picavalue = files[0];
  1125. const isJPG = file.type == 'image/jpeg' || 'image/jpg' || 'image/png' || 'image/svg';
  1126. const isLt2M = picavalue.size / 1000 / 1000 > 2;
  1127. if (isLt2M) {
  1128. this.$dialog.notify({
  1129. mes: '图片过大不支持上传哦!',
  1130. timeout: 2000,
  1131. });
  1132. } else if (!isJPG) {
  1133. this.$dialog.notify({
  1134. mes: '只能上传图片哦!',
  1135. timeout: 2000,
  1136. });
  1137. } else {
  1138. this.$public.imgPreview(picavalue, function (imgSrc, formData) {
  1139. // let img = imgSrc;
  1140. // 数据结构请求
  1141. self.$http.uploadPost('/index/upload/uploadImg', formData).then(res => {
  1142. e.target.value = "";
  1143. // console.log(res.data.code)
  1144. if (res.data.code == 1) {
  1145. let type = 'toRobot';
  1146. let data = {};
  1147. let obj = {
  1148. text: '',
  1149. img: res.data.data.src,
  1150. type: ''
  1151. }
  1152. if (self.link_success) {
  1153. //和人工聊天发送图片
  1154. data = {
  1155. from_name: self.user_info.name,
  1156. content: JSON.stringify(obj),
  1157. from_id: self.user_info.id,
  1158. avatar: '',
  1159. to_id: self.service_info.id,
  1160. to_name: self.service_info.name,
  1161. conversationId: self.conversationId,
  1162. }
  1163. type = 'chatMessage';
  1164. self.chatIndex = self.chat.length;
  1165. //本地储存
  1166. self.chat.push({
  1167. type: 'user',
  1168. time:"",
  1169. content: {img: res.data.data.src}
  1170. });
  1171. } else {
  1172. //和机器发送图片
  1173. data = {
  1174. groups_id: '1',
  1175. robot_name: res.data.data.src,
  1176. robotgroups_id: '1',
  1177. }
  1178. type = 'toRobot';
  1179. //本地储存
  1180. self.robot.push({
  1181. type: 'user',
  1182. content: {img: res.data.data.src}
  1183. });
  1184. }
  1185. self.socket_send(JSON.stringify({type, data}))
  1186. self.automaticRolling();
  1187. }
  1188. })
  1189. });
  1190. }
  1191. },
  1192. /***********************************/
  1193. keyup_maxlength(){
  1194. let ct=this.text_info;
  1195. let leng=ct.replace(/[^\x00-\xff]/g,"aa").length;
  1196. let len=Math.ceil(leng/25);
  1197. if(leng>12){
  1198. len=len+1;
  1199. }
  1200. if(len >0){
  1201. this.ibox_height=(len)*27;
  1202. this.ibox_height=this.ibox_height+'px';
  1203. }
  1204. },
  1205. /*******************************************/
  1206. //手机弹窗处理
  1207. inputShow(e) {
  1208. //console.log('a')
  1209. let ua = navigator.userAgent.toLowerCase();
  1210. if (ua.match(/iPhone\sOS/i) == "iphone os") {
  1211. var nowClientHeight = document.documentElement.clientHeight || document.body.clientHeight;
  1212. setTimeout(() => {
  1213. document.body.scrollTop = document.body.scrollHeight - (nowClientHeight / 2)
  1214. }, 200);
  1215. } else {
  1216. setTimeout(function () {
  1217. e.target.scrollIntoView({behavior: "smooth", block: "end"});
  1218. }, 100);
  1219. }
  1220. },
  1221. /******************文字信息转表情******************/
  1222. turnFace(data) {
  1223. let str = data.match(/\#\[.*?\]\//g);
  1224. let arr = Array.from(new Set(str));
  1225. arr.forEach(e => {
  1226. let imgsrc = '';
  1227. for (let i = 0; i < this.frceArr.length; i++) {
  1228. let expText = e.slice(1, e.length - 1);
  1229. if (expText == this.frceArr[i]) {
  1230. imgsrc = '<img class="hover" src="' + require(`@/assets/${i}.gif`) + '"/>'
  1231. break;
  1232. }
  1233. }
  1234. data = data.replace(new RegExp(`\\#\\[${e.substring(2, e.length - 2)}\\]\\/`, 'g'), imgsrc);
  1235. })
  1236. return data;
  1237. },
  1238. /*******************************************/
  1239. // 表情包开关
  1240. faceClick() {
  1241. this.meme = !this.meme;
  1242. },
  1243. /*******************************************/
  1244. //当表情被点击
  1245. memeImg(i) {
  1246. this.text_info = this.text_info + "#" + this.frceArr[i] + "/";
  1247. //this.text_info = this.text_info + '<img :src="' + require(`@/assets/${i}.gif`) +'"/>';
  1248. // console.log( this.text_info);
  1249. },
  1250. // /*******************************************/
  1251. // //验证码
  1252. // initialLoginCode() {
  1253. // this.loginCode = "";
  1254. // for (let i = 1; i <= 4; i++) {
  1255. // this.loginCode =
  1256. // this.loginCode + frce.arr[Math.floor(Math.random() * 32)];
  1257. // }
  1258. // },
  1259. /********************************************/
  1260. //显示隐藏评价
  1261. is_show_evaluate() {
  1262. if(localStorage.getItem('comtSuccess')){
  1263. this.$dialog.notify({
  1264. mes: '亲,您已经评价了...',
  1265. timeout: 3000,
  1266. });
  1267. return false;
  1268. }
  1269. if (this.evaluateState == 100) {
  1270. this.bottomShow = true;
  1271. } else {
  1272. if (!this.haveEvaluation) {
  1273. this.bottomShow = false;
  1274. } else {
  1275. this.$dialog.notify({
  1276. mes: '亲,您已经评价了...',
  1277. timeout: 5000,
  1278. callback: () => {
  1279. //console.log('我走咯!');
  1280. }
  1281. });
  1282. }
  1283. }
  1284. },
  1285. /*******************************************/
  1286. //切换评价状态
  1287. evaluateClick(type) {
  1288. // console.log(type);
  1289. this.evaluateState = type;
  1290. },
  1291. /*******************************************/
  1292. //提交评价信息
  1293. evaluateEsc() {
  1294. if (this.evaluateState != 100) {
  1295. this.bottomShow = false;
  1296. this.haveEvaluation = true; // 标识已评价
  1297. this.socket_send(JSON.stringify({
  1298. type: 'evaluate', data: {
  1299. evaluate_id: this.evaluateState,
  1300. conversationId: this.conversationId,
  1301. // evaluate_content:''
  1302. }
  1303. }))
  1304. let that = this
  1305. this.$dialog.notify({
  1306. mes: '感谢你的评价!',
  1307. timeout: 2000,
  1308. callback: () => {
  1309. //console.log('我走咯!');
  1310. }
  1311. });
  1312. } else {
  1313. this.$dialog.notify({
  1314. mes: '亲,请选择评价类型...',
  1315. timeout: 2000,
  1316. callback: () => {
  1317. //console.log('我走咯!');
  1318. }
  1319. });
  1320. }
  1321. },
  1322. /************************************************/
  1323. //人工聊天初始化
  1324. setInit() {
  1325. this.haveEvaluation = false;
  1326. this.chat = [];
  1327. this.evaluateState = 100;
  1328. this.hisSviceChat = [];
  1329. this.meme = false
  1330. // this.frceArr = [];//表情包代码
  1331. this.isConnection = true;
  1332. this.isExit = false;
  1333. this.service_info = {
  1334. avatar: '/static/customer/images/robot.png',
  1335. job_name: '001',
  1336. name: '智能客服',
  1337. signature: " "
  1338. }
  1339. },
  1340. /* ****************获取聊天次数****************** */
  1341. getChatNum() {
  1342. this.$http.get('/index/evaluate/minRound', {
  1343. headers: {
  1344. 'Content-Type': 'application/x-www-form-urlencoded',
  1345. 'apiToken': this.setApiToken('minround', 'evaluate', this.currentTime[0], 'index')
  1346. }
  1347. }).then(res => {
  1348. if (res.data.code == 1) {
  1349. this.chatNum = res.data.data.systemconfig_data;
  1350. // console.log(this.chatNum, '聊天限制')
  1351. }
  1352. })
  1353. },
  1354. // 留言知识库返回到主页
  1355. returnIndex(data) {
  1356. console.log(data)
  1357. this.knowledge = data
  1358. }
  1359. },
  1360. /**
  1361. * 视图挂载前
  1362. */
  1363. mounted() {
  1364. this.source.appuid = this.$public.getQueryString('appuid');//用户标识
  1365. this.source.appid = this.$public.getQueryString('appid');//用户来源
  1366. this.frceArr = frce.frce;
  1367. //console.log(this.source);
  1368. //页面初始化获取系统时间第一步
  1369. //console.log(this.$md5('userwordscustomer-servicewords1562169600service'));
  1370. this.$dialog.loading.open('网络连接中...');
  1371. this.$http.get('/index/index/systime?t=' + 100).then(res => {
  1372. if (res.data.code == 1) {
  1373. this.logo = res.data.data.logo;
  1374. this.currentTime = res.data.data.time.split(' ')
  1375. this.currentTime[0] = (new Date(this.currentTime[0].replace(/-/g, '/')).getTime()) / 1000;
  1376. // console.log( this.currentTime[0] );
  1377. this.apiToken = this.$md5('customer-service' + window.location.origin);
  1378. //匿名注册
  1379. this.registered();
  1380. //获取机器人热门问题
  1381. this.getProblem();
  1382. //获取配置信息
  1383. this.getChatNum();
  1384. }
  1385. })
  1386. },
  1387. destroyed() {
  1388. this.setInit();
  1389. this.websock.close() //离开路由之后断开websocket连接
  1390. this.lockReconnect = true;
  1391. clearTimeout(this.reconnectData); //离开清除 timeout
  1392. clearTimeout(this.timeoutObj); //离开清除 timeout
  1393. clearTimeout(this.serverTimeoutObj); //离开清除 timeout
  1394. },
  1395. // 计算
  1396. computed: {
  1397. inputmsg() {
  1398. return this.text_info;
  1399. },
  1400. iboxheight(){
  1401. return this.ibox_height;
  1402. }
  1403. },
  1404. // 监听
  1405. watch: {},
  1406. // 组件生命周期结束销毁阶段
  1407. beforeDestroy() {
  1408. this.timers = false;
  1409. }
  1410. };
  1411. </script>
  1412. <style scoped>
  1413. #textarea {
  1414. margin: 15px;
  1415. border: none;
  1416. }
  1417. .logo {
  1418. margin: 0 0.1rem;
  1419. width: 0.4rem;
  1420. height: 0.4rem;
  1421. }
  1422. /* 聊天 */
  1423. .memeImg {
  1424. width: 0.6rem;
  1425. height: 0.6rem;
  1426. margin: 0.15rem 0.4rem;
  1427. }
  1428. .dialogueA {
  1429. padding-left: 0.3rem;
  1430. padding-right: 0.3rem;
  1431. }
  1432. .dialogueB {
  1433. padding-right: 0.3rem;
  1434. padding-left: 0.3rem;
  1435. }
  1436. .left {
  1437. position: relative;
  1438. z-index: 99;
  1439. background: #fff;
  1440. }
  1441. .left::after {
  1442. position: absolute;
  1443. content: "";
  1444. display: inline-block;
  1445. left: -0.08rem;
  1446. top: 0.2rem;
  1447. width: 0.125rem;
  1448. height: 0.2rem;
  1449. background: #fff;
  1450. transform: skewX(30deg);
  1451. z-index: -1;
  1452. border-left: 0.02rem solid #dfdfdf;
  1453. border-top: 0.02rem solid #dfdfdf;
  1454. }
  1455. .right {
  1456. position: relative;
  1457. z-index: 99;
  1458. background: #5ea0f7;
  1459. border: 0.02rem solid #5ea0f7;
  1460. }
  1461. .right::after {
  1462. position: absolute;
  1463. content: "";
  1464. display: inline-block;
  1465. right: -0.07rem;
  1466. top: 0.2rem;
  1467. width: 0.125rem;
  1468. height: 0.2rem;
  1469. background: #5ea0f7;
  1470. transform: skewX(-30deg);
  1471. z-index: -1;
  1472. border-left: 0.02rem solid #5ea0f7;
  1473. border-top: 0.02rem solid #5ea0f7;
  1474. }
  1475. .service {
  1476. width: 100%;
  1477. color: #555;
  1478. font-size: 0.28rem;
  1479. padding-top: 1rem;
  1480. background: #f5f5f5;
  1481. }
  1482. .header {
  1483. position: fixed;
  1484. left: 0;
  1485. top: 0;
  1486. width: 100%;
  1487. z-index: 999;
  1488. height: 1rem;
  1489. background: linear-gradient(
  1490. 90deg,
  1491. rgba(22, 84, 209, 1) 0%,
  1492. rgba(9, 52, 173, 1) 100%
  1493. );
  1494. box-shadow: 0px 3px 3px rgba(0, 0, 0, 0.2);
  1495. font-size: 0.34rem;
  1496. color: #fff;
  1497. padding: 0 0.3rem;
  1498. }
  1499. .main {
  1500. height: 83vh;
  1501. overflow-x: hidden;
  1502. overflow-y: auto;
  1503. padding: 0 0.3rem;
  1504. }
  1505. .btn {
  1506. display: inline-block;
  1507. padding: 0 0.36rem;
  1508. text-align: center;
  1509. line-height: 0.4rem;
  1510. background: rgba(221, 221, 221, 1);
  1511. border-radius: 0.3rem;
  1512. color: #fff;
  1513. font-size: 0.24rem;
  1514. max-width: 6rem;
  1515. margin: 0 auto;
  1516. margin-top: 0.3rem;
  1517. }
  1518. .btn .click {
  1519. color: #5ea0f7;
  1520. }
  1521. .btnRouter {
  1522. color: #5ea0f7;
  1523. }
  1524. .systemDialogue {
  1525. min-height: 0.8rem;
  1526. width: 100%;
  1527. }
  1528. .manUserDialogue {
  1529. min-height: 1rem;
  1530. }
  1531. .manPlatformDialogue {
  1532. min-height: 1rem;
  1533. }
  1534. .user {
  1535. padding: 0.2rem;
  1536. display: inline-block;
  1537. border-radius: 0.1rem;
  1538. font-size: 0.28rem;
  1539. color: #fff;
  1540. max-width: 19.1rem;
  1541. table-layout:fixed;
  1542. word-break: break-all;
  1543. text-align: left;
  1544. }
  1545. .HeadPortrait {
  1546. width: 1rem;
  1547. height: 1rem;
  1548. /* background: #ddd; */
  1549. border-radius: 0.1rem;
  1550. }
  1551. .HeadPortrait img {
  1552. width: 100%;
  1553. height: 100%;
  1554. }
  1555. .icon {
  1556. width: 0.32rem;
  1557. height: 0.32rem;
  1558. }
  1559. .icon-msg {
  1560. margin-top: 0.06rem;
  1561. margin-left: 0.2rem;
  1562. width: 0.32rem;
  1563. height: 0.32rem;
  1564. }
  1565. .customerService {
  1566. background: #ffffff;
  1567. padding: 0.2rem;
  1568. display: inline-block;
  1569. border-radius: 0.1rem;
  1570. font-size: 0.28rem;
  1571. border: 1px solid rgba(223, 223, 223, 1);
  1572. }
  1573. .customerService {
  1574. /* min-height: 1rem; */
  1575. }
  1576. .system {
  1577. width: 100%;
  1578. border: 0.01rem solid rgba(223, 223, 223, 1);
  1579. border-radius: 0.1rem;
  1580. }
  1581. div /deep/ .yd-accordion-head {
  1582. /* border-radius: 0.1rem; */
  1583. border-bottom: 0.01rem solid rgb(238, 238, 238);
  1584. padding: 0 0.2rem;
  1585. }
  1586. div /deep/ .yd-accordion-title, div /deep/ .yd-accordion-head-arrow {
  1587. min-height: 0.8rem !important;
  1588. }
  1589. div /deep/ .yd-textarea textarea {
  1590. -webkit-user-select: auto;
  1591. }
  1592. .footer {
  1593. min-height: 1.2rem;
  1594. box-shadow: 0px -5px 5px rgba(0, 0, 0, 0.05);
  1595. background: #fff;
  1596. width: 100%;
  1597. position: fixed;
  1598. bottom: 0;
  1599. left: 0;
  1600. z-index: 1000;
  1601. }
  1602. .input {
  1603. width: 60%;
  1604. min-height: 1.2rem;
  1605. padding-top: 0.4rem;
  1606. padding-bottom: 0.4rem;
  1607. border: none;
  1608. padding-right: 0.3rem;
  1609. padding-left: 0.3rem;
  1610. font-size: 0.28rem;
  1611. }
  1612. .send {
  1613. width: 40%;
  1614. position: absolute;
  1615. right: 0;
  1616. top: 0;
  1617. background: #fff;
  1618. height: 1.2rem;
  1619. }
  1620. .memeBox {
  1621. height: 3rem;
  1622. width: 100%;
  1623. }
  1624. .send img {
  1625. vertical-align: middle;
  1626. margin-right: 0.4rem;
  1627. }
  1628. .artificial {
  1629. margin: 0.3rem 0 0 1.3rem;
  1630. width: 77%;
  1631. border: 0.01rem solid #dfdfdf;
  1632. background: #fff;
  1633. border-radius: 0.1rem;
  1634. padding: 0 0.2rem;
  1635. }
  1636. div /deep/ .yd-accordion-head-arrow:after {
  1637. border: none;
  1638. width: 0.3rem;
  1639. height: 0.3rem;
  1640. background: url("../assets/addright.png") no-repeat;
  1641. background-size: 100% 100%;
  1642. transform: rotate(0deg);
  1643. }
  1644. div /deep/ .yd-accordion-head-arrow.yd-accordion-rotated:after {
  1645. transform: rotate(-270deg);
  1646. }
  1647. div /deep/ .yd-accordion {
  1648. border-radius: 0.1rem;
  1649. }
  1650. div /deep/ .yd-accordion-content {
  1651. border-radius: 0.1rem;
  1652. }
  1653. .imgSrc img {
  1654. width: 1.2rem;
  1655. }
  1656. .leftHader {
  1657. height: 1rem;
  1658. background: linear-gradient(
  1659. 90deg,
  1660. rgba(22, 84, 209, 1) 0%,
  1661. rgba(9, 52, 173, 1) 100%
  1662. );
  1663. box-shadow: 0 0.03rem 0.03rem rgba(0, 0, 0, 0.2);
  1664. padding: 0 0.3rem;
  1665. }
  1666. .leftMain-top {
  1667. margin-top: 0.4rem;
  1668. font-size: 0.28rem;
  1669. line-height: 0.45rem;
  1670. padding: 0 0.3rem;
  1671. color: #666;
  1672. }
  1673. .leftMain-top span {
  1674. color: #999;
  1675. }
  1676. .leftMain-top > div {
  1677. width: 50%;
  1678. }
  1679. .leftMain-center {
  1680. margin-top: 0.3rem;
  1681. color: #666;
  1682. line-height: 0.5rem;
  1683. }
  1684. .leftMain-chenter span {
  1685. color: #999;
  1686. font-size: 0.28rem;
  1687. }
  1688. .evaluate {
  1689. height: 1.7rem;
  1690. background: #fff;
  1691. border: 0.01rem solid #ddd;
  1692. border-radius: 0.1rem;
  1693. color: #666;
  1694. margin-top: 0.3rem;
  1695. }
  1696. .evaluateBtn {
  1697. width: 1.4rem;
  1698. height: 0.6rem;
  1699. border: none;
  1700. background: #f04992;
  1701. color: #fff;
  1702. border-radius: 0.1rem;
  1703. }
  1704. div /deep/ .yd-popup {
  1705. border-radius: 0.2rem 0.2rem 0 0;
  1706. }
  1707. div /deep/ .yd-popup-content {
  1708. }
  1709. .evaluatebtn > div p {
  1710. height: 50%;
  1711. width: 100%;
  1712. text-align: center;
  1713. margin-top: 0.14rem;
  1714. }
  1715. .evaluatebtn > div {
  1716. display: flex;
  1717. align-items: center;
  1718. justify-content: center;
  1719. }
  1720. .evaluateBox {
  1721. margin: 0 0.2rem;
  1722. height: 1.5rem;
  1723. border: 0.01rem solid #ddd;
  1724. border-radius: 0.1rem;
  1725. background: #f5f5f5;
  1726. }
  1727. .evaluateBox textarea {
  1728. width: 100%;
  1729. height: 100%;
  1730. background: #f5f5f5;
  1731. border: none;
  1732. border-radius: 0.1rem;
  1733. padding: 0.2rem;
  1734. color: #999;
  1735. font-size: 0.28rem;
  1736. }
  1737. .sub {
  1738. margin: 0 0.2rem;
  1739. background: linear-gradient(
  1740. 90deg,
  1741. rgba(22, 84, 209, 1) 0%,
  1742. rgba(9, 52, 173, 1) 100%
  1743. );
  1744. box-shadow: 0px 3px 3px rgba(0, 0, 0, 0.2);
  1745. height: 1rem;
  1746. font-size: 0.34rem;
  1747. color: #fff;
  1748. border-radius: 0.1rem;
  1749. margin-top: 0.4rem;
  1750. }
  1751. div /deep/ .yd-popup-content {
  1752. background: #fff;
  1753. border-radius: 0.1rem;
  1754. }
  1755. .loginInput {
  1756. height: 0.8rem;
  1757. border: 0.01rem solid #ddd;
  1758. background: #f5f5f5;
  1759. border-radius: 0.1rem;
  1760. margin-top: 0.5rem;
  1761. padding: 0.2rem;
  1762. font-size: 0.28rem;
  1763. margin: 0.2rem;
  1764. margin-top: 0.5rem;
  1765. width: 94%;
  1766. color: #999;
  1767. }
  1768. /* 留言 */
  1769. .leave-header {
  1770. height: 1rem;
  1771. background: linear-gradient(
  1772. 90deg,
  1773. rgba(22, 84, 209, 1) 0%,
  1774. rgba(9, 52, 173, 1) 100%
  1775. );
  1776. box-shadow: 0px 3px 3px rgba(0, 0, 0, 0.2);
  1777. color: #fff;
  1778. font-size: 0.34rem;
  1779. padding: 0 0.3rem;
  1780. }
  1781. .leave-main {
  1782. height: 10rem;
  1783. background: #f5f5f5;
  1784. font-size: 0.28rem;
  1785. padding: 0.3rem 0.3rem 0.2rem 0.3rem;
  1786. }
  1787. .leave-main > div {
  1788. height: 1.3rem;
  1789. margin-bottom: 0.2rem;
  1790. }
  1791. .leave-main > div input {
  1792. height: 0.8rem;
  1793. border: 0.01rem solid #ddd;
  1794. border-radius: 0.1rem;
  1795. background: #fff;
  1796. padding: 0.2rem;
  1797. width: 100%;
  1798. margin-top: 0.1rem;
  1799. }
  1800. .leave-main-txt {
  1801. background: #fff;
  1802. padding: 0.2rem;
  1803. border: 0.01rem solid #ddd;
  1804. border-radius: 0.1rem;
  1805. }
  1806. .imgMsg {
  1807. height: 1.5rem;
  1808. padding: 0 0.2rem;
  1809. margin-top: 0.1rem;
  1810. font-size: 0.24rem;
  1811. background: #fff;
  1812. border: 0.01rem solid #ddd;
  1813. border-radius: 0.1rem;
  1814. }
  1815. .yd-cell-box {
  1816. width: 60%;
  1817. min-height: 1.2rem;
  1818. border: none;
  1819. padding-right: 0.3rem;
  1820. padding-left: 0.3rem;
  1821. border-bottom: 0.01rem solid rgb(221, 221, 221);
  1822. }
  1823. div /deep/ .yd-textarea > textarea {
  1824. height: 1.2rem;
  1825. font-size: 0.28rem;
  1826. padding-top: 0.2rem;
  1827. }
  1828. .yd-textarea {
  1829. padding: 0;
  1830. }
  1831. .yd-cell-box {
  1832. margin: 0;
  1833. }
  1834. .yd-cell-item {
  1835. padding: 0;
  1836. }
  1837. div /deep/ .yd-cell:after {
  1838. height: 0;
  1839. }
  1840. div /deep/ .yd-textarea-counter {
  1841. display: none;
  1842. }
  1843. .promptBox {
  1844. display: flex;
  1845. justify-content: center;
  1846. height: 26px;
  1847. margin: 10px 0 10px;
  1848. /* line-height: 26px; */
  1849. }
  1850. .promptBoxH {
  1851. display: flex;
  1852. justify-content: center;
  1853. height: 50px;
  1854. margin: 10px 0 10px;
  1855. /* line-height: 26px; */
  1856. }
  1857. .prompt {
  1858. line-height: 25px;
  1859. text-align: center;
  1860. background: #DDDDDD;
  1861. border-radius: 30px;
  1862. width: 140px;
  1863. color: #FFFFFF;
  1864. font-size: 12px;
  1865. }
  1866. .help {
  1867. width: 80%;
  1868. }
  1869. .help .prompt {
  1870. width: 100%;
  1871. }
  1872. .row .rightAlignment {
  1873. text-align: right;
  1874. display: block;
  1875. }
  1876. #main{
  1877. /* margin-bottom: .3rem; */
  1878. }
  1879. /*
  1880. *留言知识库
  1881. */
  1882. </style>