import PageContainerBehavior from "../../../../core/behavior/page-container.behavior";
import DictionariesBehavior from "../../../../core/behavior/dictionaries.behavior";
import tickleBehavior from "../../../../core/behavior/tickle.behavior";

// module/order/pages/appointment-success/appointment-success.ts
Page({
  behaviors: [PageContainerBehavior, DictionariesBehavior, tickleBehavior],
  data: {
    appointmentInfo: {
    },
  },
  onLoad(options: any) {
    if(options.goodsInfo){
      const goodsInfo = JSON.parse(decodeURIComponent(options.goodsInfo));
      this.setData({
        appointmentInfo: goodsInfo,
      });
    }
  },
  // 返回非药物治疗页面
  onReturn() {
    // 返回到非药物治疗页面，传递预约成功参数
    const { appointmentInfo } = this.data;
    wx.redirectTo({
      url: `/module/care/pages/offlineTreatment/offlineTreatment?id=${appointmentInfo?.id}`,
    });
  },
})