"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.ref([null, null, null, null]);
    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: common_vendor.wx$1.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: "妆发预约",
        num: 0,
        title: "包括底妆,眉毛,眼妆,腮红和唇妆,根据您的肤色和服装风格进行个性化设计"
      },
      {
        img: "https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FDFNymmCN-sheying.png",
        name: "摄影服务",
        num: 0,
        title: "提供专业的摄影棚和灯光设备,为客户打造舒适的拍摄环境"
      }
    ]);
    const zhi = common_vendor.ref("0");
    const showWhole = (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 openPopup2 = () => {
      showPopup2.value = true;
      popup2.value.open("center");
    };
    common_vendor.ref(null);
    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 add = (index) => {
      if (Own.value[index].num > 0) {
        Own.value[index].num -= 1;
      }
    };
    const jian = (index) => {
      Own.value[index].num += 1;
    };
    return (_ctx, _cache) => {
      return common_vendor.e({
        a: showPopup1.value
      }, showPopup1.value ? {
        b: common_vendor.o(close1),
        c: common_vendor.sr(popup1, "cad4fb76-0", {
          "k": "popup1"
        }),
        d: common_vendor.p({
          ["mask-click"]: false,
          ["background-color"]: "white"
        })
      } : {}, {
        e: showPopup2.value
      }, showPopup2.value ? {
        f: common_vendor.o(close2),
        g: common_vendor.sr(popup2, "cad4fb76-1", {
          "k": "popup2"
        }),
        h: common_vendor.p({
          ["mask-click"]: false,
          ["background-color"]: "white"
        })
      } : {}, {
        i: common_vendor.o(($event) => showWhole("0")),
        j: common_vendor.o(($event) => showWhole("1")),
        k: zhi.value === "0"
      }, zhi.value === "0" ? {
        l: 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), item)
          };
        })
      } : {}, {
        m: zhi.value === "1"
      }, zhi.value === "1" ? {
        n: common_vendor.f(Own.value, (item, index, i0) => {
          return {
            a: item.img,
            b: common_vendor.t(item.name),
            c: common_vendor.t(item.title),
            d: common_vendor.o(($event) => add(index), item),
            e: common_vendor.t(item.num),
            f: common_vendor.o(($event) => jian(index), item),
            g: item
          };
        })
      } : {}, {
        o: 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"]]);
wx.createPage(MiniProgramPage);