飞天AI数字人展会页面
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

79 lines
2.3 KiB

11 months ago
10 months ago
11 months ago
  1. var ajaxUrl = 'http://192.168.99.86:3001'
  2. $(function () {
  3. // 退出程序
  4. $(".doubleExit").dblclick(function(){
  5. if (confirm("确定退出?")) {
  6. console.log("确定");
  7. } else {
  8. console.log("取消");
  9. }
  10. });
  11. // 首页样式操作
  12. $('.list-left li').hover(
  13. function() {
  14. $(this).removeClass('animate__backInLeft').addClass('animate__headShake');
  15. },
  16. function() {
  17. $(this).removeClass('animate__headShake')
  18. }
  19. );
  20. $('.list-right li').hover(
  21. function() {
  22. $(this).removeClass('animate__backInRight').addClass('animate__headShake');
  23. },
  24. function() {
  25. $(this).removeClass('animate__headShake')
  26. }
  27. );
  28. // 首页菜单点击操作
  29. $('.index-list li').on('click', function () {
  30. const _this = $(this)
  31. $('.ai-human').css('animation-duration', '0.2s').addClass('animate__animated animate__flash')
  32. setTimeout(function () {
  33. $('.list-left li').removeClass('animate__backInLeft').addClass('animate__animated animate__backOutLeft')
  34. $('.list-right li').removeClass('animate__backInRight').addClass('animate__animated animate__backOutRight')
  35. setTimeout(function(){
  36. const href = _this.find('a').attr('id');
  37. if (href === 'page1') {
  38. window.location.href = 'page1.html';
  39. } else if (href === 'page2') {
  40. window.location.href = 'page2.html';
  41. } else if (href === 'page3') {
  42. window.location.href = 'page3.html';
  43. } else if (href === 'page4') {
  44. window.location.href = 'page4.html';
  45. } else if (href === 'page5') {
  46. window.location.href = 'page5.html';
  47. } else if (href === 'aiChat') {
  48. window.location.href = 'ai_chat.html';
  49. }
  50. return false;
  51. },1000)
  52. }, 300)
  53. })
  54. })
  55. function FetchChatTalk () {
  56. $.ajax({
  57. url: ajaxUrl + '/api/v1/workspace/dxhtsg/chat',
  58. type: 'POST',
  59. headers: {
  60. "Authorization": "Bearer XVSPT0T-6P54SZH-QP36QKJ-KK77TN6"
  61. },
  62. contentType:'application/json',
  63. dataType: "json",
  64. data: JSON.stringify({
  65. "message": '你是谁',
  66. "mode":"chat"
  67. }),
  68. success: function (res) {
  69. console.log('res',res)
  70. },
  71. error: function (err) {
  72. console.log(err);
  73. }
  74. });
  75. }