downlist.vue 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <template>
  2. <view>
  3. <view class="cl-one">
  4. <video-list flag="4" :list="list"></video-list>
  5. </view>
  6. </view>
  7. </template>
  8. <script>
  9. import videoList from '@/pages/index/components/wordlist.vue';
  10. export default {
  11. components: {
  12. videoList
  13. },
  14. data() {
  15. return {
  16. list: [],
  17. status:'loadmore',
  18. page:1,
  19. pagenum:10,
  20. };
  21. },
  22. onPullDownRefresh() {
  23. this.page=1;
  24. this.list=[];
  25. this.getInfoList();
  26. setTimeout(res => {
  27. uni.stopPullDownRefresh();
  28. }, 1000);
  29. },
  30. onReachBottom() {
  31. if (this.status == 'nomore') return;
  32. this.status = 'loadmore';
  33. this.page = ++this.page;
  34. this.getInfoList();
  35. },
  36. onLoad(options) {
  37. this.video_id=options.video_id;
  38. this.getInfoList();
  39. },
  40. methods: {
  41. getInfoList() {
  42. let url = 'new_cate/getVideoFiles';
  43. this.$api
  44. .request(url, {
  45. video_id:this.video_id,
  46. page: this.page,
  47. limit: this.pagenum
  48. })
  49. .then(data => {
  50. if (data.code == '200') {
  51. this.list = this.list.concat(data.data);
  52. if (data.data.length < this.pagnum) {
  53. this.status = 'nomore';
  54. }
  55. } else {
  56. this.$api.toast(data.msg);
  57. }
  58. });
  59. },
  60. }
  61. };
  62. </script>
  63. <style lang="scss" scoped>
  64. .cl-one{
  65. background-color: #fff;
  66. padding: 0 30rpx;
  67. }
  68. </style>