punch-card.ts 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. console.log(e, '子组件传来的参数');
  26. this.setData({ currentDate: e.detail.selectedDate });
  27. },
  28. // 获取当前日期
  29. getCurrentDate() {
  30. const date = new Date();
  31. this.setData({
  32. currentDate: `${date.getFullYear().toString()} ${date.getMonth() + 1}.${date.getDate().toString()}`
  33. });
  34. },
  35. onCalendarChange(e: any) {
  36. // 处理日期切换
  37. // e.detail.date
  38. }
  39. })