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

504 lines
14 KiB
JavaScript
Raw Normal View History

2025-08-21 16:51:53 +08:00
"use strict";
const common_vendor = require("../../common/vendor.js");
const common_assets = require("../../common/assets.js");
if (!Array) {
const _component_donghua = common_vendor.resolveComponent("donghua");
const _component_arrowkeys = common_vendor.resolveComponent("arrowkeys");
(_component_donghua + _component_arrowkeys)();
}
if (!Math) {
(bigroll + specialDrawerVue + ZyUpdate)();
}
const ZyUpdate = () => "../../component/zy-upgrade/zy-upgrade.js";
const specialDrawerVue = () => "../../component/public/specialDrawer.js";
const bigroll = () => "./drawer/index.js";
const itemHeight = 100;
const containerHeight = 400;
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
__name: "index",
setup(__props) {
const zyupgrade = common_vendor.ref(null);
const menuIndex = common_vendor.ref(-1);
const typeNow = common_vendor.ref(-1);
const photoplay = common_vendor.ref(false);
const getblue = common_vendor.ref(false);
const gobackdrawer = common_vendor.ref(null);
const topnum = common_vendor.ref(0);
function clamp(v, a, b) {
return Math.max(a, Math.min(b, v));
}
function ensureVisible(idx) {
const targetTop = idx * itemHeight;
const viewTop = topnum.value;
const viewBottom = viewTop + containerHeight;
if (targetTop < viewTop) {
topnum.value = clamp(targetTop, 0, filteredMenu.value.length * itemHeight - containerHeight);
} else if (targetTop + itemHeight > viewBottom) {
const needTop = targetTop + itemHeight - containerHeight;
topnum.value = clamp(needTop, 0, filteredMenu.value.length * itemHeight - containerHeight);
}
}
function genPaths(base2, prefix, count, ext = "png", startIndex = 0, pad = false) {
return Array.from({ length: count }, (_, i) => {
const idx = pad ? String(i + startIndex).padStart(2, "0") : i + startIndex;
return `${base2}/${prefix}${idx}.${ext}`;
});
}
const base = genPaths(
"/static/index/newindex/curve",
"curve_",
9,
"png",
1,
false
);
const blueArray = common_vendor.ref([
...base,
...[...base].reverse()
// 先拷贝一份再反转,避免修改原 base
]);
const basesmall = genPaths(
"/static/index/newindex/curve",
"breathe_",
9,
"png",
1,
false
);
const bluesmallArray = common_vendor.ref([
...basesmall,
...[...basesmall].reverse()
// 先拷贝一份再反转,避免修改原 base
]);
const peopleArray = common_vendor.ref([
{
name: "王金福",
url: "/static/index/watch/people0.png"
},
{
name: "李宝田",
url: "/static/index/watch/people1.png"
}
]);
const iconArray = common_vendor.ref([
{
name: "省医保",
url: "/static/index/watch/00.png",
error: false
},
{
name: "重度失能",
url: "/static/index/watch/01.png",
error: false
},
{
name: "欠费",
url: "/static/index/watch/03.png",
error: true
}
]);
const typeArray = common_vendor.ref(
[
// {
// name: '全部',
// url: genPaths(
// '/static/index/watch',
// 'all_',
// 8, // 张数
// 'png',
// 1, // 起始索引为 1
// false // 不补零
// )
// },
{
name: "护理单元",
url: genPaths(
"/static/index/watch",
"nurs_",
10,
// 张数
"png",
1,
// 起始索引为 1
false
// 不补零
)
},
{
name: "仓库",
url: genPaths(
"/static/index/watch",
"warehouse_",
6,
// 张数
"png",
1,
// 起始索引为 1
false
// 不补零
)
},
{
name: "配务室",
url: genPaths(
"/static/index/watch",
"delivery_",
5,
// 张数
"png",
1,
// 起始索引为 1
false
// 不补零
)
},
{
name: "服务大厅",
url: genPaths(
"/static/index/watch",
"service_",
5,
// 张数
"png",
1,
// 起始索引为 1
false
// 不补零
)
},
{
name: "",
url: ""
}
// {
// name: '全部',
// url: "/static/index/newindex/curve/home_1.png"
// },
// {
// name: '全部',
// url: "/static/index/newindex/curve/home_1.png"
// },
// {
// name: '全部',
// url: "/static/index/newindex/curve/home_1.png"
// },
// {
// name: '全部',
// url: "/static/index/newindex/curve/home_1.png"
// },
]
);
const leftMenuArray = common_vendor.ref([
{
name: "护理单元01",
NUID: "2508000001",
url: genPaths(
"/static/index/watch",
"nurs_",
10,
// 张数
"png",
1,
// 起始索引为 1
false
// 不补零
),
warning: false,
type: 0
},
{
name: "护理单元02",
NUID: "2508000002",
url: genPaths(
"/static/index/watch",
"nurs_",
10,
// 张数
"png",
1,
// 起始索引为 1
false
// 不补零
),
warning: false,
type: 0
},
{
name: "护理单元03",
NUID: "2508000003",
url: genPaths(
"/static/index/watch",
"nurs_",
10,
// 张数
"png",
1,
// 起始索引为 1
false
// 不补零
),
warning: true,
type: 0
},
{
name: "仓库01",
NUID: "2508000001",
url: genPaths(
"/static/index/watch",
"warehouse_",
6,
// 张数
"png",
1,
// 起始索引为 1
false
// 不补零
),
warning: false,
type: 1
},
{
name: "配务室",
NUID: "2508000001",
url: genPaths(
"/static/index/watch",
"delivery_",
5,
// 张数
"png",
1,
// 起始索引为 1
false
// 不补零
),
warning: false,
type: 2
},
{
name: "服务大厅",
NUID: "2508000001",
url: genPaths(
"/static/index/watch",
"service_",
5,
// 张数
"png",
1,
// 起始索引为 1
false
// 不补零
),
warning: false,
type: 3
}
]);
common_vendor.onMounted(() => {
menuIndex.value = 0;
typeNow.value = 0;
photoplay.value = true;
getblue.value = true;
});
const movecard = (type) => {
switch (type) {
case 0:
if (menuIndex.value > 0) {
menuIndex.value--;
typeNow.value = 0;
ensureVisible(menuIndex.value);
}
break;
case 1:
if (typeNow.value < typeArray.value.length - 1) {
typeNow.value++;
ensureVisible(menuIndex.value);
}
break;
case 2:
if (menuIndex.value < filteredMenu.value.length - 1) {
menuIndex.value++;
typeNow.value = 0;
ensureVisible(menuIndex.value);
}
break;
case 3:
if (typeNow.value > 0) {
typeNow.value--;
ensureVisible(menuIndex.value);
}
break;
case 4:
if (!typeNow.value) {
common_vendor.index.navigateTo({
url: "/pages/NursingNew/index"
});
} else if (typeNow.value === 1) {
common_vendor.index.navigateTo({
url: "/pages/Warehousing/index"
});
}
break;
}
};
const filteredMenu = common_vendor.computed(() => {
menuIndex.value = -1;
setTimeout(() => menuIndex.value = 0, 50);
return leftMenuArray.value.filter((item) => item.type === typeNow.value);
});
const goback = () => {
common_vendor.index.navigateTo({
url: "/pages/watch/settings/settings"
});
};
common_vendor.onShow(() => {
var _a;
(_a = zyupgrade.value) == null ? void 0 : _a.check_update();
});
return (_ctx, _cache) => {
return common_vendor.e({
a: common_assets._imports_0$3,
b: common_vendor.f(filteredMenu.value, (item, index, i0) => {
return {
a: "4b26e9e6-0-" + i0,
b: common_vendor.p({
width: `65rpx`,
height: `65rpx`,
links: item.url,
playing: menuIndex.value === index
}),
c: common_vendor.t(item.name),
d: common_vendor.s(index === menuIndex.value ? {
color: `#017DE9 `
} : {}),
e: index,
f: common_vendor.n(item.warning ? "warning" : ""),
g: common_vendor.s(index === menuIndex.value ? {
backgroundColor: `#fff`
} : {}),
h: common_vendor.o(($event) => menuIndex.value = index, index)
};
}),
c: topnum.value,
d: common_vendor.f(typeArray.value, (item, index, i0) => {
return common_vendor.e({
a: item.url
}, item.url ? {
b: "4b26e9e6-1-" + i0,
c: common_vendor.p({
links: item.url,
playing: typeNow.value === index
})
} : {}, {
d: item.url
}, item.url ? {
e: common_vendor.t(item.name),
f: typeNow.value === index ? 1 : "",
g: common_vendor.s(typeNow.value === index ? {
color: `#008FF5`
} : {})
} : {}, {
h: !item.url
}, !item.url ? {
i: common_assets._imports_1$1
} : {}, {
j: index,
k: common_vendor.o(($event) => {
typeNow.value = index;
}, index)
});
}),
e: common_assets._imports_2,
f: common_vendor.o(goback),
g: common_vendor.o(goback),
h: common_assets._imports_0$4,
i: common_assets._imports_1,
j: common_assets._imports_5$1,
k: common_assets._imports_6$1,
l: common_assets._imports_1$1,
m: common_assets._imports_5$1,
n: common_assets._imports_5$1,
o: common_assets._imports_1$1,
p: common_assets._imports_5$1,
q: common_assets._imports_6$1,
r: common_assets._imports_5$1,
s: common_assets._imports_6$1,
t: typeNow.value === 0
}, typeNow.value === 0 ? {
v: common_assets._imports_7
} : {}, {
w: typeNow.value === 1
}, typeNow.value === 1 ? {
x: common_assets._imports_8
} : {}, {
y: typeNow.value === 0
}, typeNow.value === 0 ? {
z: common_vendor.f(iconArray.value, (item, index, i0) => {
return {
a: item.url,
b: common_vendor.t(item.name),
c: common_vendor.n(item.error ? `warning` : ``),
d: index
};
})
} : {}, {
A: typeNow.value === 1
}, typeNow.value === 1 ? {
B: common_assets._imports_9,
C: common_assets._imports_10,
D: common_assets._imports_11
} : {}, {
E: common_assets._imports_12,
F: common_vendor.p({
width: `600rpx`,
height: `500rpx`,
links: blueArray.value,
playing: photoplay.value,
loop: true,
interval: 120
}),
G: common_vendor.p({
width: `400rpx`,
height: `250rpx`,
links: bluesmallArray.value,
playing: photoplay.value,
loop: true,
interval: 120
}),
H: common_assets._imports_13,
I: common_assets._imports_4,
J: common_assets._imports_5,
K: common_assets._imports_6,
L: common_assets._imports_17,
M: common_vendor.f(peopleArray.value, (item, index, i0) => {
return {
a: item.url,
b: common_vendor.t(item.name),
c: index
};
}),
N: common_vendor.sr(gobackdrawer, "4b26e9e6-4", {
"k": "gobackdrawer"
}),
O: common_vendor.o(movecard),
P: common_vendor.p({
getblue: getblue.value,
moveleft: 5
}),
Q: common_vendor.sr(zyupgrade, "4b26e9e6-7", {
"k": "zyupgrade"
}),
R: common_vendor.p({
noticeflag: true,
theme: "blue",
h5preview: false,
oldversion: "1.0.0",
appstoreflag: true,
autocheckupdate: true
})
});
};
}
});
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-4b26e9e6"]]);
wx.createPage(MiniProgramPage);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/watch/index.js.map