"use strict";
const common_vendor = require("../../common/vendor.js");
require("../../common/libraries/request.js");
const common_store_useWeAppAuthStore = require("../../common/store/useWeAppAuthStore.js");
require("../../common/store/useWorkStore.js");
const common_libraries_getPageConfig = require("../../common/libraries/getPageConfig.js");
require("../../gen/Apis.js");
require("../../common/libraries/setTabBar.js");
require("../../common/libraries/apiLoading.js");
if (!Array) {
  const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
  const _easycom_up_loading_icon2 = common_vendor.resolveComponent("up-loading-icon");
  (_easycom_uni_icons2 + _easycom_up_loading_icon2)();
}
const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
const _easycom_up_loading_icon = () => "../../node-modules/uview-plus/components/u-loading-icon/u-loading-icon.js";
if (!Math) {
  (_easycom_uni_icons + _easycom_up_loading_icon)();
}
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
  __name: "hs-button",
  props: [
    "type",
    "label",
    "icon",
    "size",
    "openType",
    "iconColor",
    "buttonStyle",
    "disabled",
    "loading",
    "loading_label"
  ],
  emits: ["click", "onGetPhoneNumber"],
  setup(__props, { emit }) {
    const props = __props;
    const auth = common_store_useWeAppAuthStore.useWeAppAuthStore();
    const handleClick = () => {
      emit("click");
    };
    const handleGetPhoneNumber = (e) => {
      var _a;
      if (((_a = e == null ? void 0 : e.detail) == null ? void 0 : _a.errMsg) === "getPhoneNumber:ok") {
        emit("onGetPhoneNumber", e);
      }
    };
    const getStyleInfo = () => {
      var _a, _b, _c, _d;
      let style = (_c = (_b = (_a = auth == null ? void 0 : auth.data) == null ? void 0 : _a.config) == null ? void 0 : _b.companyConfig) == null ? void 0 : _c.config_value;
      (_d = style == null ? void 0 : style.color) == null ? void 0 : _d.metaColor;
      return {
        ...props.buttonStyle,
        ...common_libraries_getPageConfig.getStyleBgInfo(),
        color: "#fff"
      };
    };
    return (_ctx, _cache) => {
      return common_vendor.e({
        a: props == null ? void 0 : props.icon
      }, (props == null ? void 0 : props.icon) ? {
        b: common_vendor.p({
          type: props == null ? void 0 : props.icon,
          size: "16",
          color: (props == null ? void 0 : props.iconColor) || "#0082fa"
        })
      } : {}, {
        c: props == null ? void 0 : props.loading
      }, (props == null ? void 0 : props.loading) ? {
        d: common_vendor.p({
          mode: "circle",
          size: "15"
        })
      } : {}, {
        e: common_vendor.t((props == null ? void 0 : props.loading_label) || (props == null ? void 0 : props.label) || "我是按钮"),
        f: common_vendor.n((props == null ? void 0 : props.loading) || (props == null ? void 0 : props.icon) ? "btn_text" : ""),
        g: common_vendor.s(getStyleInfo()),
        h: (props == null ? void 0 : props.openType) || "",
        i: common_vendor.n(`nchl_button ${props == null ? void 0 : props.type}_button ${(props == null ? void 0 : props.size) || "sm"}_size`),
        j: common_vendor.o(handleClick),
        k: props == null ? void 0 : props.disabled,
        l: common_vendor.o(handleGetPhoneNumber)
      });
    };
  }
});
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-abb95bf8"], ["__file", "/Users/zsq/Sources/github/2025property-pay/pay-customer/src/components/hs-button/hs-button.vue"]]);
wx.createComponent(Component);
