index.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <template>
  2. <view class="meeting-info-container">
  3. <view class="u-page">
  4. <item-list :ds="indexList" :onItemClick="onContentClick" />
  5. </view>
  6. </view>
  7. </template>
  8. <script>
  9. import { fetchContentInfo } from '@/common/api';
  10. import { CONTENT_TYPE } from '@/common/EnumConst';
  11. import ItemList from '@/components/ItemList/index.vue';
  12. import { getImageUrl } from '@/util';
  13. export default {
  14. components: {
  15. ItemList,
  16. },
  17. data() {
  18. return {
  19. keyword: '',
  20. indexList: [],
  21. };
  22. },
  23. onLoad() {
  24. this.loadmore();
  25. },
  26. methods: {
  27. onContentClick(item) {
  28. uni.navigateTo({
  29. url: `/pasb/pages/detail/index?id=${item.id}`,
  30. });
  31. },
  32. async loadmore(keyword = '') {
  33. const res = await fetchContentInfo({
  34. pageNum: 1,
  35. pageSize: 99,
  36. contentType: CONTENT_TYPE.conference,
  37. title: keyword,
  38. });
  39. this.indexList = res.rows.map(item => {
  40. return {
  41. id: item.id,
  42. imgUrl: getImageUrl(item.thumbnail),
  43. title: item.title,
  44. date: item.createTime,
  45. };
  46. });
  47. },
  48. onSearch(val) {
  49. this.loadmore(val);
  50. },
  51. },
  52. onShareAppMessage() {
  53. return {
  54. title: 'First UI组件库',
  55. };
  56. },
  57. };
  58. </script>
  59. <style lang="scss" src="./index.scss">
  60. </style>