chat.vue 22 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006
  1. <template>
  2. <view class="chat-box" :style="colorStyle">
  3. <!-- #ifdef MP -->
  4. <!-- <view class="head-box">
  5. <view class="system-head" :style="{ height: sysHead }"></view>
  6. <view class="title-hd">
  7. <view class="iconfont icon-fanhui" @click="goBack"></view>
  8. <view>{{ titleName }}</view>
  9. </view>
  10. </view> -->
  11. <!-- #endif -->
  12. <view class="broadcast-details_order">
  13. <!-- 商品信息 -->
  14. <view class="broadcast-details_box" v-if="productId && productInfo.id">
  15. <view class="broadcast_details_img">
  16. <image class="goods-img" :src="productInfo.image" />
  17. </view>
  18. <view class="broadcast_details_picBox">
  19. <view class="broadcast_details_tit" v-text="productInfo.store_name"></view>
  20. <view class="acea-row row-between">
  21. <view class="broadcast_details_pic">
  22. {{$t(`¥`)}}{{ productInfo.price }}
  23. <text class="broadcast_details_pic_num"
  24. v-if="productInfo.ot_price">{{$t(`¥`)}}{{ productInfo.ot_price }}</text>
  25. </view>
  26. <view class="broadcast_details_btn" @click="sendProduct">{{$t(`发送客服`)}}</view>
  27. </view>
  28. </view>
  29. </view>
  30. <!-- 订单信息 -->
  31. <view class="broadcast_box" v-if="orderId && orderInfo.id">
  32. <view class="broadcast-details_num broadcast_num">
  33. <text>{{$t(`订单号`)}}:{{ orderInfo.order_id }}</text>
  34. <text>{{ orderInfo.add_time_y }} {{ orderInfo.add_time_h }}</text>
  35. </view>
  36. <view class="broadcast-details_box">
  37. <view class="broadcast_details_img">
  38. <image class="goods-img" :src="orderInfo.cartInfo[0].productInfo.image" />
  39. <view class="broadcast_details_model">
  40. {{ orderInfo.cartInfo ? orderInfo.cartInfo.length : 0 }}{{$t(`件商品`)}}
  41. </view>
  42. </view>
  43. <view class="broadcast_details_picBox">
  44. <view class="broadcast_details_tit">{{ orderInfo.cartInfo[0].productInfo.store_name }}</view>
  45. <view class="acea-row row-between">
  46. <view class="broadcast_details_pic">
  47. {{$t(`¥`)}}{{ orderInfo.cartInfo[0].productInfo.price }}
  48. <text
  49. class="broadcast_details_pic_num">{{$t(`¥`)}}{{ orderInfo.cartInfo[0].costPrice }}</text>
  50. </view>
  51. <view class="broadcast_details_btn" @click="sendOrder">{{$t(`发送客服`)}}</view>
  52. </view>
  53. </view>
  54. </view>
  55. </view>
  56. </view>
  57. <view class="chat-scroll-box">
  58. <scroll-view scroll-y="true" style="height: 100%;" :scroll-top="scrollTop" @scrolltoupper="scrollToTop">
  59. <Loading :loaded="status" :loading="loading"></Loading>
  60. <view id="box" class="chat" ref="chat">
  61. <view v-for="(item, index) in records" :key="index" :id="`msg-${item.id}`">
  62. <view class="day-box" v-if="item.show">{{item._add_time}}</view>
  63. <view class="chat-item" :class="{ 'right-box': item.uid == myUid }">
  64. <image class="avatar" :src="item.avatar" mode=""></image>
  65. <!-- 消息 -->
  66. <view class="msg-box" v-if="item.msn_type <= 2" v-html="item.msn"></view>
  67. <!-- 图片 -->
  68. <view class="img-box" v-if="item.msn_type == 3">
  69. <image :src="item.msn" mode="widthFix" @tap="previewImage(item.msn)"></image>
  70. </view>
  71. <!-- 商品 -->
  72. <view class="product-box" v-if="item.msn_type == 5" @click="goProduct(item)">
  73. <image :src="item.productInfo.image" mode="widthFix"></image>
  74. <view class="info">
  75. <view class="price">
  76. <text>{{$t(`¥`)}}</text>
  77. {{ item.productInfo.price }}
  78. </view>
  79. <view class="name line2">{{ item.productInfo.store_name }}</view>
  80. </view>
  81. </view>
  82. <!-- 订单 -->
  83. <view class="order-box" v-if="item.msn_type == 6 && item.orderInfo" @click="goOrder(item)">
  84. <view class="title">{{$t(`订单号`)}}: {{ item.orderInfo.order_id }}</view>
  85. <view class="info">
  86. <image :src="item.orderInfo.cartInfo[0].productInfo.image"></image>
  87. <view class="product-info">
  88. <view class="name line2">{{ item.orderInfo.cartInfo[0].productInfo.store_name }}
  89. </view>
  90. <view class="price">
  91. {{$t(`¥`)}}{{ item.orderInfo.cartInfo[0].productInfo.price }}
  92. </view>
  93. </view>
  94. </view>
  95. </view>
  96. </view>
  97. </view>
  98. </view>
  99. </scroll-view>
  100. </view>
  101. <view class="footer-box">
  102. <view class="words" @click="uploadImg"><text class="iconfont icon-tupian"></text></view>
  103. <view class="input-box">
  104. <input type="text" :placeholder="$t(`请输入内容`)" v-model="con" confirm-type="send" @confirm="sendText" />
  105. <text class="iconfont icon-fasong" @click="sendText" :class="{ isSend: isSend }"></text>
  106. </view>
  107. <view class="emoji" @click="isSwiper = !isSwiper"><span class="iconfont icon-biaoqing"></span></view>
  108. </view>
  109. <!-- 表情 -->
  110. <view class="banner slider-banner" v-if="isSwiper">
  111. <swiper class="swiper-wrapper" :autoplay="autoplay" :circular="circular" :interval="interval"
  112. :duration="duration" v-if="emojiGroup.length > 0">
  113. <block v-for="(emojiList, index) in emojiGroup" :key="index">
  114. <swiper-item><i class="em" :class="emoji" :style="'background-image:url('+ httpUrl +')'"
  115. v-for="emoji in emojiList" :key="emoji" @click="addEmoji(emoji)"></i></swiper-item>
  116. </block>
  117. </swiper>
  118. </view>
  119. <canvas canvas-id="canvas" v-if="canvasStatus"
  120. :style="{width: canvasWidth + 'px', height: canvasHeight + 'px',position: 'absolute',left:'-100000px',top:'-100000px'}"></canvas>
  121. </view>
  122. </template>
  123. <script>
  124. const app = getApp();
  125. import {
  126. getChatRecord
  127. } from '@/api/user';
  128. import {
  129. getProductDetail
  130. } from '@/api/store';
  131. import {
  132. getOrderDetail
  133. } from '@/api/order';
  134. let statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
  135. import Socket from '@/libs/new_chat';
  136. const chunk = function(arr, num) {
  137. num = num * 1 || 1;
  138. var ret = [];
  139. arr.forEach(function(item, i) {
  140. if (i % num === 0) {
  141. ret.push([]);
  142. }
  143. ret[ret.length - 1].push(item);
  144. });
  145. return ret;
  146. };
  147. import emojiList from '@/utils/emoji';
  148. import Loading from '@/components/Loading';
  149. import colors from "@/mixins/color";
  150. import {
  151. HTTP_REQUEST_URL
  152. } from "@/config/app.js";
  153. export default {
  154. name: 'adminChat_index',
  155. data() {
  156. return {
  157. status: false,
  158. loading: false,
  159. sysHead: statusBarHeight,
  160. isTool: false,
  161. isSwiper: false,
  162. isWords: false,
  163. autoplay: false,
  164. circular: true,
  165. interval: 3000,
  166. duration: 500,
  167. emojiGroup: chunk(emojiList, 21),
  168. wordsList: [],
  169. con: '',
  170. toUid: 0,
  171. limit: 15,
  172. upperId: 0,
  173. chatList: [],
  174. kefuInfo: {},
  175. scrollTop: 0,
  176. active: true,
  177. isScroll: true,
  178. oldHeight: 0,
  179. myUid: 0,
  180. productId: 0,
  181. productInfo: {},
  182. orderId: 0,
  183. page: 1,
  184. orderInfo: {},
  185. uidTo: 0,
  186. titleName: '',
  187. chatStatus: false,
  188. userType: 0,
  189. canvasWidth: "",
  190. canvasHeight: "",
  191. canvasStatus: false,
  192. httpUrl: '',
  193. };
  194. },
  195. mixins: [colors],
  196. components: {
  197. Loading
  198. },
  199. computed: {
  200. isSend() {
  201. if (this.con.length == 0) {
  202. return false;
  203. } else {
  204. return true;
  205. }
  206. },
  207. records() {
  208. return this.chatList.map((item, index) => {
  209. if (index) {
  210. if (item.add_time - this.chatList[index - 1].add_time >= 300) {
  211. item.show = true;
  212. } else {
  213. item.show = false;
  214. }
  215. } else {
  216. item.show = true;
  217. }
  218. return item;
  219. });
  220. }
  221. },
  222. onLoad(options) {
  223. uni.showLoading({
  224. title: this.$t(`客服连接中`)
  225. });
  226. this.myUid = this.$store.state.app.uid;
  227. this.toUid = options.to_uid
  228. this.productId = parseInt(options.productId) || 0;
  229. this.orderId = options.orderId || 0;
  230. this.userType = options.type
  231. this.getproductInfo();
  232. this.getOrderInfo();
  233. },
  234. onUnload() {
  235. this.$socket.onClose();
  236. uni.$off()
  237. },
  238. onReady() {
  239. this.httpUrl = `${HTTP_REQUEST_URL}/statics/images/look.png`;
  240. // #ifdef H5
  241. let dom = document.querySelector(".chat-box");
  242. dom.style.height = window.innerHeight + 'px'
  243. // #endif
  244. let initSocket = () => {
  245. if (app.globalData.isWsOpen) {
  246. this.$socket.send({
  247. data: {
  248. token: this.$store.state.app.token,
  249. //#ifdef MP || APP-PLUS
  250. form_type: 2,
  251. //#endif
  252. //#ifdef H5
  253. form_type: this.$wechat.isWeixin() ? 1 : 3
  254. //#endif
  255. },
  256. type: 'login'
  257. });
  258. this.getChatList();
  259. } else {
  260. let form_type
  261. //#ifdef MP || APP-PLUS
  262. form_type = 2
  263. //#endif
  264. //#ifdef H5
  265. form_type = this.$wechat.isWeixin() ? 1 : 3
  266. //#endif
  267. this.$socket.onStart(this.$store.state.app.token, form_type);
  268. }
  269. uni.$once('socketOpen', () => {
  270. // 登录
  271. this.$socket.send({
  272. data: this.$store.state.app.token,
  273. //#ifdef MP || APP-PLUS
  274. form_type: 2,
  275. //#endif
  276. //#ifdef H5
  277. form_type: this.$wechat.isWeixin() ? 1 : 3,
  278. //#endif
  279. type: 'login'
  280. });
  281. this.$nextTick(e => {
  282. this.getChatList();
  283. })
  284. });
  285. }
  286. initSocket()
  287. // 初始化
  288. // 监听客服转接
  289. uni.$on('to_transfer', data => {
  290. this.toUid = data.toUid;
  291. this.$socket.send({
  292. data: {
  293. id: this.toUid
  294. },
  295. type: 'to_chat'
  296. });
  297. this.chatList.forEach(el => {
  298. if (el.uid != this.myUid) {
  299. el.avatar = data.avatar
  300. }
  301. })
  302. });
  303. // 超时了
  304. uni.$once('timeout', () => {
  305. uni.showLoading({
  306. title: '重连中',
  307. mask: true
  308. })
  309. this.chatList = []
  310. initSocket()
  311. });
  312. // 链接成功
  313. uni.$once('success', () => {
  314. this.$socket.init();
  315. });
  316. // 消息接收
  317. uni.$on(['reply', 'chat'], data => {
  318. if (data.msn_type == 1) {
  319. data.msn = this.replace_em(data.msn);
  320. }
  321. data._add_time = data._add_time.substring(0, data._add_time.length - 3);
  322. this.chatList.push(data);
  323. this.$nextTick(() => {
  324. this.height();
  325. });
  326. });
  327. uni.$on('socket_error', () => {
  328. this.$util.Tips({
  329. title: this.$t(`连接失败`)
  330. });
  331. });
  332. uni.$on('err_tip', (e) => {
  333. this.$util.Tips({
  334. title: e.msg
  335. });
  336. });
  337. uni.$on('online', data => {
  338. if (data.online == 0) {
  339. uni.showModal({
  340. title: this.$t(`提示`),
  341. content: this.$t(`客服已下线,是否需要反馈?`),
  342. success: function(res) {
  343. if (res.confirm) {
  344. uni.redirectTo({
  345. url: '/pages/columnGoods/HotNewGoods/feedback'
  346. });
  347. } else if (res.cancel) {}
  348. }
  349. });
  350. }
  351. });
  352. this.$nextTick(() => {
  353. this.height();
  354. });
  355. },
  356. methods: {
  357. previewImage(n) {
  358. uni.previewImage({
  359. urls: [n]
  360. });
  361. },
  362. // 返回
  363. goBack() {
  364. uni.navigateBack();
  365. },
  366. // 商品信息
  367. getproductInfo() {
  368. let that = this;
  369. if (!this.productId) return;
  370. getProductDetail(this.productId).then(res => {
  371. that.productInfo = res.data.storeInfo;
  372. });
  373. },
  374. // 商品信息
  375. goProduct(item) {
  376. uni.navigateTo({
  377. url: `/pages/goods_details/index?id=${item.msn}`
  378. });
  379. },
  380. // 订单详情
  381. goOrder(item) {
  382. if (this.userType) {
  383. uni.navigateTo({
  384. url: `/pages/admin/orderDetail/index?id=${item.msn}`
  385. });
  386. } else {
  387. uni.navigateTo({
  388. url: `/pages/goods/order_details/index?order_id=${item.msn}`
  389. });
  390. }
  391. },
  392. // 订单消息
  393. getOrderInfo() {
  394. if (!this.orderId) return;
  395. getOrderDetail(this.orderId).then(res => {
  396. this.orderInfo = res.data;
  397. if (this.orderInfo.add_time_h) {
  398. this.orderInfo.add_time_h = this.orderInfo.add_time_h.substring(0, this.orderInfo
  399. .add_time_h.lastIndexOf(':'));
  400. }
  401. if (this.orderInfo.cartInfo.length) {
  402. this.cartInfo = this.orderInfo.cartInfo[0];
  403. }
  404. });
  405. },
  406. // 表情点击
  407. addEmoji(item) {
  408. let val = `[${item}]`;
  409. this.con += val;
  410. },
  411. // 聊天表情转换
  412. replace_em(str) {
  413. str = str.replace(/\[([^\[\]]+)\]/g, "<span class='em $1' style='background-image:url(" + this
  414. .httpUrl + ")'></span>");
  415. return str;
  416. },
  417. // 获取聊天列表
  418. getChatList() {
  419. let self = this;
  420. getChatRecord({
  421. limit: this.limit,
  422. uidTo: this.uidTo,
  423. toUid: this.toUid
  424. })
  425. .then(res => {
  426. let selector = '';
  427. if (res.data.serviceList.length) {
  428. if (this.uidTo == 0) {
  429. selector = `#msg-${res.data.serviceList[res.data.serviceList.length - 1].id}`;
  430. } else {
  431. selector = `#msg-${this.chatList.length ? this.chatList[0].id : 0}`;
  432. }
  433. }
  434. let arr = [];
  435. var sH = 0;
  436. uni.hideLoading();
  437. uni.setNavigationBarTitle({
  438. title: res.data.nickname
  439. });
  440. this.titleName = res.data.nickname;
  441. this.toUid = res.data.uid;
  442. res.data.serviceList.forEach(el => {
  443. el._add_time = el._add_time.substring(0, el._add_time.length - 3);
  444. if (el.msn_type == 1 || el.msn_type == 2) {
  445. el.msn = this.replace_em(el.msn);
  446. }
  447. });
  448. this.loading = false;
  449. this.chatList = [...res.data.serviceList, ...this.chatList];
  450. this.$nextTick(() => {
  451. if (this.chatList.length) {
  452. this.setPageScrollTo(selector);
  453. this.isScroll = res.data.serviceList.length >= this.limit;
  454. }
  455. });
  456. this.$socket.send({
  457. data: {
  458. id: this.toUid
  459. },
  460. type: 'to_chat'
  461. });
  462. })
  463. .catch(error => {
  464. uni.hideLoading();
  465. this.$util.Tips({
  466. title: error
  467. });
  468. this.loading = false;
  469. this.isScroll = false
  470. uni.redirectTo({
  471. url: '/pages/columnGoods/HotNewGoods/feedback'
  472. });
  473. });
  474. },
  475. // 设置页面滚动位置
  476. setPageScrollTo(selector) {
  477. let view = uni
  478. .createSelectorQuery()
  479. .in(this)
  480. .select(selector);
  481. view.boundingClientRect(res => {
  482. this.scrollTop = res ? parseFloat(res.top) - 60 : 0;
  483. }).exec();
  484. },
  485. // 发送消息
  486. sendText() {
  487. if (!this.isSend) {
  488. return this.$util.Tips({
  489. title: this.$t(`请输入内容`)
  490. });
  491. }
  492. this.sendMsg(this.con, 1);
  493. this.con = '';
  494. },
  495. // ws发送
  496. sendMsg(msn, type) {
  497. this.$socket.send({
  498. data: {
  499. msn,
  500. type,
  501. to_uid: this.toUid
  502. },
  503. //#ifdef MP || APP-PLUS
  504. form_type: 2,
  505. //#endif
  506. //#ifdef H5
  507. form_type: this.$wechat.isWeixin() ? 1 : 3,
  508. //#endif
  509. type: 'chat'
  510. });
  511. },
  512. uploadImg() {
  513. let self = this;
  514. self.canvasStatus = true
  515. self.$util.uploadImageChange('upload/image', function(res) {
  516. if (res.status == 200) {
  517. self.sendMsg(res.data.url, 3);
  518. }
  519. }, (res) => {
  520. this.canvasStatus = false
  521. }, (res) => {
  522. this.canvasWidth = res.w
  523. this.canvasHeight = res.h
  524. });
  525. },
  526. // 发送商品
  527. sendProduct() {
  528. this.sendMsg(this.productId, 5);
  529. this.productId = 0;
  530. this.productInfo = {};
  531. },
  532. // 发送订单
  533. sendOrder() {
  534. this.sendMsg(this.orderId, 6);
  535. this.orderId = 0;
  536. this.orderInfo = {};
  537. },
  538. // 滚动到底部
  539. height() {
  540. let self = this;
  541. var scrollTop = 0;
  542. let info = uni.createSelectorQuery().select('.chat');
  543. setTimeout(res => {
  544. info.boundingClientRect(function(data) {
  545. //data - 各种参数
  546. scrollTop = data.height;
  547. if (self.active) {
  548. self.scrollTop = parseInt(scrollTop) + 500;
  549. } else {
  550. self.scrollTop = parseInt(scrollTop) + 100;
  551. }
  552. }).exec();
  553. }, 200);
  554. },
  555. // 滚动到顶部
  556. scrollToTop() {
  557. let self = this;
  558. if (this.isScroll) {
  559. this.loading = true;
  560. this.uidTo = this.chatList.length ? this.chatList[0].id : 0;
  561. this.isScroll = false;
  562. setTimeout(res => {
  563. this.getChatList();
  564. }, 800);
  565. }
  566. }
  567. }
  568. };
  569. </script>
  570. <style>
  571. /* #ifdef MP || APP-PLUS || H5 */
  572. page,
  573. uni-page-body,
  574. html,
  575. body {
  576. height: 100%;
  577. }
  578. /* #endif */
  579. </style>
  580. <style lang="scss">
  581. .chat-box {
  582. display: flex;
  583. flex-direction: column;
  584. height: 100%;
  585. background: #f0f1f2;
  586. /* #ifdef H5 */
  587. height: 100vh;
  588. /* #endif */
  589. .head-box {
  590. /* #ifdef H5 */
  591. height: 86rpx;
  592. /* #endif */
  593. background: linear-gradient(85deg, $kf-star 0%, $kf-end 100%);
  594. .title-hd {
  595. display: flex;
  596. align-items: center;
  597. justify-content: center;
  598. position: relative;
  599. height: 43px;
  600. padding: 0 30rpx;
  601. color: #fff;
  602. .icon-fanhui {
  603. position: absolute;
  604. left: 30rpx;
  605. top: 50%;
  606. transform: translateY(-50%);
  607. }
  608. .icon-gengduo2 {
  609. /* #ifdef MP */
  610. position: absolute;
  611. right: 210rpx;
  612. top: 50%;
  613. transform: translateY(-50%);
  614. /* #endif */
  615. }
  616. }
  617. }
  618. .scroll-box {
  619. flex: 1;
  620. }
  621. .footer-box {
  622. display: flex;
  623. align-items: center;
  624. color: rgba(0, 0, 0, 0.8);
  625. background: #f7f7f7;
  626. /* #ifdef APP-PLUS */
  627. padding: 0 30rpx;
  628. height: 70rpx;
  629. height: (70rpx + constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
  630. height: calc(70rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
  631. /* #endif */
  632. /* #ifndef APP-PLUS */
  633. padding: 0 30rpx 15rpx 30rpx;
  634. height: 115rpx;
  635. /* #endif */
  636. .words .icon-tupian {
  637. font-size: 50rpx;
  638. }
  639. .input-box {
  640. display: flex;
  641. align-items: center;
  642. flex: 1;
  643. height: 64rpx;
  644. padding-right: 5rpx;
  645. margin-left: 18rpx;
  646. background-color: #fff;
  647. border-radius: 32rpx;
  648. input {
  649. flex: 1;
  650. padding-left: 20rpx;
  651. height: 100%;
  652. font-size: 28rpx;
  653. font-weight: normal;
  654. }
  655. .icon-fasong {
  656. font-size: 50rpx;
  657. color: #ccc;
  658. font-weight: normal;
  659. }
  660. .isSend {
  661. color: $kf-theme;
  662. }
  663. }
  664. .emoji .icon-biaoqing {
  665. margin-left: 18rpx;
  666. font-size: 50rpx;
  667. }
  668. .more .icon-gengduozhankai {
  669. margin-left: 18rpx;
  670. font-size: 50rpx;
  671. }
  672. }
  673. }
  674. .tool-wrapper {
  675. display: flex;
  676. justify-content: space-between;
  677. padding: 45rpx 60rpx;
  678. background: #fff;
  679. font-size: 24rpx;
  680. .tool-item {
  681. text-align: center;
  682. image {
  683. width: 104rpx;
  684. height: 104rpx;
  685. }
  686. }
  687. }
  688. .slider-banner {
  689. background: #fff;
  690. padding-bottom: 0rpx;
  691. padding-bottom: calc(constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
  692. padding-bottom: calc(env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
  693. }
  694. .words-mask {
  695. z-index: 50;
  696. position: fixed;
  697. left: 0;
  698. top: 0;
  699. right: 0;
  700. bottom: 0;
  701. background: rgba(0, 0, 0, 0.5);
  702. .content {
  703. position: absolute;
  704. left: 0;
  705. right: 0;
  706. top: 114rpx;
  707. bottom: 0;
  708. display: flex;
  709. flex-direction: column;
  710. padding: 0 30rpx;
  711. background: #fff;
  712. border-radius: 6rpx 6rpx 0px 0px;
  713. .title-box {
  714. position: relative;
  715. height: 125rpx;
  716. line-height: 125rpx;
  717. text-align: center;
  718. font-size: 32rpx;
  719. .icon-cha1 {
  720. position: absolute;
  721. right: 0;
  722. top: 50%;
  723. transform: translateY(-50%);
  724. }
  725. }
  726. .scroll-box {
  727. flex: 1;
  728. overflow: hidden;
  729. .msg-item {
  730. padding: 25rpx 0;
  731. border-bottom: 1px solid #eceff8;
  732. }
  733. }
  734. }
  735. }
  736. .chat-scroll-box {
  737. flex: 1;
  738. padding: 30rpx 30rpx 0;
  739. overflow: hidden;
  740. .chat-item {
  741. display: flex;
  742. margin-bottom: 36rpx;
  743. -webkit-user-select: auto;
  744. .avatar {
  745. width: 80rpx;
  746. height: 80rpx;
  747. border-radius: 50%;
  748. }
  749. .msg-box {
  750. display: flex;
  751. align-items: center;
  752. max-width: 452rpx;
  753. margin-left: 22rpx;
  754. padding: 10rpx 24rpx;
  755. background: #fff;
  756. border-radius: 14rpx;
  757. word-break: break-all;
  758. -webkit-user-select: auto;
  759. }
  760. .img-box {
  761. width: 270rpx;
  762. margin-left: 22rpx;
  763. image {
  764. width: 270rpx;
  765. }
  766. }
  767. .product-box {
  768. width: 452rpx;
  769. margin-left: 22rpx;
  770. background-color: #fff;
  771. border-radius: 14rpx;
  772. overflow: hidden;
  773. image {
  774. width: 452rpx;
  775. }
  776. .info {
  777. padding: 16rpx 26rpx;
  778. .price {
  779. font-size: 36rpx;
  780. color: var(--view-priceColor);
  781. text {
  782. font-size: 28rpx;
  783. }
  784. }
  785. }
  786. }
  787. .order-box {
  788. width: 452rpx;
  789. margin-left: 22rpx;
  790. background-color: #fff;
  791. border-radius: 14rpx;
  792. .title {
  793. padding: 15rpx 20rpx;
  794. font-size: 26rpx;
  795. color: #282828;
  796. border-bottom: 1px solid #eceff8;
  797. }
  798. .info {
  799. display: flex;
  800. padding: 20rpx;
  801. image {
  802. width: 124rpx;
  803. height: 124rpx;
  804. border-radius: 6rpx;
  805. }
  806. .product-info {
  807. flex: 1;
  808. display: flex;
  809. flex-direction: column;
  810. justify-content: space-between;
  811. margin-left: 16rpx;
  812. .name {
  813. font-size: 26rpx;
  814. }
  815. .price {
  816. font-size: 30rpx;
  817. color: var(--view-priceColor);
  818. }
  819. }
  820. }
  821. }
  822. &.right-box {
  823. flex-direction: row-reverse;
  824. .msg-box {
  825. margin-left: 0;
  826. margin-right: 22rpx;
  827. background-color: #9cec60;
  828. }
  829. .img-box {
  830. margin-left: 0;
  831. margin-right: 22rpx;
  832. }
  833. .product-box {
  834. margin-left: 0;
  835. margin-right: 22rpx;
  836. }
  837. .order-box {
  838. margin-left: 0;
  839. margin-right: 22rpx;
  840. }
  841. }
  842. .em {
  843. margin: 0;
  844. }
  845. }
  846. }
  847. .broadcast-details_box {
  848. display: flex;
  849. background: #fff;
  850. border-radius: 6px;
  851. padding: 24rpx;
  852. }
  853. .broadcast_details_img {
  854. width: 140rpx;
  855. height: 140rpx;
  856. border-radius: 8px;
  857. overflow: hidden;
  858. position: relative;
  859. }
  860. .broadcast_details_img .goods-img {
  861. width: 100%;
  862. height: 100%;
  863. }
  864. .broadcast_details_picBox {
  865. width: 75%;
  866. margin-left: 24rpx;
  867. }
  868. .broadcast_details_tit {
  869. font-size: 28rpx;
  870. color: #333333;
  871. height: 85rpx;
  872. font-weight: 800;
  873. line-height: 40rpx;
  874. overflow: hidden;
  875. text-overflow: ellipsis;
  876. display: -webkit-box;
  877. -webkit-line-clamp: 2;
  878. -webkit-box-orient: vertical;
  879. text-align: left !important;
  880. }
  881. .broadcast_details_pic {
  882. font-size: 36rpx;
  883. color: var(--view-priceColor);
  884. text-align: left;
  885. }
  886. .broadcast_details_pic_num {
  887. text-decoration: line-through;
  888. font-size: 28rpx;
  889. color: rgba(0, 0, 0, 0.5);
  890. margin-left: 0.1rem;
  891. }
  892. .broadcast_details_btn {
  893. width: 130rpx;
  894. height: 50rpx;
  895. background: var(--view-theme);
  896. opacity: 1;
  897. border-radius: 125rpx;
  898. color: #fff;
  899. font-size: 24rpx;
  900. text-align: center;
  901. line-height: 50rpx;
  902. }
  903. .broadcast-details_num {
  904. width: 100%;
  905. height: 80rpx;
  906. line-height: 80rpx;
  907. color: #000000;
  908. font-size: 26rpx;
  909. display: flex;
  910. justify-content: space-between;
  911. background: #fff;
  912. border-bottom: 1px dashed rgba(0, 0, 0, 0.2);
  913. padding: 0 24rpx;
  914. }
  915. .day-box {
  916. font-size: 24rpx;
  917. color: #999;
  918. text-align: center;
  919. margin-bottom: 36rpx;
  920. }
  921. </style>
  922. <style>
  923. .em {
  924. display: inline-block;
  925. width: 50rpx;
  926. height: 50rpx;
  927. margin: 40rpx 0 0 50rpx;
  928. }
  929. .emoji-outer {
  930. position: absolute;
  931. right: 50rpx;
  932. bottom: 30rpx;
  933. width: 50rpx;
  934. height: 50rpx;
  935. }
  936. </style>