chat.vue 21 KB

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