index.vue 29 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093
  1. <template>
  2. <div class="chat-box">
  3. <div class="head-box">
  4. <div class="back" @click="goBack"><span class="iconfont iconfanhui"></span></div>
  5. <div class="title">{{ nickname }} - 对话详情</div>
  6. </div>
  7. <div class="chat-scroll-box">
  8. <vue-scroll
  9. :ops="ops"
  10. ref="scrollBox"
  11. @refresh-activate="handleActivate"
  12. @refresh-start="handleStart"
  13. @refresh-before-deactivate="handleBeforeDeactivate"
  14. @refresh-deactivate="handleDeactivate"
  15. >
  16. <div class="slot-refresh" slot="refresh-deactive"></div>
  17. <div class="slot-refresh" slot="refresh-beforeDeactive"></div>
  18. <div id="chatBox" class="chat" ref="chat" style="padding: 0.3rem 0.3rem 0">
  19. <div v-for="(item, index) in records" :key="index" :id="`chat_${item.id}`">
  20. <div class="day-box" v-if="item.show">{{ item.time }}</div>
  21. <div class="chat-item" :class="{ 'right-box': item.uid == kefuInfo.uid }">
  22. <img class="avatar" v-lazy="item.avatar" mode="" @click="goUserInfo(item, item.uid == kefuInfo.uid)" />
  23. <!-- 消息 -->
  24. <div class="msg-box" v-if="item.msn_type == 1" v-html="item.msn"></div>
  25. <!-- 图片 -->
  26. <div class="img-box" v-if="item.msn_type == 3" v-viewer><img v-lazy="item.msn" mode="widthFix" /></div>
  27. <!-- 商品 -->
  28. <div class="product-box" v-if="item.msn_type == 5" @click="goProduct(item)">
  29. <img v-lazy="item.productInfo.image" mode="widthFix" />
  30. <div class="info">
  31. <div class="price"><span>¥</span>{{ item.productInfo.price }}</div>
  32. <div class="name line2">{{ item.productInfo.store_name }}</div>
  33. </div>
  34. </div>
  35. <!-- 订单 -->
  36. <div class="order-box" v-if="item.msn_type == 6" @click="goOrderDetail(item)">
  37. <div class="title">订单ID: {{ item.orderInfo.order_id }}</div>
  38. <div class="info">
  39. <img v-lazy="item.orderInfo.cartInfo[0].productInfo.image" />
  40. <div class="product-info">
  41. <div class="name line2">{{ item.orderInfo.cartInfo[0].productInfo.store_name }}</div>
  42. <div class="price">¥{{ item.orderInfo.cartInfo[0].productInfo.price }}</div>
  43. </div>
  44. </div>
  45. </div>
  46. </div>
  47. </div>
  48. </div>
  49. </vue-scroll>
  50. </div>
  51. <div class="footer-box">
  52. <div class="words" @click="showWords"><span class="iconfont iconhuashu1"></span></div>
  53. <div class="input-box">
  54. <el-input v-model="con" placeholder="请输入内容" style="font-size: 0.28rem" />
  55. <span class="iconfont iconfasong" @click="sendText" :class="{ isSend: isSend }"></span>
  56. </div>
  57. <div class="emoji" @click="openBox(1)"><span class="iconfont iconbiaoqing2"></span></div>
  58. <div class="more" @click="openBox(2)"><span class="iconfont icongengduozhankai1"></span></div>
  59. </div>
  60. <!-- 工具 -->
  61. <div class="tool-wrapper" v-if="isTool">
  62. <div class="tool-item">
  63. <el-upload
  64. :show-file-list="false"
  65. :action="fileUrl"
  66. class="mr10 mb10"
  67. :before-upload="beforeUpload"
  68. :data="uploadData"
  69. :headers="header"
  70. :multiple="true"
  71. :on-success="handleSuccess"
  72. accept="image/*"
  73. :on-format-error="handleFormatError"
  74. style="margin-top: 1px; display: inline-block"
  75. >
  76. <img src="../static/tool-01.png" mode="" />
  77. <div>图片</div>
  78. </el-upload>
  79. </div>
  80. <div class="tool-item" @click="goTransfer">
  81. <img src="../static/tool-02.png" mode="" />
  82. <div>转接</div>
  83. </div>
  84. <div class="tool-item" @click="goAdminOrder">
  85. <img src="../static/tool-03.png" mode="" />
  86. <div>交易订单</div>
  87. </div>
  88. <div class="tool-item" @click="goodsInfo">
  89. <img src="../static/tool-04.png" mode="" />
  90. <div>商品信息</div>
  91. </div>
  92. </div>
  93. <!-- 表情 -->
  94. <div class="banner slider-banner" v-show="isSwiper">
  95. <swiper class="swiper-wrapper" ref="mySwiper" :options="swiperOptions">
  96. <swiper-slide v-for="(emojiList, index) in emojiGroup" :key="index">
  97. <i class="em" :class="emoji" v-for="emoji in emojiList" :key="emoji" @click="addEmoji(emoji)"></i>
  98. </swiper-slide>
  99. </swiper>
  100. </div>
  101. <!-- 常用语 -->
  102. <words :isWords="isWords" @closeBox="closeBox" @selectMsg="selectMsg"></words>
  103. <!-- 转接 -->
  104. <div class="transfer-mask" v-if="isTransfer">
  105. <div class="content" :class="{ on: isTransfer }">
  106. <div class="title">转接客服<span class="iconfont iconcha" @click="closeTransfer"></span></div>
  107. <div class="list-wrapper">
  108. <el-radio-group v-model="activeKF">
  109. <el-radio class="list-item" v-for="(item, index) in transferList" :label="item.uid" :key="index">
  110. <div class="avatar-box">
  111. <img v-lazy="item.avatar" alt="" />
  112. </div>
  113. <p class="nickName">{{ item.wx_name }}</p>
  114. </el-radio>
  115. </el-radio-group>
  116. </div>
  117. <el-button class="btn" @click="confirm">确定</el-button>
  118. </div>
  119. </div>
  120. </div>
  121. </template>
  122. <script>
  123. var mp3 = require('@/assets/video/notice.mp3');
  124. var mp3 = new Audio(mp3);
  125. import Setting from '@/setting';
  126. import words from '../components/words';
  127. import { Socket } from '@/libs/socket';
  128. import util from '@/libs/util';
  129. import emojiList from '@/utils/emoji';
  130. import { serviceList, speeChcraft, transferList, serviceCate, serviceTransfer } from '@/api/kefu';
  131. import { getCookies, removeCookies, setCookies } from '@/libs/util';
  132. import { isPicUpload } from '@/utils';
  133. const chunk = function (arr, num) {
  134. num = num * 1 || 1;
  135. var ret = [];
  136. arr.forEach(function (item, i) {
  137. if (i % num === 0) {
  138. ret.push([]);
  139. }
  140. ret[ret.length - 1].push(item);
  141. });
  142. return ret;
  143. };
  144. export default {
  145. name: 'adminChat_index',
  146. data() {
  147. return {
  148. ops: {
  149. vuescroll: {
  150. mode: 'slide',
  151. enable: false,
  152. auto: false,
  153. autoLoadDistance: 0,
  154. pullRefresh: {
  155. enable: true,
  156. auto: false,
  157. autoLoadDistance: 0,
  158. tips: {
  159. deactive: '',
  160. active: '上拉加载更多',
  161. start: 'Loading...',
  162. beforeDeactive: ' ',
  163. },
  164. },
  165. pushLoad: {
  166. enable: false,
  167. },
  168. },
  169. bar: {
  170. background: '#393232',
  171. opacity: '.5',
  172. size: '2px',
  173. },
  174. },
  175. swiperOptions: {},
  176. status: false,
  177. loading: false,
  178. isTool: false,
  179. isSwiper: false,
  180. isWords: false,
  181. autoplay: false,
  182. circular: true,
  183. interval: 3000,
  184. duration: 500,
  185. emojiGroup: chunk(emojiList, 21),
  186. con: '',
  187. toUid: '',
  188. limit: 15,
  189. upperId: 0,
  190. chatList: [],
  191. kefuInfo: {},
  192. scrollTop: 0,
  193. active: true,
  194. isScroll: true,
  195. oldHeight: 0,
  196. selector: '',
  197. transferList: [], //转接列表
  198. isTransfer: false,
  199. uploadData: {}, // 上传参数
  200. header: {},
  201. fileUrl: '',
  202. tourist: 0,
  203. activeKF: '',
  204. };
  205. },
  206. components: {
  207. words,
  208. },
  209. computed: {
  210. isSend() {
  211. if (this.con.length == 0) {
  212. return false;
  213. } else {
  214. return true;
  215. }
  216. },
  217. records() {
  218. if (!this.chatList.length) return;
  219. return this.chatList.map((item, index) => {
  220. item.time = this.$moment(item.add_time * 1000).format('MMMDo h:mm');
  221. if (index) {
  222. if (item.add_time - this.chatList[index - 1].add_time >= 300) {
  223. item.show = true;
  224. } else {
  225. item.show = false;
  226. }
  227. } else {
  228. item.show = true;
  229. }
  230. return item;
  231. });
  232. },
  233. },
  234. created() {
  235. this.fileUrl = Setting.apiBaseURL.replace('adminapi', 'kefuapi') + '/upload';
  236. this.toUid = this.$route.query.toUid || '';
  237. this.nickname = this.$route.query.nickname || '';
  238. this.kefuInfo = JSON.parse(getCookies('kefuInfo'));
  239. Promise.all([this.getChatList(), this.getTransferList()]);
  240. },
  241. mounted() {
  242. window.document.title = `${this.$route.query.nickname || ''} - 对话详情`;
  243. // 上传头部token
  244. this.header['Authori-zation'] = 'Bearer ' + getCookies('kefu_token');
  245. let isLogin = JSON.parse(sessionStorage.getItem('wsLogin'));
  246. Socket.then((ws) => {
  247. let that = this;
  248. if (isLogin) {
  249. ws.send({
  250. data: {
  251. id: this.toUid,
  252. },
  253. type: 'to_chat',
  254. });
  255. } else {
  256. ws.send({
  257. type: 'kefu_login',
  258. data: getCookies('kefu_token'),
  259. });
  260. }
  261. // 消息接收
  262. ws.$on(['reply', 'chat'], (data) => {
  263. if (data.msn_type == 1 || data.msn_type == 2) {
  264. data.msn = this.replace_em(data.msn);
  265. }
  266. // if (data.msn_type == 5)
  267. this.chatList.push(data);
  268. this.$refs['scrollBox'].refresh();
  269. this.$nextTick(() => {
  270. this.scrollBom();
  271. });
  272. });
  273. ws.$on('reply', (data) => {
  274. // mp3.play();
  275. });
  276. ws.$on('socket_error', () => {
  277. this.$util.Tips({
  278. title: '连接失败',
  279. });
  280. });
  281. });
  282. this.$nextTick(() => {});
  283. },
  284. beforeDestroy() {
  285. Socket.then((ws) => {
  286. ws.send({
  287. data: {
  288. id: 0,
  289. },
  290. type: 'to_chat',
  291. });
  292. });
  293. },
  294. methods: {
  295. goBack() {
  296. this.$router.go(-1);
  297. },
  298. handleFormatError(file) {
  299. this.$message.error('上传图片只能是 jpg、jpg、jpeg、gif 格式!');
  300. },
  301. // 用户详情
  302. goUserInfo(item, status) {
  303. if (!status) {
  304. this.$router.push({
  305. path: `/kefu/user/index/${item.uid}/${item.type}`,
  306. });
  307. }
  308. },
  309. // 上传之前
  310. beforeUpload(file) {
  311. return isPicUpload(file)
  312. },
  313. // 上传成功
  314. handleSuccess(res, file, fileList) {
  315. if (res.status === 200) {
  316. this.$message.success(res.msg);
  317. this.sendMsg(res.data.url, 3);
  318. } else {
  319. this.$message.error(res.msg);
  320. }
  321. },
  322. // 滚动到底部
  323. scrollBom() {
  324. setTimeout((res) => {
  325. let num = parseFloat(document.getElementById('chatBox').offsetHeight);
  326. if (this.$refs['scrollBox']) {
  327. this.$refs['scrollBox'].scrollTo(
  328. {
  329. y: num,
  330. },
  331. 300,
  332. );
  333. }
  334. }, 300);
  335. },
  336. // 订单详情
  337. goOrderDetail(item) {
  338. this.$router.push({
  339. path: `/kefu/orderDetail/${item.orderInfo.id}`,
  340. });
  341. // uni.navigateTo({
  342. // url: `/pages/admin/orderDetail/index?id=${item.msn}`
  343. // })
  344. },
  345. // 底部功能区打开
  346. openBox(key) {
  347. if (key == 1) {
  348. this.isTool = false;
  349. this.isSwiper = !this.isSwiper;
  350. } else {
  351. this.isSwiper = false;
  352. this.isTool = !this.isTool;
  353. }
  354. this.$refs['scrollBox'].refresh();
  355. this.$nextTick(() => {
  356. this.scrollBom();
  357. });
  358. },
  359. showWords() {
  360. this.isWords = true;
  361. },
  362. // 转接
  363. goTransfer() {
  364. this.isTransfer = true;
  365. },
  366. // 转接关闭
  367. closeTransfer() {
  368. this.transferList.forEach((el, index) => {
  369. el.isCheck = false;
  370. });
  371. this.isTransfer = false;
  372. },
  373. // 转接确认
  374. confirm() {
  375. if (this.activeKF) {
  376. serviceTransfer({
  377. uid: this.toUid,
  378. kefuToUid: this.activeKF,
  379. })
  380. .then((res) => {
  381. this.transferList.forEach((el, index) => {
  382. el.isCheck = false;
  383. });
  384. this.$message.success(res.msg);
  385. this.isTransfer = false;
  386. })
  387. .catch((error) => {
  388. this.$message.error(error.msg);
  389. });
  390. } else {
  391. this.$message.error('请选择转接客服');
  392. }
  393. },
  394. // 商品信息
  395. goodsInfo() {
  396. this.$router.push({
  397. path: '/kefu/goods/list?toUid=' + this.toUid,
  398. });
  399. },
  400. // 表情点击
  401. addEmoji(item) {
  402. let val = `[${item}]`;
  403. this.con += val;
  404. },
  405. // 聊天表情转换
  406. replace_em(str) {
  407. str = str.replace(/\[em-([\s\S]*)\]/g, "<span class='em em-$1'/></span>");
  408. return str;
  409. },
  410. // 获取聊天列表
  411. getChatList() {
  412. let self = this;
  413. serviceList({
  414. limit: this.limit,
  415. uid: this.toUid,
  416. upperId: this.upperId,
  417. is_tourist: this.$route.query.is_tourist,
  418. }).then((res) => {
  419. res.data.forEach((el) => {
  420. if (el.msn_type == 1 || el.msn_type == 2) {
  421. el.msn = this.replace_em(el.msn);
  422. }
  423. });
  424. let selector = '';
  425. if (this.upperId == 0) {
  426. selector = `chat_${res.data[res.data.length - 1].id}`;
  427. } else {
  428. selector = `chat_${this.chatList[0].id}`;
  429. }
  430. this.selector = selector;
  431. this.chatList = [...res.data, ...this.chatList];
  432. this.loading = false;
  433. this.isScroll = res.data.length >= this.limit;
  434. this.$nextTick(() => {
  435. this.$emit('change', true);
  436. this.$refs['scrollBox'].refresh();
  437. if (this.upperId == 0) {
  438. setTimeout((res) => {
  439. let num = parseFloat(document.getElementById(selector).offsetTop) - 60;
  440. this.$refs['scrollBox'].scrollTo(
  441. {
  442. y: num,
  443. },
  444. 0,
  445. );
  446. }, 300);
  447. }
  448. });
  449. });
  450. },
  451. // 发送消息
  452. sendText() {
  453. if (!this.isSend) {
  454. return this.$message.error('请输入内容');
  455. }
  456. this.sendMsg(this.con, 1);
  457. this.con = '';
  458. },
  459. // ws发送
  460. sendMsg(msn, type) {
  461. let obj = {
  462. type: 'chat',
  463. data: {
  464. msn,
  465. type,
  466. to_uid: this.toUid,
  467. },
  468. };
  469. Socket.then((ws) => {
  470. ws.send(obj);
  471. });
  472. },
  473. // 图片上传
  474. uploadImg() {
  475. let self = this;
  476. self.$util.uploadImageOne('upload/image', function (res) {
  477. if (res.status == 200) {
  478. self.sendMsg(res.data.url, 3);
  479. }
  480. });
  481. },
  482. // 常用于选择
  483. selectWords(item) {
  484. this.isWords = false;
  485. this.sendMsg(item.message, 1);
  486. },
  487. // 商品详情页
  488. goProduct(item) {
  489. this.$router.push({
  490. path: '/kefu/goods/detail?goodsId=' + item.msn,
  491. });
  492. },
  493. // 管理员订单
  494. goAdminOrder() {
  495. this.$router.push({
  496. path: '/kefu/orderList/0/' + this.toUid,
  497. });
  498. },
  499. // 滚动到底部
  500. height() {
  501. let self = this;
  502. var scrollTop = 0;
  503. let info = uni.createSelectorQuery().select('.chat');
  504. setTimeout((res) => {
  505. info
  506. .boundingClientRect(function (data) {
  507. //data - 各种参数
  508. scrollTop = data.height;
  509. if (self.active) {
  510. self.scrollTop = parseInt(scrollTop) + 500;
  511. } else {
  512. self.scrollTop = parseInt(scrollTop) + 100;
  513. }
  514. })
  515. .exec();
  516. }, 1000);
  517. },
  518. // 转接列表
  519. getTransferList() {
  520. transferList({
  521. uid: this.toUid,
  522. }).then((res) => {
  523. res.data.list.forEach((item, index) => {
  524. item.isCheck = false;
  525. });
  526. this.transferList = res.data.list;
  527. });
  528. },
  529. // 关闭常用语
  530. closeBox() {
  531. this.isWords = false;
  532. },
  533. // 选择话术
  534. selectMsg(data) {
  535. this.con += data;
  536. this.isWords = false;
  537. },
  538. handleActivate(vm, refreshDom) {
  539. this.upperId = this.chatList[0].id;
  540. },
  541. handleStart(vm, refreshDom, done) {
  542. setTimeout(() => {
  543. // load finished
  544. done();
  545. }, 2000);
  546. },
  547. handleBeforeDeactivate(vm, refreshDom, done) {
  548. this.getChatList();
  549. this.$on('change', (data) => {
  550. if (data) done();
  551. });
  552. },
  553. handleDeactivate(vm, refreshDom) {
  554. let num = parseFloat(document.getElementById(this.selector).offsetTop) - 60;
  555. this.$refs['scrollBox'].scrollTo(
  556. {
  557. y: num,
  558. },
  559. 0,
  560. );
  561. },
  562. },
  563. };
  564. </script>
  565. <style>
  566. html,
  567. body {
  568. font-size: 50px;
  569. }
  570. </style>
  571. <style lang="stylus" scoped>
  572. .head-box{
  573. position relative
  574. display flex
  575. align-items center
  576. justify-content center
  577. color #fff
  578. height 45px
  579. background: linear-gradient(85deg, #3875EA 0%, #1890FC 100%);
  580. span{
  581. position absolute
  582. width 45px
  583. height 100%
  584. left 0
  585. top 0
  586. text-align center
  587. line-height 45px
  588. }
  589. }
  590. .chat-box {
  591. display: flex;
  592. flex-direction: column;
  593. height: 100%;
  594. height: 100vh;
  595. background #f0f1f2
  596. .head-box {
  597. background: linear-gradient(85deg, #3875EA 0%, #1890FC 100%);
  598. .title-hd {
  599. display: flex;
  600. align-items: center;
  601. justify-content: center;
  602. position: relative;
  603. height: 43px;
  604. padding: 0 .3rem;
  605. color: #fff;
  606. .icon-fanhui {
  607. position: absolute;
  608. left: .3rem;
  609. top: 50%;
  610. transform: translateY(-50%);
  611. }
  612. .icon-gengduo2 {
  613. /* #ifdef MP */
  614. position: absolute;
  615. right: 2.1rem;
  616. top: 50%;
  617. transform: translateY(-50%);
  618. /* #endif */
  619. }
  620. }
  621. }
  622. .scroll-box {
  623. flex: 1;
  624. }
  625. .footer-box {
  626. display: flex;
  627. align-items: center;
  628. height: 1rem;
  629. padding: 0 .3rem;
  630. color: rgba(0,0,0,0.8);
  631. background #f7f7f7
  632. .words .iconfont {
  633. font-size: .5rem
  634. }
  635. .input-box {
  636. display: flex;
  637. align-items: center;
  638. width: 4.92rem;
  639. height: .64rem;
  640. padding-right: 0.05rem;
  641. margin-left: .18rem;
  642. background-color: #fff;
  643. border-radius: .32rem;
  644. overflow hidden
  645. input {
  646. flex: 1;
  647. padding-left: .2rem;
  648. height: 100%;
  649. border transparent !important
  650. }
  651. ::v-deep .el-input__inner, .el-input__inner:hover, .el-input__inner:focus {
  652. border transparent
  653. box-shadow: none;
  654. }
  655. .iconfont {
  656. font-size: .5rem;
  657. color: #ccc;
  658. font-weight: normal;
  659. }
  660. .isSend {
  661. color: #3875EA;
  662. }
  663. }
  664. .emoji .iconfont {
  665. margin-left: .18rem;
  666. font-size: .5rem;
  667. }
  668. .more .iconfont {
  669. margin-left: .18rem;
  670. font-size: .5rem;
  671. }
  672. }
  673. }
  674. .tool-wrapper {
  675. display: flex;
  676. justify-content: space-between;
  677. padding: .45rem .6rem;
  678. background: #fff;
  679. font-size: .24rem;
  680. .tool-item {
  681. text-align: center;
  682. img {
  683. width: 1.04rem;
  684. height: 1.04rem;
  685. }
  686. }
  687. }
  688. .slider-banner {
  689. padding-bottom .25rem
  690. background: #fff;
  691. .em {
  692. display: inline-block;
  693. width: .5rem;
  694. height: .5rem;
  695. margin: .4rem 0 0 .5rem;
  696. }
  697. }
  698. .words-mask {
  699. z-index: 50;
  700. position: fixed;
  701. left: 0;
  702. top: 0;
  703. right: 0;
  704. bottom: 0;
  705. background: rgba(0, 0, 0, 0.5);
  706. .content {
  707. position: absolute;
  708. left: 0;
  709. right: 0;
  710. top: 1.14rem;
  711. bottom: 0;
  712. display: flex;
  713. flex-direction: column;
  714. background: #fff;
  715. border-radius: 0.06rem 0.06rem 0px 0px;
  716. .title-box {
  717. padding: 0 .3rem .3rem;
  718. position: relative;
  719. border-bottom 1px solid #F5F6F9
  720. .tab-box{
  721. position relative
  722. display flex
  723. justify-content space-between
  724. padding .4rem 2.2rem .3rem
  725. font-size .32rem
  726. color #9F9F9F
  727. .on{
  728. color #3875EA
  729. font-weight bold
  730. }
  731. .right-icon{
  732. position absolute
  733. right 0
  734. top 50%
  735. transform translateY(-50%)
  736. .iconfont{
  737. margin-left .2rem
  738. font-size .48rem
  739. color #C8CAD0
  740. }
  741. }
  742. }
  743. .input-box{
  744. display: flex;
  745. align-items: center;
  746. width: 6.9rem;
  747. height: .64rem;
  748. padding-right: 0.05rem;
  749. margin-left: .18rem;
  750. border-radius: .32rem;
  751. overflow hidden
  752. ::v-deep .el-input__inner{
  753. background #F5F6F9
  754. }
  755. ::v-deep .el-input__inner, .el-input__inner:hover, .el-input__inner:focus {
  756. border transparent
  757. box-shadow: none;
  758. }
  759. }
  760. .icon-cha1 {
  761. position: absolute;
  762. right: 0;
  763. top: 50%;
  764. transform: translateY(-50%);
  765. }
  766. }
  767. .scroll-box {
  768. flex: 1;
  769. display flex
  770. overflow: hidden;
  771. .scroll-left{
  772. width 1.76rem
  773. height 100%
  774. overflow-y scroll
  775. -webkit-overflow-scrolling touch
  776. background #F5F6F9
  777. .left-item{
  778. position relative
  779. display flex
  780. align-items center
  781. justify-content center
  782. width 100%
  783. height 1.09rem
  784. color #282828
  785. font-size .26rem
  786. &.active{
  787. color #3875EA
  788. background #fff
  789. &:after{
  790. content ' '
  791. position: absolute;
  792. left 0
  793. top 50%
  794. transform translateY(-50%)
  795. width 0.06rem
  796. height .46rem
  797. background #3875EA
  798. }
  799. }
  800. &.add_cate{
  801. color #9F9F9F
  802. font-size .26rem
  803. .iconfont{
  804. margin-right 0.1rem
  805. font-size .24rem
  806. }
  807. }
  808. }
  809. }
  810. .right-box{
  811. flex 1
  812. overflow scroll
  813. -webkit-overflow-scrolling touch
  814. }
  815. .msg-item {
  816. padding: .25rem .3rem;
  817. color #888888
  818. font-size .28rem
  819. .title{
  820. margin-right .2rem
  821. color #282828
  822. }
  823. &.add-mg{
  824. display flex
  825. align-items center
  826. justify-content flex-end
  827. font-size .28rem
  828. padding .15rem .3rem
  829. .iconfont{
  830. font-size .36rem
  831. margin-right .1rem
  832. }
  833. }
  834. }
  835. }
  836. }
  837. }
  838. .chat-scroll-box {
  839. flex: 1;
  840. overflow: hidden;
  841. .day-box{
  842. margin-bottom .2rem
  843. font-size .24rem
  844. color #999
  845. text-align: center;
  846. }
  847. .chat-item {
  848. display: flex;
  849. margin-bottom: .36rem;
  850. font-size .28rem
  851. .avatar {
  852. width: .8rem;
  853. height: .8rem;
  854. border-radius: 50%;
  855. }
  856. .msg-box {
  857. display: flex;
  858. align-items: center;
  859. max-width: 4.52rem;
  860. margin-left: .22rem;
  861. padding: .1rem .24rem;
  862. background: #fff;
  863. border-radius: .14rem;
  864. word-break: break-all;
  865. color #333
  866. }
  867. .img-box {
  868. width: 2.7rem;
  869. margin-left: .22rem;
  870. img {
  871. width: 2.7rem;
  872. border-radius 6px
  873. }
  874. }
  875. .product-box {
  876. width: 4.52rem;
  877. background-color: #fff;
  878. border-radius: .14rem;
  879. overflow: hidden;
  880. margin-left: .22rem;
  881. img {
  882. width: 4.52rem;
  883. }
  884. .info {
  885. padding: .16rem .26rem;
  886. .price {
  887. font-size: .36rem;
  888. color: #F74C31;
  889. text {
  890. font-size: .28rem;
  891. }
  892. }
  893. }
  894. }
  895. .order-box {
  896. width: 4.52rem;
  897. margin-left: .22rem;
  898. background-color: #fff;
  899. border-radius: .14rem;
  900. .title {
  901. padding: .15rem .2rem;
  902. font-size: .26rem;
  903. color: #282828;
  904. border-bottom: 1px solid #ECEFF8;
  905. }
  906. .info {
  907. display: flex;
  908. padding: .2rem;
  909. img {
  910. width: 1.24rem;
  911. height: 1.24rem;
  912. border-radius: 0.06rem;
  913. }
  914. .product-info {
  915. flex: 1;
  916. display: flex;
  917. flex-direction: column;
  918. justify-content: space-between;
  919. margin-left: .16rem;
  920. .name {
  921. font-size: .26rem;
  922. }
  923. .price {
  924. font-size: .3rem;
  925. color: #F74C31;
  926. }
  927. }
  928. }
  929. }
  930. &.right-box {
  931. flex-direction: row-reverse;
  932. .msg-box {
  933. margin-left: 0;
  934. margin-right: .22rem;
  935. background-color: #9cec60;
  936. }
  937. .img-box {
  938. margin-left: 0;
  939. margin-right: .22rem;
  940. }
  941. .product-box {
  942. margin-left: 0;
  943. margin-right: .22rem;
  944. }
  945. .order-box {
  946. margin-left: 0;
  947. margin-right: .22rem;
  948. }
  949. }
  950. .em {
  951. margin: 0;
  952. }
  953. }
  954. }
  955. .transfer-mask
  956. z-index 30
  957. position fixed
  958. left 0
  959. top 0
  960. width 100%
  961. height 100%
  962. background rgba(0,0,0,0.5)
  963. .content
  964. position absolute
  965. left 0
  966. bottom 0
  967. transform translateY(100%)
  968. top 2.5rem
  969. right 0
  970. display flex
  971. flex-direction column
  972. background #fff
  973. border-radius: .16rem .16rem 0px 0px;
  974. &.on
  975. animation up .2s linear
  976. animation-fill-mode: forwards;
  977. .title
  978. position relative
  979. display flex
  980. align-items center
  981. justify-content center
  982. height 1.1rem
  983. font-size .32rem
  984. font-weight bold
  985. color #282828
  986. .iconfont
  987. position absolute
  988. right .3rem
  989. top 50%
  990. transform translateY(-50%)
  991. color #C8CAD0
  992. font-size .44rem
  993. .list-wrapper
  994. flex 1
  995. padding-left .3rem
  996. overflow-y scroll
  997. -webkit-overflow-scrolling touch
  998. .list-item
  999. display flex
  1000. align-items center
  1001. padding .16rem 0
  1002. border-bottom 1px solid #F0F2F7
  1003. .check-box
  1004. width .72rem
  1005. .avatar-box img
  1006. width .9rem
  1007. height .9rem
  1008. border-radius 0.06rem
  1009. .nickName
  1010. margin-left .28rem
  1011. color #282828
  1012. font-size .3rem
  1013. font-weight bold
  1014. .btn
  1015. width 6.9rem
  1016. height .86rem
  1017. margin .5rem auto
  1018. color #fff
  1019. background #3875EA
  1020. font-size .3rem
  1021. border-radius: .43rem !important;
  1022. </style>
  1023. <style>
  1024. @keyframes up {
  1025. 0% {
  1026. transform: translateY(100%);
  1027. }
  1028. 100% {
  1029. transform: translateY(0);
  1030. }
  1031. }
  1032. .emoji-outer {
  1033. position: absolute;
  1034. right: 0.5rem;
  1035. bottom: 0.3rem;
  1036. width: 0.5rem;
  1037. height: 0.5rem;
  1038. }
  1039. </style>