HomeLease/unpackage/dist/dev/mp-weixin/pages/index/index.js
2025-08-12 16:39:15 +08:00

131 lines
4.1 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"use strict";
const common_vendor = require("../../common/vendor.js");
const enum_commonEnum = require("../../enum/commonEnum.js");
const _sfc_main = {
data() {
return {
commonEnum: enum_commonEnum.commonEnum,
title: "设备租赁",
currentBannerIndex: 0,
bannerList: [
{
id: 1,
name: "渝锦汇",
desc: "商用节能灶燃烧器",
features: "商用节能灶燃烧器,高效节能,安全可靠,适用于各类餐饮场所。采用先进燃烧技术,热效率高,节能环保。",
image: "/static/stove.svg"
},
{
id: 2,
name: "节能燃烧器",
desc: "高效节能设备",
features: "新一代节能燃烧器热效率提升30%,节能环保,安全可靠。",
image: "/static/burner.svg"
}
],
equipmentList: [
{
id: 1,
name: "商用节能灶",
status: "normal",
startTime: "2025-07-25 13:23:59",
endTime: "2026-07-25 13:23:59",
image: "/static/stove.svg"
},
{
id: 2,
name: "节能燃烧器",
status: "normal",
startTime: "2025-07-25 13:23:59",
endTime: "2026-07-25 13:23:59",
image: "/static/burner.svg"
}
]
};
},
onLoad() {
this.startBannerAutoPlay();
},
methods: {
// 轮播图自动播放
startBannerAutoPlay() {
setInterval(() => {
this.currentBannerIndex = (this.currentBannerIndex + 1) % this.bannerList.length;
}, 3e3);
},
// 点击轮播指示器
onDotClick(index) {
this.currentBannerIndex = index;
},
// 去续费
onRenew(equipment) {
common_vendor.index.showToast({
title: `正在处理${equipment.name}的续费`,
icon: "none"
});
},
// 点击设备项
onEquipmentClick(equipment) {
common_vendor.index.showToast({
title: `查看${equipment.name}详情`,
icon: "none"
});
},
// 点击底部导航
onNavClick(index) {
const navItems = ["首页", "申请租赁", "个人中心"];
common_vendor.index.showToast({
title: `切换到${navItems[index]}`,
icon: "none"
});
}
}
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return {
a: $data.commonEnum.LOCATION,
b: common_vendor.f($data.bannerList, (banner, index, i0) => {
return {
a: common_vendor.t(banner.name),
b: common_vendor.t(banner.desc),
c: banner.image,
d: common_vendor.t(banner.features),
e: banner.id,
f: $data.currentBannerIndex === index
};
}),
c: common_vendor.f($data.bannerList, (banner, index, i0) => {
return {
a: index,
b: $data.currentBannerIndex === index ? 1 : "",
c: common_vendor.o(($event) => $options.onDotClick(index), index)
};
}),
d: common_vendor.f($data.equipmentList, (equipment, k0, i0) => {
return {
a: equipment.image,
b: common_vendor.t(equipment.name),
c: common_vendor.t(equipment.status === "normal" ? "正常" : "异常"),
d: common_vendor.n(equipment.status),
e: common_vendor.t(equipment.startTime),
f: common_vendor.t(equipment.endTime),
g: common_vendor.o(($event) => $options.onRenew(equipment), equipment.id),
h: equipment.id,
i: common_vendor.o(($event) => $options.onEquipmentClick(equipment), equipment.id)
};
}),
e: common_vendor.f(["首页", "申请租赁", "个人中心"], (nav, index, i0) => {
return {
a: common_vendor.t(index === 0 ? "🏠" : index === 1 ? "" : "😊"),
b: common_vendor.t(nav),
c: index,
d: index === 0 ? 1 : "",
e: common_vendor.o(($event) => $options.onNavClick(index), index)
};
})
};
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-1cf27b2a"]]);
wx.createPage(MiniProgramPage);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/index/index.js.map