Skip to content

Commit 2160478

Browse files
committed
fix:优化没有物品id和成就id的家具不展示百科攻略和评论
1 parent 5d02fd2 commit 2160478

2 files changed

Lines changed: 8 additions & 13 deletions

File tree

src/views/furniture/Single.vue

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@
138138
:type="comment_source_type"
139139
:source-id="String(comment_source_id)"
140140
/>
141-
<Comment v-else-if="id" :key="'furniture-comment-' + id" :id="id" :category="type" order="desc" />
142141
</template>
143142
<template v-else>
144143
<div class="m-pvx__item m-pvx-furniture-robot__header">
@@ -226,10 +225,6 @@
226225
:type="robot_wiki_type"
227226
:is-robot="true"
228227
/>
229-
<div class="m-pvx-furniture-robot__wiki" v-else-if="data && id">
230-
<div class="u-wiki-title">家具攻略<span>(以魔盒在线版本为准)</span></div>
231-
<div class="m-wiki-post-empty is-robot-empty">暂无相关攻略,欢迎热心侠士前往补充。</div>
232-
</div>
233228
</template>
234229
</div>
235230
</template>
@@ -239,7 +234,6 @@ import furnitureSet from "@/components/furniture/furniture_set.vue";
239234
import Wiki from "@/components/wiki/Wiki.vue";
240235
import furnitureMaterials from "@/components/furniture/furniture_materials.vue";
241236
import Fav from "@jx3box/jx3box-ui/src/interact/Fav.vue";
242-
import Comment from "@jx3box/jx3box-ui/src/single/Comment.vue";
243237
import PvxUser from "@/components/PvxUser.vue";
244238
245239
import { getLink, iconLink } from "@jx3box/jx3box-common/js/utils";
@@ -275,7 +269,6 @@ export default {
275269
furnitureSet,
276270
furnitureMaterials,
277271
Fav,
278-
Comment,
279272
PvxUser,
280273
// ListCross,
281274
WikiComments,
@@ -329,7 +322,9 @@ export default {
329322
return `${this.wiki_source_type}-${this.wiki_source_id}`;
330323
},
331324
wiki_title: function () {
332-
return this.wiki_source_type === "achievement" ? "成就攻略" : "家具攻略";
325+
if (this.wiki_source_type === "item") return "物品攻略";
326+
if (this.wiki_source_type === "achievement") return "成就攻略";
327+
return "";
333328
},
334329
wiki_source_title: function () {
335330
return this.wiki_source_type === "achievement" ? this.setData?.szName || this.data?.szName : this.data?.szName;
@@ -350,7 +345,7 @@ export default {
350345
return this.wiki_source_id;
351346
},
352347
robot_wiki_name: function () {
353-
return this.robot_wiki_type === "achievement" ? "成就" : "家具";
348+
return this.robot_wiki_type === "achievement" ? "成就" : "物品";
354349
},
355350
fav_author_id: function () {
356351
return Number(this.data?.user_id || this.data?.author_id || User.getInfo().uid) || "";

src/views/furniture/miniprogram/Single.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@
9999
:type="comment_source_type"
100100
:source-id="String(comment_source_id)"
101101
/>
102-
<Comment v-else-if="id" :key="'furniture-comment-' + id" :id="id" :category="type" order="desc" />
103102
</div>
104103
</template>
105104
<script>
@@ -116,11 +115,10 @@ import { getLink } from "@jx3box/jx3box-common/js/utils";
116115
import { formatFurnitureImg, getFurnitureType } from "@/utils/furniture";
117116
import User from "@jx3box/jx3box-common/js/user";
118117
import { addFav, delFav, hasFav } from "@jx3box/jx3box-ui/service/fav";
119-
import Comment from "@jx3box/jx3box-ui/src/single/Comment.vue";
120118
121119
export default {
122120
name: "FurnitureSingle",
123-
components: { WikiComments, Wiki, SuspendCommon, Comment },
121+
components: { WikiComments, Wiki, SuspendCommon },
124122
inject: ["__imgRoot"],
125123
data() {
126124
return {
@@ -172,7 +170,9 @@ export default {
172170
return `${this.wiki_source_type}-${this.wiki_source_id}`;
173171
},
174172
wiki_title: function () {
175-
return this.wiki_source_type === "achievement" ? "成就攻略" : "家具攻略";
173+
if (this.wiki_source_type === "item") return "物品攻略";
174+
if (this.wiki_source_type === "achievement") return "成就攻略";
175+
return "";
176176
},
177177
wiki_source_title: function () {
178178
return this.wiki_source_type === "achievement" ? this.setData?.szName || this.data?.szName : this.data?.szName;

0 commit comments

Comments
 (0)