chat.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734
  1. <template>
  2. <view class="content">
  3. <!-- <view class="send-load" v-if="msgData.flag">数据加载中...</view> -->
  4. <view class="send-load" v-if="msgData.isSend">发送中...</view>
  5. <view class="chat-content" @touchmove="touchmove">
  6. <scroll-view class="chat-body" scroll-y scroll-with-animation :scroll-top="scrollTop" scroll-with-animation @scroll="scroll" @scrolltoupper="scrolltoupper" @scrolltolower="scrolltolower" upper-threshold="80" :scroll-into-view="scrollIntoViewId" refresher-background="transparent">
  7. <!-- <view class="msgLoading" v-if="msgData.flag">数据加载中...</view> -->
  8. <view class="scroll-view-msg" style="padding: 30rpx 30rpx;">
  9. <template v-for="(item, index) in msgData.list">
  10. <view class="msgContent" :id="'msg-' + item.messageId">
  11. <view class="text_26 color__ time">
  12. {{ renderMessageDate(item, index) }}
  13. </view>
  14. <view class="message" :class="[item.userType]">
  15. <image :src="chatData.service" v-if="item.userType === 'friend'" class="avatar" mode="widthFix"></image>
  16. <view class="message-con">
  17. <view v-if="item.msgType == 'text'" @click="clickText(item.content)">
  18. <view v-html="renderTextMessage(item.content)"></view>
  19. </view>
  20. <view class="m-address" v-if="item.msgType == 'address'" @click="toAddress(item.content)">
  21. <view class="image"><image :src="item.content.img" mode="widthFix"></image></view>
  22. <view class="infos">
  23. <view class="title">{{item.content.name}}</view>
  24. <view class="desc">{{item.content.order?item.content.order:'-'}}</view>
  25. </view>
  26. </view>
  27. <view class="m-address" v-if="item.msgType == 'order'">
  28. <view class="image"><image :src="item.content.img" mode="widthFix"></image></view>
  29. <view class="infos">
  30. <view class="title">{{item.content.name}}</view>
  31. <view class="desc">{{item.content.order?item.content.order:'-'}}</view>
  32. </view>
  33. </view>
  34. <view class="m-image" v-if="item.msgType == 'image'">
  35. <image :src="item.content" mode="widthFix" @click="previewImg(item.content)"></image>
  36. </view>
  37. <view class="m-address" v-if="item.msgType == 'pay'">
  38. <view class="image"><image :src="item.content.img" mode="widthFix"></image></view>
  39. <view class="infos">
  40. <view class="title">{{item.content.name}}</view>
  41. <view class="price">¥ {{item.content.price?item.content.price:'-'}}</view>
  42. </view>
  43. </view>
  44. <view class="" v-if="item.msgType == 'quick'">
  45. <view class="quickCon">{{item.content}}</view>
  46. <view class="quickList" v-if="item.list.length > 0">
  47. <view class="list-items" v-for="(qItem,indx) in item.list" @click="quickQs(qItem)">
  48. {{qItem.question}}
  49. </view>
  50. </view>
  51. </view>
  52. </view>
  53. <image :src="chatData.self" v-if="item.userType === 'self'" class="avatar" mode="widthFix"></image>
  54. </view>
  55. </view>
  56. </template>
  57. </view>
  58. </scroll-view>
  59. <view class="tool">
  60. <view class="tool-option">
  61. <view class="input-text">
  62. <textarea class="input" placeholder="输入点什么呢..." auto-height="true" confirm-type="send" type="text"
  63. :maxlength="-1" :adjust-position="false" v-model="text" confirm-hold @focus="focus" :focus="isFocus" @blur="isFocus = false"
  64. :show-confirm-bar="false" @confirm="sendingText" @keyboardheightchange="keyboardheightchange" />
  65. </view>
  66. <view class="check-img">
  67. <view class="check-icon" @click="tapEmoji"><image src="@/static/image/face.svg" mode="aspectFill"></image></view>
  68. <view class="check-icon" @click="tapMore"><image src="@/static/image/more.svg" mode="aspectFill"></image></view>
  69. </view>
  70. </view>
  71. </view>
  72. <template v-if="keyboardHeight>0">
  73. <view class="keyboardheight" :style="{ height: keyboardHeight + 'px' }"></view>
  74. </template>
  75. <emoji v-model="isEmoji" @onEmoji="onEmoji" @deleteFn="deleteFn" @sendingText="sendingText" @sendingEmojiPack="sendingEmojiPack"></emoji>
  76. <more v-model="isMore" @onMore="sendingMore"></more>
  77. </view>
  78. <orderDialog ref="orderDialog" @send="sendOrder"></orderDialog>
  79. </view>
  80. </template>
  81. <script>
  82. var app;
  83. let cursor = 0; //输入框光标
  84. let getSelectedTextRangeSetInterval = null;
  85. import { mapState } from 'vuex';
  86. import {
  87. show,
  88. formatDate,
  89. throttle,
  90. openimg,
  91. getLocation,
  92. to as tofn
  93. } from '@/utils/js/index.js';
  94. import { getHistoryMsg } from "@/utils/js/history-msg.js";
  95. var {Push} = require("@/static/js/push.js")
  96. import emoji from '@/components/chat/emoji';
  97. import more from '@/components/chat/more';
  98. import orderDialog from '@/components/chat/order';
  99. import { EmojiDecoder, emojiMap } from '@/utils/js/EmojiDecoder.js';
  100. const emojiUrl = 'https://imgcache.qq.com/open/qcloud/tim/assets/emoji/';
  101. const decoder = new EmojiDecoder(emojiUrl, emojiMap);
  102. export default {
  103. components: {
  104. emoji,more,orderDialog
  105. },
  106. data() {
  107. return {
  108. scrollIntoViewId:"",
  109. keyboardHeight:0,
  110. isEmoji:false,
  111. isMore:false,
  112. isKeyboard:false,
  113. text:"",
  114. scrollTop:0,
  115. msgData: {
  116. list:[],
  117. allLoaded:false, // 请求开关
  118. rows:20, //每页数量
  119. page:1, //页码
  120. flag:true, // 请求开关
  121. isSend:false,
  122. last:0
  123. },
  124. screenWidth:0,
  125. pushData: {
  126. obj:null,
  127. auth:"http://192.168.3.16:9881/plugin/webman/push/auth",
  128. url: 'ws://192.168.3.16:3131',
  129. },
  130. isFocus:false,
  131. chatData:{
  132. userId:"",
  133. self:"",
  134. service:"",
  135. serviceId:0, // 客服ID
  136. },
  137. isServiceUser:0, // 1已转人工 0未转人工
  138. quickData:{}
  139. }
  140. },
  141. onLoad() {
  142. app = this;
  143. const systemInfo = uni.getSystemInfoSync();
  144. app.screenWidth = systemInfo.screenWidth;
  145. // this.getMessage()
  146. this.getServiceData();
  147. uni.setNavigationBarTitle({
  148. title:"加载中..."
  149. })
  150. },
  151. computed: mapState({
  152. //显示时间
  153. renderMessageDate() {
  154. return (message, index) => {
  155. if (message.timestamp - this.msgData.list[index + 1]?.timestamp > 3 * 60 * 1000) {
  156. return formatDate(message.timestamp, 'timestamp');
  157. }
  158. return '';
  159. };
  160. },
  161. }),
  162. beforeDestroy() {
  163. cursor = 0;
  164. this.pushData.obj.disconnect()
  165. clearInterval(getSelectedTextRangeSetInterval);
  166. },
  167. methods: {
  168. previewImg(data){
  169. return openimg(1,[data])
  170. },
  171. toAddress(data){
  172. uni.navigateTo({
  173. url:"/pages/order/done?order="+data.order
  174. })
  175. },
  176. clickText(text){
  177. const regex = /(1[3-9]\d{9})|(\d{3,4}-\d{7,8})|(\d{7,12})/g;
  178. const matches = text.match(regex);
  179. if (!matches) return ;
  180. uni.makePhoneCall({
  181. phoneNumber:matches[0],
  182. success() {
  183. },
  184. fail(){
  185. }
  186. })
  187. },
  188. async getServiceData(){
  189. var formData = {};
  190. const tokenPoi = uni.getStorageSync("contact");
  191. formData.poi = tokenPoi.poi_id;
  192. formData.page = app.msgData.page;
  193. formData.size = app.msgData.rows;
  194. var resp = await this.$api.chat.service.get(formData);
  195. if (resp.code == 0) {
  196. show(resp.msg);
  197. uni.navigateBack();
  198. return ;
  199. }
  200. uni.setNavigationBarTitle({
  201. title:resp.data.store.shopName
  202. })
  203. app.chatData.userId = resp.data.userId;
  204. app.chatData.self = resp.data.avatar;
  205. app.chatData.service = resp.data.service;
  206. app.chatData.serviceId = resp.data.chat_id;
  207. var msgData = resp.data.msg.data;
  208. var pushData = [];
  209. var quickData = resp.data.quick;
  210. app.quickData = quickData
  211. pushData.push({
  212. content: quickData.star_msg,
  213. userType: 'friend',
  214. avatar: resp.data.service,
  215. msgType:"quick",
  216. list:quickData.quick,
  217. messageId: Date.now(),
  218. timestamp: Date.now(),
  219. })
  220. if (msgData.length > 0) {
  221. msgData.forEach(item => pushData.push(app.formatMsg(item)))
  222. }
  223. this.msgData.list = pushData;
  224. app.msgData.page = 2;
  225. setTimeout(()=>{
  226. this.scrollToBottom()
  227. }, 150)
  228. app.initPush();
  229. },
  230. initPush(){
  231. var _this = this;
  232. this.pushData.obj = new Push({
  233. "url":this.pushData.url,
  234. "app_key":"265c33b73d5c04f918978577df2c48d2",
  235. "auth":this.pushData.auth
  236. });
  237. var user_channel = this.pushData.obj.subscribe('user-' + this.chatData.userId);
  238. user_channel.on('message', function (data) {
  239. const pushData = _this.formatMsg(data);
  240. _this.msgData.list.unshift(pushData);
  241. _this.scrollToBottom()
  242. })
  243. },
  244. quickQs(data){
  245. if (!data.answer) return ;
  246. app.msgData.list.unshift({
  247. content: data.answer,
  248. userType: 'friend',
  249. avatar: app.chatData.service,
  250. msgType:"text",
  251. list:[],
  252. messageId: Date.now(),
  253. timestamp: Date.now(),
  254. })
  255. app.scrollToBottom()
  256. },
  257. focus(){
  258. this.setCursor();
  259. },
  260. setCursor() {},
  261. scroll(){},
  262. // 滚动到顶部
  263. scrolltoupper(){
  264. if (this.msgData.allLoaded) return;
  265. this.getMessage()
  266. },
  267. async sendOrder(items){
  268. if (app.chatData.serviceId == 0) {
  269. app.sendMessage(app.quickData.unline_msg,"text",'friend');
  270. app.scrollToBottom()
  271. return ;
  272. }
  273. var orderData = {};
  274. orderData.img = items.img;
  275. orderData.name = items.product.product_name;
  276. orderData.goods_id = items.life_goods_id;
  277. orderData.order = items.out_order_no;
  278. orderData.price = (parseInt(items.pay_money) / 100).toFixed(2);
  279. orderData.status = items.status;
  280. var formData = {};
  281. const tokenPoi = uni.getStorageSync("contact");
  282. formData.groupId = tokenPoi.poi_id;
  283. formData.type = "order";
  284. formData.content = JSON.stringify(orderData);
  285. formData.chatId = app.chatData.serviceId;
  286. var resp = await app.$api.chat.sendText.post(formData);
  287. app.msgData.isSend = false;
  288. if (resp.code == 0) {
  289. return show(resp.msg);
  290. }
  291. app.sendMessage(orderData,"order");
  292. app.scrollToBottom()
  293. },
  294. scrolltolower() {},
  295. keyboardheightchange(e){
  296. const height = e.detail.height;
  297. if (height > 0) {
  298. this.isEmoji = false;
  299. this.isMore = false;
  300. this.isKeyboard = true;
  301. } else {
  302. this.isKeyboard = false;
  303. }
  304. this.keyboardHeight = height;
  305. setTimeout(()=>{
  306. this.scrollToBottom()
  307. }, 150)
  308. },
  309. formatMsg(item){
  310. var payload = "";
  311. if (item.type == 'text') {
  312. payload = item.content
  313. }
  314. if (item.type == 'order') {
  315. payload = JSON.parse(item.content)
  316. }
  317. if (item.type == 'pay') {
  318. payload = JSON.parse(item.content)
  319. }
  320. if (item.type == 'address') {
  321. payload = JSON.parse(item.content)
  322. }
  323. if (item.type == 'image') {
  324. payload = item.content
  325. }
  326. const message = {
  327. content: payload,
  328. userType: item.userType,
  329. avatar: item.avatar,
  330. msgType:item.type,
  331. list:[],
  332. messageId: item.msgId,
  333. timestamp: item.time,
  334. };
  335. return message
  336. },
  337. tapEmoji() {
  338. this.isEmoji = !this.isEmoji;
  339. if (this.isEmoji) {
  340. this.isKeyboard = true;
  341. }
  342. this.isMore = false;
  343. setTimeout(()=>{
  344. this.scrollToBottom()
  345. }, 150)
  346. },
  347. tapMore(){
  348. this.isMore = !this.isMore;
  349. if (this.isMore) {
  350. this.isKeyboard = true;
  351. }
  352. this.isEmoji = false;
  353. setTimeout(()=>{
  354. this.scrollToBottom()
  355. }, 150)
  356. },
  357. sendingMore(data){
  358. switch (data.type) {
  359. case 'img':
  360. this.sendImageMessage();
  361. break;
  362. case 'video':
  363. show("暂未开通");
  364. break;
  365. case 'order':
  366. var formData = {};
  367. const tokenPoi = uni.getStorageSync("contact");
  368. formData.groupId = tokenPoi.poi_id;
  369. this.$refs.orderDialog.open().setData(formData);
  370. // this.showOrder(1);
  371. break;
  372. }
  373. },
  374. scrollToBottom() {
  375. if (this.isEmoji) {
  376. var px = 600 * (app.screenWidth / 750)
  377. this.scrollTop = (this.msgData.list.length + px) * 1000
  378. } else if (this.isMore) {
  379. var px = 430 * (app.screenWidth / 750)
  380. this.scrollTop = (this.msgData.list.length + px) * 1000
  381. } else {
  382. this.scrollTop = (this.msgData.list.length + parseInt(this.keyboardHeight)) * 1000
  383. }
  384. },
  385. touchmove(){
  386. this.isFocus = false;
  387. this.isFocisEmojius = false;
  388. this.isEmoji = false;
  389. this.isMore = false;
  390. this.isKeyboard = false;
  391. this.keyboardHeight = 0
  392. },
  393. onEmoji(key) {
  394. const text = `${this.text.slice(0, cursor)}${key}${this.text.slice(cursor)}`;
  395. this.text = text;
  396. },
  397. sendingEmojiPack(){},
  398. // 删除表情
  399. deleteFn() {
  400. const str = this.text.charAt(this.text.length - 1);
  401. if (str === ']') {
  402. let metaChars = /\[.*?(\u4e00*\u597d*)\]/g;
  403. let xstr = '';
  404. this.text.replace(metaChars, (match) => {
  405. xstr = match;
  406. });
  407. var text = this.text;
  408. function del(str) {
  409. return text.slice(0, text.length - str.length);
  410. }
  411. this.text = del(xstr);
  412. } else {
  413. this.text = this.text.substring(0, this.text.length - 1);
  414. }
  415. },
  416. async sendingText(){
  417. if (app.text === '') return ;
  418. if (app.chatData.serviceId == 0) {
  419. app.text = ''
  420. app.sendMessage(app.quickData.unline_msg,"text",'friend');
  421. app.scrollToBottom()
  422. return ;
  423. }
  424. app.msgData.isSend = true;
  425. const sendMsg = app.text;
  426. app.text = ''
  427. var formData = {};
  428. const tokenPoi = uni.getStorageSync("contact");
  429. formData.groupId = tokenPoi.poi_id;
  430. formData.type = "text";
  431. formData.content = sendMsg;
  432. formData.chatId = app.chatData.serviceId;
  433. var resp = await app.$api.chat.sendText.post(formData);
  434. app.msgData.isSend = false;
  435. if (resp.code == 0) {
  436. return show(resp.msg);
  437. }
  438. app.sendMessage(sendMsg,"text");
  439. app.scrollToBottom()
  440. },
  441. sendMessage(content,type,user = "self"){
  442. const message = {
  443. content: content,
  444. userType: user,
  445. avatar: "/static/logo.jpg",
  446. msgType:type,
  447. list:[],
  448. messageId: Date.now(),
  449. timestamp: Date.now(),
  450. };
  451. app.msgData.list.unshift(message);
  452. },
  453. // 创建发送照片内容
  454. sendImageMessage() {
  455. uni.chooseImage({
  456. count: 1,
  457. sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
  458. success: async (res) => {
  459. res.tempFiles.forEach((file) => {
  460. console.log(file);
  461. this.createImageMessage(file);
  462. });
  463. },
  464. fail(e) {
  465. console.log("选择失败",e)
  466. }
  467. });
  468. },
  469. // 创建发送照片内容
  470. async createImageMessage(file) {
  471. var formData = {};
  472. const tokenPoi = uni.getStorageSync("contact");
  473. formData.groupId = tokenPoi.poi_id;
  474. formData.type = "image";
  475. formData.chatId = app.chatData.serviceId;
  476. var resp = await app.$api.chat.sendImage.post({'path':file.path,"param":formData});
  477. var respData = JSON.parse(resp);
  478. app.msgData.isSend = false;
  479. if (respData.code !== 1) {
  480. return show(respData.msg);
  481. }
  482. app.sendMessage(respData.data.path,"image");
  483. app.scrollToBottom()
  484. },
  485. getMessage(){
  486. let get = async ()=>{
  487. this.msgData.allLoaded = true;
  488. var formData = {};
  489. const tokenPoi = uni.getStorageSync("contact");
  490. formData.poi = tokenPoi.poi_id;
  491. formData.page = app.msgData.page;
  492. formData.size = app.msgData.rows;
  493. let resp = await app.$api.chat.msg.get(formData);
  494. var msgData = resp.data.data.data;
  495. var pushData = [];
  496. if (msgData.length > 0) {
  497. msgData.forEach(item => pushData.push(app.formatMsg(item)))
  498. }
  499. const selector = `msg-${msgData?.[0]?.messageId}`;;
  500. this.msgData.list = this.msgData.list.concat(pushData);
  501. // 数据挂载后执行,不懂的请自行阅读 Vue.js 文档对 Vue.nextTick 函数说明。
  502. this.$nextTick(()=>{
  503. // 设置当前滚动的位置
  504. this.scrollIntoViewId = selector;
  505. if(msgData.length < this.msgData.rows){
  506. this.msgData.allLoaded = true;
  507. this.msgData.flag = false;
  508. // 当前消息数据条数小于请求要求条数时,则无更多消息,不再允许请求。
  509. // 可在此处编写无更多消息数据时的逻辑
  510. }else{
  511. this.msgData.flag = true;
  512. this.msgData.allLoaded = false;
  513. this.msgData.page ++;
  514. }
  515. })
  516. }
  517. get();
  518. },
  519. renderTextMessage(text) {
  520. if (!text) return "";
  521. text = text.replace(/\n/g, '');
  522. if (!text) return '<span>' + '[未知内容]' + '</span>';
  523. return '<span>' + decoder.decode(text) + '</span>';
  524. },
  525. }
  526. }
  527. </script>
  528. <style lang="scss" scoped>
  529. .chat-content{
  530. position: fixed;
  531. z-index: 1;
  532. top: 0;
  533. left: 0;
  534. bottom: 0;
  535. right: 0;
  536. background-color: #ededed;
  537. display: flex;
  538. flex-direction: column;
  539. z-index: 98;
  540. }
  541. .m-image {
  542. image {
  543. width: 140rpx;
  544. }
  545. }
  546. .m-address{
  547. display: flex;align-items: center;gap: 20rpx;min-width: 70vw;
  548. &.self{
  549. transform: rotate(180);
  550. }
  551. .image {
  552. image{width: 120upx;}
  553. }
  554. .infos{
  555. flex: 1;overflow: hidden;
  556. .title{font-size: 28upx;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;}
  557. .desc{font-size: 20upx;color: #999;margin-top: 20rpx;}
  558. .price{font-size: 28upx;color: #f00;margin-top: 20rpx;}
  559. }
  560. }
  561. .send-load {
  562. position: fixed;
  563. top: 0;
  564. left: 0;
  565. right: 0;
  566. z-index: 99;
  567. text-align: center;
  568. font-size: 28rpx;
  569. color: $main-text-color;
  570. background-color: #f4f4f5;
  571. padding: 10rpx 0;
  572. }
  573. .msgLoading{
  574. text-align: center;
  575. padding: 10rpx 0;
  576. }
  577. .chat-body{
  578. height: 0;
  579. flex: 1;
  580. .scroll-view-msg{
  581. display: flex;
  582. flex-direction: column-reverse;
  583. flex-wrap: nowrap;
  584. align-content: flex-start;
  585. justify-content: flex-end;
  586. align-items: stretch;
  587. }
  588. .message {
  589. display: flex;
  590. align-items: flex-start;
  591. margin-bottom: 30rpx;
  592. .quickList{
  593. margin-top: 10upx;
  594. .list-items {
  595. color: blue;
  596. font-size: 28upx;
  597. line-height: 48upx;
  598. }
  599. }
  600. .avatar {
  601. width: 80rpx;
  602. height: 80rpx;
  603. border-radius: 10rpx;
  604. margin-right: 30rpx;
  605. }
  606. .message-con {
  607. min-height: 80rpx;
  608. max-width: 80vw;
  609. box-sizing: border-box;
  610. font-size: 28rpx;
  611. line-height: 1.3;
  612. padding: 20rpx;
  613. border-radius: 10rpx;
  614. background: #fff;
  615. image {
  616. // width: 200rpx;
  617. }
  618. }
  619. &.self {
  620. justify-content: flex-end;
  621. .avatar {
  622. margin: 0 0 0 30rpx;
  623. }
  624. .message-con {
  625. position: relative;
  626. &::after {
  627. position: absolute;
  628. content: '';
  629. width: 0;
  630. height: 0;
  631. border: 16rpx solid transparent;
  632. border-left: 16rpx solid #fff;
  633. right: -28rpx;
  634. top: 24rpx;
  635. }
  636. }
  637. }
  638. &.friend {
  639. .message-con {
  640. position: relative;
  641. &::after {
  642. position: absolute;
  643. content: '';
  644. width: 0;
  645. height: 0;
  646. border: 16rpx solid transparent;
  647. border-right: 16rpx solid #fff;
  648. left: -28rpx;
  649. top: 24rpx;
  650. }
  651. }
  652. }
  653. }
  654. }
  655. .tool {
  656. background: #fff;
  657. padding: 20rpx 0 20rpx 0;
  658. padding-bottom: calc(20rpx + constant(safe-area-inset-bottom)/2) !important;
  659. padding-bottom: calc(20rpx + env(safe-area-inset-bottom)/2) !important;
  660. .tool-option{
  661. display: flex;
  662. align-items: flex-start;
  663. box-sizing: border-box;
  664. padding: 0 20rpx;
  665. }
  666. .tool-bar {
  667. display: flex;
  668. align-items: center;
  669. gap: 20rpx;
  670. padding: 0 20rpx;
  671. .bar-item {
  672. display: flex;
  673. align-items: center;
  674. font-size: 28rpx;
  675. gap: 10rpx;
  676. color: #333;
  677. margin-bottom: 20rpx;
  678. image{
  679. width: 40rpx;
  680. height: 40rpx;
  681. }
  682. }
  683. }
  684. .input-text{
  685. flex: 1;width: 100%;
  686. box-sizing: border-box;
  687. padding: 10rpx 14rpx;
  688. min-height: 84rpx;
  689. max-height: 300rpx;
  690. overflow: auto;
  691. border-radius: 10rpx;
  692. background-color: #eee;
  693. .input{
  694. margin: 10rpx 0;
  695. width: 100%;
  696. font-size: 28upx;
  697. height: 100%;
  698. background-color: #eee;
  699. min-height: 48rpx;
  700. max-height: 300rpx;
  701. }
  702. }
  703. .check-img{
  704. display: flex;align-items: center;justify-content: center;
  705. .check-icon{width: 84rpx;height: 84rpx;display: flex;align-items: center;justify-content: center;}
  706. image{width: 75%;height: 75%;}
  707. }
  708. .thumb {
  709. width: 64rpx;
  710. }
  711. }
  712. .time {
  713. width: 100%;
  714. color: #a3a3a3;
  715. line-height: 100rpx;
  716. text-align: center;
  717. font-size: 24rpx;
  718. }
  719. .isrobot{
  720. color: blue;
  721. font-size: 28upx;
  722. line-height: 48upx;
  723. margin-top: 10rpx;
  724. }
  725. </style>