"use strict";
const common_vendor = require("../../common/vendor.js");
if (!Array) {
  const _easycom_up_icon2 = common_vendor.resolveComponent("up-icon");
  const _easycom_hs_button2 = common_vendor.resolveComponent("hs-button");
  const _easycom_up_popup2 = common_vendor.resolveComponent("up-popup");
  (_easycom_up_icon2 + _easycom_hs_button2 + _easycom_up_popup2)();
}
const _easycom_up_icon = () => "../../node-modules/uview-plus/components/u-icon/u-icon.js";
const _easycom_hs_button = () => "../hs-button/hs-button.js";
const _easycom_up_popup = () => "../../node-modules/uview-plus/components/u-popup/u-popup.js";
if (!Math) {
  (_easycom_up_icon + _easycom_hs_button + _easycom_up_popup)();
}
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
  __name: "hs-popup-evaluate",
  props: ["show", "mode", "insetBottom", "round", "closeable", "bgColor"],
  emits: ["onSubmit", "onClose"],
  setup(__props, { emit }) {
    const props = __props;
    const rating = common_vendor.ref(-1);
    const evaluateObj = {
      1: "非常差",
      2: "比较差",
      3: "一般",
      4: "满意",
      5: "非常满意"
    };
    const onClickCurrent = (idx) => {
      console.log(idx, "idx");
      rating.value = idx;
    };
    const onClose = () => {
      emit("onClose");
    };
    const onSubmit = () => {
      if ((rating == null ? void 0 : rating.value) > -1) {
        emit("onSubmit", { rating: rating.value });
      } else {
        common_vendor.index.showToast({
          title: "请先评价",
          icon: "none"
        });
      }
    };
    return (_ctx, _cache) => {
      return common_vendor.e({
        a: common_vendor.f(5, (i, index, i0) => {
          return {
            a: index,
            b: common_vendor.o(($event) => onClickCurrent(i), index),
            c: "ad578632-1-" + i0 + ",ad578632-0",
            d: common_vendor.p({
              name: "star-fill",
              size: "32",
              color: index < rating.value ? "#FFC53D" : "#F3F3F4"
            })
          };
        }),
        b: rating.value > -1
      }, rating.value > -1 ? {
        c: common_vendor.t(evaluateObj[rating.value])
      } : {}, {
        d: common_vendor.o(onSubmit),
        e: common_vendor.p({
          type: "primary",
          label: "提交评价",
          size: "md"
        }),
        f: common_vendor.o(onClose),
        g: common_vendor.p({
          customStyle: (props == null ? void 0 : props.insetBottom) ? {
            bottom: "calc(env(safe-area-inset-bottom) + 48px)"
          } : {},
          overlayStyle: (props == null ? void 0 : props.insetBottom) ? {
            bottom: "calc(env(safe-area-inset-bottom) + 48px)"
          } : {},
          show: props.show,
          mode: (props == null ? void 0 : props.mode) || "top",
          round: (props == null ? void 0 : props.round) || 0,
          closeable: props == null ? void 0 : props.closeable,
          bgColor: props == null ? void 0 : props.bgColor
        })
      });
    };
  }
});
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-ad578632"], ["__file", "/Users/zsq/Sources/github/2025property-pay/pay-customer/src/components/hs-popup-evaluate/hs-popup-evaluate.vue"]]);
wx.createComponent(Component);
