success-page.ts 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. Page({
  6. behaviors: [
  7. PageContainerBehavior,
  8. tickleBehavior,
  9. ],
  10. lifetimes: {
  11. attached() {
  12. }
  13. },
  14. properties: {
  15. },
  16. data: {
  17. title: '',
  18. successImg: 'https://wx.hzliuzhi.com:4433/manager/file/statics/2025/07/11/img_success@3x_20250711171518A500.png',
  19. },
  20. onLoad(options: any) {
  21. console.log(options, "options");
  22. if (options.title) {
  23. this.setData({ title: options.title });
  24. }
  25. },
  26. onBackOrderList() {
  27. // wx.redirectTo({ url: '/module/article/pages/order-list/order-list' });
  28. // 先到「我的」再自动进订单列表,这样订单列表返回时栈上是「我的」
  29. wx.setStorageSync("fromSuccessToOrderList", "1");
  30. wx.redirectTo({ url: "/pages/mine/mine" });
  31. },
  32. async load() {
  33. wx.showLoading({ title: '加载中' });
  34. try {
  35. const dataset = await getDietMethod(this.data.id);
  36. this.setData({ dataset, title: dataset.name });
  37. } catch (error) {
  38. getTickleContext.call(this).showWarnMessage(error.errMsg);
  39. }
  40. wx.hideLoading();
  41. },
  42. })