care-scheme.ts 1004 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // module/health/components/field-ruler/field-ruler.ts
  2. import { getCareRecordMethod } from "../../request";
  3. Component({
  4. behaviors: ["wx://form-field-group"],
  5. lifetimes: {
  6. attached() {
  7. this.getCareRecordList();
  8. },
  9. },
  10. /**
  11. * 组件的初始数据
  12. */
  13. data: {
  14. loading: false,
  15. careRecordList: [],
  16. },
  17. methods: {
  18. // 获取调养记录列表
  19. async getCareRecordList(e: any) {
  20. const data = await getCareRecordMethod();
  21. if(data && data.length > 0) {
  22. this.setData({
  23. careRecordList: data,
  24. });
  25. } else {
  26. this.setData({
  27. careRecordList: [],
  28. });
  29. }
  30. // console.log(this.data.careRecordList,'调理中的调养记录列表11');
  31. },
  32. // 跳转调养方案详情
  33. goDetail(e: any) {
  34. const id = e.currentTarget.dataset.id;
  35. if(id) {
  36. wx.navigateTo({
  37. url: `/module/care/pages/careDetail/careDetail?id=${id}`,
  38. });
  39. }
  40. },
  41. },
  42. properties: {},
  43. observers: {},
  44. });