punch-card.ts 1001 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. import PageContainerBehavior from "../../../../core/behavior/page-container.behavior";
  2. import tickleBehavior, { getTickleContext } from "../../../../core/behavior/tickle.behavior";
  3. import { addPatientOnlineRecord } from "../../request"
  4. // module/article/pages/punch-card/punch-card.ts
  5. Page({
  6. behaviors: [
  7. PageContainerBehavior,
  8. tickleBehavior,
  9. ],
  10. onLoad(options) {
  11. if (options.id) {
  12. this.setData({ id: options.id });
  13. wx.setStorageSync('recordId', options.id);
  14. }
  15. // 获取当前日期
  16. this.getCurrentDate();
  17. },
  18. properties: {
  19. },
  20. data: {
  21. id: '',
  22. currentDate: '',
  23. },
  24. onSelect(e: any) {
  25. this.setData({ currentDate: e.detail.selectedDate });
  26. },
  27. // 获取当前日期
  28. getCurrentDate() {
  29. const date = new Date();
  30. this.setData({
  31. currentDate: `${date.getFullYear().toString()} ${date.getMonth() + 1}.${date.getDate().toString()}`
  32. });
  33. },
  34. onCalendarChange(e: any) {
  35. // 处理日期切换
  36. // e.detail.date
  37. }
  38. })