Browse Source

fix: 修改

master
高志龙 1 year ago
parent
commit
259b74d511
  1. 25
      main.js
  2. BIN
      public/assets/1.mp4
  3. BIN
      public/assets/act.png
  4. BIN
      public/assets/act1.png
  5. BIN
      public/assets/video.png
  6. 5
      util.js

25
main.js

@ -47,20 +47,6 @@ window.audioStart = () => {
addMy(); //添加我气泡
setScrollPosition();
}
// addBackItemText("思考中...","ing",false)
// setScrollPosition();
// let res = {
// code:200,
// data: {
// "type": "video",
// "value": {
// "text":"德基美术馆",
// "content":[{"logo":"/assets/act.png","video":"/assets/1.mp4"},{"logo":"/assets/act1.png","img":"/assets/video.png"}]
// }
// }
// }
// callBack(res);
}
function delMy(){
@ -83,6 +69,8 @@ function callBack(str){
addredHot();
}
switch(obj.data.type){
case undefined:
break;
case "shopList" :
if(typeof obj.data.value.length == "number"){
obj.data.value.forEach((item, index)=>{
@ -169,6 +157,7 @@ function callBack(str){
window.clickCoupon = function(event){
console.log(event.target.dataset.pop);
window.isplayHello = false; //停止播放招呼语音
window.stopTTS();
let mark = document.getElementById("mark");
mark.style.display = "flex";
let video = document.createElement("img");
@ -180,11 +169,13 @@ window.clickCoupon = function(event){
video.remove();
mark.style.display = "none";
window.isplayHello = true;
window.hello();
})
}
window.clickVideo = function(event){
console.log(event.target.dataset.video);
window.isplayHello = false; //停止播放招呼语音
window.stopTTS();
let mark = document.getElementById("mark");
mark.style.display = "flex";
let video = document.createElement("video");
@ -197,6 +188,7 @@ window.clickVideo = function(event){
video.remove();
mark.style.display = "none";
window.isplayHello = true;
window.hello();
})
}
@ -209,7 +201,7 @@ let getAiData = async (msg) => {
user: 'djdemo'
},{
headers: {
'Authorization': 'Bearer app-DjzwAeiecJhqdavo6Xev0fUr'
'Authorization': 'Bearer app-Fzon9DlAGNVwJSSrjF1gCiw4'
}
});
console.log(response)
@ -253,6 +245,7 @@ window.playOver=()=>{
document.getElementById("hVideo").style.display = "none";
document.getElementById("aVideo").style.display = "none";
window.hello();
window.isplayHello=true;
}
window.timer=-1;
window.isplayHello=true;
@ -263,8 +256,6 @@ window.hello=()=>{
if(window.isplayHello){
window.isHello=true;
window.startTTS("您好呀,我是德基广场数字客服小德,请问有什么需要帮助的吗?");
}else{
window.hello();
}
},60000);
}

BIN
public/assets/1.mp4

Binary file not shown.

BIN
public/assets/act.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 KiB

BIN
public/assets/act1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 117 KiB

After

Width:  |  Height:  |  Size: 61 KiB

BIN
public/assets/video.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 200 KiB

5
util.js

@ -62,7 +62,7 @@ function setScrollPosition() {
behavior: 'smooth'
});
}
},100);
},200);
}
function addAvdi(){
@ -117,6 +117,7 @@ function addBackItemText(msg, idName="", isTTS=true){
}
if(isTTS){
window.isHello = false;
window.isplayHello=false;
startTTS(div.innerText);
}
}
@ -141,6 +142,7 @@ function addItemBigImg(imgUrl, videoUrl, clickFun){
document.getElementById("cont").appendChild(li_img);
let w = (scaleW/(1080/535));
li_img.style.width = w+"px";
li_img.style.borderRadius = "20px";
li_img.src = imgUrl;
li_img.width = w;
li_img.dataset.video = videoUrl;
@ -206,7 +208,6 @@ var config = {
"API_KEY":"2d1e9e5604d66089bda42ff4797201c1"
}
export {initDate,onchangeSize,setScrollPosition,addBackItemText,addItemImg,addWrapper,addClickItemImg,addAvdi,addItemSmallImg,addItemBigImg,addredHot,addBackItemAction, config}
//
// requestNoJM({

Loading…
Cancel
Save