| 123456789101112131415161718192021222324252627282930 |
- // module/article/components/science-card/science-card.ts
- import { HOST } from "../../../../app.config";
- Component({
- properties: {
- item: { type: Object, value: {} },
- index: { type: Number, value: 0 },
- replace: { type: Boolean, value: false },
- },
- data: {},
- methods: {
- toInfoPage(event: WechatMiniprogram.TouchEvent) {
- const id = event.currentTarget.id;
- if (this.data.replace) {
- wx.redirectTo({ url: `/module/article/pages/science-info/science-info?id=${id}` });
- } else {
- const url = `https://${HOST}/admin/editor/preview.html?popularScienceArticleId=${id}`;
- const item = {
- url,
- };
- wx.navigateTo({
- url: `/module/article/pages/science-info/science-info?url=${url}`,
- }).then((res) => {
- res.eventChannel.emit("load", item);
- });
- // wx.navigateTo({ url: `/module/article/pages/science-info/science-info?id=${id}` })
- // .then(res => { res.eventChannel.emit('load', this.data.item) })
- }
- }
- }
- })
|