boka-human-cliend-v3 0.0.16 → 0.0.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -444,80 +444,80 @@
444
444
  display: none;
445
445
  }
446
446
  }
447
-
448
447
  /* 可根据需要添加样式 */
449
448
  .boka-human-v2 {
450
- overflow: hidden;
451
- position: fixed;
452
- top: 0;
453
- left: 0;
454
- z-index: 999;
455
- }
456
- .humanEnterIcon{
457
- position: fixed;
458
- z-index: 999;
459
- background-color: #0074ff;
460
- border-radius: 50%;
461
- width: 40px;
462
- height: 40px;
463
- text-align: center;
464
- padding: 8px;
465
- box-sizing: border-box;
466
- /*transform: translate(100vw, 100vh);*/
467
- transform: translate(50vw, 50vh);
468
- >svg{
469
- width: 100%;
470
- height:100%;
471
- fill:#fff;
472
- }
473
- &.unreadCount{
474
- background-color: red;
475
- color: #fff;
476
- line-height: 24px;
477
- font-size: 14px;
478
- font-weight: bold;
449
+ overflow: hidden;
450
+ position: fixed;
451
+ top: 0;
452
+ left: 0;
453
+ z-index: 999;
479
454
  }
455
+ .humanEnterIcon {
456
+ position: fixed;
457
+ z-index: 999;
458
+ background-color: #0074ff;
459
+ border-radius: 50%;
460
+ width: 40px;
461
+ height: 40px;
462
+ text-align: center;
463
+ padding: 8px;
464
+ box-sizing: border-box;
465
+ /*transform: translate(100vw, 100vh);*/
466
+ transform: translate(50vw, 50vh);
467
+ }
468
+ .humanEnterIcon > svg {
469
+ width: 100%;
470
+ height: 100%;
471
+ fill: #fff;
472
+ }
473
+ .humanEnterIcon.unreadCount {
474
+ background-color: red;
475
+ color: #fff;
476
+ line-height: 24px;
477
+ font-size: 14px;
478
+ font-weight: bold;
480
479
  }
481
480
  .humanMainView {
482
- position: fixed;
483
- min-width: 420px;
484
- min-height: 400px;
485
- height: 80vh;
486
- border: 1px solid #ccc;
487
- .humanMainHeader {
488
- width: 100%;
489
- height: 40px;
490
- text-align: center;
491
- cursor: move;
492
- font-size: 0;
493
- box-sizing: border-box;
494
- border-bottom: 1px solid #f5f5f5;
495
- position: relative;
496
- z-index: 999;
497
- background: #fff;
498
- white-space: nowrap;
499
- .humanMainHeaderRight{
500
- text-align: right;
501
- }
502
- .humanMainHeaderLeft,.humanMainHeaderRight{
503
- width:20%;
504
- display: inline-block;
505
- vertical-align: middle;
506
- padding: 0 10px;
507
- line-height: 40px;
508
- font-size: 14px;
509
- box-sizing: border-box;
510
- }
511
- .humanMainHeaderCenter{
512
- width:60%;
513
- display: inline-block;
514
- vertical-align: middle;
515
- font-size: 16px;
516
- box-sizing: border-box;
517
- }
518
- }
519
- >iframe{
520
- width: 100%;
521
- height: calc(100% - 40px);
481
+ position: fixed;
482
+ min-width: 420px;
483
+ min-height: 400px;
484
+ height: 80vh;
485
+ border: 1px solid #ccc;
486
+ }
487
+ .humanMainView .humanMainHeader {
488
+ width: 100%;
489
+ height: 40px;
490
+ text-align: center;
491
+ cursor: move;
492
+ font-size: 0;
493
+ box-sizing: border-box;
494
+ border-bottom: 1px solid #f5f5f5;
495
+ position: relative;
496
+ z-index: 999;
497
+ background: #fff;
498
+ white-space: nowrap;
499
+ }
500
+ .humanMainView .humanMainHeader .humanMainHeaderRight {
501
+ text-align: right;
502
+ }
503
+ .humanMainView .humanMainHeader .humanMainHeaderLeft,
504
+ .humanMainView .humanMainHeader .humanMainHeaderRight {
505
+ width: 20%;
506
+ display: inline-block;
507
+ vertical-align: middle;
508
+ padding: 0 10px;
509
+ line-height: 40px;
510
+ font-size: 14px;
511
+ box-sizing: border-box;
512
+ }
513
+ .humanMainView .humanMainHeader .humanMainHeaderCenter {
514
+ width: 60%;
515
+ display: inline-block;
516
+ vertical-align: middle;
517
+ font-size: 16px;
518
+ box-sizing: border-box;
522
519
  }
520
+ .humanMainView > iframe {
521
+ width: 100%;
522
+ height: calc(100% - 40px);
523
523
  }
@@ -5200,7 +5200,7 @@
5200
5200
  if (product.toLowerCase() === "mase" || product.toLowerCase() === "aime" && subCustType === "overseas") {
5201
5201
  return "https://service.mase.cloud";
5202
5202
  }
5203
- return "https://human.shboka.com";
5203
+ return "https://baidu.com";
5204
5204
  },
5205
5205
  src() {
5206
5206
  let { token, product, subCustType, source } = this;
@@ -5214,8 +5214,10 @@
5214
5214
  };
5215
5215
  },
