| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- "use strict";
- const common_vendor = require("../../common/vendor.js");
- const store_message = require("../../store/message.js");
- const _sfc_main = {
- __name: "custom-tabbar",
- props: {
- activeIndex: {
- type: Number,
- default: 0
- }
- },
- setup(__props) {
- const props = __props;
- const color = common_vendor.ref("#999999");
- const selectedColor = common_vendor.ref("#1F6CFF");
- const unreadMessageCount = common_vendor.computed(() => store_message.messageStore.unreadCount);
- const list = common_vendor.ref([
- {
- pagePath: "/pages/jobs/jobs",
- iconPath: "/static/tabbar/jobs_n.png",
- selectedIconPath: "/static/tabbar/jobs_a.png",
- text: "岗位"
- },
- {
- pagePath: "/pages/assessment/assessment",
- iconPath: "/static/tabbar/assess_n.png",
- selectedIconPath: "/static/tabbar/assess_a.png",
- text: "测评"
- },
- {
- pagePath: "/pages/message/message",
- iconPath: "/static/tabbar/msg_n.png",
- selectedIconPath: "/static/tabbar/msg_a.png",
- text: "消息"
- },
- {
- pagePath: "/pages/my/my",
- iconPath: "/static/tabbar/my_n.png",
- selectedIconPath: "/static/tabbar/my_a.png",
- text: "我的"
- }
- ]);
- const switchTab = (path, index) => {
- if (props.activeIndex !== index) {
- common_vendor.index.switchTab({
- url: path
- });
- }
- };
- common_vendor.onMounted(() => {
- common_vendor.index.hideTabBar({
- animation: false
- });
- });
- return (_ctx, _cache) => {
- return {
- a: common_vendor.f(list.value, (item, index, i0) => {
- return common_vendor.e({
- a: item.pagePath === "/pages/message/message" && unreadMessageCount.value > 0
- }, item.pagePath === "/pages/message/message" && unreadMessageCount.value > 0 ? {
- b: common_vendor.t(unreadMessageCount.value)
- } : {}, {
- c: __props.activeIndex === index ? item.selectedIconPath : item.iconPath,
- d: common_vendor.t(item.text),
- e: __props.activeIndex === index ? selectedColor.value : color.value,
- f: index,
- g: common_vendor.o(($event) => switchTab(item.pagePath, index), index)
- });
- })
- };
- };
- }
- };
- const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-51c48e3c"]]);
- wx.createComponent(Component);
- //# sourceMappingURL=../../../.sourcemap/mp-weixin/components/custom-tabbar/custom-tabbar.js.map
|