Page({
  data: {
    appointmentInfo: {
      operateTime: '',
      operateDuration: '',
      conditioningProgramSupplierName: '',
      cpSupplierDetailAddress: '',
      cpSupplierPhone: '',
      cpSupplierQrCode: '',
    },
  },
  onLoad(options: any) {
    if (options.appointmentInfo) {
      try {
        const appointmentInfo = JSON.parse(decodeURIComponent(options.appointmentInfo));
        this.setData({ appointmentInfo });
        this.generateQRCode(appointmentInfo?.cpSupplierQrCode || "");
        return;
      } catch (e) {
        // 解析失败
      }
    }
  },
  // 生成二维码
  generateQRCode(qrCodeUrl: any) {
    this.setData({
      qrCodeUrl
    });
  },
  onBack() {
    wx.redirectTo({
      url: `/module/care/pages/offlineTreatment/offlineTreatment`,
    });
  },

});
