waterfall-card.ts 705 B

12345678910111213141516171819202122232425
  1. // module/article/components/waterfall-card/waterfall-card.ts
  2. import { HOST } from "../../../../app.config";
  3. Component({
  4. properties: {
  5. item: { type: Object, value: {} },
  6. index: { type: Number, value: 0 },
  7. replace: { type: Boolean, value: false },
  8. },
  9. data: {},
  10. methods: {
  11. toInfoPage(event: WechatMiniprogram.TouchEvent) {
  12. const id = event.currentTarget.id;
  13. const url = `https://${HOST}/admin/editor/preview.html?popularScienceArticleId=${id}`;
  14. const item = {
  15. url,
  16. };
  17. wx.navigateTo({
  18. url: `/module/article/pages/science-info/science-info`,
  19. }).then((res) => {
  20. res.eventChannel.emit("load", item);
  21. });
  22. },
  23. },
  24. });