"use strict";
const common_vendor = require("../../../common/vendor.js");
const api_request = require("../../../api/request.js");
if (!Array) {
  const _easycom_uni_popup2 = common_vendor.resolveComponent("uni-popup");
  _easycom_uni_popup2();
}
const _easycom_uni_popup = () => "../../../uni_modules/uni-popup/components/uni-popup/uni-popup.js";
if (!Math) {
  _easycom_uni_popup();
}
const _sfc_main = {
  __name: "respectable",
  setup(__props) {
    common_vendor.onMounted(() => {
      getWhole();
    });
    common_vendor.ref([]);
    const Whole = common_vendor.ref([{}]);
    const getWhole = async () => {
      const res = await common_vendor.index.request({
        url: api_request.baseUrl + "/clothesGrade/list",
        method: "POST",
        header: {
          cookie: wx.getAccountInfoSync("cookie")
        },
        data: {}
      });
      if (res.data.code === 1) {
        Whole.value = res.data.data;
      } else {
        uin.showtoast({
          icon: "error",
          title: "获取失败"
        });
      }
    };
    const Own = common_vendor.ref([
      {
        img: "https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FObQGBPnJ-zhuangfa.png",
        name: "妆发预约",
        price: "20",
        title: "包括底妆,眉毛,眼妆,腮红和唇妆,根据您的肤色和服装风格进行个性化设计"
      },
      {
        img: "https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FDFNymmCN-sheying.png",
        name: "摄影服务",
        price: "15",
        title: "提供专业的摄影棚和灯光设备,为客户打造舒适的拍摄环境"
      }
    ]);
    const zhi = common_vendor.ref("0");
    const showWhole = (zhiValue) => {
      zhi.value = zhiValue;
    };
    const showOwn = (zhiValue) => {
      zhi.value = zhiValue;
    };
    const close1 = () => {
      popup1.value.close();
    };
    const close2 = () => {
      popup2.value.close();
    };
    const popup1 = common_vendor.ref(null);
    const popup2 = common_vendor.ref(null);
    const showPopup1 = common_vendor.ref(false);
    const showPopup2 = common_vendor.ref(false);
    const openPopup1 = () => {
      showPopup1.value = true;
      popup1.value.open("center");
    };
    const openPopup2 = () => {
      showPopup2.value = true;
      popup2.value.open("center");
    };
    const selectedLocation = common_vendor.ref(null);
    const handleLocationChange = (e) => {
      selectedLocation.value = e.detail.value;
      console.log(selectedLocation.value);
    };
    const goToText = (index) => {
      console.log(index);
      common_vendor.index.navigateTo({
        url: "/pages/booking/CostumeDisplay/CostumeDisplay?info=" + JSON.stringify(Whole.value[index].id)
      });
      console.log(Whole.value[index].id);
    };
    const goToContact = () => {
      common_vendor.index.navigateTo({
        url: "/pages/mine/Contact/Contact"
      });
    };
    return (_ctx, _cache) => {
      return common_vendor.e({
        a: showPopup1.value
      }, showPopup1.value ? {
        b: common_vendor.o(close1),
        c: () => ({
          r: popup1,
          k: "popup1"
        }),
        d: common_vendor.p({
          ["mask-click"]: false,
          ["background-color"]: "white"
        })
      } : {}, {
        e: showPopup2.value
      }, showPopup2.value ? {
        f: common_vendor.o(close2),
        g: () => ({
          r: popup2,
          k: "popup2"
        }),
        h: common_vendor.p({
          ["mask-click"]: false,
          ["background-color"]: "white"
        })
      } : {}, {
        i: common_vendor.o(($event) => goToContact()),
        j: common_vendor.o(($event) => showWhole("0")),
        k: common_vendor.o(($event) => showOwn("1")),
        l: zhi.value === "0"
      }, zhi.value === "0" ? {
        m: common_vendor.f(Whole.value, (item, index, i0) => {
          return {
            a: item.image,
            b: common_vendor.t(item.clothesType),
            c: common_vendor.t(item.minPrice),
            d: common_vendor.t(item.maxPrice),
            e: common_vendor.t(item.brief),
            f: item,
            g: common_vendor.o(($event) => goToText(index))
          };
        }),
        n: common_vendor.o(handleLocationChange),
        o: common_vendor.o(openPopup1)
      } : {}, {
        p: zhi.value === "1"
      }, zhi.value === "1" ? {
        q: common_vendor.f(Own.value, (item, k0, i0) => {
          return {
            a: item.img,
            b: common_vendor.t(item.name),
            c: common_vendor.t(item.price),
            d: common_vendor.t(item.title),
            e: item
          };
        }),
        r: common_vendor.o(handleLocationChange),
        s: common_vendor.o(openPopup1)
      } : {}, {
        t: common_vendor.o(openPopup2)
      });
    };
  }
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-cad4fb76"], ["__file", "D:/jiangchengfeiyi-xiaochengxu/pages/booking/respectable/respectable.vue"]]);
my.createPage(MiniProgramPage);