HomeLease/unpackage/dist/dev/mp-weixin/pages/index/index.js

167 lines
5.3 KiB
JavaScript
Raw Normal View History

2025-08-12 15:38:25 +08:00
"use strict";
const common_vendor = require("../../common/vendor.js");
2025-08-12 16:39:15 +08:00
const enum_commonEnum = require("../../enum/commonEnum.js");
2025-08-12 15:38:25 +08:00
const _sfc_main = {
data() {
return {
2025-08-13 09:58:47 +08:00
background: ["color1", "color2", "color3"],
indicatorDots: true,
autoplay: true,
interval: 2e3,
duration: 500,
2025-08-12 16:39:15 +08:00
commonEnum: enum_commonEnum.commonEnum,
2025-08-12 15:38:25 +08:00
title: "设备租赁",
currentBannerIndex: 0,
bannerList: [
{
id: 1,
name: "渝锦汇",
desc: "商用节能灶燃烧器",
features: "商用节能灶燃烧器,高效节能,安全可靠,适用于各类餐饮场所。采用先进燃烧技术,热效率高,节能环保。",
image: "/static/stove.svg"
},
{
id: 2,
name: "节能燃烧器",
desc: "高效节能设备",
features: "新一代节能燃烧器热效率提升30%,节能环保,安全可靠。",
image: "/static/burner.svg"
2025-08-12 18:00:36 +08:00
},
{
id: 3,
name: "商用炉具",
desc: "专业厨房设备",
features: "专业商用炉具,采用不锈钢材质,耐高温,易清洁,适合大型餐饮场所使用。",
image: "/static/stove.svg"
},
{
id: 4,
name: "燃气灶具",
desc: "高效燃气设备",
features: "高效燃气灶具,燃烧充分,热效率高,节能环保,安全可靠。",
image: "/static/burner.svg"
},
{
id: 5,
name: "厨房设备",
desc: "一体化解决方案",
features: "提供完整的厨房设备解决方案,从设计到安装,一站式服务。",
image: "/static/stove.svg"
2025-08-12 15:38:25 +08:00
}
],
equipmentList: [
{
id: 1,
name: "商用节能灶",
status: "normal",
startTime: "2025-07-25 13:23:59",
endTime: "2026-07-25 13:23:59",
2025-08-13 09:58:47 +08:00
image: enum_commonEnum.commonEnum.TEMP2
2025-08-12 15:38:25 +08:00
},
{
id: 2,
name: "节能燃烧器",
status: "normal",
startTime: "2025-07-25 13:23:59",
endTime: "2026-07-25 13:23:59",
2025-08-13 09:58:47 +08:00
image: enum_commonEnum.commonEnum.TEMP3
2025-08-12 15:38:25 +08:00
}
]
};
},
onLoad() {
this.startBannerAutoPlay();
},
methods: {
// 轮播图自动播放
startBannerAutoPlay() {
setInterval(() => {
this.currentBannerIndex = (this.currentBannerIndex + 1) % this.bannerList.length;
}, 3e3);
},
// 点击轮播指示器
onDotClick(index) {
this.currentBannerIndex = index;
},
2025-08-12 18:00:36 +08:00
// 点击轮播图
onBannerClick(index) {
this.currentBannerIndex = index;
},
2025-08-12 15:38:25 +08:00
// 去续费
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"
});
2025-08-13 09:58:47 +08:00
},
// 获取导航图标
getNavIcon(index) {
const isActive = index === 0;
switch (index) {
case 0:
return isActive ? this.commonEnum.HOME_ACTIVE : this.commonEnum.HOME;
case 1:
return isActive ? this.commonEnum.RENT_ACTIVE : this.commonEnum.RENT;
case 2:
return isActive ? this.commonEnum.PERSONAL_CENTER_ACTIVE : this.commonEnum.PERSONAL_CENTER;
default:
return this.commonEnum.HOME;
}
2025-08-12 15:38:25 +08:00
}
}
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return {
2025-08-12 16:39:15 +08:00
a: $data.commonEnum.LOCATION,
2025-08-12 17:49:16 +08:00
b: $data.commonEnum.ANNOUNCEMENT_ICON,
2025-08-13 09:58:47 +08:00
c: $data.commonEnum.TEMP1,
2025-08-12 18:06:04 +08:00
d: $data.commonEnum.TEMP1,
2025-08-13 09:58:47 +08:00
e: $data.commonEnum.TEMP1,
f: $data.commonEnum.TEMP1,
g: $data.indicatorDots,
h: $data.autoplay,
i: $data.interval,
j: $data.duration,
k: common_vendor.f($data.equipmentList, (equipment, k0, i0) => {
2025-08-12 15:38:25 +08:00
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)
};
}),
2025-08-13 09:58:47 +08:00
l: common_vendor.f(["首页", "申请租赁", "个人中心"], (nav, index, i0) => {
2025-08-12 15:38:25 +08:00
return {
2025-08-13 09:58:47 +08:00
a: $options.getNavIcon(index),
2025-08-12 15:38:25 +08:00
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