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

174 lines
6.2 KiB
JavaScript
Raw Normal View History

2025-02-18 17:11:31 +08:00
"use strict";
const common_vendor = require("../../common/vendor.js");
const common_assets = require("../../common/assets.js");
2025-03-05 17:29:32 +08:00
if (!Math) {
(rightItemsfirst + rightItemssecond)();
}
const rightItemsfirst = () => "../../component/rightItemsindex/index.js";
const rightItemssecond = () => "../../component/rightItemssecond/index.js";
2025-02-18 17:11:31 +08:00
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
__name: "index",
setup(__props) {
const iconList = common_vendor.ref([
{ url: "/static/index/lefticon/index.png", targetUrl: "/static/index/lefticontarget/blueindex.png" },
{ url: "/static/index/lefticon/nurse.png", targetUrl: "/static/index/lefticontarget/bluenurse.png" },
{ url: "/static/index/lefticon/doctor.png", targetUrl: "/static/index/lefticontarget/bluedoctor.png" },
2025-02-27 17:15:17 +08:00
{ url: "/static/index/lefticon/give.png", targetUrl: "/static/index/lefticontarget/givedark.png" },
2025-02-18 17:11:31 +08:00
{ url: "/static/index/lefticon/wifi.png", targetUrl: "/static/index/lefticontarget/bluewifi.png" },
{ url: "/static/index/lefticon/back.png", targetUrl: "/static/index/lefticontarget/blueback.png" }
]);
2025-03-07 17:26:02 +08:00
const menuIndex = common_vendor.ref(1);
2025-03-05 17:29:32 +08:00
const menuIndexshow = common_vendor.ref(false);
const menuIndexshowsecond = common_vendor.ref(false);
2025-02-27 17:15:17 +08:00
const darkFans = common_vendor.ref(false);
2025-03-05 17:29:32 +08:00
common_vendor.ref([]);
2025-03-04 17:29:52 +08:00
common_vendor.ref(0);
2025-03-05 17:29:32 +08:00
common_vendor.ref(0);
common_vendor.ref(0);
common_vendor.ref(0);
common_vendor.ref(0);
const darkchange = (res) => {
darkFans.value = res;
2025-02-27 17:15:17 +08:00
};
2025-03-05 17:29:32 +08:00
const changeMenu = (index) => {
if (index === 3) {
menuIndexshow.value = false;
menuIndexshowsecond.value = false;
common_vendor.index.navigateTo({
url: `/pages/somethingmove/index?darkFans=${darkFans.value}`,
animationType: "slide-in-right",
animationDuration: 400
// 设置动画时长为300毫秒, // 动画持续时间,单位为毫秒
2025-02-27 17:15:17 +08:00
});
2025-03-05 17:29:32 +08:00
return;
2025-02-27 17:15:17 +08:00
}
2025-03-05 17:29:32 +08:00
menuIndex.value = index;
menuIndexshow.value = false;
menuIndexshowsecond.value = false;
2025-03-04 17:29:52 +08:00
setTimeout(() => {
2025-03-05 17:29:32 +08:00
switch (index) {
case 0:
menuIndexshow.value = true;
break;
case 1:
menuIndexshowsecond.value = true;
break;
}
}, 50);
2025-03-04 17:29:52 +08:00
};
2025-03-07 17:26:02 +08:00
const clientX = common_vendor.ref(0);
const clientY = common_vendor.ref(0);
const savename = common_vendor.ref("");
const canmove = common_vendor.ref(true);
2025-03-14 17:30:56 +08:00
const indexNumber = common_vendor.ref({
index0: 999,
index1: 999
});
const getxyrel = (event) => {
2025-03-07 17:26:02 +08:00
const touch = event.touches[0];
2025-03-14 17:30:56 +08:00
clientX.value = 2 * (Math.floor(touch.clientX) - 100);
2025-03-07 17:26:02 +08:00
clientY.value = 2 * (Math.floor(touch.clientY) - 55);
2025-03-14 17:30:56 +08:00
const translateX = Math.floor(touch.clientX) - 50;
const translateY = Math.floor(touch.clientY) - 25;
const clickedItem = fangkuaiValue.value.find((item) => {
return translateX >= item.left && translateX <= item.right && translateY >= item.top && translateY <= item.bottom;
});
if (clickedItem) {
const { index0, index1 } = clickedItem.dataset;
indexNumber.value.index0 = index0;
indexNumber.value.index1 = index1;
} else {
indexNumber.value.index0 = 999;
indexNumber.value.index1 = 999;
}
2025-03-07 17:26:02 +08:00
};
2025-03-14 17:30:56 +08:00
const getxy = throttle(getxyrel, 10);
const fangkuaiValue = common_vendor.ref([]);
const openname = (res, fangkuai) => {
2025-03-07 17:26:02 +08:00
savename.value = res;
canmove.value = false;
2025-03-14 17:30:56 +08:00
fangkuaiValue.value = fangkuai;
2025-03-07 17:26:02 +08:00
};
2025-03-14 17:30:56 +08:00
const closename = () => {
2025-03-07 17:26:02 +08:00
savename.value = "";
2025-03-14 17:30:56 +08:00
canmove.value = true;
fangkuaiValue.value = [];
};
const ruler = common_vendor.ref(null);
const cleanall = () => {
var _a;
2025-03-07 17:26:02 +08:00
clientX.value = 9999;
clientY.value = 9999;
canmove.value = true;
2025-03-14 17:30:56 +08:00
indexNumber.value = {
index0: 999,
index1: 999
};
(_a = ruler.value) == null ? void 0 : _a.rulerEnd(savename.value);
savename.value = "";
2025-03-07 17:26:02 +08:00
};
2025-03-14 17:30:56 +08:00
function throttle(fn, delay) {
let lastExecutionTime = 0;
return function(...args) {
const now = Date.now();
if (now - lastExecutionTime >= delay) {
lastExecutionTime = now;
fn.apply(this, args);
}
};
}
2025-03-05 17:29:32 +08:00
common_vendor.onShow(() => {
2025-03-04 17:29:52 +08:00
setTimeout(() => {
2025-03-05 17:29:32 +08:00
changeMenu(menuIndex.value);
}, 50);
2025-02-18 17:11:31 +08:00
});
return (_ctx, _cache) => {
2025-03-05 17:29:32 +08:00
return {
2025-03-07 17:26:02 +08:00
a: common_vendor.t(savename.value),
2025-03-14 17:30:56 +08:00
b: savename.value && clientX.value,
2025-03-07 17:26:02 +08:00
c: `${clientY.value}rpx`,
d: `${clientX.value}rpx`,
e: common_assets._imports_0,
f: common_vendor.n(darkFans.value ? `left-head-font-dark` : `left-head-font`),
g: common_vendor.f(iconList.value, (item, index, i0) => {
2025-02-18 17:11:31 +08:00
return {
a: index === menuIndex.value,
b: index === menuIndex.value ? item.targetUrl : item.url,
2025-02-27 17:15:17 +08:00
c: common_vendor.o(($event) => changeMenu(index), index),
d: index
};
}),
2025-03-07 17:26:02 +08:00
h: `/static/index/ray.png`,
i: !menuIndex.value,
j: common_vendor.o(darkchange),
k: common_vendor.p({
2025-03-05 17:29:32 +08:00
isshow: menuIndexshow.value,
darkFans: darkFans.value
2025-03-04 17:29:52 +08:00
}),
2025-03-14 17:30:56 +08:00
l: common_vendor.sr(ruler, "1cf27b2a-1", {
"k": "ruler"
}),
m: menuIndex.value == 1,
n: common_vendor.o(darkchange),
o: common_vendor.o(openname),
p: common_vendor.o(closename),
q: common_vendor.p({
liang: indexNumber.value,
2025-03-05 17:29:32 +08:00
isshow: menuIndexshowsecond.value,
2025-03-07 17:26:02 +08:00
canmove: canmove.value,
2025-03-05 17:29:32 +08:00
darkFans: darkFans.value
2025-03-04 17:29:52 +08:00
}),
2025-03-14 17:30:56 +08:00
r: common_vendor.n(darkFans.value ? `darkbackgroundContainer` : `backgroundContainer`),
s: common_vendor.o(
//@ts-ignore
(...args) => common_vendor.unref(getxy) && common_vendor.unref(getxy)(...args)
),
t: common_vendor.o(cleanall)
2025-03-05 17:29:32 +08:00
};
2025-02-18 17:11:31 +08:00
};
}
});
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-1cf27b2a"]]);
wx.createPage(MiniProgramPage);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/index/index.js.map