From 85e558f1a059e014a2c4d0d70bfd3b2c9d71cb5f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=B0=8F=E8=8E=AB=E5=94=90=E5=B0=BC?= <1431128779@qq.com>
Date: Tue, 25 Jun 2024 12:19:21 +0800
Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=96=87=E7=AB=A0?=
=?UTF-8?q?=E8=AF=A6=E6=83=85=E8=AF=84=E8=AE=BA=E5=8C=BA=E6=8C=89=E9=92=AE?=
=?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=9A=90=E8=97=8F=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pagesA/article-detail/article-detail.vue | 60 +++++++++++++++---------
1 file changed, 38 insertions(+), 22 deletions(-)
diff --git a/pagesA/article-detail/article-detail.vue b/pagesA/article-detail/article-detail.vue
index 3555383..9adbe8b 100644
--- a/pagesA/article-detail/article-detail.vue
+++ b/pagesA/article-detail/article-detail.vue
@@ -128,7 +128,7 @@
-
@@ -156,7 +156,7 @@
-
+
@@ -246,22 +246,8 @@ export default {
return {
loading: 'loading',
markdownConfig: MarkdownConfig,
- btnOption: {
- actions: [
- // {
- // icon: 'icon-like',
- // color: 'bg-gradient-orange-accent'
- // },
- {
- icon: 'icon-commentdots-fill',
- color: 'bg-gradient-green-accent'
- },
- {
- icon: 'icon-share1',
- color: 'bg-gradient-blue-accent'
- }
- ]
- },
+
+ flotButtonActions: [],
queryParams: {
name: null
},
@@ -299,7 +285,7 @@ export default {
return this.$tm.vx.getters().getConfigs;
},
postDetailConfig() {
- return this.$tm.vx.getters().getConfigs.postDetailConfig;
+ return this.haloConfigs.postDetailConfig;
},
calcUrl() {
return url => {
@@ -325,7 +311,16 @@ export default {
}
},
},
- watch: {},
+ watch: {
+ haloConfigs: {
+ deep: true,
+ immediate: true,
+ handler: (newVal) => {
+ if (!newVal) return;
+ this.fnHandleSetFlotButtonItems(newVal);
+ }
+ }
+ },
onLoad(e) {
this.fnSetPageTitle('文章加载中...');
this.queryParams.name = e.name;
@@ -398,7 +393,28 @@ export default {
uni.stopPullDownRefresh();
});
},
+ fnHandleSetFlotButtonItems(configs) {
+ const actions = [
+ {
+ icon: 'icon-share1',
+ color: 'bg-gradient-blue-accent',
+ use: true,
+ },
+ {
+ icon: 'icon-like',
+ color: 'bg-gradient-orange-accent',
+ use: false,
+ },
+ {
+ icon: 'icon-commentdots-fill',
+ color: 'bg-gradient-green-accent',
+ use: configs?.basicConfig?.postDetailConfig?.showComment
+ }
+ ]
+
+ this.flotButtonActions = actions.filter(x => x.use === true)
+ },
// 浮动按钮点击
fnOnFlotButtonChange(index) {
switch (index) {
@@ -406,10 +422,10 @@ export default {
// this.fnDoLikes();
// break;
case 0:
- this.fnToComment();
+ this.fnShowShare();
break;
case 1:
- this.fnShowShare();
+ this.fnToComment();
break;
}
},