Browse Source

feat 链接管理、投票管理控制

yhliu 4 months ago
parent
commit
a767397e23
3 changed files with 19 additions and 5 deletions
  1. 3 1
      config/index.js
  2. 8 2
      pages/tabbar/about/about.vue
  3. 8 2
      pages/tabbar/home/home.vue

+ 3 - 1
config/index.js

@@ -14,11 +14,13 @@ export const DefaultAppConfigs = {
 	authorConfig: {},
 	appConfig: {},
 	pluginConfig: {
+		votePlugin: {},
 		toolsPlugin: {},
+		linksPlugin:{},
 		linksSubmitPlugin: {},
 		doubanPlugin: {
 			position: 'bottom'
-		}
+		},
 	},
 	pageConfig: {
 		homeConfig: {

+ 8 - 2
pages/tabbar/about/about.vue

@@ -165,6 +165,12 @@
 			calcAuditModeEnabled() {
 				return this.haloConfigs.auditConfig.auditModeEnabled
 			},
+      calcVotePluginEnabled() {
+        return !!this.haloConfigs?.pluginConfig?.votePlugin?.enabled;
+      },
+      calcLinksPluginEnabled() {
+        return !!this.haloConfigs?.pluginConfig?.linksPlugin?.enabled;
+      },
 		},
 		watch: {
 			haloConfigs: {
@@ -228,7 +234,7 @@
 						path: '/pagesA/votes/votes',
 						isAdmin: false,
 						type: 'page',
-						show: !this.calcAuditModeEnabled
+						show: !this.calcAuditModeEnabled && !!this.calcVotePluginEnabled,
 					}, {
 						key: 'disclaimers',
 						title: '友情链接',
@@ -238,7 +244,7 @@
 						path: '/pagesA/friend-links/friend-links',
 						isAdmin: false,
 						type: 'page',
-						show: true
+						show: !!this.calcLinksPluginEnabled,
 					},
 					{
 						key: 'disclaimers',

+ 8 - 2
pages/tabbar/home/home.vue

@@ -193,6 +193,12 @@
 				}
 				return this.haloConfigs.pageConfig.homeConfig.useCategory
 			},
+      calcVotePluginEnabled() {
+        return !!this.haloConfigs?.pluginConfig?.votePlugin?.enabled
+      },
+      calcLinksPluginEnabled() {
+        return !!this.haloConfigs?.pluginConfig?.linksPlugin?.enabled;
+      },
 			bannerConfig() {
 				return this.haloConfigs.pageConfig.homeConfig.bannerConfig
 			}
@@ -556,7 +562,7 @@
 					iconColor: '',
 					path: '/pagesA/votes/votes',
 					type: 'page',
-					show: !this.calcAuditModeEnabled
+					show: !this.calcAuditModeEnabled && !!this.calcVotePluginEnabled,
 				}, {
 					key: 'disclaimers',
 					title: '友情链接',
@@ -567,7 +573,7 @@
 					iconColor: '',
 					path: '/pagesA/friend-links/friend-links',
 					type: 'page',
-					show: true
+					show: !!this.calcLinksPluginEnabled,
 				}, {
 					key: 'love',
 					title: '恋爱日记',