boka-human-cliend-v2 0.0.41 → 0.0.42

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "boka-human-cliend-v2",
3
- "version": "0.0.41",
3
+ "version": "0.0.42",
4
4
  "main": "dist/boka-human-v2.umd.js",
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve src/demo/main.js",
@@ -114,16 +114,16 @@ export default {
114
114
  }else{
115
115
  this.visible=true;
116
116
  }
117
-
117
+
118
118
  if(!this.fullScreen){
119
119
  this.chatMainInitDrag();
120
120
  }
121
121
  })
122
-
122
+
123
123
  window.humanFunction = {
124
124
  showChatView: this.showChat
125
125
  };
126
-
126
+
127
127
  let frame = document.querySelector("#iframe");
128
128
  frame.onload = function () {
129
129
  frame.contentWindow.postMessage({from:"human",info:{isFrame:true}},"*")
@@ -142,12 +142,12 @@ export default {
142
142
  this.unreadCount+=count;
143
143
  }
144
144
  }else if(type=="toAi"){//切换到智能体了,需要隐藏顶部
145
-
145
+
146
146
  }
147
147
  // console.log("外部[收到]了===>>>>",info);
148
148
  }
149
149
  });
150
-
150
+
151
151
  },
152
152
  methods:{
153
153
  sendMsgToFrame(info){
@@ -161,7 +161,7 @@ export default {
161
161
  this.visible=!this.visible;
162
162
  if(this.visible){
163
163
  this.unreadCount=0;
164
-
164
+
165
165
  this.sendMsgToFrame({type:"toBottom"});
166
166
  }
167
167
  },
@@ -194,7 +194,7 @@ export default {
194
194
  tmpIcon.style.transform = `translate(${defx}px, ${defy}px)`;
195
195
  tmpIcon.setAttribute('data-x', defx);
196
196
  tmpIcon.setAttribute('data-y', defy);
197
-
197
+
198
198
  interact('.humanEnterIcon')
199
199
  .on('tap', function (event) {
200
200
  event.preventDefault()
@@ -212,7 +212,7 @@ export default {
212
212
  var target = event.target
213
213
  var x = (parseFloat(target.getAttribute('data-x')) || 0) + event.dx
214
214
  var y = (parseFloat(target.getAttribute('data-y')) || 0) + event.dy
215
-
215
+
216
216
  // 限制纵向位置在容器内
217
217
  if (y < 0) {
218
218
  y = 0;
@@ -220,13 +220,13 @@ export default {
220
220
  if (y > container.clientHeight - target.offsetHeight) {
221
221
  y = container.clientHeight - target.offsetHeight;
222
222
  }
223
-
223
+
224
224
  // 横向限制:不允许停留在中间,拖动时允许在左侧区和右侧区之间滑动
225
225
  // 这里允许水平拖动到左右边界之间,但不允许停留中间,拖动结束时自动吸附
226
226
  // 但为了拖动顺畅,这里不限制x,吸附逻辑放在 dragend 事件
227
-
227
+
228
228
  target.style.transform = `translate(${x}px, ${y}px)`;
229
-
229
+
230
230
  // update the posiion attributes
231
231
  target.setAttribute('data-x', x)
232
232
  target.setAttribute('data-y', y)
@@ -262,7 +262,7 @@ export default {
262
262
  /*restriction: () => {
263
263
  const scrollTop = window.pageYOffset || document.documentElement.scrollTop;
264
264
  const scrollLeft = window.pageXOffset || document.documentElement.scrollLeft;
265
-
265
+
266
266
  return {
267
267
  left: scrollLeft,
268
268
  top: scrollTop,
@@ -280,18 +280,18 @@ export default {
280
280
  var target = event.target
281
281
  var x = (parseFloat(target.getAttribute('data-x')) || 0) + event.dx
282
282
  var y = (parseFloat(target.getAttribute('data-y')) || 0) + event.dy
283
-
283
+
284
284
  target.style.transform = 'translate(' + x + 'px, ' + y + 'px)'
285
-
285
+
286
286
  // update the posiion attributes
287
287
  target.setAttribute('data-x', x)
288
288
  target.setAttribute('data-y', y)
289
-
290
-
289
+
290
+
291
291
  /*const target = event.target;
292
292
  const x = (parseFloat(target.getAttribute('data-x')) || 0) + event.dx;
293
293
  const y = (parseFloat(target.getAttribute('data-y')) || 0) + event.dy;
294
-
294
+
295
295
  target.style.transform = `translate(${x}px, ${y}px)`;
296
296
  target.setAttribute('data-x', x);
297
297
  target.setAttribute('data-y', y);*/
@@ -346,11 +346,13 @@ export default {
346
346
  .humanMainView {
347
347
  position: fixed;
348
348
  min-width: 360px;
349
+ width: 400px;
349
350
  max-width: 600px;
350
351
  min-height: 360px;
351
352
  height: 80vh;
352
353
  //border: 1px solid #ccc;
353
354
  //transform: translate(10vw, 10vh);
355
+ box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
354
356
  &.full{
355
357
  padding-top: env(safe-area-inset-top); /* 0 ~ 50px 不等,由系统决定 */
356
358
  width: 100vw!important;
@@ -363,6 +365,7 @@ export default {
363
365
  z-index: 999;
364
366
  overflow: hidden;
365
367
  //transform: none;
368
+ box-shadow: none;
366
369
  }
367
370
  .humanMainHeader {
368
371
  width: 100%;
@@ -378,7 +381,7 @@ export default {
378
381
  background: url(https://rs.bokao2o.com/bkWeb/Def_BKWeb_AI_Header.png) center top / 100% no-repeat rgb(255, 255, 255);
379
382
  white-space: nowrap;
380
383
  user-select: none;
381
-
384
+
382
385
  max-width: 1000px;
383
386
  left: 50%;
384
387
  transform: translateX(-50%);
package/src/demo/App.vue CHANGED
@@ -1,8 +1,7 @@
1
1
  <template>
2
2
  <div id="app">
3
- ===
4
3
  <!-- token=Bearer 9f5f0c3cae2398961e254bd0fa3587&product=manageCenterPlus&custType=manageCenterPlus&subCustType=standard&source=g8&human=1&isIFrame=true&terminal=&domain=http%3A%2F%2F192.168.3.153%3A8080&time=1766385220881 -->
5
- <BokaHumanV2 :token="'Bearer 9f5f0c3cae2398961e254bd0fa3587'" :product="'manageCenterPlus'" :sub-cust-type="'standard'"/>
4
+ <BokaHumanV2 :token="'Bearer 53b2251627e82b29b521d78c5ac9a9ea'" :product="'manageCenterPlus'" :sub-cust-type="'standard'"/>
6
5
  <!--<Hello :token="'Bearer 8937d9ccf21264a83c3cb29aaf16dc7'" :product="'manageCenterPlus'" :sub-cust-type="'standard'"/>-->
7
6
  ---
8
7
  </div>
@@ -19,7 +18,7 @@ export default {
19
18
  Hello
20
19
  },
21
20
  mounted() {
22
-
21
+
23
22
  }
24
23
  }
25
24
  </script>