jiangchengfeiyi-xiaochengxu/unpackage/dist/dev/mp-weixin/pages/booking/respectable/respectable.js

158 lines
4.9 KiB
JavaScript
Raw Normal View History

"use strict";
const common_vendor = require("../../../common/vendor.js");
2024-12-04 02:39:41 +00:00
const api_request = require("../../../api/request.js");
2024-12-02 03:01:34 +00:00
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();
}
2024-10-20 05:16:38 +00:00
const _sfc_main = {
__name: "respectable",
setup(__props) {
2024-12-04 02:39:41 +00:00
common_vendor.onMounted(() => {
getWhole();
});
2024-12-02 03:01:34 +00:00
common_vendor.ref([]);
2024-12-04 02:39:41 +00:00
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: "获取失败"
});
2024-12-02 03:01:34 +00:00
}
2024-12-04 02:39:41 +00:00
};
2024-12-02 03:01:34 +00:00
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: "提供专业的摄影棚和灯光设备,为客户打造舒适的拍摄环境"
}
2024-11-09 09:43:22 +00:00
]);
2024-12-02 03:01:34 +00:00
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");
};
2024-12-04 02:39:41 +00:00
const selectedLocation = common_vendor.ref(null);
const handleLocationChange = (e) => {
selectedLocation.value = e.detail.value;
console.log(selectedLocation.value);
};
2024-12-02 03:01:34 +00:00
const goToText = (index) => {
console.log(index);
common_vendor.index.navigateTo({
2024-12-04 02:39:41 +00:00
url: "/pages/booking/CostumeDisplay/CostumeDisplay?info=" + JSON.stringify(Whole.value[index].id)
2024-12-02 03:01:34 +00:00
});
2024-12-04 02:39:41 +00:00
console.log(Whole.value[index].id);
2024-12-02 03:01:34 +00:00
};
const goToContact = () => {
common_vendor.index.navigateTo({
url: "/pages/mine/Contact/Contact"
});
};
2024-10-20 05:16:38 +00:00
return (_ctx, _cache) => {
2024-12-02 03:01:34 +00:00
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) => 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 {
2024-12-04 02:39:41 +00:00
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)
2024-12-02 03:01:34 +00:00
};
}),
2024-12-04 02:39:41 +00:00
n: common_vendor.o(handleLocationChange),
o: common_vendor.o(openPopup1)
2024-12-02 03:01:34 +00:00
} : {}, {
2024-12-04 02:39:41 +00:00
p: zhi.value === "1"
2024-12-02 03:01:34 +00:00
}, zhi.value === "1" ? {
2024-12-04 02:39:41 +00:00
q: common_vendor.f(Own.value, (item, k0, i0) => {
2024-12-02 03:01:34 +00:00
return {
a: item.img,
b: common_vendor.t(item.name),
c: common_vendor.t(item.price),
d: common_vendor.t(item.title),
e: item
};
}),
2024-12-04 02:39:41 +00:00
r: common_vendor.o(handleLocationChange),
s: common_vendor.o(openPopup1)
2024-12-02 03:01:34 +00:00
} : {}, {
2024-12-04 02:39:41 +00:00
t: common_vendor.o(openPopup2)
2024-12-02 03:01:34 +00:00
});
2024-10-20 05:16:38 +00:00
};
}
};
2024-12-10 07:04:13 +00:00
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-cad4fb76"]]);
wx.createPage(MiniProgramPage);