index.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867
  1. <template>
  2. <s-layout class="chat-wrap" :title="$t('chat.index.title')" navbar="inner">
  3. <div class="status">
  4. {{ socketState.isConnect ? customerServiceInfo.title : $t('chat.index.networkLosed') }}
  5. </div>
  6. <div class="page-bg" :style="{ height: sys_navBar + 'px' }"></div>
  7. <view class="chat-box" :style="{ height: pageHeight + 'px' }">
  8. <scroll-view
  9. :style="{ height: pageHeight + 'px' }"
  10. scroll-y="true"
  11. :scroll-with-animation="false"
  12. :enable-back-to-top="true"
  13. :scroll-into-view="chat.scrollInto"
  14. >
  15. <button
  16. class="loadmore-btn ss-reset-button"
  17. v-if="
  18. chatList.length &&
  19. chatHistoryPagination.lastPage > 1 &&
  20. loadingMap[chatHistoryPagination.loadStatus].title
  21. "
  22. @click="onLoadMore"
  23. >
  24. {{ loadingMap[chatHistoryPagination.loadStatus].title }}
  25. <i
  26. class="loadmore-icon sa-m-l-6"
  27. :class="loadingMap[chatHistoryPagination.loadStatus].icon"
  28. ></i>
  29. </button>
  30. <view class="message-item ss-flex-col" v-for="(item, index) in chatList" :key="index">
  31. <view class="ss-flex ss-row-center ss-col-center">
  32. <!-- 日期 -->
  33. <view v-if="item.from !== 'system' && showTime(item, index)" class="date-message">
  34. {{ formatTime(item.date) }}
  35. </view>
  36. <!-- 系统消息 -->
  37. <view v-if="item.from === 'system'" class="system-message">
  38. {{ item.content.text }}
  39. </view>
  40. </view>
  41. <!-- 常见问题 -->
  42. <view v-if="item.mode === 'template' && item.content.list.length" class="template-wrap">
  43. <view class="title">{{$t('chat.index.msg1')}}</view>
  44. <view
  45. class="item"
  46. v-for="(item, index) in item.content.list"
  47. :key="index"
  48. @click="onTemplateList(item)"
  49. >
  50. * {{ item.title }}
  51. </view>
  52. </view>
  53. <view
  54. v-if="
  55. (item.from === 'customer_service' && item.mode !== 'template') ||
  56. item.from === 'customer'
  57. "
  58. class="ss-flex ss-col-top"
  59. :class="[
  60. item.from === 'customer_service'
  61. ? `ss-row-left`
  62. : item.from === 'customer'
  63. ? `ss-row-right`
  64. : '',
  65. ]"
  66. >
  67. <!-- 客服头像 -->
  68. <image
  69. v-show="item.from === 'customer_service'"
  70. class="chat-avatar ss-m-r-24"
  71. :src="
  72. sheep.$url.cdn(item?.sender?.avatar) ||
  73. sheep.$url.static('/assets/addons/shopro/uniapp/chat/default.png')
  74. "
  75. mode="aspectFill"
  76. ></image>
  77. <!-- 发送状态 -->
  78. <span
  79. v-if="
  80. item.from === 'customer' &&
  81. index == chatData.chatList.length - 1 &&
  82. chatData.isSendSucces !== 0
  83. "
  84. class="send-status"
  85. >
  86. <image
  87. v-if="chatData.isSendSucces == -1"
  88. class="loading"
  89. :src="sheep.$url.static('/assets/addons/shopro/uniapp/chat/loading.png')"
  90. mode="aspectFill"
  91. ></image>
  92. <!-- <image
  93. v-if="chatData.isSendSucces == 1"
  94. class="warning"
  95. :src="sheep.$url.static('/assets/addons/shopro/uniapp/chat/warning.png')"
  96. mode="aspectFill"
  97. @click="onAgainSendMessage(item)"
  98. ></image> -->
  99. </span>
  100. <!-- 内容 -->
  101. <template v-if="item.mode === 'text'">
  102. <view class="message-box" :class="[item.from]">
  103. <div
  104. class="message-text ss-flex ss-flex-wrap"
  105. @click="onRichtext"
  106. v-html="replaceEmoji(item.content.text)"
  107. ></div>
  108. </view>
  109. </template>
  110. <template v-if="item.mode === 'image'">
  111. <view class="message-box" :class="[item.from]" :style="{ width: '200rpx' }">
  112. <su-image
  113. class="message-img"
  114. isPreview
  115. :previewList="[sheep.$url.cdn(item.content.url)]"
  116. :current="0"
  117. :src="sheep.$url.cdn(item.content.url)"
  118. :height="200"
  119. :width="200"
  120. mode="aspectFill"
  121. ></su-image>
  122. </view>
  123. </template>
  124. <template v-if="item.mode === 'goods'">
  125. <GoodsItem
  126. :goodsData="item.content.item"
  127. @tap="
  128. sheep.$router.go('/pages/goods/index', {
  129. id: item.content.item.id,
  130. })
  131. "
  132. />
  133. </template>
  134. <template v-if="item.mode === 'order'">
  135. <OrderItem
  136. from="msg"
  137. :orderData="item.content.item"
  138. @tap="
  139. sheep.$router.go('/pages/order/detail', {
  140. id: item.content.item.id,
  141. })
  142. "
  143. />
  144. </template>
  145. <!-- user头像 -->
  146. <image
  147. v-show="item.from === 'customer'"
  148. class="chat-avatar ss-m-l-24"
  149. :src="sheep.$url.cdn(customerUserInfo.avatar)"
  150. mode="aspectFill"
  151. >
  152. </image>
  153. </view>
  154. </view>
  155. <view id="scrollBottom"></view>
  156. </scroll-view>
  157. </view>
  158. <su-fixed bottom>
  159. <view class="send-wrap ss-flex">
  160. <view class="left ss-flex ss-flex-1">
  161. <uni-easyinput
  162. class="ss-flex-1 ss-p-l-22"
  163. :inputBorder="false"
  164. :clearable="false"
  165. v-model="chat.msg"
  166. :placeholder="$t('chat.index.msg2')"
  167. ></uni-easyinput>
  168. </view>
  169. <text class="sicon-basic bq" @tap.stop="onTools('emoji')"></text>
  170. <text
  171. v-if="!chat.msg"
  172. class="sicon-edit"
  173. :class="{ 'is-active': chat.toolsMode == 'tools' }"
  174. @tap.stop="onTools('tools')"
  175. ></text>
  176. <button v-if="chat.msg" class="ss-reset-button send-btn" @tap="onSendMessage">
  177. {{$t('chat.index.send')}}
  178. </button>
  179. </view>
  180. </su-fixed>
  181. <su-popup
  182. :show="chat.showTools"
  183. @close="
  184. chat.showTools = false;
  185. chat.toolsMode = '';
  186. "
  187. >
  188. <view class="ss-modal-box ss-flex-col">
  189. <view class="send-wrap ss-flex">
  190. <view class="left ss-flex ss-flex-1">
  191. <uni-easyinput
  192. class="ss-flex-1 ss-p-l-22"
  193. :inputBorder="false"
  194. :clearable="false"
  195. v-model="chat.msg"
  196. :placeholder="$t('chat.index.msg2')"
  197. ></uni-easyinput>
  198. </view>
  199. <text class="sicon-basic bq" @tap.stop="onTools('emoji')"></text>
  200. <text></text>
  201. <text
  202. v-if="!chat.msg"
  203. class="sicon-edit"
  204. :class="{ 'is-active': chat.toolsMode == 'tools' }"
  205. @tap.stop="onTools('tools')"
  206. ></text>
  207. <button v-if="chat.msg" class="ss-reset-button send-btn" @tap="onSendMessage">
  208. {{$t('chat.index.send')}}
  209. </button>
  210. </view>
  211. <view class="content ss-flex ss-flex-1">
  212. <template v-if="chat.toolsMode == 'emoji'">
  213. <swiper
  214. class="emoji-swiper"
  215. :indicator-dots="true"
  216. circular
  217. indicator-active-color="#7063D2"
  218. indicator-color="rgba(235, 231, 255, 1)"
  219. :autoplay="false"
  220. :interval="3000"
  221. :duration="1000"
  222. >
  223. <swiper-item v-for="emoji in emojiPage" :key="emoji">
  224. <view class="ss-flex ss-flex-wrap">
  225. <template v-for="item in emoji" :key="item">
  226. <image
  227. class="emoji-img"
  228. :src="sheep.$url.cdn(`/assets/addons/shopro/img/chat/emoji/${item.file}`)"
  229. @tap="onEmoji(item)"
  230. >
  231. </image>
  232. </template>
  233. </view>
  234. </swiper-item>
  235. </swiper>
  236. </template>
  237. <template v-else>
  238. <view class="image">
  239. <s-uploader
  240. file-mediatype="image"
  241. :imageStyles="{ width: 50, height: 50, border: false }"
  242. @select="onSelect({ type: 'image', data: $event })"
  243. >
  244. <image
  245. class="icon"
  246. :src="sheep.$url.static('/assets/addons/shopro/uniapp/chat/image.png')"
  247. mode="aspectFill"
  248. ></image>
  249. </s-uploader>
  250. <view>{{$t('chat.index.picture')}}</view>
  251. </view>
  252. <view class="goods" @tap="onShowSelect('goods')">
  253. <image
  254. class="icon"
  255. :src="sheep.$url.static('/assets/addons/shopro/uniapp/chat/goods.png')"
  256. mode="aspectFill"
  257. ></image>
  258. <view>{{$t('chat.index.goods')}}</view>
  259. </view>
  260. <view class="order" @tap="onShowSelect('order')">
  261. <image
  262. class="icon"
  263. :src="sheep.$url.static('/assets/addons/shopro/uniapp/chat/order.png')"
  264. mode="aspectFill"
  265. ></image>
  266. <view>{{$t('chat.index.order')}}</view>
  267. </view>
  268. </template>
  269. </view>
  270. </view>
  271. </su-popup>
  272. <SelectPopup
  273. :mode="chat.selectMode"
  274. :show="chat.showSelect"
  275. @select="onSelect"
  276. @close="chat.showSelect = false"
  277. />
  278. </s-layout>
  279. </template>
  280. <script setup>
  281. import sheep from '@/sheep';
  282. import { computed, reactive, toRefs } from 'vue';
  283. import { onLoad } from '@dcloudio/uni-app';
  284. import { emojiList, emojiPage } from './emoji.js';
  285. import SelectPopup from './components/select-popup.vue';
  286. import GoodsItem from './components/goods.vue';
  287. import OrderItem from './components/order.vue';
  288. import { useChatWebSocket } from './socket';
  289. const {
  290. socketInit,
  291. state: chatData,
  292. socketSendMsg,
  293. formatChatInput,
  294. socketHistoryList,
  295. onDrop,
  296. onPaste,
  297. getFocus,
  298. // upload,
  299. getUserToken,
  300. // socketTest,
  301. showTime,
  302. formatTime,
  303. } = useChatWebSocket();
  304. const chatList = toRefs(chatData).chatList;
  305. const customerServiceInfo = toRefs(chatData).customerServerInfo;
  306. const chatHistoryPagination = toRefs(chatData).chatHistoryPagination;
  307. const customerUserInfo = toRefs(chatData).customerUserInfo;
  308. const socketState = toRefs(chatData).socketState;
  309. const sys_navBar = sheep.$platform.navbar;
  310. const chatConfig = computed(() => sheep.$store('app').chat);
  311. const { screenHeight, safeAreaInsets, safeArea, screenWidth } = sheep.$platform.device;
  312. const pageHeight = safeArea.height - 44 - 35 - 50;
  313. const chatStatus = {
  314. online: {
  315. text: uni.getLocale() == 'en' ? 'online' : '在线',
  316. colorVariate: '#46c55f',
  317. },
  318. offline: {
  319. text: uni.getLocale() == 'en' ? 'offline' : '离线',
  320. colorVariate: '#b5b5b5',
  321. },
  322. busy: {
  323. text: uni.getLocale() == 'en' ? 'busy' : '忙碌',
  324. colorVariate: '#ff0e1b',
  325. },
  326. };
  327. // 加载更多
  328. const loadingMap = {
  329. loadmore: {
  330. title: uni.getLocale() == 'en' ? 'view more' : '查看更多',
  331. icon: 'el-icon-d-arrow-left',
  332. },
  333. nomore: {
  334. title: uni.getLocale() == 'en' ? 'no more' : '没有了',
  335. icon: '',
  336. },
  337. loading: {
  338. title: uni.getLocale() == 'en' ? 'loading' : '加载中...',
  339. icon: 'el-icon-loading',
  340. },
  341. };
  342. const onLoadMore = () => {
  343. chatHistoryPagination.value.page < chatHistoryPagination.value.lastPage && socketHistoryList();
  344. };
  345. const chat = reactive({
  346. msg: '',
  347. scrollInto: '',
  348. showTools: false,
  349. toolsMode: '',
  350. showSelect: false,
  351. selectMode: '',
  352. chatStyle: {
  353. mode: 'inner',
  354. color: '#F8270F',
  355. type: 'color',
  356. alwaysShow: 1,
  357. src: '',
  358. list: {},
  359. },
  360. });
  361. // 点击工具栏开关
  362. function onTools(mode) {
  363. if (!socketState.value.isConnect) {
  364. sheep.$helper.toast(socketState.value.tip || $t('chat.index.dropped'));
  365. return;
  366. }
  367. if (!chat.toolsMode || chat.toolsMode === mode) {
  368. chat.showTools = !chat.showTools;
  369. }
  370. chat.toolsMode = mode;
  371. if (!chat.showTools) {
  372. chat.toolsMode = '';
  373. }
  374. }
  375. function onShowSelect(mode) {
  376. chat.showTools = false;
  377. chat.showSelect = true;
  378. chat.selectMode = mode;
  379. }
  380. async function onSelect({ type, data }) {
  381. let msg = '';
  382. switch (type) {
  383. case 'image':
  384. const { url, fullurl } = await sheep.$api.app.upload(data.tempFiles[0].path, 'default');
  385. msg = {
  386. from: 'customer',
  387. mode: 'image',
  388. date: new Date().getTime(),
  389. content: {
  390. url: fullurl,
  391. path: url,
  392. },
  393. };
  394. break;
  395. case 'goods':
  396. msg = {
  397. from: 'customer',
  398. mode: 'goods',
  399. date: new Date().getTime(),
  400. content: {
  401. item: {
  402. id: data.goods.id,
  403. title: data.goods.title,
  404. image: data.goods.image,
  405. price: data.goods.price,
  406. stock: data.goods.stock,
  407. },
  408. },
  409. };
  410. break;
  411. case 'order':
  412. msg = {
  413. from: 'customer',
  414. mode: 'order',
  415. date: new Date().getTime(),
  416. content: {
  417. item: {
  418. id: data.id,
  419. order_sn: data.order_sn,
  420. // create_time: data.create_time,
  421. createtime: data.createtime,
  422. pay_fee: data.pay_fee,
  423. items: data.items.filter((item) => ({
  424. goods_id: item.goods_id,
  425. goods_title: item.goods_title,
  426. goods_image: item.goods_image,
  427. goods_price: item.goods_price,
  428. })),
  429. status_text: data.status_text,
  430. },
  431. },
  432. };
  433. break;
  434. }
  435. if (msg) {
  436. socketSendMsg(msg, () => {
  437. scrollBottom();
  438. });
  439. // scrollBottom();
  440. chat.showTools = false;
  441. chat.showSelect = false;
  442. chat.selectMode = '';
  443. }
  444. }
  445. function onAgainSendMessage(item) {
  446. if (!socketState.value.isConnect) {
  447. sheep.$helper.toast(socketState.value.tip || $t('chat.index.dropped'));
  448. return;
  449. }
  450. if (!item) return;
  451. const data = {
  452. from: 'customer',
  453. mode: 'text',
  454. date: new Date().getTime(),
  455. content: item.content,
  456. };
  457. socketSendMsg(data, () => {
  458. scrollBottom();
  459. });
  460. }
  461. function onSendMessage() {
  462. if (!socketState.value.isConnect) {
  463. sheep.$helper.toast(socketState.value.tip || $t('chat.index.dropped'));
  464. return;
  465. }
  466. if (!chat.msg) return;
  467. const data = {
  468. from: 'customer',
  469. mode: 'text',
  470. date: new Date().getTime(),
  471. content: {
  472. text: chat.msg,
  473. },
  474. };
  475. socketSendMsg(data, () => {
  476. scrollBottom();
  477. });
  478. chat.showTools = false;
  479. // scrollBottom();
  480. setTimeout(() => {
  481. chat.msg = '';
  482. }, 100);
  483. }
  484. // 点击猜你想问
  485. function onTemplateList(e) {
  486. if (!socketState.value.isConnect) {
  487. sheep.$helper.toast(socketState.value.tip || $t('chat.index.dropped'));
  488. return;
  489. }
  490. const data = {
  491. from: 'customer',
  492. mode: 'text',
  493. date: new Date().getTime(),
  494. content: {
  495. text: e.title,
  496. },
  497. customData: {
  498. question_id: e.id,
  499. },
  500. };
  501. socketSendMsg(data, () => {
  502. scrollBottom();
  503. });
  504. // scrollBottom();
  505. }
  506. function onEmoji(item) {
  507. chat.msg += item.name;
  508. }
  509. function selEmojiFile(name) {
  510. for (let index in emojiList) {
  511. if (emojiList[index].name === name) {
  512. return emojiList[index].file;
  513. }
  514. }
  515. return false;
  516. }
  517. function replaceEmoji(data) {
  518. let newData = data;
  519. if (typeof newData !== 'object') {
  520. let reg = /\[(.+?)\]/g; // [] 中括号
  521. let zhEmojiName = newData.match(reg);
  522. if (zhEmojiName) {
  523. zhEmojiName.forEach((item) => {
  524. let emojiFile = selEmojiFile(item);
  525. newData = newData.replace(
  526. item,
  527. `<img class="chat-img" style="width: 24px;height: 24px;margin: 0 3px;" src="${sheep.$url.cdn(
  528. '/assets/addons/shopro/img/chat/emoji/' + emojiFile,
  529. )}"/>`,
  530. );
  531. });
  532. }
  533. }
  534. return newData;
  535. }
  536. function scrollBottom() {
  537. let timeout = null;
  538. chat.scrollInto = '';
  539. clearTimeout(timeout);
  540. timeout = setTimeout(() => {
  541. chat.scrollInto = 'scrollBottom';
  542. }, 100);
  543. }
  544. onLoad(async () => {
  545. const { code } = await getUserToken();
  546. if (code === 1) {
  547. socketInit(chatConfig.value, () => {
  548. scrollBottom();
  549. });
  550. } else {
  551. socketState.value.isConnect = false;
  552. }
  553. });
  554. </script>
  555. <style lang="scss" scoped>
  556. .page-bg {
  557. width: 100%;
  558. position: absolute;
  559. top: 0;
  560. left: 0;
  561. background: linear-gradient(90deg, var(--ui-BG-Main), var(--ui-BG-Main-gradient));
  562. background-size: 750rpx 100%;
  563. z-index: 1;
  564. }
  565. .chat-wrap {
  566. // :deep() {
  567. // .ui-navbar-box {
  568. // background: linear-gradient(90deg, var(--ui-BG-Main), var(--ui-BG-Main-gradient));
  569. // }
  570. // }
  571. .status {
  572. position: relative;
  573. box-sizing: border-box;
  574. z-index: 3;
  575. height: 70rpx;
  576. padding: 0 30rpx;
  577. background: var(--ui-BG-Main-opacity-1);
  578. display: flex;
  579. align-items: center;
  580. font-size: 30rpx;
  581. font-weight: 400;
  582. color: var(--ui-BG-Main);
  583. }
  584. .chat-box {
  585. padding: 0 20rpx 0;
  586. .loadmore-btn {
  587. width: 98%;
  588. height: 40px;
  589. font-size: 12px;
  590. color: #8c8c8c;
  591. .loadmore-icon {
  592. transform: rotate(90deg);
  593. }
  594. }
  595. .message-item {
  596. margin-bottom: 33rpx;
  597. }
  598. .date-message,
  599. .system-message {
  600. width: fit-content;
  601. border-radius: 12rpx;
  602. padding: 8rpx 16rpx;
  603. margin-bottom: 16rpx;
  604. background-color: var(--ui-BG-3);
  605. color: #999;
  606. font-size: 24rpx;
  607. }
  608. .chat-avatar {
  609. width: 70rpx;
  610. height: 70rpx;
  611. border-radius: 50%;
  612. }
  613. .send-status {
  614. color: #333;
  615. height: 80rpx;
  616. margin-right: 8rpx;
  617. display: flex;
  618. align-items: center;
  619. .loading {
  620. width: 32rpx;
  621. height: 32rpx;
  622. -webkit-animation: rotating 2s linear infinite;
  623. animation: rotating 2s linear infinite;
  624. @-webkit-keyframes rotating {
  625. 0% {
  626. transform: rotateZ(0);
  627. }
  628. 100% {
  629. transform: rotateZ(360deg);
  630. }
  631. }
  632. @keyframes rotating {
  633. 0% {
  634. transform: rotateZ(0);
  635. }
  636. 100% {
  637. transform: rotateZ(360deg);
  638. }
  639. }
  640. }
  641. .warning {
  642. width: 32rpx;
  643. height: 32rpx;
  644. color: #ff3000;
  645. }
  646. }
  647. .message-box {
  648. max-width: 50%;
  649. font-size: 16px;
  650. line-height: 20px;
  651. // max-width: 500rpx;
  652. white-space: normal;
  653. word-break: break-all;
  654. word-wrap: break-word;
  655. padding: 20rpx;
  656. border-radius: 10rpx;
  657. color: #fff;
  658. background: linear-gradient(90deg, var(--ui-BG-Main), var(--ui-BG-Main-gradient));
  659. &.customer_service {
  660. background: #fff;
  661. color: #333;
  662. }
  663. :deep() {
  664. .imgred {
  665. width: 100%;
  666. }
  667. .imgred,
  668. img {
  669. width: 100%;
  670. }
  671. }
  672. }
  673. :deep() {
  674. .goods,
  675. .order {
  676. max-width: 500rpx;
  677. }
  678. }
  679. .message-img {
  680. width: 100px;
  681. height: 100px;
  682. border-radius: 6rpx;
  683. }
  684. .template-wrap {
  685. // width: 100%;
  686. padding: 20rpx 24rpx;
  687. background: #fff;
  688. border-radius: 10rpx;
  689. .title {
  690. font-size: 26rpx;
  691. font-weight: 500;
  692. color: #333;
  693. margin-bottom: 29rpx;
  694. }
  695. .item {
  696. font-size: 24rpx;
  697. color: var(--ui-BG-Main);
  698. margin-bottom: 16rpx;
  699. &:last-of-type {
  700. margin-bottom: 0;
  701. }
  702. }
  703. }
  704. .error-img {
  705. width: 400rpx;
  706. height: 400rpx;
  707. }
  708. #scrollBottom {
  709. height: 120rpx;
  710. }
  711. }
  712. .send-wrap {
  713. padding: 18rpx 20rpx;
  714. background: #fff;
  715. .left {
  716. height: 64rpx;
  717. border-radius: 32rpx;
  718. background: var(--ui-BG-1);
  719. }
  720. .bq {
  721. font-size: 50rpx;
  722. margin-left: 10rpx;
  723. }
  724. .sicon-edit {
  725. font-size: 50rpx;
  726. margin-left: 10rpx;
  727. transform: rotate(0deg);
  728. transition: all linear 0.2s;
  729. &.is-active {
  730. transform: rotate(45deg);
  731. }
  732. }
  733. .send-btn {
  734. width: 100rpx;
  735. height: 60rpx;
  736. line-height: 60rpx;
  737. border-radius: 30rpx;
  738. background: linear-gradient(90deg, var(--ui-BG-Main), var(--ui-BG-Main-gradient));
  739. font-size: 26rpx;
  740. color: #fff;
  741. margin-left: 11rpx;
  742. }
  743. }
  744. }
  745. .content {
  746. width: 100%;
  747. align-content: space-around;
  748. border-top: 1px solid #dfdfdf;
  749. padding: 20rpx 0 0;
  750. .emoji-swiper {
  751. width: 100%;
  752. height: 280rpx;
  753. padding: 0 20rpx;
  754. .emoji-img {
  755. width: 50rpx;
  756. height: 50rpx;
  757. display: inline-block;
  758. margin: 10rpx;
  759. }
  760. }
  761. .image,
  762. .goods,
  763. .order {
  764. width: 33.3%;
  765. height: 280rpx;
  766. text-align: center;
  767. font-size: 24rpx;
  768. color: #333;
  769. display: flex;
  770. flex-direction: column;
  771. align-items: center;
  772. justify-content: center;
  773. .icon {
  774. width: 50rpx;
  775. height: 50rpx;
  776. margin-bottom: 21rpx;
  777. }
  778. }
  779. :deep() {
  780. .uni-file-picker__container {
  781. justify-content: center;
  782. }
  783. .file-picker__box {
  784. display: none;
  785. &:last-of-type {
  786. display: flex;
  787. }
  788. }
  789. }
  790. }
  791. </style>
  792. <style>
  793. .chat-img {
  794. width: 24px;
  795. height: 24px;
  796. margin: 0 3px;
  797. }
  798. .full-img {
  799. object-fit: cover;
  800. width: 100px;
  801. height: 100px;
  802. border-radius: 6px;
  803. }
  804. </style>