|
@@ -106,7 +106,7 @@
|
|
|
:desc="item.desc"
|
|
:desc="item.desc"
|
|
|
:wideImage="true"
|
|
:wideImage="true"
|
|
|
:tags="(item.bottomTags as string[])"
|
|
:tags="(item.bottomTags as string[])"
|
|
|
- @click="goDetails(item.id)"
|
|
|
|
|
|
|
+ @click="goDetails(item)"
|
|
|
/>
|
|
/>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
@@ -133,11 +133,11 @@ import { FormatUtils, StringUtils, waitTimeOut } from "@imengyu/imengyu-utils";
|
|
|
import { injectAppConfiguration } from "@/api/system/useAppConfiguration";
|
|
import { injectAppConfiguration } from "@/api/system/useAppConfiguration";
|
|
|
import { useSimpleDataLoader } from "@/common/composeabe/SimpleDataLoader";
|
|
import { useSimpleDataLoader } from "@/common/composeabe/SimpleDataLoader";
|
|
|
import { navTo, redirectTo } from "@/components/utils/PageAction";
|
|
import { navTo, redirectTo } from "@/components/utils/PageAction";
|
|
|
-import { resolveCommonContentFormData } from "./common/CommonContent";
|
|
|
|
|
|
|
+import { navCommonDetail, resolveCommonContentFormData } from "./common/CommonContent";
|
|
|
import { injectCommonCategory } from "./data/CommonCategoryGlobalLoader";
|
|
import { injectCommonCategory } from "./data/CommonCategoryGlobalLoader";
|
|
|
import { getIsDevtoolsPlatform } from "@/common/utils/MpVersions";
|
|
import { getIsDevtoolsPlatform } from "@/common/utils/MpVersions";
|
|
|
import { doCallDynamicFunction, doEvaluateDynamicCompareExpression } from "./data/CommonCategoryDynamicEvax";
|
|
import { doCallDynamicFunction, doEvaluateDynamicCompareExpression } from "./data/CommonCategoryDynamicEvax";
|
|
|
-import type { GetContentDetailItem } from "@/api/CommonContent";
|
|
|
|
|
|
|
+import type { GetContentDetailItem, GetContentListItem } from "@/api/CommonContent";
|
|
|
import type { IHomeCommonArticleDetailDefine } from "./data/CommonCategoryDefine";
|
|
import type { IHomeCommonArticleDetailDefine } from "./data/CommonCategoryDefine";
|
|
|
import CommonContent, { GetContentListParams } from "@/api/CommonContent";
|
|
import CommonContent, { GetContentListParams } from "@/api/CommonContent";
|
|
|
import Box2LineImageRightShadow from "../parts/Box2LineImageRightShadow.vue";
|
|
import Box2LineImageRightShadow from "../parts/Box2LineImageRightShadow.vue";
|
|
@@ -216,6 +216,10 @@ export interface CommonArticleDetailProps {
|
|
|
*/
|
|
*/
|
|
|
expression: string,
|
|
expression: string,
|
|
|
}[],
|
|
}[],
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 推荐详情处理函数
|
|
|
|
|
+ */
|
|
|
|
|
+ recommendDetailHandler: string,
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const { querys } = useLoadQuerys({
|
|
const { querys } = useLoadQuerys({
|
|
@@ -261,6 +265,7 @@ const loader = useSimplePageContentLoader<
|
|
|
>(async (params) => {
|
|
>(async (params) => {
|
|
|
if (!params)
|
|
if (!params)
|
|
|
throw new Error("!params");
|
|
throw new Error("!params");
|
|
|
|
|
+ await waitTimeOut(200);
|
|
|
const res = await NewsIndexContent.getContentDetail(params.id);
|
|
const res = await NewsIndexContent.getContentDetail(params.id);
|
|
|
uni.setNavigationBarTitle({ title: res.title });
|
|
uni.setNavigationBarTitle({ title: res.title });
|
|
|
if (querys.value.navToExternalLink === 'auto' && (!res.content || res.content.trim() === '') && res.externalLink) {
|
|
if (querys.value.navToExternalLink === 'auto' && (!res.content || res.content.trim() === '') && res.externalLink) {
|
|
@@ -390,10 +395,21 @@ function goArchive(id: number) {
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-function goDetails(id: number) {
|
|
|
|
|
- navTo('/pages/article/details', {
|
|
|
|
|
- ...querys.value,
|
|
|
|
|
- id,
|
|
|
|
|
|
|
+function goDetails(item: GetContentListItem) {
|
|
|
|
|
+ const script = currentCommonCategoryContentDefine.value?.props.recommendDetailHandler;
|
|
|
|
|
+ if (script) {
|
|
|
|
|
+ doCallDynamicFunction(script, {
|
|
|
|
|
+ sourceData: {
|
|
|
|
|
+ main: item,
|
|
|
|
|
+ customData: {},
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ navCommonDetail({
|
|
|
|
|
+ id: item.id,
|
|
|
|
|
+ mainBodyColumnId: item.mainBodyColumnId,
|
|
|
|
|
+ modelId: item.modelId,
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
function goBorrow(title: string) {
|
|
function goBorrow(title: string) {
|
|
@@ -416,9 +432,13 @@ async function loadPageConfig() {
|
|
|
await waitTimeOut(500);
|
|
await waitTimeOut(500);
|
|
|
}
|
|
}
|
|
|
const pageConfigName = 'common-details';
|
|
const pageConfigName = 'common-details';
|
|
|
- const currentCommonCategoryDefine = commonCategory.value.page
|
|
|
|
|
|
|
+ let currentCommonCategoryDefine = commonCategory.value.page
|
|
|
.find((item) => item.name === pageConfigName);
|
|
.find((item) => item.name === pageConfigName);
|
|
|
if (!currentCommonCategoryDefine) {
|
|
if (!currentCommonCategoryDefine) {
|
|
|
|
|
+ await waitTimeOut(1000);
|
|
|
|
|
+ currentCommonCategoryDefine = commonCategory.value.page.find((item) => item.name === pageConfigName);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!currentCommonCategoryDefine) {
|
|
|
errorMessage.value = '未找到指定的分类配置:' + pageConfigName;
|
|
errorMessage.value = '未找到指定的分类配置:' + pageConfigName;
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|