index.vue 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <template>
  2. <view>
  3. <view class="list">
  4. <view class="li" v-for="(item,index) in pageList" :key="index" @click="jumpUrl('/leaflet/detail/index?code=' + item.code)">
  5. <image :src="item.pic" mode="aspectFill"></image>
  6. <view class="info">
  7. <view class="title">{{item.title}}</view>
  8. <view class="person">已报名<text>{{item.submitCount}}</text>人</view>
  9. </view>
  10. </view>
  11. </view>
  12. </view>
  13. </template>
  14. <script>
  15. const app = getApp();
  16. const req = require("../../utils/request.js");
  17. export default {
  18. data() {
  19. return {
  20. form: {
  21. page: 1,
  22. limit: 10
  23. },
  24. pageList: [],
  25. isLoad: true,
  26. hasmore: true,
  27. };
  28. },
  29. onLoad: function(options) {
  30. this.getList();
  31. },
  32. onReachBottom: function() {
  33. this.form.page++
  34. this.getList()
  35. },
  36. methods: {
  37. getList() {
  38. let that = this;
  39. if (!that.isLoad) return false;
  40. that.isLoad = false;
  41. let form = that.form
  42. form.rootCode = 'brochure'
  43. req.getRequest('/api/v3/material/library', form, data => {
  44. if (data&&data.list && data.list.length >= 10) that.isLoad = true;
  45. if (that.page > 1) data.list = that.pageList.concat(data.list);
  46. that.pageList = data.list
  47. });
  48. },
  49. jumpUrl(url){
  50. uni.navigateTo({
  51. url: url
  52. })
  53. }
  54. }
  55. };
  56. </script>
  57. <style>
  58. @import "./index.css"
  59. </style>