chat.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993
  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" @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(/\[em-([\s\S]*)\]/g, "<span class='em 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[0].id}`;
  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. this.setPageScrollTo(selector);
  452. this.isScroll = res.data.serviceList.length >= this.limit;
  453. });
  454. this.$socket.send({
  455. data: {
  456. id: this.toUid
  457. },
  458. type: 'to_chat'
  459. });
  460. })
  461. .catch(error => {
  462. uni.hideLoading();
  463. this.$util.Tips({
  464. title: error
  465. });
  466. this.loading = false;
  467. this.isScroll = false
  468. uni.redirectTo({
  469. url: '/pages/columnGoods/HotNewGoods/feedback'
  470. });
  471. });
  472. },
  473. // 设置页面滚动位置
  474. setPageScrollTo(selector) {
  475. let view = uni
  476. .createSelectorQuery()
  477. .in(this)
  478. .select(selector);
  479. view.boundingClientRect(res => {
  480. this.scrollTop = res ? parseFloat(res.top) - 60 : 0;
  481. }).exec();
  482. },
  483. // 发送消息
  484. sendText() {
  485. if (!this.isSend) {
  486. return this.$util.Tips({
  487. title: this.$t(`请输入内容`)
  488. });
  489. }
  490. this.sendMsg(this.con, 1);
  491. this.con = '';
  492. },
  493. // ws发送
  494. sendMsg(msn, type) {
  495. this.$socket.send({
  496. data: {
  497. msn,
  498. type,
  499. to_uid: this.toUid
  500. },
  501. //#ifdef MP || APP-PLUS
  502. form_type: 2,
  503. //#endif
  504. //#ifdef H5
  505. form_type: this.$wechat.isWeixin() ? 1 : 3,
  506. //#endif
  507. type: 'chat'
  508. });
  509. },
  510. uploadImg() {
  511. let self = this;
  512. self.canvasStatus = true
  513. self.$util.uploadImageChange('upload/image', function(res) {
  514. if (res.status == 200) {
  515. self.sendMsg(res.data.url, 3);
  516. }
  517. }, (res) => {
  518. this.canvasStatus = false
  519. }, (res) => {
  520. this.canvasWidth = res.w
  521. this.canvasHeight = res.h
  522. });
  523. },
  524. // 发送商品
  525. sendProduct() {
  526. this.sendMsg(this.productId, 5);
  527. this.productId = 0;
  528. this.productInfo = {};
  529. },
  530. // 发送订单
  531. sendOrder() {
  532. this.sendMsg(this.orderId, 6);
  533. this.orderId = 0;
  534. this.orderInfo = {};
  535. },
  536. // 滚动到底部
  537. height() {
  538. let self = this;
  539. var scrollTop = 0;
  540. let info = uni.createSelectorQuery().select('.chat');
  541. setTimeout(res => {
  542. info.boundingClientRect(function(data) {
  543. //data - 各种参数
  544. scrollTop = data.height;
  545. if (self.active) {
  546. self.scrollTop = parseInt(scrollTop) + 500;
  547. } else {
  548. self.scrollTop = parseInt(scrollTop) + 100;
  549. }
  550. }).exec();
  551. }, 200);
  552. },
  553. // 滚动到顶部
  554. scrollToTop() {
  555. let self = this;
  556. if (this.isScroll) {
  557. this.loading = true;
  558. this.uidTo = this.chatList[0].id;
  559. this.isScroll = false;
  560. setTimeout(res => {
  561. this.getChatList();
  562. }, 800);
  563. }
  564. }
  565. }
  566. };
  567. </script>
  568. <style>
  569. /* #ifdef MP || APP-PLUS || H5 */
  570. page,
  571. uni-page-body,
  572. html,
  573. body {
  574. height: 100%;
  575. }
  576. /* #endif */
  577. </style>
  578. <style lang="scss">
  579. .chat-box {
  580. display: flex;
  581. flex-direction: column;
  582. height: 100%;
  583. background: #f0f1f2;
  584. /* #ifdef H5 */
  585. height: 100vh;
  586. /* #endif */
  587. .head-box {
  588. /* #ifdef H5 */
  589. height: 86rpx;
  590. /* #endif */
  591. background: linear-gradient(85deg, $kf-star 0%, $kf-end 100%);
  592. .title-hd {
  593. display: flex;
  594. align-items: center;
  595. justify-content: center;
  596. position: relative;
  597. height: 43px;
  598. padding: 0 30rpx;
  599. color: #fff;
  600. .icon-fanhui {
  601. position: absolute;
  602. left: 30rpx;
  603. top: 50%;
  604. transform: translateY(-50%);
  605. }
  606. .icon-gengduo2 {
  607. /* #ifdef MP */
  608. position: absolute;
  609. right: 210rpx;
  610. top: 50%;
  611. transform: translateY(-50%);
  612. /* #endif */
  613. }
  614. }
  615. }
  616. .scroll-box {
  617. flex: 1;
  618. }
  619. .footer-box {
  620. display: flex;
  621. align-items: center;
  622. padding: 0 30rpx;
  623. color: rgba(0, 0, 0, 0.8);
  624. background: #f7f7f7;
  625. height: 100rpx;
  626. height: calc(100rpx+ constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
  627. height: calc(100rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
  628. .words .icon-tupian {
  629. font-size: 50rpx;
  630. }
  631. .input-box {
  632. display: flex;
  633. align-items: center;
  634. flex: 1;
  635. height: 64rpx;
  636. padding-right: 5rpx;
  637. margin-left: 18rpx;
  638. background-color: #fff;
  639. border-radius: 32rpx;
  640. input {
  641. flex: 1;
  642. padding-left: 20rpx;
  643. height: 100%;
  644. font-size: 28rpx;
  645. font-weight: normal;
  646. }
  647. .icon-fasong {
  648. font-size: 50rpx;
  649. color: #ccc;
  650. font-weight: normal;
  651. }
  652. .isSend {
  653. color: $kf-theme;
  654. }
  655. }
  656. .emoji .icon-biaoqing {
  657. margin-left: 18rpx;
  658. font-size: 50rpx;
  659. }
  660. .more .icon-gengduozhankai {
  661. margin-left: 18rpx;
  662. font-size: 50rpx;
  663. }
  664. }
  665. }
  666. .tool-wrapper {
  667. display: flex;
  668. justify-content: space-between;
  669. padding: 45rpx 60rpx;
  670. background: #fff;
  671. font-size: 24rpx;
  672. .tool-item {
  673. text-align: center;
  674. image {
  675. width: 104rpx;
  676. height: 104rpx;
  677. }
  678. }
  679. }
  680. .slider-banner {
  681. background: #fff;
  682. }
  683. .words-mask {
  684. z-index: 50;
  685. position: fixed;
  686. left: 0;
  687. top: 0;
  688. right: 0;
  689. bottom: 0;
  690. background: rgba(0, 0, 0, 0.5);
  691. .content {
  692. position: absolute;
  693. left: 0;
  694. right: 0;
  695. top: 114rpx;
  696. bottom: 0;
  697. display: flex;
  698. flex-direction: column;
  699. padding: 0 30rpx;
  700. background: #fff;
  701. border-radius: 6rpx 6rpx 0px 0px;
  702. .title-box {
  703. position: relative;
  704. height: 125rpx;
  705. line-height: 125rpx;
  706. text-align: center;
  707. font-size: 32rpx;
  708. .icon-cha1 {
  709. position: absolute;
  710. right: 0;
  711. top: 50%;
  712. transform: translateY(-50%);
  713. }
  714. }
  715. .scroll-box {
  716. flex: 1;
  717. overflow: hidden;
  718. .msg-item {
  719. padding: 25rpx 0;
  720. border-bottom: 1px solid #eceff8;
  721. }
  722. }
  723. }
  724. }
  725. .chat-scroll-box {
  726. flex: 1;
  727. padding: 30rpx 30rpx 0;
  728. overflow: hidden;
  729. .chat-item {
  730. display: flex;
  731. margin-bottom: 36rpx;
  732. -webkit-user-select: auto;
  733. .avatar {
  734. width: 80rpx;
  735. height: 80rpx;
  736. border-radius: 50%;
  737. }
  738. .msg-box {
  739. display: flex;
  740. align-items: center;
  741. max-width: 452rpx;
  742. margin-left: 22rpx;
  743. padding: 10rpx 24rpx;
  744. background: #fff;
  745. border-radius: 14rpx;
  746. word-break: break-all;
  747. -webkit-user-select: auto;
  748. }
  749. .img-box {
  750. width: 270rpx;
  751. margin-left: 22rpx;
  752. image {
  753. width: 270rpx;
  754. }
  755. }
  756. .product-box {
  757. width: 452rpx;
  758. margin-left: 22rpx;
  759. background-color: #fff;
  760. border-radius: 14rpx;
  761. overflow: hidden;
  762. image {
  763. width: 452rpx;
  764. }
  765. .info {
  766. padding: 16rpx 26rpx;
  767. .price {
  768. font-size: 36rpx;
  769. color: var(--view-priceColor);
  770. text {
  771. font-size: 28rpx;
  772. }
  773. }
  774. }
  775. }
  776. .order-box {
  777. width: 452rpx;
  778. margin-left: 22rpx;
  779. background-color: #fff;
  780. border-radius: 14rpx;
  781. .title {
  782. padding: 15rpx 20rpx;
  783. font-size: 26rpx;
  784. color: #282828;
  785. border-bottom: 1px solid #eceff8;
  786. }
  787. .info {
  788. display: flex;
  789. padding: 20rpx;
  790. image {
  791. width: 124rpx;
  792. height: 124rpx;
  793. border-radius: 6rpx;
  794. }
  795. .product-info {
  796. flex: 1;
  797. display: flex;
  798. flex-direction: column;
  799. justify-content: space-between;
  800. margin-left: 16rpx;
  801. .name {
  802. font-size: 26rpx;
  803. }
  804. .price {
  805. font-size: 30rpx;
  806. color: var(--view-priceColor);
  807. }
  808. }
  809. }
  810. }
  811. &.right-box {
  812. flex-direction: row-reverse;
  813. .msg-box {
  814. margin-left: 0;
  815. margin-right: 22rpx;
  816. background-color: #9cec60;
  817. }
  818. .img-box {
  819. margin-left: 0;
  820. margin-right: 22rpx;
  821. }
  822. .product-box {
  823. margin-left: 0;
  824. margin-right: 22rpx;
  825. }
  826. .order-box {
  827. margin-left: 0;
  828. margin-right: 22rpx;
  829. }
  830. }
  831. .em {
  832. margin: 0;
  833. }
  834. }
  835. }
  836. .broadcast-details_box {
  837. display: flex;
  838. background: #fff;
  839. border-radius: 6px;
  840. padding: 24rpx;
  841. }
  842. .broadcast_details_img {
  843. width: 140rpx;
  844. height: 140rpx;
  845. border-radius: 8px;
  846. overflow: hidden;
  847. position: relative;
  848. }
  849. .broadcast_details_img .goods-img {
  850. width: 100%;
  851. height: 100%;
  852. }
  853. .broadcast_details_picBox {
  854. width: 75%;
  855. margin-left: 24rpx;
  856. }
  857. .broadcast_details_tit {
  858. font-size: 28rpx;
  859. color: #333333;
  860. height: 85rpx;
  861. font-weight: 800;
  862. overflow: hidden;
  863. text-overflow: ellipsis;
  864. display: -webkit-box;
  865. -webkit-line-clamp: 2;
  866. -webkit-box-orient: vertical;
  867. text-align: left !important;
  868. }
  869. .broadcast_details_pic {
  870. font-size: 36rpx;
  871. color: var(--view-priceColor);
  872. text-align: left;
  873. }
  874. .broadcast_details_pic_num {
  875. text-decoration: line-through;
  876. font-size: 28rpx;
  877. color: rgba(0, 0, 0, 0.5);
  878. margin-left: 0.1rem;
  879. }
  880. .broadcast_details_btn {
  881. width: 130rpx;
  882. height: 50rpx;
  883. background: var(--view-theme);
  884. opacity: 1;
  885. border-radius: 125rpx;
  886. color: #fff;
  887. font-size: 24rpx;
  888. text-align: center;
  889. line-height: 50rpx;
  890. }
  891. .broadcast-details_num {
  892. width: 100%;
  893. height: 80rpx;
  894. line-height: 80rpx;
  895. color: #000000;
  896. font-size: 26rpx;
  897. display: flex;
  898. justify-content: space-between;
  899. background: #fff;
  900. border-bottom: 1px dashed rgba(0, 0, 0, 0.2);
  901. padding: 0 24rpx;
  902. }
  903. .day-box {
  904. font-size: 24rpx;
  905. color: #999;
  906. text-align: center;
  907. margin-bottom: 36rpx;
  908. }
  909. </style>
  910. <style>
  911. .em {
  912. display: inline-block;
  913. width: 50rpx;
  914. height: 50rpx;
  915. margin: 40rpx 0 0 50rpx;
  916. }
  917. .emoji-outer {
  918. position: absolute;
  919. right: 50rpx;
  920. bottom: 30rpx;
  921. width: 50rpx;
  922. height: 50rpx;
  923. }
  924. </style>