From 3282e95db0207ee133d1e98d9771dec9d83b0fc4 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期四, 02 四月 2026 16:24:38 +0800
Subject: [PATCH] 2026.4.2 新增专题管理功能
---
custom-tab-bar/index.js | 31 +++++++++++++++++++++++++++----
1 files changed, 27 insertions(+), 4 deletions(-)
diff --git a/custom-tab-bar/index.js b/custom-tab-bar/index.js
index 4384ee3..5933a2c 100644
--- a/custom-tab-bar/index.js
+++ b/custom-tab-bar/index.js
@@ -1,10 +1,35 @@
import TabMenu from './data';
+// import { getMenu } from './data';
+
+const app = getApp();
+
Component({
data: {
active: 0,
list: TabMenu,
+ // list: getMenu(app.globalData.userInfo.usertypeid),
},
-
+ attached() {
+ // const menu = [];
+ // TabMenu.forEach(v => {
+ // if (app.globalData.userInfo.usertypeid <= v.level) {
+ // menu.push(v);
+ // }
+ // });
+ // this.setData({ list: menu });
+ // const index = [];
+ // TabMenu.forEach((v, i) => {
+ // if (app.globalData.userInfo.usertypeid > v.level) {
+ // index.push(i);
+ // }
+ // });
+ // let offset = 0;
+ // index.forEach(e => {
+ // TabMenu.splice(e + offset, 1);
+ // offset--;
+ // });
+ // this.setData({ list: TabMenu });
+ },
methods: {
onChange(event) {
let index = event.detail.value;
@@ -29,9 +54,7 @@
const page = getCurrentPages().pop();
const route = page ? page.route.split('?')[0] : '';
const active = this.data.list.findIndex(
- item =>
- (item.url.startsWith('/') ? item.url.substr(1) : item.url) ===
- `${route}`,
+ item => (item.url.startsWith('/') ? item.url.substr(1) : item.url) === `${route}`,
);
this.setData({ active });
},
--
Gitblit v1.9.3