|
|
@@ -3,6 +3,7 @@ import tickleBehavior, {
|
|
|
getTickleContext,
|
|
|
} from "../../../../core/behavior/tickle.behavior";
|
|
|
import { getFootPrintListMethod } from "../../request";
|
|
|
+import { Get } from "../../../../lib/request/method";
|
|
|
Page({
|
|
|
behaviors: [PageContainerBehavior, tickleBehavior],
|
|
|
lifetimes: {
|
|
|
@@ -10,19 +11,30 @@ Page({
|
|
|
},
|
|
|
properties: {},
|
|
|
data: {
|
|
|
- articleList: [],
|
|
|
+ articleList: [] as any[],
|
|
|
},
|
|
|
- goDetail(e: any) {
|
|
|
+ async goDetail(e: any) {
|
|
|
const type = e.currentTarget.dataset.type;
|
|
|
const item = e.currentTarget.dataset.item;
|
|
|
- // type 1 中医科普 2 药膳 4 茶饮
|
|
|
+ // type ,1-健康宣教 2-药膳 3-膳食 4-茶饮
|
|
|
// 药膳详情
|
|
|
if (type === "1") {
|
|
|
- wx.navigateTo({
|
|
|
- url: `/module/article/pages/science-info/science-info?id=${item.sourceId}`,
|
|
|
- }).then((res) => {
|
|
|
- res.eventChannel.emit("load", item);
|
|
|
- });
|
|
|
+ try {
|
|
|
+ const res: any = await Get(`/psarticle/clickPsarticle`, {
|
|
|
+ params: { popularScienceArticleId: item.sourceId },
|
|
|
+ });
|
|
|
+ const url = res?.data;
|
|
|
+ const detailPayload = {
|
|
|
+ url,
|
|
|
+ };
|
|
|
+ wx.navigateTo({
|
|
|
+ url: `/module/article/pages/science-info/science-info`,
|
|
|
+ }).then((res) => {
|
|
|
+ res.eventChannel.emit("load", detailPayload);
|
|
|
+ });
|
|
|
+ } catch (error) {
|
|
|
+ console.log(error);
|
|
|
+ }
|
|
|
} else if (type === "2" || type === "4") {
|
|
|
wx.navigateTo({
|
|
|
url: `/module/article/pages/diet-info/diet-info?id=${item.sourceId}`,
|