care-scheme.ts 1.1 KB

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