|
@@ -1,6 +1,6 @@
|
|
|
// module/article/components/waterfall-card/waterfall-card.ts
|
|
// module/article/components/waterfall-card/waterfall-card.ts
|
|
|
import { HOST } from "../../../../app.config";
|
|
import { HOST } from "../../../../app.config";
|
|
|
-
|
|
|
|
|
|
|
+import { Get } from "../../../../lib/request/method";
|
|
|
Component({
|
|
Component({
|
|
|
properties: {
|
|
properties: {
|
|
|
item: { type: Object, value: {} },
|
|
item: { type: Object, value: {} },
|
|
@@ -9,17 +9,27 @@ Component({
|
|
|
},
|
|
},
|
|
|
data: {},
|
|
data: {},
|
|
|
methods: {
|
|
methods: {
|
|
|
- toInfoPage(event: WechatMiniprogram.TouchEvent) {
|
|
|
|
|
|
|
+ async toInfoPage(event: WechatMiniprogram.TouchEvent) {
|
|
|
const id = event.currentTarget.id;
|
|
const id = event.currentTarget.id;
|
|
|
- const url = `https://${HOST}/admin/editor/preview.html?popularScienceArticleId=${id}`;
|
|
|
|
|
- const item = {
|
|
|
|
|
- url,
|
|
|
|
|
- };
|
|
|
|
|
- wx.navigateTo({
|
|
|
|
|
- url: `/module/article/pages/science-info/science-info`,
|
|
|
|
|
- }).then((res) => {
|
|
|
|
|
- res.eventChannel.emit("load", item);
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ // const url = `https://${HOST}/admin/editor/preview.html?popularScienceArticleId=${id}`;
|
|
|
|
|
+
|
|
|
|
|
+ try {
|
|
|
|
|
+ const res = await Get(`/psarticle/clickPsarticle`, {
|
|
|
|
|
+ params: { popularScienceArticleId: id },
|
|
|
|
|
+ });
|
|
|
|
|
+ const url = res?.data;
|
|
|
|
|
+ const item = {
|
|
|
|
|
+ url,
|
|
|
|
|
+ };
|
|
|
|
|
+ console.log(item, "item",url);
|
|
|
|
|
+ wx.navigateTo({
|
|
|
|
|
+ url: `/module/article/pages/science-info/science-info`,
|
|
|
|
|
+ }).then((res) => {
|
|
|
|
|
+ res.eventChannel.emit("load", item);
|
|
|
|
|
+ });
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ console.log(error);
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
});
|
|
});
|