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

323 lines
12 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 common_assets = require("../../common/assets.js");
if (!Math) {
(rightItemsfirst + rightItemssecond + rightItemssecondnew + rightItemssecondrelnew)();
}
const rightItemsfirst = () => "../../component/rightItemsindex/index.js";
const rightItemssecond = () => "../../component/rightItemssecond/index.js";
const rightItemssecondnew = () => "../../component/rightItemssecondnew/index.js";
const rightItemssecondrelnew = () => "../../component/rightItemssecondrelnew/index.js";
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
__name: "index",
setup(__props) {
common_vendor.onMounted(() => {
isOld.value = 2;
common_vendor.index.getSystemInfoSync();
common_vendor.index.pageScrollTo;
});
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" },
{ url: "/static/index/lefticon/give.png", targetUrl: "/static/index/lefticontarget/givedark.png" },
{ url: "/static/index/lefticon/wifi.png", targetUrl: "/static/index/lefticontarget/bluewifi.png" },
{ url: "/static/index/lefticon/back.png", targetUrl: "/static/index/lefticontarget/blueback.png" }
]);
const menuIndex = common_vendor.ref(0);
const menuIndexshow = common_vendor.ref(false);
const menuIndexshowsecond = common_vendor.ref(false);
const darkFans = common_vendor.ref(false);
const isOld = common_vendor.ref(-1);
common_vendor.ref([]);
common_vendor.ref(0);
common_vendor.ref(0);
common_vendor.ref(0);
common_vendor.ref(0);
common_vendor.ref(0);
const darkchange = (res) => {
darkFans.value = res;
};
const isOldchange = (res) => {
isOld.value = res;
};
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毫秒, // 动画持续时间,单位为毫秒
});
return;
} else if (index === 5) {
common_vendor.index.navigateBack();
return;
}
menuIndex.value = index;
menuIndexshow.value = false;
menuIndexshowsecond.value = false;
setTimeout(() => {
switch (index) {
case 0:
menuIndexshow.value = true;
break;
case 1:
menuIndexshowsecond.value = true;
break;
}
}, 50);
};
const clientX = common_vendor.ref(0);
const clientY = common_vendor.ref(0);
const savename = common_vendor.ref("");
const canmove = common_vendor.ref(true);
const indexNumber = common_vendor.ref({
index0: 999,
index1: 999
});
const canTrigger = common_vendor.ref(true);
const animation = common_vendor.index.createAnimation({
duration: 0,
timingFunction: "linear",
delay: 0
});
const animationData = common_vendor.ref({});
const getxyrel = (event) => {
var _a;
const touch = event.touches[0];
clientX.value = 2 * (Math.floor(touch.clientX) - 100);
clientY.value = 2 * (Math.floor(touch.clientY) - 55);
animation.translate3d(clientX.value / 2, clientY.value / 2, 0).step({ duration: 0 });
animationData.value = animation.export();
const translateX = Math.floor(touch.clientX) - 50;
const translateY = Math.floor(touch.clientY) - 25;
const clickedItem = fangkuaiValue.value.find((item) => {
return translateX >= Math.floor(item.left) && translateX <= Math.floor(item.right) && translateY >= Math.floor(item.top) && translateY <= Math.floor(item.bottom);
});
if (clickedItem) {
const { index0, index1 } = clickedItem.dataset;
indexNumber.value.index0 = index0;
indexNumber.value.index1 = index1;
if (clientX.value < 200 && canTrigger.value && !isOld.value) {
(_a = ruler.value) == null ? void 0 : _a.nextItems();
canTrigger.value = false;
setTimeout(() => {
canTrigger.value = true;
}, 1e3);
}
} else {
indexNumber.value.index0 = 999;
indexNumber.value.index1 = 999;
}
};
const getxy = throttle(getxyrel, 40);
const fangkuaiValue = common_vendor.ref([]);
const openname = (res, fangkuai) => {
savename.value = res;
canmove.value = false;
fangkuaiValue.value = fangkuai;
};
const changefangkuang = (fangkuang) => {
fangkuaiValue.value = fangkuang;
};
const saveruler = common_vendor.ref({
directiveName: "",
cycleType: "",
positioningLong: "0",
typeName: "",
startTime: "",
id: "",
endTime: "",
tagName: null
});
const openruler = (res, fangkuai) => {
saveruler.value = res;
canmove.value = false;
fangkuaiValue.value = fangkuai;
};
const closename = () => {
savename.value = "";
canmove.value = true;
};
const ruler = common_vendor.ref(null);
const rulernew = common_vendor.ref(null);
const cleanall = () => {
var _a, _b, _c;
clientX.value = 9999;
clientY.value = 9999;
animation.translate3d(clientX.value / 2, clientY.value / 2, 0).step({ duration: 0 });
animationData.value = animation.export();
canmove.value = true;
indexNumber.value = {
index0: 999,
index1: 999
};
if (savename.value) {
if (!isOld.value) {
(_a = ruler.value) == null ? void 0 : _a.rulerEnd(savename.value);
}
} else if (saveruler.value.typeName) {
if (isOld.value === 0) {
(_b = ruler.value) == null ? void 0 : _b.rulerMoveEnd(saveruler.value);
} else {
(_c = rulernew.value) == null ? void 0 : _c.rulerMoveEnd(saveruler.value);
}
}
savename.value = "";
saveruler.value = {
directiveName: "",
cycleType: "",
positioningLong: "0",
typeName: "",
startTime: "",
id: "",
endTime: "",
tagName: null
};
};
function throttle(fn, delay) {
let lastExecutionTime = 0;
return function(...args) {
const now = Date.now();
if (now - lastExecutionTime >= delay) {
lastExecutionTime = now;
fn.apply(this, args);
}
};
}
function splitString(str) {
let result = [];
let remainingStr = str;
let regex = /([^(]*)[(]([^)]+)[)]/;
while (regex.test(remainingStr)) {
let match = remainingStr.match(regex);
if (match) {
if (match[1].trim()) {
result.push(match[1].trim());
}
if (match[2].trim()) {
result.push(match[2].trim());
}
remainingStr = remainingStr.replace(match[0], "").trim();
}
}
if (remainingStr.trim()) {
result.push(remainingStr.trim());
}
return result;
}
common_vendor.onShow(() => {
setTimeout(() => {
changeMenu(menuIndex.value);
}, 50);
});
return (_ctx, _cache) => {
return {
a: common_vendor.t(savename.value),
b: savename.value && clientX.value,
c: animationData.value,
d: common_vendor.t(saveruler.value.startTime + `-` + saveruler.value.endTime),
e: saveruler.value.cycleType == "日常" ? `/static/index/yellowbian.png` : `/static/index/puoplebian.png`,
f: common_vendor.t(saveruler.value.cycleType),
g: saveruler.value.startTime,
h: common_vendor.t(splitString(saveruler.value.directiveName)[0]),
i: common_vendor.f(splitString(saveruler.value.directiveName).slice(1), (item, index, i0) => {
return {
a: index
};
}),
j: common_vendor.t(splitString(saveruler.value.directiveName)[1]),
k: common_vendor.s(saveruler.value.cycleType != "日常" ? {
backgroundColor: `rgb(123,97,255)`
} : {}),
l: common_vendor.s(saveruler.value.cycleType != "日常" ? {
backgroundColor: `rgb(212,203,255)`
} : {}),
m: splitString(saveruler.value.directiveName)[1],
n: saveruler.value.cycleType,
o: common_vendor.n(saveruler.value.cycleType == "日常" ? `title-time-border-yellow` : `title-time-border-pouple`),
p: animationData.value,
q: common_assets._imports_0$1,
r: common_vendor.n(darkFans.value ? `left-head-font-dark` : `left-head-font`),
s: common_vendor.f(iconList.value, (item, index, i0) => {
return {
a: index === menuIndex.value,
b: index === menuIndex.value ? item.targetUrl : item.url,
c: common_vendor.o(($event) => changeMenu(index), index),
d: index
};
}),
t: `/static/index/ray.png`,
v: !menuIndex.value,
w: common_vendor.o(darkchange),
x: common_vendor.p({
isshow: menuIndexshow.value,
darkFans: darkFans.value
}),
y: common_vendor.sr(ruler, "b6cc7861-1", {
"k": "ruler"
}),
z: menuIndex.value == 1 && !isOld.value,
A: common_vendor.o(darkchange),
B: common_vendor.o(openname),
C: common_vendor.o(openruler),
D: common_vendor.o(changefangkuang),
E: common_vendor.o(closename),
F: common_vendor.o(isOldchange),
G: common_vendor.p({
liang: indexNumber.value,
isshow: menuIndexshowsecond.value,
canmove: canmove.value,
darkFans: darkFans.value
}),
H: common_vendor.sr(rulernew, "b6cc7861-2", {
"k": "rulernew"
}),
I: menuIndex.value == 1 && isOld.value === 1,
J: common_vendor.o(darkchange),
K: common_vendor.o(openname),
L: common_vendor.o(openruler),
M: common_vendor.o(changefangkuang),
N: common_vendor.o(closename),
O: common_vendor.o(isOldchange),
P: common_vendor.p({
isold: isOld.value === 1,
liang: indexNumber.value,
isshow: menuIndexshowsecond.value,
canmove: canmove.value,
darkFans: darkFans.value
}),
Q: common_vendor.sr(rulernew, "b6cc7861-3", {
"k": "rulernew"
}),
R: menuIndex.value == 1 && isOld.value === 2,
S: common_vendor.o(darkchange),
T: common_vendor.o(openname),
U: common_vendor.o(openruler),
V: common_vendor.o(changefangkuang),
W: common_vendor.o(closename),
X: common_vendor.o(isOldchange),
Y: common_vendor.p({
isold: isOld.value === 2,
liang: indexNumber.value,
isshow: menuIndexshowsecond.value,
canmove: canmove.value,
darkFans: darkFans.value
}),
Z: common_vendor.n(darkFans.value ? `darkbackgroundContainer` : `backgroundContainer`),
aa: common_vendor.o(
//@ts-ignore
(...args) => common_vendor.unref(getxy) && common_vendor.unref(getxy)(...args)
),
ab: common_vendor.o(cleanall)
};
};
}
});
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-b6cc7861"]]);
wx.createPage(MiniProgramPage);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/Nursing/index.js.map