servicerMessage.vue 37 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571
  1. <template>
  2. <el-dialog class="service" :visible.sync="showService" width="48%" @close='closeDialog' :append-to-body="true">
  3. <div class="header-box ns-bg-color">
  4. <div class="header-logo">
  5. <img class="header-img" src="../../assets/images/kefupng.png" />
  6. <span class="serve-name">客服咨询</span>
  7. </div>
  8. <!-- <span>{{currShop.shop_name}}</span> -->
  9. <!-- <div class="outline" v-if="currShop.online==0">
  10. <div class="block"></div>
  11. 离线
  12. </div>
  13. <div class="online" v-else>
  14. <div class="block"></div>
  15. 在线
  16. </div> -->
  17. </div>
  18. <div class="service-box">
  19. <!-- <div class="service-box-left" v-if="member">
  20. <div class="people-box">
  21. <div @click="siteIdMap == item.shop_id?'':selectShop(item)" v-for="(item,index) in sessionList" :key="index"
  22. :class="{active:siteIdMap == item.shop_id}" class="people-item">
  23. <div class="shop-info">
  24. <div class="shop_img" :style="{backgroundImage:'url('+$util.img(item.avatar?item.avatar:item.logo)+')'}"></div>
  25. <div class="online-people" v-if="item.online==1"></div>
  26. <div class="outline-people" v-else></div>
  27. <div>
  28. <div class="text-hidden">{{item.shop_name}}
  29. <div style="font-size: 12px;" class="time">{{ $util.timeStampTurnTime(item.add_time) | Time }}</div>
  30. </div>
  31. <div class="last_content">
  32. <div class="msg" v-if="item.content_type==0" v-html="dealMessage(item.content)"></div>
  33. <div class="msg" v-if="item.content_type==1">您有一个商品消息</div>
  34. <div class="msg" v-if="item.content_type==2">您有一个订单消息</div>
  35. <div class="msg" v-if="item.content_type==3">您有一个图片消息</div>
  36. <div class="num" v-if="item.unread">{{item.unread}}</div>
  37. </div>
  38. </div>
  39. </div>
  40. </div>
  41. </div>
  42. </div> -->
  43. <!-- 右半边 -->
  44. <div class="service-box-right">
  45. <div class="service-box-right-top test-1">
  46. <div class="servicer-content" id="content">
  47. <div class="text-center" v-if="contentEmpty">没有聊天记录了</div>
  48. <div v-else class="time text-center" style="cursor:pointer;" @click="getMessageList">点击加载</div>
  49. <div v-for="(item,index) in messageList" :key="index">
  50. <div>
  51. <div class="onlineStatus" v-if="item.contentType == 'online'">客服在线</div>
  52. <div class="onlineStatus" v-if="item.contentType == 'noline'">客服不在线</div>
  53. </div>
  54. <div v-if="item.isItMe" class="message my-message">
  55. <div>
  56. <div class="my-nickname">{{member.nickname}}</div>
  57. <goodsItem :skuId="item.sku_id" v-if="item.contentType == 'goods'" @sendMessage="sendMessage('goods',index)"></goodsItem>
  58. <orderItem :orderId="item.order_id" v-if="item.contentType == 'order'" @sendMessage="sendMessage('order',index)"></orderItem>
  59. <div v-if="item.contentType == 'string'" class="word-message" v-html="dealMessage(item.content)"></div>
  60. <div v-if="item.contentType == 'image'" class="word-message">
  61. <el-image :src="$util.img(item.content)" :preview-src-list="[$util.img(item.content)]"></el-image>
  62. </div>
  63. </div>
  64. <div class="headimg" :style="{backgroundImage:'url('+$util.img(member.headimg?member.headimg:defaultHeadImage)+')'}">
  65. </div>
  66. </div>
  67. <!-- 对方发起的消息 -->
  68. <div v-else-if="item.isItMe === false" class="message your-message">
  69. <div class="headimg" :style="{backgroundImage:'url('+$util.img(shopinfo.logo)+')'}">
  70. </div>
  71. <div>
  72. <div class="my-nickname">{{item.nickname}} <span>{{item.time}}</span> </div>
  73. <div v-if="item.contentType == 'image'" class="word-message your-word-message">
  74. <el-image :src="$util.img(item.content)" :preview-src-list="[$util.img(item.content)]"></el-image>
  75. </div>
  76. <goodsItem :skuId="item.sku_id" v-if="item.contentType == 'goods'" @sendMessage="sendMessage('goods',index)"></goodsItem>
  77. <orderItem :orderId="item.order_id" v-if="item.contentType == 'order'" @sendMessage="sendMessage('order',index)"></orderItem>
  78. <div v-if="item.contentType == 'string'" class="word-message your-word-message" v-html="dealMessage(item.content)">
  79. </div>
  80. </div>
  81. </div>
  82. </div>
  83. <div style="height:40px;"></div>
  84. </div>
  85. </div>
  86. <div class="service-box-right-bottom">
  87. <div class="key-word" v-if="keyWordsConfig.is_open == 1">
  88. <span v-for="(item, index) in keyWordsConfig.keyword_list" :key="index" @click="sendMessage('string', -1, item.keyword)">{{item.keyword}}</span>
  89. </div>
  90. <div class="operation">
  91. <img class="emjoy" src="../../assets/images/emjoy.png" @click="showEmoji = !showEmoji;" />
  92. <el-upload :action="uploadActionUrl" :show-file-list="false" :on-success="handleAvatarSuccess" class="upload">
  93. <img class="emjoy" src="../../assets/images/upload.png" @click="showEmoji = false" />
  94. </el-upload>
  95. </div>
  96. <div class="emoji-box" v-if="showEmoji">
  97. <img @click="sendEmoji(index,item)" v-for="(item,index) in emjoyList" :key="index" class="text item" style="cursor:pointer"
  98. :src="$util.img(item)" />
  99. </div>
  100. <!-- <textarea @keydown.enter="sendMessage()" v-model="message"></textarea> -->
  101. <div class="input-panel" :class="keyWordsConfig.is_open == 1 ? '' : 'active'" ref="msgInputContainer" @keydown.enter.exact="sendMessage()" contenteditable="true"
  102. spellcheck="false" @input="input($event)"></div>
  103. <div class="num-box">
  104. {{text_num}}/150
  105. </div>
  106. <el-button size="small" class="send-btn" @click="sendMessage()">发送</el-button>
  107. </div>
  108. </div>
  109. </div>
  110. </el-dialog>
  111. </template>
  112. <script>
  113. import Config from "@/plugins/config"
  114. import goodsItem from "./goodsItem"
  115. import orderItem from "./orderItem"
  116. import {
  117. sendMessage,
  118. bindServicer,
  119. messageList,
  120. hasServicers,
  121. sessionList,
  122. closeMessage,
  123. readMessage,
  124. currStore,
  125. getKeywords,
  126. getSiteInfo
  127. } from "@/api/message"
  128. import {
  129. mapGetters
  130. } from "vuex"
  131. import emjoy from "@/utils/emjoy"
  132. export default {
  133. components: {
  134. goodsItem,
  135. orderItem
  136. },
  137. props: {
  138. skuId: {
  139. default: 0
  140. },
  141. orderId: {
  142. default: 0
  143. },
  144. logo:{
  145. default: ''
  146. },
  147. shop: {
  148. type: Object,
  149. default: () => {
  150. return {
  151. shop_name: '',
  152. shop_id: '',
  153. logo: ''
  154. }
  155. }
  156. }
  157. },
  158. data() {
  159. return {
  160. isFirstInit: true,
  161. showEmoji: false, //是否显示表情
  162. emjoyList: emjoy.emjoyList,
  163. showService: false,
  164. search_text: "",
  165. websock: null,
  166. messageList: [], //聊天记录
  167. servicerId: 0, //客服id
  168. message: "", //发送内容
  169. image: "", //发送内容
  170. sendSwitch: true, //防止重复发送
  171. page: 1, //数据页码
  172. total: 0, //数据总数
  173. getSwitch: true, //防止重复拉去列表,节流
  174. contentEmpty: false, //是否有聊天记录
  175. sessionList: [], //店铺列表
  176. currShop: { //当前店铺
  177. shop_name: "",
  178. site_logo: ""
  179. },
  180. keyWordsConfig: {}, //关键词
  181. canSend: true,
  182. siteIdMap: 0,
  183. timeoutObj: null,
  184. uploadActionUrl: Config.baseUrl + '/api/upload/chatimg', //表情图标
  185. text_num: 0, //当前字数
  186. is_first: true, //第一次进入模拟点击
  187. shopinfo: {
  188. name: '',
  189. logo: ''
  190. } //客服的个人信息
  191. }
  192. },
  193. filters: {
  194. Time: function(time) {
  195. var date2 = new Date();
  196. var year1 = parseInt(time.substr(0, 4));
  197. var month1 = parseInt(time.substr(5, 2));
  198. var day1 = parseInt(time.substr(8, 2));
  199. var year2 = date2.getFullYear();
  200. var month2 = date2.getMonth() + 1;
  201. var day2 = date2.getDate();
  202. var date1 = new Date(year1, month1 - 1, day1);
  203. var date2 = new Date(year2, month2 - 1, day2);
  204. var timeX = date1.getTime() - date2.getTime();
  205. if (Math.abs(timeX) < 24 * 60 * 60 * 1000) {
  206. return "今天" + time.substr(11, 5);
  207. } else if (timeX > 0 && timeX < 48 * 60 * 60 * 1000) {
  208. return "明天" + time.substr(11, 5);
  209. } else if (timeX < 0 && timeX > 0 - 48 * 60 * 60 * 1000) {
  210. return "昨天" + time.substr(11, 5);
  211. } else {
  212. return time.substr(5, 16);
  213. // let last_time = time.substr(0, 10);
  214. // last_time = last_time.replace(/-/g, '/');
  215. // return last_time
  216. }
  217. }
  218. },
  219. created() {
  220. this.siteIdMap = this.shop.shop_id;
  221. this.getKeywords();
  222. this.getSiteInfo();
  223. },
  224. watch: {
  225. showService(curr) {
  226. if (!curr && this.websock) {
  227. this.websock.close()
  228. }
  229. },
  230. groupId(val) {
  231. this.group_id = this.groupId;
  232. },
  233. servicerId(val) {
  234. // this.getSessionList();
  235. // this.getMessageList();
  236. }
  237. },
  238. mounted() {
  239. },
  240. computed: {
  241. ...mapGetters(["token", "defaultHeadImage", "defaultShopImage", "defaultGoodsImage", "addonIsExit", "locationRegion",
  242. "member"
  243. ])
  244. },
  245. // 如果之前有连接,切断链接
  246. beforeDestroy() {
  247. clearInterval(this.timeoutObj)
  248. closeMessage().then((res) => {
  249. if (res.code == 0 && this.websock) {
  250. this.websock.close()
  251. }
  252. })
  253. },
  254. methods: {
  255. // 处理消息中的数据
  256. dealMessage(val) {
  257. return emjoy.stringToEmjoy(val)
  258. },
  259. getSiteInfo(){
  260. getSiteInfo().then(res=>{
  261. if(res.code >= 0 && res.data){
  262. this.shopinfo = res.data;
  263. }
  264. })
  265. },
  266. getKeywords(){
  267. getKeywords().then(res => {
  268. if(res.code >= 0 && res.data){
  269. this.keyWordsConfig = res.data;
  270. }
  271. })
  272. },
  273. // 点击表情,添加表情
  274. sendEmoji(index, item) {
  275. this.showEmoji = false
  276. this.$refs.msgInputContainer.focus()
  277. const imgSrc = this.$img(item)
  278. const imgTag = `<img src="${imgSrc}" width="20" height="20">`;
  279. document.execCommand("insertHTML", false, imgTag);
  280. },
  281. // 展示弹窗
  282. show() {
  283. this.is_first = true
  284. this.siteIdMap = this.shop.shop_id;
  285. console.log('新版本')
  286. // console.log(this.shop, 'shop')
  287. // console.log(this.is_first, 'this.is_first')
  288. if (this.is_first) {
  289. this.currShop = this.shop;
  290. }
  291. this.showService = true
  292. // this.getSessionList();
  293. // this.getMessageList();
  294. this.initWebSocket();
  295. },
  296. // 初始化页数
  297. initData() {
  298. this.page = 1
  299. this.messageList.length = 0
  300. this.contentEmpty = false
  301. },
  302. // 选择联系人
  303. selectShop(item) {
  304. console.log('切换联系人')
  305. this.initData() // 初始化页数
  306. this.siteIdMap = item.shop_id;
  307. this.currShop = item;
  308. this.servicerId = item.servicer_id
  309. // 消除未读数
  310. this.sessionList.forEach(ites => {
  311. if (ites.shop_id == item.shop_id) {
  312. ites.unread = 0
  313. this.isRead(ites)
  314. }
  315. })
  316. this.messageList = [];
  317. this.closeDialog(); //关闭旧链接
  318. this.initWebSocket(); //打开新衔接
  319. this.getMessageList() //获取聊天信息
  320. this.text_num = 0 //重置文字数量
  321. this.$refs.msgInputContainer.innerHTML = '' //文本重置
  322. },
  323. //标识已读未读
  324. isRead(item) {
  325. console.log(item, 'item')
  326. readMessage({
  327. site_id: item.shop_id
  328. }).then(res => {
  329. console.log(res, 'res')
  330. }).catch(err => {})
  331. },
  332. // 获取联系人
  333. // getSessionList() {
  334. // console.log('获取联系人')
  335. // sessionList({
  336. // page_size: 30,
  337. // page: 1
  338. // })
  339. // .then((res) => {
  340. // this.sessionList = res.data
  341. // // 如果是新加的链接,加入一个到联系人列表中
  342. // let _item = {
  343. // shop_name: this.shop.shop_name,
  344. // shop_id: this.shop.shop_id,
  345. // logo: this.shop.logo
  346. // }
  347. // var curr = this.sessionList.find((item) => {
  348. // return item.shop_id == this.currShop.shop_id;
  349. // })
  350. // if (!curr) {
  351. // this.sessionList.unshift(_item)
  352. // this.test_online()
  353. // }
  354. // // 如果是第一次进入,模拟点击一下
  355. // if (this.is_first) {
  356. // this.is_first = false
  357. // this.sessionList.forEach(item => {
  358. // if (item.shop_id == this.currShop.shop_id) {
  359. // this.selectShop(item)
  360. // }
  361. // })
  362. // }
  363. // // 如果当前有链接,链接的未读数处理
  364. // // console.log(this.sessionList, '联系人列表')
  365. // // console.log(this.siteIdMap, 'siteIdMap')
  366. // this.sessionList.forEach(item => {
  367. // if (this.siteIdMap == item.shop_id) {
  368. // item.unread = 0
  369. // this.isRead(item)
  370. // }
  371. // })
  372. // })
  373. // .catch((err) => {})
  374. // },
  375. // 当前店铺的客服是否在线
  376. test_online() {
  377. // console.log(this.currShop.shop_id)
  378. hasServicers({
  379. site_id: this.currShop.shop_id
  380. }).then((res) => {
  381. // console.log(res, 'res')
  382. if (res.data.online_count > 0) {
  383. this.currShop.online = 1
  384. this.sessionList.forEach(item => {
  385. if (item.shop_id == this.currShop.shop_id) item.online = 1
  386. })
  387. } else {
  388. this.currShop.online = 0
  389. }
  390. })
  391. },
  392. // 滚动到底部
  393. scrollBottom() {
  394. var div = document.getElementById("content")
  395. setTimeout(() => {
  396. div.scrollTop = div.scrollHeight;
  397. }, 0)
  398. },
  399. // 获取聊天记录
  400. getMessageList() {
  401. messageList({
  402. page: this.page,
  403. limit: 4,
  404. servicer_id: this.servicerId,
  405. site_id: this.siteIdMap
  406. }).then((res) => {
  407. const {
  408. code,
  409. data,
  410. messge
  411. } = res
  412. if (code == 0) {
  413. let messageList = []
  414. let arr = res.data.list
  415. // console.log(arr, 'arr')
  416. // 处理聊天内容的类型
  417. arr.forEach((item) => {
  418. let obj = {}
  419. if (item.content_type == 0) {
  420. obj.content = item.type == 0 ? item.consumer_say : item.servicer_say
  421. obj.isItMe = item.type == 0 ? true : false //自己的消息还是对面发来的消息
  422. obj.contentType = "string"
  423. obj.nickname = item.nickname
  424. obj.shop_name = item.shop_name
  425. obj.time = item.create_day + ' ' + item.create_time
  426. if (item.avatar) {
  427. obj.logo = item.avatar
  428. } else {
  429. obj.logo = item.logo
  430. }
  431. } else if (item.content_type == 1) {
  432. obj.isItMe = item.type == 0 ? true : false
  433. obj.contentType = "goods"
  434. obj.sku_id = item.goods_sku_id
  435. obj.nickname = item.nickname
  436. obj.shop_name = item.shop_name
  437. obj.time = item.create_day + ' ' + item.create_time
  438. if (item.avatar) {
  439. obj.logo = item.avatar
  440. } else {
  441. obj.logo = item.logo
  442. }
  443. } else if (item.content_type == 2) {
  444. obj.isItMe = item.type == 0 ? true : false
  445. obj.contentType = "order"
  446. obj.order_id = item.order_id
  447. obj.nickname = item.nickname
  448. obj.shop_name = item.shop_name
  449. obj.time = item.create_day + ' ' + item.create_time
  450. if (item.avatar) {
  451. obj.logo = item.avatar
  452. } else {
  453. obj.logo = item.logo
  454. }
  455. } else if (item.content_type == 3) {
  456. obj.isItMe = item.type == 0 ? true : false
  457. obj.contentType = "image"
  458. obj.content = item.type == 0 ? item.consumer_say : item.servicer_say
  459. obj.nickname = item.nickname
  460. obj.shop_name = item.shop_name
  461. obj.time = item.create_day + ' ' + item.create_time
  462. if (item.avatar) {
  463. obj.logo = item.avatar
  464. } else {
  465. obj.logo = item.logo
  466. }
  467. }
  468. messageList.push(obj)
  469. })
  470. this.messageList = messageList.concat(!this.contentEmpty ? this.messageList : [])
  471. console.log(this.messageList, 'this.messageList')
  472. if (this.page == 1) {
  473. if (this.skuId) this.joinNewFakeMessage("mine", "goods")
  474. if (this.orderId) this.joinNewFakeMessage("mine", "order")
  475. this.scrollBottom()
  476. }
  477. if (this.page >= res.data.page_count) {
  478. this.contentEmpty = true
  479. } else {
  480. this.page += 1
  481. }
  482. // 等待数据完全处理完,滚动到底部位置
  483. // setTimeout(() => {
  484. // this.scrollBottom();
  485. // }, 500)
  486. }
  487. })
  488. },
  489. // 加入虚假数据
  490. joinNewFakeMessage(isItMe = "mine", contentType = "string") {
  491. // console.log('加入虚假数据')
  492. let data = {
  493. isItMe: isItMe == "mine" ? true : false,
  494. contentType: contentType
  495. }
  496. if (contentType == "string") {
  497. data.content = this.message
  498. }
  499. if (contentType == "goods") {
  500. data.sku_id = this.skuId
  501. data.canSend = true
  502. }
  503. if (contentType == "order") {
  504. data.order_id = this.orderId
  505. data.canSend = true
  506. }
  507. if (contentType == "image") {
  508. data.content = this.image
  509. }
  510. this.messageList.unshift(data)
  511. this.scrollBottom()
  512. },
  513. // 加入评论信息
  514. joinMessage(isItMe = "mine", contentType = "string") {
  515. // console.log('加入评论信息')
  516. let data = {
  517. isItMe: isItMe == "mine" ? true : false,
  518. contentType: contentType
  519. }
  520. if (contentType == "string") {
  521. data.content = this.message
  522. }
  523. if (contentType == "goods") {
  524. data.sku_id = this.skuId
  525. data.canSend = false
  526. }
  527. if (contentType == "order") {
  528. data.order_id = this.orderId
  529. data.canSend = false
  530. }
  531. if (contentType == "image") {
  532. data.content = this.image;
  533. }
  534. this.messageList.push(data);
  535. this.scrollBottom();
  536. },
  537. // 输入文字时
  538. input(event) {
  539. let str = this.$refs.msgInputContainer.innerHTML
  540. var a = str.replace(/<\s?img.*?src\s*=\s*[\"|\']?(.*?)[\"|\']\s.*?>/ig, '0');
  541. this.text_num = a.length
  542. if (this.text_num >= 150) {
  543. this.$message({
  544. message: "最多一次可以发送150个字~",
  545. type: "warning"
  546. })
  547. }
  548. },
  549. // 发送消息
  550. sendMessage(type = "string", index = -1, value = '') {
  551. if (index != -1) this.messageList.splice(index, 1)
  552. if (!this.sendSwitch) return
  553. this.sendSwitch = false
  554. let data = {
  555. servicer_id: this.servicerId,
  556. site_id: this.siteIdMap
  557. }
  558. let _content;
  559. if(!value) _content = this.$refs.msgInputContainer.innerHTML;
  560. else _content = value;
  561. let _message = _content.replace(/<div>/g, '');
  562. let _message2 = _message.replace(/<\/div>/g, '');
  563. let _message3 = _message2.replace(/<br>/g, '');
  564. this.message = _message3
  565. if (type == "string") {
  566. if (!this.message.trim()) {
  567. this.sendSwitch = true;
  568. this.$message({
  569. message: "不能发送空白内容",
  570. type: "warning"
  571. })
  572. return
  573. }
  574. Object.assign(data, {
  575. message: this.message,
  576. content_type: 0
  577. })
  578. }
  579. if (type == "goods") {
  580. Object.assign(data, {
  581. goods_id: this.skuId,
  582. content_type: 1
  583. })
  584. }
  585. if (type == "order") {
  586. Object.assign(data, {
  587. order_id: this.orderId,
  588. content_type: 2
  589. })
  590. }
  591. if (type == "image") {
  592. Object.assign(data, {
  593. message: this.image,
  594. content_type: 3
  595. })
  596. }
  597. this.joinMessage("mine", type)
  598. sendMessage(data)
  599. .then((res) => {
  600. this.sendSwitch = true
  601. this.message = ""
  602. this.text_num = 0
  603. this.$refs.msgInputContainer.innerHTML = ''
  604. })
  605. this.scrollBottom();
  606. },
  607. // 初始化socket
  608. initWebSocket() {
  609. //初始化weosocket
  610. // console.log(Config.webSocket)
  611. const wsuri = Config.webSocket
  612. this.websock = new WebSocket(wsuri)
  613. this.websock.onmessage = this.websocketonmessage
  614. this.websock.onopen = this.websocketonopen
  615. this.websock.onerror = this.websocketonerror
  616. this.websock.onclose = this.websocketclose
  617. },
  618. websocketonopen() {
  619. //连接建立之后执行send方法发送数据
  620. console.log("连接建立")
  621. },
  622. websocketonerror() {
  623. //连接建立失败重连
  624. this.initWebSocket()
  625. },
  626. // 接受消息
  627. websocketonmessage(e) {
  628. //数据接收
  629. // console.log(e, 'e')
  630. let data = JSON.parse(e.data),
  631. that = this
  632. console.log(data, 'data')
  633. this.pingInterval = Config.pingInterval
  634. if (data.type == "close" && this.websock) {
  635. that.websock.close()
  636. }
  637. // this.getSessionList();
  638. clearInterval(this.timeoutObj)
  639. this.reset()
  640. // 如果是第一次绑定
  641. if (data.type == "init") {
  642. this.messageList = [];
  643. bindServicer({
  644. client_id: data.data.client_id,
  645. })
  646. .then((res) => {
  647. const {
  648. code,
  649. data,
  650. message
  651. } = res
  652. var obj = {};
  653. // console.log(res, 'bindData')
  654. if (code == 0) {
  655. this.servicerId = data.servicer_id
  656. obj = {
  657. contentType: "online"
  658. }
  659. if (this.isFirstInit) {
  660. this.initData()
  661. // this.getMessageList()
  662. }
  663. this.isFirstInit = false
  664. } else {
  665. obj = {
  666. contentType: "noline"
  667. }
  668. }
  669. this.messageList.unshift(obj);
  670. })
  671. .catch((err) => {
  672. var obj = {
  673. contentType: "noline"
  674. }
  675. // this.getMessageList();
  676. this.messageList.unshift(obj);
  677. })
  678. } else if (data.type == "connect") {
  679. if (data.data.shop_id == this.siteIdMap) {
  680. // 绑定
  681. if (data.data.shop_id) {
  682. this.servicerId = data.servicer_id
  683. var obj = {
  684. contentType: "online"
  685. }
  686. this.messageList.unshift(obj);
  687. } else {
  688. this.servicerId = 0
  689. var obj = {
  690. contentType: "noline"
  691. }
  692. this.messageList.unshift(obj);
  693. }
  694. }
  695. } else {
  696. // if (data.data.shop_id == this.siteIdMap) {
  697. let contentData = {
  698. isItMe: false
  699. }
  700. if (data.type == "string") {
  701. contentData.content = data.data.servicer_say;
  702. contentData.time = data.data.create_day + data.data.create_time;
  703. contentData.logo = data.data.avatar;
  704. contentData.nickname = data.data.nickname;
  705. contentData.contentType = 'string'
  706. } else if (data.type == "order") {
  707. contentData.order_id = data.data.order_id;
  708. contentData.time = data.data.create_day + data.data.create_time;
  709. contentData.logo = data.data.avatar;
  710. contentData.nickname = data.data.nickname;
  711. contentData.contentType = 'order'
  712. } else if (data.type == "goodssku") {
  713. contentData.sku_id = data.data.goods_sku_id;
  714. contentData.time = data.data.create_day + data.data.create_time;
  715. contentData.logo = data.data.avatar;
  716. contentData.nickname = data.data.nickname;
  717. contentData.contentType = 'goods'
  718. } else if (data.type == "image") {
  719. contentData.content = data.data.servicer_say;
  720. contentData.time = data.data.create_day + data.data.create_time;
  721. contentData.logo = data.data.avatar;
  722. contentData.nickname = data.data.nickname;
  723. contentData.contentType = 'image';
  724. }
  725. this.messageList.push(contentData);
  726. // this.sessionList()
  727. // }
  728. }
  729. this.scrollBottom();
  730. },
  731. // 检测心跳reset
  732. reset() {
  733. console.log("检测心跳")
  734. console.log(this.timeoutObj, 'this.timeoutObj')
  735. clearInterval(this.timeoutObj)
  736. this.start() // 启动心跳
  737. },
  738. // 启动心跳 start
  739. start() {
  740. if (Config.pingInterval == 0) return;
  741. console.log("启动心跳")
  742. this.timeoutObj = setInterval(() => {
  743. console.log('检测...')
  744. this.websock.send("ping")
  745. }, this.pingInterval)
  746. },
  747. websocketsend(Data) {
  748. //数据发送
  749. this.websock.send(Data)
  750. },
  751. websocketclose(e) {
  752. //关闭
  753. console.log("断开连接", e)
  754. },
  755. closeDialog() {
  756. clearInterval(this.timeoutObj)
  757. console.log('关闭链接')
  758. this.websock.close()
  759. let data = {
  760. servicer_id: this.servicerId,
  761. site_id: this.siteIdMap
  762. }
  763. // console.log(this.websock, '关闭连接')
  764. if (this.servicerId && this.websock) {
  765. closeMessage(data).then((res) => {
  766. // console.log(res, 'res')
  767. if (res.code == 0) {
  768. clearInterval(this.timeoutObj)
  769. }
  770. })
  771. }
  772. },
  773. handleAvatarSuccess(res, file) {
  774. this.image = res.data.pic_path;
  775. this.sendMessage('image');
  776. }
  777. }
  778. }
  779. </script>
  780. <style>
  781. .kefu .el-dialog__header {
  782. padding: 0 !important;
  783. }
  784. .kefu .el-dialog__headerbtn {
  785. top: 8px !important;
  786. }
  787. .kefu .el-dialog__body {
  788. padding: 0 !important;
  789. min-width: 800px;
  790. }
  791. .kefu .el-dialog {
  792. min-width: 860px !important;
  793. }
  794. </style>
  795. <style lang="scss" scoped="">
  796. html,
  797. body {
  798. overflow-y: scroll;
  799. }
  800. html,
  801. body {
  802. overflow: scroll;
  803. min-height: 101%;
  804. ::-webkit-scrollbar {
  805. width: 0;
  806. height: 0;
  807. color: transparent;
  808. }
  809. }
  810. html {
  811. overflow: -moz-scrollbars-vertical;
  812. }
  813. .service {
  814. min-width: 800px;
  815. .header-box {
  816. color: white;
  817. align-items: center;
  818. padding: 25px 15px;
  819. border-bottom: 1px solid #eee;
  820. font-size: 15px;
  821. padding-left: 260px;
  822. display: flex;
  823. align-items: center;
  824. justify-content: center;
  825. .header-logo {
  826. position: absolute;
  827. top: 10px;
  828. left: 15px;
  829. display: flex;
  830. align-items: center;
  831. .header-img {
  832. margin-right: 10px;
  833. background-color: white;
  834. border-radius: 50%;
  835. width: 26px;
  836. height: 26px;
  837. }
  838. }
  839. .online {
  840. line-height: 1.3;
  841. margin-left: 5px;
  842. padding: 2px 6px;
  843. background-color: white;
  844. border-radius: 10px;
  845. font-size: 10px;
  846. display: flex;
  847. color: #000;
  848. align-items: center;
  849. .block {
  850. margin-right: 4px;
  851. border-radius: 50%;
  852. width: 6px;
  853. height: 6px;
  854. background-color: rgba(#70ed3a, 1);
  855. }
  856. }
  857. .outline {
  858. line-height: 1.3;
  859. margin-left: 5px;
  860. padding: 2px 6px;
  861. background-color: white;
  862. border-radius: 10px;
  863. font-size: 10px;
  864. display: flex;
  865. color: #000;
  866. align-items: center;
  867. .block {
  868. margin-right: 4px;
  869. border-radius: 50%;
  870. width: 6px;
  871. height: 6px;
  872. background-color: rgba(#b2b2b2, 1);
  873. }
  874. }
  875. }
  876. }
  877. .key-word{
  878. display: flex;
  879. padding: 10px 15px;
  880. overflow-x: scroll;
  881. margin-right: 15px;
  882. &:hover::-webkit-scrollbar{
  883. opacity: 1;
  884. cursor: pointer;
  885. }
  886. span{
  887. white-space: nowrap;
  888. padding: 0 10px;
  889. border: 1px solid #eee;
  890. line-height: 23px;
  891. border-radius: 46px;
  892. margin-right: 10px;
  893. cursor: pointer;
  894. -webkit-user-select:none;
  895. -moz-user-select:none;
  896. -ms-user-select:none;
  897. user-select:none;
  898. }
  899. }
  900. // /*chrome 和Safari*/
  901. // .key-word::-webkit-scrollbar { height: 10px !important;color: #eee; }
  902. // .key-word::-webkit-scrollbar-button { display: none; }
  903. .key-word::-webkit-scrollbar {
  904. /*滚动条整体样式*/
  905. width: 10px;
  906. /*高宽分别对应横竖滚动条的尺寸*/
  907. height: 6px;
  908. }
  909. .key-word::-webkit-scrollbar-thumb {
  910. /*滚动条里面小方块*/
  911. border-radius: 10px;
  912. background-color: #eee;
  913. opacity: 0;
  914. background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .2) 50%, rgba(255, 255, 255, .2) 75%, transparent 75%, transparent);
  915. }
  916. .key-word::-webkit-scrollbar-track {
  917. /*滚动条里面轨道*/
  918. // -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
  919. background: transparent;
  920. }
  921. .operation {
  922. display: flex;
  923. padding: 10px 24px;
  924. border-top: 1px solid #eee;
  925. align-items: center;
  926. img {
  927. margin-right: 10px;
  928. }
  929. .emjoy {
  930. width: 20px;
  931. height: 20px;
  932. }
  933. }
  934. .service-box {
  935. min-width: 800px;
  936. display: flex;
  937. // .service-box-left {
  938. // width: 250px;
  939. // // height: 630px;
  940. // // .curr_peo {
  941. // // display: flex;
  942. // // align-items: center;
  943. // // padding: 20px 24px;
  944. // // background-color: #F3F3F3;
  945. // // background-image: linear-gradient(to right, #F3F3F3, #F3F3F3);
  946. // // img {
  947. // // margin-right: 10px;
  948. // // height: 60px;
  949. // // width: 60px;
  950. // // min-width: 60px;
  951. // // border-radius: 10px;
  952. // // }
  953. // // .curr_peo_name {
  954. // // color: #000;
  955. // // font-size: 16px;
  956. // // overflow: hidden;
  957. // // text-overflow: ellipsis;
  958. // // white-space: nowrap;
  959. // // }
  960. // // }
  961. // .service-box-left-top {
  962. // background-color: $base-color;
  963. // padding: 10px;
  964. // .member-info {
  965. // display: flex;
  966. // .headimg {
  967. // width: 50px;
  968. // height: 50px;
  969. // img {
  970. // width: 100%;
  971. // height: 100%;
  972. // }
  973. // }
  974. // .member-nickname {
  975. // flex: 1;
  976. // div {
  977. // color: #fff;
  978. // }
  979. // }
  980. // }
  981. // .search-box {
  982. // display: flex;
  983. // background-color: #fff;
  984. // align-items: center;
  985. // height: 24px;
  986. // border-radius: 4px;
  987. // padding: 0 5px;
  988. // input {
  989. // padding: 0;
  990. // outline: none;
  991. // border: 0;
  992. // margin-left: 5px;
  993. // height: 100%;
  994. // line-height: 24px;
  995. // }
  996. // }
  997. // }
  998. // .people-box {
  999. // height: 590px;
  1000. // overflow-y: auto;
  1001. // .people-item {
  1002. // cursor: pointer;
  1003. // display: flex;
  1004. // align-items: center;
  1005. // justify-content: space-between;
  1006. // padding: 15px 24px;
  1007. // border-bottom: 1px solid #f1f1f1;
  1008. // justify-content: center;
  1009. // .shop-info {
  1010. // position: relative;
  1011. // display: flex;
  1012. // align-items: center;
  1013. // overflow: hidden;
  1014. // flex: 1;
  1015. // .shop_img {
  1016. // width: 35px;
  1017. // height: 35px;
  1018. // max-width: 35px;
  1019. // margin-right: 10px;
  1020. // background-size: contain;
  1021. // background-position: center;
  1022. // background-repeat: no-repeat;
  1023. // border-radius: 50%;
  1024. // }
  1025. // >div {
  1026. // flex: 1;
  1027. // overflow: hidden;
  1028. // div {
  1029. // color: #333;
  1030. // display: flex;
  1031. // justify-content: space-between;
  1032. // align-items: center;
  1033. // overflow: hidden;
  1034. // .time {
  1035. // color: #A7ACB4;
  1036. // }
  1037. // &.last_content {
  1038. // overflow: hidden;
  1039. // .msg {
  1040. // color: #96999C;
  1041. // overflow: hidden;
  1042. // text-overflow: ellipsis;
  1043. // white-space: nowrap;
  1044. // flex: 1;
  1045. // display: block;
  1046. // font-size: 12px;
  1047. // img {
  1048. // width: 5px !important;
  1049. // height: 5px !important;
  1050. // }
  1051. // }
  1052. // .num {
  1053. // color: #fff;
  1054. // top: 0;
  1055. // background-color: #FF4544;
  1056. // height: 14px;
  1057. // line-height: 14px;
  1058. // padding: 0 3.5px;
  1059. // border-radius: 20px;
  1060. // font-size: 12px;
  1061. // text-align: center;
  1062. // justify-content: center;
  1063. // }
  1064. // }
  1065. // }
  1066. // }
  1067. // .online-people {
  1068. // position: absolute;
  1069. // bottom: 0;
  1070. // left: 26px;
  1071. // border-radius: 50%;
  1072. // background-color: #70ed3a;
  1073. // width: 10px;
  1074. // height: 10px;
  1075. // }
  1076. // .outline-people {
  1077. // position: absolute;
  1078. // bottom: 0;
  1079. // left: 26px;
  1080. // border-radius: 50%;
  1081. // background-color: #b2b2b2;
  1082. // width: 10px;
  1083. // height: 10px;
  1084. // }
  1085. // }
  1086. // &.active {
  1087. // background-color: #edf3fa;
  1088. // border-bottom: 1px solid #edf3fa;
  1089. // .shop-info {
  1090. // .shop_img {
  1091. // width: 35px;
  1092. // height: 35px;
  1093. // }
  1094. // }
  1095. // }
  1096. // }
  1097. // }
  1098. // .people-box::-webkit-scrollbar {
  1099. // /*滚动条整体样式*/
  1100. // width: 5px;
  1101. // /*高宽分别对应横竖滚动条的尺寸*/
  1102. // height: 1px;
  1103. // }
  1104. // .people-box::-webkit-scrollbar-thumb {
  1105. // /*滚动条里面小方块*/
  1106. // border-radius: 20px;
  1107. // -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
  1108. // background: #BFBFBF;
  1109. // }
  1110. // .people-box::-webkit-scrollbar-track {
  1111. // /*滚动条里面轨道*/
  1112. // -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.1);
  1113. // border-radius: 10px;
  1114. // background: white;
  1115. // }
  1116. // }
  1117. .service-box-right {
  1118. flex: 1;
  1119. overflow: hidden;
  1120. // .curr_company {
  1121. // display: flex;
  1122. // align-items: center;
  1123. // justify-content: center;
  1124. // padding: 20px 24px;
  1125. // background-color: #F3F3F3;
  1126. // color: #333;
  1127. // img {
  1128. // height: 60px;
  1129. // width: 60px;
  1130. // min-width: 60px;
  1131. // margin-right: 20px;
  1132. // border-radius: 10px;
  1133. // }
  1134. // .curr_company_name {
  1135. // font-size: 16px;
  1136. // }
  1137. // >div>div {
  1138. // &:last-child {
  1139. // color: #000;
  1140. // }
  1141. // }
  1142. // }
  1143. .service-box-right-top {
  1144. height: 420px;
  1145. border-left: 1px solid #eee;
  1146. overflow-y: auto;
  1147. width: 100%;
  1148. .shop-name {
  1149. display: flex;
  1150. height: 60px;
  1151. align-items: center;
  1152. // border-bottom: 1px solid #eee;
  1153. img {
  1154. width: 40px;
  1155. height: 40px;
  1156. margin-right: 5px;
  1157. margin-left: 10px;
  1158. }
  1159. }
  1160. .servicer-content {
  1161. height: 100%;
  1162. overflow-y: auto;
  1163. display: flex;
  1164. flex-direction: column;
  1165. &>div {
  1166. margin: 10px 0 0;
  1167. .onlineStatus {
  1168. margin: auto
  1169. }
  1170. }
  1171. .last-tip {
  1172. color: #a1a6af;
  1173. position: relative;
  1174. &::before {
  1175. content: "";
  1176. position: absolute;
  1177. top: 50%;
  1178. transform: translateY(-50%);
  1179. width: 70px;
  1180. height: 1px;
  1181. background: #a1a6af;
  1182. left: -80px;
  1183. }
  1184. &::after {
  1185. content: "";
  1186. position: absolute;
  1187. top: 50%;
  1188. transform: translateY(-50%);
  1189. width: 70px;
  1190. height: 1px;
  1191. background: #a1a6af;
  1192. right: -80px;
  1193. }
  1194. }
  1195. .time {
  1196. color: #a1a6af;
  1197. }
  1198. .message {
  1199. display: flex;
  1200. justify-content: flex-end;
  1201. align-items: flex-start;
  1202. .my-nickname {
  1203. text-align: right;
  1204. color: #909399;
  1205. span {
  1206. padding-left: 10px;
  1207. font-size: 10px;
  1208. }
  1209. }
  1210. .headimg {
  1211. width: 32px;
  1212. height: 32px;
  1213. margin: 5px 20px 0 20px;
  1214. background-size: contain;
  1215. background-position: center;
  1216. background-repeat: no-repeat;
  1217. border-radius: 50%;
  1218. }
  1219. &.your-message {
  1220. justify-content: flex-start;
  1221. .my-nickname {
  1222. text-align: left;
  1223. }
  1224. }
  1225. }
  1226. .word-message {
  1227. color: #333;
  1228. position: relative;
  1229. padding: 10px;
  1230. border-radius: 4px;
  1231. max-width: 450px;
  1232. width: fit-content;
  1233. ::v-deep img {
  1234. max-width: 150px;
  1235. }
  1236. ::v-deep .el-image-viewer__close {
  1237. color: #fff;
  1238. }
  1239. &::after {
  1240. content: "";
  1241. position: absolute;
  1242. width: 10px;
  1243. height: 10px;
  1244. top: 15px;
  1245. right: -5px;
  1246. transform: rotateZ(45deg);
  1247. }
  1248. &.your-word-message {
  1249. background-color: #F0F0F0;
  1250. color: #333;
  1251. &::after {
  1252. left: -5px;
  1253. background-color: #F0F0F0;
  1254. transform: rotateZ(45deg);
  1255. }
  1256. img {
  1257. max-width: 150px;
  1258. }
  1259. }
  1260. }
  1261. }
  1262. }
  1263. .service-box-right-top::-webkit-scrollbar {
  1264. width: 10px;
  1265. }
  1266. .service-box-right-top::-webkit-scrollbar-thumb {
  1267. border-radius: 10px;
  1268. -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
  1269. background: #535353;
  1270. }
  1271. .service-box-right-top::-webkit-scrollbar-track {
  1272. -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
  1273. border-radius: 10px;
  1274. background: #EDEDED;
  1275. }
  1276. .service-box-right-bottom {
  1277. height: calc(100% - 450px);
  1278. position: relative;
  1279. .num-box {
  1280. position: absolute;
  1281. bottom: 13px;
  1282. right: 68px;
  1283. text-align: right;
  1284. width: 60px;
  1285. color: #909399;
  1286. }
  1287. .send-btn {
  1288. position: absolute;
  1289. bottom: 10px;
  1290. right: 10px;
  1291. background-color: #FF4649;
  1292. color: #fff
  1293. }
  1294. .emoji-btn {
  1295. position: absolute;
  1296. bottom: 10px;
  1297. left: 10px;
  1298. }
  1299. }
  1300. }
  1301. }
  1302. .input-panel {
  1303. width: 100%;
  1304. height: 57px;
  1305. margin-bottom: 50px;
  1306. padding: 0px 24px;
  1307. outline: none;
  1308. box-sizing: border-box;
  1309. line-height: 1.3;
  1310. overflow-y: scroll;
  1311. &.active{
  1312. margin-bottom: 25px !important;
  1313. }
  1314. }
  1315. .input-panel::-webkit-scrollbar {
  1316. display: none;
  1317. }
  1318. .service {
  1319. ::v-deep .el-dialog__header {
  1320. padding: 0;
  1321. }
  1322. ::v-deep .el-dialog__headerbtn {
  1323. top: 17px !important;
  1324. }
  1325. ::v-deep .el-dialog__body {
  1326. height: 640px;
  1327. }
  1328. ::v-deep .el-dialog__headerbtn .el-dialog__close {
  1329. color: white;
  1330. }
  1331. }
  1332. .text-center {
  1333. text-align: center;
  1334. }
  1335. .text-hidden {
  1336. text-overflow: ellipsis;
  1337. overflow: hidden;
  1338. white-space: nowrap;
  1339. }
  1340. .text-hidden-two-row {
  1341. text-overflow: -o-ellipsis-lastline;
  1342. overflow: hidden;
  1343. text-overflow: ellipsis;
  1344. display: -webkit-box;
  1345. -webkit-line-clamp: 2;
  1346. line-clamp: 2;
  1347. -webkit-box-orient: vertical;
  1348. }
  1349. .emoji-box {
  1350. background-color: #fff;
  1351. z-index: 9999;
  1352. position: absolute;
  1353. height: 90px;
  1354. overflow: hidden scroll;
  1355. padding-left: 14px;
  1356. top: -40px;
  1357. img {
  1358. margin: 5px;
  1359. }
  1360. }
  1361. .emoji-box::-webkit-scrollbar {
  1362. /*滚动条整体样式*/
  1363. width: 5px;
  1364. }
  1365. .emoji-box::-webkit-scrollbar-thumb {
  1366. /*滚动条里面小方块*/
  1367. border-radius: 20px;
  1368. // -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
  1369. background: white;
  1370. }
  1371. .emoji-box::-webkit-scrollbar-track {
  1372. /*滚动条里面轨道*/
  1373. // -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.1);
  1374. border-radius: 10px;
  1375. background: white;
  1376. }
  1377. .onlineStatus {
  1378. background-color: #6b6c6d;
  1379. text-align: center;
  1380. width: 90px;
  1381. margin: auto;
  1382. font-size: 12px;
  1383. color: #fff;
  1384. border-radius: 6px;
  1385. line-height: 22px;
  1386. }
  1387. ::v-deep .upload {
  1388. line-height: 1;
  1389. ::v-deep .el-upload {
  1390. line-height: 1;
  1391. }
  1392. }
  1393. </style>