|
|
@@ -42,6 +42,24 @@
|
|
|
:content="loader.content.value.content"
|
|
|
:tagStyle="commonParserStyle"
|
|
|
/>
|
|
|
+ <text v-if="emptyContent">暂无简介</text>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <!-- 推荐 -->
|
|
|
+ <view v-if="recommendListLoader.content.value?.length" class="d-flex flex-col p-3">
|
|
|
+ <text class="size-base text-bold mb-3">推荐文章</text>
|
|
|
+ <Box2LineImageRightShadow
|
|
|
+ class="w-100"
|
|
|
+ titleColor="title-text"
|
|
|
+ v-for="item in recommendListLoader.content.value"
|
|
|
+ :key="item.id"
|
|
|
+ :image="item.thumbnail || item.image || AppCofig.defaultImage"
|
|
|
+ :title="item.title"
|
|
|
+ :desc="item.desc"
|
|
|
+ :badge="item.badge"
|
|
|
+ :wideImage="true"
|
|
|
+ @click="goDetails(item.id)"
|
|
|
+ />
|
|
|
</view>
|
|
|
|
|
|
<ContentNote />
|
|
|
@@ -74,6 +92,12 @@ import commonParserStyle from "@/common/style/commonParserStyle";
|
|
|
import SimplePageContentLoader from "@/common/components/SimplePageContentLoader.vue";
|
|
|
import ContentNote from "../parts/ContentNote.vue";
|
|
|
import Parse from "@/components/display/parse/Parse.vue";
|
|
|
+import { computed } from "vue";
|
|
|
+import { useSimpleDataLoader } from "@/common/composeabe/SimpleDataLoader";
|
|
|
+import { navTo } from "@/components/utils/PageAction";
|
|
|
+import CommonContent, { GetContentListParams } from "@/api/CommonContent";
|
|
|
+import Box2LineImageRightShadow from "../parts/Box2LineImageRightShadow.vue";
|
|
|
+import AppCofig from "@/common/config/AppCofig";
|
|
|
|
|
|
const loader = useSimplePageContentLoader<
|
|
|
GetContentDetailItem,
|
|
|
@@ -89,7 +113,31 @@ const loader = useSimplePageContentLoader<
|
|
|
|
|
|
const { onPreviewImage } = useSwiperImagePreview(() => loader.content.value?.images || [])
|
|
|
|
|
|
-useLoadQuerys({ id : 0, }, (p) => loader.loadData(p));
|
|
|
+const emptyContent = computed(() => (loader.content.value?.content || '').trim() === '')
|
|
|
+
|
|
|
+const recommendListLoader = useSimpleDataLoader(async () => {
|
|
|
+ if (!querys.value.modelId || !querys.value.mainBodyColumnId)
|
|
|
+ return []
|
|
|
+ return (await CommonContent.getContentList(new GetContentListParams()
|
|
|
+ .setModelId(querys.value.modelId)
|
|
|
+ .setMainBodyColumnId(querys.value.mainBodyColumnId)
|
|
|
+ , 1, 10)).list.filter((p) => p.id !== querys.value.id);
|
|
|
+});
|
|
|
+
|
|
|
+
|
|
|
+function goDetails(id: number) {
|
|
|
+ navTo('/pages/article/details', {
|
|
|
+ id,
|
|
|
+ mainBodyColumnId: querys.value.mainBodyColumnId,
|
|
|
+ modelId: querys.value.modelId
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+const { querys } = useLoadQuerys({
|
|
|
+ id: 0,
|
|
|
+ mainBodyColumnId: 0,
|
|
|
+ modelId: 0,
|
|
|
+}, (t) => loader.loadData(t));
|
|
|
|
|
|
function getPageShareData() {
|
|
|
if (!loader.content.value)
|