boka-human-cliend-v2 0.0.40 → 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/dist/boka-human-v2.common.js +33 -33
- package/dist/boka-human-v2.css +1 -1
- package/dist/boka-human-v2.umd.js +33 -33
- package/dist/boka-human-v2.umd.min.js +2 -2
- package/package.json +1 -1
- package/src/BokaHumanV2.vue +27 -20
- package/src/demo/App.vue +3 -3
package/package.json
CHANGED
package/src/BokaHumanV2.vue
CHANGED
|
@@ -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);*/
|
|
@@ -317,14 +317,19 @@ export default {
|
|
|
317
317
|
.humanEnterIcon{
|
|
318
318
|
position: fixed;
|
|
319
319
|
z-index: 999;
|
|
320
|
-
|
|
320
|
+
background-color: #0074ff;
|
|
321
321
|
border-radius: 50%;
|
|
322
|
+
//width: 56px;
|
|
323
|
+
//height: 56px;
|
|
322
324
|
width: 40px;
|
|
323
325
|
height: 40px;
|
|
324
326
|
text-align: center;
|
|
325
327
|
box-sizing: border-box;
|
|
326
328
|
/*transform: translate(100vw, 100vh);*/
|
|
327
329
|
transform: translate(50vw, 50vh);
|
|
330
|
+
box-shadow: rgba(0, 0, 0, 0.2) 0 0 10px;
|
|
331
|
+
padding: 8px;
|
|
332
|
+
//background: #fff;
|
|
328
333
|
>svg{
|
|
329
334
|
width: 100%;
|
|
330
335
|
height:100%;
|
|
@@ -336,17 +341,18 @@ export default {
|
|
|
336
341
|
line-height: 24px;
|
|
337
342
|
font-size: 14px;
|
|
338
343
|
font-weight: bold;
|
|
339
|
-
padding: 8px;
|
|
340
344
|
}
|
|
341
345
|
}
|
|
342
346
|
.humanMainView {
|
|
343
347
|
position: fixed;
|
|
344
348
|
min-width: 360px;
|
|
349
|
+
width: 400px;
|
|
345
350
|
max-width: 600px;
|
|
346
351
|
min-height: 360px;
|
|
347
352
|
height: 80vh;
|
|
348
353
|
//border: 1px solid #ccc;
|
|
349
354
|
//transform: translate(10vw, 10vh);
|
|
355
|
+
box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
|
|
350
356
|
&.full{
|
|
351
357
|
padding-top: env(safe-area-inset-top); /* 0 ~ 50px 不等,由系统决定 */
|
|
352
358
|
width: 100vw!important;
|
|
@@ -359,6 +365,7 @@ export default {
|
|
|
359
365
|
z-index: 999;
|
|
360
366
|
overflow: hidden;
|
|
361
367
|
//transform: none;
|
|
368
|
+
box-shadow: none;
|
|
362
369
|
}
|
|
363
370
|
.humanMainHeader {
|
|
364
371
|
width: 100%;
|
|
@@ -374,7 +381,7 @@ export default {
|
|
|
374
381
|
background: url(https://rs.bokao2o.com/bkWeb/Def_BKWeb_AI_Header.png) center top / 100% no-repeat rgb(255, 255, 255);
|
|
375
382
|
white-space: nowrap;
|
|
376
383
|
user-select: none;
|
|
377
|
-
|
|
384
|
+
|
|
378
385
|
max-width: 1000px;
|
|
379
386
|
left: 50%;
|
|
380
387
|
transform: translateX(-50%);
|
package/src/demo/App.vue
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div id="app">
|
|
3
|
-
|
|
4
|
-
<BokaHumanV2 :token="'Bearer
|
|
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 -->
|
|
4
|
+
<BokaHumanV2 :token="'Bearer 53b2251627e82b29b521d78c5ac9a9ea'" :product="'manageCenterPlus'" :sub-cust-type="'standard'"/>
|
|
5
5
|
<!--<Hello :token="'Bearer 8937d9ccf21264a83c3cb29aaf16dc7'" :product="'manageCenterPlus'" :sub-cust-type="'standard'"/>-->
|
|
6
6
|
---
|
|
7
7
|
</div>
|
|
@@ -18,7 +18,7 @@ export default {
|
|
|
18
18
|
Hello
|
|
19
19
|
},
|
|
20
20
|
mounted() {
|
|
21
|
-
|
|
21
|
+
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
</script>
|