hldy_app/unpackage/dist/dev/mp-weixin/component/public/leftMenu.js

86 lines
2.6 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");
const _sfc_main = {
__name: "leftMenu",
props: {
darkFans: {
type: Boolean,
default: false
},
menuIndex: {
type: Number,
default: 0
}
},
emits: ["click"],
setup(__props, { emit: __emit }) {
const iconList = common_vendor.ref([
{
url: "/static/index/lefticon/index.png",
targetUrl: "/static/index/lefticontarget/blueindex.png",
path: `/pages/index/index`
},
{
url: "/static/index/lefticon/nurse.png",
targetUrl: "/static/index/lefticontarget/bluenurse.png",
path: `/pages/doctorsay/index`
},
{
url: "/static/index/lefticon/doctor.png",
targetUrl: "/static/index/lefticontarget/bluedoctor.png",
path: ""
},
{
url: "/static/index/lefticon/give.png",
targetUrl: "/static/index/lefticontarget/givedark.png",
path: ""
},
{
url: "/static/index/lefticon/wifi.png",
targetUrl: "/static/index/lefticontarget/bluewifi.png",
path: ""
},
{
url: "/static/index/lefticon/back.png",
targetUrl: "/static/index/lefticontarget/blueback.png",
path: ""
}
]);
const jumpTonew = (path) => {
const pages = getCurrentPages();
if (pages.length === 0)
return;
const currentPage = pages[pages.length - 1];
const currentPath = "/" + currentPage.route;
if (currentPath !== path && path) {
common_vendor.index.redirectTo({
url: path,
animationType: "none",
// 取消动画效果
animationDuration: 0
// 设置动画持续时间为0表示没有动画
});
}
};
return (_ctx, _cache) => {
return {
a: common_assets._imports_0,
b: common_vendor.n(__props.darkFans ? `left-head-font-dark` : `left-head-font`),
c: common_vendor.f(iconList.value, (item, index, i0) => {
return {
a: index == __props.menuIndex,
b: index == __props.menuIndex ? item.targetUrl : item.url,
c: common_vendor.o(($event) => jumpTonew(item.path), index),
d: index
};
}),
d: `/static/index/ray.png`
};
};
}
};
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-d0ac6a5e"]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/component/public/leftMenu.js.map