success-page.ts 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. if (options.title) {
  22. this.setData({ title: options.title });
  23. }
  24. },
  25. onBackOrderList() {
  26. // wx.redirectTo({ url: '/module/article/pages/order-list/order-list' });
  27. // 先到「我的」再自动进订单列表,这样订单列表返回时栈上是「我的」
  28. wx.setStorageSync("fromSuccessToOrderList", "1");
  29. wx.redirectTo({ url: "/pages/mine/mine" });
  30. },
  31. async load() {
  32. wx.showLoading({ title: '加载中' });
  33. try {
  34. const dataset = await getDietMethod(this.data.id);
  35. this.setData({ dataset, title: dataset.name });
  36. } catch (error) {
  37. getTickleContext.call(this).showWarnMessage(error.errMsg);
  38. }
  39. wx.hideLoading();
  40. },
  41. })