From 9846133f322177528546ed0b7be5558010ad9504 Mon Sep 17 00:00:00 2001 From: DCloud_Heavensoft Date: Fri, 3 Nov 2023 18:38:38 +0800 Subject: [PATCH] Update template.uvue --- pages/tabBar/template.uvue | 402 +++++++++++++++++++------------------ 1 file changed, 204 insertions(+), 198 deletions(-) diff --git a/pages/tabBar/template.uvue b/pages/tabBar/template.uvue index deedd693..d5e80dfa 100644 --- a/pages/tabBar/template.uvue +++ b/pages/tabBar/template.uvue @@ -1,90 +1,90 @@ - - - - - + }, + { + id: 'calendar', + url: 'calendar', + name: '日历', + open: false, + pages: [] as Page[], + },{ + id: 'schema', + url: 'schema', + name: '打开外部链接', + open: false, + pages: [] as Page[], + }, + ] as ListItem[], + arrowUpIcon: '/static/icons/arrow-up.png', + arrowDownIcon: '/static/icons/arrow-down.png', + arrowRightIcon: '/static/icons/arrow-right.png', + } + }, + methods: { + triggerCollapse(index: number, item: ListItem) { + if (item.pages.length == 0) { + const page: Page = { + name: item.name, + enable: item.enable, + url: item.url!, + } + this.goDetailPage(page) + return + } + for (var i = 0; i < this.list.length; ++i) { + if (index == i) { + this.list[i].open = !this.list[i].open + } else { + this.list[i].open = false + } + } + }, + goDetailPage(e: Page) { + if (e.enable == false) { + uni.showToast({ + icon: 'none', + title: '暂不支持', + }) + return + } + const url = + e.url.indexOf('platform') > -1 + ? e.url + : `/pages/template/${e.url}/${e.url}` + uni.navigateTo({ + url, + }) + }, + }, +} + + + -- GitLab