drugCalendar.min.js 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. (function (c) {
  2. config.init();
  3. calendar.getToday();
  4. c(".hzApp-list-calendar-master h2.title").html(calendar.Y + "年" + (calendar.M + 1) + "月" + calendar.D + "日");
  5. c(".hzApp-list-calendar-master .arrowT").bind("tap", function () {
  6. if (c(this).hasClass("right")) {
  7. if (c(this).hasClass("month")) {
  8. calendar.M++
  9. } else {
  10. calendar.D++
  11. }
  12. } else {
  13. if (c(this).hasClass("left")) {
  14. if (c(this).hasClass("month")) {
  15. calendar.M--
  16. } else {
  17. calendar.D--
  18. }
  19. }
  20. }
  21. if (calendar.M > 11 || calendar.M < 0) {
  22. calendar.M = 0
  23. }
  24. if (calendar.D > calendar.getDaysInMonth(calendar.Y, calendar.M)) {
  25. calendar.D = 1
  26. }
  27. if (calendar.D < 1) {
  28. calendar.D = calendar.getDaysInMonth(calendar.Y, calendar.M)
  29. }
  30. c(".hzApp-list-calendar-master h2.title").html(calendar.Y + "年" + (calendar.M + 1) + "月" + calendar.D + "日");
  31. b.doing()
  32. });
  33. c("#ListCycle").bind("swipeRight", function () {
  34. c(".hzApp-list-calendar-master .arrowT.day.left").trigger("tap")
  35. });
  36. c("#ListCycle").bind("swipeLeft", function () {
  37. c(".hzApp-list-calendar-master .arrowT.day.right").trigger("tap")
  38. });
  39. c(".menu_drug_add").on("tap", function () {
  40. window.location = "drug_q_plan_add.html?id=" + JSON.parse(c("#familyList .selected a").attr("data")).id
  41. });
  42. var d = "";
  43. c("#ListCycle li a").on("tap", function () {
  44. var e = {night: "凌晨", morning: "上午", afternoon: "下午", evening: "晚上"};
  45. d = "服用清单 - " + calendar.Y + "年" + (calendar.M + 1) + "月" + calendar.D + "日 " + e[c(this).parent().attr("id")];
  46. icoNav.popWinLayer(c(this).attr("vhref"), d)
  47. });
  48. c(".hzApp-list-timeline li a").on("tap", function () {
  49. if (c(this).attr("vhref").length > 0) {
  50. d = c(this).find("h4").text();
  51. icoNav.popWinLayer(c(this).attr("vhref"), d)
  52. }
  53. });
  54. var b = {
  55. doing: function () {
  56. planPerDay.getAllPlan(calendar.Y + "-" + (calendar.M + 1) + "-" + calendar.D, JSON.parse(c("#familyList .selected a").attr("data")).id)
  57. }, init: function () {
  58. fn_call = {
  59. doing: function () {
  60. b.doing()
  61. }
  62. };
  63. hzAPI.getData(window.apiUrl+"?c=Index&a=customerFamilyList", {idCk: Fx.getUrlParam("id")}, "#familyList", 0, true, 4, null, null, fn_call)
  64. }
  65. };
  66. window.reload = b;
  67. b.init();
  68. var a = {
  69. idx: [1, 6, 7, 8],
  70. // count: 4,
  71. count: 2,
  72. current: 7};
  73. icoNavFx.doing(c("#nav_bottom"), a)
  74. })(Zepto);