index.min.js 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. (function (c) {
  2. config.init();
  3. var a = 0;
  4. // var b = {idx: [1, 6, 7, 8], count: 4, current: 1};
  5. var b = {idx: [1, 6, 7, 8], count: 2, current: 1};
  6. icoNavFx.doing(c("#nav_bottom"), b);
  7. c(".login_open").on("touchend", function (d) {
  8. var token = window.hzAPI.getToken().token;//token
  9. //判断token是否存在
  10. if(!token){
  11. window.location.href = 'login.html';
  12. e.preventDefault();
  13. }
  14. if (c("#container").hasClass("push") == false) {
  15. if (a == 0) {
  16. c("#container,#user,#header,#nav_bottom").addClass("pull");
  17. a = 1;
  18. c(window).on("touchmove", function (f) {
  19. f.preventDefault();
  20. f.stopImmediatePropagation()
  21. });
  22. c("#us_panel").addClass("hide")
  23. } else {
  24. c("#container,#user,#header,#nav_bottom").removeClass("pull");
  25. a = 0;
  26. c(window).unbind("touchmove")
  27. }
  28. }
  29. return false
  30. });
  31. c(".search_input").on("input", function () {
  32. if (c(".search_input").val().length > 0) {
  33. c(".reset_input").show()
  34. } else {
  35. c(".reset_input").hide()
  36. }
  37. });
  38. c(".reset_input").on("touchstart touchend", function (d) {
  39. if (d.type == "touchstart") {
  40. c(".search_input").val("");
  41. c(".reset_input").addClass("ton")
  42. } else {
  43. if (d.type == "touchend") {
  44. c(".reset_input").removeClass("ton").hide()
  45. }
  46. }
  47. });
  48. c("a.needlogin").on("click",function (e) {
  49. var token = window.hzAPI.getToken().token;//token
  50. //判断token是否存在
  51. if(!token){
  52. window.location.href = 'login.html';
  53. e.preventDefault();
  54. }
  55. })
  56. })(Zepto);