index.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870
  1. <template>
  2. <s-layout class="chat-wrap" title="客服" navbar="inner">
  3. <div class="status">
  4. {{ socketState.isConnect ? customerServiceInfo.title : '网络已断开,请检查网络后刷新重试' }}
  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">猜你想问</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('/static/images/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('/static/images/loading.png')"
  90. mode="aspectFill"
  91. ></image>
  92. <!-- <image
  93. v-if="chatData.isSendSucces == 1"
  94. class="warning"
  95. :src="sheep.$url.static('/static/images/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="请输入你要咨询的问题"
  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. 发送
  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="请输入你要咨询的问题"
  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. 发送
  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(`/static/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('/static/images/image.png')"
  247. mode="aspectFill"
  248. ></image>
  249. </s-uploader>
  250. <view>图片</view>
  251. </view>
  252. <view class="goods" @tap="onShowSelect('goods')">
  253. <image
  254. class="icon"
  255. :src="sheep.$url.static('/static/images/goods.png')"
  256. mode="aspectFill"
  257. ></image>
  258. <view>商品</view>
  259. </view>
  260. <view class="order" @tap="onShowSelect('order')">
  261. <image
  262. class="icon"
  263. :src="sheep.$url.static('/static/images/order.png')"
  264. mode="aspectFill"
  265. ></image>
  266. <view>订单</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: '在线',
  316. colorVariate: '#46c55f',
  317. },
  318. offline: {
  319. text: '离线',
  320. colorVariate: '#b5b5b5',
  321. },
  322. busy: {
  323. text: '忙碌',
  324. colorVariate: '#ff0e1b',
  325. },
  326. };
  327. // 加载更多
  328. const loadingMap = {
  329. loadmore: {
  330. title: '查看更多',
  331. icon: 'el-icon-d-arrow-left',
  332. },
  333. nomore: {
  334. title: '没有更多了',
  335. icon: '',
  336. },
  337. loading: {
  338. title: '加载中... ',
  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 || '您已掉线!请返回重试');
  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 { path, 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: path,
  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. pay_fee: data.pay_fee,
  422. items: data.items.filter((item) => ({
  423. goods_id: item.goods_id,
  424. goods_title: item.goods_title,
  425. goods_image: item.goods_image,
  426. goods_price: item.goods_price,
  427. })),
  428. status_text: data.status_text,
  429. },
  430. },
  431. };
  432. break;
  433. }
  434. if (msg) {
  435. socketSendMsg(msg, () => {
  436. scrollBottom();
  437. });
  438. // scrollBottom();
  439. chat.showTools = false;
  440. chat.showSelect = false;
  441. chat.selectMode = '';
  442. }
  443. }
  444. function onAgainSendMessage(item) {
  445. if (!socketState.value.isConnect) {
  446. sheep.$helper.toast(socketState.value.tip || '您已掉线!请返回重试');
  447. return;
  448. }
  449. if (!item) return;
  450. const data = {
  451. from: 'customer',
  452. mode: 'text',
  453. date: new Date().getTime(),
  454. content: item.content,
  455. };
  456. socketSendMsg(data, () => {
  457. scrollBottom();
  458. });
  459. }
  460. function onSendMessage() {
  461. if (!socketState.value.isConnect) {
  462. sheep.$helper.toast(socketState.value.tip || '您已掉线!请返回重试');
  463. return;
  464. }
  465. if (!chat.msg) return;
  466. const data = {
  467. from: 'customer',
  468. mode: 'text',
  469. date: new Date().getTime(),
  470. content: {
  471. text: chat.msg,
  472. },
  473. };
  474. socketSendMsg(data, () => {
  475. scrollBottom();
  476. });
  477. chat.showTools = false;
  478. // scrollBottom();
  479. setTimeout(() => {
  480. chat.msg = '';
  481. }, 100);
  482. }
  483. // 点击猜你想问
  484. function onTemplateList(e) {
  485. if (!socketState.value.isConnect) {
  486. sheep.$helper.toast(socketState.value.tip || '您已掉线!请返回重试');
  487. return;
  488. }
  489. const data = {
  490. from: 'customer',
  491. mode: 'text',
  492. date: new Date().getTime(),
  493. content: {
  494. text: e.title,
  495. },
  496. customData: {
  497. question_id: e.id,
  498. },
  499. };
  500. socketSendMsg(data, () => {
  501. scrollBottom();
  502. });
  503. // scrollBottom();
  504. }
  505. function onEmoji(item) {
  506. chat.msg += item.name;
  507. }
  508. function selEmojiFile(name) {
  509. for (let index in emojiList) {
  510. if (emojiList[index].name === name) {
  511. return emojiList[index].file;
  512. }
  513. }
  514. return false;
  515. }
  516. function replaceEmoji(data) {
  517. let newData = data;
  518. if (typeof newData !== 'object') {
  519. let reg = /\[(.+?)\]/g; // [] 中括号
  520. let zhEmojiName = newData.match(reg);
  521. if (zhEmojiName) {
  522. zhEmojiName.forEach((item) => {
  523. let emojiFile = selEmojiFile(item);
  524. newData = newData.replace(
  525. item,
  526. `<image class="chat-img" style="width: 24px;height: 24px;margin: 0 3px;" src="${sheep.$url.cdn(
  527. '/static/img/chat/emoji/' + emojiFile,
  528. )}"/></image>`,
  529. );
  530. });
  531. }
  532. }
  533. return newData;
  534. }
  535. function scrollBottom() {
  536. let timeout = null;
  537. chat.scrollInto = '';
  538. clearTimeout(timeout);
  539. timeout = setTimeout(() => {
  540. chat.scrollInto = 'scrollBottom';
  541. }, 100);
  542. }
  543. onLoad(async () => {
  544. const { error } = await getUserToken();
  545. if (error === 0) {
  546. socketInit(chatConfig.value, () => {
  547. scrollBottom();
  548. });
  549. } else {
  550. socketState.value.isConnect = false;
  551. }
  552. });
  553. </script>
  554. <style lang="scss" scoped>
  555. .page-bg {
  556. width: 100%;
  557. position: absolute;
  558. top: 0;
  559. left: 0;
  560. background: linear-gradient(90deg, var(--ui-BG-Main), var(--ui-BG-Main-gradient));
  561. background-size: 750rpx 100%;
  562. z-index: 1;
  563. }
  564. .chat-wrap {
  565. // :deep() {
  566. // .ui-navbar-box {
  567. // background: linear-gradient(90deg, var(--ui-BG-Main), var(--ui-BG-Main-gradient));
  568. // }
  569. // }
  570. .status {
  571. position: relative;
  572. box-sizing: border-box;
  573. z-index: 3;
  574. height: 70rpx;
  575. padding: 0 30rpx;
  576. background: var(--ui-BG-Main-opacity-1);
  577. display: flex;
  578. align-items: center;
  579. font-size: 30rpx;
  580. font-weight: 400;
  581. color: var(--ui-BG-Main);
  582. }
  583. .chat-box {
  584. padding: 0 20rpx 0;
  585. .loadmore-btn {
  586. width: 98%;
  587. height: 40px;
  588. font-size: 12px;
  589. color: #8c8c8c;
  590. .loadmore-icon {
  591. transform: rotate(90deg);
  592. }
  593. }
  594. .message-item {
  595. margin-bottom: 33rpx;
  596. }
  597. .date-message,
  598. .system-message {
  599. width: fit-content;
  600. border-radius: 12rpx;
  601. padding: 8rpx 16rpx;
  602. margin-bottom: 16rpx;
  603. background-color: var(--ui-BG-3);
  604. color: #999;
  605. font-size: 24rpx;
  606. }
  607. .chat-avatar {
  608. width: 70rpx;
  609. height: 70rpx;
  610. border-radius: 50%;
  611. }
  612. .send-status {
  613. color: #333;
  614. height: 80rpx;
  615. margin-right: 8rpx;
  616. display: flex;
  617. align-items: center;
  618. .loading {
  619. width: 32rpx;
  620. height: 32rpx;
  621. -webkit-animation: rotating 2s linear infinite;
  622. animation: rotating 2s linear infinite;
  623. @-webkit-keyframes rotating {
  624. 0% {
  625. transform: rotateZ(0);
  626. }
  627. 100% {
  628. transform: rotateZ(360deg);
  629. }
  630. }
  631. @keyframes rotating {
  632. 0% {
  633. transform: rotateZ(0);
  634. }
  635. 100% {
  636. transform: rotateZ(360deg);
  637. }
  638. }
  639. }
  640. .warning {
  641. width: 32rpx;
  642. height: 32rpx;
  643. color: #ff3000;
  644. }
  645. }
  646. .message-box {
  647. max-width: 50%;
  648. font-size: 16px;
  649. line-height: 20px;
  650. // max-width: 500rpx;
  651. white-space: normal;
  652. word-break: break-all;
  653. word-wrap: break-word;
  654. padding: 20rpx;
  655. border-radius: 10rpx;
  656. color: #fff;
  657. background: linear-gradient(90deg, var(--ui-BG-Main), var(--ui-BG-Main-gradient));
  658. &.customer_service {
  659. background: #fff;
  660. color: #333;
  661. }
  662. :deep() {
  663. .imgred {
  664. width: 100%;
  665. }
  666. .imgred,
  667. img {
  668. width: 100%;
  669. }
  670. }
  671. }
  672. :deep() {
  673. .goods,
  674. .order {
  675. max-width: 500rpx;
  676. }
  677. }
  678. .message-img {
  679. width: 100px;
  680. height: 100px;
  681. border-radius: 6rpx;
  682. }
  683. .template-wrap {
  684. // width: 100%;
  685. padding: 20rpx 24rpx;
  686. background: #fff;
  687. border-radius: 10rpx;
  688. .title {
  689. font-size: 26rpx;
  690. font-weight: 500;
  691. color: #333;
  692. margin-bottom: 29rpx;
  693. }
  694. .item {
  695. font-size: 24rpx;
  696. color: var(--ui-BG-Main);
  697. margin-bottom: 16rpx;
  698. &:last-of-type {
  699. margin-bottom: 0;
  700. }
  701. }
  702. }
  703. .error-img {
  704. width: 400rpx;
  705. height: 400rpx;
  706. }
  707. #scrollBottom {
  708. height: 120rpx;
  709. }
  710. }
  711. .send-wrap {
  712. padding: 18rpx 20rpx;
  713. background: #fff;
  714. .left {
  715. height: 64rpx;
  716. border-radius: 32rpx;
  717. background: var(--ui-BG-1);
  718. }
  719. .bq {
  720. font-size: 50rpx;
  721. margin-left: 10rpx;
  722. }
  723. .sicon-edit {
  724. font-size: 50rpx;
  725. margin-left: 10rpx;
  726. transform: rotate(0deg);
  727. transition: all linear 0.2s;
  728. &.is-active {
  729. transform: rotate(45deg);
  730. }
  731. }
  732. .send-btn {
  733. width: 100rpx;
  734. height: 60rpx;
  735. line-height: 60rpx;
  736. border-radius: 30rpx;
  737. background: linear-gradient(90deg, var(--ui-BG-Main), var(--ui-BG-Main-gradient));
  738. font-size: 26rpx;
  739. color: #fff;
  740. margin-left: 11rpx;
  741. }
  742. }
  743. }
  744. .content {
  745. width: 100%;
  746. align-content: space-around;
  747. border-top: 1px solid #dfdfdf;
  748. padding: 20rpx 0 0;
  749. .emoji-swiper {
  750. width: 100%;
  751. height: 280rpx;
  752. padding: 0 20rpx;
  753. .emoji-img {
  754. width: 50rpx;
  755. height: 50rpx;
  756. display: inline-block;
  757. margin: 10rpx;
  758. }
  759. }
  760. .image,
  761. .goods,
  762. .order {
  763. width: 33.3%;
  764. height: 280rpx;
  765. text-align: center;
  766. font-size: 24rpx;
  767. color: #333;
  768. display: flex;
  769. flex-direction: column;
  770. align-items: center;
  771. justify-content: center;
  772. .icon {
  773. width: 50rpx;
  774. height: 50rpx;
  775. margin-bottom: 21rpx;
  776. }
  777. }
  778. :deep() {
  779. .uni-file-picker__container {
  780. justify-content: center;
  781. }
  782. .file-picker__box {
  783. display: none;
  784. &:last-of-type {
  785. display: flex;
  786. }
  787. }
  788. }
  789. }
  790. </style>
  791. <style>
  792. .chat-img {
  793. width: 24px;
  794. height: 24px;
  795. margin: 0 3px;
  796. }
  797. .full-img {
  798. object-fit: cover;
  799. width: 100px;
  800. height: 100px;
  801. border-radius: 6px;
  802. }
  803. </style>