evangelism-notice.ts 785 B

123456789101112131415161718192021222324252627282930
  1. import PageContainerBehavior from "../../../../core/behavior/page-container.behavior";
  2. import tickleBehavior, { getTickleContext } from "../../../../core/behavior/tickle.behavior";
  3. import { getDietMethod } from "../../request";
  4. // module/diet/pages/delivery-address/delivery-address.ts
  5. Component({
  6. behaviors: [
  7. PageContainerBehavior,
  8. tickleBehavior,
  9. ],
  10. lifetimes: {
  11. attached() {
  12. }
  13. },
  14. properties: {
  15. },
  16. data: {
  17. },
  18. methods: {
  19. async load() {
  20. wx.showLoading({ title: '加载中' });
  21. try {
  22. const dataset = await getDietMethod(this.data.id);
  23. this.setData({ dataset, title: dataset.name });
  24. } catch (error) {
  25. getTickleContext.call(this).showWarnMessage(error.errMsg);
  26. }
  27. wx.hideLoading();
  28. },
  29. }
  30. })