chat.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683
  1. <template>
  2. <view>
  3. <view style="width: 100%;padding-bottom: 140rpx;">
  4. <view style="display: flex;flex-direction: column;" v-for="(item,index) in ListItem" :key='index'>
  5. <view style="margin-top: 15rpx;width: 100%;text-align: center;font-size: 26rpx;color: #999999;">
  6. {{item.createTime}}
  7. </view>
  8. <view v-if="item.sendType === 2" style="width: 83%;margin-right: 15%;">
  9. <view class="chat-listitem" style="float: left;margin-left: 10rpx;">
  10. <view>
  11. <image src="../../static/logo.png" class="chat-listitem-image"></image>
  12. </view>
  13. <view v-if="item.content && item.type === 1" class="chat-listitem-text1"
  14. style="margin-left: 20rpx;">{{item.content}}</view>
  15. <image @tap="viewImg(item.content)" v-if="item.content && item.type === 2" :src="item.content"
  16. style="height: 200rpx;width: 200rpx;margin-left: 20rpx;"></image>
  17. </view>
  18. </view>
  19. <view v-if="item.sendType === 1" style="width: 83%;margin-left: 15%;">
  20. <view class="chat-listitem" style="float: right;">
  21. <view v-if="item.content && item.type === 1" @longpress="copy(item.content)"
  22. class="chat-listitem-text" style="margin-right: 20rpx;">{{item.content}}</view>
  23. <view v-if="item.content && item.type === 4" @click="goShop(item.content[3])"
  24. style="width: 400rpx;background: #FFFFFF;height: max-content;margin-right: 20rpx;margin-top: 10rpx;border-radius: 20rpx;">
  25. <image :src="item.content[0]" class="chat-listitem-image-type4"
  26. style="width: 400rpx;height: 350rpx;"></image>
  27. <view style="padding: 10rpx;padding-bottom: 20rpx;">
  28. <view style="color: #ed5732;font-size: 34rpx;"><text style="font-size: 22rpx;">¥ </text>
  29. {{item.content[2]}}
  30. </view>
  31. <view
  32. style="overflow: hidden;text-overflow: ellipsis;display: -webkit-box;-webkit-line-clamp: 2;-webkit-box-orient: vertical;width: 100%;height: 75upx;">
  33. {{item.content[1]}}
  34. </view>
  35. </view>
  36. </view>
  37. <view v-if="item.content && item.type === 3"
  38. style="width: 500rpx;background: #FFFFFF;height: max-content;margin-right: 20rpx;margin-top: 10rpx;border-radius: 20rpx;padding: 15rpx 10rpx;">
  39. <view style="color: #000000;font-weight: 600;margin-left: 10rpx;">你正在咨询的订单</view>
  40. <view style="display: flex;">
  41. <image :src="item.content[0]" class="chat-listitem-image-type4"
  42. style="margin-left: 7rpx;margin-top: 20rpx;width: 110rpx;height: 110rpx;"></image>
  43. <view
  44. style="margin-top: 15rpx;padding: 10rpx 0rpx 5rpx 10rpx;width: 75%;background: #f5f5f5;margin-left: 10rpx;">
  45. <view
  46. style="font-size: 28rpx;overflow: hidden;text-overflow: ellipsis;display: -webkit-box;-webkit-line-clamp: 2;-webkit-box-orient: vertical;height: 75upx;width: 100%;">
  47. {{item.content[1]}}
  48. </view>
  49. <view style="color: #ed5732;font-size: 28rpx;"><text style="font-size: 22rpx;">¥
  50. </text>{{item.content[5]}}
  51. </view>
  52. </view>
  53. </view>
  54. <view style="color: #999999;margin-top: 10rpx;margin-left: 12rpx;">
  55. <view>订单编号:{{item.content[3]}}</view>
  56. <view style="margin-top: 10rpx;">创建时间:{{item.content[4]}}</view>
  57. </view>
  58. <view
  59. style="float: right;margin-right: 10rpx;margin-top: 15rpx;background: #F9221D;color: #FFFFFF;border-radius: 50rpx;width: 150rpx;height: 50rpx;font-size: 24rpx;text-align: center;line-height: 50rpx;"
  60. @click="goDingdanDetail(item.content[2])">查看</view>
  61. </view>
  62. <image @tap="viewImg(item.content)" v-if="item.content && item.type === 2" :src="item.content"
  63. style="height: 200rpx;width: 200rpx;margin-right: 20rpx;"></image>
  64. <view>
  65. <image v-if="item.chat.userHead" :src="item.chat.userHead" class="chat-listitem-image">
  66. </image>
  67. <image v-else src="../../static/logo.png" class="chat-listitem-image"></image>
  68. </view>
  69. </view>
  70. </view>
  71. <!-- <view v-if="item.sendType === 4" style="width: 83%;margin-left: 15%;">
  72. <view class="chat-listitem" style="float: right;">
  73. <view style="height: max-content;">
  74. <image :src="type4[0]" mode=""></image>
  75. </view>
  76. <image @tap="viewImg(item.content)" v-if="item.content && item.type === 2" :src="item.content" style="height: 200rpx;width: 170rpx;margin-right: 20rpx;"></image>
  77. <view>
  78. <image :src="item.chat.userHead" class="chat-listitem-image"></image>
  79. </view>
  80. </view>
  81. </view> -->
  82. </view>
  83. </view>
  84. <view v-if="ShopState"
  85. style="width: 95%;margin-left: 20rpx;height: 150upx;position: fixed;bottom: 120upx;z-index: 99;background-color: #FFFFFF;border-radius: 20rpx;">
  86. <view style="display: flex;width: 100%;color: #000000;padding: 20rpx;">
  87. <image :src="Shopimage" style="width: 110rpx;height: 110rpx;"></image>
  88. <view style="margin-left: 20rpx;width: 400rpx;">
  89. <view
  90. style="font-size: 34rpx;color: #000000;overflow: hidden;text-overflow: ellipsis;flex-wrap: nowrap;white-space: nowrap;width: 98%;">
  91. {{ShopTitle}}
  92. </view>
  93. <view style="margin-top: 20rpx;color: #ed5732;font-size: 34rpx;">¥{{Shopmoney}}</view>
  94. </view>
  95. <view style="text-align: right;">
  96. <image @click="ShopClose" src="../../static/images/msg/close.png"
  97. style="width: 30rpx;height: 30rpx;"></image>
  98. <view
  99. style="margin-top: 20rpx;background: #F9221D;color: #FFFFFF;border-radius: 50rpx;width: 150rpx;height: 50rpx;font-size: 24rpx;text-align: center;line-height: 50rpx;"
  100. @click="goMaijia">发送给商家</view>
  101. </view>
  102. </view>
  103. </view>
  104. <view v-if="orderState"
  105. style="width: 95%;margin-left: 20rpx;height: 150upx;position: fixed;bottom: 120upx;z-index: 99;background-color: #FFFFFF;border-radius: 20rpx;">
  106. <view style="display: flex;width: 100%;color: #000000;padding: 20rpx;">
  107. <image :src="orderimage" style="width: 110rpx;height: 110rpx;"></image>
  108. <view style="margin-left: 20rpx;width: 400rpx;">
  109. <view
  110. style="font-size: 34rpx;color: #000000;overflow: hidden;text-overflow: ellipsis;flex-wrap: nowrap;white-space: nowrap;width: 98%;">
  111. 你可能想咨询该订单</view>
  112. <view style="margin-top: 20rpx;color: #ed5732;font-size: 34rpx;">¥{{ordermoney}}</view>
  113. </view>
  114. <view style="text-align: right;">
  115. <image @click="orderClose" src="../../static/images/msg/close.png"
  116. style="width: 30rpx;height: 30rpx;"></image>
  117. <view
  118. style="margin-top: 20rpx;background: #F9221D;color: #FFFFFF;border-radius: 50rpx;width: 150rpx;height: 50rpx;font-size: 24rpx;text-align: center;line-height: 50rpx;"
  119. @click="goDingdan">发送订单</view>
  120. </view>
  121. </view>
  122. </view>
  123. <!-- 底部聊天输入框 -->
  124. <view class="input-box">
  125. <view class="justify-between padding-lr"
  126. style="display: flex;margin-top: 15rpx;width: 100%;background-color: #FFFFFF;padding-top: 4upx;">
  127. <image src="../../static/images/msg/add.png" @click="chooseImage(['album'])"
  128. style="width: 60rpx;height: 60rpx;margin-top: 8rpx;margin-right: 12rpx;"></image>
  129. <input confirm-type="send" @confirm='setChatSave(1)' type="text" v-model="content"
  130. style="width: 72%;height: 70rpx;background: #F5F5F5;margin: 4rpx 10rpx 0;border-radius: 70rpx;padding-left: 10rpx;" />
  131. <view class="save" @tap='setChatSave(1)'>发送</view>
  132. </view>
  133. </view>
  134. <!-- 权限说明弹窗 -->
  135. <u-popup mode="top" ref="permission">
  136. <view class="popup-content">
  137. <view class="popup-text-permission">选择/拍摄照片需要相机/相册权限,用于上传用户头像</view>
  138. </view>
  139. </u-popup>
  140. </view>
  141. </template>
  142. <script>
  143. import configdata from '../../common/config.js';
  144. export default {
  145. data() {
  146. return {
  147. connected: false,
  148. connecting: false,
  149. msg: false,
  150. type4: [],
  151. listRight: {
  152. chat: {
  153. userHead: ""
  154. },
  155. content: "",
  156. sendType: 1,
  157. type: 1
  158. },
  159. content: '',
  160. chatId: '',
  161. type: 1,
  162. ListItem: [],
  163. ShopState: false,
  164. ShopordersId: '',
  165. Shopimage: '',
  166. Shopmoney: '',
  167. ShopTitle: '',
  168. orderState: false,
  169. ordersId: '',
  170. orderimage: '',
  171. orderNum: '',
  172. ordermoney: '',
  173. orderTitle: '',
  174. orderCreateTime: '',
  175. className: '',
  176. Shopsales: '',
  177. hand: 1,
  178. index: 0,
  179. page: 0,
  180. size: 1000,
  181. countDown: ''
  182. };
  183. },
  184. computed: {
  185. showMsg() {
  186. if (this.connected) {
  187. if (this.msg) {
  188. return '收到消息:' + this.msg
  189. } else {
  190. return '等待接收消息'
  191. }
  192. } else {
  193. return '尚未连接'
  194. }
  195. }
  196. },
  197. onUnload() {
  198. uni.closeSocket()
  199. uni.hideLoading()
  200. },
  201. onLoad(d) {
  202. if (d.className) {
  203. this.className = d.className;
  204. if (d.className === 'shop') {
  205. this.ShopState = true;
  206. this.ShopordersId = d.ordersId;
  207. this.Shopimage = d.image;
  208. this.Shopmoney = d.money;
  209. this.Shopsales = d.sales;
  210. this.ShopTitle = d.title;
  211. } else if (d.className === 'order') {
  212. this.orderState = true;
  213. this.ordersId = d.id;
  214. this.orderimage = d.image;
  215. this.ordermoney = d.money;
  216. this.orderTitle = d.title;
  217. this.orderNum = d.orderNum;
  218. this.orderCreateTime = d.createTime;
  219. }
  220. }
  221. this.getChatSave();
  222. this.connect();
  223. },
  224. onShow() {
  225. if (this.connected || this.connecting) {
  226. } else {
  227. this.connect();
  228. }
  229. },
  230. onHide() {
  231. uni.closeSocket()
  232. },
  233. methods: {
  234. copy(content) {
  235. uni.showModal({
  236. title: '温馨提示',
  237. content: '确认要复制此文字吗?',
  238. showCancel: true,
  239. cancelText: '取消',
  240. confirmText: '确认',
  241. success: res => {
  242. if (res.confirm) {
  243. uni.setClipboardData({
  244. data: content,
  245. success: r => {
  246. this.$queue.showToast('复制成功');
  247. }
  248. });
  249. }
  250. }
  251. });
  252. },
  253. h5Copy(content) {
  254. if (!document.queryCommandSupported('copy')) {
  255. // 不支持
  256. return false
  257. }
  258. let textarea = document.createElement("textarea")
  259. textarea.value = content
  260. textarea.readOnly = "readOnly"
  261. document.body.appendChild(textarea)
  262. textarea.select() // 选择对象
  263. textarea.setSelectionRange(0, content.length) //核心
  264. let result = document.execCommand("copy") // 执行浏览器复制命令
  265. textarea.remove()
  266. return result
  267. },
  268. getDateDiff(data) {
  269. // 传进来的data必须是日期格式,不能是时间戳
  270. //var str = data;
  271. //将字符串转换成时间格式
  272. var timePublish = new Date(data);
  273. var timeNow = new Date();
  274. var minute = 1000 * 60;
  275. var hour = minute * 60;
  276. var day = hour * 24;
  277. var month = day * 30;
  278. var result = "2";
  279. var diffValue = timeNow - timePublish;
  280. var diffMonth = diffValue / month;
  281. var diffWeek = diffValue / (7 * day);
  282. var diffDay = diffValue / day;
  283. var diffHour = diffValue / hour;
  284. var diffMinute = diffValue / minute;
  285. if (diffMonth > 3) {
  286. result = timePublish.getFullYear() + "-";
  287. result += timePublish.getMonth() + "-";
  288. result += timePublish.getDate();
  289. } else if (diffMonth > 1) { //月
  290. result = data.substring(0, 10);
  291. } else if (diffWeek > 1) { //周
  292. result = data.substring(0, 10);
  293. } else if (diffDay > 1) { //天
  294. result = data.substring(0, 10);
  295. } else if (diffHour > 1) { //小时
  296. result = parseInt(diffHour) + "小时前";
  297. } else if (diffMinute > 1) { //分钟
  298. result = parseInt(diffMinute) + "分钟前";
  299. } else {
  300. result = "刚刚";
  301. }
  302. return result;
  303. },
  304. goDingdanDetail(id) {
  305. uni.navigateTo({
  306. url: '../member/orderdetail?id=' + id
  307. });
  308. },
  309. goShop(ordersId) {
  310. uni.navigateTo({
  311. url: './commoditydetail?ordersId=' + ordersId
  312. });
  313. },
  314. ShopClose() {
  315. this.ShopState = false;
  316. },
  317. orderClose() {
  318. this.orderState = false;
  319. },
  320. goDingdan() {
  321. this.orderState = false;
  322. this.setChatSave(3);
  323. },
  324. goMaijia() {
  325. this.ShopState = false;
  326. this.setChatSave(4);
  327. },
  328. connect() {
  329. let userId = this.$queue.getData('userId');
  330. if (this.connected || this.connecting) {
  331. uni.showModal({
  332. content: '正在连接或者已经连接,请勿重复连接',
  333. showCancel: false
  334. })
  335. return false
  336. }
  337. let token = uni.getStorageSync('token')
  338. this.connecting = true
  339. uni.showLoading({
  340. title: '连接中...'
  341. })
  342. uni.connectSocket({
  343. // url: 'wss://game.shengqianxiong.com.cn/wss/websocket/' + userId,
  344. // url: 'ws://192.168.1.17:8180/sqx_fast/websocket/' + userId,
  345. url: 'wss://zhaopin.xianmaxiong.com/wss/sqx_fast/websocket/' + userId,
  346. // url: this.config("WSHOST") + userId,
  347. data() {
  348. return {
  349. msg: 'Hello'
  350. }
  351. },
  352. header: {
  353. 'content-type': 'application/json',
  354. 'token': token
  355. },
  356. method: 'GET',
  357. success(res) {
  358. // 这里是接口调用成功的回调,不是连接成功的回调,请注意
  359. },
  360. fail(err) {
  361. // 这里是接口调用失败的回调,不是连接失败的回调,请注意
  362. }
  363. })
  364. uni.onSocketOpen((res) => {
  365. this.connecting = false
  366. this.connected = true
  367. uni.hideLoading()
  368. // uni.showToast({
  369. // icon: 'none',
  370. // title: '连接成功'
  371. // })
  372. console.log('onOpen', res);
  373. })
  374. uni.onSocketError((err) => {
  375. this.connecting = false
  376. this.connected = false
  377. uni.hideLoading()
  378. uni.showModal({
  379. content: '网络较差,请稍后再试',
  380. showCancel: false
  381. })
  382. console.log('onError', err);
  383. })
  384. uni.onSocketMessage((res) => {
  385. // let that = this;
  386. // let datas = JSON.parse(res.data)
  387. // let data = {
  388. // chat: {
  389. // userHead: '../../static/logo.png'
  390. // },
  391. // content: datas.content,
  392. // type: datas.type,
  393. // sendType: datas.sendType
  394. // }
  395. // that.ListItem.push(data);
  396. this.getTimeOrListItem1();
  397. console.log('onMessage', res)
  398. })
  399. uni.onSocketClose((res) => {
  400. this.connected = false
  401. this.startRecive = false
  402. this.msg = false
  403. console.log('onClose', res)
  404. })
  405. },
  406. close() {
  407. uni.closeSocket()
  408. },
  409. getTimeOrListItem1() {
  410. this.$Request.getT('/app/chats/list?chatId=' + this.chatId).then(
  411. res => {
  412. this.ListItem = [];
  413. if (res.data) {
  414. var time = '';
  415. res.data.forEach(d => {
  416. d.createTime = this.getDateDiff(d.createTime);
  417. if (d.createTime === time) {
  418. d.createTime = '';
  419. } else {
  420. time = d.createTime;
  421. }
  422. if (!d.chat.userHead) {
  423. // d.chat.userHead = '../../static/logo.png';
  424. let avatar = this.$queue.getData('avatar');
  425. d.chat.userHead = avatar
  426. }
  427. if (d.type === 4) {
  428. let data = d.content.split(',');
  429. d.content = data;
  430. }
  431. if (d.type === 3) {
  432. let data = d.content.split(',');
  433. d.content = data;
  434. }
  435. this.ListItem.push(d);
  436. });
  437. setTimeout(() => {
  438. uni.pageScrollTo({
  439. scrollTop: 99999,
  440. duration: 0
  441. });
  442. }, 50);
  443. }
  444. uni.hideLoading();
  445. });
  446. },
  447. getChatSave() {
  448. let userId = this.$queue.getData('userId');
  449. let phone = this.$queue.getData('phone');
  450. let userName = this.$queue.getData('userName');
  451. if (!phone) {
  452. phone = this.$queue.getData('userName');
  453. }
  454. let avatar = this.$queue.getData('avatar');
  455. let data = {
  456. userId: userId,
  457. userHead: avatar,
  458. userName: userName,
  459. storeId: '0',
  460. storeHead: '省钱兄电竞',
  461. storeName: ''
  462. }
  463. this.$Request.postJson('/app/chats/save', data).then(res => {
  464. if (res.status === 0) {
  465. this.chatId = res.data.chatId;
  466. uni.showLoading({
  467. title: '加载中...'
  468. });
  469. this.getTimeOrListItem1();
  470. }
  471. });
  472. },
  473. setChatSave(type) {
  474. //type:1文字 2图片
  475. if (type === 1 && this.content == '') {
  476. this.$queue.showToast('请输入聊天内容');
  477. return;
  478. }
  479. if (this.chatId == '' || this.chatId == undefined) {
  480. this.$queue.showToast('网络较差,请稍后再试');
  481. return;
  482. }
  483. let userId = this.$queue.getData('userId');
  484. if (type === 4) {
  485. this.content = this.Shopimage + ',' + this.ShopTitle + ',' + this.Shopmoney + ',' + this.ShopordersId;
  486. }
  487. if (type === 3) {
  488. this.content = this.orderimage + ',' + this.orderTitle + ',' + this.ordersId + ',' + this.orderNum +
  489. ',' + this.orderCreateTime +
  490. ',' + this.ordermoney
  491. }
  492. let data = {
  493. userId: userId,
  494. content: this.content,
  495. chatId: this.chatId,
  496. type: type,
  497. storeId: '0',
  498. sendType: '1'
  499. }
  500. data = JSON.stringify(data);
  501. let that = this;
  502. uni.sendSocketMessage({
  503. data: data,
  504. success(res) {
  505. let avatar = that.$queue.getData('avatar');
  506. if (!avatar) {
  507. avatar = '../../static/logo.png';
  508. }
  509. // let data = {
  510. // chat: {
  511. // userHead: avatar
  512. // },
  513. // content: that.content,
  514. // type: type,
  515. // sendType: 1
  516. // }
  517. // that.ListItem.push(data);
  518. setTimeout(() => {
  519. that.getTimeOrListItem1();
  520. }, 50);
  521. console.log(that.content);
  522. },
  523. fail(err) {
  524. console.log(err);
  525. }
  526. })
  527. this.content = '';
  528. },
  529. //发送图片
  530. async chooseImage(sourceType) {
  531. // 1. 检查权限状态
  532. const hasPermission = await this.$queue.checkPermission(
  533. 'camera',
  534. '选择/拍摄照片需要相机/相册权限,用于上传用户头像',
  535. this
  536. );
  537. // 2. 如果未授权或者用户拒绝,显示提示
  538. if (!hasPermission) {
  539. return;
  540. }
  541. uni.chooseImage({
  542. count: 1,
  543. sourceType: ['album', 'camera'],
  544. success: res => {
  545. for (let i = 0; i < res.tempFilePaths.length; i++) {
  546. this.$queue.showLoading("上传中...");
  547. uni.uploadFile({ // 上传接口
  548. url: this.config("APIHOST1") + '/alioss/upload', //真实的接口地址
  549. filePath: res.tempFilePaths[i],
  550. name: 'file',
  551. success: (uploadFileRes) => {
  552. this.content = JSON.parse(uploadFileRes.data).data;
  553. this.setChatSave(2);
  554. uni.hideLoading();
  555. }
  556. });
  557. }
  558. }
  559. })
  560. },
  561. config: function(name) {
  562. var info = null;
  563. if (name) {
  564. var name2 = name.split("."); //字符分割
  565. if (name2.length > 1) {
  566. info = configdata[name2[0]][name2[1]] || null;
  567. } else {
  568. info = configdata[name] || null;
  569. }
  570. if (info == null) {
  571. let web_config = cache.get("web_config");
  572. if (web_config) {
  573. if (name2.length > 1) {
  574. info = web_config[name2[0]][name2[1]] || null;
  575. } else {
  576. info = web_config[name] || null;
  577. }
  578. }
  579. }
  580. }
  581. return info;
  582. },
  583. //查看大图
  584. viewImg(item) {
  585. let imgsArray = [];
  586. imgsArray[0] = item;
  587. uni.previewImage({
  588. current: 0,
  589. urls: imgsArray
  590. });
  591. },
  592. },
  593. };
  594. </script>
  595. <style>
  596. page {
  597. background: #F5F5F5;
  598. }
  599. .input-box {
  600. position: fixed;
  601. bottom: 0;
  602. left: 0;
  603. height: 100rpx;
  604. width: 100%;
  605. display: flex;
  606. box-sizing: content-box;
  607. z-index: 999;
  608. /* background-color: #ececec; */
  609. /* padding: 0 5rpx; */
  610. }
  611. .chat-listitem {
  612. display: flex;
  613. margin-top: 20rpx;
  614. padding: 10rpx;
  615. }
  616. .chat-listitem-text {
  617. color: #FFFFFF;
  618. background: #557EFD;
  619. margin-top: 10rpx;
  620. width: fit-content;
  621. padding: 15rpx;
  622. font-size: 30rpx;
  623. height: max-content;
  624. word-wrap: break-word;
  625. word-break: break-all;
  626. border-radius: 10rpx;
  627. }
  628. .chat-listitem-text1 {
  629. /* color: #FFFFFF; */
  630. background: #FFFFFF;
  631. margin-top: 10rpx;
  632. width: fit-content;
  633. padding: 15rpx;
  634. font-size: 30rpx;
  635. height: max-content;
  636. word-wrap: break-word;
  637. word-break: break-all;
  638. border-radius: 10rpx;
  639. }
  640. .chat-listitem-image-type4 {
  641. /* color: #FFFFFF; */
  642. background: #FFFFFF;
  643. width: fit-content;
  644. font-size: 30rpx;
  645. height: max-content;
  646. word-wrap: break-word;
  647. word-break: break-all;
  648. border-top-left-radius: 20rpx;
  649. border-top-right-radius: 20rpx;
  650. }
  651. .chat-listitem-image {
  652. margin-top: 5rpx;
  653. width: 75rpx;
  654. height: 75rpx;
  655. border-radius: 5rpx;
  656. }
  657. .save {
  658. width: 130rpx;
  659. text-align: center;
  660. border-radius: 10rpx;
  661. height: 70rpx;
  662. color: #FFF;
  663. background: #557EFD;
  664. margin: 5rpx 10rpx 0;
  665. line-height: 70rpx;
  666. }
  667. </style>