1
0
kopia lustrzana https://github.com/ialley-workshop-open/uni-halo.git synced 2026-06-12 13:19:31 +08:00

fix: 修复文章详情评论区按钮显示隐藏问题

This commit is contained in:
小莫唐尼
2024-06-25 12:19:21 +08:00
rodzic fade65397d
commit 85e558f1a0
+38 -22
Wyświetl plik
@@ -128,7 +128,7 @@
<!-- 返回顶部 --> <!-- 返回顶部 -->
<tm-flotbutton :offset="[16, 80]" icon="icon-angle-up" color="bg-gradient-light-blue-accent" <tm-flotbutton :offset="[16, 80]" icon="icon-angle-up" color="bg-gradient-light-blue-accent"
@click="fnToTopPage()"></tm-flotbutton> @click="fnToTopPage()"></tm-flotbutton>
<tm-flotbutton :actions="btnOption.actions" actions-pos="left" :show-text="true" <tm-flotbutton :actions="flotButtonActions" actions-pos="left" :show-text="true"
color="bg-gradient-orange-accent" @change="fnOnFlotButtonChange"></tm-flotbutton> color="bg-gradient-orange-accent" @change="fnOnFlotButtonChange"></tm-flotbutton>
</block> </block>
@@ -156,7 +156,7 @@
</view> </view>
</view> </view>
<block v-else> <block v-else>
<view v-if="commentDetail.list.length == 0" class="poup-empty flex flex-center"> <view v-if="commentDetail.list.length === 0" class="poup-empty flex flex-center">
<tm-empty icon="icon-shiliangzhinengduixiang-" label="没有更多评论啦~"></tm-empty> <tm-empty icon="icon-shiliangzhinengduixiang-" label="没有更多评论啦~"></tm-empty>
</view> </view>
@@ -246,22 +246,8 @@ export default {
return { return {
loading: 'loading', loading: 'loading',
markdownConfig: MarkdownConfig, markdownConfig: MarkdownConfig,
btnOption: {
actions: [ flotButtonActions: [],
// {
// 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'
}
]
},
queryParams: { queryParams: {
name: null name: null
}, },
@@ -299,7 +285,7 @@ export default {
return this.$tm.vx.getters().getConfigs; return this.$tm.vx.getters().getConfigs;
}, },
postDetailConfig() { postDetailConfig() {
return this.$tm.vx.getters().getConfigs.postDetailConfig; return this.haloConfigs.postDetailConfig;
}, },
calcUrl() { calcUrl() {
return url => { 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) { onLoad(e) {
this.fnSetPageTitle('文章加载中...'); this.fnSetPageTitle('文章加载中...');
this.queryParams.name = e.name; this.queryParams.name = e.name;
@@ -398,7 +393,28 @@ export default {
uni.stopPullDownRefresh(); 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) { fnOnFlotButtonChange(index) {
switch (index) { switch (index) {
@@ -406,10 +422,10 @@ export default {
// this.fnDoLikes(); // this.fnDoLikes();
// break; // break;
case 0: case 0:
this.fnToComment(); this.fnShowShare();
break; break;
case 1: case 1:
this.fnShowShare(); this.fnToComment();
break; break;
} }
}, },