5216
5216
  mounted() {
5217
- this.icon();
5218
- this.chatMainInitDrag();
5217
+ setTimeout(() => {
5218
+ this.icon();
5219
+ this.chatMainInitDrag();
5220
+ });
5219
5221
  window.humanFunction = {
5220
5222
  showChatView: this.showChat
5221
5223
  };
@@ -5241,6 +5243,10 @@
5241
5243
  });
5242
5244
  },
5243
5245
  methods: {
5246
+ sendMsgToFrame(info) {
5247
+ let frame = document.querySelector("#iframe");
5248
+ frame.contentWindow.postMessage({ from: "human", info }, "*");
5249
+ },
5244
5250
  showChat(flag = true) {
5245
5251
  this.visible = flag;
5246
5252
  },
@@ -5248,6 +5254,7 @@
5248
5254
  this.visible = !this.visible;
5249
5255
  if (this.visible) {
5250
5256
  this.unreadCount = 0;
5257
+ this.sendMsgToFrame({ type: "toBottom" });
5251
5258
  }
5252
5259
  },
5253
5260
  showImg(url, messageItem) {
@@ -5274,7 +5281,7 @@
5274
5281
  icon() {
5275
5282
  const container = document.body;
5276
5283
  let defx = container.clientWidth - 40;
5277
- let defy = container.clientHeight - 150;
5284
+ let defy = Math.min(screen.availHeight, container.clientHeight) - 150;
5278
5285
  let tmpIcon = document.querySelector("#humanEnterIcon");
5279
5286
  tmpIcon.style.transform = `translate(${defx}px, ${defy}px)`;
5280
5287
  tmpIcon.setAttribute("data-x", defx);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "boka-human-cliend-v3",
3
- "version": "0.0.16",
3
+ "version": "0.0.18",
4
4
  "main": "dist/boka-human-v3.umd.js",
5
5
  "scripts": {
6
6
  "dev": "vite",
@@ -13,8 +13,9 @@
13
13
  },
14
14
  "devDependencies": {
15
15
  "@vitejs/plugin-vue": "^6.0.1",
16
+ "less": "^4.4.1",
17
+ "viewerjs": "^1.11.7",
16
18
  "vite": "^7.0.6",
17
- "vite-plugin-vue-devtools": "^8.0.0",
18
- "viewerjs": "^1.11.7"
19
+ "vite-plugin-vue-devtools": "^8.0.0"
19
20
  }
20
21
  }