"use strict";
const common_vendor = require("../../common/vendor.js");
const WORKORDER_pay_method = require("./method.js");
const WORKORDER_pay_model = require("./model.js");
require("../../gen/Apis.js");
require("../../common/libraries/request.js");
require("../../common/store/useWeAppAuthStore.js");
require("../../common/libraries/setTabBar.js");
require("../../common/libraries/apiLoading.js");
require("../../common/store/useWorkStore.js");
require("../../common/libraries/pay.js");
if (!Array) {
  const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
  const _easycom_hs_button2 = common_vendor.resolveComponent("hs-button");
  (_easycom_uni_icons2 + _easycom_hs_button2)();
}
const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
const _easycom_hs_button = () => "../../components/hs-button/hs-button.js";
if (!Math) {
  (_easycom_uni_icons + _easycom_hs_button)();
}
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
  __name: "index",
  setup(__props) {
    common_vendor.onLoad(async (e) => {
      var _a, _b;
      console.log("onLoad", e);
      await ((_a = common_vendor.getCurrentInstance()) == null ? void 0 : _a.appContext.config.globalProperties.$onLaunched);
      WORKORDER_pay_model.useModel.loadingLabel.value = "";
      WORKORDER_pay_model.useModel.loadingShowNumber.value = 0;
      WORKORDER_pay_model.useModel.hideStatus.value = false;
      WORKORDER_pay_model.useModel.payDisabled.value = false;
      WORKORDER_pay_model.useModel.OrderInfo.value = e;
      (_b = WORKORDER_pay_method.method) == null ? void 0 : _b.getShow();
    });
    common_vendor.onShow(() => {
      var _a, _b, _c, _d;
      if ((_b = (_a = WORKORDER_pay_model.useModel) == null ? void 0 : _a.hideStatus) == null ? void 0 : _b.value) {
        WORKORDER_pay_model.useModel.hideStatus.value = false;
        (_c = WORKORDER_pay_method.method) == null ? void 0 : _c.getShow(null);
        (_d = WORKORDER_pay_method.method) == null ? void 0 : _d.loadShow();
      }
      console.log("onShow");
    });
    common_vendor.onHide(() => {
      var _a, _b;
      if ((_b = (_a = WORKORDER_pay_model.useModel) == null ? void 0 : _a.payDisabled) == null ? void 0 : _b.value) {
        WORKORDER_pay_model.useModel.hideStatus.value = true;
      }
    });
    common_vendor.onUnload(() => {
      WORKORDER_pay_model.useModel.loadingLabel.value = "";
      WORKORDER_pay_model.useModel.loadingShowNumber.value = 0;
      WORKORDER_pay_model.useModel.hideStatus.value = false;
      WORKORDER_pay_model.useModel.payDisabled.value = false;
      clearInterval(WORKORDER_pay_model.useModel.timer.value);
    });
    return (_ctx, _cache) => {
      var _a, _b, _c, _d, _e, _f, _g, _h;
      return {
        a: common_vendor.t(((_b = (_a = common_vendor.unref(WORKORDER_pay_model.useModel)) == null ? void 0 : _a.orderShow.value) == null ? void 0 : _b.amount) || "0.00"),
        b: common_vendor.p({
          type: "checkbox-filled",
          size: "23",
          color: "#48B338"
        }),
        c: common_vendor.o(common_vendor.unref(WORKORDER_pay_method.method).onPay),
        d: common_vendor.p({
          type: "primary",
          size: "md",
          disabled: (_d = (_c = common_vendor.unref(WORKORDER_pay_model.useModel)) == null ? void 0 : _c.payDisabled) == null ? void 0 : _d.value,
          loading: (_f = (_e = common_vendor.unref(WORKORDER_pay_model.useModel)) == null ? void 0 : _e.payDisabled) == null ? void 0 : _f.value,
          loading_label: (_h = (_g = common_vendor.unref(WORKORDER_pay_model.useModel)) == null ? void 0 : _g.loadingLabel) == null ? void 0 : _h.value,
          label: "立即支付"
        })
      };
    };
  }
});
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__file", "/Users/zsq/Sources/github/2025property-pay/pay-customer/src/WORKORDER/pay/index.vue"]]);
wx.createPage(MiniProgramPage);
