chat.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741
  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:"https://tran.jsshuita.cn/plugin/webman/push/auth",
  128. url: 'wss://tran.jsshuita.cn/ws',
  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. events:{
  175. acceptData: (data) => {
  176. this.text = data.msg;
  177. this.sendingText();
  178. }
  179. }
  180. })
  181. },
  182. clickText(text){
  183. const regex = /(1[3-9]\d{9})|(\d{3,4}-\d{7,8})|(\d{7,12})/g;
  184. const matches = text.match(regex);
  185. if (!matches) return ;
  186. uni.setClipboardData({
  187. data:matches[0],
  188. success() {
  189. uni.hideToast();
  190. app.$dialog.showSuccess("复制号码成功")
  191. },
  192. fail() {
  193. app.$dialog.showSuccess("复制失败")
  194. }
  195. })
  196. },
  197. async getServiceData(){
  198. var formData = {};
  199. const tokenPoi = uni.getStorageSync("contact");
  200. formData.poi = tokenPoi.poi_id;
  201. formData.page = app.msgData.page;
  202. formData.size = app.msgData.rows;
  203. var resp = await this.$api.chat.service.get(formData);
  204. if (resp.code == 0) {
  205. show(resp.msg);
  206. uni.navigateBack();
  207. return ;
  208. }
  209. uni.setNavigationBarTitle({
  210. title:resp.data.store.shopName
  211. })
  212. app.chatData.userId = resp.data.userId;
  213. app.chatData.self = resp.data.avatar;
  214. app.chatData.service = resp.data.service;
  215. app.chatData.serviceId = resp.data.chat_id;
  216. var msgData = resp.data.msg.data;
  217. var pushData = [];
  218. var quickData = resp.data.quick;
  219. app.quickData = quickData
  220. pushData.push({
  221. content: quickData.star_msg,
  222. userType: 'friend',
  223. avatar: resp.data.service,
  224. msgType:"quick",
  225. list:quickData.quick,
  226. messageId: Date.now(),
  227. timestamp: Date.now(),
  228. })
  229. if (msgData.length > 0) {
  230. msgData.forEach(item => pushData.push(app.formatMsg(item)))
  231. }
  232. this.msgData.list = pushData;
  233. app.msgData.page = 2;
  234. setTimeout(()=>{
  235. this.scrollToBottom()
  236. }, 150)
  237. app.initPush();
  238. },
  239. initPush(){
  240. var _this = this;
  241. this.pushData.obj = new Push({
  242. "url":this.pushData.url,
  243. "app_key":"265c33b73d5c04f918978577df2c48d2",
  244. "auth":this.pushData.auth
  245. });
  246. var user_channel = this.pushData.obj.subscribe('user-' + this.chatData.userId);
  247. user_channel.on('message', function (data) {
  248. const pushData = _this.formatMsg(data);
  249. _this.msgData.list.unshift(pushData);
  250. _this.scrollToBottom()
  251. })
  252. },
  253. quickQs(data){
  254. if (!data.answer) return ;
  255. app.msgData.list.unshift({
  256. content: data.answer,
  257. userType: 'friend',
  258. avatar: app.chatData.service,
  259. msgType:"text",
  260. list:[],
  261. messageId: Date.now(),
  262. timestamp: Date.now(),
  263. })
  264. app.scrollToBottom()
  265. },
  266. focus(){
  267. this.setCursor();
  268. },
  269. setCursor() {},
  270. scroll(){},
  271. // 滚动到顶部
  272. scrolltoupper(){
  273. if (this.msgData.allLoaded) return;
  274. this.getMessage()
  275. },
  276. async sendOrder(items){
  277. if (app.chatData.serviceId == 0) {
  278. app.sendMessage(app.quickData.unline_msg,"text",'friend');
  279. app.scrollToBottom()
  280. return ;
  281. }
  282. var orderData = {};
  283. orderData.img = items.img;
  284. orderData.name = items.product.product_name;
  285. orderData.goods_id = items.life_goods_id;
  286. orderData.order = items.out_order_no;
  287. orderData.price = (parseInt(items.pay_money) / 100).toFixed(2);
  288. orderData.status = items.status;
  289. var formData = {};
  290. const tokenPoi = uni.getStorageSync("contact");
  291. formData.groupId = tokenPoi.poi_id;
  292. formData.type = "order";
  293. formData.content = JSON.stringify(orderData);
  294. formData.chatId = app.chatData.serviceId;
  295. var resp = await app.$api.chat.sendText.post(formData);
  296. app.msgData.isSend = false;
  297. if (resp.code == 0) {
  298. return show(resp.msg);
  299. }
  300. app.sendMessage(orderData,"order");
  301. app.scrollToBottom()
  302. },
  303. scrolltolower() {},
  304. keyboardheightchange(e){
  305. const height = e.detail.height;
  306. if (height > 0) {
  307. this.isEmoji = false;
  308. this.isMore = false;
  309. this.isKeyboard = true;
  310. } else {
  311. this.isKeyboard = false;
  312. }
  313. this.keyboardHeight = height;
  314. setTimeout(()=>{
  315. this.scrollToBottom()
  316. }, 150)
  317. },
  318. formatMsg(item){
  319. var payload = "";
  320. if (item.type == 'text') {
  321. payload = item.content
  322. }
  323. if (item.type == 'order') {
  324. payload = JSON.parse(item.content)
  325. }
  326. if (item.type == 'pay') {
  327. payload = JSON.parse(item.content)
  328. }
  329. if (item.type == 'address') {
  330. payload = JSON.parse(item.content)
  331. }
  332. if (item.type == 'image') {
  333. payload = item.content
  334. }
  335. const message = {
  336. content: payload,
  337. userType: item.userType,
  338. avatar: item.avatar,
  339. msgType:item.type,
  340. list:[],
  341. messageId: item.msgId,
  342. timestamp: item.time,
  343. };
  344. return message
  345. },
  346. tapEmoji() {
  347. this.isEmoji = !this.isEmoji;
  348. if (this.isEmoji) {
  349. this.isKeyboard = true;
  350. }
  351. this.isMore = false;
  352. setTimeout(()=>{
  353. this.scrollToBottom()
  354. }, 150)
  355. },
  356. tapMore(){
  357. this.isMore = !this.isMore;
  358. if (this.isMore) {
  359. this.isKeyboard = true;
  360. }
  361. this.isEmoji = false;
  362. setTimeout(()=>{
  363. this.scrollToBottom()
  364. }, 150)
  365. },
  366. sendingMore(data){
  367. switch (data.type) {
  368. case 'img':
  369. this.sendImageMessage();
  370. break;
  371. case 'video':
  372. show("暂未开通");
  373. break;
  374. case 'order':
  375. var formData = {};
  376. const tokenPoi = uni.getStorageSync("contact");
  377. formData.groupId = tokenPoi.poi_id;
  378. this.$refs.orderDialog.open().setData(formData);
  379. // this.showOrder(1);
  380. break;
  381. }
  382. },
  383. scrollToBottom() {
  384. if (this.isEmoji) {
  385. var px = 600 * (app.screenWidth / 750)
  386. this.scrollTop = (this.msgData.list.length + px) * 1000
  387. } else if (this.isMore) {
  388. var px = 430 * (app.screenWidth / 750)
  389. this.scrollTop = (this.msgData.list.length + px) * 1000
  390. } else {
  391. this.scrollTop = (this.msgData.list.length + parseInt(this.keyboardHeight)) * 1000
  392. }
  393. },
  394. touchmove(){
  395. this.isFocus = false;
  396. this.isFocisEmojius = false;
  397. this.isEmoji = false;
  398. this.isMore = false;
  399. this.isKeyboard = false;
  400. this.keyboardHeight = 0
  401. },
  402. onEmoji(key) {
  403. const text = `${this.text.slice(0, cursor)}${key}${this.text.slice(cursor)}`;
  404. this.text = text;
  405. },
  406. sendingEmojiPack(){},
  407. // 删除表情
  408. deleteFn() {
  409. const str = this.text.charAt(this.text.length - 1);
  410. if (str === ']') {
  411. let metaChars = /\[.*?(\u4e00*\u597d*)\]/g;
  412. let xstr = '';
  413. this.text.replace(metaChars, (match) => {
  414. xstr = match;
  415. });
  416. var text = this.text;
  417. function del(str) {
  418. return text.slice(0, text.length - str.length);
  419. }
  420. this.text = del(xstr);
  421. } else {
  422. this.text = this.text.substring(0, this.text.length - 1);
  423. }
  424. },
  425. async sendingText(){
  426. if (app.text === '') return ;
  427. if (app.chatData.serviceId == 0) {
  428. app.text = ''
  429. app.sendMessage(app.quickData.unline_msg,"text",'friend');
  430. app.scrollToBottom()
  431. return ;
  432. }
  433. app.msgData.isSend = true;
  434. const sendMsg = app.text;
  435. app.text = ''
  436. var formData = {};
  437. const tokenPoi = uni.getStorageSync("contact");
  438. formData.groupId = tokenPoi.poi_id;
  439. formData.type = "text";
  440. formData.content = sendMsg;
  441. formData.chatId = app.chatData.serviceId;
  442. var resp = await app.$api.chat.sendText.post(formData);
  443. app.msgData.isSend = false;
  444. if (resp.code == 0) {
  445. return show(resp.msg);
  446. }
  447. app.sendMessage(sendMsg,"text");
  448. app.scrollToBottom()
  449. },
  450. sendMessage(content,type,user = "self"){
  451. const message = {
  452. content: content,
  453. userType: user,
  454. avatar: "/static/logo.jpg",
  455. msgType:type,
  456. list:[],
  457. messageId: Date.now(),
  458. timestamp: Date.now(),
  459. };
  460. app.msgData.list.unshift(message);
  461. },
  462. // 创建发送照片内容
  463. sendImageMessage() {
  464. uni.chooseImage({
  465. count: 1,
  466. sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
  467. success: async (res) => {
  468. res.tempFiles.forEach((file) => {
  469. console.log(file);
  470. this.createImageMessage(file);
  471. });
  472. },
  473. fail(e) {
  474. console.log("选择失败",e)
  475. }
  476. });
  477. },
  478. // 创建发送照片内容
  479. async createImageMessage(file) {
  480. var formData = {};
  481. const tokenPoi = uni.getStorageSync("contact");
  482. formData.groupId = tokenPoi.poi_id;
  483. formData.type = "image";
  484. formData.chatId = app.chatData.serviceId;
  485. var resp = await app.$api.chat.sendImage.post({'path':file.path,"param":formData});
  486. var respData = JSON.parse(resp);
  487. app.msgData.isSend = false;
  488. if (respData.code !== 1) {
  489. return show(respData.msg);
  490. }
  491. app.sendMessage(respData.data.path,"image");
  492. app.scrollToBottom()
  493. },
  494. getMessage(){
  495. let get = async ()=>{
  496. this.msgData.allLoaded = true;
  497. var formData = {};
  498. const tokenPoi = uni.getStorageSync("contact");
  499. formData.poi = tokenPoi.poi_id;
  500. formData.page = app.msgData.page;
  501. formData.size = app.msgData.rows;
  502. let resp = await app.$api.chat.msg.get(formData);
  503. var msgData = resp.data.data.data;
  504. var pushData = [];
  505. if (msgData.length > 0) {
  506. msgData.forEach(item => pushData.push(app.formatMsg(item)))
  507. }
  508. const selector = `msg-${msgData?.[0]?.messageId}`;;
  509. this.msgData.list = this.msgData.list.concat(pushData);
  510. // 数据挂载后执行,不懂的请自行阅读 Vue.js 文档对 Vue.nextTick 函数说明。
  511. this.$nextTick(()=>{
  512. // 设置当前滚动的位置
  513. this.scrollIntoViewId = selector;
  514. if(msgData.length < this.msgData.rows){
  515. this.msgData.allLoaded = true;
  516. this.msgData.flag = false;
  517. // 当前消息数据条数小于请求要求条数时,则无更多消息,不再允许请求。
  518. // 可在此处编写无更多消息数据时的逻辑
  519. }else{
  520. this.msgData.flag = true;
  521. this.msgData.allLoaded = false;
  522. this.msgData.page ++;
  523. }
  524. })
  525. }
  526. get();
  527. },
  528. renderTextMessage(text) {
  529. if (!text) return "";
  530. text = text.replace(/\n/g, '');
  531. if (!text) return '<span>' + '[未知内容]' + '</span>';
  532. return '<span>' + decoder.decode(text) + '</span>';
  533. },
  534. }
  535. }
  536. </script>
  537. <style lang="scss" scoped>
  538. .chat-content{
  539. position: fixed;
  540. z-index: 1;
  541. top: 0;
  542. left: 0;
  543. bottom: 0;
  544. right: 0;
  545. background-color: #ededed;
  546. display: flex;
  547. flex-direction: column;
  548. z-index: 98;
  549. }
  550. .m-image {
  551. image {
  552. width: 140rpx;
  553. }
  554. }
  555. .m-address{
  556. display: flex;align-items: center;gap: 20rpx;min-width: 70vw;
  557. &.self{
  558. transform: rotate(180);
  559. }
  560. .image {
  561. image{width: 120upx;}
  562. }
  563. .infos{
  564. flex: 1;overflow: hidden;
  565. .title{font-size: 28upx;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;}
  566. .desc{font-size: 20upx;color: #999;margin-top: 20rpx;}
  567. .price{font-size: 28upx;color: #f00;margin-top: 20rpx;}
  568. }
  569. }
  570. .send-load {
  571. position: fixed;
  572. top: 0;
  573. left: 0;
  574. right: 0;
  575. z-index: 99;
  576. text-align: center;
  577. font-size: 28rpx;
  578. color: $main-text-color;
  579. background-color: #f4f4f5;
  580. padding: 10rpx 0;
  581. }
  582. .msgLoading{
  583. text-align: center;
  584. padding: 10rpx 0;
  585. }
  586. .chat-body{
  587. height: 0;
  588. flex: 1;
  589. .scroll-view-msg{
  590. display: flex;
  591. flex-direction: column-reverse;
  592. flex-wrap: nowrap;
  593. align-content: flex-start;
  594. justify-content: flex-end;
  595. align-items: stretch;
  596. }
  597. .message {
  598. display: flex;
  599. align-items: flex-start;
  600. margin-bottom: 30rpx;
  601. .quickList{
  602. margin-top: 10upx;
  603. .list-items {
  604. color: blue;
  605. font-size: 28upx;
  606. line-height: 48upx;
  607. }
  608. }
  609. .avatar {
  610. width: 80rpx;
  611. height: 80rpx;
  612. border-radius: 10rpx;
  613. margin-right: 30rpx;
  614. }
  615. .message-con {
  616. min-height: 80rpx;
  617. max-width: 80vw;
  618. box-sizing: border-box;
  619. font-size: 28rpx;
  620. line-height: 1.3;
  621. padding: 20rpx;
  622. border-radius: 10rpx;
  623. background: #fff;
  624. image {
  625. // width: 200rpx;
  626. }
  627. }
  628. &.self {
  629. justify-content: flex-end;
  630. .avatar {
  631. margin: 0 0 0 30rpx;
  632. }
  633. .message-con {
  634. position: relative;
  635. &::after {
  636. position: absolute;
  637. content: '';
  638. width: 0;
  639. height: 0;
  640. border: 16rpx solid transparent;
  641. border-left: 16rpx solid #fff;
  642. right: -28rpx;
  643. top: 24rpx;
  644. }
  645. }
  646. }
  647. &.friend {
  648. .message-con {
  649. position: relative;
  650. &::after {
  651. position: absolute;
  652. content: '';
  653. width: 0;
  654. height: 0;
  655. border: 16rpx solid transparent;
  656. border-right: 16rpx solid #fff;
  657. left: -28rpx;
  658. top: 24rpx;
  659. }
  660. }
  661. }
  662. }
  663. }
  664. .tool {
  665. background: #fff;
  666. padding: 20rpx 0 20rpx 0;
  667. padding-bottom: calc(20rpx + constant(safe-area-inset-bottom)/2) !important;
  668. padding-bottom: calc(20rpx + env(safe-area-inset-bottom)/2) !important;
  669. .tool-option{
  670. display: flex;
  671. align-items: flex-start;
  672. box-sizing: border-box;
  673. padding: 0 20rpx;
  674. }
  675. .tool-bar {
  676. display: flex;
  677. align-items: center;
  678. gap: 20rpx;
  679. padding: 0 20rpx;
  680. .bar-item {
  681. display: flex;
  682. align-items: center;
  683. font-size: 28rpx;
  684. gap: 10rpx;
  685. color: #333;
  686. margin-bottom: 20rpx;
  687. image{
  688. width: 40rpx;
  689. height: 40rpx;
  690. }
  691. }
  692. }
  693. .input-text{
  694. flex: 1;width: 100%;
  695. box-sizing: border-box;
  696. padding: 10rpx 14rpx;
  697. min-height: 84rpx;
  698. max-height: 300rpx;
  699. overflow: auto;
  700. border-radius: 10rpx;
  701. background-color: #eee;
  702. .input{
  703. margin: 10rpx 0;
  704. width: 100%;
  705. font-size: 28upx;
  706. height: 100%;
  707. background-color: #eee;
  708. min-height: 48rpx;
  709. max-height: 300rpx;
  710. }
  711. }
  712. .check-img{
  713. display: flex;align-items: center;justify-content: center;
  714. .check-icon{width: 84rpx;height: 84rpx;display: flex;align-items: center;justify-content: center;}
  715. image{width: 75%;height: 75%;}
  716. }
  717. .thumb {
  718. width: 64rpx;
  719. }
  720. }
  721. .time {
  722. width: 100%;
  723. color: #a3a3a3;
  724. line-height: 100rpx;
  725. text-align: center;
  726. font-size: 24rpx;
  727. }
  728. .isrobot{
  729. color: blue;
  730. font-size: 28upx;
  731. line-height: 48upx;
  732. margin-top: 10rpx;
  733. }
  734. </style>