diff --git a/main.js b/main.js index cdeb0e1..30528a6 100644 --- a/main.js +++ b/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); } diff --git a/public/assets/1.mp4 b/public/assets/1.mp4 deleted file mode 100644 index b71c0ee..0000000 Binary files a/public/assets/1.mp4 and /dev/null differ diff --git a/public/assets/act.png b/public/assets/act.png deleted file mode 100644 index d811e32..0000000 Binary files a/public/assets/act.png and /dev/null differ diff --git a/public/assets/act1.png b/public/assets/act1.png index a55a1c2..d811e32 100644 Binary files a/public/assets/act1.png and b/public/assets/act1.png differ diff --git a/public/assets/video.png b/public/assets/video.png deleted file mode 100644 index 139efd4..0000000 Binary files a/public/assets/video.png and /dev/null differ diff --git a/util.js b/util.js index 72109c0..0b58f3a 100644 --- a/util.js +++ b/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({