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

61 lines
1.9 KiB
JavaScript
Raw Normal View History

2024-12-04 05:33:43 +00:00
"use strict";
const common_vendor = require("../../../common/vendor.js");
const api_request = require("../../../api/request.js");
const _sfc_main = {
__name: "CostumeDisplay",
setup(__props) {
const list = common_vendor.ref([{}]);
const label = common_vendor.ref([{}]);
common_vendor.onMounted(() => {
getLabel();
});
common_vendor.onLoad((options) => {
list.value = JSON.parse(options.info);
console.log(list.value, "id");
});
const getLabel = async () => {
const res = await common_vendor.index.request({
url: api_request.baseUrl + "/clothesInfo/list/label",
method: "POST",
header: {
cookie: common_vendor.wx$1.getAccountInfoSync("cookie")
},
data: {
id: list.value
}
});
console.log(res);
if (res.data.code === 1) {
label.value = res.data.data;
} else {
uin.showtoast({
icon: "error",
title: "获取失败"
});
}
};
const goToText = (index) => {
common_vendor.index.navigateTo({
url: "/pages/booking/CostumeDetails/CostumeDetails?info=" + JSON.stringify(label.value[index].id)
});
console.log(label.value[index].id);
};
return (_ctx, _cache) => {
return {
a: common_vendor.f(label.value, (item, index, i0) => {
return {
a: item.image,
2025-01-02 03:18:59 +00:00
b: common_vendor.t(item.name),
c: common_vendor.t(item.intro),
d: common_vendor.t(item.price),
e: index,
f: common_vendor.o(($event) => goToText(index), index)
2024-12-04 05:33:43 +00:00
};
})
};
};
}
};
2025-01-02 03:18:59 +00:00
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-d97852c0"], ["__file", "D:/微信小程序/课设整合/匠承非遗小程序端/jiangchengfeiyi-xiaochengxu/pages/booking/CostumeDisplay/CostumeDisplay.vue"]]);
2024-12-04 05:33:43 +00:00
wx.createPage(MiniProgramPage);