index.min.js 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. }else{
  14. window.location.href = 'loginOut.html';
  15. }
  16. // if (c("#container").hasClass("push") == false) {
  17. // if (a == 0) {
  18. // c("#container,#user,#header,#nav_bottom").addClass("pull");
  19. // a = 1;
  20. // c(window).on("touchmove", function (f) {
  21. // f.preventDefault();
  22. // f.stopImmediatePropagation()
  23. // });
  24. // c("#us_panel").addClass("hide")
  25. // } else {
  26. // c("#container,#user,#header,#nav_bottom").removeClass("pull");
  27. // a = 0;
  28. // c(window).unbind("touchmove")
  29. // }
  30. // }
  31. return false
  32. });
  33. c(".search_input").on("input", function () {
  34. if (c(".search_input").val().length > 0) {
  35. c(".reset_input").show()
  36. } else {
  37. c(".reset_input").hide()
  38. }
  39. });
  40. c(".reset_input").on("touchstart touchend", function (d) {
  41. if (d.type == "touchstart") {
  42. c(".search_input").val("");
  43. c(".reset_input").addClass("ton")
  44. } else {
  45. if (d.type == "touchend") {
  46. c(".reset_input").removeClass("ton").hide()
  47. }
  48. }
  49. });
  50. c("a.needlogin").on("click",function (e) {
  51. var token = window.hzAPI.getToken().token;//token
  52. //判断token是否存在
  53. if(!token){
  54. window.location.href = 'login.html';
  55. e.preventDefault();
  56. }
  57. })
  58. })(Zepto);