customer.js 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. // 屏幕试图的高度
  2. let screenHeight = $(window).height()
  3. // 客户管家
  4. let collaborationTeamHight = $('#collaborationTeam').offset().top
  5. $(window).scroll(function () {
  6. // 当前滚动的高度
  7. let currentTop = $(window).scrollTop()
  8. if(currentTop < 2) {
  9. $('#all').removeClass('hanAll')
  10. $('#abc').addClass('abc')
  11. $('#navigationBar').removeClass('white')
  12. } else {
  13. $("#all").addClass("hanAll");
  14. $("#abc").removeClass("abc");
  15. $("#navigationBar").addClass("white");
  16. }
  17. // 客户管家滚动计算
  18. if(currentTop > collaborationTeamHight && currentTop < (collaborationTeamHight + screenHeight)) {
  19. let teamOffset = (currentTop - collaborationTeamHight) / screenHeight
  20. console.log(teamOffset, '透明度')
  21. $('#collCentImg').css({'transform': `translate(0, ${(1 - teamOffset) * 250}px)`})
  22. $('#collCentFonts').css({'opacity': teamOffset})
  23. }
  24. })
  25. // 导航下划线
  26. $('.aus li').hover(function () {
  27. let i = $(this).index()
  28. $(".aus li").eq(i).addClass('tils')
  29. },function () {
  30. let i = $(this).index()
  31. $(".aus li").eq(i).removeClass('tils')
  32. })
  33. $('.auss li').hover(function () {
  34. let i = $(this).index()
  35. $(".auss li").eq(i).addClass('tils')
  36. },function () {
  37. let i = $(this).index()
  38. $(".auss li").eq(i).removeClass('tils')
  39. })
  40. // 客服hover
  41. $('#zhixun').hover(function () {
  42. $("#zhixun").show()
  43. $("#consultigImg").attr("src", './image/ions/kefu1.png')
  44. },function () {
  45. $("#zhixun").hide()
  46. $("#consultigImg").attr("src", './image/ions/kefu2.png')
  47. })
  48. $('#consulting').hover(function () {
  49. $("#zhixun").show()
  50. $("#consultigImg").attr("src", './image/ions/kefu1.png')
  51. },function () {
  52. $("#zhixun").hide()
  53. $("#consultigImg").attr("src", './image/ions/kefu2.png')
  54. })
  55. // 产品鼠标移入移出
  56. let fls = true
  57. $('#productHov').hover(function () {$("#product").show()},function () {
  58. setTimeout(function() {
  59. if(fls) {
  60. $("#product").hide()
  61. }
  62. }, 200)
  63. })
  64. $('#product').hover(function () {
  65. fls = false
  66. $("#product").show()
  67. },function () {
  68. fls = true
  69. $("#product").hide()
  70. })
  71. // 特色展示
  72. $('#specialShowConLeftUL li').click(function () {
  73. let index = $(this).index()
  74. // console.log(index, '索引')
  75. $('#tesTex').html(+index + 1 + '/11')
  76. $('#tesSpan').css('width', (+index + 1) * 9.09 + '%')
  77. let arr = $('#specialShowConLeftUL li')
  78. // if(index != '1' && index != '7') {
  79. for(let i in arr) {
  80. $('#specialShowConLeftUL li').removeClass('on')
  81. }
  82. $(this).addClass("on")
  83. $('#easyManBoxConImg').attr("src", './image/customer/li'+(+index + 1)+'.png')
  84. // }
  85. })
  86. // 用户评价点击事件
  87. let numberClick = 0
  88. // 移动的距离
  89. let mobiledistance = 0
  90. $(function() {
  91. kehuFlg()
  92. $('#kehuRight').click(function() {
  93. if(numberClick < 3) {
  94. numberClick++
  95. zuoyouClick()
  96. }
  97. })
  98. $('#kehuLeft').click(function() {
  99. if(numberClick > 0 && numberClick <= 3) {
  100. numberClick--
  101. zuoyouClick()
  102. }
  103. })
  104. })
  105. function zuoyouClick() {
  106. console.log(numberClick)
  107. mobiledistance = '-' + (numberClick * 68.75) + 'rem'
  108. $('.evaluationConIkun').stop(true,false).animate({
  109. 'left': mobiledistance
  110. }, 400)
  111. kehuFlg()
  112. }
  113. function kehuFlg() {
  114. if(numberClick == 0) {
  115. $('#kehuLeft').addClass("zhis")
  116. } else {
  117. $('#kehuLeft').removeClass("zhis")
  118. }
  119. if(numberClick >= 3) {
  120. $('#kehuRight').addClass("zhis")
  121. } else {
  122. $('#kehuRight').removeClass("zhis")
  123. }
  124. }